Posts

Showing posts from May, 2013

emacs - org-mode agenda view by headline -

i have several agenda files, many of have "ideas" top-level subtree. i'd love collapsable, editable view shows each of these subtrees in single buffer (though wouldn't correspond single file). understand can agenda keyword search "*ideas", gives me list of subtrees, while have tab through each 1 different buffer. there way want?

matplotlib, why custom marker style is not allowed in scatter functions -

i have such code import numpy np import matplotlib.pyplot plt import matplotlib.markers mks plt.close('all') n = 50 x = np.random.rand(n) y = np.random.rand(n) colors = np.random.rand(n) area = np.pi * (15 * np.random.rand(n))**2 # 0 15 point radiuses mymkstyle = mks.markerstyle(marker=u'o', fillstyle=u'full') plt.scatter(x, y,color = 'k',s = 100, marker = mymkstyle ) plt.show() i try create custom markerstyle , use scatter functions, script failed in scatter function. any ideas? thanks. i'm using python 2.7.6 , mathplotlib 1.3.1 under winxp. although documentation states markerstyle type pass marker= , doesn't seem implemented correctly. bug has been reported on github . plt.plot(x, y, marker='o', markersize=100, fillstyle='bottom') seems pretty you're looking for; of course, doesn't let treat marker styles objects.

Couchbase .NET client server list round robin lookup -

i have couchbase cluster of 4 nodes running in production. using .net client connect cluster. problem servers list have provide. docs while initializing cluster object goes through these list of servers , whoever returns first cluster meta data used initialize it. my site has lot of traffic , observer since server1 first server in list , app tier close 10 servers cpu load on server goes high point goes down. solve have add reverse proxy in between per docs not right way. please me how can randomize server selection behavior or values should use connection persistence etc. have tried lot of things nothing works.

javascript - Loop the array and fill value in dynamic textbox in jquery -

here splitvalues contains array , .split class in multiline texbox generated dynamically want fill textbox array. have done not getting further? function insertitems(splitvalues) { $(".split").each(function () { if (splitvalues != "") { $(this).val(splitvalues);// } }); } change this: $(this).val(splitvalues);// to this: $(this).val(splitvalues.join());// updates: $(".split").each(function (i, elem) { $(this).val(splitvalues[i]);// }); updated demo suggested milind .

javascript - ng-repeat detect first occurrence of a condition -

for codes below, want detect first occurrence of condition (msg.from_id==myid && msg.seen==1) , ignore rest items condition satisfies. i tried ($first && msg.from_id==myid && msg.seen==1) condition may not applicable in first index. <table class="table table-striped table-hover"> <tr ng-repeat="msg in messages" > <td ng-class="{'orange': msg.from_id!=myid}" > <span class="seen" ng-show="msg.from_id==myid && msg.seen==1"> <i class="icon icon-ok border0 font12 green"></i> seen </span> <b>{{msg.username}}</span> :</b> <span ng-bind-html-unsafe="msg.message"></span> </td> </tr> </table> actually want achieve here show "seen" span first occurring seen message (just in viber).

Access kafka broker in a remote machine ERROR -

i run zookeeper , kafka server in 172.19.91.125. run things in machine well. but when try access kafka service in 172.19.101.61 consumer: bin/kafka-console-consumer.sh --zookeeper 172.19.91.125:2181 --from-beginning --topic my-topic i following error messages: [2014-12-16 01:52:42,531] error producer connection linux:9100 unsuccessful (kafka.producer.syncproducer) java.nio.channels.unresolvedaddressexception @ sun.nio.ch.net.checkaddress(net.java:48) @ sun.nio.ch.socketchannelimpl.connect(socketchannelimpl.java:505) @ kafka.network.blockingchannel.connect(blockingchannel.scala:57) @ kafka.producer.syncproducer.connect(syncproducer.scala:141) @ kafka.producer.syncproducer.getormakeconnection(syncproducer.scala:156) @ kafka.producer.syncproducer.kafka$producer$syncproducer$$dosend(syncproducer.scala:68) @ kafka.producer.syncproducer.send(syncproducer.scala:112) @ kafka.client.clientutils$.fetchtopicmetadata(clientutils.scala:53) @ kafka.clien

Android show soft keyboard when fragment onResume -

i trying show keyboard when screen edittext in foreground.. found 2 solutions, surprisingly, both work on cases , not other.. i have 2 fragments, first fragment shows keyboard when call showsoftkeyboard1 , second fragment works if call showsoftkeyboard2. both called inside onresume(); public static void showsoftkeyboard1(context activity, view view) { if (view == null) return; view.requestfocus(); inputmethodmanager imm = (inputmethodmanager) activity.getsystemservice(context.input_method_service); imm.showsoftinput(view, inputmethodmanager.show_forced); } public static void showsoftkeyboard2(activity activity, view view) { if (view == null) return; if (view.requestfocus()) { activity.getwindow().setsoftinputmode( windowmanager.layoutparams.soft_input_state_always_visible); } } i wonder difference between these 2 methods?!

TypeError: 'int' object has no attribute '__getitem__' - Error recieved in IRC weather bot in Python -

okay, i've got bit of python irc bot code, , added weather command it, doesn't seem work... heres code # import necessary libraries. import socket import time import httplib def commands(nick,channel,message): if message.find('!test')!=-1: ircsock.send('privmsg %s :%s: test complete\r\n' % (channel,nick)) elif message.find('!help')!=-1: ircsock.send('privmsg %s :%s: other command test.\r\n' % (channel,nick)) elif message.find('!sex')!=-1: ircsock.send('privmsg %s :%s: why?\r\n' % (channel,nick)) elif message.find('!quit')!=-1: ircsock.send('quit :for bones of weak shall support me\r\n') die('quit command given') elif message.find('!op')!=-1: ircsock.send('mode %s +o :%s\n' % (channel,nick)) elif message.find('!deop')!=-1: ircsock.send('mode %s -o :%s\n' % (channel,nick)) elif message.fin

flash - There isn’t a software package called “adobe-flashplugin” in your current software sources -

i trying install adobe-flashplugin on ubuntu 14.04. on adobe's site choose "apt ubuntu 10.04+" option. it opens ubuntu software center, tells me "there isn’t software package called “adobe-flashplugin” in current software sources." firefox or google chromium? google chrome or chromium can this: open terminal input "apt-get install pepperflashplugin-nonfree" input "update-pepperflashplugin-nonfree --install"

python - Is there a way to vectorize this loop -

is there way vectorize code eliminate loop: import numpy np z = np.concatenate((x, labels[:,none]), axis=1) centroids = np.empty([len(unique(labels))-1,2]) in unique(labels[labels>-1]): centroids[i,:]=z[z[:,-1]==i][:,:-1].mean(0) centroids this code produces pseudo centroids dbscan scikit-learn example , in case want play find vectorized form, i.e. x , labels defined in example. thanks help! you can use bincount() 3 times: count = np.bincount(labels) x = np.bincount(labels, x[:, 0]) y = np.bincount(labels, x[:, 1]) centroids = np.c_[x, y] / count[:, none] print centroids but if can use pandas, simple: z = np.concatenate((x, labels[:,none]), axis=1) df = pd.dataframe(z, columns=("x", "y", "label")) df[df['label']>-1].groupby("label").mean()

ios - Can barely hear HTML5 audio through earphones -

i'm using html5 audio implementation in phonegap code. implementation looks below: myaudio = new audio(path.mp3); myaudio.play(); the problem media audible when i'm listening through devices speakers. once plug-in earphones, can barely hear sound coming out. i tried using volume attribute raise volume max. myaudio.volume = 1.0; but didn't make difference. then checked current volume adding line: alert(myaudio.volume); that returned 1 , meaning it's @ max. ideas?

jquery - Semantic Ui Menu not working -

Image
i trying work semantic ui menu. but cannot work, ie when click items in menu, active state isn't changing. didn't find examples in web either. html : <div class="ui grid"> <div class="one wide row"> <div class="ui green menu"> <a class="active item"> <i class="home icon"></i> home </a> <a class="item"> <i class="mail icon"></i> messages </a> <div class="right menu"> <div class="item"> <div class="ui transparent icon input"> <input type="text" placeholder="search..."> <i class="search link icon"></i>

java - How to select distinct value from array items in jsp -

currently, want display value list items want remove duplicate value , showing unique value user. i tried implement below code doesn't work . <tr> <td class="col-ss1 col1">currency</td> <c:foreach items="${listproducts}" var="item" varstatus="loop"> <td class="col-ss1 "><c:foreach items="${item.terms}" var="term" varstatus="mainloop"> <c:if test="${(mainloop.index - 1) > 0}"> <c:foreach var="previousterm" items="${item.terms}" begin="0" end="${mainloop.index-1}" varstatus="inner"> <c:if test="${term.currencytype == previousterm.currencytype }"> <c:set var="flag" value="true"/> </c:if> </c:foreach> </c:if> <c:if test="${not flag}">${term.currencytype }</c:if&

mapreduce - Hadoop error -"connection refused"? -

i got following error in hadoop cluster . ran job ,and long , couldn't finish . whenever try access hdfs ,i get: "call li417-43.members.linode.com/174.79.191.40 li417-43.members.linode.com:8020 failed on connection exception: java.net.connectexception: connection refused; more details see: http://wiki.apache.org/hadoop/connectionrefused " any way solve this! thanks from comments: no java processes running , neither namenode nor jobtracker running. particular error 8020 refers namenode: hdfs not up. depending on version of hadoop may able start-dfs.sh start-mapred.sh or start-all.sh after need examine hdfs logs see issues. may post log entries here further assistance.

c# - How to upload image in database using jqgrid with asp.net -

i using jqgrid asp.net 4.0 web form application , want upload image sqlserver database. please suggest right way example. in advance. colmodel: [ { name: 'imagetoupload', index: 'imageid', align: 'left', editable: true, edittype: 'file', editoptions: { enctype: "multipart/form-data" }, search: false }, } ], beforesubmit: function (postdata, formid) { var complete = false; var message = ""; var namefile = ""; alert("hi"); $.ajaxfileupload({ url: '<%=page.resolveurl("~/master/policymaster.ashx") %>', secureuri

php - Slim Framework - get all headers -

i discovered slim yesterday , it. have run minor issues. here one: i send out headers jquery ui app slim rest api. not problem @ jquery end- $.ajax provides capability. however, thought write small slim app test out slim's own ability give me access request headers. here app function indexfunction() { global $app; $headers = $app->request->headers; echo json_encode($headers); } header('content-type:text/plain'); $app = new \slim\slim(); $app->get("/",'indexfunction'); $app->run(); i opened dhc in chrome , fired off request http://ipaddr/slimrestapi after adding header xhash = abc123 for measure started fiddler , watched traffic sent out request. fiddler faithfully reported following headers host: ipaddr connection: keep-alive xhash: abc123 user-agent: mozilla/5.0 (windows nt 6.1) applewebkit/537.36 (khtml, gecko) chrome/39.0.2171.95 safari/537.36 accept: */* accept-encoding: gzip, deflate, sdch accept-language: en-

json - Geografical center of region in Google Map API -

i'm trying geografical center of region called "středočeský kraj" in json format http://maps.googleapis.com/maps/api/geocode/json?address=st%c5%99edo%c4%8desk%c3%bd%20kraj&sensor=false gives me incorrect result. gives me "lat" : 49.8782223, "lng" : 14.9362955, correct https://www.google.cz/maps/place/st%c5%99edo%c4%8desk%c3%bd+kraj/@50.060218,14.4659312,9z/data=!3m1!4b1!4m2!3m1!1s0x470b939c0e8ff2a3:0x100af0f6614a830 (50.060218,14.4659312) how possible, json return incorrect data? thanks. the data returned api isn't incorrect, it's not documented returned location area center of area. take @ http://gmaps-samples-v3.googlecode.com/svn/trunk/geocoder/v3-geocoder-tool.html#q%3dst%u0159edo%u010desk%fd%20kraj . you'll see there blue rectangle marks bounds of area. to center of bounds instead of marker-location calculate based on bounds: new google.maps.latlngbounds(new google.maps.latlng(49.501336,13.397336),

c - ASCII to decimal value -

consider below example: char = '4'; int c = (int)a; // gives hex value of '4' 0x34 but want result 4 integer. how this? hex2dec conversion? int = - '0'; printf("%d",i); the char values digits 0 9 contiguous , make use of here shown above.

C# Checking Same DOB & Different Name -

i checking on code regarding duplicate dob , different name. somehow stuck in here not sure start condition checking whereby if duplicate dob , different name logged file. public static bool validatedob(string dob, string effdate, string policyno, string name) { bool var_return = true; string[] dobsplit = dob.split('/'); string var_day = dobsplit[0]; string var_month = dobsplit[1]; string var_year = dobsplit[2]; string[] effdatesplit = effdate.split('-'); //string var_name = name.tostring(); //streamwriter sb; if (convert.toint32(var_day) <= datetime.daysinmonth(convert.toint32(var_year), convert.toint32(var_month))) { datetime var_dob = convert.todatetime(var_year + "-" + var_month + "-" + var_day); datetime var_effdateastodaydate = convert.todatetime(effdatesplit[2] + "-&

objective c - How to call group using PJSIP -

how can make call between three, 4 , more accounts using pjsip api in ios? make call between 2 account, use pjsua_call_make_call function. char *desturi = "sip:account@example.com"; pj_status_t status; pj_str_t uri = pj_str(desturi); status = pjsua_call_make_call(_acc_id, &uri, 0, null, null, null); if (status != pj_success) error_exit("error making call", status); i have no experience run pjsip on ios yet (may there restrictions on call count in ios version of pjsip?). based on experience of using pjsip on desktop, should call parties different calls pjsua_call_make_call (execute pjsua_call_make_call 4 times 4 accounts in group example). after calls estabilished, should connect them in pjsip's conference bridge all-with-all pjsua_conf_connect function.

arrays - Apply function to table conditioned on several variables in Matlab -

i have following 2 tables, data , members : data = table(sort(repmat(datenum(2001,1:5,1).',4,1)),repmat(('a':'d').',5,1),repmat((201:204).',5,1),'variablenames',{'date','id','price'}); data = date id price __________ __ _____ 7.3085e+05 201 7.3085e+05 b 202 7.3085e+05 c 203 7.3085e+05 d 204 7.3088e+05 201 7.3088e+05 b 202 7.3088e+05 c 203 7.3088e+05 d 204 7.3091e+05 201 7.3091e+05 b 202 7.3091e+05 c 203 7.3091e+05 d 204 7.3094e+05 201 7.3094e+05 b 202 7.3094e+05 c 203 7.3094e+05 d 204 7.3097e+05 201 7.3097e+05 b 202 7.3097e+05 c 203 7.3097e+05 d 204 members = table(datenum(2001,1:5,1).',{cell2table({'b','c'});table({

apache - Fail to secure the SSL in tomcat -

our architecture is: external users<---https--->web server(apache http server)<----->webapp server (tomcat) we fail pass ibm appscan, used detect security defects in webapp server, because finds our tomcat server.xml file not added secure="yes" attribute in our port. however secure="yes" attribute should not added tomcat server.xml file because not need secure connection between web server , webapp server. how can fix issue? there secure="yes" attribute can added configuration file of web server(apache http server)? thanks & regards, gordon if users accessing tomcat (indirectly) through apache httpd using tls (https:// url) entirely appropriate set secure="true" in <connector> . tells web application request being received secure when not (e.g. using plain-http between httpd , tomcat). so, if have set scheme="https" on <connector> want set secure="true" . this not con

java - How can I format this string that represents decimal number in my JSP page? -

i have following problem. working on jsp page use jquery. in page show money amounts table, this: <td width = "8.33%"> <%=saldettaglio.gettotimponibile().tostring() != null ? saldettaglio.gettotimponibile().tostring() : "" %> </td> the obtained object (from gettotimponibile() method) bigdecimal in td of table shown value as: 447.93 . now have format amount in following way: use , character instead . (for decimal digits). show 2 decimal digits after . example can have 1 decimal digit 10,4 , have show 10,40 or can have more 2 decimal digits , in case have show firs 2 decimal digits (for example 10,432 have show 10,43) so can achieve these 2 tasks? showing string represent decimal number. have cast value double or this? first create class (i.e. numberformat.java) , please put following methods in numberformat.java class: public static string pricewithdecimal (double price) { decimalformat formatter = new deci

android 5.0 lollipop - Bluetooth LE: undocumented error code 19 -

my android app uses ble apis, , 1 of these apis, bluetoothgattcallback.onconnectionstatechange() , receives undocumented error code 19. i'm using nexus 9. did ever see error code before? mentioned above, undocumented in android api reference, , don't know it. p.s. i searched issue tickets @ android issue tracker also, , found developers encounter undocumented, ble-related error codes often. hmm, grim.

python - Django/Apache/Mod_WSGI - HTTP 404 Error with Static Files -

i'm trying use django + apache + wsgi on windows. i've been using bitnami stack takes care of installation of apache. able put django project on django, however, loads webpage without static files (css, js). i've opened apache logs , static files shown 404. this httpd-app.conf: <directory "e:/bitnami/djangostack-1.6.7-1/apps/django/django_projects/dashboard_web/dashboard_web"> options +multiviews allowoverride <ifversion < 2.3 > order allow,deny allow </ifversion> <ifversion >= 2.3> require granted options </ifversion> options +execcgi wsgiapplicationgroup %{global} <ifversion < 2.3 > order allow,deny allow </ifversion> <ifversion >= 2.3> require granted options </ifversion> options allowoverride options indexes followsymlinks options +execcgi </direc

xslt - Follow-up: create (grand)parent-child elements based on delimiter in attribute-values -

hereby followup question posted here last year . still being newbie i'm struggling (again...) transform - using xslt 1.0 - following xml describes objects (note slight change in input - 'b.c.*' - previous question): <data> <object> <property name="id" value="001"/> <property name="p.id" value="id p"/> <property name="p.description" value="descr p"/> <property name="a.id" value="id a" /> <property name="a.description" value="descr a"/> <property name="b.id" value="id b"/> <property name="b.description" value="descr b"/> <property name="b.c.id" value="b.c.id"/> <property name="b.c.description" value="b.c.description"/> </object> </data>

bash - Rename folder with name consisting of multiple words -

for begining have such script: #!/bin/bash in *; if [ -d "$i" ]; if [ "$i" == $(grep $i names.txt | cut -d ' ' -f 1) ]; mv $i $(grep $i names.txt | cut -d ' ' -f 2) else echo "the word $i wasn't found in dictionary" fi fi done which renames files dictionary (names.txt) line of pattern "english_word german_one". one eins 2 zwei mein dein the problem is: works files names one-wordish. "one" becomes "eins", "two" becomes "zwei", "one two" doesn't become "eins zwei". how rename files names consisting more 1 word, e.g "my documents", "first folder", etc? know must somehow tokenize folder name, don't how. new bash. in advance. here's pure bash solution rather general: we'll tokenize folder name , perform translation on each word found in name. before that, we'll load dictionary hash ar

caching - Clearing expired cache entries from disk cache on Ruby on Rails 4 -

i have rails app uses disk cache default russian-doll caching. have no trouble invalidating cache , cache strategy working requirements, have find proper way delete expired entries disk. documented disk cache keeps on growing until either cleared or disk full. i'm aware can rake tmp:cache:clear deletes entire cache, not stale items! i'm looking better way preserve fresh entries , delete disk stale cached entries. i'm using shell script delete entries have not been accessed in last day not guarantee i'm deleting stale entries , preserving fresh entries. i aware can switch memcached or redis, prefer not to, disk cache doing fine job without overhead of resources , supporting yet server (server in terms of server process, not actual hardware/virtual-machine). how clear stale cache entries when using disk cache? there better way using files' atime/mtime? according documentation, might use #cleanup http://api.rubyonrails.org/classes/activesupport/cach

Android get parent id in multi context menu -

in code have listener have multi context menu : button btn1= (button) findviewbyid(r.id.btn1); registerforcontextmenu(btn1); button edit_text1= (button) findviewbyid(r.id.edit_text1); registerforcontextmenu( edit_text1 ); now in oncontextitemselected want witch widgets must text change. example: @override public boolean oncontextitemselected(menuitem item) { adapterview.adaptercontextmenuinfo info = (adapterview.adaptercontextmenuinfo) item.getmenuinfo(); long buttonid = info.id; switch ( item.getitemid () ){ case 1: /* if user request context menu on btn1 */ btn1.settext( "ok" ); /* if user request context menu on edit_text1 */ edit_text1.settext( "" ); } return super.oncontextitemselected(item); } unfortunately java.lang.nullpointerexception error info.id update post public void oncreatecontextmenu(contextmenu menu, view v,contextmenu.contextmenu

wordpress - 1 link in two paragraphs in html -

i'd have link on text text in 2 paragraphs (using html editor) resulting in having 2 href's link i've given. here's regular code: <p><a href="google.com">google</a></p> <p><a href="google.com">dotcom</a></p> and result of code how don't want be: google dotcom i want single highlight when mousing over/clicking, tried manually changing code erasing < /a > or since im newbie when comes html nothing came out... sorry bad english, , in advance replies.[also why html editors online buggy? 1 in wordpress.. trying table how want annoying.] have tried putting tag around p tags? <a href="#"> <p> google </p> <p> dotcom </p> </a> in terms of usage, html 5 states element "may wrapped around entire paragraphs, lists, tables, , forth, entire sections, long there no interactive content within (e.

regex - How to grep exact matching special characters from file? -

i have file below: a 4 ab,cc,ab,bc b 6 x,xx,y,%,%%,\,\\ ab 0 i need grep special characters third column file , return corresponding first column. e.g., need grep '%' , return me b (it's corresponding first column) i have tried using: grep -w "%" file1 but return me % , %% both. like: b 6 x,xx,y,%,%%,\,\\ where %,%% highlighted. want grep exact word/character searched. in above case should try find '%' , not '%%'. approach works fine words grep manual grep -w works when finds lines containing matches form whole words. i tried using with grep -wp "%" file1 for perl pattern. did not return anything. can suggest how can grep exact matching special characters? not solve problem special characters '\'. backslash can escaped , handled. other special characters need find solution. ok. slight change required here in question. answers given here great , work according question. maybe missed req

c# - Multi producer, multi consumer in Rabbit MQ with single queue -

Image
i'm new rabbitmq , need write program has multi producer , multi consumer single queue. possible i've shown in image? found lots of examples single producer. producer send messages consumer. in short, answer absolutely can have many producers publish single queue. recommend create exchange , have producers send things exchange forwards queue. in simple diagram exchange not strictly necessary makes solution more extensible in future.

java - Hibernate set up -

i writing first hibernate program, unable connect database details:db: oracle 11g version 2 hibernate: 4.3.7. could please verify config file: hibernate.cfg.xml : <?xml version="1.0" encoding="utf-8"?> <hibernate-configuration xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.hibernate.org/xsd/ hibernate-configuration hibernate-configuration- 4.0.xsd" xmlns="http://www.hibernate.org/xsd/hibernate-configuration"> <session-factory> <!-- database connection settings --> <property name="connection.driver_class">oracle.jdbc.oracledriver</property> <property name="connection.url">jdbc:oracle:thin:@localhost:1521:orcl</property> <property name="connection.username">sys</property> <property name="connection.password"&

javascript - Transform Blob from XmlHttpRequest without loading it completely into memory -

i want implement client-side file decryption in browser. takes decrypted files server , should decrypt in browser, presenting save as dialog save decrypted file. should work large files (1 gb or more). i have following strategy in mind: download file using xmlhttprequest responsetype = 'blob' . decrypt transforming blob given xmlhttprequest . provide decrypted blob objecturl user. the decryption work stream transformation, reads chunks downloaded blob, decrypts data , writes output blob. however far can tell work current browsers if can load whole file memory (you need store complete decrypted blob in memory before can create objecturl ). seems no kind of chunked reading/writing supported current blob , xmlhttprequest , createobjecturl interface described on mozilla developer network . blob immutable , there doesn't seem streaming support binary data in browsers. is there way implement current browsers? after getting blob responsetype = '

php - htaccess / custom 404 page - everything seem to be fine, but it does not work (frustrated) -

<files ~ "^\.(htaccess|htpasswd)$"> deny </files> options indexes errordocument 404 new404.html order deny,allow file without name extension .thaccess it in main domain folder index page , others. new 404 page called new404.html , in same folder htaccess file. i checked code few guides on htaccess topic, , seem fine. i appreciate suggestions. you can't write in 1 line must options -indexes errordocument 404 new404.html <files ~ "^\.(htaccess|htpasswd)$"> deny </files>

php - Symfony Finder: Finding all directories except ones that start with an underscore -

i want find directories (at root level, not recursive) not start underscore. getcwd() = /users/example/project directory example: /users/example/project/_pictures /users/example/project/_graphics /users/example/project/test i've tried following code snippet: $directories = $this->container->get('finder') ->directories() ->in(getcwd()) ->notname('_*') ->depth(0); but seems return: /users/example/project/_pictures/home /users/example/project/test so returns "test", correct, returns sub-folder inside 1 starts underscore, incorrect. ideas what's gone wrong here? this works: $directories = glob(getcwd() . '/[!^_]*', glob_onlydir); but hoped solution using symfony finder.

php - array permutation with respect to some templates -

i have template :on basis of templates want permutation of array part of template , insert db every 1 element of permutation data acutually value of template dynamically change , number of elements varied means dynamic $temp = ['server', 'test[server]', 'extra']; $temp1 = ['server', 'test[server]']; $temp2 = ['server']; test[server] -: test depends on server; data belongs template: $server = ['server1','server2','server3']; $test = ['server1'=>['test1', 'test2'], 'server2' => ['test4', 'test5'], 'server3' => ['test7']]; $extra = ['a','b','c']; i want permutaion : for template $temp ['server'=>'server1', 'test' => 'test1','extra'=>'a'] ['server'=>'server1', 'test' => '

c++ - Qt Creator cannot resolve STL containers -

Image
i've downloaded qt 5.4 windows, running in windows 8.1 pro. comes mingw , qt creator 3.3. i've been using qt few years. still necessary component seems missing in qt creator ide. suppose class card defined function getsymbol() : class card { public: string getsymbol() const; } somewhere in code i've std::vector of card s: vector<card> playable; and somewhere else in code: playable[0].getsymbol(); ^----------------- note dot when type period in line above, qt creator should list available functions , variables of card class used, intellisense works in vs. doesn't happen. however, when create object of type card , dot triggers qt creator show available functions: why feature doesn't work when card objects put in stl containers? there settings needs enabled? this has been long standing issue discussed asked , asked on again on forums , mailing lists. thuga correctly showed in comment, corresponding bugreport monit

javascript - what's the different between app.post and app.use in nodes express? -

i use command curl -h "content-type: application/json" -d '{"name":"sparc_core","port":["p1", "p2"]}' http://127.0.0.1:3000/add_module test nodejs server. at first, code follows: app.post('/add_module', bodyparser.json()); app.post('/add_module', bodyparser.urlencoded()); app.post('/add_module', function(req, res, next) { req.body = json.parse(req.body.data); next(); }); app.post('/add_module', function(req, res) { console.log("start submitting"); console.log(req.body); ... ... after run curl command, nodes server output error information below: syntaxerror: unexpected token u @ object.parse (native) @ object.app.post.res.send.error [as handle] (/home/xtec/documents/xtec- simict/sim/app.js:80:21) @ next_layer (/home/xtec/documents/xtec- simict/sim/node_modules/express/lib/router/route.js:103:13) @ route.dispa

c# - .net local assembly load failed with CAS policy -

Image
we getting following assembly load error. assembly loaded local path "c:\program files\asworx products\asworx\bin\". problem not there old version of binary. issue appears when have sent new binary through e-mail. build settings not changed. how can correct issue? issue appears in win7 32 bit machine file name: 'file:///c:\program files\asworx products\asworx\bin\asconnexdi.dll' ---> system.notsupportedexception: attempt made load assembly network location have caused assembly sandboxed in previous versions of .net framework. release of .net framework not enable cas policy default, load may dangerous. if load not intended sandbox assembly, please enable loadfromremotesources switch. see http://go.microsoft.com/fwlink/?linkid=155569 more information. @ system.reflection.runtimeassembly._nload(assemblyname filename, string codebase, evidence assemblysecurity, runtimeassembly locationhint, stackcrawlmark& stackmark, boolean throwonfilenotfound, boolean f

.htaccess - htaccess redirect from one url to another url -

i bit stuck 1 redirecting 1 url url. i want redirect http://samedomain.com/?abc to http://samedomain.com/news/title any highly appreciated. in advance. this rewrite rule redirect http://samedomain.com/?abc http://samedomain.com/news/title : rewriteengine on rewritecond %{query_string} ^abc$ rewriterule ^ /news/title/? [l,r=301]

ios - How to call method of my ViewController from separate non UIViewController Class -

what im trying networkcall(asyncronous call) in seprate class file. when network call completed should throw function callback in actuall viewcontroller , update ui-views i have facilitiesnewvc.swift class this class facilitiesnewvc: uiviewcontroller, roomsdataprotocol { var data = nsmutabledata() var roomsdata = roomsdata() override func viewdidload() { super.viewdidload() // additional setup after loading view. //image background roomsdata.startconnection(); } // overriden method (not called) func didfinishloadingurl(jsonresult:nsdictionary) -> void{ //this method not getting called println("in view controller") } } note: roomsdata.startconnection(); here roomsdata.swift class roomsdata: nsobject, nsurlconnectiondelegate { var data = nsmutabledata() var callback:roomsdataprotocol? func startconnection(){ let urlpath: string = "http://blue.genetechz.com

computer vision - BlueStacks image output for apps -

i'm working on own project computer vision can @ images coming mobile game, , autonomously play game based upon features detect in computer images. first computer vision project. i plan on using bluestacks run app, , output images. once have images, need real-time analysis, , control mouse actions based upon results of cv analysis. my question how can access images apps bluestacks? best way this?

Not able to push my local app to bluemix -

i had app running on bluemix account. wanted copy app , run in bluemix account. downloaded code github repo., when trying push app account seeing following error. note : used cf push push downloaded app. ? log : 2014-12-16t14:49:15.41+0530 [api] out updated app guid e2fca26a-c62d-47 5d-8c21-8e959ae6632c ({"state"=>"stopped"}) 2014-12-16t14:49:42.10+0530 [dea] out got staging request app id e2 fca26a-c62d-475d-8c21-8e959ae6632c 2014-12-16t14:49:45.08+0530 [api] out updated app guid e2fca26a-c62d-47 5d-8c21-8e959ae6632c ({"state"=>"started"}) 2014-12-16t14:49:45.65+0530 [stg] out -----> downloaded app package (4.6m) 2014-12-16t14:49:46.15+0530 [stg] out -----> downloaded app buildpack cache(4.4m) 2014-12-16t14:49:48.62+0530 [stg] out staging failed: application not detected available buildpack 2014-12-16t14:49:49.37+0530 [api] err encountered error: app not succ essfully detected available build

quantmod - Bollinger Strategy in R with Entry and Exit Signals at Re-allocation Dates -

i have following simple trading strategy: entry signal: when price of ibm above upper bollinger band. close signal: when price of ibm below lower bollinger band. here bollinger bands: require(quantmod) # load ibm data tickers = c("ibm") myenv = new.env() getsymbols(tickers, from="2012-01-03", to="2014-12-01", env=myenv) close.prices = do.call(merge, eapply(myenv, cl)) close.prices = close.prices[,pmatch(tickers,colnames(close.prices))] colnames(close.prices) = c("ibm") # extract upper , lower bollinger band ttr's bbands function bb.up = bbands(close.prices, n=20, matype = sma)[,3] bb.dn = bbands(close.prices, n=20, matype = sma)[,1] the tricky part close position only if price of ibm below lower bollinger band @ re-allocation date. otherwise roll signal of last period next period. accomplish weekly re-allocation: # apply startpoints function pick week's first trading day # re-allocating portfolio startpoints = func

javascript - Send image from filesystem to server in AngularJs -

i need send in background multiple-image , data server. i'm using ionicframework (with angularjs) android app. i'm using angular-file-upload ( directive ) , following code factory: if(angular.isarray(arrpictures) && arrpictures.length > 0) { var files = []; for(var i=0; i<arrpictures.length; i++) { files.push(arrpictures[i].photo); //it file://my_path/myimage.jpg } $upload.upload({ url: api_post_answer, method: 'post', data: { "idsurvey": idsurvey, "idoam": idoam, "idopm": idopm, "score": score, "date": date, "answerjson": answersjson, "address": address, "latitude": latitude, "longitude": longitude }, file: files,

python 2.7 - Cython: ImportError: DLL load failed -

i have compiled cython code , call within python script. worked until recently. it's not working more , gives error importerror: dll load failed: initialization of dll file failed. i'm on win7 64bit, anaconda distribution 2.0.1. recompiling cython code didn't help. import time import implied_vola underlyingprice=5047 strikeprice=4600 interestrate=0.03 daystoexpiration=218 price=724.5 optiontype='call' start=time.time() vola= implied_vola.implied_vola(underlyingprice,strikeprice,interestrate,daystoexpiration,price,optiontype) end=time.time() time=float(end-start) any idea do? how check if compiles using windows sdk compilation , how check cython version in ipython?

scala - Restrict method of a trait with constraint on abstract type member using implicits? -

i in situation below: import scalaz.leibniz._ trait exp[t, c] { def &&(that: exp[t, c])(implicit evt: t === boolean) = logicaland(this, that) def &&(that: exp[t, c])(implicit evt: t === int) = bitwiseand(this, that) } case class logicaland[c](e1: exp[boolean, c], e2: exp[boolean, c]) extends exp[boolean, c] case class logicalor[c](e1: exp[boolean, c], e2: exp[boolean, c]) extends exp[boolean, c] ... case class bitwiseand[c](e1: exp[int, c], e2: exp[int, c]) extends exp[int, c] case class bitwiseor[c](e1: exp[int, c], e2: exp[int, c]) extends exp[int, c] ... the trait exp[t,c] base trait , ast dsl, overload built-in scala operators in trait allow infix notation on dsl, constrain of these methods bound on type t @ trait level same operation here '&&' has different semantics depending on type t. it seems leibniz subsitution not/cannot work here (maybe because defined functors f[_] single argument): [error] /home/remi/projects/dsl/src

w3c validation - Microdata in XHTML 1.1: there is no attribute "itemprop" -

i added microdata product pages of site. leads errors. 1 of these errors following: there no attribute "itemprop" the error related source code line: <div itemprop="offers" itemscope="" itemtype="http://schema.org/offer"> my doctype follows: <!doctype html public "-//w3c//dtd xhtml 1.1//en" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd"> how possible make page w3c compliant when keeping same doctype? microdata can used in (x)html5. if want use schema.org vocabulary in xhtml 1.1, use rdfa , require changing doctype to <!doctype html public "-//w3c//dtd xhtml+rdfa 1.1//en" "http://www.w3.org/markup/dtd/xhtml-rdfa-2.dtd"> (see answer differences between microdata , rdfa .)

What does "i" mean in a CSS attribute selector? -

Image
i have found following css selector in google chrome user agent stylesheet: [type="checkbox" i] what i mean? as mentioned in comments, case-insensitive attribute matching. this new feature in css selectors level 4. presently available in chrome 49+, firefox 47+, safari 9+, , opera 37+*. prior available in chrome user-agent styles starting around chrome 39, enabled web content setting experimental features flag. * earlier versions of opera may support it. working example / browser test: [data-test] { width: 100px; height: 100px; margin: 4px; } [data-test="a"] { background: red; } [data-test="a" i] { background: green; } green if supported, red if not: <div data-test="a"></div> the above square green if browser supports feature, red if not.

sybase ase - sql compute difference between 2 rows -

i'm looking methodology compare difference between 2 rows in same table. found here ( how difference between 2 rows column field? ) it's wanted. have done following code: create table #tmptest ( id_fund int null, id_sharetype int null, valuedate datetime null, varnav float null, fundperf float null, ) insert #tmptest(id_fund, id_sharetype, valuedate, varnav) values(1,1,'20140101',100) insert #tmptest(id_fund, id_sharetype, valuedate, varnav) values(1,1,'20140102',20) update #tmptest set hrc.fundperf = (isnull(hrn.varnav, 0) - hrc.varnav)/hrc.varnav #tmptest hrc left join #tmptest hrn on hrn.valuedate = (select min(valuedate) #tmptest valuedate > hrc.valuedate) , hrc.id_fund = hrn.id_fund , hrc.id_sharetype = hrn.id_sharetype my issue result i'm computing starts on line 1 instead of line 2. hereunder result i'm obtaining: id_fund id_sharetype valuedate varnav fundperf