Posts

Showing posts from January, 2013

google app engine - GAE: Prevent inadvertent overwriting of data -

suppose have entity person 2 properties: class person(ndb.model) payments = ndb.integerproperty(default=0) name = ndb.stringproperty() i thinking update payments in transaction not need transactions when updating name . however, seems in following scenario, lose value of payments : time | instance1 | instance2 (in transaction) ===================================================== || | person1 = key1.get() | || | person1.name = "john" | person1 = key1.get() || | [other stuff that] | person1.payments = 100 || | [takes time] | person1.put() || | person1.put() | || | \/ in scenario, seems instance1 overwrite payment amount written in instance2 , payment amount lost. does mean need use transactions when updating name make sure important data never lost? or more generally, if using transactions update property of entity, should use transactions updates entity? yes, lose new value

c - posix thread memory consumption -

i have c program creating detached thread child. inside of function pass pthread_create use pthread_detach detach thread. @ end call pthread_exit((void *) 0) i know if normal behaviour memory consumption increases after thread created. i did valgrind check , there no leaks 4 suppressed errors. i know if normal behaviour memory consumption increases after thread created. yes, each thread gets own stack assigned. size os setting dependend , around 1m. some system resource used manage each thread itself. both released if thread ends detached thread or if thread joined joinable thread.

c++ - rosrun via ssh doesnt start a node properly -

we working ros , try run node via ssh in shell script. have controlling (master) computer on execute script following line: ssh user@xxx.xxx.x.x -x "/bin/bash -c 'source /etc/profile; rosrun stargazer_alter stargazer_node'" the node getting started (it occurs in "rosnode list" , node listed publisher in "rostopic info") main method seems not executed (neither print lines show nor messages published). #include "stargazer_listener.h" enum states {config, readdata}; int main(int argc, char** argv) { ros_info("test!!!! stargazer starts!"); ros::init(argc, argv, "stargazer_node"); stargazer_listener starg; int ifd = 0; char *rec_msg = (char*)malloc(buffsize * sizeof(char)); ifd = starg.portsetup(); states state = config; while(ros::ok()) { switch(state) { case config: starg.cmd(ifd, rec_msg, "~#calcstop`"); printf("calcstop\n"); s

C++ array initialization by reference through function -

i'm working on project requires many dynamically sized 2d arrays need accessible across functions. code i'm working on uses pointers double** dynarray this. r = ...; // rows of matrix, unknown prior runtime c = ...; // columns of matrix, unknown prior runtime double** dynarray; after checking existing code found arrays being initialized this: double** dynarray = new double*[r]; for(int r=0; r<r; r++){dynarray[r] = new double[c];} in order improve readability write method above. here's came allocate void initialize2d(double*** data, int r, int c){ (*dynarray) = new double*[r]; for(int r=0; r<r; r++){ (*dynarray)[r] = new double[c]; for(int c=0; c<c; c++){ (*dynarray)[r][c] = 0; } } } and free memory respectively: void free2d(double*** data, int r, int c){ for(int r=0; r<r; r++){ delete[] (*data)[r]; } delete *data; } i intended use these methods this: r = ...; // ro

javascript - How can I display a success message after the user submit the form -

$('input[type="submit"]').click(function(){ reseterrors(); $.each($('form input, form textarea, form select'), function(i, v){ if(v.type !== 'submit'){ data[v.name] = v.value; } }); $.ajax({ datatype: 'json', type: 'post', url: 'libs/contact.php', data: data, success: function(resp){ if(resp === true){ $('form').submit(); if(status == "success"){ console.log('success') } return false; } else { $.each(resp, function(i, v){ console.log(i + " => " + v); var msg = &#

javascript - ASP.Net checkbox postback doesn't fire -

i'm making change existing asp.net application via js. i'm unable @ nor edit original asp.net code. able inject js webpage. there 2 radio buttons, , want change default 1 other, can via js. when using web app, when other radio chosen can see there server post happening , js code toggle checkbox not fire this. because of this, server side function isn't getting ran allow me submit form. just reference here js code works fine, nothing troubleshoot here. after inspecting radio in chrome i'm unable see event being fired. might not understand how inspect elements in chrome, advice? $(window).load(function() { // tests selected value if ($("input[name*='radshippingaddresslist']:checked").val() == "radselectaddress") { // changes radio button $("input[name*='radshippingaddresslist'][value='radasbilling']").prop("checked", true); } }); you need invoke click method

python 3.x - White spaces in Theano arrays -

i started playing around theano , got surprised result of code. from theano import * import theano.tensor t = t.vector() out = + ** 10 f = function([a], out) print(f([0, 1, 2])) using python3 get: array([ 0., 2., 1026.]) the array correct, contains right values, printed output odd. expect this: array([0, 2, 1026]) or array([0.0, 2.0, 1026.0]) why so? white spaces? shall concerned about? what you're printing numpy.ndarray . default format when printed. the output array floating point array because, default, theano uses floating point tensors. if want use integer tensors need specify dtype : a = t.vector(dtype='int64') or use bit of syntactic sugar: a = t.lvector() compare output output of following: print numpy.array([0, 2, 1026], dtype=numpy.float64) print numpy.array([0, 2, 1026], dtype=numpy.int64) you can change default printing options of numpy using numpy.set_printoptions .

javascript - jQuery filter - sort by attribute and sort by price -

i'm trying create dropdown filters content. have 2 different types of filters in this: 1) filter sorts price 2) filter sorts attribute tagged in product. i'm new implementing type of request. have 2 semi-working, seems 2 filters conflicting each other. example: if filter price first, , try filter attribute (dropdown), doesn't filter correctly. filters correctly if filter down either price or dropdown. also, right have price filtering buttons, price in separate dropdown well. i'd add "best seller" attribute in there, , tag products in terms of best-selling. possible? can help? take look? thanks , help! fiddle: https://jsfiddle.net/daysable/eags255n/ my code below: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="tex

html - Fit width of a div inside another div that has padding left and right -

i have divs. div outside has left , right paddings. div inside has width of 100%, these 100% not include padding left , right. example: <div style="width:200px; height: 300px; padding-left:15px; padding-right:15px; background-color:green"> <div style="width:100%; height:300px; background-color:blue"> <div> my goal is, blue div becomes width green div. not want leave 100% width blue , enter in px keep responsive website. there html/css way? you try this: <div style="width:200px; height: 300px; padding-left:15px; padding-right:15px; background-color:green"> <div style="width: calc(100% + 35px); height:300px; background-color:blue; margin-left: -15px;"> <div>

ios - Bad practice storing long strings in CoreData? -

Image
i understand similar question has been asked before, assure not duplicate. i have unknown amount of ints need stored coredata, preferably inside of 1 row. since amount of ints unknown wondering if or bad practice, creating long string of ints subsequently separating them dash example. when string fetched coredata use simple split split them respective form. mentioned bad practice? if so, how differently? if don't have query ints , can use nsarray transformable property. this converted in binary , stored blob. here example:

windows runtime - DevCenter package submission error -

Image
i completed first own windows store app, trying submit on windows store. followed guidelines problem everytime occurs after uploading package. package uploaded, analyzed , "error" shown. nothing more. wack test ok. there way how know, wrong packages? sometimes store has issues chrome or other browsers, try using ie, maybe helps.

java - MySQL CallableStatement.getObject have inconsistent behavior -

i have following simple procedure defined within in test schema, _test_jdbc_inconsistency , in instance of mysql on development system create procedure _test_jdbc_inconsistency.proc(in param1 boolean, out param2 boolean) begin if (param1 null) set param2 = null; else set param2 = not param1; end if; end but surprise, following simple test fails @test(dataprovider = "connectionpool") public void testjdbcinconsitencyoutparametertype(connection con) throws sqlexception, ioexception { con.setcatalog("_test_jdbc_inconsistency"); try (callablestatement statement = con.preparecall("{call proc(?, ?)}")) { statement.setint("param1", 5); statement.registeroutparameter("param2", types.integer); statement.execute(); asserttrue(statement.getobject(2) instanceof integer); assertequals(statement.getobject(2), 25); asserttrue(statement.getobject("param2") i

how to import library and modules to android studio properly -

i want use library ( https://github.com/ikimuhendis/ldrawer ) in project. when import new modules can't see is? , gradle error occur this: cant find runproguard and replaced minifyenabled error occur "change gradle version error:library projects cannot set applicationid. applicationid set in default config" then clear applicationid still have error! can't understand sample folder, library folder, or root folder in project! have import one?! i import sample project , root of project import new project have errors! newly migrate android studio eclipse bcz many open source project using android studio.i guess of question because can't understand android studio structure properly! use build.gradle import project easily. make sure add build.gradle under app(or custom name) folder in build.gradle file, add following dependencies, sync gradle. that's need do dependencies { compile 'com.ikimuhendis:ldrawer:0.1' compile 'c

In Java, do accessor methods always need to return a value? -

i wondering if accessor methods in java need return value. because "access" method print etc. for example, method below considered accessor method in class? public static void getcapacity(){ system.out.print("capacity 0"); } access methods needed value. call method value, , continue work him (or, example, compare something). one oop principles the principle of encapsulation - values of closed fields of class using access methods. here we expect see informative message : public void printcapacity(){ system.out.print("capacity 0"); } in method, we expect value : public int getcapacity(){ return this.capacity; }

Yii2 : Setting two values of Key in SqlDataProvider -

i have table have_schedule (many-to-many relations) in database contains foreign key tables : table student : student_id , student_name table schedule : sch_id , sch_day, sch_time and table have_schedule : student_id , sch_id and want create dataprovider using sqldataprovider this $dataprovider = new sqldataprovider([ 'sql' => $sql, 'totalcount' => $n, 'key' => '', // <--------- key 'sort' => [ 'attributes' => [ 'student_name', 'sch_day', 'sch_time', ], ], 'pagination' => [ 'pagesize' => 20, ], ]); the key used actioncolumn , example : /view?student_id=1&sch_id=2 . how set key's value student_id , sch_id ? the simplest way

angular - How to setup a router-link? -

i have read several blog posts 1 , including official documentation , router-link can setup using following markup: <nav> <ul> <li><a router-link="start">start</a></li> <li><a router-link="about">about</a></li> <li><a router-link="contact">contact</a></li> </ul> </nav> and routeconfig: import { start } './components/start'; import { } './components/about'; import { contact } './components/contact'; // ... @routeconfig([ { path: '/', component: start, 'start'} { path: '/about', component: about, 'about'} { path: '/contact', component: contact, 'contact'} ]) running above code using 2.0.0-alpha.31 build produces following error: typeerror: list.reduce not function in [red in null] stacktrace: error: typeerror: list.reduce not function in [red in null]

python - Cloudsearch Request Exceed 10,000 Limit -

when search query has more 10,000 matches following error: {u'message': u'request depth (10100) exceeded, limit=10000', u'__type': u'#searchexception', u'error': {u'rid': u'zpxdxukp4befcigqeq==', u'message': u'[*deprecated*: use outer message field] request depth (10100) exceeded, limit=10000'}} when search more narrowed down keywords , queries less results, works fine , no error returned. i guess have limit search somehow, i'm unable figure out how. search function looks this: def execute_query_string(self, query_string): amazon_query = self.search_connection.build_query(q=query_string, start=0, size=100) json_search_results = [] json_blog in self.search_connection.get_all_hits(amazon_query): json_search_results.append(json_blog) results = [] json_blog in json_search_results: results.append(json_blog['fields']) return results and it's being

json - Java Database Correct Approach -

i have built small javafx 2 scenes. user can input 3 fields (text) , upload documents object. so thinking when user clicks save json object created , appended list of json objects. json objects written file. this of thinking: { "objects": { "object1": { "field1": "foo" "field2": "foo" "field3": "foo" "folderwithfileslocation": "c:/programfiles/myapp/foobar/" }, "object2": { "field1": "foobar" "field2": "foobar" "field3": "foobar" "folderwithfileslocation": "c:/programfiles/myapp/barbar/" }, ....... .... .. } these read objects on startup, user has access them, can edit them, add, delete, etc etc typical crud. is correct

mysql - SQL Syntax Error: Can anyone see an issue here? -

i getting syntax error sql statement. little stumped seems ok me... insert vehicle (vin,plate,plateprov,condition,year,makecode,make,model,bstyle,mileage,colour,twotone,paintstage,impact1) values ('3vwsf31k36m617923','ardm093','on','go','06','47','volkswagen','jetta','4d sed','132123','burgundy','0','0','07') here table structure: id int(11) vin varchar(17) plate varchar(10) plateprov varchar(2) condition varchar(2) year int(11) makecode varchar(12) make varchar(20) model varchar(50) bstyle varchar(20) engine varchar(20) mileage int(7) colour varchar(20) twotone int(11) paintstage int(11) paintcode1 varchar(15) paintcode2 varchar(15) paintcode3 varchar(15) impact1 varchar(2) impact2 varchar(30) error message get: you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'condition,year,makeco

iText - roundRectangle with no border -

is possible have roundrectangle no border? following code creates roundrectangles , rectangles border sizes of 0f , 1f. roundrectangle there still visible border when linewidth set 0f, not true rectangle border of 0f. here code i'm using: magazine = new document(pagesize.letter,0,0,0,0); pdfw = pdfwriter.getinstance(magazine, new fileoutputstream("out.pdf")); magazine.open(); canvas = pdfw.getdirectcontent(); canvas.rectangle(0,0,600,750); canvas.setcolorfill(basecolor.orange); canvas.fillstroke(); canvas.setcolorstroke(basecolor.black); canvas.setcolorfill(basecolor.gray); canvas.setlinewidth(1f); llx = 100; lly = 100; wid = 100; hei = 100; canvas.roundrectangle(llx,lly, wid, hei, 10); canvas.fillstroke(); llx = 100; lly = 210; wid = 100; hei = 100; canvas.rectangle(llx,lly, wid, hei); canvas.fillstroke(); canvas.setcolorstroke(basecolor.black); canvas.setcolor

java - JVM can't find custom ClassLoader -

i have created custom java classloader can't jvm load it. i'm getting classnotfoundexception when launch application. jar contains code added classpath argument jvm. wondering if have jar in correct place...do classloaders added here? know application code gets added classpath, 1 argue if custom classloader application code or internal jvm. so, ideas? edit: ok, after thinking more, think may asking jvm circular. classloader have created system class loader. these class loaders ones search classpath classes load...but have put class loader there! so, if i'm correct, custom class loaders go?

if statement - Not Operator in Javascript gives Unexpected Token Error -

using not operator ( ! ) in conditional gives me: "uncaught syntaxerror: unexpected token !" if (text.includes(input[j])) { $(messages[i]).hide(); } else if !(text.includes(input[j])) { $(messages[i]).show(); } why isn't ! working here? ! should within () : else if (!text.includes(input[j]))

r - How to disable y-axis in mosaic plot? -

Image
how disable y-axis in mosaic plot? example: x <- data.frame(o=c(rep("aaaaaaaaaaaaaaaaaaa",50),rep("bbbbbbbbbbbbbbbbbbbbbbbbbbbbb",40),rep("cccccccccccccccccccccccccccccccc",70)),r=runif(160)) x$int <- findinterval(x$r, seq(0.1,1,0.1), rightmost.closed = true, all.inside = true) tab.dat <- with(x, table(o, int)) par(mar=c(3, 3, 3, 3)) mosaicplot(tab.dat, col=colorramppalette( c("green3", "yellow", "red"), space="rgb")(9), las=2, dir=c("h","v")) i use own axis function. how can remove y axis names? yaxt="n" works, not case. axis(2, at=seq(0, 1, = 1 / (length(rownames(tab.dat)) - 1)), labels=rownames(tab.dat), cex.axis=2.2, line=1.1, las=1) there doesn't seem way directly mosaicplot function there easy alternative. just turn tab.dat row names '' , work fine tab.dat <- with(x, table(o, int)) #i adding line of code below #just use row.n

How does the padding work in responsive CSS square? -

i learning how develop responsive liquid css designs , came across technique, block display elements (eg. div) have % dimensions. in order display them, following css code used: .class:before { content: ""; display: block; padding-top: 100%; } my confusion comes padding property. far know, in css box model (css2), padding affects inner part of block element, not outer. in technique used, without it, element not visible. explain me in terms of box model, padding property here? in case explanation confusing, attaching 2 links working examples: http://www.mademyday.de/css-height-equals-width-with-pure-css.html http://jsfiddle.net/josedvq/38tnx/ alexander. css pseudo element ::before (:before) or ::after (:after) + content property, creates child element inside container. and a percentage padding value relative width of container - w3c spec , padding-top:100% + display:block creates square. .square { width: 10%; backg

html5 - HTML srcset Specification: Clarification -

i have written javascript filler implement srcset , need clarify specified behaviour. while srcset allows specify conditions width or resolution, can’t work out whether ok specify both. example: <img src="images/oh1x408.jpg" srcset="images/oh1x192.jpg, images/oh1x408.jpg 420w, images/oh2x192.jpg 2x, images/oh2x408.jpg 2x 420w"> this supposed cover single , double resolutions, , smaller , wider screens. i have seen no examples both width , resolution specified. question is: is last image in srcset example above within specs? is else in example incorrect? thanks no, can specify 1 of both. seems, don't understand how width descriptor works. use width descriptor, won't need x descriptor anymore. here example: <img srcset="img-300.jpg 1x, img-600.jpg 2x" /> the above example can described width descriptor, this: <img srcset="img-300.jpg 300w, img-600.jpg 600w" sizes="300px"

javascript - Jquery Datatable search -

i've created datatable using jquery datatable. $('#mytable').datatable({ "pagingtype": "simple_numbers", "blengthchange": false, "idisplaylength": 10, "aasorting": [[0, 'asc']], "processing": true, "serverside": true, "ajax": $('#mytable').data('source'), "aocolumndefs": [ {'bsortable': false, 'atargets': [3, 4]} ] }); but how can search on data displayed on table? var datatable = $('#mytable').datatable(); $('#yourinputfieldid').on('input keyup paste', function () { datatable.fnfilter(this.value); }); // prevent submit on enter need prevent default behaviour of enter key on keydown event $('#yourinputfieldid').keydown(function (event) { if (event.keycode === 13) { event.preventdefault(); return false; } });

orchardcms - How to use/add existing Media Library widget into a custom widget in Orchard CMS? -

i'm writing custom widget, want create form contains image picker selects image existing media library. i've noticed use existing media library widget, have no idea how include in widget. can import editpart view somehow ? [update] here part of sample code. assuming have edit part template: @using medialibrary.filepicker //is there way add doing this?? @model maps.models.mappart <fieldset> <legend>map fields</legend> <div class="editor-label"> @html.labelfor(model => model.latitude) </div> <div class="editor-field"> @html.textboxfor(model => model.latitude) @html.validationmessagefor(model => model.latitude) </div> <div class="editor-label"> @html.labelfor(model => model.longitude) </div> <div class="editor-field"> @html.textboxfor(model => model.longitude) @html.validationmessagefor(model =>

opencsv - Aggregate CSV data with group by in Java -

Image
i need aggregate csv data group by in java. my csv file looks this: numero, numerowsn, noeudadress, packetrece, noeudsrece, hello 1436136640477044,wsn430-8,na:b27b,packet recevied from,rx: b0b4, hello #33 1436136640477257,wsn430-8,na:b27b,packet recevied from,rx: b986, hello #33 1436136640477415,wsn430-8,na:b27b,packet recevied from,rx: bc2d, hello #33 1436136640477566,wsn430-8,na:b27b,packet recevied from,rx: b36b, hello #34 1436136640477716,wsn430-8,na:b27b,packet recevied from,rx: bcb6, hello #35 1436136640477995,wsn430-9,na:bc2d,packet recevied from,rx: 1f9e, hello #33 1436136640478162,wsn430-9,na:bc2d,packet recevied from,rx: be29, hello #33 1436136640478313,wsn430-9,na:bc2d,packet recevied from,rx: b61a, hello #32 1436136640478462,wsn430-9,na:bc2d,packet recevied from,rx: c735, hello #32 1436136640478612,wsn430-9,na:bc2d,packet recevied from,rx: bb0a, hello #32 1436136640478760,wsn430-9,na:bc2d,packet recevied from,rx: b6bc, hello #33 1436136640477044,wsn430-8,na:b27b,pa

scala - Test HttpErrorHandler with scalates/specs2 in Play Framework 2.4.2 -

i have implemented own httperrorhander in play framework 2.4.2 , functions well, want able test "fake actions" intentionally throw exceptions. have tried in scalatest , specs2 import play.api.http.httperrorhandler import play.api.mvc._ import play.api.mvc.results._ import scala.concurrent._ class myerrorhandler extends httperrorhandler { def onclienterror(request: requestheader, statuscode: int, message: string) = { future.successful( status(statuscode)("a client error occurred: " + message) ) } def onservererror(request: requestheader, exception: throwable) = { future.successful( internalservererror("a server error occurred: " + exception.getmessage) ) } } i tried far following tests. try debug code, never entering methods. methods of play.api.http.defaulthttperrorhandler neither executed. object throwablecontrollerspec extends playspecification results { "example page" should { "th

bukkit - Convert Minecraft Mod into Server Plugin -

i have developing forge minecraft mods time now. wondering if possible put them on server. can't seem find direct answer. know may not place put dying know. please let me know if can it, , if so, how. you can't turn mc mod server plugin because bukkit , forge different things (take plugin dev); however, can make mod work on forge servers. when making forge server, of server's players have have client mod, in addition forge client, installed work, prepared. the first step install server. next, go forge server folder, , upload mod(s) folder. restart server , boom, there. server mods can found here . so if didn't want read this, gist of is, no , cannot, but mods can used on forge server, not plugins bukkit or spigot server, , players need clientside modpack. hope helped!

mysql group by show count 0 not sure if I can left join here -

i have query , want return row when count 0 select count(day) count, day `table` group `day` other stackoverflow answers need left join. don't know how in scenario. create table thedays ( aday varchar(20) not null ); create table sales ( id int auto_increment primary key, aday varchar(20) not null, prodid int not null, qty int not null ); insert thedays values ('sunday'),('monday'),('tuesday'),('wednesday'),('thursday'),('friday'),('saturday'); insert sales(aday,prodid,qty) values ('tuesday',101,4),('thursday',107,2); select d.aday thedays d left outer join sales s on d.aday=s.aday s.aday null +-----------+ | aday | +-----------+ | sunday | | monday | | wednesday | | friday | | saturday | +-----------+

pymongo - Error getting MongoDB by _Id in Flask -

i can query mongodb , see "_id" value this: "_id" : bindata(3,"sfgvqwmkzuiwl5dql62j2g==") using flask 0.10.1 , pymongo 3.0.3 attempt "find_one" this: record = db.collection.find_one({'_id': objectid("sfgvqwmkzuiwl5dql62j2g==")}) and error: bson.errors.invalidid: 'sfgvqwmkzuiwl5dql62j2g==' not valid objectid, must 12-byte input or 24-character hex string any appreciated. you storing _id bindata , trying retrive objectid, instead of objectid. first need convert base64string binary , try search. bi = binary.binary("sfgvqwmkzuiwl5dql62j2g=="); record = db.collection.find_one({'_id': bi}); this work you. convert id binary compare result.

parse.com - Android Parse "invalid session token" error -

i new android , stuck on seems simple problem fix don't know doing wrong! need sign user, reason e never equal null , therefore goes straight else part gives me invalid session token message. here code signup part, looked @ thousands of times!: protected edittext musername; protected edittext mpassword; protected edittext memail; protected button msignupbutton; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_sign_up_manager); musername = (edittext)findviewbyid(r.id.usernamefield); mpassword = (edittext)findviewbyid(r.id.passwordfield); memail = (edittext)findviewbyid(r.id.emailfield); msignupbutton = (button)findviewbyid(r.id.signupbutton); msignupbutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { string username = musername.gettext().tostring(); string password = mpassword.gett

jquery - Not able to get cycle2 carousel working with text overlay -

i trying cycle2 carousel working text overlays in wordpress. images being displayed vertically. can basic cycle2 demo work , not carousel. here code: <div class="cycle-slideshow" data-cycle-fx="carousel" data-cycle-timeout="0" data-cycle-next="#next4" data-cycle-prev="#prev4" data-cycle-carousel-visible="5" data-allow-wrap="false" data-cycle-slides="> a" > <div class="cycle-overlay"></div> <a href="http://google.com" data-cycle-title="first" data-cycle- desc="first description"><img src="http://malsup.github.io/images/beach1.jpg"></a> <a href="http://google.com" data-cycle-title="two" data-cycle-desc="second description"><img src="http://malsup.github.io/images/beach2.jpg"></a&

ruby - Bundler could not find compatible versions for gem "sass-rails" -

i new ruby on rails , have error when run bundle install new project. using rails 4.2.3 on mac osx yosemite in gemfile: compass-rails (~> 2.0.4) ruby depends on sass-rails (<= 5.0.1) ruby sass-rails (5.0.3) any idea on why got error? just add version of sass-rails gem gemfile. find string: gem "sass-rails" and replace the gem "sass-rails", "5.0.1" this error occured because of little old version of compass-rails gem. can review line of gemspec see that's newer version of compass-rails wouldn't raise exception (because of sass-rails 5.0.3 lower 5.1 )

java - Realm Relationship Many-to-one not work -

i've simple model: class dog owner owner and when try add 2 dogs same owner, fist dog i've created owner null , second dog owner. always owner not null if dog last. owner me = new owner(); dog doggy = new dog(); doggy.setowner(me); realm.copytorealmorupdate(doggy); //here has been created dog doggy , owner me dog jimmy = new dog(); jimmy.setowner(me); realm.copytorealmorupdate(jimmy); //here has been created dog jimmy , updated owner me dog jimmy .... realmresults<dog> dogs ... dogs.get(0).getowner(); //it's null dogs.get(1).getowner(); //it's owner me why not work? thanks!!

php - Laravel Raw DB Insert Affected Rows -

i'm using raw queries laravel 4 , is there way check affected rows on insert? db::getpdo()->rowcount(); gives me "undefined method" error . code follows: $query = "insert ignore table (id) values (?)"; $doquery = db::insert($query, array($value)); if ($doquery) { return db::getpdo()->last(); } else { return 0; } if not, there easy way figure out whether insert done or not without making 2 queries? well figured out workaround should efficient - use insert instead of insert ignore , use try/catch. $query = "insert table (id) values (?)"; try { db::insert($query, array($value)); return 1; } catch (\exception $e) { return 0; }

c# - Adding int property, EF keeps making it nullable column? -

i'm adding int property called order existing entity has records in db tables. public class page : content { // ... public int order { get; set; } // ... } however, when run "update-database", it's adding column nullable default value of null. tried using [defaultvalue(0)], setting default in constructor. neither work. how can add column/property existing set of data , have populate non-null value of 0? thanks. that's because of inheritance. not properties in derived types can defined not-nullable, because types in upper level of hierarchy doesn't have properties.

python - Twitter: Finding number of followers from a Twitter account URL -

is there way find number of followers of twitter user using user's twitter account url? example, using twitter account url www.twitter.com/abc , find number of followers user corresponding account url has? i have extracted followers count using beautifulsoup in python, there non-scraping way accomplish this? know there api finds followers count using user id, couldn't find me find follower count using twitter account url. you can extract screen name url, , use users/lookup , returns among other things follower_count of given user.

windows 7 x64 - scala bash applet not found when compiling -

i downloaded scala here: http://www.scala-lang.org/download/ , added c:\program files (x86)\scala\bin path variable. working scala plugin eclipse, install new software, video here says: http://scala-ide.org/download/current.html working in windows 7 64bit. i trying run simple object called helloworld, according tutorial: http://www.scala-lang.org/docu/files/scalatutorial.pdf . object has following code: object helloworld { def main(args: array[string]) { println("hello, world!") } } when commit scalac helloworld.scala , in mobaxterm prints bash: applet not found . i saw similar problem gradle ( bash: applet not found when running gradle in mobaxterm ), solution seems irrelevant,as gradle has totally different files in it's installation directory. edit: misunderstood solution in attached link, thought env.exe , busybox.exe files of gradle , still, before making irreversible changes, want ask: should if cannot find file

jquery - uncaught type error:$ is not a function -

i have html page below , when select item on dropdown runs function. each time step through function , line $("#ddlroute").html(procemessage).show(); i error : uncaught typeerror:$ not function do know is? how resolve this? @using (html.beginform()) { <div id="rowone-form"> <div class="section1"> <h2>select customer</h2> <div> <label for="branch">branch:</label> @html.dropdownlistfor(m => m.selectedbranch, model.branchlist, "select branch", new { @id = "ddlbranch", @style = "width:200px;", @onchange = "javascript:getroute(this.value);" }) </div> <div> <label>route:</label>

postgresql - SQL join across 3 tables, with multiple WHERE clause matches -

i have 3 tables: user, user_tag , tag. basic elements of these reproduced below. users linked tags using intermediate user_tag table. every user can have 0 or more tags. i'm keen find users have 1 or more matching tags. user column | type | modifiers -------------+--------------------------------+--------------------------------- id | integer | not null name | character varying(150) | not null user_tag column | type | modifiers ------------+--------------------------------+----------- id | integer | not null user_id | integer | tag_id | integer | tag column | type | modifiers -------------+--------------------------------+--------------------------------- id | integer | not null nam

python - Copy Specific Rows and Columns from a .csv into .xlsx -

i extremely new @ programming gonna rough lol, however, turtle scientist, of patience , excellent advice contribute turtle conservation ^_^ so, have .csv 1 of several turtle species in column , utm coordinates in columns b (northings) , c (eastings). need take rows species (for example every row column sptu [spotted turtle fyi]) save of rows in pre-existing .csv, overwriting of old coordinates. here's i've got far, i'm using pycharm , python 3.somethin: for wsurvey-20150630.csv in glob.glob("c:/users/vito/desktop/gis/latitudes , longitudes/wsurvey/wsurvey-20150630.csv"): (f_path, f_name) = os.path.split(wsurvey-20150630.csv) (f_short_name, f_extension) = os.path.splitext(f_name) ws = wb.add_sheet(f_short_name) spamreader = csv.reader(open(wsurvey-20150630.csv, 'rb')) row in "wsurvey-20150630latlon.csv": if "sptu" in row: rowx, row in enumerate(spamreader): colx, value in enumerate(row): ws.write(rowx, c

MySQL Delete rows from table dependent on over -

i trying delete rows map_points table supply place_id, delete if place_id not ancestor of place_id entered same map_id create table map_points { map_id int, place_id int } create table place_relation { ancestor int, child int } | map_id | place_id | +--------+----------+ | 10 | 20 | | 10 | 22 | | 12 | 20 | | 12 | 31 | | 12 | 21 | | 13 | 20 | | 13 | 44 | | 14 | 33 | | 14 | 31 | | 14 | 20 | | 14 | 44 | +--------+----------+ | ancestor | child | +----------+-------+ | 20 | 22 | | 20 | 21 | | 31 | 33 | +----------+-------+ i want delete map_points have place_id = 20, not if place has child in place_relation table. after executing delete result set should follows. | map_id | place_id | +--------+----------+ | 10 | 20 | | 10 | 22 | | 12 | 20 | | 12 | 31 |<- deleted | 12 | 21

migration orbeon to 4.9 from 3.7.1 -

i updating orbeon 3.7.1 newest 4.9. seems widget not used in 4.9. how can migration our widget logic 4.9. provide detail steps me. also create processor in 3.7.1. there lots of errors when use jars in 4.9 build. methods removed in 4.9, readinputasdom(pipelinecontext context, string inputname) . other method can use replace it.

c++ - Finding most common sextuplets in a huge set of numbers -

i have matrix 6000x20, containing numbers range 1-80. need find sextuplets appear in matrix. need efficient , fastest solution. current solution steps: 1.i take first row matrix , generate sextuplets (38600 in 1 row) 2. compare each of sextuple other 5999 rows , count them 3. write them file because memory gets full pretty fast 4. take 2nd row , generate sextuplets , steps again this algorithm pretty bad , im aware of because have 38600x6000 comparisons , possible file writing, , have lots of sextuplets repetition. cant know because cant use variables of size. i need algorithmic solution can write in matlab/java/c++/python since values range 1-80, total number of possible sextuplets "only" tad on 300 million (300,500,200 precise). since there 6000 rows in matrix, maximum count sextuplet 6000, count comfortably fit in two-byte integer ( uint16_t , assuming exists in c++ implementation). 3 hundred million two-byte integers total 600 megabytes, have available.