Posts

Showing posts from August, 2012

html - element positioning. changing the base point (top-left corner) while positioning (not transform) -

i encounter error while positioning element. browsers calculate positions of elements looking @ top-left corner. lets point (top-left corner) "basis" (sorry terminology) when using alignment or center object, works fine. if, change element's position other attributes, lets width:%50 , height:%50, browser not move element middle, moves "basis" of element middle. is there way change "basis" other location of element? example, can make "basis" of element right-bottom corner? i think see you're trying ask. in short answer no. if use absolute positioning, , take @ quick test: html <div class="wrap"> <div class="absolute"> </div> </div> css .wrap { position: relative; width:400px; height:400px; background: red; } .absolute { position: absolute; bottom:0; right:0; width:100px; height:100px; background: blue; } you should see div.absolute posi...

sql - MYSQL select in different table with condition -

update i know variable $id id of data in table_1. have 2 same columns in table_1 , table_2 (with same content). want select , show column in table_2 (result). table 1 | id | color | ----------------------------------- 1 | data1 | 2 | data2 | 3 | data3 | 4 | data4 | 5 | data5 | table 2 | id | flower | result | ------------------------------------------------------ 11 | data1 | result1 | 12 | data2 | result2 | 13 | data3 | result3 | 14 | data4 | result4 | 15 | data5 | result5 | ex id = 5 result = result5 select t2.*, t1.color t2 inner join t1 on t1.color = t2.data , t1.id = '$id' ...

java - Drools : Setting a flag from within the drl file -

i testing conditions within drools drl file, , if of these conditions true, want set flag in calling program. i tried doing in following manner : --- drl file ---- //created on: 28 aug, 2013 package flowmanagers import flowhelper.orderrelatedqueriesflowhelper; import entity.order; import org.apache.log4j.logger; global logger logger; global boolean isvalid; rule "isvalid" no-loop salience -1 activation-group "ac1" when $o : order( orderrelatedqueriesflowhelper.isvalid($o)) isvalid=boolean.true; logger.info("valid order..." ); end --- calling program bit ---- boolean isvalid=boolean.false; string[] nohappyorderfilelist={"nohappyorder.drl"}; statefulknowledgesession ksession = createknowledgesession( nohappyorderfilelist ); ksession.setglobal("logger", logger); ksession.setglobal( "isvalid", isvalid); for( order fo : coll ) { ksession.inse...

javascript - Web and physical units -

is there way tell/set, how many millimeters element has, works across various devices? for example, create white window 100 x 100 mm, black 10 x 10 mm square in middle, have dimensions on desktop, tablet, print, ... i don't mind use latest browser has use html/js/css. ps: related: there way tell, how many millimeters screen has? edit in other words, problem using css units pt, mm, cm, ... not work browser vendors decided hardcode 96 dpi agents, according here . there 1 can real, physical, dimensions on web? not really. in theory can set lengths using mm units, requires browser accurately handles dpi of display … , browsers tend assume fixed value instead of getting real one. if worked, width in unit creating off-screen element of known physical dimensions, reading pixel dimensions using javascript , using ratio convert pixel dimensions of other element mm. in practice, if need accurate measurements pretty limited drawing on screen , asking user measur...

php - How do I get rid of the delimiters? -

case 1: have string "57_5" . how take out underscore(_) supposedly (i think) acts delimiter may have 57 , 5 ? 2 values should integers not string!!! need in php case 2: have array ("57_8", "45_7", "24_3") . need obtain each individual element in array, take out underscore convert them integers , in total should have 8 distinct values. how can achieved in php? should have 57, 8, 45, 7, 24, 3 remember end result should not array , values should integers. as written in comment, 1 variant, "implode explode intval array_map things" : $integers = array_map('intval', explode('_', implode('_', (array) $arrayorstring))); casting/converting array http://php.net/implode http://php.net/explode http://php.net/intval http://php.net/array_map thanks casting, handles both cases @ time normalizing input. code-example: <?php /** * how rid of delimiters? * @link http://stackoverflow.com/q/1848...

ios - UITableView Does not show data in ipad app -

i have ipad app in using tableview show data problem not show data in tableview here code setting cell value - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[[uitableviewcell alloc] initwithstyle:uitableviewcellstylesubtitle reuseidentifier:cellidentifier] autorelease]; cell.selectionstyle = uitableviewcellselectionstyleblue; } if (tableview == tablecategory) { cell.textlabel.font=[uifont fontwithname:@"arial" size:16]; cell.textlabel.textalignment=uitextalignmentleft; objectdata*thecelldata = [categoryarray objectatindex:indexpath.row]; cell.textlabel.text=thecelldata.categorytitle; return cell; } else if (tableview == tab...

onload event event javascript not responding -

javascript code: <script type="text/javascript"> function react() { document.getelementbyid("img").src = second.jpg } </script> html page: <div style="width:170px;height:160px;border:2px solid blue"> <img src="first.jpg" style="width:inherit;height:inherit" id="img" onload="settimeout('react()', 15000)"/> </div> please the image in not change meant change first.jpg second.jpg in 15000 milliseconds set settimeout() function second.jpg means "the jpg property of second object" (which hasn't been mentioned before throw reference error). you need use string literal: "second.jpg" .

iphone - DeviceToken as anonymous identifier IOS -

can use devicetoken register user in server not push notification service. is possible fetch devtoken without using push notification delegate method? thanks yes, can use device token register user because if delete app & re-install again give same device-token same previous. code: nsstring *device_id=[[[uidevice currentdevice]identifierforvendor]uuidstring];

sql - Search refinement for WebMatrix site -

i've been asking few questions on site, , have answers lots of little bits, trying piece whole thing together. i have page shows properties have in database. need find way refine results though, example, show properties have 4 bedrooms etc. problem is, don't know how many variables might have in search term yet. here's example. a user may want see properties have 4 bedrooms a user may want see properties have 4 bedrooms , 3 bathrooms , sleeps 8 people etc. i have decided pull variables querystring, ?numbedrooms=4&?numbathrooms=3 here's code have far, doesn't work: @{ var db = database.open("stayinflorida"); ienumerable<dynamic> queryresults; int numbedrooms = request.querystring["numbedrooms"].asint(); int numbathrooms = request.querystring["numbathrooms"].asint(); int sleeps = 0; list<int> arglist = new list<int>(); if (request.querystring["sleeps"].isint()) { sleeps = request.querys...

android - Why does Apps Main Activity not take new values of variables after they are changed when the activity starts? -

hi know why though ive created methods change co-ordinate values (which executed before main method). main method still taking default values gave co-ordinate variables @ start of activity? here code: for first activity shown on app (start activity) allows change lat , long co-ordinates typing in alert dialog, starting main map activity: public class startviewactivity extends activity { mainactivity longlat = new mainactivity(); @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.startview); button button = (button) findviewbyid(r.id.button1); button button1 = (button) findviewbyid(r.id.button2); button button2 = (button) findviewbyid(r.id.button3); button.setonclicklistener(new onclicklistener() { public void onclick(view v) { alertdialog.builder alert = new alertdialog.builder(startviewactivity.this); alert.settitle("longitude"); ...

sparql - RDF list subjects with their objects in a single line -

i have rdf file , need extract information , write file. understood how works, i'm stuck this: string querystring = "select ?person ?children { ?person ?haschildren ?children}"; tuplequery tuplequery = conn.preparetuplequery(querylanguage.sparql, querystring); tuplequeryresult result = tuplequery.evaluate(); while (result.hasnext()) { bindingset bindingset = result.next(); value p1 = bindingset.getvalue("person"); value p2 = bindingset.getvalue("child"); println(p1 + " has children " + p2 +""); } result.close(); the output this: http://example.org/people/person1 has children http://example.org/people/child1 http://example.org/people/person1 has children http://example.org/people/child2 i don't see how list persons objects in format: person1 has children child1 , child2 how can done? you may find answer, describes sparql's group_concat , useful: aggregating results sparql query...

Sharepoint Application 2013 custom list new page -

i have sharepoint-hosted application , lists within app. want replace default new form own page. i've modified schema.xml list: <forms> <form type="displayform" url="dispform.aspx" setuppath="pages\form.aspx" webpartzoneid="main" /> <form type="editform" url="editform.aspx" setuppath="pages\form.aspx" webpartzoneid="main" /> <form type="newform" url="newform.aspx" setuppath="features\$sharepoint.feature.deploymentpath$\pages\default.aspx" webpartzoneid="main" /> </forms> but there error during deployment "cannot find file specified". how can point page in sharepoint-hosted application list schema.xml? if have form within same folder list: <form type="newform" url="newform.aspx" path="customnewform.aspx" webpartzoneid="main" uselegacyf...

javascript - SCRIPT5011: Can't execute code from a freed script -

i saw many post here , here regarding type error in case have object in function below code , error " can't execute code freed script " function updateletterofclaim(thisletterclaimid) { var updatedletter = {}; updatedletter.new_breaches = top.opener.selected_breach.join(",");//from line in ie7 error updatedletter.new_causation = top.opener.selected_causation.join(","); updatedletter.new_chronology = top.opener.chronology_records.join(","); updatedletter.new_injuries = top.opener.damage_records; } after see many link , blogs result come applying following code my problem found apply join() in objects apply in array first make my objects in array apply join .... function updateletterofclaim(thisletterclaimid) { var updatedletter = {}; updatedletter.new_breaches =joinobjects(top.opener.selected_breach); updatedletter.new_causation =joinobjects( to...

hadoop - Input path does not exist: file:/D:/pigsample_1749383998_1377684507424 -

i facing wiered issue. running pig 0.11 on windows7/64 bit machine latest version of cygwin. i weblog want order username have user activities same user feed next line of processing. i starting commandprompt -> cygwin.bat -> on cygwin console go d:/ -> pig , typing following script on grunt shall (local mode). (note i've set pig_home, pig_classpath correctly). script : useractivities = load '/d:/path/of/logs/useractivities' using org.apache.pig.piggybank.storage.csvexcelstorage(',') (datetimeunprocessed:chararray, username:chararray, request:chararray); useractivities_ordered = order useractivities username; store useractivities_ordered '/d:/readyfornextinput/useractivities' using org.apache.pig.piggybank.storage.csvexcelstorage(','); when illustrate useractivities_ordered see going smooth. when store/dump face wiered issue. it fails saying : java.lang.runtimeexception: org.apache.hadoop.mapreduce.lib.input.invalidinputexc...

How do I create a sbt build file from a mixed java/scala eclipse project? -

i have multiple mixed java/scala eclipse projects, dependencies between them. there way automatically create sbt build file? a little more infos projects: started java projects, using libgdx eclipse. added scala , build internal scala-ide sbt builder. using sbt build. want use emacs sbt, while colleague wants work eclipse. no. there not. the same question maven summarize of problems of creating complete build definition eclipse projects. configuration of external dependencies , between different projects. the common case go other way around, sbt project eclipse configuration files. depending of projects may want create build each project, or 1 projects, or in between. multi-projects builds described here , advise read getting started guide beginning. then, creating eclipse configuration files done using sbteclipse plugin .

how to sum the visible fields of a column (not suppressed one) in Crystal Report -

Image
i have crystal report column data following: 81306 suppressed (real value 81306) total 81306 (result required) total 162612 (result coming not required) i suggest create formula field way: if {rpt.amount}= previous({rpt.amount}) 0 else {rpt.amount} [drag field formula] and summarize formula field instead of original field. to summarize formula field, easiest way is 1) mouse right button inside report 2) insert \ summary 3) choose formula field, sum summarize, group yuou want summarize

javascript - remove Cookie using jquery not working -

Image
i have 2 cookies in js file , want remove them. i have tried code below not working $.removecookie('filter', { path: '/home/' }); $.removecookie('pfilter', { path: '/home/' }); i have tried below null cookies, not working. thanks help $.cookie('filter',null, { path: '/home/' }); it might depend on path cookie using. if goto chrome developer tools , check path column under resources > cookies > path. you might using generic / path instead of /home/ . give code below try. to delete cookie jquery set value null: $.removecookie('filter', { path: '/' });

javascript - How to pass a text box value in html onclick event in asp.net -

i using asp.net web application. in application having 1 text box in web page inputs user. need read value in html source page have mentioned below. <a href="" onclick="editdocumentwithprogid2('textbox1.text', '', 'sharepoint.opendocuments', '0', 'http://demo-1/blankpage', '0')">edit onclick</a> in above line not able textbox1 value. need pass textbox value dynamically. how can ? need change in code? please me on this. thanks. you can use scriptlet clientid if clientidmode of textbox not static . can use document.getelementbyid dom object textbox control onclick="editdocumentwithprogid2(document.getelementbyid('<%= textbox1.clientid %>').value, '0', 'http://demo-1/blankpage', '0')">edit onclick</a> or can call function (parameterless) onclick , call editdocumentwithprogid2 function make call more readable. html <a href=...

python - Comparing Matlab and Numpy code that uses random number generation -

is there way make random number generator in numpy generate same random numbers in matlab, given same seed? i tried following in matlab: >> rng(1); >> randn(2, 2) ans = 0.9794 -0.5484 -0.2656 -0.0963 and following in ipython numpy: in [21]: import numpy np in [22]: np.random.seed(1) in [23]: np.random.randn(2, 2) out[23]: array([[ 1.624, -0.612], [-0.528, -1.073]]) values in both arrays different. or suggest idea compare 2 implementations of same algorithm in matlab , python uses random number generation. thanks! one way ensure same numbers fed process generate them in 1 of 2 languges, save them , import other language. easy, write them in simple textfile. if not possible or desirable, can make sure numbers same doing generation of pseudo random numbers yourself. here site shows simple example of easy implement algorithm: build own simple random numbers if quality of homemade random generator not sufficient, can build rand...

jsf 2 - Textbox Focus in Richfaces -

i have make sample project of focus in textbox the demo of richfaces showcase . use jsf 2.0, richfaces 4.3.0 final.jar , jboss 7 server. can sucessfully run project focus did not work. when press tab key, focus arrives @ textbox. if there need congifure, please advise me. thanks in advance. finally, got it. put javascript code in jsf form this. <h:form id="frm"> <script type="text/javascript"> window.onload = function() { document.getelementbyid('frm:txtstaffid').focus(); } </script> ... ... <h:inputtext id="txtstaffid"/> ... ... </h:form>

jQuery: One fancybox gallery for each unordered list of links -

in page in have 2 or more unordered lists of links @ each link links image. as these unordered lists generated database fancybox make 1 gallery each unordered list. hve idea how put same rel attribute links of each list of jquery? it looks this: <ul> <li><a href=""><thumb img/></a></li> <li><a href=""><thumb img/></a></li> <li><a href=""><thumb img/></a></li> </ul> <ul> <li><a href=""><thumb img/></a></li> <li><a href=""><thumb img/></a></li> <li><a href=""><thumb img/></a></li> </ul> but should of jquery this: <ul> <li><a rel="gallery1" href=""><thumb img/></a></li> <li><a rel="gallery1" href=""><thumb img/></a>...

java - How to call takePicture() method from another activity in android? -

i have main activity class have written takepicturefromcamera() method this: public void takepicturefromcamera() { intent intent = new intent(mediastore.action_image_capture); try { string state = environment.getexternalstoragestate(); if (environment.media_mounted.equals(state)) { mimagecaptureuri = uri.fromfile(mfiletemp); } else { // solution taken here: http://stackoverflow.com/questions/10042695/how-to-get-camera-result-as-a-uri-in-data-folder mimagecaptureuri = internalstoragecontentprovider.content_uri; } intent.putextra(android.provider.mediastore.extra_output, mimagecaptureuri); intent.putextra("return-data", true); startactivityforresult(intent, request_code_take_picture); } catch (acti...

SOOT like program analysis tool for Javascript -

i have looked @ this question graphical representation not want. is there soot tool javascript gives intermediate representation can play with? or else, there javascript -> java-bytecode -> javascript converter? (so can use soot java-bytecode transformations , javascript) i don't think such tool exists. wala can analyze js extent cannot generate js code again. many people know analyze js modifying jit compiler.

c# - Regular expression for multiple email destinations delimited by semicolon -

i succeed regular expression single email this: private readonly regex _regex = new regex(@"^[_a-za-z0-9-\\+]+(\\.[_a-za-z0-9-]+)*@" + "[a-za-z0-9-]+(\\.[a-za-z0-9]+)*(\\.[a-za-z]{2,})$"); now, need make regular expression more 1 email, , delimited semicolon test@gmail.com;test2@yahoo.com;test3@gmail.com i found regular expression: \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*([,;]\s*\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)* but problem regular expression "receive" string: h@kj.com;asds@gmail how can that? thanks let's not build regular expression more 1 because 1 complex enough, validate them individually: foreach (var email in emaillist.split(new char[] { ';' }, stringsplitoptions.removeemptyentries)) { // validate email } further, regular expressions aren't suited because user have put space, more 1 space, before or after semicolon - gets messy - , ema...

detection - Detect the start tone event for a race from a .wav file in MATLAB -

i trying measure duration (in samples) between start tone (3800hz) , finish tone (high amplitude frequency unknown). 2 tones randomly distributed in .wav file (est. 10 seconds). important identify sample number of last sample of first tone , first sample of last tone? how can this? the .wav file contains fundamental frequency , noise (as start tone , finish tone). have prerecording of start tone fundamental frequency , noise in background, can use correlation function detect it? some of noise exceeds 3800hz (instantaneously) methods using threshold values detecting tones don't work well. however, can use fact tone event longer in duration noise event (because made deliberately pressing , releasing button) detect tone.

vba - SQL that access accepts, but SQL Server Express rejects -

today wrote bit of sql: select count(t0021_werk_naam) (select distinct t0021_werk_naam,t0021_jaar,t0021_kwartiel t0021_offertes t0021_status_code = 'g' , t0021_jaar = 2013 , (t0021_kwartiel = 3)) this sql runs great when run locally in access, however, when run through code has been used ages , definetly not problem, , send sql express gives error says there's problem near ')' after stripping away brackets possible becomes clear detects there's problem last ')' don't see problem. any ideas? you need give alias select in parenthesis: select count(t0021_werk_naam) ( select distinct t0021_werk_naam, t0021_jaar, t0021_kwartiel t0021_offertes t0021_status_code = 'g' , t0021_jaar = 2013 , (t0021_kwartiel = 3) ) t notice t in end after last parenthesis.

python - NIST Randomness Tests requires a sequence of ASCII 0's and 1's but does not accept any trial from MATLAB -

i trying use nist randomness test suite randomness tests of long 0-1 bit sequences. requires me supply either ascii zeroes , ones or binary file each byte 8 bits of data. however, tried save(...,'-ascii') , fwrite() , other commands make work not accept , gives me segmentation error + igamc: underflow error. if can how create matching format in addition if knows mathematica created own sample files below mathematica , maybe can format , can tell me in matlab. binexp[num_,d_] := module[{n,l}, if[d > $maxprecision, $maxprecision = d]; n = n[num,d]; l = first[realdigits[n,2]] ]; se = binexp[e,302500]; save["data.e",{se}]; i assume have software installed (compiled) instructed in manual to see how run software start in section 5.3 in manual. you can generate ascii file of random 0/1 generated in matlab follows: n=10000; % <-- length of sequence seq = rand(n,1)>0.5; fid=fopen('test.txt','w','native')...

java - OpenGL - too many textures -

i have 90 frames animation , want display on minecraft hud. here code use now: string ctype = "target"; int cspeed = 30; int fast = 0; public int centerroterycounter = 0; @forgesubscribe public void centerrotery(rendergameoverlayevent.post event){ //========resolution======== res = new scaledresolution(mc.gamesettings, mc.displaywidth, mc.displayheight); int width = res.getscaledwidth(); int height = res.getscaledheight(); //========resolution========+ if(centerroterycounter == 90){centerroterycounter = 0;} if(centerroterycounter < 10){ this.mc.renderengine.func_110577_a(new resourcelocation("centerrotery/"+ctype+"000" + centerroterycounter + ".png")); }else{if(centerroterycounter < 100){ this.mc.renderengine.func_110577_a(new resourcelocation("centerrotery/"+ctype+"00" + centerroterycounter + ".png")); }else{ this.mc.renderengine.func_110577_a(new resourcelocation("centerrotery/"+ctype+...

How do I translate an while loop to clojure code -

for example, extended euclidean algorithm (quoted wiki): function extended_gcd(a, b) x := 0 lastx := 1 y := 1 lasty := 0 while b ≠ 0 quotient := div b (a, b) := (b, mod b) (x, lastx) := (lastx - quotient*x, x) (y, lasty) := (lasty - quotient*y, y) return (lastx, lasty) which tried , got: (defn extended-gcd [a b] (loop [a b b x 0 y 1 lx 1 ly 0] (if (zero? b) [lx ly] (recur b (mod b) (- lx (* (int (/ b)) x)) (- ly (* (int (/ b)) y)) x y)))) i guess find way translate loops deal sequence. how one? how write in clojure way? map, reduce, etc. rather loop recur. for extended euclidean algorithm can use simple recursion, makes function quite elegant: (defn extended-gcd [a b] (if (zero? b) [1 0] (let [[q r] [(quot b) (rem b)] [s t] (extended-gcd b r)] [t (- s (* q t))]))) let's try it: user=> (extended-gcd 120 23) [-...

django - set time_limit for celery periodic task -

i have celery worker (run through celeryd daemon), accepting both periodic tasks , async tasks. problem i'm not able fix how set time_limit periodic tasks? tried use @periodic_task(run_every(crontab(hour='*/2', minute=0)), time_limit=500) but won't override time_limit setting in /etc/default/celeryd, 300s i tried add second @task decorator @periodic_task(run_every(crontab(hour='*/2', minute=0)), time_limit=500) @task(time_limit=500) def my_task(): but doesn't work, either. so what's correct way of doing this?

javascript - Searching for acceleration -

i using $routeprovider in angular. whenever go particular route see log in console: xhr finished loading: "http://localhost:8080/root/partials/view1.html". xhr finished loading: "http://localhost:8080/root/partials/view2.html". ... at point particular pages cached think in browser , referenced faster. how can make xhrs routes in background when angular referenced first time? search this: for ( /* every page inside routeprovider */ ) { // xhrs page } your question answered examples in documentation . to summarise: can inject $templatecache run method (possibly along $route if want template urls route table), , insert templates cache. hth!

java - Any API support child have two or more parent in Tree or Graph? -

i trying create graph or tree below start | step1 / \ step2.1 step2.2 \ / step3 will support tree component of jsf or zk framework or third party api support kind on scenario . tried org charts not possible other such api can me design such kind of thing.

android - Load Fragment before Navigation Drawer closes -

i have implemented navigation drawer , want load fragment before navigation drawer closes. currently, fragment loads in parallel drawer closing, if fragment heavy user interface hangs bit. the code have is: private class draweritemclicklistener implements listview.onitemclicklistener { @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { fragmenttransaction ft = getsupportfragmentmanager().begintransaction(); ft.replace(r.id.content_frame, fragmentprofile); ft.commit(); drawerlayout.closedrawer(drawernavilistview); } } how can change see fragment loading (in background) first , when has finished loading, navigation drawer closes? my solution load fragment after drawer closed: call loadfragment method inside ondrawerclosed public void ondrawerclosed() { // assure request comes selecting menu item...

java - Is it possible to read a PDF line by line? -

is there way in java, read pdf line line , convert text? have used itextpdfparser reads page page rather line line. has few drawbacks. let me know if there way read pdf's line line. before start on this, should ask few more abstract questions. first "what line of text in document?" problem, see, pdf represents large set of printable documents (i won't all , it's pretty close). text placed on page number of operators: tj ' " tj . example (a string) tj places "a string" in current font current text transformations (word/char spacing/scaling, transformation matrix) on page. , on simplified because 8-bit characters in string may interpreted in kinds of screwy ways depending on encoding used instance of font. so let's @ way - if place text on page in lines, generating application might use ' operator moves next line , places line of text. great, extracting line line easy. if application decides place plain text on ...

io - Inquiry about ResourceBundle in java -

directly api : otherwise, getbundle attempts locate property resource file using generated properties file name. generates path name candidate bundle name replacing "." characters "/" , appending string ".properties". attempts find "resource" name using classloader.getresource. what mean replacing "." characters "/" example? ps:i ok appending .properties @ end. say have package named com.yourgroup.bundles containing file named hello_en_us.properties you have specify either of following load bundle resourcebundle bundle = resourcebundle.getbundle("com.yourgroup.bundles.hello"); resourcebundle bundle = resourcebundle.getbundle("com/yourgroup/bundles/hello"); basically javadoc telling how translates argument pass getbundle method find resource on classpath. me, default locale en_us , so com.yourgroup.bundles.hello translates to com/yourgroup/bundles/hello_en_us....

java 7 - EclipseLink doesn't generate tables -

i defined entities , want generate tables now. i use eclipselink 2.5 (jpa 2.1) , glassfish 4.0 , program uses jkd7. when build application there following messages: warning: supported source version 'release_6' annotation processor 'org.eclipse.persistence.internal.jpa.modelgen.canonicalmodelprocessor' less -source '1.7' note: creating static metadata factory ... note: optional file not found: meta-inf/orm.xml continuing generation. note: optional file not found: meta-inf/eclipselink-orm.xml continuing generation. note: optional file not found: meta-inf/orm.xml continuing generation. note: optional file not found: meta-inf/eclipselink-orm.xml continuing generation. i don't know need now... i have latest eclipselink version latest version of glassfish jkd 7 just standard derby database (delivered glassfish 4.0) how can solve this? edit 1: <properties> <property name="eclipselink.ddl-generation" value="drop-a...

xcode - Conflicting libraries in iOS project -

so have 2 libraries think conflicting each other. have following settings key "library search path" : "$(srcroot)/projectname/release-iphone/lib" 1 of libraries, , "$(srcroot)/projectname" another. i have added coreplot library project work requires following linker flags : -objc -all_load . now when add 1 or both of them following message , project won't build: duplicate symbol _objc_class_$_gtmhttpfetcher in: /users/user/library/developer/xcode/deriveddata/projectname-chibchblpntaapfagqcohtkixhib/build/intermediates/projectname.build/debug-iphoneos/projectname.build/objects-normal/armv7/gtmhttpfetcher.o /users/user/dropbox/projectname/projectname/projectname/libgtltouchstaticlib.a(gtmhttpfetcher.o) duplicate symbol _objc_metaclass_$_gtmhttpfetcher in: /users/user/library/developer/xcode/deriveddata/projectname-chibchblpntaapfagqcohtkixhib/build/intermediates/projectname.build/debug-iphoneos/projectname.build/objects-normal/...

c# - How to return the last recorded ID in access db -

i need insert record in access database , return id inserted row try use execute non query inserting execute scalar statement : `"select @@identity`" and return 0 time "select scope_identity()" throw exception ! so way issue ! scope_identity() works in sql server, not access. you should able use select @@identity last id - long there identity column. see microsoft kb article example: http://support.microsoft.com/kb/815629

javascript - redirect 302 losing POST data -

i have global load balancer url, whenever hit page global loadbalnacer url redirect local load balancer url in response 302. below issue facing on 302 redirect. i have form on jsp page, when submitting form via post required parameters global load balancer url, browser sends request global loadbalancer url, replies “302” , tells redirect local load balancer. getting server , drawing page losing parameters due redirect request. is there way can avoid losing parameter in 302 redirect? instead of using 302 redirect, use 307 redirect. more in deep explanation check question

How to install Ruby 2 on Ubuntu without RVM -

i want install ruby 2.0 using sudo apt-get install ruby2.0 but there isn't available package ruby2.0 i want install using apt-get install same ruby 1.9.1 any suggestions? sudo apt-get -y update sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev cd /tmp wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz tar -xvzf ruby-2.0.0-p451.tar.gz cd ruby-2.0.0-p451/ ./configure --prefix=/usr/local make sudo make install from here how install ruby 2.0.0 correctly on ubuntu 12.04? update for ruby 2.1.5 sudo apt-get -y update sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev cd /tmp wget http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gz tar -xvzf ruby-2.1.5.tar.gz cd ruby-2.1.5/ ./configure --prefix=/usr/local make sudo make install if still seeing older ruby check symlink ls -la /usr/bin/ruby hector

java - Can I return an anonymous closure in JRuby when an interface is expected? -

per the docs , can pass block method expects interface, , block converted anonymous implementation of interface. it's pretty cool! however, have ruby subclass of java class, has method that's supposed return implements interface. // java public abstract class parent { public myinterface getit(); } # ruby class child < parent def getit # need return implementation of myinterface? end end i have tried making proc , lambda , neither of work. can add method parent (in java) forces automatic conversion protected myinterface passthrough(myinterface mi) { return mi; } and works: def getit passthrough {|thing| puts thing.inspect } end this seems hacky though. oversight in how jruby works, or missing alternate solution? yes - should able ... use to_java on proc/lambda : class child < parent def getit lambda { |*args| puts args.inspect }.to_java(java::myinterface) end end

c++ - Calculator Based on ATMega8 using AVRstudi -

about calculator: basically calculator made calculate resistance of copper , aluminum wires @ ambient temperature using formula r2= r1*(1+alpha(t-25)) here r2 output, r1 value entered user using 4x4 matrix keypad (which include decimal values 12.5 etc), t temperature in degree celsius recorded temperature sensor lm35. alpha copper = 0.0039 alpha aluminum = 0.0042 how should work: basically temperature recorded calculator give input t. value of resistance @ 25deg c fed user using keypad. keys 0-9 , "." used enter value. after when user presses "+" on keypad, should implement formula copper , show result on lcd, when user presses "-" should implement formula aluminum. let leave "*" "/" , "=" buttons spare time being. progress till now: using codes have sent in attachment, able temperature on screen correctly, able see value of r1 (i.e value of resistance @ 25deg c) cannot figure out how use these values output. ...

javascript - In an array, how do I find the closest key given a float value? -

i'm making "acceleration" array this: acc["0100"] = 1; acc["0300"] = 2; acc["0600"] = 4; acc["0900"] = 8; acc["2000"] = 16; acc["5000"] = 32; and, when user presses key, start timer: this._starttick = (new date()).gettime(); now have timer checks if key still pressed. if so, like: this._delay = (new date()).gettime() - this._starttick; and now, based on this._delay , i'd find 1 of previous values (1, 2, 4 or 8). how that? nb: if value greater " 5.0 " result should 32 . nota: goal is, given elapsed time, find out value best. started way i've explained, if have solution, i'll take it! it's easier operate on array on object: var accarr = []; (time in acc) { accarr.push({time: time, value: acc[time]}); } assuming have array, can do: function getvalue(delay) { var diffs = accarr.map(function (e) { return math.abs(e.time - delay); }); return accarr[...

epic - Perl: How to break on write-to-variable in Eclipse -

i have script writing entries hash. however, @ point entries exist in hash think should not. so, i've cocked somewhere, there 1 place think add elements in hash , i've tested make sure these "rogue" elements aren't being added @ location. what break on write hash, this, in "global" kinda way because don't know stray write in code - can't see it... so options? can set watch point in epic debugger , if how? (i've had play can;t find relevant). or perhaps create extended hash can intercept writes somehow? any ideas on "easy" debugging method. otherwise think i'll brute force debug :s in davance... not epic-specific answer, check out tie::watch . can setup variable (like hash) watched, , program can output every time variable updated. updated: tie::trace pretty same thing, simpler interface.

Rails deployment. "This method may not be used" response on PUT or DELETE request -

i have rails 3.2 application. locally works fine. but when try make put or delete request on staging, request status '501 not implemented', , response says ' this method may not used .' (get , post requests work well). there no records these requests in server logs. does know might cause such problem? solved! problem had redirecting made pound , redirected user port 80 port 3000, don't need specify port in address line.

algorithm - Finding minimum moves required for making 2 strings equal -

this question 1 of online coding challenge (which has completed). need logic how approach. problem statement: have 2 strings , b same super set of characters. need change these strings obtain 2 equal strings. in each move can perform 1 of following operations: 1. swap 2 consecutive characters of string 2. swap first , last characters of string a move can performed on either string. minimum number of moves need in order obtain 2 equal strings? input format , constraints: first , second line of input contains 2 strings , b. guaranteed superset characters equal. 1 <= length(a) = length(b) <= 2000 input characters between 'a' , 'z' output format: print minimum number of moves line of output sample input: aab baa sample output: 1 explanation: swap first , last character of string aab convert baa. 2 strings equal. edit : here first try, i'm getting wrong output. can guide me wrong in approach. int minstringmoves(char* a, char* ...

security - Obfuscating password in batch script -

i have batch script password sitting in part of command requires credentials not want prompt credentials. not worried external threats, don't want co-worker going in there , seeing password. while trust them not abuse it, i'd rather not have there @ all. i able pretty powershell storing secure string in text file. pretty basic, @ least there's no plain text passwords laying around. that's need. how can obfuscate password in batch script? you hide password in alternate data stream : first, add secret password alternate data stream of script: echo somewhatsecretpassword>script.bat:pwd here's how retrieve password variable %p% : for /f "usebackq delims=" %i in (script.bat:pwd) set p=%i from within batch file may use like: for /f "usebackq delims=" %%i in (%~0:pwd) set p=%%i this not secure! please consider: this not secure! alternate data streams not copied everywhere (fat) passwords containing special charac...

curl - Python stock quotes and all time highs and lows -

the curl 1 liner below generates stock price, have 2 columns next can time high , time low of stock well. using below commadlinefu : curl -s ' http://download.finance.yahoo.com/d/quotes.csv?s=csco&f=l1 ' 23.445 but have context see in relation previous time high , previous time lows. any thoughts ??

wordpress - PHP server file download cutoff unexpectedly -

i have web interface built admin section of wordpress site. scrapes few tables in database , displays big list of data row row. there 30,000 rows of data, displayed basic echo in loop. displaying 30,000 rows on page works fine. additionally, include option download csv file of complete rows of data. use fopen , fputcsv build csv file download result of data query. feature used work, dataset @ 30,000, csv no longer generate correctly. happens first 200~1000 rows written csv file leaving out majority of data. estimate csv not generated in case 10 megs. file download first 200~1000 rows though working correctly. here code: // gets huge list of data sp built. data formed $data = $this->run_stats_stored_procedure($job_to_report); // data converted csv file. part broken // file may exist @ location burn down if if(file_exists(abspath . "some/path/to/my/file/csv_export.csv")) { unlink(abspath . "some/path/to/my/file/csv_export.csv"); } ...

javascript - Drag and Drop PDF Attachments From Outlook To Chrome PHP SITE with DropFile.js -

i use micorsoft outlook 2010. have upload pdf attachments website come outlook. normal operation save hard drive , upload site. hoping cut out step of saving hard drive , instead drag , drop directly outlook email site. use dropzone.js upload function. can done?