Posts

Showing posts from June, 2015

java - error in apply method in Background subtraction in opencv android -

i want background subtraction on inputframe, , want return foreground mask. facing error bellow can 1 me fix in advance my code: package org.opencv.samples.tutorial1; import org.opencv.android.baseloadercallback; import org.opencv.android.camerabridgeviewbase.cvcameraviewframe; import org.opencv.android.loadercallbackinterface; import org.opencv.android.opencvloader; import org.opencv.core.mat; import org.opencv.core.point; import org.opencv.core.scalar; import org.opencv.video.backgroundsubtractormog; import org.opencv.android.camerabridgeviewbase; import org.opencv.android.camerabridgeviewbase.cvcameraviewlistener2; import android.app.activity; import android.os.bundle; import android.util.log; import android.view.menu; import android.view.menuitem; import android.view.surfaceview; import android.view.windowmanager; import android.widget.toast; public class tutorial1activity extends activity implements cvcameraviewlistener2 { private static final string tag = "di...

android - .gif Image as source runs nicely in Windows kivy program . Running via kivy Launcher shows background of gif image -

Image
i running program showing .gif image in widget , works when run app using kivy launcher .gif image comes square box when image without backgrund . any 1 ideas , why behaving differently on android , windows . please see below .kv code example of how used .gif image . using .gif image button . <butimage@buttonbehavior+asyncimage> canvas.before: color: rgb: (0, 0, 1) pushmatrix rotate: axis: 0,0,1 angle: 20 origin: self.center source: "images/butterflybluex.gif" canvas.after: popmatrix ... first make sure package pil/pillow [just add 1 of requirements while building apk] gif loading, otherwise pure python loader slow android used, second please elaborate mean square box? update: updated example shows using asyncimage local source, async image ment used remote url local sources can use image class. second: if getting white background instead of image gave...

node.js - How to add production mode to sailsjs app when started using PM2 -

to start sailsjs in production mode append --prod . run: node app.js --prod i'm using pm2 , simple json file settings, contains name of process , scriptname, kick off node process. how pass production argument using pm2? read pm2 json app declaration . e.g. (not tested) [{ "name" : "sails", "script" : "./app.js", "args" : "['--prod']" }]

android - Make editable EditText on LongClick in ListView -

i'm trying make edittext field in listview editable on longclick on item. i've searched same topics on stackoverflow, haven't found best case. here edittext xml listview item: <edittext android:id="@+id/list_title_parent_item" style="@style/list_parent_title_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_alignparenttop="true" android:inputtype="textpersonname" android:focusable="false" android:background="@android:color/transparent" android:lines="1" /> firstly disabled editing , shows text. longclick on item, must editable. i've tried did setting onitemlonglistener listview: private class listviewonlongclicklistener implements onitemlongclicklistener { @override public boolean onitemlongclick(adapterview<?>...

R: relisting a flat list -

this question has nice solution of flattening lists while preserving data types (which unlist not): flatten = function(x, unlist.vectors=f) { while(any(vapply(x, is.list, logical(1)))) { if (! unlist.vectors) x = lapply(x, function(x) if(is.list(x)) x else list(x)) x = unlist(x, recursive=f) } x } if give following list, behaves expected: > = list(c(1,2,3), list(52, 561), "a") > flatten(a) [[1]] [1] 1 2 3 [[2]] [1] 52 [[3]] [1] 561 [[4]] [1] "a" now i'd restructure flat list a . relist fails miserably: > relist(flatten(a), skeleton=a) [[1]] [[1]][[1]] [1] 1 2 3 [[1]][[2]] [1] 52 [[1]][[3]] [1] 561 [[2]] [[2]][[1]] [[2]][[1]][[1]] [1] "a" [[2]][[2]] [[2]][[2]][[1]] null [[3]] [[3]][[1]] null now, of course relist(unlist(b), a) loses data types again. way restructure flat list? bonus points if handles analogous attribute unlist.vectors correctly. one way is: relist...

version control - Why "src/core" is ignored automatically in IntelliJ VCS -

i use intellij idea 13.1.1. it's source folder structure. module1/src/api module1/src/core and use cvs version control system. "api" source folder managed intellij vcs, "core" sorce foloder not managed. files marked olive color , vcs sub menus deactivated, except "check out". why "src/core" ignored automatically in intellij vcs? i checked "file"->"settings"->"version control"->"ignored files" "core" not exists.

Split row into multiple rows in SQL Server for insert -

i trying create sql query insert single row 2 rows in table. my data looks this: size | indemnity_factor | monitoring_factor -------------------------------------------- 0 | 1.00 | 1.5 the end data looks this: id | claim_component_type_code | size | adjustment_factor | valid_from_date ------------------------------------------------------------------------------ 1 | indemnity | 0 | 2.5000000 | 2014-01-01 1 | monitoring | 1 | 1.5000000 | 2014-01-01 i want add entry of indemnity , monitoring every row in first data source. haven't got idea how go it, appreciative if help. sorry rough data can't post images reputation apparently. thanks in advance. use unpivot select * (select size, indemnity_factor indemnity, monitoring_factor monitoring yourtable) src unpivot (adjustment_factor claim_component_type_code in (indemnity, monitoring) ) u

multiple Input for sales system with javascript and PHP -

hi :) have dificulties in develope sales system. in system have itemname,item price,qty , total. problem every time want add new row new item entry the price won't appear in item price textbox , calculation "total" did not works too. can 1 me solved problems. here code regards, sugi <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="script.js"></script> <title>untitled document</title>enter code here </head> <body onload="setup()" > <script type="text/javascript"> function setup(){ var itemname = document.getelementbyid("item_name"); var tot = doc...

mysql - Datastax hadoop InvalidRequestException(why:You have not logged in) -

i have installed datastax enterprise "dse-4.0.1", when tried demo per below link http://www.datastax.com/docs/datastax_enterprise2.0/sqoop/sqoop_demo , getting below error, can please me issue, facing, log file attached reference. [root@chbslx0624 bin]# ./dse sqoop import --connect jdbc:mysql://127.0.0.1/npa_nxx_demo --username root --password poc123 --table npa_nxx --target-dir /npa_nxx 14/04/14 10:44:14 warn tool.basesqooptool: setting password on command-line insecure. consider using -p instead. 14/04/14 10:44:14 info manager.mysqlmanager: preparing use mysql streaming resultset. 14/04/14 10:44:14 info tool.codegentool: beginning code generation 14/04/14 10:44:14 info manager.sqlmanager: executing sql statement: select t.* `npa_nxx` t limit 1 14/04/14 10:44:14 info manager.sqlmanager: executing sql statement: select t.* `npa_nxx` t limit 1 14/04/14 10:44:14 info orm.compilationmanager: hadoop_home /opt/cassandra/dse-4.0.1/resources/hadoop/bin/.. note: /tmp/sqoop...

security - How to protect my standalone android app -

my android app created me works offline , load dynamically .jar libraries. there , effective way protect applications against copying , distribution of these libraries? i grateful help. you can download default package directory. that directory private application can access that. you can create folder there , download file @ location.

ios - EKEventStore causes SpringBoard crash -

i build application fetches ekevents calendar (by ekeventstore predicateforeventswithstartdate:enddate:calendars: ) , synchronize app-events calendars (with ekeventstore saveevent:span:commit:error: ). i use static reference ekeventstore , make sure ekeventstore not accessed simultaneously different processes. the app terminated springboard crash on ios7. here backtrace of crash. last exception backtrace: 0 corefoundation 0x18625e950 __exceptionpreprocess + 132 1 libobjc.a.dylib 0x1927641fc objc_exception_throw + 60 2 corefoundation 0x18625e810 +[nsexception raise:format:arguments:] + 116 3 foundation 0x186d96db4 -[nsassertionhandler handlefailureinmethod:object:file:linenumber:description:] + 112 4 eventkit 0x186adab84 -[ekeventstore _addfetchedobjectwithid:] + 240 5 eventkit 0x186adaa64 __78-[ekeventstore registerfetchedobjectwithid:with...

java - Both Scanner and BufferedReader not reading the first line of file in unicode format -

i have tried reading file contents line line using bufferedreader. then, tried scanner also. problem is, if read file in unicode format, first line not read . please help. used tamil latha font. my code: with bufferedreader file sourcefile=new file("d:/sample.txt"); fileinputstream f1=new fileinputstream(sourcefile); bufferedreader br1=new bufferedreader(new inputstreamreader(f1, "utf8")); linenumberreader lnr = new linenumberreader(new filereader(sourcefile)); lnr.skip(long.max_value); int lines=lnr.getlinenumber(); lnr.close(); for(i=0;i<lines;i++) { system.out.println(s); } br1.close();

Access VBA Return form control value from variable -

i trying return value of form control using below coding, unfortunately error "runtime error 2465, cant find field "forms!frm1!control1 referred in expression". vartest = "forms!" & screen.activeform.name & "!control1" msgbox controls(vartest).value please can can value returned? thanks.

Windows 7 Batch - Create subfolder, then find files with certain text in file name and move those files in the newly created subfolder -

tried best searching solution close need example did not work. bash: moving multiple files subfolders i not programmer unable create batch file myself windows 7. appreciated. needed code batch file following:- searches folder files have "_f1" in file name creates subfolder named "f1" file located move files searched in step 1 folder "f1" created in step 2 ideally, batch file should execute parent folder , should complete 3 steps in subfolders @ least till 3 levels down parent folder. thanks in advance help. i tried , came this. works, raw. needs run manually inside of each folder (100's of them) mkdir f1 mkdir f2 500 move *_f1*.* f1 move *_f2*.* f2 enddo try : @echo off /f "delims=" %%a in ('dir /s/b/a-d *.* ^| find /i "_f1"') ( if not exist "%%~dpaf1" md "%%~dpaf1" move "%%~fa" "%%~dpaf1")

How to compare timegm in Perl? -

i need on code below. wanted earliest time "inspection start" column , latest time "inspection stop" column . issue script not seem correctly pick earliest time. or possible compare timegm format using script below my data: inspection start inspection stop e4855 wi_left01 3/12/2014_5:00:09_am 3/12/2014_5:02:08_am 9334 8195 8135 59 1 60 99.27 h0096 wi_left01 3/12/2014_5:22:58_am 3/12/2014_5:24:55_am 9334 8197 8138 58 1 59 99.28 l0998 wi_left01 3/12/2014_5:29:13_am 3/12/2014_5:31:09_am 9334 8163 8088 73 2 75 99.08 p0113 wi_left01 3/12/2014_5:15:37_am 3/12/2014_5:17:39_am 9334 8008 7927 80 1 81 98.99 p0149 wi_left01 3/12/2014_5:12:36_am 3/12/2014_5:14:31_am 9334 8195 8125 68 2 70 99.15 t2765 wi_left01 3/12/2014_5:25:59_am 3/12/2014_5:28:00_am 9334 7810 7732 77 1 78 99.00 t5518 wi_left01 3/12/2014_5:04:37_am 3/12/2014_5:06:37_am 9334 8182 8107 73 2 75 99.08 my code: #!/usr/bin/perl use time::timegm; $line = ""; $in...

excel - How to have Range condition in VLOOKUP? -

Image
i have below table in excle file , want find value column respective input. col col b col c min max value 101 aa high 0 10 1% 101 aa high 11 20 2% 101 aa low 0 10 3% 101 aa low 11 20 4% 101 bb high 0 10 5% 101 bb high 11 20 6% 101 bb low 0 10 7% 101 bb low 11 20 8% for input 101, aa, low, 12 - should 4% have tried formula array , working great, prerformnace not , hence wanted move away. dont want use dsum or vba. want achieve in plain excel formula. please help if there no duplicate rows, can use following formulas: for excel 2007 or later: =sumifs(f2:f9,a2:a9,101,b2:b9,"aa",c2:c9,"low",d2:d9,"<="&12,e2:e9,">="&12) for excel 2003: =sumproduct((f2:f9)*(a2:a9=101)*(b2:b9="aa")*(c2:c9="low")*(d2:d9<=12)*(e2:e9>=12)) where 101 , "aa...

javascript - Html5 audio element can't read blob url -

i'm using asp.mvc , recorder.js capture audio view, converting resulting blob url using url=url.createobjecturl(blop); then sending url server. now problem when send url client , try play in audio element src,it gives 404 not found error. your thoughts please... edit: my code goes this: setinterval(function () { if (canvas) { dataurl = canvas.todataurl(); recorder && recorder.exportwav(handlewav.bind(this)); recorder.clear(); fd = new formdata(); fd.append("audio", audiourl); fd.append("id", id); fd.append("drawing", dataurl); xhr = new xmlhttprequest(); xhr.open("post", "/session/uploaddata", true); xhr.send(fd); } }, 100); i'm sending canvas drawingurl , audiourl server , them both again in view this setinterval(function () { if (ctx) { $.ajax({ url: "/session/downloaddata/" + i...

Fast Maximum Matching Algorithm for Bipartite Graphs -

i trying solve following problem algorithm slow. that's because using edmonds - karp algorithm find maximum flow when applied bipartite graphs gives maximum matching well. it's running time n^5. know faster algorithms solve problem (for bipartite graphs specifically). 1 algorithm studying relabel front n^3. i write bipartite matching using dinitz's algorithm . there theorem graphs of type of maximum bipartite matching problems has same complexity relabel front(and way easier implement). in networks arising during solution of bipartite matching problem, number of phases bounded o(\sqrt{v}), therefore leading o(\sqrt{v} e) time bound. resulting algorithm known hopcroft–karp algorithm. more generally, bound holds unit network — network in each vertex, except source , sink, either has single entering edge of capacity one, or single outgoing edge of capacity one, , other capacities arbitrary integers. unfortunately wikipedia article on algor...

android - chariotsolutions phonegap-nfc plugin intent -

i use phonegap-nfc plugin chariotsolutions. reading nfc tag while app running no problem. registered app intents starts when app in background , tag read. ndeflistener not fired. know how tag information when app started intent? you need add mime type listener nfcevent fired intent when application launches. you can use same event handler using ndef listener, same except event type. don't need specify mime type. nfc.addmimetypelistener("", app.onnfc, success, failure); this bit odd, way works because of how events fired in plugin implementation.

javascript - Ruby - Watir - Get HTML with interpreted js -

after doing on ruby file : browser = watir::browser.new browser.goto 'anywebsite.com' puts browser.html > "~/index.html" i html code non-interpreted javascript. example, things : <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> my question is, how can html after js interpretation ? thanks in advance answers ! when use html method, getting current dom - ie html after javascript interpretation. for example, take simple html page includes javascript add button: <html> <body> <script> var btn=document.createelement("button"); document.body.appendchild(btn); </script> </body> </html> when go page , browser html, can see includes button added javascript (see end of second last line) - ie html after javascript has been interpreted: browser.html #=> <html xmlns="http://www.w3.org/1999/xhtml">...

regex - PHP code with regexp for dutch phone are not working -

i used expression solution given in regular expression dutch phone number php code below, code not working. the code simple don't see go wrong ? define("regexp_phone_nl","(^\+[0-9]{2}|^\+[0-9]{2}\(0\)|^\(\+[0-9]{2}\)\(0\)|^00[0-9]{2}|^0)([0-9]{9}$|[0-9\-\s]{10}$)"); $string = "+31123456789"; //based on solution given in https://stackoverflow.com/questions/17949757/regular-expression-for-dutch-phone-number echo(filter_var($string, filter_validate_regexp,array("options"=>array("regexp"=>regexp_phone_nl)))); regex works, forgot put same characters in beginning , in end of pattern (delimeters). <?php define("regexp_phone_nl","/(^\+[0-9]{2}|^\+[0-9]{2}\(0\)|^\(\+[0-9]{2}\)\(0\)|^00[0-9]{2}|^0)([0-9]{9}$|[0-9\-\s]{10}$)/"); $string = "+316123456789"; //based on solution given in http://stackoverflow.com/questions/17949757/regular-expression-for-dutch-phone-number var...

php - curl getting header and cookie from one URL and posting to another URL to retrieve data -

i'm trying retrieve json data url, requires http authorization (no password) cookie , header data need parent url. i've managed retrieve header information integrating within post part of script having difficulty with. function check_link($link) { $main = array(); $ch = curl_init(); curl_setopt ($ch, curlopt_url, $link); curl_setopt ($ch, curlopt_header, 1); curl_setopt ($ch, curlopt_nobody, 1); curl_setopt ($ch, curlopt_followlocation, 1); curl_setopt ($ch, curlopt_netrc, 1); curl_setopt ($ch, curlopt_timeout, 300); curl_setopt ($ch, curlopt_useragent, "mozilla/4.0 (compatible; msie 5.01; windows nt 5.0)"); ob_start(); curl_exec ($ch); $stuff = ob_get_contents(); ob_end_clean(); curl_close ($ch); return $stuff; } $link = 'http://www.avis.fr/default.aspx'; //parent url $returndata = check_link($link); print_r($returndata); //header information curl_setopt($ch2, curlopt_httpheader, array ($returndata)); $url2 = "http://www.avis.fr/...

javascript - How to call a popup from a link inside another popup. Jquery Mobile -

i have popup this: <div data-role="popup" id="popup1"> <a href="#pop" data-rel="popup">link open popup</a> </div> and div popup id="pop" is: <div data-role="popup" id="pop"> <!-- content here --> </div> so how open popup id="popup" link inside popup. i tried regular way. did not work! $("#popup1").popup('close'); $("#pop").popup('open'); even above did not work! jqm popups cannot chained. have fire second after timer delay. see jqm documentation , search "chain": http://api.jquerymobile.com/popup/

Bind dynatable search to onchange -

im using http://www.dynatable.com/ , there search input filtering data. problem works on hitting enter/losing focus etc , want use on every letter change. you can change dynatable accomodate needs. @ line 1215 of jquery.dynatable.js(version 0.3.1), search performed on enter keypress. may change keyup without waiting enter key press. default code: $search .bind(settings.inputs.queryevent, function() { obj.queries.runsearch($(this).val()); }) .bind('keyup', function(e) { if (e.which == 13) { obj.queries.runsearch($(this).val()); e.preventdefault(); } }); modified code: $search .bind(settings.inputs.queryevent, function() { obj.queries.runsearch($(this).val()); }) .bind('keyup', function(e) { obj.queries.runsearch($(this).val()); e.preventdefault(); });

mysql - mysqltuner - Sorts requiring temporary tables -

i'm new stackoverflow, that's first shot :) i have issue mysql db. running performance issues, decided use mysqltuner. result is [--] for: 7m 42s (7k q [16.452 qps], 78 conn, tx: 927k, rx: 2m) [--] reads / writes: 86% / 14% [--] total buffers: 2.1g global + 1.1m per thread (151 max threads) [ok] maximum possible memory usage: 2.3g (24% of installed ram) [ok] slow queries: 0% (16/7k) [ok] highest usage of available connections: 2% (4/151) [ok] key buffer size / total myisam indexes: 1.0g/834.4m [ok] key buffer hit rate: 99.1% (8m cached / 79k reads) [!!] query cache efficiency: 0.0% (0 cached / 4k selects) [ok] query cache prunes per day: 0 [!!] sorts requiring temporary tables: 376% (2k temp sorts / 675 sorts) [ok] temporary tables created on disk: 0% (13 on disk / 7k total) [ok] thread cache hit rate: 94% (4 created / 78 connections) [ok] table cache hit rate: 26% (102 open / 384 opened) [ok] open file limit used: 1% (63/5k) [ok] table locks acquired immediately: 100% ...

regex - regular expression for cpp_source files and c_source_files in python -

can tell me how express regular expression following 2 strings: c_source_files cpp_source_files i analyze text file contains text segments beginning mentioned strings. it expressed approximately follows: for result in re.findall('c(.*?)pp_source_files', re.s) # something.... thx in advance! you can use regex: # 'c' optionally followed 'pp', followed '_source_files' r'c(pp)?_source_files' if need these strings separate words (so things notc_source_files don't match), can use word boundary 'matchers': # \b matches word boundary r'\bc(pp)?_source_files\b'

android - GridView element selection has different size -

Image
i've gridview 3 columns , fixed height. seems fine when click on element, selector bigger clicked element. in image, can see, fifth element selected, , selection goes on elemen boundaries. the gridview layout pretty simple <gridview android:id="@+id/gridview" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:numcolumns="3" android:stretchmode="columnwidth" /> and item pretty straightforward <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="@dimen/row_height" android:gravity="center" > <imageview android:id="@+id/img" android:layout_width="@dimen/width" android:layout_height="@dimen/height" android:layout_gravity="...

batch file - MS Windows: running several commands in parallel -

when running following command in windows 7... for /l %%n in (1,1,20) start /b groovy -cp selenium-server-standalone-2.39.0.jar script.groovy box%%n ... expected 20 groovy processes started (almost) simultaneously. instead, i'm having no more 5 processes operating @ same time. when 1 script ends , whole number of running scripts becomes 4, 1 more script starting. far understand, it's gonna kind of limitation "start" command in windows. question : options run 20 scripts simultaneously? 20 not magic number here. want rid of 5 scripts limitation introducing "start" command. a note familiar selenium: couple of reasons, don't want use selenium grid run scripts simultaneously on several nodes. thanks, racoon the batch code executes program called waitapp.exe, passing in number each time. @echo off /l %%n in (1,1,20) start "waiting:%%n" /b waitapp.exe %%n @echo on c# code waitapp.exe class program { static void main(st...

ways and usefull libraries for sending image from client (android) to server (Spring) -

i find next possible ways 1) convert image base64 string , put string json object. send image json entry android 2) create array of bytes out of bitmap, , create new string array of bytes, , send server http://blog.3dmick.com/2012/06/android-app-for-uploading-images-on-server/ which else libraries or ways u know ?? ways popular on enteptise projects?

html - How IE Document modes are automatically selected -

might pretty basic bit confused about, how ie automatically determines browser mode selected, can see list of browser modes in ie9 ie9 compatibility mode, ie9, ie8, ie7. these modes automatically selected based on webpage. how browser mode automatically selected in ie browsers? thanks sites use x-ua-compatible meta tag. see further information: msdn for example: <html> <head> <!-- mimic internet explorer 8 --> <title>my web page</title> <meta http-equiv="x-ua-compatible" content="ie=emulateie8" /> </head> <body> <p>content goes here.</p> </body> </html>

asp.net mvc 4 - Getting error in webmatrix data while using mvc4 -

Image
i getting weird error. not connected database. working on mvc4.can ? that exception in asp.net web app. not related asp.net, or mvc either. in turn file not loaded error. http://msdn.microsoft.com/en-us/library/system.io.fileloadexception(v=vs.110).aspx (system.io.fileloadexception) above link msdn post exception. can learn name, exception thrown, when file found, not loaded due error. these errors thrown assembly files found in application, not loaded.

php - Does Stripe record a payee's IP address? -

i'm trying troubleshoot stripe payment issue on client's wordpress website running event espresso plugin. reason, payment went through on stripe appears payment notification didn't make client's website. we've tested , can't replicate issue. our hosting provider have asked if can provide ip address of successful payment, can't see mention of recorded ip address in stripe logs. know if record of payee's ip address accessible anywhere? any hugely appreciated! dave. doesn't it. doing sample curl test api: { "id": "ch_103qsk2ezvkylo2cxp4iail9", "object": "charge", "created": 1397483829, "livemode": false, "paid": true, "amount": 400, "currency": "usd", "refunded": false, "card": { "id": "card_103qsk2ezvkylo2cqxxrjvwq", "object": "card", "las...

php - No default label for attribute in zend form -

i have strange problem. i'm creating form radio element using zend_form class , default should wrapped in attribute , is, have no attribute points on particular radio element. why? should default. did turn sth off or what? the for attribute not required on labels if label contains form element relates to, case zf1's radio buttons. behaviour hard-coded formradio view helper difficult (although not impossible) override. if explain why need attribute in particular might able further.

vim snipMate: expand snippet within a snippet -

using vim-snipmate have following problem: if try expand snippet within snippet, snipmate takes me next placeholder of current snippet instead of expanding new snippet. e.g.: if press tab in following situation: for (i = 0; < 10; i++) { ifi<press tab here> } i expect: for (i = 0; < 10; i++) { if (<cursor position>) ; } but following: for (i = 0; < 10; i++) { ifi }<cursor position> is there way expand snippets within snippets or @ least way suppress going next placeholder? best regards the original snipmate did not support recursive snippet expansion. apparently, fork doesn't, neither. wouldn't hurt ask on project's issue tracker such support. a modern alternative (that requires python though) ultisnips . far know, 1 support snippets within snippets.

objective c - iOS constraints not updating as expected -

Image
i have superview circle view , holderview contains 3 labels subview , centred superview seen in image i have added constraints 3 labels respect holderview , added constraints holderview respect superview nsdictionary *viewsdictionary = nsdictionaryofvariablebindings(titlelabel); nsarray *constraints = [nslayoutconstraint constraintswithvisualformat:@"|-[titlelabel]-|" options:0 metrics:nil views:viewsdictionary]; [holderview addconstraints:constraints]; viewsdictionary = nsdictionaryofvariablebindings(setlabel); constraints = [nslayoutconstraint constraintswithvisualformat:@"|-[setlabel]-|" options: 0 metrics:nil views:viewsdictionary]; [holderview addconstraints:constraints]; viewsdictionary = nsdictionaryofvar...

javascript - series declared dynamically Highcharts -

good evening, made chart visible in http://jsfiddle.net/6u7fw/1/ . turns out, have defined variable "data" array, since not know numbers (in graph three, more). you can declare variable "series" in dynamic way, code possible enter data ("data") , not static? series: [{ name: name, data: data[2] }, { name: name, data: data[1] }, { name: "", data: data[0] }] thank in advance dave let me explain: you can like: series: function() { (i=0; <data.length; i++) { return { name: "", data: data[i]} } }

java - HttpServletRequest stored in model gets replaced -

i'm working on legacy code (spring 2.5.x, java 1.5), controller passes http servlet request view this: public modelandview handlerequest(httpservletrequest request, httpservletresponse response) throws exception { map attributes = new hashmap(); attributes.put("httprequest", request); return new modelandview("/path/to/page.jsp", attributes); } however happens httprequest attribute indeed exist in jsp page context, contains current request (jsp page) , not original (controller). passed request being used extract information url. appears can around problem using bunch of "javax.servlet.forward.*" attributes. puzzles me pretty simple thing , i'd happy work anyways or @ least know why doesn't work now. has ideas? to begin with, bad idea store request attribute of request. if need specific data current request, can retrieve directly using ${requestcontext} , if need access url, use ${requestcontex...

javascript - How to convert HTML to JSON using PHP? -

Image
i can convert json html using jsontohtml library. now,i need convert present html json shown in site. when looked code found following script: <script> $(function(){ //html json $('#btn-render-json').click(function() { //set html output $('#html-output').html( $('#html-input').val() ); //process json , format consumption $('#html-json').html( formatjson(totransform($('#html-output').children())) ); }); }); //convert obj or array transform function totransform(obj) { var json; if( obj.length > 1 ) { json = []; for(var = 0; < obj.length; i++) json[json.length++] = objtotransform(obj[i]); } else json = objtotransform(obj); return(json); } //convert obj transform function objtotransform(obj) { //get dom element var el = $(obj).get(0); //add tag element var json = {'tag':el.nodename.tolowercase()}; ...

java - Map to servlet without servlet-mapping record -

this question has answer here: how invoke servlet without mapping in web.xml? 3 answers i'm developing frontservlet, there no need map other servlet. use getrequestdispatcher specific servlet , need name access it, forward request, without mapping's url-pattern don't know how it. is there ability access servlet without being mapped in web.xml? you should have servlet mapped name in order invoke programmatically, , can done: either old way <servlet-mapping>...</servlet-mapping> tag in deployment descriptor file. with 3.0 servlet spec annotation @webservlet using addservlet method. then able chain request custom servlet.

arrays - et Return the Whole Subdocument Arrary from MongoDB -

i need of subdocuments array courses class user.userid = whatever , courses.status=active public class user public property userid string 'this unique index this, unless think otherwise public property coursedata() list(of courses) ' public property groups list(of string) public property bu list(of string) end class public class courses public property id string 'this can dynamic public property description string public property completiondate string public property hours string public property status string end class using vb.net , tried few ways, want courses returned have status="active" dumped ienumberable i tried (_users collection of user) (_uid variable passed it) return _users.findas(of user)(query.and(query.eq("learninghours.status", "active"), (query.eq("userid", _uid)))) return _users.findas(of user)(query.and(query.eq("learninghours.status", "activ...

javascript - Integrating custom function and rule using JQuery validator plugin -

i have form email field. part of validation exclude domains ( eg gmail,yahoo etc ) i have found following function should search substrings believe choice search email strings in: jquery/javascript check string multiple substrings : function issubstringpresent(str){ for(var = 1; < arguments.length; i++){ if(str.indexof(arguments[i]) > -1){ return true; } } return false; } issubstringpresent('myemail', 'gmail', 'yahoo', ...) i confused on how integrate function jquery validator plugin. please see below: i have following following below form: $(document).ready(function(){ $.validator.addmethod( "wrong_domain", issubstringpresent function should inserted here somehow... }, 'not acceptable email' ); $.validator.classrulesettings.wrong_domain = { wrong_domain: true}; ...

python - How to profile a cdef function? -

i have application uses many nogil cdef function , profile them in order find bottle-necks. i tried passing profile=true directive cython these functions seem imune, such output of cprofile.run() contains timings of functions calling cdef functions, not of cdef functions themselves. is there directive or profiler can used in order profile cdef functions? edit: this link application file referring to... . in order profile must set: #cython: profile=true at header. the profiler needs gil , so, of comments @veedrac, solution to: use cdef functions without nogil directive set #cython: profile=true @ header of .pyx ( or somewhere else ) the drawback here that, removing nogil , 1 can not use prange in order profile parallel execution. question remains... possible profile nogil function?

c# - Java Web Service in .NET Client - Getting Null object -

i calling java web service in .net client default proxy classes created vs 2010. unfortunately, getting object "customerdetails" null. here raw response in fiddler: <soapenv:body wsu:id="body-45465c84-7d51-4b18-aea8-bf945435018" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <se:getaccountbymemberidreturn xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:se="http://service.xxx 33c .yyyyy.eeee.eeee.com" xmlns:beans="http://some.url.another.url.com"> <beans:branch>011</beans:branch> <beans:customerdetails> <beans:item> <beans:accountdetails> <beans:item> <beans:accountnumber>xxxxxx</beans:accountnumber> <beans:firstname>yyyyyyy</beans:firstname> <beans:lastname>zzzzz</beans:lastname> <beans:middleinitial /> <beans:opendate>2014-03-18t05:00:00.000z...

java - Merge multiple list of different Objects with a common field into another list -

i trying merge multiple list of objects common field list. for example: list< obja>, list< objb>, list< objc>, list< objd> obja : string id; string name, string a; string b; objb : string id; string address; string x; objc : string id; string phone; string y; objd : string id; string zipcode; now merge these lists list< objz> in efficient way. objz : string id; string name, string a; string b; string address; string x; string phone; string y; string zipcode; can please me in writing efficient code above? use map instead of list, , make objs implement interface defines getid() use key. each entry in list a-d (and possibly create objz) map , update details. you make quite generic. java pseudocode: interface objcopier { string getid(); void copytoobjz(objz z); } e.g. class obja implements objcopier { ... string getid() { return id; } void copytoobjz(objz z) { z.setname(name); z.seta(a); ... } } and fin...

c# - "Cannot use a leading .. to exit above the top directory." but it's not a directory -

<div id="container" class="<%=getcssclass%>"> this code working , returns error in title, doesn't make sense since thing property can return "index" or "style1", i.e. there no slashes, backslashes, tildes or periods. how possible error if there's nothing can interpreted trying access in directory (not href property)? public string getcssclass { { if (viewstate["getcssclass"] == null) { viewstate["getcssclass"] = "index"; } return (string) viewstate["getcssclass"]; } set { viewstate["getcssclass"] = value; } } but found problem. user control used 1 many "../" in href and, suspect, first place program knows there's problem when hits first encounter server-side property (the problem earlier , had deleted other more difficult properties , left this, innocuous, getcssclass property). if can expl...

ui thread - Android view not shown after addView method -

i have issue viewgroup.addview() method. use code add new view layout: talbelayout parent = (tablelayout)findviewbyid(r.id.this_does_not_matter); parent.removeallviews(); //this view group contains @ start textview tv = new textview(this); tv.settext("some text"); tablelayout.layoutparams lp = new tablelayout.layoutparams(tablelayout.layoutparams.match_parent, tablelayout.layoutparams.wrap_content); tv.setlayoutparams(lp); parent.addview(tv); and after cant see textview. more that, parent.getchildcount() returns correct values (1 if try add 1 child). in onclick() method of parent view try width , height of textview , of equals 0. calling requestlayout(), invalidate() , measure(500, 50) tableview , parent has no effect. try add new view of view.post(runnable), although code executed in ui thread. i confused. don't understand happens. can explain me doing wrong? one interesting moment: setlayoutparams() has no effect. if set params width=500 , height=50, in oncl...

android - Navigation with fragments in navigation drawer -

let me describe situtation : have activity has navigation drawer has items a, b, c, d, s(preferencesfragment). user goes app can choose whatever wants. lets click on b opens new fragmentb has list of items. clicking on item opens new fragmentdetails , puts transaction of fragments stack enable user go fragmentb list. let user still on fragmentdetails, if chooses go fragments nav. drawer stack empty. there way how let stack forget remaining transactions ? dont mean popbackstack, becouse result small amont of time showing fragmentb. how achive kind of navigation ? lupajz, please take time consider on fragments user have access navigation drawer. of time when reach "item details" fragment may wan't offer different kind of navigation. what want achieve can done using line: getsupportfragmentmanager().popbackstackimmediate(null, fragmentmanager.pop_back_stack_inclusive); nevertheless please take @ following blog posts i've written covering issues: ...

java - Automate: export runnable jar, by Launch Configuration, Eclipse -

i develop java code using eclipse. when want runnable jar point , click in gui this: file->export->runnable jar -> launch configuration (select maintest) --libraryhandling (extract required libraries generated jar) i want automatically, how can in bash? depending on in project , dependencies have, pretty complex using command line tools java provides. the java tutorial pretty in explaining usage of related tools ship java create jars , think people suggest using build tool maven or gradle command line builds. if you're using jar tool though, basic example jar tool runnable main class being specified is: jar cmf existing-manifest jar-file input-file(s) where existing-manifest manifest file specifies main class.

python - how to delete subfolder recursevely -

i have following problem: i delete subdirectories , files recursively. have follow: 200 subdirectories. each of them has structure: case a0 a1 a2---------a100 each folder of 100 has 3 sub-folders. 2 of them should kept. other 1 has subdir , multiple files. want keep 1 of files , want keep subfolder i hope picture show want do. have folder let's case. folder has 100 subdirectories. example 0 folder, want keep b , d. in folder c want keep k , file l.gz. process should run 100 folders a0-a100. thank help. apreciate if 1 on that.

Writing functions in MatLab -

i'm been ask jacobian in matlab solve coordinates highest value f(x) , max value same function. the function have work : f(x; y) = (x^3y + 5x^2y^2)/ e^(x^2+3y^4) so have accomplished far: function [j1,j2]=j(x) [3*x(1)^2+20*x(1)*x(2)-36*x(1)^2*x(2)^4-120*x(1)*x(2)^5,10*x(1)^2-48*x(1)^3*x(2)^3-300*x(1)^2*x(2)^4;6*x(1)*x(2)+10*x(2)^2-8*x(1)^3*x(2)-30*x(1)^2*x(2)^2,3*x(1)^2+20*x(1)*x(2)-2*x(1)^4-20*x(1)^3*x(2)] end i believe matrix including 4 derivatives of f(x) . nut don't know how solve 2 questions. the answer given in comments, make sure question not remain unanswerd post here: first wrote jocobian matris function = j(x) j11 = 6*x(1)*x(2)+10*x(2)^2-8*x(1)^3*x(2)-30*x(1)^2*x(2)^2; j12 = 3*x(1)^2+20*x(1)*x(2)-2*x(1)^4-20*x(1)^3*x(2); j21 = 3*x(1)^2+20*x(1)*x(2)-36*x(1)^2*x(2)^4-120*x(1)*x(2)^5; j22 = 10*x(1)^2-48*x(1)^3*x(2)^3-300*x(1)^2*x(2)^4; = [j11, j12;j21, j22]; end then used function estimate criticalpoints function xnp1 = new...

How to set Amazon S3 Bucket default image -

i have bucket on s3 public images in it. if browse folder without specifying file name, serves me image. so using link this, still getting image back. https://s3.amazonaws.com/bucket_name/folder_name/ the image served 1 of mine i've uploaded @ point in past don't recall ever setting folder default. there option somewhere this? thanks. i suspect /bucket_name/folder_name/ object path. in s3, there not true concept of folders. / in object path, can displayed folders, still part of key in end.

ios - Switch between UIScrollView -

i have 1 uiscrollview embedded in uiscrollview. i switch first 1 other 1 when user scroll offset. is there equivalent of [textfield becomefirstresponder] , can use? instead of setting scrollview.scrollenabled = no , setting yes. thanks one strategy detect when want switch scroll views, animate 1 of them offscreen , other 1 on. example, scrollviewa being used , scrollviewb offscreen. when time comes switch scrollviewb onscreen , scrollviewa offscreen, use uianimation combined scrollingenabled . - (void)timetoswitchscrollviews { [uiview animatewithduration:5 animations: ^{ self.scrollviewa.frame = cgrectmake(/* somewhere off screen */); self.scrollviewb.frame = cgrectmake(/* somewhere on screen */); } completion: ^(bool finished) { /* wait untill last minute turn of user interaction */ self.scrollviewa.scrollingenabled = no; } }

inheritance - Parent/Child Constructor in java -

i keep getting error required:boolean; found:no arguments; reason:actual , formal arguments lists differ in length; i know why is, because constructor in superclass , subclass don't match...but dont want make changes them if possible because it'll ruin rest of other classes , if need make changes i'd rather make changes lowrights class. point me in right direction? public class lowrights extends securityrights { private string name; public lowrights(string n){ this.name = n; boolean right = getright(); // added setright(false); // added } public boolean setright(boolean right){ return right; } public string getname(){ return name; } public static void main(string[] a){ lowrights s= new lowrights("lisa"); system.out.print(s.getname() +" "+s.getsecret()); } } this super class: public class securityrights { private boolean right; private boolea...