Posts

Showing posts from February, 2011

css - Add active class to element according to URL Jquery Django -

how can add "active" class element according href i have django template this: <div class="panel side-panel-1 category"> <h4 class="title1">Разделы</h4> <ul class="clear-list"> {% section in sections %} <li> <a href="/advert/adverts.aspx&sec{{ section.id }}">{{ section.name }} ({{ section.advert_set.count }})</a> </li> {% endfor %} </ul> so urls formed section.id example: mysite.com/advert/adverts.aspx&sec1 in cases be: mysite.com/advert/adverts.aspx&sec1&cat10&page1 maybe want this. use class="{{ section.id ? 'active' : '' }}" . if section.id exists, active wile add. <div class="panel side-panel-1 category"> <h4 class="title1">Разделы</h4> <ul class="clear-list"> {% section in sections %} <li class="{{ section.id ? 'a...

Is is possible to get keywords used to land on my Google play page? -

is possible keywords user uses land on google play page. have linked google analytics , google play page, still not able this. on website, data using google analytics. wondering why google aint providing on play store. i realise question posted earlier - google analytics google play app page . pretty old post(2012). wondering if google has come solution recently. it appears still isn't possible. the answer provided stefan link still seems hold true: you don't have direct access source code of app page there no way include necessary js [to track keywords] the closest might (and may terrible idea since may divert clicks google play storefront) create landing page outside of google play, capture search keywords there ga + webmaster tools, , extrapolate.

sql server - CASE expression for two unique values being compared to another table -

using sql-server 2008 / t-sql background: my query seeks compare codes assigned across 2 versions (highest value vs next highest). versions assigned same id (i.e. versions of id). however, final piece in jigsaw (where struggling) see if code assigned version of same id other previous version. way dataset built (through use of temp tables) previous version never have same code current version. table 1: id | curver | curcode | prevver | prevcode | ------------------------ 1 | 4 | 1234 | 3 | 4321 basically, although 1234 assigned version 4 not 3, want run yes/no or 1/0 checker on table, table 2, see if assigned versions 1 or 2 of same id . table 2: id | ver | code ------------------------ 1 | 1 | 1234 1 | 2 | 4321 1 | 3 | 4321 1 | 4 | 1234 so, want join table 2 table 1 , introduce column table 1 gives '1' if code assigned versions not curver in table 2. my query goes this: select d...

java - Why is one TimerTask slowing down another? -

i have got timer task, updates player positions: public void run(){ {updatewatcher = new timertask() { public void run() { update(0.1); } }; t.scheduleatfixedrate(updatewatcher, 5, 5);} and have timertask right under one, updates projectile positions: updatewatcher = new timertask() { //different variable. note capital u. public void run() { (bullet b : bullets){ b.update(); } } }; t.scheduleatfixedrate(updatewatcher, 5, 5); } however, second timertask slowing down first one. if delete iteration, this: updatewatcher = new timertask() { public void run() { } }; t.scheduleatfixedrate(updatewatcher, 5, 5); } the player moves @ correct speed. however, re-add code (using eclipse de-bugging add live), delayed task executes lot less often, causing players moving more 10 times slower usual. what causing this, , how fix it?

bash - Why extglob except breaking except condition? -

i run in debian 8.1, gnu bash, version 4.3.30(1)-release (x86_64-pc-linux-gnu) , lenovo g50-30 500 gb ssd , 8 gb flash memory: shopt -s extglob cp -r !(backups.backupdb/) /home/masi/documents/ but copy directory backups.backupdb/ , confirmed @ end of copying. messages during copying process after 2h copying cp: cannot stat ‘backups.backupdb/masi\’s macbook air/2015-06-25-233115/macintosh hd/system/library/image capture/automatic tasks/makepdf.app/contents/resources/ko.lproj/3x5로 자르기.mkpdf’: no such file or directory cp: cannot stat ‘backups.backupdb/masi\’s macbook air/2015-06-25-233115/macintosh hd/system/library/image capture/automatic tasks/makepdf.app/contents/resources/ko.lproj/3x5에 맞추기.mkpdf’: no such file or directory ... cp: cannot stat ‘camera uploads/2015-06-29 11.51.36.jpg’: invalid argument cp: cannot stat ‘camera uploads/2015-06-29 11.51.53.jpg’: invalid argument cp: cannot stat ‘camera uploads/icon\r’: invalid argument cp: cannot stat ‘cancer’: invalid argum...

javascript - Can someone tell me how to make an image inside a canvas move? -

can tell me how make image on canvas move? in previous version of game made image div moved fine can't figure out. making me write more please ignore part: //this variable image want move var blinky = { x: 0, y: 0 }; //this makes image appear when page loaded var byready = false; var byimage = new image(); byimage.onload = function(){ byready = true; }; byimage.src = "blinky.jpg" //this puts images on canvas var render = function(){ if(bgready){ ctx.drawimage(bgimage,0,0); } if(hrready){ ctx.drawimage(hrimage,hero.x, hero.y); } if(emready){ ctx.drawimage(emimage,monster.x, monster.y); } if(byready){ ctx.drawimage(byimage,blinky.x,blinky.y); } //this moves div around screen randomly $(document).ready(function(){ animatediv(); }); function makenewposition(){ // viewport dimensions (remove dimension of div) var h = $(window).height() - 30; var w = $(window)....

jquery mobile - JQM: Adding click function to a button AFTER Page load via Ajax -

html: <div data-role="page" id="main"> <a href="#" id="menubtn" class="ui-btn">menu</a> <script>$(document).on("pageshow", menu);</script> </div> js: function menu() { $('#menubtn').on('click', function () { ... }); alert("menu"); } does work first pageload, after clicking link jqm loads link via ajax... menu() called, alert viewable... no click event added link any ideas?

ruby on rails - RSpec: Can't seem to stub ActiveRecord::QueryMethods#select -

i'm trying write test computes average of many db records without overhead of reading/writing db. here method: class average::route def self.daily_flight_count route.active.map |r| times = r.flights.select('distinct depart_time').count (times / 7.0).round end.average end end the method gets number of unique depart times per day routes , averages average route's daily flight count. i'm setting test so: require 'rails_helper' describe average::route describe '.daily_flight_count' 'returns average daily flight count of routes' flights1 = (1..7).inject([]) |arr, n| arr << double(flight, depart_time: time.now + n.days) end flights2 = (1..7).inject([]) |arr, n| arr << double(flight, depart_time: time.now + n.days) arr << double(flight, depart_time: time.now + n.days) end r1 = double(route, flights: flights1) r2 = double(route...

java - how to do something while you are waiting a Thread.join() -

i'm trying while thread waiting join() method want change name of button while waiting it's not working... , don't know why here's awful code: if( e.getsource()==botonfiltro ){ double [] datosfiltro2 = { (double.parsedouble(montotextfield.gettext())),//0monto (double.parsedouble(txtporcentaje.gettext())/100),//1porcentaje (double.parsedouble(txtprecio.gettext())),//2precio (double.parsedouble(txtrango.gettext())/100),//3rango (double.parsedouble(txtpmasduro.gettext())/100)//4pmasduro }; double [] datosfiltro1= {}; botonfiltro.settext("filtrando"); hilolanzarfiltro hilo = new hilolanzarfiltro(programa, datosfiltro1, datosfiltro2); thread tfiltrando = new thread(hilo); tfiltrando.start(); try { // while(tfiltrando.isalive()){ // ...

angularjs - Angular with Typescript and undefined injected service in directive -

i'm trying access services directive seem undefined no matter do. mydirective.factory() says undefined when initializing directive. undefined (not surprisingly) in constructor. i've tried similiar these instructions no avail: http://blog.aaronholmes.net/writing-angularjs-directives-as-typescript-classes/ http://sirarsalih.com/2014/08/04/proper-dependency-injection-in-your-angularjs-typescript-apps/ define angularjs directive using typescript , $inject mechanism here's app.ts: angular.module("footest", []) .service("myservice", foo.myservice) .directive("mydirective", foo.mydirective.factory()); mydirective.ts: module foo { 'use strict'; export class mydirective implements ng.idirective { private myservice: any; //static $inject = ['myservice']; constructor(service: myservice) { this.myservice = service; } restrict = "e"; replace = true; template = "...

stored procedures - Value can't be assigned to a host variable because it's not in range data type -

create procedure administ.student_custom_procedure1 ( in p_id integer, in p_maths integer, in p_science integer, out p_obtain_marks integer, out p_percentage decimal(3,2), out p_status char(4) ) p1: begin declare p_total integer; set p_total = 200; set p_obtain_marks = p_maths + p_science; set p_percentage = ((p_obtain_marks * 100)/p_total); if (p_percentage > 35) set p_status = 'pass'; else set p_status = 'fail'; end if; insert administ.student_result values(p_id, p_maths, p_science, p_obtain_marks, p_percentage, p_status); end p1 i got error code: sqlcode=-304, sqlstate=22003 the dec/decimal data type different assumed. data type information can found in db2 manual under create table : "decimal(precision-integer, scale-integer) or dec(precision-integer, scale-integer) decimal number. first integer precision of number; is, to...

java - Find MongoDB records where status is a, b or c and it has some array which is greater than 0 -

i struggling build query 1 of criteria, have documents this: [ { "status": "a" }, { "status": "b" }, { "status": "foo" }, { "status": "a", "flightdetails": [ { "test": "xyz" } ] } ] my criteria select this: get data status either a , b or c , or get data status either a , b or c , flightdetails , size > 0 where not documents contains flightdetails key. i tried java code this: basicdbobject inquery = new basicdbobject(); inquery.append("status", new basicdbobject("$nin", arrays.aslist("a", "b", "c"))); basicdbobject inquery2 = new basicdbobject(); inquery2.append("$where", "return object.keys( this.flightdetails").length > 0"); basicdblist criteria = new basicdblist(); criteria.add(inquery); criteria.add(inquery2); ...

How to load python modules in Rstudio instance -

Image
reproducible example. from bash try: $ r > library(rpython) > python.exec("help('modules')") i loads, e.g. blaze itertools scipy blz itsdangerous see now try same in rstudio: > library(rpython) > python.exec("help('modules')") crash! update i've tried on rstudio 0.99.451 (old dev version) , 0.99.467 (current latest - https://www.rstudio.com/products/rstudio/download/ ).

php - Mulit select widget post large data in form -

i using xmultiselects widget post large data in form.(yii framework) <div class="row"> <?php echo $form->labelex($model, 'list'); ?> <div style="display: inline-block"> <?php $this->widget('multiselects.xmultiselects', array( 'id' => 'hd-programs', //since there multiple selector pairs on page need set identifier 'lefttitle' => 'available', 'leftname' => 'availablelist', 'leftlist' => $availablelist, 'righttitle' => 'selected', 'rightname' => get_class($model) . '[list][]', 'rightlist' => $list, 'size' => 15, 'width' => '350px', )); ?> <?php echo $form->error($model, 'list'); ?> </div> where $avaliablelist large data set. now when print value of...

php - How to insert a single row to a Wordpress database table? -

Image
intro: i have function handles contact form variables in website. user enters name, email , text. function.php gets variables using javascript. i more information on user on way - ip, country, utm tags if any, ect. then added code part saves variables respectively on sql table. i created table 'wp_contact_form' using phpmyadmin. used code part in function: global $wpdb; $wpdb->insert( 'wp_contact_form', array( 'con_ip' => $_cookie['ip'], 'con_name' => $fullname, 'con_email' => $email, 'con_text' => $message, 'con_country' => $_cookie['country'], 'con_reigon' => $_cookie['region'], 'con_city' => $_cookie['city'], 'con_utm_source' => $_cookie['utm_source'], 'con_utm_medium' =...

php - Fatal error: Class 'AppController' not found error -

can tell me might source of error. have tried solutions found online no avail. installed cakephp framework , getting error on index.cpt page... error: fatal error: class 'appcontroller' not found in [mypath] on line 2 <?php class homecontroller extends appcontroller { function index() { //nothing's here } } ?> the above code...homecontroller.php , appcontroller.php on same folder this solved problem after many searching <?php namespace app\controller; use app\controller\appcontroller; class homecontroller extends appcontroller { public function index() { } }

javascript - File.Transfer in cordova Cannot read property 'lengthComputable' of undefined -

i need download 1 file , i following error, cannot read property 'lengthcomputable' of undefined - error filetransfer.js this code document.addeventlistener("deviceready", ondeviceready, false); // device apis available // function ondeviceready() { // retrieve image file location specified source var filetransfer = new filetransfer(); var uri = encodeuri("https://www.yyy.com/aspl.bak"); var filepath = "oa.apk"; filetransfer.download( uri, filepath, function (entry) { console.log("download complete: " + entry.fullpath); }, function (error) { console.log("download error source " + error.source); console.log("download error target " + error.target); console.log("...

php - SQL Upvote Downvote system -

i working on forum posts need have upvote/downvote system. my current sql(phpmyadmin) structure this: table 1 (posts) | post_id | post_title | post_score | table 2 (pvotes) | pvote_id | fk_post_id | fk_user_id | pvote_score | i want somehow make post_score (in table 1), find pvote_score (table 2) columns , add/subtract them together, fk_post_id (table 2) = post_id (table 1) this way hope make voting system allows every user vote once, , automatically calculate posts post_score pvote_score values. example : user_1 upvotes post_1 inserting following table 2: | (pvote_id) 1 | (fk_post_id) 1 | (fk_user_id) 1 | (pvote_score) 1 | i want post_score (table 1) find entries in table 2 where: fk_post_id same post_id, , thereafter add or subtract values pvote_score , make sum new value of post_score. i trying make work stackoverflows own upvote/downvote system. edit 1 : question: i want know how can make post_score column automatically add/subtract values pvotes_score , ...

ios - Two UIViews & one UICollectionView inside UIScrollView (or better approach) -

i need have ios app screen this: screen the idea when user start scroll down first uiview move until second uiview reach top stick , uicollectionview continue move up. currently i'm using structure uiscrollview (main scroll) uiview (some banners) uiview (uisegmentedcontrol) uicollectionview (grid items, scroll disabled, main scroll used) i manage it, needed set uicollectionview height constraint manually in code (calculated based on items in grid) in order appear in uiscrollview (everything else handled autolayout in storyboard). problem uicollectionview think cells visible , load them, whole recycling & reusing thing not work. it's worst because use willdisplaycell method on uicollectionview load more data when last cell displayed, load pages @ once. my question (actually 2) how can fix issue above? what right way achieve functionality? maybe whole approach conceptually wrong? collection view scroll view itself. maybe have same function...

Where I can find a table of pairs of colors (primary and accent) for Material Design? -

Image
i noticed google uses standard pair of colors (main , accent). example, indigo-500 , pink-a200; pink-500 , yellow-a200 , on. there table of pairs of colors? the colors listed on angular material site, , should correspond asking. angular material theme introduction , color lists . also, material design lite site has color selection wheel.

typescript - Import module and use it in view -

in asp.net 5 project visual studio 2015, use typescript classes knockout generate our javascript files. use amd , es5. assume have first class : actionviewmodel.ts export class actionviewmodel { public id: knockoutobservable<number>; ... } and class implements actionviewmodel in typescript file. action.ts import { actionviewmodel } 'actionviewmodel'; class actionvm extends actionviewmodel { ... } class actionviewmodelmanager { private actionviewmodel: actionvm; ... } actionviewmodelmanager used manage viewmodel. load first viewmodel import keyword. the problem the javascript file generated use define() method load actionviewmodel.ts file. define(["require", "exports", 'actionviewmodel'], function (require, exports, actionviewmodel) { var actionvm = (function (_super) { } var actionviewmodelmanager = (function () { function actionviewmodelmanager(withvalidationr...

winforms - How to Count Checked CheckBoxes count in DataGridView in WindowsForms Application -

i have datagridview.in checkbox column there.if want check check box in datagrid view 1 button visible if no checkbox selected button enabled , if selected more 5 checkboxes 1 caution appered tryed private void gridview1_cellclick(object sender, datagridviewcelleventargs e) { datagridviewcheckboxcell ch1 = new datagridviewcheckboxcell(); ch1 = (datagridviewcheckboxcell)gridview1.rows[gridview1.currentrow.index].cells[0]; if (ch1.value == null) { btnshow.visible = false; } else btnshow.visible = true; } here did not exact out put.how can solve pls help... use cellcontentclick instead of cellclick . checkbox value triggered change in former. use currentcell instead of current row cells[0] , otherwise you're unnecessarily triggering code if clicked in different cell checkboxcell in same row. if checkboxcell clicked (checked/unchecked), iterate through rows count number o...

python - How to use sphinx with flask? -

the documentation of project relies on sphinx generated autodoc. purpose of project provide prediction service. i wrap service flask. , can accessed through endpoint localhost:5000/predict?... i want integrate documentation flask, can accessed through endpoint in same application object like localhost:5000/doc how achieve elegantly ? sphinx-doc generated files static, have send statically. following send_file documentation, like: @app.route('/docs', defaults={'filename': 'index.html'}) @app.route('/docs/<path:filename>') def documentation(filename): return flask.send_from_directory( app.config['upload_folder'], filename )

javascript - AngularJS : calling a factory method within the loop -

i have factory method looks below: angular.module('gridsamplesapp') .factory('registerpostfactory', function($resource, $q, webrequest) { var getmessage = function(upddata, token, dataurl) { var deferred = $q.defer(); var settings = { data: upddata, headers: { 'content-type': 'application/json', 'x-csrf-token' : token }, method: 'post', url: dataurl, withcredentials: true }; webrequest.requestraw(settings).then( function(response) { // data app sec var msg = response; deferred.resolve(msg); }, function(error) { console.log('error retrieving message', error); deferred.reject('error retrieving message', error); }); return deferred.promise; }; return { getmessage: getmessage...

replace - How to modify standard commands in PHP -

is possible modify standard commands in php? use ' {{ ', instance, instead of ' echo '. in practice use ' echo " ' , ' "; ' often, print whole string. example: echo " <div class='someclass'> <table id='sometable'> <tr> <td> hello </td> <td> world </td> </tr> </table> </div> "; as me it's more convenient , code looks more readable ever when use ' echo ' every new line. possible make more pretty, in laravel framework, example. {{ <div class='someclass'> <table id='sometable'> <tr> <td> hello </td> <td> world </td> </tr> </table> </div> }} i tried difine constant: define ('{{', 'echo "'); define ('}}', '";'); but did not work. replacing code using str_replace in 1...

image - Trying to generate 3D bumpmap text in PHP -

Image
i have website monetize numerous original pictures on it, want people visit website see original pictures , have search engines show pictures transparent watermarks. the following example of mean transparent watermark. except of course, replace "test!" company name. here's php code created far: <?php $txt = "test!"; header( "content-type: image/jpeg", true ); $w = imagefontwidth(5) * ( strlen( $txt ) + 1 ); $h = imagefontheight(5) * 2; $i2 = imagecreatetruecolor( $w,$h ); imagesavealpha( $i2, true ); imagealphablending( $i2, false ); imagefill( $i2, 0, 0, imagecolorallocatealpha( $i2, 255, 255, 255, 127 ) ); imagestring( $i2, 3, 10, 10, $txt, imagecolorallocate( $i2, 255, 0, 0) ); $i = imagecreatefromjpeg( "someimage.jpg" ); imagecopyresized( $i, $i2, 2, 2, 0, 0, $w * 5, $h * 7, $w, $h ); imagejpeg( $i, null, 100 ); imagedestroy( $i ); imagedestroy( $i2 ); ?> $i2 resource variable image box in added text, , $i1 large...

c++ - MFC - How to draw pixel waves inside a rectangle -

i new mfc trying learn scratch. i trying create small dialog based application in vs2012 - mfc. on dialog window have drawn rectangle (in onpaint event) this. cpaintdc dc(this); crect background1(10,10,208,92); dc.rectangle(10,10,208,92); then filled bacground color. this. cbrush brush1; brush1.createsolidbrush(rgb(2,3,4)); dc.fillrect(background1,&brush1); now wanted draw waves in form of pixels continuously inside rectangle. as of have done is, bool top = false; for(i=10,j=92;i<200 && j>10;) { pdc->setpixel(i,j,newcolor); sleep(10); if(!top) j-=1; else j+=1; if(j%4==0) { i+=1; } if(j==12) top=true; if(j==90) top = false; } i drawing pixels straightaway on window, within dimensions rectangle lies. , waves stop reaches right dimension of rect. feel thats not right way it. i want draw wave...

asp.net mvc - MVC5 Web Application Scaffold - Account/Logoff - Why use HTTP Post? -

i trying head around mvc 5 web application template, , noticed special attention given security around logoff link. in scaffold template "logoff" link in _loginpartial.cshtml view sits inside html form antiforgerytoken in it, , defined js call form's submit action, so: @if (request.isauthenticated) { using (html.beginform("logoff", "account", formmethod.post, new { id = "logoutform", @class = "navbar-right" })) { @html.antiforgerytoken() <ul class="nav navbar-nav navbar-right"> <li> @html.actionlink("hello " + user.identity.getusername() + "!", "index", "manage", routevalues: null, htmlattributes: new { title = "manage" }) </li> <li><a href="javascript:document.getelementbyid('logoutform').submit()">log off</a></li> </ul> } } with correspo...

visual studio 2012 - SSRS, chart Title.... can I format part of title differently (color, style). Use \x00B0C chars -

i'm trying , learning how make chart title meet specs, need bold words in title, put diff color words, use special html chars it.... learned in hard way can't (note chart title works differently text in ssrs text box). do think it's still possible? let in title? chart title in bold , text red color, degree sign \x00bo..... report kinda of dashboard style, has chart that's it, nothing else permited, no headers, no tablix.. i found greate resource here http://support2.dundas.com/forum/tm.aspx?m=3028&mpage=1&key=&#3039 , it's didn't me in chart title. tx m if else has problem, can add more 1 title chart , format them differently. if need big bold title smaller summary/descriptive line underneath require 2 independently formatted titles.

c# - Add Message Inspector to WCF service in code rather that config file -

i working through example microsoft training kit (wcf). entails adding message inspection service. i have far create inspection implementation class, message behavior class , message behavior class extension. instead of adding behavior through config file add in service host file. below implementation classes... public class messagetrace : idispatchmessageinspector { private message tracemessage(messagebuffer buffer) { message msg = buffer.createmessage(); stringbuilder sb = new stringbuilder("message content"); sb.append(msg.tostring()); console.writeline(sb.tostring()); return buffer.createmessage(); } public object afterreceiverequest(ref message request, iclientchannel channel, instancecontext instancecontext) { request = tracemessage(request.createbufferedcopy(int32.maxvalue)); return null; } public void beforesendre...

Jquery ajax - ignore non-json data in response -

i have message form has work both javascript , without. with js woudl send data ajax. php woudl returning status info (success/failure) encoded in json. without js form works regular form, except needs status messages returned in plaintext (no way parse json human redable form without js). if try return json data along plaintext error because of datatype : 'json' setting. can ignoe non json data if js disabled , display onli plaintext without js enabled? ok, got it. sticked detecting on php side if there ajax request, depending on return json or plaintext. i detect ajax if (isset($_server['http_x_requested_with']) && ($_server['http_x_requested_with'] == 'xmlhttprequest'))

html - Javascript $('li').length call throws uncaught exception -

i've built little webpage carousel image slider. slider has buttons when clicked upon trigger image change , corresponding text appear below slider. right slider has 4 images. when click 'next image' button past fourth image, slideshow , corresponding text blurbs supposed start over, instead javascript or json throws error. same error thrown if click 'previous image' button when page first loads. leads me believe problem near increment decrement functions, of course wrong. error below , apologize in advance weird codeblock format. i'm not experienced js exceptions unsure best format posting them. threw of html, css , js in 1 codeblock because i'm unsure if it's html or js causing exception thrown. insights appreciated! uncaught typeerror: cannot read property 'imagedes' of undefinedmoveright @ showcasewebsitetest.html:272(anonymous function) @ showcasewebsitetest.html:281m.event.dispatch @ jquery-latest.min.js:3m.event.add.r.handle...

First time Javascript Object alert -

you can see want do, dont know how. function setupcards() { var cards = { "1name": "value1", "1suit": 1, "1number": 2, "1active": 0 }; alert( cards.1name ); } try using: alert(cards['1name']); because first character of object item begins number.

Oracle SQL PHP INSERT speed optimization? -

i'm trying insert lot of data oracle sql db, doing following... foreach ($service $valor) { $j=0; foreach($fechahorainf $fecha){ $i=0; $consulta="insert prueba_sms(fechahorainf,servicio,valor) values (to_date('".$fecha."','dd/mm/yyyy hh24:mi:ss'),'".$valor."','".$data[$j][$i]."')"; $stmt = oci_parse($conexion, $consulta); oci_execute($stmt,oci_default); $i++; } oci_commit($conexion); oci_free_statement($stmt); $j++; } note count($j)=count($service)=30 , count($i)=count($fechahorainf)=720 the point here i'm going insert 21600 rows , takes lot of time. is there tip improve speed? update: tried load date infile daan , citywall sugested way: $consulta="load data local infile 'files/data.csv' table prueba_sms fields terminated ';' lines terminated '\n' (fechahorainf,nodo,servicio,valor)"; $stmt=oci_...

ios - how to throw errors in a closure in swift? -

please @ following code: override func tableview(tableview: uitableview, editactionsforrowatindexpath indexpath: nsindexpath) -> [uitableviewrowaction]? { let deleteaction = uitableviewrowaction(style: uitableviewrowactionstyle.default, title: "delete", handler: { (action : uitableviewrowaction, indexpath : nsindexpath) -> void in if let managedobjectcontext = (uiapplication.sharedapplication().delegate as! appdelegate).managedobjectcontext{ let restauranttodelete = self.fetchresultcontroller.objectatindexpath(indexpath) as! restaurant managedobjectcontext.deleteobject(restauranttodelete) // saving managedobjectcontext instance, , catch errors if fails { try managedobjectcontext.save() } catch let error nserror { print("error: \(error.localizeddescription)") } } }) return deleteaction } the error message xcod...

Visual Studio 2015 losing settings -

my visual studio 2015 (rtm) keeps resetting of tweaks each time reopen (for example automatic brace completion). i'm running in administrator mode , tried devenv /resetsettings , reinstalling did not help. any ideas how fix appreciated. this has been fixed in kb3165756 , update instructions found on same page.

regex - How to protect blade template language in CKEditor 4? -

i using ckeditor backend mail template editing panel. after bit of tweaking made correctly protect php source , {{ }} tags used blade templates. sadly noticed blade words @if @foreach , others moved around text , wrapped in tags make them html compliant. is there way can avoid behaviour , let these elements untouched , live in page (for example) protected sources? maybe regex can suggest may fit blade language strings? thanks lot in advance. federico our product needed sort of mail template tags, understand you're coming from. we decided not use blade tags due full php support -- security implications not pretty. instead, decided expose blade-like tokens of {{ foo }} , {!! bar !!}`, , write simple parser them @ https://github.com/piestar/dough -- perhaps it's useful you.

java - Use view/layout of the base Fragment -

i have base fragment framelayout , want use layout in derived fragment , add ontouchlistener it. basefragment.java public class basefragment extends fragment { protected framelayout baseframelayout; protected view baseview; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { super.oncreateview(inflater, container, savedinstancestate); baseview = inflater.inflate(r.layout.fragment_base, container, false); baseframelayout = (framelayout) baseview.findviewbyid(r.id.framelayout); return baseview; } } fragment_base.xml <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/framelayout" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" /> derivedfragment.java public class derivedfragment extends basefragment...

c# - Implementing multiple instances of a concurrent queue -

i'm trying work .net concurrentqueue i'm having trouble. situation i'm trying accomplish. when application loads load queue 1000 objects. when user clicks button take first object in queue....do work...and pass item next queue. queues go in order when queue1 done pass on queue2, , queue2 queue3 etc. i can have upto 100 queues. i thought concurrentqueue best way this, however, i'm not sure how go this.

c# - Dynamics CRM 2015 - The plug-in type could not be found -

Image
i'm having similar problem to: dynamics crm 2011 - plug-in type not found unhandled exception: system.servicemodel.faultexception`1[[microsoft.xrm.sdk.organizationservicefault, microsoft.xrm.sdk, version=7.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35]]: system.argumentnullexception: value cannot null. parameter name: plug-in type not found in plug-in assembly: enlighten.crm.customisations.job.createjobdetail: <organizationservicefault xmlns:i="http://www.w3.org/2001/xmlschema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/contracts"> <errorcode>-2147220970</errorcode> <errordetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/system.collections.generic"> <keyvaluepairofstringanytype> <d2p1:key>callstack</d2p1:key> <d2p1:value xmlns:d4p1="http://www.w3.org/2001/xmlschema" i:type="d4p1:string"> @ microsoft.crm.sandbox.sandboxappdom...

html - Different style to column in table -

i trying give different style last column of table, have no idea how can this. added column <th>buy</th> , it's working normal other <th>..</th> give different style last column. tried write <th th-1>buy</th th-1> no effect. please, if has idea share :) here code: <table id="example" class="display" cellspacing="0" width="100%"> <thead> <tr> <th>name</th> <th>position</th> <th>rating</th> <th>salary</th> <th th-1>buy</th th-1> </tr> </thead> <tfoot> <tr> <th>name</th> <th>position</th> <th>rating</th> <th>salary</th> <th th-1>...

ios - About WebCache's sd_setImageWithURL with swift -

i'm using webcache swift. when set string sd_setimagewithurl directly following, it's displayed correctly. imageview?.sd_setimagewithurl(nsurl(string: "http://imgfp.hotp.jp/imgh/86/49/p018678649/p018678649_238.jpg"), placeholderimage: nil, options: sdwebimageoptions.cachememoryonly, completed: {[unowned self] (image: uiimage!, error: nserror!, type: sdimagecachetype, url: nsurl!) -> void in .... but, set following, it's not displayed.. if let imageurl:string = shop.img { print(imageurl) // same above self.imageview?.sd_setimagewithurl(nsurl(string: imageurl), placeholderimage: nil, options: sdwebimageoptions.cachememoryonly, completed: {[unowned self] (image: uiimage!, error: nserror!, type: sdimagecachetype, url: nsurl!) -> void in .... } what's wrong?? it's simple: if let strimage = "http://imgfp.hotp.jp/imgh/86/49/p018678649/p018678649_238.jpg"{ self.imageview.sd_setimagewithurl(nsurl(s...

ruby on rails - How can I get my stand alone ActiveRecord::Base tool to connect to my production database? -

this script created add users onto production database. puts "name of user" name = gets.chomp puts "login of user" login = gets.chomp etc. etc..... what want connect production database can manage new users without having type lot of fields multiple times. at top of file i've tried few ways connect database no avail.... attempt 1: require 'config/environment.rb' this connects me development database attempt 2: require 'active_record' activerecord::base.establish_connection(:production) `establish_connection': production database not configured (activerecord::adapternotspecified) attempt 3: require 'active_record' activerecord::base.establish_connection(:adapter => 'postgresql', :host => 'company_host') load_missing_constant': uninitialized constant rails (nameerror) attempt 4: require 'active_record' activerecord::base.establish_connection(:adapter => 'postgre...

Octave keyboard input function to filter concatenated string and integer? -

if write 12wkd3 , how choose/filter 123 integer in octave? example in octave: a = input("a?\n") a? 12wkd3 = 123 while 12wkd3 user keyboard input , a = 123 expected answer. assuming general form you're looking taking arbitrary string user input, removing non-numeric, , storing result integer: a = input("a? /n",'s'); = int32(str2num(a(isdigit(a)))); example output: a? 324bhtk.p89u34 = 3248934 to clarify what's written above: in input statement, 's' argument causes answer stored string, otherwise it's evaluated octave first. inputs produce errors, others may interpreted functions or variables. isdigit(a) produces logical array of values a 1 character 0-9 number, , 0 otherwise. isdigit('a1 3 b.') = [0 1 0 1 0 0 0] a(isdigit(a)) produce substring using values corresponding 1 in logical array above. a(isdigit(a)) = 13 that still returns string, need convert number using str2num() . th...