Posts

Showing posts from June, 2015

Recursively Delete Matching Files via PHP -

i reworked naming convention of images on our website. when uploaded images altered names, ended getting images duplicated, 1 copy old naming convention , 1 new naming convention. images numbered in thousands , didn't want manually delete them all. so decided needed figure out php script capable of deleting old images site. luckily old images consistently named either ending of f.jpg or s.jpg. had find files endings , delete them. thought straightforward thing, whatever reason several different solutions found listed online didn't work right. ended going old code had posted on stackoverflow different purpose , reworked this. i'm posting code answer problem in case might useful else. below solution finding files matching naming convention in selected folder , sub-folders , deleting them. make work situation. you'll want place above directory want delete, , you'll specify specific folder replacing part have ./media/catalog/ . you'll want replace cr...

c# - Moq Callback is fine in first test, but same code returns null in second test -

would know why, when using moq in 2 tests have following code: var magentochannelmock = new mock<imagentochannel>(); var magentochannelmock = new mock<imagentochannel>(); magentochannelmock.setup(x => x.salesorderinvoicecreate(it.isany<string>(), "2", it.isany<orderitemidqty[]>(), it.isany<string>(), it.isany<string>(), it.isany<string>())) .callback<string, string, orderitemidqty[], string, string, string>((s1, s2, x, s3, s4, s5) => invoicessent = x); i have 2 tests in test class, when run each individually, run fine , callback object "invoicessent" contains expected value. when run both tests @ same time, second test run gets null returned callback. any idea? [test] public void invoice_3line_qtythatisinvoicedshouldbe12() { //arrange orderitemidqty[] invoicessent = null; var magentochannelmock = new mock<imagentochannel>(); magentochannelmock.setup(x => x...

database - Parse error: syntax error, unexpected '$sql' (T_VARIABLE) in -

parse error: syntax error, unexpected '$sql' (t_variable) in /home/orientsolutionsc/public_html/cdmdb/dbcon.php on line 19 here codes //insert data `mysql` $sql="insert users(jimbo, kata, mtaa ,uongozi ) values('$jimbo', '$kata', '$mtaa' '$uongozi')"; $result=mysql_query($sql); $sql="insert users(jimbo, kata, mtaa ,uongozi ) values('".$jimbo."', '".$kata."', '".$mtaa."', '".$uongozi."')" or if want insert '$jimbo' etc.. string then $sql="insert users(jimbo, kata, mtaa ,uongozi ) values('$jimbo', '$kata', '$mtaa', '$uongozi')";

Read multiple data types from txt file into arrayList - Java -

for program i'm supposed read txt file containing information on automobile's make , model , mpg , , trunk space in order. example is: hyundai genesis 24.6 100 , repeated several different cars. had construct " automobile " superclass instance variables of make , model. " gasengineauto " subclass instance variable mpg extends " automobile ". subclass called " sedan " extends " gasengine auto " , has instance variable trunk space. assignment had these classes signed off on make sure made correctly. write method read information file gas_sedans.txt , store in list created in previous step. list should parameter method. within method, open file, read information each sedan appropriately-typed variables, call parameterized constructor (the 1 takes arguments attributes) create object, add object list. call method main. below code far. wanted try make sure read arraylist before used method it. impor...

delete bundle file in iOS app -

here problem: trying check contents of app's bundle. writing couple of lines of code like: nsbundle *mybundle = [nsbundle mainbundle]; nslog(@"%@",mybundle); i got path need locate app's bundle. however, when deleted bundle, expecting app give error saying bundle doesn't exist. instead, showed same path again. hy doesn't have impact on program. how work under hoods? new ios, appreciated. thanks in advance!!!

ios - How can I "remove" the embed segue in my container view, or remove the container view completely? -

i have splashviewcontroller containerview , created in storyboard. in story board, automatically drag embed segue containerview profileviewcontroller . inside splashviewcontroller , want programatically "destroy" containerview + profileviewcontroller (both of them). i've tried this: self.containerview.hidden = true //obviously doesn't work. it's visual self.containerview.removefromsuperview() //nope. it's visual. how can remove both containerview and profileviewcontroller completely, making sure both deinit appropriately? if that's not possible, can @ least deinit profileviewcontroller? (i'll set containerview hidden). note: play movie video automatically (looping) in profileviewcontroller. has sound, , when set containerview nil , remove superview, sound keeps playing. i wrote quick example project here demonstrating solution here . autoplaying video (with dog barking) automatically plays in bottom of screen. pressing ...

makefile - Treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated -

this similar warning: treating 'c-header' input 'c++-header' when in c++ mode, behavior deprecated . however, op trying compile header files. in case, i'm trying generate dependencies: $ git diff diff --git a/gnumakefile b/gnumakefile index 791ef05..ce48a59 100644 --- a/gnumakefile +++ b/gnumakefile @@ -175,6 +176,11 @@ libimportobjs = $(libobjs:.o=.import.o) testimportobjs = $(testobjs:.o=.import.o) dlltestobjs = dlltest.dllonly.o +-include gnumakefile.deps + +gnumakefile.deps: + $(cxx) $(cxxflags) -mm *.h *.cpp > gnumakefile.deps + how use cxx build dependencies while avoiding clang warning? the -mm option of c++ compiler give list of dependencies input file. assuming compile .cpp files (and don't $(cxx) -c xyz.h or such) , dependencies needed .cpp files. changing to: $(cxx) $(cxxflags) -mm *.cpp > gnumakefile.deps should give dependencies need in gnumakefile.deps.

c++ - Two objects in namespace to be default initialized by different functions and used by class within namespace -

i have strange request. have namespace foo 2 declared objects of type bar , namely bar1 , bar2 , initialize via constructor of class bar. sound way so: namespace foo { class bar; foo::bar *bar1; foo::bar *bar2; } class foo::bar { /* initialize bar1 , bar2 in constructor. */ initializebar(); }; the reason behind shenanigan create object similar cout , cin such foo::bar1 , foo::bar2 need not defined user. more specifically, using ncurses , wish replace cout output window bar1 , cin input window bar2 , overload operators , such foo::bar1 << prints in output window see fit , foo::bar2 >> b extracts values input window , dumps b. able via c functions call need extend c++. perhaps default initialization of bar1 , bar2 accordingly? one way use simple function pattern. keep constructor private , clients can access these objects via 2 functions. want disable copy constructor , copy assignment operator well. // .h namespace f...

Android In-app micropayments with PayPal -

i'm developing free android app , want sell digital service inside app. price of service 1 €, 0.35 € commission of paypal crazy. solution micropayment system (about 0.10 € of commission in paypal). possible include paypal micropayment inside app (kind of paypal in-app micropayment)? how it? in case not possible, other alternatives recommend? thanks lot , kind regards! paypal requires separate account micropayments, , micropayment rate charged on purchases account. according site , need sign business account, contact support account enabled 5cents + 5% micropayment rate. after that, can integrate paypal app normally, using micropayment-enabled account.

javascript - Dynamically change stylesheet onclick anywhere on site -

i wondering if there's way keep changing stylesheet (so series of 5 or so) of whole page every time user clicks anywhere @ all. maybe using $(document).click function? give main <link> tag id , create array of href url's want. <link data-style_index="0" id="main-style" href="main.css" rel=.... > jquery: var styles =['url1.css','url2.css','url3.css'...]; $(document).click(function(){ var $link =$('#main-style'), // index stored on element data , increment nextindex = $link.data('style_index') + 1; //revert first if @ last 1 if( nextindex === styles.length){ nextindex = 0; } // change href , store new index value in tag data $link.attr('href', styles[nextindex]).data('style_index', nextindex); }); using element store current index styles array in html5 data- attribute

regex - python substitute words between two points in a text -

in last few days dealing regular expressions. so, let's have text text = ' 1. sometext sometext sometext given follows: «book 1 title here part 1 1. mpla mpla mpla 2. text text «here spesific text» book 2 1. text text. 2. «also» try in case of emergency.» book 3 part 3 directions home' and trying find books between '«' , '»'. change word 'chapter' , text back. using regular expression can't result want because far can understand regex isn't best solution counting how many '»' have passed far. for example if use print re.findall(r'«([book\s\s+]*?)»', data, re.dotall) i text until first '»'. there way book 1 , book two? i tried this: print re.findall(r'(?<=«)(?=(book\s\s+))|(?=[^«]*»)(?=(book\s\s+))',data, re.dotall) but neither works. there way result or should use other regular expressions? one solution in 2 parts follows: print re.findall(r"(book\s\s+)", re.search...

jquery - delete and reset html table row ids for the rest of the table -

how reset html table row id , name after deleting row using jquery. example html table has 5 rows , if delete 3rd row, actual 4th , 5th row textbox id should become 3 , 4 <script type="text/javascript"> $("#add").on("click",function() { var data ='<tr><td>2</td><td><input type="text" id="name2" value=""/></td><td><input type="text" id="phone2" value=""/></td><td><input type="text" id="email2" value=""/></td><td><button id="delete">delete</button></td></tr>'; $("tbody").append(data); }); </script> <button id="add">add row</button> <table> <tbody> <tr> <td>1</td> <td><input type="text" id="name1" value=""/></td> <td>...

ios - AudioServicesPlaySystemSound sound volume dependency -

i'm making ios keyboard extension. to play click sound, used audioservicesplaysystemsound . however users reported click sound depends on 'bell sound volume(bell icon)' , 'normal sound volume(speaker icon)' i tested on apple memo app , found there cases inconstant dependency. here code init func inittypesound(soundindex: int) { let bundle = nsbundle.mainbundle() var = 0 ; < max_type_sound_count ; i++ { if let url = bundle.urlforresource(nsstring(format: "type%d_%d", soundindex, i) string, withextension: "wav") { // file exist var soundid : systemsoundid = 0 audioservicescreatesystemsoundid(url, &soundid) mtypesoundids.insert(soundid, atindex: i) } else { // no file } } } and code play func play(soundtype: kksoundtype) { if (!mhaspermission || !missound) { return } var session = avaudiosession.sharedinstance...

android - Add array of URLs to imageview -

i have following code url html file using jsoup , save in array: element table2 = document.select("table").get(1); (element td : tr.select("td")){ element img = td.select("img").first(); if (img == null){ continue; } string imgrelpath = img.attr("src"); images.add("http://hostname.com"+imgrelpath); } } objimages = images.toarray(); the array has: http://hostname.com/hobbit/gifs/static/green.gif http://hostname.com/hobbit/gifs/static/green.gif http://hostname.com/hobbit/gifs/static/clear.gif http://hostname.com/hobbit/gifs/static/clear.gif http://hostname.com/hobbit/gifs/static/green.gif http://hostname.com/hobbit/gifs/static/red.gif http://hostname.com/hobbit/gifs/static/green.gif http://hostname.com/hobbit/gifs/static/green.gif http://h...

SQL Server 2008 Express : find similar records in a table -

here first question sql server 2008 express database, containing articles, quantities, prices , on. unfortunately when loaded data first time loaded articles making following mistake: i created 2 records (almost) every article similar different character. here's example: tuto510088.9x3 tuto510088,9x3 the different character , , . . there way select these articles delete ones comma , leaving others? please note position of different character not fixed, on 3rd right, or in middle you can using self join: delete t2 tablename t1 join tablename t2 on replace(t1.article,'.','')=replace(t2.article,',','') t2.article '%,%' demo in sql fiddle you can check records going deleted replacing delete t2 select t2.*

android - debug.log for XposedBridge? -

i work on application xposedbridge , have lot of questions. start simple ones. how can debug.log file? i cannot find debug.log file. have tried phone shell 2 adb ways : a. adb shell data/data/de.robv.android.xposed.installer/log/debug.log b. adb shell "su -c 'cat data/data/de.robv.android.xposed.installer/log/debug.log'" c. adb shell cat data/data/de.robv.android.xposed.installer/log/debug.log adb says : " no such file or directory " the phone shell can cd /data , /data/data not after. cannot ls neither of data's. says access denied. adb when try adb ls. the phone, moto e xt1023, rooted. despite, shell cannot read directories. have posted question why here no 1 seems care answer. i had go es file explorer. managed /data. es says folder empty. managed emulator/0/de.robv.android.xposed.installer or alike. there subdirectory called files. inside installer. no debug.log. searched directories es debug.log. nothing found. once create xpose...

system.reactive - group and aggregate with rxjs -

scan works this(with sum function): 1-1-1-1-1-1 -> 1-2-3-4-5-6 but need this: n=3 1-1-1-1-1-1 -> 3-3 how achieve behavior? in rxjs can use bufferwithcount : var source = rx.observable.from([1,1,1,1,1,1]) .bufferwithcount(3) .flatmap(group => rx.observable.from(group).sum()); you optionally use windowwithcount don't have rewrap output in order use sum you'll empty final window well, fire out extraneous 0 value.

ios - Sending float to parameter of incompatible type id -

i'm in middle of creating button uses core data save name, xcoordinate, , ycoordinate of point annotation. can persist name, keep getting error when try save coordinate. i've logged correct data, can't seem save it. when try setvalue newpoi, error reads: sending 'float' parameter of incompatible type 'id'. in data model, attribute set float. self.latitude , self.longitude of type float. my method little rough because i'm relatively new this, appreciate feed give me concerning error. below code method. don't understand 'id' comes play here. -(void) saveselectedpoiname:(nsstring *)name withy:(float)ycoordinate withx:(float)xcoordinate{ self.pointfrommapview = [[mkpointannotation alloc] init]; self.annotationtitlefrommapview = [[nsstring alloc] init]; appdelegate *appdelegate = [[uiapplication sharedapplication] delegate]; nsmanagedobjectcontext *context = [appdelegate managedobjectcontext]; self.annotationtitle...

python - numpy eigenvalues correct but eigenvectors wrong -

my code print numpy.linalg.eig([[1, 2, 3], [5, 4, 9], [63, 7, 5]]) the output (array([ 21.61455381, -9.76720959, -1.84734422]), array([[-0.17186028, -0.14352001, 0.03651047], [-0.48646994, -0.50447076, -0.8471429 ], [-0.85662772, 0.8514172 , 0.53010931]])) i using online eigenvector calcualtor verify http://www.arndt-bruenner.de/mathe/scripts/engl_eigenwert2.htm gives following answer: real eigenvalues: { -9.767209588804548 ; -1.8473442163236111 ; 21.61455380512816 } eigenvectors: for eigenvalue -9.767209588804548: [ -0.1685660264358372 ; -0.5925071319066865 ; 1 ] for eigenvalue -1.8473442163236111: [ 0.06887346700751434 ; -1.5980532339710003 ; 1 ] for eigenvalue 21.61455380512816: [ 0.20062423644695662 ; 0.5678895584242702 ; 1 ] the values don't match. going wrong? they match (sort of...). these eigenvectors indeed same 1 another, ones online calculator not normalized (though should sake of convenience). eigenvectors of m...

c - how to "migrate" from cortexM3 to cortexM4 -

i have old project, run on sam3s( cortex-m3) , need use base ew project should run on sam4s cortex-m4 . after changing o opeocd.cfg errors, , don't mean : error: target not examined yet in procedure 'halt' error: jtag scan chain interrogation failed: zeroes error: check jtag interface, timings, target power, etc. error: trying use configured scan chain anyway... error: at91sam3s4.cpu: ir capture error; saw 0x00 not 0x01 error: target not examined yet can here give hint should ? update now error : error: sam4 chipid 0x28ab07e0 not found in table (perhaps can id chip?) version: 0 [0x0000] eproc: 7 [0x0007] cortex-m4 nvpsize: 7 [0x0007] 128k bytes nvpsize2: 0 [0x0000] none sramsize: 11 [0x000b] 64k bytes arch: 138 [0x008a] atsam3s/sam4s xc series (100-pin version) nvptyp: 2 [0x0002] embedded flash memory extid: 0 [0x0000] (exists: no) error: auto_probe ...

SSH to a server and exit Python script (in the same shell) -

i'm running script that's determining login information me, , in end outputting login information need use. i running script in terminal, , want ssh me credentials has, exit python script on computer , connect current terminal new server. say have sshhost, sshuser , sshpass variables in script. how run ssh command in current terminal , connect server? i tried subprocess , spur, didn't manage going. i appreciate , in advance. assuming python prints settings stdout; #!/bin/sh export $(credentials.py) exec ssh hostname

How to translate i tag of html into rails' link_to helper? -

i translate below code link_to helper. how that? <a href="#"><i class="fa fa-twitter"></i></a> you can recreate above link using link_to 's block format, so: <%= link_to "#" %> <i class="fa fa-twitter"></i> <% end %> hope helps!

java - how to read soap response header from JAX-WS -

this not work me.hadlers.xml error this makes soap header content private list getheaders() { messagecontext messagecontext = context.getmessagecontext(); if (messagecontext == null || !(messagecontext instanceof wrappedmessagecontext)) { return null; } message message = ((wrappedmessagecontext) messagecontext).getwrappedmessage(); list<header> headers = castutils.cast((list<?>) message.get(header.header_list)); return headers; }

node.js - Unable to bring node inspector to debug express/nodejs app hosted on IIS -

Image
i have hosted express/nodejs app on iis using iisnode. this how web.config looks: <configuration> <appsettings> <add key="node_env" value="production" /> </appsettings> <system.webserver> <!-- indicates hello.js file node.js application handled iisnode module --> <handlers> <add name="iisnode" path="server/app.js" verb="*" modules="iisnode" /> </handlers> <iisnode loggingenabled="false" debuggingenabled="true" debuggerpathsegment="debug" /> <rewrite> <rules> <clear /> <rule name="debug" patternsyntax="wildcard" stopprocessing="true"> <match url="server/app.js/debug*" /> <conditions logicalgrouping="matchall" trackallcaptures="false" /> <act...

android - Ordering elements in a layout file -

i have been trying layout elements such button occupies bottom of screen , remaining elements arranged in successive manner @ top of screen no success. last editext(opedt) showed bit distant others somewhere in middle of screen. changes have them in desired order? here xml layout file: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:background="@drawable/beezlinkbackg" android:layout_height="match_parent" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:paddingbottom="@dimen/activity_vertical_margin" tools:context="gsie.beezlink.opportunityactivity"> <relativelayout android:id="@+id/footer...

Why is this error happening in c? -

i wrote code in codevisionavr: //global variable int second2=0; int sec_wait=14; bit waito_get=0,wait_to_string=0,error_reciv=0,fail_reciv=0; . . . // in function while (second2 < sec_wait) { if (wait_to_string || error_reciv || fail_reciv) second2= sec_wait; }; if (wait_to_string == 0) { printf("second2 %d sec_wait %d error_reciv %d fail_reciv %d \r\n", second2, sec_wait, error_reciv, fail_reciv); }; output of program this: second2 1 sec_wait 14 error_reciv 0 fail_reciv 0 how exit while loop, when condition true value printed? also have 2 interrupt routines: interupt1: each 1 second second2++ interupt2: character usart , maybe set: wait_to_string ,error_reciv, fail_reciv. my assembler code is: ; 0000 01ec while(second2 < sec_wait){ _0x87: call subopt_0xc call subopt_0x5 cp r26,r30 cpc r27,r31 brge _0x89 ; 0000 01ed if(wait_to_string || error_reciv ||...

Unable to start a Docker container through Remote Docker Java API -

i beginner docker technology , have been attempting build java app capable of starting , stopping existing docker containers. for purpose had been using java docker api client - docker-java. https://github.com/docker-java/docker-java , had been using https://github.com/docker-java/docker-java/wiki test cases observe how api works have not been able find related tutorials. using code, have enabled java application create docker container using following code sample. createcontainerresponse container = client.createcontainercmd("chirangaalwis/docker-whale") .withcmd("/bin/sh -c '/usr/gam") .exec(); but have been unsuccessful in starting container created using java application , throws out following exception: exception in thread "main" com.github.dockerjava.api.internalservererrorexception: cannot start container 485386a92b34c5aaf53793207e5c6a8146295b23602c9d0adf86d64a1b27d031: write /sys/fs/cgroup/cpuset...

How do I get my num_digit function to give me the correct output and how do I get it to return any integer value in python? -

how num_digit function return 1 instead of 0 whenever put in 0 parameter in function? how function return integer such negative numbers? def num_digits(n): count = 0 while n: count = count + 1 n = abs(n) / 10 return count i working on question number 2 first. if put abs(n) in line of code while is, still infinite loop still not understand why. figured if can n value positive , input in -24, convert 24 , still count number of values. on question 1, not know start, ive tried: def num_digits(n): count = 0 while n: if n == 0: count = count + 1 n = n / 10 return count i forgot add have limited tools use since still learning python. have gotten iterations , studying while loops , counters. have not gotten break yet although have idea of does. when in doubt, brute force available: def num_digits(n): if n == 0: return 1 if n < 0: return num_digits(abs(n)) count = ...

objective c - What grid/view does Instagram use for the feed? -

i'm in process of emulating instagram application ios using xcode , objective-c. looked around not figure out how instagram implemented following grid feed: https://debsphuong.files.wordpress.com/2014/10/5-volleyball-hashtag-page.jpg any insights appreciated it. thank you that uicollection view. when tap on button turn grid single column grid, cells resized width of view , reloaded again.

javascript - Detect right mouse click outside of the user selection (highlight) -

lets user selected (text/image/anything) on page , clicked right mouse button. there way detect whether clicked outside of selection or inside it? after lot of tries*, think there no clean solution this. i come tweak of jstonne 's answer (which tweak of mikeb 's answer on same thread) may fit needs. it implies range of current selection on right click (easy part), , check if target node of event in range (tricky part). sadly, there no easy way nodes contained in range object we've iterate through nodes contained between range.startcontainer , range.endcontainer . * even 1 implying range.extractcontents() , mutationobservers notes : since chrome seems make new range selection when right-click, return true if right click on text. when select img tag, you're selecting textnodes before , after element, if select first image in below example, , right-click on some dummy text text, return true. if same test on second image, won't, since te...

c++ - Dangling pointer with explicit conversion -

in scott meyrses effective c++ provided exampple of bad usage of implicit conversions along raii classes: class font { // raii class public: explicit font(fonthandle fh) // acquire resource; : f(fh) // use pass-by-value, because {} // c api ~font() { releasefont(f ); } // release resource ... // handle copying (see item14) private: fonthandle f; // raw font resource }; and implicit conversion function: class font { public: ... operator fonthandle() const // implicit conversion function { return f; } ... }; he provided example of such bad usage: font f1(getfont()); ... fonthandle f2 = f1; // oops! meant copy font // object, instead implicitly // converted f1 underlying // fonthandle, copied and here said: now program has fonthandle being managed font object f1, fonthandle available direct use f2. that’s never good. example, when f1 destroyed, font released, ...

php - str_replace() doesn't work as expected -

i have string : $string = "somehting<br><br>"; when try str_replace() this: echo str_replace("<br>","<c>",$string); the output string doesn't change @ all. what tried: echo mb_detect_encoding($string); // returns utf-8 var_dump(strpos($string, "<br>")); // bool(false) i have edited string html dom node class before , don't know wrong. i have tried reproduce problem on sandbox.onlinephpfunctions.com real string , works. so unable reproduce problem. so turns out. string encoded html-entities. see looking source code or using highlight_string($yourstring) , see: &lt; instead of < . to decode use html_entity_decode() . example: $string = str_replace("<br>","<c>", html_entity_decode($string)); highlight_string($string);

algorithm - Find number of continuous subarray having sum zero -

you have given array , have give number of continuous subarray sum zero. example: 1) 0 ,1,-1,0 => 6 {{0},{1,-1},{0,1,-1},{1,-1,0},{0}}; 2) 5, 2, -2, 5 ,-5, 9 => 3. with o(n^2) can done.i trying find solution below complexity. i don't know complexity of suggestion have idea :) can try reduce element main array not able contribute solution suppose elements -10, 5, 2, -2, 5,7 ,-5, 9,11,19 can see -10,9,11 , 19 element never gone useful make sum 0 in case try remove -10,9,11, , 19 main array can 1) create 2 sub array main array `positive {5,7,2,9,11,19}` , `negative {-10,-2,-5}` 2) remove element positive array not satisfy condition condition -> value should construct negative arrays element or sum of elements ie. 5 = -5 //so keep //don't consider sign 7 = (-5 + -2 ) // keep 2 = -2 // keep 9 // cannot construct using -10,-2,-5 same 11 , 19 3) remove element form negative array not...

sql - SSRS 2008 draw lines on report -

i have 2 sets of coordinates in table. first set xfrom , yfrom , other set xto , yto. if draw line between these 2 coordinates arrow. i draw these arrows in report, many rows table has. xfrom yfrom xto yto 1 1 3 3 2 2 4 4 1 2 5 6 each row represents arrow i can't seems find way. any suggestions? thanks drag , drop chart control toolbox. , pop-up, displaying various image shapes chart control & try choose option.

amazon web services - Display elastic beanstalk cron output in events -

i have cron jobs running in elastic beanstalk ec2 instance , i'm trying output of cron show in events on elastic beanstalk dashboard. how achieved? i don't believe can write custom output beanstalk events. events used show deployment related activities.

c++ - OpenGL blending: texture on top overlaps its pixels which should be transparent (alpha = 0) -

Image
i drawing map texture and, on top of it, colorbar texture. both have alpha channel , using blending, set as // turn on blending glenable(gl_blend); glblendfunc(gl_src_alpha, gl_one_minus_src_alpha); however, following happens: the texture on top (colorbar) alpha channel imposes black pixels, don't want happen. map texture should appear behind colorbar alpha = 0. is related blending definitions? how should change it? assuming texture has alpha channel , it's transparent in right places, suspect issue rendering order , depth testing. lets render scale texture first. blends correctly black background. render orange texture behind it, pixels scale texture have higher depth value , cause orange texture there discarded. so, make sure render transparent stuff in front order, or farthest nearest. without getting order independent transparency, common approach alpha transparency follows: enable depth buffer render opaque geometry disable depth writes (...

html mail receive of php form -

i using code php form have added fields want receive form in html format while comming in general message in mail should attached file.. not coming php code this <?php /** configuration options * $email_address = email address form submissions sent * $company_address = destination address used in contact form */ $email_address = 'info@synergywebdesigners.com'; $company_address = 'delhi, india'; // send html mail, content-type header must set $headers = 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n"; /** not edit below line unless comfortable php */ echo "<script>var companyaddress = '".$company_address."';</script>"; $field_rules = array( 'name' => 'required', 'email' => 'required|valid_email', 'phone' => '', 'contact_reason' => 'required...

python - convert categorial variables into integers using pandas -

i trying convert categorical variables integers. however, want them use same key (a gets converted 1 across fields. below code not use same keys. import pandas pd df1 = pd.dataframe({'a' : ['a', 'a', 'c', 'd','b']}) df2 = pd.dataframe({'a' : ['d', 'd', 'b', 'a','a']}) df1_int = pd.factorize(df1['a'])[0] print df1_int df2_int = pd.factorize(df2['a'])[0] print df2_int this output get: [0 0 1 2 3] [0 0 1 2 2] as you're trying learn categories 1 dataframe apply different dataframe, using scikit-learn might provide more elegant solution: from sklearn import preprocessing import pandas pd df1 = pd.dataframe({'a' : ['a', 'a', 'c', 'd','b'], 'b' : ['one', 'one', 'two', 'three','four']}) df2 = pd.dataframe({'a' : ['d...

laravel - PHP Search function string to number conversion (search for month) -

in laravel, using following code in eventscontroller: public function index() { $search = input::get('search'); $searchresult = events::orderby($order, $by)->where(function ($query) use ($search) { $query->where('name', 'like', '%'. $search .'%') ->orwhere('date', 'like', '%'. $search .'%')->get(); })->paginate(10); $search = str_getcsv($search, ' '); if (in_array("january", $search)) { $searchresult = events::orderby($order, $by)->where('date', 'like', '%2015-01'%')->paginate(10); } if (in_array("february", $search)) { $searchresult = events::orderby($order, $by)->where('date', 'like', '%2015-02'%')->paginate(10); } return view::make('events.index') ->with('events...

Cassandra Seed crashed - How to rejoin? -

i have 3-node cluster of cassandra instances. my former seed died. wiped data directory , commitlogs in hope rejoin cluster, didn't. promoting other 2 remaining nodes seeds didn't help, because former seed goes without getting data, metadata. promoted them seeds adding them "-seeds" list in cassandra.yaml this log when joining: http://pastebin.com/z28lha3w 192.168.81.66 seed. 192.168.81.68 , 192.168.81.70 other 2 nodes the node bootstrapped. doing repair should restore data on node.

java - Adding app shortcut on lockscreen -

Image
i want add app's shortcut on phone's lock screen, possible in android ? below screenshot (which of iphone) make clear. without widget.. any appreciated, :) if want add shortcut in home-screen possible api android provides. but talking adding shortcut lock-screen, few (very few) android devices support officially. have experience lot of different android devices lot of different manufacturers none of them supports adding app shortcut on lockscreen. you might not willing accept answer may not provide answer looking for, still try give two possible solutions :- 1) need create own lockscreen , have privilege of adding shortcut want there. see if that's possible solution you. 2) or, if know of android device support this, need contact device manufacturer knowing api. i rest assured there no official api available put app shortcut on lockscreen. hope best.

Script execution time in PHP -

i find out script execution of script. used below code. $time_start = microtime(true); //here script extracting 13,000 product using api $time_end = microtime(true); $execution_time = ($time_end - $time_start)/60; echo '<b>total execution time:</b> '.$execution_time.' mins'; this script working in localhost not working in production server. on other hand if reduce product quantity 4,000 working in production server. why happening so?? thanks update if add echo 'mouse'; @ end of script not printing. it might case script facing time out. so, please try add time out limit @ top of script file. set_time_limit(0); $time_start = microtime(true); //here script extracting 13,000 product using api $time_end = microtime(true); $execution_time = ($time_end - $time_start)/60; echo '<b>total execution time:</b> '.$execution_time.' mins';

Clear memory in python loop -

how can clear memory in python loop ? import concurrent.futures futures futures.threadpoolexecutor(max_workers=100) executor: fs = [executor.submit(get_data, url) url in link] i, f in enumerate(futures.as_completed(fs)): x= (f.result()) results.append(x) del x del f get_data - simple function wich using requests i think had same problem recently, answer not del introducing sleep func... try; import time import concurrent.futures futures futures.threadpoolexecutor(max_workers=100) executor: fs = [executor.submit(get_data, url) url in link] i, f in enumerate(futures.as_completed(fs)): x= (f.result()) results.append(x) time.sleep(n_seconds) or (i used while loop on list of urls)

javascript - Is it possible to "loosely" define an object using React.PropTypes.shape? -

using react.proptypes.shape possible object must have fields x,y,z, can have many arbitrary other fields likes? i ensure object has @ least few required fields, want user able pass in number of additional key/values object well. you can add many fields want. react.proptypes.shape not care additional unspecified fields.

javascript - AngularJS - Uncaught Error: [$injector:modulerr] Failed to instantiate module -

i learning angular , have receiving cryptic , mysterious "angularjs - uncaught error: [$injector:modulerr]" in console when viewing index.html, post below (as angular js files being referenced.) can please tell me i'm doing wrong? error message vague... index.html <!doctype html> <html lang="en"> <head> <meta char-set="utf-8"> <!--for angular routing--> <base href="/"> <link rel="stylesheet" href="assets/css/style.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.3/angular.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.3/angular-animate.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.3/angular-route.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/angu...