Posts

Showing posts from April, 2013

javascript - Google Sheets Script Error - Cannot convert Array to Object[][] -

i'm working on script encode data in fields insertion html (the cells contain words planétarium , rua joão bettega, 01 ). getting error , don't know it. error says "cannot convert array object[][]" i'm passing two-dim array .setvalues() , know that's not (found common problem). ideas? here's function: // columns[] , columns2encode[] set in scope above function function _encodedata() { var sheet = _getsheet(); var data = sheet.getdatarange().getvalues(); var rowcnt = data.length; var colcnt = data[0].length; var data2set = new array(rowcnt-1); // creates array w/ row.length indeces var colencodeindexlist = []; var origval, encodedval, range, cell; // used later in loop(s) toast('start encoding data'); // loop every row for(var ri = 0; ri < data.length; ri++) { if(ri !== 0) { data2set[ri] = new array(colcnt); // creates array w/ length of ~ 29 } // loop every cell (column entry in given row) fo...

angular - Different Sidemenu in ionic 2 app -

i have different side menus in ionic 2 app based on user login. when user logs in customer , want show side-menu customer functionalities. when user logs in admin, show different side-menu. i using ionic 2 sidemenu template any appreciated. you use *ngif on element inside sidebar display based on if user logged in admin. example: <div class="side-bar-admin" *ngif="admin'"></div>

c# - Formula conditional EPPlus -

i'm trying add file column conditional formula... cell stay blank or formula show string. i saw 2 possibilities, using _formatrangeaddress or each data of cell... file can have 150 000+ rows... var _formatrangeaddress = new exceladdress("c1:cxxxx,d1:dxxxx"); string _statement = "si(c2=d2;point(d2 c2);linestring(d2 c2,d3 c3)"; var _cond4 = worksheet.conditionalformatting.addexpression(_formatrangeaddress); _cond4.style.fill.patterntype = officeopenxml.style.excelfillstyle.solid; _cond4.formula = _statement; any ideas how can make formula works? thanks.

javascript - Undefined error when embedding SVG -

Image
i' using ajax call retrieve htm file builds svg . call returns file area it's suppose appear says: is timing issue? have ajax call in separate js file called after page loads. function buildmap(){ var lbmp = document.getelementbyid("lbmp-map"); if(lbmp != null){ $.ajax({ url:'../footer.htm', method: 'get', success: function(response){ lbmp.innerhtml = response.responsetext; }, failure: function(response){ lbmp.innerhtml = "<p>failure</p>"; } }); } } on success, ajax gives directly content, html in response , not in response.responsetext , that's why getting undefined message.

mysql - Query on my sql db -

i have 2 different query: select nazione, count(*) gold `summertotalmedal` medaglia = 'gold' , sport = 'athletics' group nazione order gold desc and select nazione, count(*) silver `summertotalmedal` medaglia = 'silver' , sport = 'athletics' group nazione order silver desc is there way join query such 2 different output on 2 different coloumns? you can use conditional aggregation same select nazione, sum(case when medaglia ='gold' , sport='athletics' 1 else 0 end) gold, sum(case when medaglia ='silver' , sport='athletics' 1 else 0 end) silver summertotalmedal group nazione

mercurial - How can I view the remaining changesets left to check in an hg bisect? -

when i'm running hg bisect, want "look ahead" @ what's remaining, see if there obvious culprits check while slow bisection test runs. so given i've run > hg bisect -g testing changeset 15802:446defa0e64a (8 changesets remaining, ~2 tests) how can view 8 changesets remaining? you can use bisect("untested") revset view untested changesets. e.g.: hg log -r 'bisect(untested)' if information, can combine template option: hg log -r 'bisect(untested)' -t '{rev}\n' or can restrict output first , last entry of range: hg log -r 'first(bisect(untested))+last(bisect(untested))' you can create revset aliases in .hg/hgrc or ~/.hgrc file save typing, e.g.: [revsetalias] tbt = bisect("untested") tbt2 = first(tbt)+last(tbt) then can (for example): hg log -r tbt note if call revset alias untested , you'll have quote string untested (e.g. bisect("untested") ), hence choice ...

php - Extract keyword that Word Pattern -

i have string. hi {$user_name} test msg {$user1,$user2,$user3} i want extract {$word} string. have tried use str_replace not working. short solution preg_mach_all function: $str = 'hi {$user_name} test msg {$user1,$user2,$user3}'; preg_match_all('/\s*(\{\$[^\{\}]+\})+\s*/iue', $str, $matches); echo "<pre>"; var_dump($matches[1]); // output: array(2) { [0]=> string(12) "{$user_name}" [1]=> string(22) "{$user1,$user2,$user3}" } http://php.net/manual/ru/function.preg-match-all.php

amazon web services - Chat App on AWS: EC2 (eJabberd XMPP) vs RDS (Relational Database) vs other options? -

i want create ios app 1:1 , group chats. since dynamodb not ideal solution this , searching better way. possible solutions: install xmpp server (ejabbered) on aws ec2 use aws rds (relational database) 1 chat table, each record equals message sent 1 client or group. use amazon s3 store files each chat? other options? which 1 of above elegant / easiest solution this? option 1 not recommended some. option 2 seems easier (auto) scale. which 1 more cost-efficient? regarding rds amazon writes: "aws free tier includes 750hrs of micro db instance each month 1 year" regarding ec2 amazon writes: "aws free tier includes 750 hours of linux , windows t2.micro instances each month 1 year. stay within free tier, use ec2 micro instances." i quite new server backend architecture, accounting based on time seems not best solution chat app? the s3 solution not 1 choose because limit of put authorized on amazon s3 small (2000), if going have millions ...

ruby on rails - Micheal Hartl ch 7 -

i new rails , stuck on chapter 7 of michael hartl tutorial. have been geting error after first sign in 7.4.3: missing partial shared/_error_messages {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}. searched in: * "/usr/local/rvm/gems/ruby-2.2.1/gems/web-console-2.0.0.beta3/lib/action_dispatch/templates" * "/home/ubuntu/workspace/sample_app/app/views" * "/usr/local/rvm/gems/ruby-2.2.1/gems/web-console-2.0.0.beta3/app/views" thanks in advance help! missing partial shared/_error_messages :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder] you have missing partial . it should in shared/ it should named _error_messages it should have .html extension followed 1 of .erb, .builder, .raw, .ruby, .coffee, .jbuilder it's pretty straightforward error message.

Python script not able to read user input when run remotely -

i trying remotely execute simple python script userinfo.py present in remotehost. below sourcecode of userinfo.py [ using python 2.7.10 ] ############# print "userinfo :" name=raw_input("enter name") age=raw_input("enter age") print "name"+name+"\nage"+age ############# but script working abnormally when run remotely. [user@localhost]# ssh remotehost python /home/userinfo.py userinfo : enter nameenter agename age [user@localhost]# execution summary :: during execution, doesn't print anything, directly waits user input , pressed enter key display output above. would know why not behaving expected when raw_input used. when values passed arguments, works fine. [user@localhost]# ssh remotehost python userinfo.py xyz 20 userinfo : name xyz age 20 [user@localhost]# below changed code. ########### import sys print "userinfo :" name=sys.argv[1] age=s...

java - passing and parsing object input dialog value to database table -

i want know how integer value input dailog box and query inside select statement looks error input box type per below object , have no idea how parse object integer accepted select statement please advise how handle object type inputbox variables , inject same select private void inputval(){ // here input box retrieve user entry object journal_no = joptionpane.showinputdialog( null, "please enter journal no.?:\n", "search", joptionpane.plain_message, null,null,""); if (journal_no.equals("")){ joptionpane.showmessagedialog(null, "please enter correct no."); return; } // here call sql statement load table rely on //inputbox try { string host1= "jdbc:derby://localhost:1527//accountsdb"; string uname1="accounts"; string upass1="accounts"; con1=drivermanager.getconnection(host1,uname1 ,upass1)...

python - How to show the content of each Evernote note in Django -

https://github.com/evernote/evernote-sdk-python/blob/master/sample/django/evernote_oauth_sample/templates/oauth/callback.html https://github.com/evernote/evernote-sdk-python/blob/master/sample/django/oauth/views.py show content of 1st note (works): // views.py (my fork) updated_filter = notefilter(order=notesortorder.updated) updated_filter.notebookguid = notebooks[0].guid offset = 0 max_notes = 1000 result_spec = notesmetadataresultspec(includetitle=true) result_list = note_store.findnotesmetadata(auth_token, updated_filter, offset, max_notes, result_spec) note_guid = result_list.notes[0].guid content = note_store.getnotecontent(auth_token, note_store.getnote(note_guid, true, false, false, false).guid) return render_to_response('oauth/callback.html', {'notebooks': notebooks, 'result_list': result_list, 'content': content}) // oauth/callback.html (my fork) <ul> {% note in result_list.notes %} <li><b>{{ note.titl...

Spring Integration - Flow process with erro handling -

i'm continuing study si , in same time i'm trying build application. my application flow this: read xml file , split each tag each tag have define attribute called "interval", , need create job repeated, according value. when job execution terminated, need invoke web service store information if wbs invokation fails, try send info email right i'm arrived on point 1 ( :d ) of flow, i'm trying move forward , first check error handling (point 4 of flow). this actual configuration have , works fine splitting tag , invoking right service-activator : <context:component-scan base-package="it.mypkg" /> <si:poller id="poller" default="true" fixed-delay="1000"/> <si:channel id="rootchannel" /> <si-xml:xpath-splitter id="mysplitter" input-channel="rootchannel" output-channel="routerchannel" create-documents="true"> <si-xml:xpath-e...

java - Weird behaviour with collection and StringBuilder -

i try make sql query objects contained in collection , stringbuilder . seems simple code write: public string makequery(collection<myobject> collection) { logger.info("the size of collection {}", collection.size()); stringbuilder querystring = new stringbuilder("insert my_table (my_column) values "); int = 1; (myobject object : collection) { querystring.append("('"); querystring.append(object.get...); querystring.append("')"); if (i == collection.size()) { querystring.append(";"); } else { querystring.append(","); } i++; } logger.info("the size of collection {}", collection.size()); return querystring.tostring(); } for me, code should works have result: insert my_table (my_column) values ('a'),('b');('c'), how possible semi colon not last character ? ...

selenium - I am using Scrapy to crawl data, but the server block my IP -

Image
as picture showed, using scrapy crawl data server , server seem block ip, curious server block ip of my mac or ip of router ? it router's public ip blocked. in scenario there 2 networks. one, public internet - server (hosting website crawl) connected. two, private home network - mac connected. your router acts gateway private home network internet , helps mac talk server. to act "gateway" router have 2 ip addresses. 1 private ip address home network , 1 public ip address. public ip address visible server. in server's viewpoint public ip address crawl requests made. hence it router's public ip blocked. also please respect website's terms of service , crawl responsibly. if don't want banned try following settings in settings.py: limit concurrent_requests set download_delay reference : http://doc.scrapy.org/en/latest/topics/settings.html

objective c - iOS Realm cascade delete -

my models are: first model - job: idx, title, description second model - specialization: idx, title, rlmarray<job> jobs what should if want delete job , i'd delete specs related job. in advance. code is: [self.storage beginwritetransaction]; rlmresults *specs = [mbspecialization objectsinrealm:self.storage where:@"%@ in jobs", job]; (mbspecialization *spec in specs) { [self.storage deleteobjects:spec]; } [self.storage deleteobject:job]; [self.storage commitwritetransaction]; if want delete specializations containing job being deleted if still have other jobs: [self.storage beginwritetransaction]; [self.storage deleteobjects:[job linkingobjectsofclass:mbspecialization.classname forproperty:@"jobs"]]; [self.storage deleteobject:job]; [self.storage commitwritetransaction]; alternatively, may want clean specializations no longer have jobs after 1 deleted: [self.storage beginwritetrans...

database - Entity Framework Data First - Invalid Object Name dbo.TableName -

sup? got problem wich has been slowing down production lot, hope u guys can give me tip on how solve it.... i'm using ef6 , custom connectionstring connectionstring builder class reads , external xml file. my database set , running in sql 2010 , management studio ok, whenever generate edmx file, generates class mappings okay, i've compared original connectionstring connectionstring builder they're same, changed :base receive custom connectionstring, set. but when try save changes doesn't find table object, have deleted it, created again start, still same "invalid database object dbo.tablename" error. does 1 have clue on this? in advance! this error not coming entity framework directly database. use sql profiler , include in trace "databasename" , "servername" , find out it's not same expected. the other options issue happen if "tablename" not same table name in sql, run sql sql profiler directly s...

sensor - Capture and Update Lidar Scan Data in Matlab -

i want hokuyo ubg-04lx-f01 lidar scan , read range data matlab. code returns data 1 scan, can provide on how can code continuously return scan data (continuously update lidar scans). code matlab. thanks. %this function capture , display scan data %it displays range data 1 scan 682 steps function [rangescan] = capturedata(urg_device) proceed=0; while (proceed==0) fprintf(urg_device, 'gd0044072500\n'); pause(0.1); data = fscanf(urg_device); if numel(data) == 2134 proceed = 1; end end = find(data == data(13)); rangedata = data(i(3)+1:end-1); onlyrangedata = []; j=0:31 onlyrangedata((64*j)+1:(64*j)+64) = rangedata( 1+(66*j):64+(66*j)); end j=0; i=1:floor(numel(onlyrangedata)/3) encodeddist(i,:)=[onlyrangedata((3*j)+1) onlyrangedata((3*j)+2) onlyrangedata((3*j)+3)]; j=j+1; end k=1:size(encodeddist,1) rangescan(k)=decodescip(encodeddist(k,:)); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...

php - Pagination in Codeigniter returns error -

my problem pagination not working, shows number of pages << 1 2 3 >> etc... when tried go on page 2 gives me error like: the requested url /mysite/welcome/index/2 not found on server. here model called: country.php <?php defined('basepath') or exit('no direct script access allowed'); class country extends ci_model { public function __construct() { parent::__construct(); } public function record_count() { return $this->db->count_all("news"); } public function fetch_countries($limit, $start) { $this->db->limit($limit, $start); $query = $this->db->get("news"); if ($query->num_rows() > 0) { foreach ($query->result() $row) { $data[] = $row; } return $data; } return false; } } here controller shows news on page, , pagination, unfortunately said when try go page 2 returns error message. my controller called welcome.php class...

reactjs - Basic hello world with react-router and webpack not working -

i have simple webpack configuration (using react-slingshot https://github.com/coryhouse/react-slingshot ) , basic hello world react-router. instead of hello world being rendered noscript tag in app div. here of dependencies package.json: "react": "0.14.6", "react-dom": "0.14.6", "react-redux": "4.0.0", "history": "2.0.0", "react-router": "2.0.0-rc5", here index.html: <!doctype html> <html lang="en"> <head> <title>routing test</title> </head> <body> <div id="app"></div> <script src="js/bundle.js"></script> </body> </html> here index.js: import react 'react'; import { render } 'react-dom'; import { router, route, browserhistory } 'react-router'; const rootcomponent = () => <div>hullo world?</div>; render( <r...

javascript - Styling an SVG line with CSS -

is there way style svg line css ? have tried adding. want add classes onclick jquery later on. add class , change stroke colour. .black { fill: black!important; stroke: black!important; } to svg <g id="layer_1"> <image display="none" overflow="visible" width="1800" height="4913" xlink:href="../../../../desktop/gcs-career-path.jpg" transform="matrix(1 0 0 1 -405.5005 -428.001)"></image> <polyline class="black" fill="#cdced0" stroke="#d0d0d0" stroke-width="2" stroke-miterlimit="10" points="546.834,107.001 550.723,105.249 641.501,64.334"/> <line class="black" fill="#cdced0" stroke="#d0d0d0" stroke-width="2" stroke-miterlimit="10" x1="641.501" y1="151" x2="551.168" y2="109.667"/> <line fill=...

Purge by deleting all records older than 180 days from the current date in SQL Server -

Image
in sql server 2008 r2 have table (database size 450 gb) on billion rows, i'd purge deleting records older 180 days counting current date. here appreciated! i'm using following query : delete table name column name < '2015-01-01' but taking time. there maintenance plan or query can delete data fast? one approach might save time: start off taking backup (you never know) insert rows want keep temporary table (make sure have enough room on disk tempdb ) truncate table remove rows (this statement execute instantly) insert rows temporary table source table insert #keep select * table_name column_name>='2015-01-01'; truncate table table_name; insert table_name select * #keep; drop table #keep;

javascript - How to determine parameter list of callback functions -

in d3.js, time pass callback function argument, e.g. in delay() below: d3.select('body').selectall('div') .data(distances) .enter() .append('div') .html('.') .style('width', '10px') .style('opacity', 0) .transition() .delay(function(d, i) { return * 1000 }) question: how know callback function shall have 2 parameters: d , i. , in document specify 'd' should correspond datum , 'i' correspond index? my question not limited d3.js js convention in general. e.g. in angular.js, found similar thing. e.g. in callback function passed then() below: // simple request example: $http({ method: 'get', url: '/someurl' }).then(function successcallback(response) { // callback called asynchronously // when response available }, function errorcallback(response) { // called asynchronously if error occurs // or server returns response error status. }); how know (i....

Error = [Microsoft][ODBC Driver 11 for SQL Server]Warning: BCP import with a format file will convert empty strings in delimited columns to NULL -

i upgraded our windows server 2008 2012 , sql server 2008 2014. have process uses bcp command export data database. command below: bcp "exec db_name.dbo.table_name 20160204, 0" queryout d:\myfolder\201602\20160204\output.txt -c -t -s server_name before upgrade 2016-02-02 04:05:16,038 [2492] info - starting copy... 1000 rows bulk-copied host-file. total received: 1000 after upgrade 2016-02-05 04:04:37,006 [15872] info - starting copy... sqlstate = s1000, nativeerror = 0 error = [microsoft][odbc driver 11 sql server]warning: bcp import format file convert empty strings in delimited columns null. 1000 rows bulk-copied host-file. total received: 1000 though output file has been created, error/warning undesirable in log. there way suppress warning? apparently,according microsoft not error warning , can safely ignored.( detailed discussion , work around here ) in case, parsing bcp console output string "error" , reporting process failed. s...

Checking a user exists in Azure Active Directory B2C -

i creating new azure ad b2c authenticated site replace older forms authenticated one. in new site, asking user enter email address can check if exist in azure b2c , send them appropriate sign-in page , if not send them older forms authenticated site. the issue have when following microsoft's tutorials, show user management require have logged in azure account first , not possible given system trying build. doing possible? thanks in advance! ms tutorials: https://azure.microsoft.com/en-gb/documentation/articles/active-directory-code-samples/ sadly, seems not possible within azure b2c preview. from limitations section ( https://azure.microsoft.com/en-gb/documentation/articles/active-directory-b2c-limitations/ ) there paragraph describes trying do: daemons / server side applications applications contain long running processes or operate without presence of user need way access secured resources, such web apis. these applications can authenticate , token...

c# - Unity 'score does not exist in the current context' -

so i'm trying make when touch coin (sprite, it's 2d game) gets destroyed , point up, problem is, says score not exist in current context. unity error: (assets/_scripts/textscore.cs(11,61): error cs0103: name `score' not exist in current context) code: using unityengine; using system.collections; using unityengine.socialplatforms.impl; using unityengine.ui; using system.security.cryptography.x509certificates; public class codesystem : monobehaviour { // use initialization void start () { } // update called once per frame void update () { } int score = 0; void oncollisionenter ( collider other ) { debug.log("picked coin!"); if (tag == "coin") { debug.log("added score!"); score = score + 1; } } }

android - Cannot get objectId even inside saveInBackground()? -

i cannot retrieve created object's objectid, inside public void done . occasion.saveinbackground(new savecallback(){ @override string string = occasion.getobjectid(); }) and returns null and crashes app nullpointerexception. why null? saved successfully. no object id, why? :( use occassion.saveinbackground(new savecallback() { @override public void done(parseexception e) { // todo auto-generated method stub if(e==null){ string string = occasion.getobjectid(); } } });

ontology - How to keep rule head as null using Protege swrl tab -

i trying capture conflict using swrl rules. learned swrl support rules empty head(consequent). protege not allow defining such rules. dummy example of trying achieve is person(?x)^hasson(?x,?y)^hasdaughter(?x,?y)-> meaning not possible person can linked same individual both hasson , hasdaughter properties. if not possible in protege, please guide me on how achieve alternatively. the rule body can empty, not imply contradiction, in intentions; interpreted rule not applying. specs here . if understand intent correctly, after can achieved creating 2 classes: define exact cardinality restriction of 0 hasson , exact cardinality restriction of 0 hasdaughter , assign these classes range of hasdaughter , hasson respectively. this way, stating a hasson b , a hasdaughter b cause inconsistency.

asp.net mvc - HTTP Handler in MVC Project Yielding 404s -

i've created mvc project on button click it's suppose save contents of the page .xlsx file. works fine in chrome/ff not in ie 9 , below. to handle edge case i've implemented http handler. weird thing when in debugging (vs 2013) "without breakpoints" code works fine , i'm able download excel file in ie. when i'm not debuging , browse page 404: requested url: /home/exporthandler.axd wonder why getting 404 , why route electing put /home in url, there way remove it? ways here's code: http handler namespace mvcapplication2 { public class exporthandler : ihttphandler { public void processrequest(httpcontext context) { if (context.request.form["contenttype"] != null && context.request.form["filename"] != null && context.request.form["data"] != null) { context.response.clear(); context....

go - assign a string type golang -

i'm having hard time assigned string type string. have type: type username string i have function returns string what i'm trying set username returned string: u := &username{returnedstring} i tried var u username u = returnedstring but error. as others have pointed out, you'll need explicit type conversion: somestring := functhatreturnsstring() u := username(somestring) i'd recommend reading this article on implicit type conversion. specifically, honnef references go's specifications on assignability : a value x assignable variable of type t ("x assignable t") in of these cases: x's type v , t have identical underlying types , @ least 1 of v or t not named type. so in example, returnedstring "named type": has type string. if had instead done like var u username u = "some string" you have been ok, "some string" implicitly converted type username , both string ...

Jquery on click function not reseting on browser resize -

i have following code slides column in left right , nudges right of column on right , again (a bit facebook app). works fine on document ready not on resize. after resizing starts act strangely. though doing previous function , not registering new function on resize. function domenu() { var $trigger = $(".icon-menu-2"); var $menu = $(".c_left"); var width = $(window).width(); if ((width < 870) && (width > 750)) { var status = 'closed'; $('.icon-list').on('click', function(event){ if ( status === 'closed' ){ $menu.animate({ width: 0, marginleft: -200, display: 'toggle' }, 'fast'); $(".content_right, .navbar").animate({ marginright: 0, display: 'toggle' }, 'fast'); return status = 'open'; } else if (...

validation - Weka - Update Instances during evaluation -

i using weka api test algorithm. during evaluation, want update of instances (feature vectors) after evaluate each instance. here method now for(int = 0; < testdataset.numinstances(); i++) { // current validation instance instance curinst = testdataset.instance(i); // actual class index int actualclassidx = (int)curinst.classvalue(); // predicted class index int predclassidx = (int)bestclassifier.classifyinstance(curinst); if(actualclassidx == predclassidx) { numcorrect++; } // update validation dataset updatefeatures(testdataset); } double accuracy = (double)numcorrect / testdataset.numinstances(); system.out.println("testing accuracy = " + accuracy * 100 + "%"); this works, however, want use things evaluation object me because need more statistic data (e.g: confusion matrix). there sufficient way achieve that?

qt - How to add different types of delegates in QTreeView -

Image
i want create same kind of qtreeview (not qtreewidget) structure shown in attached figure.. property editor of qt. using qt-4.6 on 2nd column, depending on different condition, can have either spin box, or drop down or checkbox or text edit... , on... please guide me on how set different delegates in different cells of particular column. docs, evident there no straight away api setting delegate on cell (rather available full widget or row or column). all qabstractitemdelegate methods, createeditor or paint , have model index 1 of parameters. can access model data using index , create appropriate delegate widget. when create model should set value every item used distinguish type. an example: enum delegatetype { dt_text, dt_checkbox, dt_combo } const int mytyperole = qt::userrole + 1; qstandarditemmodel* createmodel() { qstandarditemmodel *model = new qstandarditemmodel; qstandarditem *item = new qstandarditem; item->settext("hel...

c# - How to put button inside grid that can be tapped in Windows 8.1 app? -

i'm developing app windows 8.1. have grid can tapped, , want put button inside grid provide finer function. should when click button, event inside grid not triggered. code structure this <grid tapped = "ongridtapped" background = "transparent"> <button tapped = "onbuttontapped"/> </grid> i cannot have access bringtofront() or zindex problem. inside onbuttontapped(object sender, tappedroutedeventargs e) add e.handled = true stop tap event bubble grid solve problem

python - Celery: how to limit number of tasks in queue and stop feeding when full? -

i new celery , here question have: suppose have script supposed fetch new data db , send workers using celery. tasks.py # celery task celery import celery app = celery('tasks', broker='amqp://guest@localhost//') @app.task def process_data(x): # x pass fetch_db.py # fetch new data db , dispatch workers. tasks import process_data while true: # run db query here fetch new data db fetched_data process_data.delay(fetched_data) sleep(30); here concern: data being fetched every 30 seconds. process_data() function take longer , depending on amount of workers (especially if few) queue might throttled understand. i cannot increase number of workers. i can modify code refrain feeding queue when full. the question how set queue size , how know full? in general, how deal situation? you can set rabbitmq x-max-length in queue predeclare using kombu example : import time celery import celery kombu import queue, exchange cl...

php - File download getting canceled afte ~1GB of transfer -

i have 4gb file on server served via php script. sadly after transferring around 1gb download aborted , following messages in server log: (104)connection reset peer: mod_fcgid: error reading data fastcgi server, referer: http://www.domain.tld/files/?dir=downloads/video/testvid (104)connection reset peer: mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.domain.tld/files/?dir=downloads/video/testvid i googled both errors every suggestion far didn't work or had changing chmod on data plesk uses throw errors. anybody ideas? - going wrong? i tried put in apache &nginx settings http & https: <ifmodule mod_fcgid.c> fcgidconnecttimeout 43200 fcgidbusytimeout 43200 fcgidiotimeout 43200 fcgidmaxrequestlen 335544320 fcgidmaxrequestsperprocess 20000 </ifmodule>

ruby on rails 4 - heroku precompiling asserts failed: Sass::SyntaxError: Undefined variable -

i develop app based on m. hartls tutorial. when try push sample-app on heroku, precomiling of assets fails error: sass::syntaxerror: undefined variable: "$gray-lighter" in none of files mention "gray-lighter". application.css.scss contains only: /* *= require_tree . *= require_self */ @import "bootstrap-sprockets"; @import "bootstrap"; has idea how solve problem? besides error code - need more information? $ git push heroku master -f counting objects: 168, done. delta compression using 2 threads. compressing objects: 100% (154/154), done. writing objects: 100% (168/168), 40.30 kib | 0 bytes/s, done. total 168 (delta 32), reused 0 (delta 0) remote: compressing source files... done. remote: building source: remote: remote: -----> ruby app detected remote: -----> compiling ruby/rails remote: -----> using ruby version: ruby-2.2.4 remote: ###### warning: remote: removing `gemfile.lock` because generated on windows...

c# - InvalidProgramException with shims in Visual Studio 2015 -

an similar question has been asked while ago not answered yet. , since setup little different, start new try: i demonstrate shortened version of code, short version produces error. i have method returns instance of system.printing.localprintserver : public class printserverprovider { public localprintserver provide() { return new localprintserver(new string[0], printsystemdesiredaccess.enumerateserver); } } for method implemented unit test using shims: [testclass] public class printserverprovidertests { [testmethod] public void provide_success() { using (shimscontext.create()) { bool constructorcalled = false; shimlocalprintserver.constructorstringarrayprintsystemdesiredaccess = (instance, props, access) => { constructorcalled = true; }; printserverprovider provider = new printserverprovider(); localprintserver server = provider.prov...

Data type mismatch in criteria expression error in C# trying to insert data in Microsoft Access using ASP.net -

private oledbconnection bookconn; private oledbcommand oledbcmd = null; private string connparam; protected void page_load(object sender, eventargs e) { } protected void btnsubmitform_click(object sender, eventargs e) { if (page.isvalid) { connparam = @"provider=microsoft.ace.oledb.12.0;data source=" + server.mappath("validation.accdb") + ";persist security info=false;"; bookconn = new oledbconnection(connparam); bookconn.open(); oledbcmd = new oledbcommand("insert tblclients(firstname,lastname, phone, streetaddress, city, zipcode) values('" + fname.text + "','" + lname.text + "'," + convert.toint64(phone.text) + ",'" + address.text + "','"+ city.text + "', " + convert.toint32(zipcode.text) + ")", bookconn); oledbcmd.executenonquery(); bookconn.close(); response.redirect(httpcontext.c...

javascript - jQuery UI Tooltip won't disappear after click -

$(document).ready(function(){ $('[data-toggle="tooltip"]').tooltip(); }); i'm using basic js have tooltips enabled on hover. however, if click icon tooltip, remain there until click else. how change code above ? check out jquery hover() method, has enter , exit handlers: http://api.jquery.com/hover/ you can call open() , close() on tooltip on enter , exit respectively: http://api.jqueryui.com/tooltip/#method-open http://api.jqueryui.com/tooltip/#method-close

ddl - how to create a new column in postgresql UDR database -

i need able create new column in existing table in database has been set use postgresql udr. i've read, cannot run ddl commands in bdr unless write syntax in specific way... example, found post on stackoverflow: django 1.8 migration postgres bdr 9.4.1 i've tried follow similar udr setup... it's not working me. specifically, i've tried following: mydatabase=# alter table mytable add column newcolumn character varying(50) not null default 'boo'; error: alter table ... add column ... default may affect unlogged or temporary tables when bdr active; mytable regular table and this: mydatabase=# alter table mytable add column newcolumn character varying(50); error: no peer nodes or peer node count unknown, cannot acquire ddl lock hint: bdr still starting up, wait while mydatabase=# are allowed run ddl commands in udr setup? if has tips, i'd appreciate it. thanks.

java - Parse "no results found for query (code 101)". Can't get object id -

i've installed example parse server ( https://github.com/parseplatform/parse-server-example ) on desktop , made simple app test it. my app saves object server, gets object , sets mtextview's value value of object. the problem is, when try code data server works: query.getinbackground("5k7n8a8dmd", new getcallback<parseobject>() ... (got object id curl) but when try (to object id w/o using curl): gamescore.saveinbackground(new savecallback() { public void done(parseexception e) { if (e == null) { objectid = gamescore.getobjectid(); } else { log.e("saveinbackground", geterrormessage(e)); } } }); ... query.getinbackground(objectid, new getcallback<parseobject>() ... it doesn't work. logcat: e/getinbackground﹕ no results found query - code: 101 mainactivity.java public class ...

How to filter SSRS report with multivalue parameters works like a string.contains -

i have ssrs report calls stored procedure result set. 1 of column "owner" column can have 0 or more person name , string concatenated " & ". can't change stored procedure in report need add multivalue report parameter. parameter displays possible owner name in drop down , need use parameter post-filter after result set stored procedure call. question how create filter on owner field works string.contains? better illustrate, below example: below raw result set ticket number owner 100 john doe & jane doe 101 john doe & jack smith 102 john doe & bill white if user selects jack smith , bill white in owner parameter drop down, result should be ticket number owner 101 john doe & jack smith 102 john doe & bill white if john doe selected, 3 rows should returned. you this. declare @string nvarchar(10) set @string = 'string' owner '''' + '...

php - uksort() - single digit integers being treated as larger than double digit integers when first integer is smaller -

as question suggests, i'm using uksort() desired ordering multidimensional array. everything's working great, exception of 1 small flaw. i'm having trouble conveying issue is, it's if natsort() being applied somewhere , can't figure out. here's uksort() callback: uksort($loanprograms, function($a, $b){ $yeara = abs((int) filter_var($a, filter_sanitize_number_int)); $yearb = abs((int) filter_var($b, filter_sanitize_number_int)); return $yearb > $yeara ? 1 : -1; }); i'm extracting numbers string (which i've triple checked). numbers this: $a - 30 $b - 5 $a - 20 $b - 10 $a - 30 $b - 15 $a - 7 $b - 10 however, issue 7 treated larger 10 , , 5 treated larger 30 ...etc. i can't figure out issue here. thoughts appreciated. edit snapshot of multi dimensional array: array ( [conventional 15yr fixed] => array ( [0] => array ( [humanname] => conven...