Posts

Showing posts from May, 2014

iphone - Remove feature in submitted App -

i have app on app store features a , b , c , d i looking make features c , d paid using in-app purchasing in future until programmed/implemented; restrict or remove (visible) access features. note had setup c or d maintain access them. is ok remove features in submitted application? i try use applicaion's version purpose. three steps follow: detect app's first launch link first time app launch and @ moment save version number link app's version number once intend display feature nsstring *currentversion = @"1.2.0"; nsstring *versionatappdownload = @"1.1.5"; if ([currentversion compare:versionatappdownload options:nsnumericsearch] == nsordereddescending) { //decide } this should added in next app version. once done, downloaded app should have saved current app version. now update next bigger version i.e. 1.2.0 , version 1 hides content users have not yet paid. users downloaded app @ previous version should able stil...

sql server - check the presence of a value of a column in another table sql -

i'm new in sql server. i've copy values of column table table b respect column(join) before copying have check whether value exists in table c. if yes copy, otherwise return records values not in table c. query is; if exists (select branch_id adm_branch inner join ubl$ on adm_branch.branch_code = ubl$.[branch code ] adm_branch.branch_code = [ubl$].[branch code] ) update emp_personal set account_number = ubl$.[account ] , bank_id = 1 , branch_id = (select branch_id adm_branch join ubl$ on adm_branch.branch_code = ubl$.[branch code ] emp_personal.emp_id = ubl$.[employee id ]) emp_personal join ubl$ on emp_personal.emp_id = ubl$.[employee id ] else ( select ubl$.[employee id ],ubl$.[name ],ubl$.[account ],ubl$.[branch code ] ubl$) except ( select ubl$.[employee id ],ubl$.[name ],ubl$.[account ],ubl$.[branch code ] ubl$ right join adm_branch on adm_branch.branch_code = ubl$.[branch code ]) i think following code gi...

serializing java object to json with auto generated names -

i want create json file out of java objects similar structure: {"users" : {"1" : { "ids" : [1,2,3], "names" : ["anton","berta","charlie"] }, {"2" : { "ids" : [4,5,6], "names" : ["dora","emil","friedrich"] }, ...and on. my problem don´t know how generate numbers of second hierarchy. in of tutorials found hierarchy names generated class names or annotations can´t use way create requested names. is there way without writing huge method generate json stirng "by hand"? greetz the code required create each json entry not much: public static string tojson(int i, list<user> users) { stringbuilder sb = new stringbuilder("{\"").append(i).append("\" : { \"ids\" : ["); (user user : users) sb.append(user.getid()).append(","); sb.setcharat(sb....

fedora - Chkconfig conflict during RPM installation -

i work .rpm. have made rpm glassfish my template file summary: glassfish name: redsky-glassfish version: @version@ release: @release@ license: proprietary group: applications/system buildroot: %{_topdir}/%{name}-%{version}-root buildarch: x86_64 requires: jdk conflicts: java-1.7.0-openjdk %description %preun %install rm -fr ${rpm_build_root} mkdir ${rpm_build_root} cp -r ${rpm_build_dir}/* ${rpm_build_root} %post %postun #0 = uninstall, 1 = upgrade if [ "$1" == "0" ]; rm -fr /opt/glassfish/ fi %files /* during installation throws error file /etc/init.d install of glassfish-development-1095.x86_64 conflicts file package chkconfig-1.3.49.3-2.el6.x86_64 your %files section needs list files in it. don't own /etc/init.d , chkconfig does.

gnuplot - how to obtain contour lines with the same level color of the 3d plot -

Image
i have 3-dimensional plot obtained gnuplot, calculate contour lines as: set pm3d @ s set palette rgbformulae 33,13,10 set contour unset clabel set cntrparam levels incremental 1,1,5 sp "dati.dat" u 1:2:3 w l ls 7 notitle i'd plot contour lines same colour specified in corresponding level in 3d plot. didn't find helpful post. possible in way? you have include palette command in sp command: set pm3d @ s set palette rgbformulae 33,13,10 set contour unset clabel set cntrparam levels incremental -100,10,100 sp x*y w l ls 7 palette notitle the palette option apply definition line 2 contour-lines, , plot: note : contour levels changed -100,10,100 accomodate function x*y chose plot due lack of suitable input file. if want keep black grid on surface, suggest using multiplot , plotting grid on top of surface. updated code: set pm3d @ s set palette rgbformulae 33,13,10 set contour unset clabel set cntr...

r - Nice way to generate grid of points for use in 3d plots -

Image
every want use r plot 3d graph, e.g. below. x=seq(-3,3,0.05) y=c(); for(i in x) { y=c(y,rep(i,length(x))) } x=rep(x,length(x)) z=pmin(x,y) library(lattice) wireframe(z~x*y, shade=true, scales=list(arrows=false)) this generates plot fine but there more natural / efficient way of generating x , y vectors? want "product" operator gives me possible pairs. here's easy way to using expand.grid , outer : library(lattice) x <- seq(-3,3,by=0.05) y <- seq(-3,3,by=0.05) grid <- expand.grid(x=x, y=y) dim(grid) [1] 14641 2 grid$z = with(grid, pmin(x,y)) wireframe(z ~ x*y, data=grid, shade=true, main="x=y", scales=list(arrows=false)) contourplot(z ~ x*y, data=grid, cuts=10, aspect = "iso")

Copy a shape from a PowerPoint Master slide layout to the cu -

in powerpoint 2010: i create macro copy shape created on one of layout slides of master slide , , paste active slide - slide i'm on when i'm running macro. (i need utilize on slide- clone it, etc.) how that? thanks, you haven't mentioned how you'd identify shape copied, if know in advance it'll be, example, sixth shape on second custom layout of first master in presentation , want copy/paste onto slide 3: sub thing() dim osh shape ' copies sixth shape on second layout of first master ' change needed set osh = activepresentation.designs(1).slidemaster.customlayouts(2).shapes(6) osh.copy set osh = activepresentation.slides(3).shapes.paste(1) osh ' formatting/sizing/etc. here end end sub

SQL Server 2008 Count(Distinct CASE? -

select scheduledays = count(distinct(cast(datediff(d, 0, a.apptstart) datetime))) appointments apptkind = 1 , --filter on current month a.apptstart >= isnull(dateadd(month, datediff(month, 0, getdate()), 0),'1/1/1900') , a.apptstart < isnull(dateadd(month, datediff(month, 0, getdate())+1, 0),'1/1/3000')and --filter days aren't friday, , give fridays have hour > 12. datename(weekday, a.apptstart) <> 'friday' , datepart(hour, a.apptstart) > 12 , --filter on doctor a.resourceid in (201) this query through appointment start times , not count fridays our docs work half day on fridays. told want count them, half days (first time around told exclude them lol). could please me case statement count fridays not have appointment after 12noon, half day? believe have go in scheduledays=count(distinct(cast(datediff(d,0,a.apptstart) datetime))) . perhaps can put friday , after 12 filters in there...

javascript - Meteor.userId not persisting when i refresh the page -

i'm using meteor 0.6.3.1 , have improvised own user system (not user system thought might make use of userid variable since nobody else laid claim it.) the problem is, variable isn't persisting. i have code meteor.methods({ 'initcart': function () { console.log(this.userid); if(!this.userid) { var id = carts.insert({products: []}); this.setuserid(id); console.log("cart id " + id + " assigned"); } return this.userid; } }); the point being, should able switch pages still use same shopping cart. i can't use sessions since they're client-side , lead information leaking between users.. how should go doing this? there amplify server-side meteor? from meteor docs: setuserid not retroactive. affects current method call , future method calls on connection . previous method calls on this connection still see value of userid in effect wh...

sql server - vsdbcmd.exe generate drop constraint instructions without constraint name -

when generating diff script between 2 dbschema vsdbcmd.exe, sometime obtain unexpected output, containing drop constraint without name of constraint : go print n'dropping on column: columnname ...'; go alter table tablename drop constraint ; in our schema, column has default value constraint, auto generated name. expected vsdbcmd.exe generate valid alter table sql statement, specified in msdn library : alter table [ database_name . [ schema_name ] . | schema_name . ] table_name drop { [ constraint ] constraint_name | column column_name } do have idea of prevent vsdbcmd.exe generate valid sql statement ? this issue occurs when constraint has generated name. explicitly named constraint not impacted. therefore, solution name every constraint.

iphone - Programmatically displaying Storyboard view -

Image
i using storyboard facing error shown in below code executed no page show or action in simulator show black screen after launching image. clsmainpageappdelegate.h #import <uikit/uikit.h> @interface clsmainpageappdelegate : uiresponder <uiapplicationdelegate> @property (strong, nonatomic) uiwindow *window; @end clsmainpageappdelegate.m #import "clsmainpageappdelegate.h" #import "clsmainpageviewcontroller.h" #import "clstermsandconditionviewcontroller.h" @implementation clsmainpageappdelegate - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. nsuserdefaults *fetchdefaults = [nsuserdefaults standarduserdefaults]; int message = [fetchdefaults integerforkey:@"checkvalue"]; nslog(@"message hello : %i",message); if(message == 1) { uistoryboard *storyboard = [uistoryboard storyboardwithname:@...

Is there any applications available to write linq query and execute? -

best way learn linq? there applications available write linq query , execute? can 1 suggest this seems question google. having said that: take at: linqpad: http://www.linqpad.net/ . also see: http://code.msdn.microsoft.com/101-linq-samples-3fb9811b

python - How to convert string to list in Django template -

i want convert string list in django template : data : {u'producttitle': u'gatsby hard hair gel 150g', u'productprice': 0.0, u'productmrp': 75.0, u'hasvariants': 0, u'productsite': u'http://www.365gorgeous.in/', u'productcategory': u'', u'currency': u'inr', u'producturl': u'http://www.365gorgeous.in/gatsby-hard-hair-gel-300g-1.html', u'productdesc': u'a water type hair gel hard setting , gives hair firm hold non sticky hard setting , smooth touch firm hold wet spikes', u'productsubcategory': u'', u'availability': 0, u'image_paths': u'["full/548bc0f93037bd03340e11e8b18de33b414efbca.jpg"]'} i want extract image paths above dict image paths in string u'["full/548bc0f93037bd03340e11e8b18de33b414efbca.jpg"]' there way can convert ["full/548bc0f93037bd03340e11e8b18de33b414efbca.jpg"] ...

pyopengl - Pyglet : Alternative to avoid slow FPS when writing text? -

i need display text on screen without dropping frames, @ 120 hz. code working fine until put on text (menu options), drops 47 hz. know problem amount of text displaying. thought writing text in texture , display static image, don't know if it's possible. it? if how? i new opengl, started read red book (7th edition), still trying understand how works. code needs cross platform , can use pyopengl / pyglet. help/ advise appreciated. help. def on_draw(dt): left = true right = false rval = 0.0/255.0 gval = 153.0/255.0 bval = 0.0/255.0 shapeposition() glclear(gl_color_buffer_bit) glloadidentity() drawchecker(nbr = 16, dark = 25.0/255, light = 75.0/255) if screenswap == 1: drawquestionmark(rval, gval, bval, left) # blue line blueline(left) # line see if dropping frame dropframetest(left) pyglet.text.label('left', font_name='times new roman', font_size=34, x=(window.widt...

PHP ODBC error: tried to allocate 4294967293 bytes -

i've been trying make work whole day , think need help. have read/tried lot of related posts here nothing seems solve problem. i'm getting error: fatal error: out of memory (allocated 524288) (tried allocate 4294967293 bytes) in c:\inetpub\wwwroot\sandbox\odbc.php on line 26 when executing following code: $query = "select * table"; $res = odbc_exec($connection, $query); while( $row = odbc_fetch_array($res) ) { print_r($row); } the "line 26" referred error message line. while( $row = odbc_fetch_array($res) ) other info: running php version 5.3.24 on iis 7, windows server 2008; php memory_limit: 500m (have come increase insanely high after lower numbers didn't work) please help. thanks! i ran exact same error , turned out table selecting had field of type nvarchar(max). reducing length of field (to nvarchar(100), example) resolved issue me.

javascript - Textarea Selected Text Drag and Drop Copy -

i want users of application able highlight text textarea , drag , drop text input . i want change default behavior (the user shouldn't have hold down ctrl or alt ) copy text rather being moved textarea input. i've tried using jquery draggable , droppable . see how work if div or static static selected , helper clone used, don't know how random text selection in textarea . you try following hack: on select create transparent div , copy selected text it, 'window.getselection' make div draggable , droppable on drop content div , populate input field , clear div

c# - Using tasks when they have all completed -

Image
i have question task.factory.continuewhenall method here code: private void checknewresult(){ task.factory.continuewhenall(taskslist.toarray(),completetasks); } private void completetasks(tasks[] tasks) { if(tasks.any(t => t.status == (taskstatus.rantocompletion))) { //do } } my question when complete tasks method called? when tasks have finished completing requests? when doing task.factory.continuewhenall(taskslist.toarray(),completetasks); documentation states that creates continuation task started upon completion of set of provided tasks. either in completed state or other. one possible approach test status of task, , attempt perform continuation if status not faulted or canceled. need this. if(tasks.any(t => t.status == (taskstatus.rantocompletion)))

ClassNotFoundException with SIGAR API -

i'm trying work sigar api, , added external jar "sigar.jar" build path eclipse project. compiles no problem, when try run main class, : cpu cpu = new cpu(); it gives me error: [java] exception in thread "main" java.lang.noclassdeffounderror: org/hyperic/sigar/cpu [java] @ pt.client.user.main(user.java:90) [java] caused by: java.lang.classnotfoundexception: org.hyperic.sigar.cpu [java] @ java.net.urlclassloader$1.run(urlclassloader.java:202) [java] @ java.security.accesscontroller.doprivileged(native method) [java] @ java.net.urlclassloader.findclass(urlclassloader.java:190) [java] @ java.lang.classloader.loadclass(classloader.java:306) [java] @ sun.misc.launcher$appclassloader.loadclass(launcher.java:301) [java] @ java.lang.classloader.loadclass(classloader.java:247) [java] ... 1 more [java] java result: 1 what may missing? i think missed include .so file specific platform. these files locate...

Watir-webdriver: how to change attribute value without js/jquery -

how can change href attribute value using watir-webdriver without using js/jquery? i can attribute value: @browser.frames[2].div(:id,"mid-2").link(:class,"btn-lrg").attribute_value("href") but need change bit of href attribute value. i think way modify link use javascript. code quite maintainable since element retrieved using watir. #get first link (or element want) element = browser.frame.link #check element's initial attribute puts element.attribute_value('href') #=> "page_a.html" #execute javascript change attribute script = "return arguments[0].href = 'page_b.html'" browser.execute_script(script, element) #check attribute has changed puts element.attribute_value('href') #=> "page_b.html"

mysql - Alternative for a loop -

i trying generate simple report display number of customers owning number of distinct brands. following query wrote generates desired numbers 1 @ time. tried writing loop , takes forever. there alternative? select count(distinct customer_id) ( select customer_id,count(distinct brand) no_of_customers table_a brand_id != 10 group customer_id having count(distinct brand) =1 order customer_id) t1; what give me count of customers total count of distinct brands =1. change count of brands 2,3 , on. please let me know if there way automate this. thanks lot. use second level of group by them in 1 query, rather looping. select no_of_brands, count(*) no_of_customers (select customer_id, count(distinct brand) no_of_brands table_a brand_id != 10 group customer_id) x group no_of_brands you don't need distinct in outer query, since inner query's grouping guarantees customer ids distinct.

html - Creating PL/SQL function from query -

little knowledge of pl/sql here, need bit of help. i have query need turn function (let's call reject_list), not sure how it. have far: create or replace function reject_list(ayrc in varchar2,mcrc in varchar2) return string begin select distinct '<tr><td>'||cap.cap_uci2||'</td> <td>'||cap.cap_stuc||'</td> <td>'||cap.cap_mcrc||'</td> <td>'||cap.cap_ayrc||'</td> <td>'||stu.stu_fnm1||'</td> <td>'||stu.stu_surn||'</td> <td>'||cap.cap_stac||'</td> <td>'||cap.cap_crtd||'</td></tr>' intuit.srs_cap cap ,intuit.ins_stu stu ,intuit.srs_apf apf cap.cap_stuc = stu.stu_code , cap.cap_apfs = apf.apf_seqn , cap.cap_stuc = apf.apf_stuc , cap.cap_mcrc = &mcrc , cap.cap_ayrc = &ayrc , cap.cap_idrc in ('r','cr','cfr') , apf.apf_recd <= to_date('1501'||substr(&ayrc,1,4),...

android - Edittext outline box not visible -

i have 2 edittext's in layout. reason, border outline shows in preview here( http://gyazo.com/7cb0d1d2c5807e65f65164957b4d13b8 ) doesn't show when run app on phone or on emulator( http://gyazo.com/428bb31a974e43ccb52aaaee61f3b355 ). see box outlines edittext's in preview screen. if try , see issue is, great, thanks. xml containing 2 edittext's: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background_medium" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".list" > <linearlayout android:id=...

php - Allow access to all files from only 1 IP address and redirect all others to other file -

i'm not sure if has been answered before tried looking it. anyways, i'm developing website make actual site content accessible ip address. want .htaccess redirect other ip address separate file on server. 1 file called subscribe.php . i've tried couple things nothing provided me result wanted. know server allows .htaccess used since i've used change other things such preventing caches. you can use mod_rewrite that. add following in .htaccess file: code: options +followsymlinks rewriteengine on rewritecond %{remote_addr} !=123.45.67.89 rewriterule index.php$ /subscribe.php [r=301,l] alternative solution: <?php $allow = array("123.456.789", "456.789.123", "789.123.456"); //allowed ips if(!in_array($_server['remote_addr'], $allow) && !in_array($_server["http_x_forwarded_for"], $allow)) { header("location: http://domain.tld/subscribe.php"); //redirect exit(); } ?> ...

asp.net mvc - ASP MVC4: A issue when manipulating variable value in controller -

thanks everyone's effort of helping me out, i'm facing problem in controller below, make simple , easy: controller c{ public list<model> a; //used in action a, if it's searched list, don't initialize; public bool searched = false; public actionresult a(){ if(searched){ viewbag.a = a; }else //initial list = db.model.where(); ..... return view() } //return result list when people search keywords public actionresult b(string str){ = db.model.where(d=> d.id = str); search = true; } } but, turned out value of both , researched never changed after b called did miss critical knowledge in .net mvc? any related articles welcomed thanks you should use tempdata keep value after redirect. tempdata designed for. in example be: controller c{ public actionresult a(){ tempdat...

refactoring - Refactor C# Application -

i found this post , second option in first answer 2) if app useful within context of parent apps, being given objects or other arguments other apps, consider refactoring small app allow form's project referenced parent apps. then, parent apps can create new instance of form , display it: var childform = new smallappform(); childform.owner = this; //the child window close when owner does. childform.show(); i have questions steps have in order accomplish it. the app trying call can found here . to change have main (parent) form creates , calls application class, add new project "parent", add main new parent form application. have menu choice start wizard in parent form in order create , call wizard this? createusercontext context = new createusercontext(); createuserwizard wizard = new createuserwizard(context); thanks guidance, leslie what tranform small aplication class library instead of winforms application. (it can project withi...

Video Delay/Buffer in Processing 2.0 -

i'm having ton of trouble making simple video delay in processing. looked around on internet , keep finding same bit of code , can't work @ all. when first tried it, did nothing (at all). here's modified version (which @ least seems load frames buffer), have no idea why doesn't work , i'm getting tired of pulling out hair. please... please, love of god, please point out stupid mistake i'm making here. , now, without further delay (hah, it?), code: import processing.video.*; videobuffer vb; movie mymovie; capture cam; float seconds = 1; void setup() { size(320,240, p3d); framerate(30); string[] cameras = capture.list(); if (cameras.length == 0) { println("there no cameras available capture."); exit(); } else { println("available cameras:"); (int = 0; < cameras.length; i++) { println(cameras[i]); } cam = new capture(this, cameras[3]); cam.start(); } vb = new videobuffer(90, width, ...

Scala - replace xml element with specific text -

so have xml <a>blah</a> and want change <a>somevalueidonotknowatcompiletime</a> currently, looking @ this question . however, changes value "2" what want same thing, able define value (so can change @ runtime - reading values file!) i tried passing value overridden methods, didn't work - compile errors everywhere (obviously) how can change static xml dynamic values? adding code var splitstring = somestring.split("/t") //where somestring line file val action = splitstring(0) val ref = splitstring(1) xmlmap.get(action) match { //maps "action" string xml case some(entry) => { val xmltosend = insertrefintoxml(ref,entry) //for different xml, want put string "ref" in appropriate place } ... for example: scala> val x = <foo>hi</foo> x: scala.xml.elem = <foo>hi</foo> scala> x match { case <foo>{what}</foo> => <fo...

Android ListView: Align last list item to top of screen -

i have listview's stackfrombottom xml attribute set true, when activity opens, last items in listview ones visible opposed top items, default. however, want activity open last item in listview aligned top of screen. in other words, there should blank space below last item takes remaining space. i've attempted adding footer view listview: view footer = inflater.inflate(r.layout.empty_view, listview, false); viewgroup.layoutparams lp = footer.getlayoutparams(); lp.height = ???; footer.setlayoutparams(lp); listview.addfooterview(footer); the problem don't know during activity's oncreate function height assign blank footer view. need know height of last item in listview decide height make blank footer view, height of last listview item not fixed number. how can height of last listview item? or perhaps there better way altogether? i found simple solution problem: wrap listview in framelayout. apparently alignment handled differently other viewgroups. ...

python - All integer points on a line segment -

i'm looking short smart way find integer points on line segment. 2 points integers, , line can @ angle of 0,45,90,135 etc. degrees. here long code(so far 90 degree cases): def getpoints(p1,p2) if p1[0] == p2[0]: if p1[1] < p2[1]: return [(p1[0],x) x in range(p1[1],p2[1])] else: return [(p1[0],x) x in range(p1[1],p2[1],-1)] if p2[1] == p2[1]: if p1[0] < p2[0]: return [(x,p1[1]) x in range(p1[0],p2[0])] else: return [(x,p1[1]) x in range(p1[0],p2[0],-1)] edit: haven't mentioned clear enough, slope integer -1, 0 or 1, there 8 cases need checked. reduce slope lowest terms (p/q), step 1 endpoint of line segment other in increments of p vertically , q horizontally. same code can work vertical line segments if reduce-to-lowest-terms code reduces 5/0 1/0.

Irregular array subsetting in R -

let's have array testarray=array(1:(3*3*4),c(3,3,4)) in following refer testarray[i,,] , testarray[,j,] , testarray[,,k] x=i , y=j , z=k subsets, respectively. in specific example, indices i , j can go 1 3 , k 1 4. now, want subset 3 dimensional array x=y subset. output should be do.call("cbind", list(testarray[1,1,,drop=false], testarray[2,2,,drop=false], testarray[3,3,,drop=false] ) ) i have (naively) thought such operation should possible by library(matrix) testarray[as.array(diagonal(3,true)),] this works in 2 dimensions matrix(1:9,3,3)[as.matrix(diagonal(3,true))] however, in 3 dimensions gives error. i know produce index array indexarray=outer(diag(1,3,3),c(1,1,1,1),"*") mode(indexarray)="logical" and access elements by matrix(testarray[indexarray],nrow=4,ncol=3,byrow=true) but first method nicer , need less memory well. know how fix testarray[as.array(...

postgresql - Is Hadoop Suitable For This? -

we have postgres queries take 6 - 12 hours complete , wondering if hadoop suited doing faster. have (2) 64 core servers 256gb of ram hadoop use. we're running postgresql 9.2.4. postgres uses 1 core on 1 server query, i'm wondering if hadoop 128 times faster, minus overhead. we have 2 sets of data, each millions of rows. set one: id character varying(20), a_lat double precision, a_long double precision, b_lat double precision, b_long double precision, line_id character varying(20), type character varying(4), freq numeric(10,5) set two: a_lat double precision, a_long double precision, b_lat double precision, b_long double precision, type character varying(4), freq numeric(10,5) we have indexes on lat, long, type, , freq fields, using btree. both tables have "vacuum analyze" run right before query. the postgres query is: select id setone 1 not exists ( select 'x' settwo 2 ...

pdf - QR Code reading/writing in Ruby -

what's easiest way add qr code reading/writing capabilities ruby (2.0) program (if helps, codes written , read pdfs)? of gems i've found seem have not been updated in quite time, , have ton of dependencies. there options out there? https://github.com/smparkes/zxing.rb ymmv, i'm author. i'm primary c++ maintainer of zxing , use zxing.rb lot of testing should up-to-date c++ port is. no comment on number of dependences: they're not barrier me, obviously.

python - finding the standard deviation of each list in a list of lists -

how modify code: def sd(numlist): cntn=len(numlist) sumn=0 in numlist: sumn+=i avgval=float(sumn)/float(cntn) sumvar=0.0 in range(cntn): sumvar+=float((numlist[i]-avgval)**2) return ((float(sumvar)/float((cntn-1)))**0.5) so work if numlist list of lists , want find standard deviation of each row? appreciated def sd(numlists): def singlesd(numlist): cntn=len(numlist) sumn=0 in numlist: sumn+=i avgval=float(sumn)/float(cntn) sumvar=0.0 in range(cntn): sumvar+=float((numlist[i]-avgval)**2) return ((float(sumvar)/float((cntn-1)))**0.5) return [singlesd(l) l in numlists]

command line - Linking compiled android libraries together in a complex project -

i'm migrating large, complicated android library project gradle, , having trouble incorporating library projects large project. has been discussed in other questions, no 1 has yet (to knowledge) posted problem. have several applications, bunch of third party libraries, , own shared library. folder structure follows: --root -build.gradle -settings.gradle |--apps |--myapp |--libraries |--thirdparty |--actionbarsherlock -build.gradle |--facebook -build.gradle |--google-play-services-lib -build.gradle |--personal |--commons -build.gradle - androidmanifest.xml |--src |--main, blah blah |--proprietary now, personal/commons library depends on of third party libs (abs, facebook, etc). each third party lib depends on common jar files can brought in mavencentral, , each of builds perfectly. it's important have separation...

Highcharts mulitple y axis unit not display -

i new in highcharts. creating multiple series reading java server side json list, json objects consist multiple series , each series have 'electric irms' following 'temperature' mapping 2 y axis label. the problem encounter 2nd y axis unit not display. json list format are {name, "serialnumber1_type1", {"data", [[timestamp1, value1], [[timestamp2, value2], ... {name, "serialnumber1_type2", {"data", [[timestamp1, value1], [[timestamp2, value2], ... {name, "serialnumber2_type1", {"data", [[timestamp1, value1], [[timestamp2, value2], {name, "serialnumber2_type2", {"data", [[timestamp1, value1], ... {"title","highcharts title"} e.g json list [{"name":"5004672_irms"},{"data":[[1373958000000,53],[1373958300000,53]......

iphone - Rotating a View in iOS causes UIImageView height issues -

i have been writing app ios, , trying implement landscape views. trying support both ios 5 , ios 6, have autolayout disabled. when rotate landscape, layout loades correctly. rotate landscape, , when rotate portrait, uiimageview containing logo stretches underneath button , label. from viewcontroller.m: @interface viewcontroller () - (ibaction)showmenu:(id)sender; @end @implementation viewcontroller @synthesize start, menubutton, vector_status, login_status, items, recordlength, countdown, change_name, iapi, running, timeover, setupdone, dfm, motionmanager, locationmanager, recorddatatimer, timer, testlength, expnum, sampleinterval, sessionname,geocoder,city,country,address,datatobejsoned,elapsedtime,recordingrate, experiment,firstname,lastinitial,username,usedev,password,session_num,managedobjectcontext,datasaver,x,y,z,mag,image ; // displays correct xib based on orientation , device type - called automatically upon view controller entry -(void) willrotatetointerfaceorien...

oop - Calling the public instance methods of a composed private class member without passthrough functions in Javascript -

i trying find way avoid creating lots of passthrough methods on class's prototype. have class progressbar, has lot of instance methods. want create new class (called composedprogressbar in code example), "has a" progressbar instance, , not inherit progressbar. in order access progressbar's instance methods client code, customary create series of passthrough functions. such as: composedprogressbar.prototype.setwidth = function (width) { this.progressbar.setwidth(width); }; however, i'm trying avoid this. i able access progressbar's privileged methods adding following composedprogressbar's constructor: progressbar.call(this); but, isn't suitable i'm trying implement. need access methods have been added progressbar's prototype. below example code based on i'm working with. have included height setter , getter illustrate using progressbar.call(this) works them. is possible i'm trying achieve? function progressbar()...

Oracle sql merge to insert and delete but not update -

is there way use oracle merge insert , delete not update? i have table representing set of values related single row in table. change set of values deleting them , adding new set, or selectively deleting , adding others, interested in making single statement if possible. here working example update. in order make work, had add dummy column available update not in on condition. there way delete , insert without dummy column update? no column on condition may in update set list if not updated. create table every_value ( the_value varchar2(32) ); create table paired_value ( the_id number, a_value varchar2(32) , dummy number default 0 ); -- the_id foreign_key row in table insert every_value ( the_value ) values ( 'aaa' ); insert every_value ( the_value ) values ( 'abc' ); insert every_value ( the_value ) values ( 'ace' ); insert every_value ( the_value ) values ( 'adg' ); insert every_value ( the_value ) values ( 'aei' ); insert e...

javascript - Remove an image brought up by on mouseover -

the following script opens image onmouseover, can't come way remove image onmouseout. know missing extremely simple can't seem find works. <script type="text/javascript"> function show(id) { document.getelementbyid(id).style.display="inline"; } </script> <span onmouseover="show ('myimage')">- <u>lazarette</u></span></b> <img src="../images/markilinedrawinglazarette.jpg" id="myimage" border="0" style="display:none;" you close! add onmouseout event! html <b> <span onmouseover="show('myimage',true)" onmouseout="show('myimage',false)">- <u>lazarette</u></span></b> javascript function show(id, show) { document.getelementbyid(id).style.display = show ? "inline" : "none"; }

Retrieve info from many-to-many relationship in django temaplate -

i creating blog , have many-to-many relationship between posts , categories. class category(models.model): title = models.charfield(max_length=255) slug = models.slugfield() def __str__(self): return self.title class post(models.model): title = models.charfield(max_length=255) subtitle = models.charfield(max_length=255,null=true,blank=true) published_date = models.datetimefield(auto_now_add=true) draft = models.booleanfield(default=true) body = richtextfield(config_name='blog') slug = models.slugfield() categories = models.manytomanyfield(category) featured = models.booleanfield(default=false) i trying retrieve the list of categories associated individual post within template can display category titles @ bottom of post. here template code displays posts not categories. {% post in blog_posts %} <div class="post"> <div class="date"> {...

extjs - moving rows up and down on ext grid using ext4 -

i'm trying enable allowing rows moved , down using buttons on ext grid using ext 4. here's snippit of code moving row up: var record = grid.getselectionmodel().selection.record; var index = grid.getstore().indexof(record); var newindex = index - 1; this.store.remove(selection, true); this.store.insert(newindex, record); //selectionmodel.select(record); when move once, it's correct , row moves , stays highlighted. when move again, row moves , becomes unhighlighted , deselected. i tried selecting record on last line of code commented out, line of code ends highlighting row below moved row while keeping moved row highlighted. i want able continually press button , move selected row without having reselect manually. it might lot easier add field store/model ranks records. way have change rank-number , filter store. should keep selection intact. if don't want rank-field synced proxy, set "persist" property false on fie...

Python read from list -

i have question lists in python , how print them. of following code snippets prints 7 words found in list "words"? have compiled , tried still don't know of snippets correct. 1. = 0 while < 7: print(words[i], end=" ") += 1 2. = 0 while < 7: print(words[i], end=" ") += 1 3. = 1 while < 7: print(words[i], end=" ") += 1 4. = 0 sum = "" while < 7: sum += words[i] += 1 print(sum) 5. = 0 sum = "" while <= 7: sum += words[i] += 1 print(sum) if list looks this, words = ["a","b","c"..] , all have iterate on them using for statement, for in words: print that should print out words: a b c ....

jquery - CORS with JSON Fallback for IE -

i have following code works on browsers except ie: access denied. please help!!! have looked @ tons of examples , still cannot resolve this. keep simple doing returning text url. <script type="text/javascript"> // insure document loaded... $(document).ready(function() { // set url pos api... var posapiurl = 'https://test.safety.com/posapi/getposmessage?app=rmis'; // load pos api message... function loadposmessage(edurl) { if (window.xmlhttprequest) { xmlhttp = new xmlhttprequest(); } else if (window.xdomainrequest) { xmlhttp = new xdomainrequest(); } else { xmlhttp = new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readystate == 4 && xmlhttp.status == 200) { var jsonedition = xmlhttp.responsetext; ...

c# - How to verify a certificate in fiddler core? -

i want verify certificate issued server valid , alert user choose if cannot verified. presently seems certificates accepted fiddler without alerting user. there mechanism it? perhaps in following code found in fiddler core sample project. want alert user self-signed certificates untrusted root. static void checkcert(object sender, validateservercertificateeventargs e) { if (null != e.servercertificate) { console.writeline("certificate " + e.expectedcn + " site " + e.servercertificate.subject + " , errors " + e.certificatepolicyerrors.tostring()); if (e.servercertificate.subject.contains("fiddler2.com")) { console.writeline("got certificate fiddler2.com. we'll other site, https://fiddlertool.com."); e.validitystate = certificatevalidity.forcevalid; } } } by default, fiddlercore validate remote certificate...

Android: only show cursor in edittext when keyboard is displayed -

how can show cursor of edittext when keyboard displayed. @ moment cursor blinking if edittext not active , keyboard hidden, annoying. this how layout looks: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/activity_main_root" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white" > <imagebutton android:id="@+id/activity_main_add_button" android:layout_width="40dp" android:layout_height="40dp" android:background="@drawable/button" android:contentdescription="@string/desc_add" android:onclick="addgame" android:src="@android:drawable/ic_input_add" android:tint="@color/gray" /> <view an...

android - Getting data (asynchronous) and populating ViewPager's fragments -

i have activity viewpager variable number of fragments (tabs). upon start activity checks if associated (complex) data has been loaded. if hasn't shows progress bar view , starts asynctask fetches data. depending on data activity creates number of fragments (tabs) , gives each fragment sub set of data. i hold references fragments (i know discouraged) , run sorts of problems when fragments gets reused - i'm giving data wrong instance of fragment. so, there "android way" of solving problem? i run sorts of problems when fragments gets reused fragments don't reused in viewpager . not adapterview rows recycled. using fragmentpageradapter or fragmentstatepageradapter , fragment represents 1 , 1 page. i re-instantiate viewpager each time (but fragments reused?) ah. that's different problem. the stock implementations of fragmentpageradapter , fragmentstatepageradapter make couple of assumptions: they in complete control on f...

jquery fileDownload library, done event never called -

i use filedownload calling excel export page. works download. "done" event never called. $.filedownload('exportexcel.aspx') .done(function () { alert('file download success!'); }) .fail(function () { alert('file download failed!'); });

python - python2.7 peek at stdin -

i call sys.stdin.readlines() without removing stdin. using python2.7 on linux. for example, want is: x = sys.stdin.readlines() y = sys.stdin.readlines() then x , y have identical strings. acceptable if read stdin , put contents in. background: i have module either takes 1 file input , -optional argument or "some input piped module" , -optional argument mymodule.py myfile -option or echo "some input" | mymodule.py -option i have working, , works fine. checking sys.stdin.isatty() determine if there input piped in. if there is, module throw error if there more 1 argument command line (there can 1 -optional argument, no files specified if there stdin) the reason i'm having problem because i'm required have unit tests pass on command line in eclipse. works fine on command line, looks pyunit plugin eclipse uses sys.stdin also. if call sys.stdin.readlines() , eclipse gives on running unit tests. additionally, eclipse pushing things sys.stdi...

Adding paperclip and imagemagick pathing to environment.rb of rails project -

qustion: what correct line of code should add insure paperclip , imagemagick linked enviroment.rb on side note there common caveats should mindful of when deploying paperclip/imagemagick on vps (imagemagick on vps install , same path) ok i'm new rails, ubuntu , i'm trying install paperclip. askes add pathing in config/enviorment.rb file paperclip can link imagemagick. link reference to ensure does, on command line, run convert (one of imagemagick utilities). give path utility installed. example, might return /usr/local/bin/convert. then, in environment config file, let paperclip know there adding directory path. running command yields: /usr/bin/convert link old video old video of installing paperclip adds config/enviorment.rb config.gem 'paperclip' in config/environments/development.rb add following line: paperclip.options[:command_path] = "/usr/bin/" this points parent directory of convert application, bec...

regex - Extract links from BBcode with Ruby -

which simple method / regular expression extract links bbcode [code]...[/code] section? links begin http:// , end \n or [/code] tag, maybe space or other whitespace characters @ end. one [code] section can contains multiple links / code tag: [code]http://example1.com http://example2.com http://example3.com [code] and multiple consecutive [code] sections can occur: [code]http://example4.com http://example5.com [/code] [code]http://example6.com[/code] [code] http://example7.com http://example8.com[/code] i links such section defined above in simple flattened array, unable solve right regular expression scan method. try one: data = '[code]http://example4.com http://example5.com [/code] [code]http://example6.com[/code] [code] http://example7.com http://example8.com[/code]' p data.split(/\[\/*code\]/) .flat_map{|el| el.split(/\s+/)} .reject(&:empty?) output: #=> ["http://example4.com", "http://example5.com", ...

Android Facebook SDK Hash Key on Windows 7 64 bits -

the problem: i can´t functional hash key. works fine without fb app installed on emulator @jesse chen says in famous answer subject not working properly. i've tried: use openssl-0.9.8k_x64, openssl-0.9.8e_x6 , openssl-0.9.8e_win32. use openssl envoronment variable ( http://www.youtube.com/watch?v=lrduyk1wdla ) use openssl it's respecting path. use debug.keystore it's respecting path , without it. delete debug.keystore , regenerated debugging fb samples. i 've tried way says on fb tutorial : @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // add code print out key hash try { packageinfo info = getpackagemanager().getpackageinfo( "com.facebook.samples.hellofacebook", packagemanager.get_signatures); (signature signature : info.signatures) { messagedigest md = messagedigest.getinstance("sha"); md.update(signature.tobytearray()); log.d(...