Posts

Showing posts from September, 2011

utf 8 - PHP remove special characters to make sure a string is utf-8 encoded -

i @ lost of how remove special characters string make sure chars supported uft-8 + french chars included. below base64 string has special chars , sanitizing function has failed remove them , causing text not print when using fpdf cells etc. if decode string @ https://www.base64decode.org/ see special chars. // sanitizing function static function remove_none_word_chars($string) { return preg_replace('/[^a-za-z0-9`_.,;@#%~\’\'\"+*\?\^\[\]\$\(\)\{\}\=!\<\>\|\-:\s\/\\sàâçéèêëîïôûùüÿñæœ]/ui', '', $string); } 74knifn1cgvydmlzzxigbgugdhjhdmfpbcbkzsbs4oczzw5zzw1ibgugzhugcgvyc29ubmvsigrlihbyb2r1y3rpb24sigrligzigjllbnryzxrpzw4gzxqgzgugbgegbwfpbnrlbmfuy2ugc3vyigxlihf1yxj0igrlig51axqgzw4gdgvuyw50ignvbxb0zsbkzsbsysbjb252zw50aw9uignvbgxly3rpdmu7cu+cpybbc3n1cmvyihvuzsbib25uzsbnzxn0aw9uigrligzigjllbnnlbwjszsbkzxmgb3ddqxjhdglvbnmgzgugbokamxvzaw5lowrvgqcgugxhbmlmawvyigrlcybvcmopcmf0aw9ucyblbibmb25jdglvbibkzxmgym9ucybkzsbjb21tyw5kztsk74kniefwcg9ydgvyigxl...

python - Building a dataframe in an efficient way from dictionary -

Image
i have large set of data have process , generated dictionary. want create dataframe dictionary. vales of dictionary list of tuples. values need find out unique values build columns of dataframe: d = {'0001': [('skiing',0.789),('snow',0.65),('winter',0.56)],'0002': [('drama', 0.89),('comedy', 0.678),('action',-0.42) ('winter',-0.12),('kids',0.12)],'0003': [('action', 0.89),('funny', 0.58),('sports',0.12)],'0004': [('dark', 0.89),('mystery', 0.678),('crime',0.12), ('adult',-0.423)],'0005': [('cartoon', -0.89),('comedy', 0.678),('action',0.12)],'0006': [('drama', -0.49),('funny', 0.378),('suspense',0.12), ('thriller',0.78)],'0007': [('dark', 0.79),('mystery', 0.88),('crime',0.32), ('adult',-0.423)]} (size of dictionary cl...

SAS EG: SAS Dataset is locked by opening it from EG. Need a resolution -

one of critical sas dataset left open sas enterprise guide, our offshore associate. depending on dataset many updates through various jobs. tried searching option various sites unlock dataset, of no use. kindly provide suggestion. thanks. depending on of specifics of situation, option prevent anyone locking in first place using pw= dataset option like: data myimportanttable(pw=pass123); x=1;output; run; then create view allows eg users click , see underlying data, not lock original dataset: proc sql; create view myimportanttable_view select * myimportanttable(read=pass123) ;quit; now inserts, updates etc work if view opened user in eg: *this work if view opened in eg; proc sql; insert myimportanttable(pw=pass123) values(101) ;quit; note not option if you've got lot of different insert/update statements spread throughout program - each of them need (pw=...) dataset option added them in order work.

javascript - Three.js - How to link/add a light to the camera since r69? -

since r69 pattern no longer supported (*) : directionallight.position = camera.position; so have tried this answer : var pointlight = new three.pointlight( 0xffffff, 1, 100 ); camera.add( pointlight ); but light doesn't work (black out), , it's same thing directionallight what problem ? note : of course if light doesn't follow camera : var directionallight = new three.directionallight( 0xffffff, 1 ); directionallight.position.set( camera.position.x, camera.position.y, camera.position.z ); scene.add( directionallight ); thanks in advance if add light child of camera, need add camera scene, light part of scene graph. var pointlight = new three.pointlight( 0xffffff ); camera.add( pointlight ); scene.add( camera ); three.js r.71

javascript - Change elements height React Angular -

i'm working angular , react (with ng-react) , i'm trying change height of 1 element match height of element. have react component both of elements inside, this: render: function() { return ( <div> <div classname="absolute" ref="absolutecell">foo</div> <th ref="emptycell" style={this.state.style}></th> </div> ) } so want set height of empty cell match 1 of absolute cell. i've tried componentdidmount this: getinitialstate: function() { return { style: { height: '30px' } } }, componentdidmount: function() { var absolutecellheight = this.refs.absolutecell.getdomnode().offsetheight; this.setstate({ style: { height: absolutecellheight } }); this.refs.emptycell.forceupdate(); } but keep getting nasty error cannot read property 'getdomnode' of undefined . there other way can achieve...

ios - Update CoreData Object -

i'd update coredata object. backgrund: made app includes uitableview. in textlabel of uitableviewcell name. in detailtextlabel of cell date can changed/updated. i'd change date. i wrote following code: var people = [nsmanagedobject]() func savedate(date: nsdate) { //1 let appdelegate = uiapplication.sharedapplication().delegate appdelegate let managedcontext = appdelegate.managedobjectcontext! //2 let entity = nsentitydescription.entityforname("person", inmanagedobjectcontext:managedcontext) let person = people[dateindexpath.row] //3 person.setvalue(date, forkey: "datum") //4 var error: nserror? if !managedcontext.save(&error) { println("could not save \(error), \(error?.userinfo)") } //5 people.append(person) tableview.reloaddata() } now, if run code: date updated cell in date has been updated displayed 2 times. example if ...

ios - App Content not filling simulator window -

just having xcode issue i'm sure tied setting can't find. im storyboard, content fills entire view (i.e background image), when run app in iphone 6 simulator, background image , content don't fill entire screen. there white space right of , below content on simulated "screen". when run app in iphone 5 simulator, isn't issue , fills entire simulated view. so, did miss? want make app work on models of iphone. thanks help! there several ways solve this, , guess using view size inferred or iphone4 inch in attribute inspector. first way use autolayout @ storyboard add constraint. if don't want use this, should @ least set autoresizing @ size inspector.

javascript - How to call an exception with post method (AJAX)? -

if post method unsuccessful want throw exception , write error log? if method returns no results want throw exception , write file. post method: $.post("ip.php", function( data ){ $("#ip").val(data.ip); $("#country").val(data.country); $('#campaignid').val(data.campaignid); }, "json"); for part of question: if post method unsuccessful want throw exception (...) you chain .fail() callback method $.post() request mentioned @grimbode or use $.ajax() instead, error option - function called if request fails. $.ajax() equivalent $.post() method be: $.ajax({ type : "post", url : "ip.php", datatype : 'json', success : function(data){ $("#ip").val(data.ip); $("#country").val(data.country); $('#campaignid').val(data.campaignid); }, error : function(jqxhr/*object*/, textstatus/*string*/, errorthrown...

asp.net mvc - Nginx to iis forwarding Error 400 -

please me. have iis server , nginx proxy on it. when connected nginx 400 bad request (invalid hostname) error , when press f5 , reload page site loading correct (200 code) without scripts\css... , when press f5 angain 400 error , on. iis on http://localhost:81 i tried 2 nginx configs: first location / { proxy_pass http://localhost:81; proxy_set_header host $host; proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $remote_addr; port_in_redirect off; proxy_connect_timeout 300; } second location / { proxy_pass http://localhost:81; proxy_set_header host $host; proxy_set_header x-accel-expires 0; proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; } both first , second config have error. nginx of 1.6.2 version. nginx error.lo...

c# - Grouping by when id can be in column 1 or 2 -

on website, members can send messages each other. here message class : public partial class message { public system.guid id { get; set; } public system.datetime datemsg { get; set; } public string senderid { get; set; } public string receiverid { get; set; } public string text { get; set; } } i'd query last message each opened discussion. since have no "discussion id", can't "group discussionid" , select first 1 in each group. how ? public ienumerable<message> get_discussionsfor(string userid) { list<message> list; using (var context = new modelcontainer()) { iqueryable<message> dbquery = context.set<message>(); list = dbquery .asnotracking() .where(m => m.senderid.equals(userid) || m.receiverid.equals(userid)) .orderbydescending(m => m.datemsg) ...

css - Border Radius Issue in Chrome/Safari - Image is not clippping porperly -

i have been in particular issue burnt 2 hours. cannot figure out , need fresh perspective. uniquely facing bottom right border radius not showing in chrome , safari. i using bootstrap carousel , using slide image 100% width , has left margin of 10px , edges rounded on top & bottom left using css here link demo have uploaded. comment/suggestion/workaround appreciated. if check in ie10 or mozilla find there no issue

php - Fatal error: Call to a member function first() on a non-object -

yes know there lot of questions topic searched , tried answers none of them helped me. that's why created question own code. class student{ private $_db, $_first; public function __construct() { $this->_db = db::getinstance(); } public function getlast($fields = array()) { $columns = 'admission_no, id'; $orderby = 'id'; $order = 'desc'; if(!empty($fields['columns'])){ $columns = $fields['columns']; } if(!empty($fields['order_by'])){ $orderby = $fields['oder_by']; } if(!empty($fields['order'])){ $order = $fields['order']; } $data = $this->_db->query("select {$columns} students order {$orderby} {$order} limit 1"); if($data->count()){ $this->_first = $data->first(); return true; } return false; } public function first() { return $this->_first; } } above...

intellij idea - How to resize splitter in PhpStorm -

i see can resize side sidebar using ctrl + shift + arrows . how can same thing vertical/horizontal split. at moment cannot via keyboard -- mouse only. https://youtrack.jetbrains.com/issue/idea-67379 -- watch ticket (star/vote/comment) notified on progress.

arrays - How to populate ExpandableListView in Android at Runtime? -

array "feedback" contains keyword_id , feedback eg. {keyword_id= 1, feedback="test1"}, {keyword_id=1, feedback="test2"}, {keyword_id=2, feedback="test1"} so, want add every keyword_id listdataheader , feedback listdatachild. keyword_id=1 should show 2 feedbacks , keyword_id=2 should show feedback. how can achieve that? my current code able show keyword_id=1 , feedback="test1" try { jsonobject jsonresponse; jsonresponse = new jsonobject(result); jsonarray jsonmainnode = jsonresponse.optjsonarray("feedbacks"); if(jsonmainnode != null) { int lengthjsonarr = jsonmainnode.length(); (int = 0; < lengthjsonarr; i++) { listdataheader = new arraylist<string>(); listdatachild = new hashmap<string, list<string>>(); jsonobject jsonchildnode = jsonmainnode.ge...

xml - PHP changing the value of an svg node -

i have huge svg file( https://gist.githubusercontent.com/anonymous/273dda3478d676ab1d5d/raw/gistfile1.xml ) , want change value of each *. need loop through tspan nodes , gives me values of it, can compare them other value , change value of node. have tried lot, nothing worked me. can of can me working loop change tspan values? why don't read xml , read token after token until find open tspan tag? can manipulate , save xml. http://php.net/manual/de/class.domdocument.php

jar - Maven reduce bundles size by excluding unneeded dependencies in bulk? -

the project i'm working on has dependencies on few known , big libraries. things working well, transitive dependencies playing nice each other, now. unfortunately total bundle size around 100 megs. i'm not sure if large or not, there way in maven remove dependencies, without making pom.xml verbose , long? and pointers me in right direction awesome! you can remove dependencies declaring exclusions. question post first though .. why want remove them? unless know dependencies not needed, might not make sense try remove them. not if there no issues e.g. in terms of application performance or startup times. the maven dependency plugin eclipse integration have tools allow understand dependencies better tools dependency:tree goal or dependnecy hierarchy view of pom. don't try fix not broken. but .. if know needed @ runtime , use tooling maven , m2e can potentially remove lot of bulk of final artifact. have configure in pom using dependency exclusions. ne...

regex - excel VB regexp 5.5 capturing group -

i have problem using regexp in excel macro, calling regex.execute(string), instead of getting array of returned capturing groups, single return whole string specified in pattern. using same pattern in http://www.regexr.com/ , can see return nicely grouped. missing this: private sub parsefilename(strinput string) dim regex new regexp dim strpattern string dim strreplace 'sample string \\work_dir\ftp\results\reva\ftp_01_01_06_results\4f\acc2x2r33371_sasssd_run1 strpattern = "ftp_(\w+)_results\\(\w+)\\([\d,\d]+)_(sas|sata)(hdd|ssd)_run(\d)" regex .global = true .multiline = false .ignorecase = false .pattern = strpattern end if regex.test(strinput) set strreplace = regex.execute(strinput) activecell.offset(0, 1) = strreplace.count else activecell.offset(0, 1) = "(not matched)" end if end sub in end, strreplace.count shows 1, whole string ftp_01_01_06_results\...

c# - Read then write html to xml file using linq xml and xml writer -

i reading value of element <content>text <br /> break</content> string , showing string in textbox . afterwards user can modify possibly additional html tags. upon using linq query exact node insert user-input spiky bracket <> html tags normalized &lt;br /&gt; . how preseve html tags? i read , tried solutions these questions failed apply use case: c# xml avoid html encode using xdocument get html tags embedded in xml using linq keep html tags in xml using linq xml http://blogs.msdn.com/b/charlie/archive/2008/09/29/linq-farm-preserving-formats-with-linq-to-xml.aspx this example of xml file: <events> <event id="0"> <content><br/></content> </event> </events> how load , query: xdocument xml; xmltextreader xtr = new xmltextreader(this.pathxml); xtr.normalization = false; xml = xdocument.load(xtr, loadoptions.preservewhitespace); xtr.close(); var nodetoedit = xml.desce...

javascript - In HTML5 how do you make spefic video players pop up as a result of dropping and dragging spefic images into a div? -

i able drop , drag images div. have 2 images. problem want when image 1 "carrots.jpg" dragged , dropped div video play lets "video 1" , when image 2 "pepper.png" dragged , dropped div "video 2" play. videos show in pop-up windows. how do this? here of code display how i'm doing drop , drag event. #div1 {width:20%;height:20%; position:absolute; left:50%; top:50%; margin-right: -50%; transform: translate(-50%, -50%); z-index:-1; } #drag2{width:20%; height:20%; position:absolute; left:50%; top:50%; margin-right: -50%; transform: translate(-50%, -50%); z-index:-2; } #drag1{ width:10%; height:10%; position:absolute; top:50%; left:20%; margin-right: -20%; transform: translate(-20%, -25%); z-index:-3; } #drag3{ width:10%; height:10%; position:absolute; top:70%; left:30%; margin-right: -30%; transform: translate(-30%, -70%); z-index:-3; } </style> <script> function allowdrop(ev) { ev.preventdefault(); } fu...

c++ - How to make this "template / constexpr" construct more elegant / less verbose? -

i have pseudo bitfield implementation: class field { public: constexpr field(int i, int s) : index(i), size(s) {} constexpr field(const field & prev, int s) : index(prev.index + prev.size), size(s) {} int index, size; }; #define field(name, i, s) constexpr static const field name = {i, s}; template<typename t = quint32> class flags { public: flags(t d = 0) : data(d) {} inline t readfield(const field & f) { return (data & getmask(f.index, f.size)) >> f.index; } inline void writefield(const field & f, t val) { data = (data & setmask(f.index, f.size)) | (val << f.index); } private: static constexpr t getmask(int i, int size) { return ((1 << size) - 1) << i; } static constexpr t setmask(int pos, int size) { return ~getmask(pos, size); } t data; }; however, quite verbose use in present form: struct test { flags<> flags; field(one, 0, 1) field(two, one, 2) }; test t; t.flags.r...

parse.com - Parse Android: update ParseObject containing an array of ParseUsers throws UserCannotBeAlteredWithoutSessionError -

im working on android app. i have custom class has relations 2 parseusers , other fields. suggested docs, used array (with key "usersarray") store pointers 2 parseusers, because want able use "include" include users when query custom class. can create new object , save successfully. //my custom parse class: customobject customobject = new customobject(); arraylist<parseuser> users = new arraylist<parseuser>(); users.add(parseuser.getcurrentuser()); users.add(anotheruser); customobject.put("usersarray", users); //i store other variable update later customobject.put("othervariable",false); customobject.saveinbackground(); also, can query with: parsequery<customobject> query = customobject.getquery(); query.whereequalto("usersarray", parseuser.getcurrentuser()); query.whereequalto("usersarray", anotheruser); query.include("usersarray"); query.findinbackground( .... ); my problem when try...

Javascript default object method -

this question has answer here: does javascript have ruby's method_missing feature? 7 answers set default value of javascript object attributes 11 answers is there way how create default method call when method called object undefined? e.g. myobj = { default: function(){ console.log("you've called method isn't defined"); }, sayhi: function(){ console.log("myobj says hi!"); } } //console output: "myobj says hi!" myobj.sayhi(); //console output: "you've called method isn't defined" myobj.methodthatisnotreallythere();

ruby on rails - Using if .present? redirect -

i feel simple i'm banging head against wall. i'm trying tell rails app if 1 parameter present (signature in example) want redirect home. here's code: <%= if @pc.signature.present? %><% redirect_to "pages#home" %><%end%> i keep running syntax error. in edit.html.erb file way. perhaps in controller didn't define @pc? also, use path instead of 'pages#home'. should more this: def edit @pc = pc.find(params[:id]) #or whatever logic redirect_to root_path if @pc.signature.present? # otherwise 'edit' template rendered end

php - SQL insert into select issue -

so think i'm close figuring out query won't add item "pending" table "items" table. can guys me out please. if want delete after gets added should add code below insert select query? thanks action.php: $sql = "insert items (photo,title,description, name) select (photo,title,description, name) pending"; $stmt = $conn->prepare($sql); $stmt->execute(); example delete query after takes item "pending" items: $idtodelete = filter_var($_post["recordtodelete"],filter_sanitize_number_int); //try deleting record using record id received post $sql = "delete pending id = :id"; $stmt = $conn->prepare($sql); $stmt->bindparam(':id', $idtodelete, pdo::param_int); $stmt->execute(); i think leaving open mistakes doing way. consider happen if new row added pending queue after have issued insert select before have started delete. i think need in more controlled way inside single lo...

sql - How to truncate and add new rows to the table with a select query never getting empty results -

i have requirement table holds state of things. table truncated , new status data in inserted in every second. problem if select query executed between delete , following insert, user empty table in return. sql transactions not here think not sure. also, if select query executed between delete , insert query, shouldn't return error because blocked database lock. should wait till delete + insert operation finished. what best way implement such system? how should form "delete + insert" query , "select" query? thank in advance. --------additional information table result of multiple heavy queries , updated every second applications not run heavy queries , instead, required information table. truncate , insert every second , multiple selects @ random. don't truncate table. instead, insert new status using identity primary key or date primary key. do: select top 1 date table order date desc or select max(date) table (these should have...

openerp - Error in original version of Odoo (fleet module) -

when install odoo , fleet module can open user admin view. when upgrade fleet , open admin interface have error (upgrade base module delete error when upgrade next time fleet have same problem !!!) traceback (most recent call last): file "/opt/odoo/openerp/http.py", line 530, in _handle_exception return super(jsonrequest, self)._handle_exception(exception) file "/opt/odoo/openerp/http.py", line 567, in dispatch result = self._call_function(**self.params) file "/opt/odoo/openerp/http.py", line 303, in _call_function return checked_call(self.db, *args, **kwargs) file "/opt/odoo/openerp/service/model.py", line 113, in wrapper return f(dbname, *args, **kwargs) file "/opt/odoo/openerp/http.py", line 300, in checked_call return self.endpoint(*a, **kw) file "/opt/odoo/openerp/http.py", line 796, in call return self.method(*args, **kw) file "/opt/odoo/openerp/http.py", line 396, in response_wr...

xml - Uniqueness in XSD or DTD with namespaces -

i need create rules in .xsd or .dtd these cases: the name of songs can't repeated. (i not sure if did in code, please check) the elements comments , genre can optional, rest of them required. (i not sure if did in code, please check) there 3 types of values element genre, pop, rock , jazz. (i sure did in code, please check) this code, getting errors http://www.xmlvalidation.com/ in xml document: 7: 60 attribute "xmlns" must declared element type "catalog". 7: 60 attribute "xmlns:xsi" must declared element type "catalog". 7: 60 attribute "xsi:schemalocation" must declared element type "catalog". catalog.xml <?xml version="1.0" encoding="utf-8"?> <!doctype catalog system "catalog.dtd"> <catalog xmlns="http://www.w3schools.com" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemaloc ation="http://www.w3schools.com c...

java - What dependencies must be added to make Hibernate and Spring MVC project -

i trying add dependencies project. added maven plugin eclipse link http://eclipse.org/m2e/ here generated pom.xml <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>dddddd</groupid> <artifactid>ss</artifactid> <version>0.0.1-snapshot</version> <packaging>jar</packaging> <name>ss</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>3.8.1</version> <scope>test...

python - Passing file to function to parse -

i have upload form takes file , sends function parse. csv file , im using datafield type store it. views.py def upload(request): # handle file upload if request.method == 'post': form = uploadform(request.post, request.files) if form.is_valid(): newdoc = csv(file=request.files['csvfile']) newdoc.save() # send file parser import fanduel.load_data fanduel.load_data.parse(newdoc.file, request.user) # redirect document list after post return httpresponseredirect(reverse('app.views.upload')) else: form = uploadform() # empty, unbound form load_data.py def parse(file, username): import csv datareader = csv.reader(open(file), delimiter=',', quotechar='"') forms.py # in forms.py... django import forms class uploadform(forms.form): csvfile = forms.filefield( label='select csv file', ...

r - OpenCPU Functions -

i trying out opencpu software making r-based functions available web services. created (for testing purposes) function takes true/false , returns 1 of 2 strings result. i managed web service running (in single-user mode, on own computer). however, when try access web service posting, return value isn't result of function, instead bunch of urls: /ocpu/tmp/x038e60b267/r/.val /ocpu/tmp/x038e60b267/stdout /ocpu/tmp/x038e60b267/source /ocpu/tmp/x038e60b267/console /ocpu/tmp/x038e60b267/info /ocpu/tmp/x038e60b267/files/description the first url return result of function call, nice. isn't there way return value post result of function call, rather bunch of urls? i'm sure i'm missing obvious here. this trivial. if append "/json" end of url, return result json.

shared ptr - C++ conversion from to non-scalar type requested -

i trying overload + operator member function can add 2 polynomial objects (which linked lists) , keep getting error message conversion 'polynomial*' non-scalar type 'std::shared_ptr<polynomial>' requested don't understand causing this? have declared 2 shared pointers term objects don't understand why can't polynomial object? polynomial polynomial::operator+( const polynomial &other ) const { shared_ptr<polynomial> result = new polynomial(); shared_ptr<polynomial::term> = this->head; shared_ptr<polynomial::term> b = other.head; double sum = 0; for(a; != nullptr; = a->next) { for(b; b != nullptr; b = b->next) { if(a->exponent == b->exponent) { sum = a->coeff + b->coeff; result->head = shared_ptr<term>(new term( sum, a->exponent, result->head )); cout << "function has f...

c++ - How is ambiguity determined in the overload resolution algorithm? -

i'm trying understand overloading resolution method. why ambiguous: void func(double, int, int, double) {} void func(int, double, double, double) {} void main() { func(1, 2, 3, 4); } but isn't? void func(int, int, int, double) {} void func(int, double, double, double) {} void main() { func(1, 2, 3, 4); } in first case there 2 exact parameters matches , 2 conversions against 1 exact match , 3 conversions, , in second case there 3 exact matches , 1 conversion against 1 exact matches , 3 conversions. so why 1 ambiguous , 1 not? logic here? the overload resolution rules define partial order on set of matches - if overload f1 not better match f2 , not imply f2 better match f1 . exact partial order can thought of comparing 2 points in k dimensions, number of arguments k . lets define partial order on points in k -dim space - (x_1, x_2,..., x_k) < (y_1, y_2,..., y_k) if x_i <= y_i , x_j < y_j @ least 1 j . partial order on candidate non-t...

ios - Exception thrown if string is null -

i getting exception if string null: terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nsnull length]: unrecognized selector sent instance this 1 of objects of dictionary,that contains null string: { cabdriver = "<null>"; code = sv1000000079; date = "2015-03-15"; destiny = ""; email = "jose@gmail.com"; origin = vxd; } and code exception thrown: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { historialcelltableviewcell *cell = (historialcelltableviewcell *)[tableview dequeuereusablecellwithidentifier:@"cell"]; nsstring *origin = [[historialservicios objectatindex:indexpath.row] valueforkey:@"origin"]; if (origin.length ==0){ cell.origen_label.text = @"-"; } else { cell.origen_label.text = origin; } nsstring *destiny = [[historialservicio...

osx - Installing TexturePacker in Travis CI -

i'm trying install texturepacker inside travis ci. following 4 commands run fine , return exit code 0 on mac. language: objective-c install: - hdiutil attach -mountpoint dmg client/texturepacker-3.2.1-uni.dmg - cp -ra dmg/texturepacker.app . - hdiutil detach dmg - echo agree | texturepacker.app/contents/macos/texturepacker --version &> /dev/null on travis following error occurs. the command "echo agree | texturepacker.app/contents/macos/texturepacker --version &> /dev/null" failed , exited 10 during . any ideas? texturepacker 3.2.1 doesn't support agreement via terminal. solution upgrade texturepacker, 3.6.0 worked.

jquery - how to get data from 'ImmutableMultiDict' in flask -

i learning how use ajax , flask ,so send ajax request , receive data post request in python file my html file contains code var data = {"name":"john doe","age":"21"}; $.ajax({ url:'/post/data', datatype : "json", contenttype: "application/json; charset=utf-8", data : json.stringify(data), success : function(result) { jquery("#clash").html(result); },error : function(result){ console.log(result); } }); and python file contains : @app.route('/post/data',methods=['get','post']) def postdata(): #do data = str(request.args) json_dumps = json.dumps(data) return json_dumps this gives me following data on page "immutablemultidict([('{\"name\":\"john doe\",\"age\":\"21\"}', u'')])" and request.query_string looks {%22name%22:%22john%20doe%22,%22age%22:%2221%22} so how name , ag...

vb.net - Remote cocreate call "Class not registered" -

i have read can find on net "class not registered". i have vb com dll have installed on server. (i did not write dll don't have source) server 64 bit i have 32 bit program (delphi7) on 64 bit machine. the program cocreate server name , gets "class not registered". if put program on server , run cocreate works, class registered. in desperation did install of dll on local pc , cocreate works i checked registration on both machines, identical, , registry hkey_classes_root_wow6432node\clsid\ on both machines has registration guid. setup/registration process on each machine being identical. why create when call local (on both machines) , not when call remote? it seem remote call pc server though 32 bit program being seen server 64 bit call. note: server virtual server, make difference? any appreciated. the server has program called pastel partner uses pervasive btrieve vb6 dll (and associated dlls) separate program can accessed via interfa...

Delphi 2007, Indy 10 - What is the simplest TCP/IP setup for transferring a block of data in one direction -

i have application (the "server") updates block of data in memory - around 100k bytes - every second. there 1 4 other instances of "client" application running on other workstations on same network, , these need read same 100k image every second. this has been implemented til writing image file on server , having clients read file across network. has worked no problems many years, lately (coincident move windows 8-based hardware) has developed problem file becomes inaccessible nodes except one. exiting client application running on node frees file , becomes accessible again everyone. i'm still perplexed the cause of lockout, i'm wondering if may mechanism discussed here , file isn't closed due network glitch. i'm thinking having clients request data on tcp/ip avoid this. there doesn't need handshaking other clients failing connect or read data - server needs go it's business , respond requests grabbing data , sending it. i...

c++ - What buffers to use for stereo in Qt using QOpenGLWidget? -

i'm trying stereoscopic visualization in qt. have found tutorials of them use older qglwidget , buffers gl_front_left , gl_front_right . as i'm using newer qopenglwidget tried drawing images same buffers call gldrawbuffer(gl_front_left) generating gl_invalid_enum . i saw default buffer gl_color_attachment0 instead of gl_front_left imagine need use different set of buffers enable stereo. which buffers should use? you should use gldrawbuffer(gl_back_right); gldrawbuffer(gl_back_left); look link i working on same thing nvidia quadro 4000 . no luck yet, got 2 images offset, ir tansmitter light screen flicker! got it: sync 60hz, put 120 , works fine still need work on right/left frustrum eureka.

php - How to display all checkboxes values in a div using ajax -

Image
i have multiple checkboxes displayed mysql table. i'm trying pass checked values <div> using ajax . currently, code passes 1 checked value <div> . want display checked values in <div> . what have far: <?php $sql="select * options cat_id='".$id."' , opg_id='".$group."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ ?> <input type="checkbox" name="<?php echo $row['op_id']; ?>" onclick="showprice(this.name)" value="<?php echo $row['price']; ?>"/> <!-- display prices mysql table in checkbox. pass `id` ajax name attribute. --> <?php } ?> ajax <script> function showprice(name) { $.ajax({ url: 'ajax_price.php', type: 'get', data: {option : name}, success: function(data) { document.getelementbyid('c').innerhtml =data; ...

linux - How to compile libsqlite3 for python without root privileges -

i need install python 3 in 1 web server(linux) , not have root access. installed in home path. however, cannot import sqlite python command shell. searched , found need install libsqlite3. have following problems: now not have root access, need compile libsqlite3 myself. not have trusted source code url, can guide me there? how can make python aware of library compiled out of libsqlite3 source code?

c# - ASP.NET MVC service route overrides default route -

i have added wcf service mvc 5 application, , created route it: public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.add(new serviceroute("service1.svc", new servicehostfactory(), typeof(service1))); routes.maproute( name: "default", url: "{controller}/{action}/{id}", defaults: new { controller = "home", action = "index", id = urlparameter.optional } ); } the problem links leads service1.svc route now. @html.actionlink("passport maker", "index", "home", new { area = "" }, new { @class = "navbar-brand" }) become http://localhost:50099/service1.svc?action=index&controller=home , other links change in same way. if add serviceroute after "default" route, links work correctly service unavailable. why happens (there no "service1" in links, why ...

ruby on rails - add contact is not present on mobile in diaspora -

i have working diaspora pod on heroku working cool except when users log in there mobile device cant add 1 onto there aspects because add contact option not there on mobile site.does know how fix it..?? see https://github.com/diaspora/diaspora/pull/5594 please see https://wiki.diasporafoundation.org/how_we_communicate , stackoverflow not right place kind of question.

Group by key in crossfilter data in table structure. I do not need the chart -

i have large set of records on 5 million. have managed pull data json using crossfilter in table structure. want group data using symbol key. appreciated. here code d3.json("my_json_file.json", function(error, json_data) { var data = crossfilter(json_data), typedimension = stocks_jsoncs.dimension(function (d) { return d.symbol; }); typegroup = typedimension.group().all(); $('#stk_table').datatable({ "aadata": typedimension.top(infinity), "aocolumns": [{ "mdataprop": "id" }, { "mdataprop": "symbol" }, { "mdataprop": "stock_name" }, { "mdataprop": "changepercent" }, { "mdataprop": "close" }, { "mdataprop...