Posts

Showing posts from January, 2012

shell - Command Line Git Problems -

this question has answer here: github committed files don't show on 2 answers i'm not understanding git. have repository on github.com checkout cloning. add file called index.html , commit via command line. nothing happens on github.com. cannot see new file updating nor see of new branches create. doing wrong? to commit it's not enough. please run 1 more command: git push origin <your_branch_name> after command new branch created on github commited changes

standalone sdk manager in Android Studio -

tools => android => sdk manager open sdk manager, , check "show package details" see the list of installed , not installed components. i try find "sample" folder under individual android version, unable find "sample" component. upset because want install gesture builder inside "sample" folder. by accident, click "launch standalone sdk" launch screen looks similar sdk manager on eclipse, , find sample folder. anyone can tell me reason unable find sample folder on opened sdk manager (there 3 tabs: sdk platforms, sdk tools , sdk update sites) thanks you need download samples particular sdk you're targeting. furthermore, samples change sdk sdk. so first find out sdk, did gestures builder sample come from, , download samples sdk. after that, use android studio wizard create project sample. sure target same sdk (you can change target sdk later, once have sample). using android studio best way it. there no ...

android - What could this empty spacing under my listview item be? -

i extended arrayadapter inflate own custom layout (it doesn't else , implementation straightforward). noticed there's hairline of empty space between listview items: https://www.evernote.com/l/am8w6ffsaqhgnjreixsy5fowdbztel7z73e i've tried setting height of listview item opposed using wrap_content , there's no margin anywhere, , i'm setting background color of root view of listview item i'm having hard time trying figure out why empty space being added. @override public view getview(int position, view convertview, viewgroup parent) { viewholder holder; if (convertview == null) { convertview = minflater.inflate(r.layout.event_row, parent, false); holder = new viewholder(); holder.time = (textview) convertview.findviewbyid(r.id.clock_event_time); holder.title = (textview) convertview.findviewbyid(r.id.clock_event_title); convertview.settag(holder); } else { holder = (viewholder) convertview.gettag()...

How to update specific key's value in an associative array in PHP? -

i've following associative array named $data array ( [0] => array ( [transaction_user_id] => 359691e27b23f8ef3f8e1c50315cd506 [transaction_no] => 19500912050218 [transaction_total_amount] => 589.00 [transaction_date] => 1335932419 [transaction_status] => cancelled ) [1] => array ( [transaction_user_id] => 9def02e6337b888d6dbe5617a172c18d [transaction_no] => 36010512050819 [transaction_total_amount] => 79.00 [transaction_date] => 1336476696 [transaction_status] => cancelled ) [2] => array ( [transaction_user_id] => 9def02e6337b888d6dbe5617a172c18d [transaction_no] => 19020512050820 [transaction_total_amount] => 299.00 [transaction_date] => 1336476739 [transaction_status] => cancelled ) ...

javascript - how to draw Canvas using for loop with delay? -

var context = document.getelementbyid("canvas").getcontext("2d"); for(var = 0; i< savedmove.length; i++){ dosettimeout(i); } function dosettimeout(i) { setinterval(function() { animate(savedmove[i][0], savedmove[i][1]); }, 100); } function animate(xpos, ypos) { context.fillstyle = "red"; context.fillrect(xpos, ypos, 5, 5); } i have every x , y position move inside of 2d array (savedmove) , want draw array information delay. canvas not draw this. keep debugging cannot figure out problem. you're setting savedmove.length timers tick parallelly every 100 milliseconds. i'm pretty sure not want, though it's hard guess is. first change setinterval settimeout , make them fire @ different times, 100 ms away each other: function dosettimeout(i) { settimeout(function() { animate(savedmove[i][0], savedmove[i][1]); }, 100 * i); } note not best way it, better original code. then can debug it, 'cause might dra...

for loop - Why is R adding an extra element to my vector? -

i have create loop takes vector z1, squares it, , creates vector z2 vectors (yes know there vectorization homework problem). i've got down except reason adds on trailing element said vector. z1 <- c(1, 8, 19, 17, 65, 103, 48, 17, 23, 34) # sort z1 in descending order z1 <- sort(z1, decreasing = true) # create empty vector z2 z2 <- c() (i in 1:10){ z2[i] <- z1[i]*z1[i] z2 <- c(z2,z2[i]) } print(z2) here's vector prints [1] 10609 4225 2304 1156 529 361 289 289 64 1 1 if notice has 11 elements while original z1 vector has 10. why? first point: can operation without loop using vectorized ^ primitive function. z1 ^ 2 # [1] 10609 4225 2304 1156 529 361 289 289 64 1 but here's what's happening in code. need remove line z2 <- c(z2, z2[i]) because on previous line have completed assignment of z2 vector, leaving final run c(z2[1:10], z2[10]) . if want continue using loop, remove line....

android - Are XML attributes compulsory? -

i wanted know if xml attributes compulsory. let me illustrate example. <myxml> <myelement attr1="value1" attr2="value2" /> <myelement attr1="value3" /> </myxml> will xml parsed of xml parsers? i'm interested in knowing whether xml parsers in-built in ios , android sdks parse xml correctly , whether parsing more difficult guys? please excuse if question partial repetition of earlier question, needed definitive answer this. thanks in advance :) xml attributes not compulsory. use according own convinience , need. yes xml parsed of parsers. if @ xml valid parsed xml parser correctly whether in ios or android.

php - data:image/gif;base64 Images Not Animated -

Image
it seems whenever try link animated gif using data:image/gif isn't animated. here's have linked: <img src='data:image/gif;base64,r0lgodlhyadiamiaap/yaaokcgaaacriao0cjaaaaaaaaaaaach5baeaaaualaaaaadiamgaaap+wlrc/jdksau9oovnu/9gki5kaz5oqq5s675wlm90bd94ru987//aohbilbqpykryyww6n9codeqtwq/yrhbl7xq/4lb4tc6bz+i0es1uu9/wuhxor9vv+lx+z+/7/4cbgooehyahiimki4ynjo+qkzktljwwl5izmpucnz6fokgio6slpqeoqaqrrk2ur7cxsro0tba3ulm6u7y9vr/awcldxmxgx8jjysvmzc7p0nhs09tv1tfy2drb3n3e3+dh4upk5eataukczorry+3s6sjtafub8mp09vjc+vx8wfzdk/dlol2b6yaz3efq18j/dxs9rojoobqdbwgsmhj+enjejsm42vn4espehcde1iozzutjiivubmapwcvfeo3aadjjs+fojo8+rusqu53powcaohkk0kprdeh9km3efcbrp1f7tmwkeylic12zzt26kkzprxxmij1kvpfanmgpvf3ls22iuqditsbl1y6yp4ad28yi1evqvubprvx7jbdjnimzfo2q1wffxt9hnnnmuwzkingrn7immbgxzo8/g058vdqd0opnz5f5elntw00jwl4tgwtte7edwz1smbvwpl2v/k53pljo3batw1keopnt58at19vsrqzw4nrpei8axbj02sujf2cevifa8shp+04/eh319snzv86op/p+ys302wrffzu9x19/8m2bwkvg9wcgvmepbsecnrhn4hjw2wfthavwrucdajqn4rsuenihfgtkuf1kgjiin2xmdsdja...

php - How would I use the header command in the Cloud 9 IDE to redirect someone after their forms are validated? -

i using cloud 9 ide , had created registration page redirect user once submit registration credentials. trying using header method in php. however, don't know if can use or have work around due url provide website. example, url be, " https://example-user.c9users.io/register.php " , header trying use is: header("location: https://vomica-porixify.c9users.io/home.php "); the main problem won't work , can't figure out why. don't know if due links given or if registration page broken. here register.php <?php $pagetitle = "sign up"; $section = "signing"; ?> <?php include 'inc/header.php'; ?> <div class="row"> <div class="col-md-3"></div> <div class="col-md-6"> <div class="panel panel-default"> <div class="panel-body"> <div class=...

haskell - cabal unable to find hakyll ==4.7.* on Travis-CI -

i trying set-up github pages site using hakyll looks cabal unable resolve dependency when run in travis . everything appears working locally, when attempt integrate travis project looks required dependency cannot resolved (it can resolved in dev. environment, however). it looks cabal cannot find hakyll ==4.7.* on travis though dependency defined in cabal file. know obvious mistake might be? maybe need use stack instead of cabal ? i've included partial log travis here ( and full travis log here ): ... resolving dependencies... configuring tylerjfisher-github-io-0.1.0.0... cabal: @ least following dependencies missing: hakyll ==4.7.* travis_time:end:097fdfc3:start=1453342815270747376,finish=1453342815885794604,duration=615047228 [0k [31;1mthe command "cabal configure --disable-library-profiling --disable-tests --disable-library-coverage --disable-benchmarks --disable-split-objs" failed , exited 1 during .[0m ... the followi...

swift - got error whe converting xcode6 to 7 -

the error said "use of self in delegating initializer before self.init called". know how fix issue???? convenience init(tweet: dictionary<string, string>) { let _contents: string = "" //var _date: string = "" //var _reply_cnt: string = "0" let _like_cnt: string = "0" //var _bad_cnt: string = "0" let _imageurl: string? //code below reason why got error self.init(contents:_contents, /*date:_date, reply_cnt:_reply_cnt, */like_cnt:_like_cnt,/* bad_cnt:_bad_cnt, */imageurl:imageurl) going on limb here, variable in function called _imageurl , , parameter passed self.init call imageurl , perhaps variable invoking self.imageurl prior calling self.init error stating.

java - How to retrieve the eclipse launch location? -

i need access eclipse.ini file . since location of eclipse.ini same location of eclipse.exe , there way access location through java code ? you can eclipse install directory location in plugin with: location location = platform.getinstalllocation(); url locationurl = location.geturl(); the eclipse.ini should in directory.

Eclipse 4 RCP How to launch another plug in in a new window -

i have e4 rcp needs screen real estate. have developed second rcp in effect relatively simple single-function plug-in, 1 part. want user able launch second first, terminate it, on demand. as understand it, have 3 options: launch new workbench second, written plug-in. assume uses more resources , has problem need track , distinguish events go both. write second model fragment plug-in extends first. has advantage can keep on adding second plug-in declaration in model editor. however, believe requires attaching existing container in main model. add new container main model , write code flip containers in , out done in model editor currently, , more importantly functions carried out second plug-in quite different of first (main) rcp, fear user find ui change confusing. use emodelservice , write code create new trimmedwindow , child partstack, , part, , handlers. have not yet found enough documentation understand implications, advantages , disadvantages of - aside obvious ones f...

python wrong file format cause unpack error -

when use python code below deal right.txt , wrong.txt , though totally same, wrong.txt cannot run. indent problem? my code here: import re if __name__ == '__main__': open('wrong.txt') fin: text = fin.read() l = [p p in text.split('\nsentence #') if p] p in l: lines, deps = tuple(p.split('\n\n')[:2]) right.txt: sentence #1 (33 tokens): introduction. [text=. characteroffsetbegin=208 characteroffsetend=209 partofspeech=. lemma=.] (root (. .))) root(root-0, stored-18) wrong.txt: sentence #1 (33 tokens): introduction. [text=. characteroffsetbegin=208 characteroffsetend=209 partofspeech=. lemma=.] (root (. .))) root(root-0, stored-18) i had compare of 2 txt files, , found (4111)differeces line endings (new line). right.txt uses (0x0a, '\n'); wrong.txt uses (0x0d0a, '\r\n'). with above in mind, code this: import re if __name__ == '__main__': open('wrong.txt...

How to dynamically configure Httpsecurity in the Resource server using Spring security OAuth2 in Java? -

i new spring oauth 2. know how configure httpsecurity in resource server dynamically using spring oauth 2.0. since have list of antmatchers , scopes stored in database (may in future antmatchers , scopes can added). for single antmatchers , scope have tried below , worked expected: @override public void configure(httpsecurity http) throws exception { http.authorizerequests() .antmatchers("/adminservice/") .access("#oauth2.hasscope('products')"); } how should configure if there list of antmatchers , scopes stored in database such as: **antmatchers** **scopes** /adminservice/ products /xxxx/ yyyy /yyyy/ xxxx /jkjlk/ uyuuy /klklk/ hjkskjk here while spring booting want configure antmatchers respective scope database dynamically in resource server. how can achieve this? depending on database access mechanism autowire jdbctemplate, entityservice , do...

How do I do basic Auth in Zend Framework 2 http requests? -

good morning all, i'm trying call api requires basic authentication. i'm trying use zend framework 2 zend\http\request, , i'm not sure best way of doing basic auth or should manually set header? i'm trying force myself use zf2 , stop using zf1 please bear me, old habits die hard. zf2 $http= new zend\http\request(); $http->seturi('https://api.my.tv/analytics/views/daily/'); $http->.... in zf1 used following nice , convenient. $http = new \zend_http_client(); $http->seturi('https://api.my.tv/analytics/views/daily/'); $http->setauth($my_api_key, 'x', \zend_http_client::auth_basic); $request = $http->request(\zend_http_client::post); is there similar method available in zf2 or should write own. honest don't know if i'm better off using guzzle . jujhar the approach same zend\http\client : $client = new \zend\http\client(); $client->setauth($user, $password, \zend\http\client::auth_basic); $cl...

android - How to receive multiuserchat message in smack 4.1.5 -

is there method chatmanagerlistener receiving entire multiuser chats ? i found muc.addmessagelistener , packetfilter both dependent on group name. i need listen group messages based on connection object. i viewed how listen multiuserchat in smack? not appropriate current requirement.

android - How to "download Cordova" and "expand appropriate archive"? -

cordova's android platform guide states: install cordova shell tools if want use cordova's android-centered shell tools in conjunction sdk, download cordova cordova.apache.org. otherwise ignore section if plan use cross-platform cli tool described in command-line interface. the cordova download contains separate archives each platform. sure expand appropriate archive, android in case, within empty directory. relevant executible utilities available in top-level bin directory. (consult readme file if necessary more detailed directions.) however, cordova.apache.org offers "npm install -g cordova" means , install cordova, , there no mention of how download separately @ "shell tools". what have missed?

python - convert text columns into numbers in sklearn -

i'm new data analytics. i'm trying models in python sklearn. have dataset in of columns have text columns. below, dataset is there way convert these column values numbers in pandas or sklearn?. assigning numbers these values right?. , if new string pops out in test data?. please advice. you can convert them integer codes using categorical datatype. column = column.astype('category') column_encoded = column.cat.codes as long use use tree based model deep enough trees, eg gradientboostingclassifier(max_depth=10 ), model should able split out categories again.

java - Android - app crashes when using a signed APK -

i trying signed apk android app. app works when install through android studio when generate signed apk , install app using apk following exception. idea on going on? java.lang.runtimeexception: unable start activity componentinfo{com.app.test/com.app.test.activities.menuactivity}: java.lang.nullpointerexception: attempt invoke virtual method 'boolean java.lang.string.equalsignorecase(java.lang.string)' on null object reference @ android.app.activitythread.performlaunchactivity(activitythread.java:2358) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2420) @ android.app.activitythread.access$900(activitythread.java:154) @ android.app.activitythread$h.handlemessage(activitythread.java:1321) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:135) @ android.app.activitythread.main(activitythread.java:5292) @ java.l...

python - invalid literal for int() with base 10: 'aa',,I'm not trying to pass number why am I getting this? -

hello i'm django activity stream, , got error: invalid literal int() base 10 when tried follow category named aa. code def category_timeline(request, category): user = user.objects.select_related('profile').get(category=category) user_actions = [] if is_following(request.user, user) or not user.profile.private: user_actions = actor_stream(user) context = { 'user': user, 'activities': user_actions, } return render(request, 'timeline.html', context) def follow_user(request, category): follow(request.user, user.objects.get(category=category)) return redirect('category_timeline', category) def unfollow_user(request, category): unfollow(request.user, user.objects.get(category=category)) return redirect('category_timeline', category) here's traceback it's occuring here user = user.objects.select_related('profile').get(category=category) i'm n...

c# - Centralised Connection String for multiple application asp.net -

i have web server multiple application running. application have web.config file. if database password changes due policy have manually change password in each of web.config files in app setting section. i reading connection string setting in machine.config file . now question if put connection string in appsetting section of machine.config name connectionstring , same in web.config file overwrite machine.config file values. in machine.config following setting <configuration> .... <appsettings> <add key="connectionstring" value="value"/> </appsettings> </configuration> similarly in web.config file <configuration> .... <appsettings> <add key="connectionstring" value="value"/> </appsettings> </configuration> and value in code below string constring=configurationmanager.appsettings["connectionstring"]; will overloaded value? ...

java - Equinox Launcher executable -

i have executable file supposedly built eclipse equinox launcher ( https://wiki.eclipse.org/equinox_launcher ) can executable contain java classes? contained in executable, example eclipse.exe on windows? possible extract classes packed in executable? there no classes included in launcher executable. contains code start jvm , call java code in jar file specified -startup option. the launcher looks .ini file same name launcher in same directory (so eclipse.ini eclipse.exe) , reads contents determine start options.

.net - WinCE Remove App still calls the EXE on startup -

i having issue uninstalling application ce devices. i have shcreateshortcut on application initialization shcreateshortcut(@"\windows\startup\daemon.lnk", "\"" + "program files\daemon\daemon.exe" + "\""); i uninstall it, after reboot device still asks run. following message: the file "daemon" cannot opened. either not signed trusted certificate, or 1 of it's components cannot found. if problem persists, try reinstalling or restoring file i want know if there proper way un-install application, how prevent issue happening? i know if there way in uninstaller remove startup link or on installer of next version. of course. way it, program creates shortcut, not installer . installer not know should remove shortcut, too, startup shortcut remains on device , upon every restart, system tries run application, still linked in startup folder. instead of having program create shortcut, need have installer create...

android - Updating hashMap value on specific position -

i tried out lot ways update hashmap value on specific position not able do. have custom array list in stored hash map array list specific position array list. , in list view adapter creating dynamic linear layout on basis of count of hashmap array list, in linear layout have edit text also. now on click of edit text of each item of linear layout. have update hash map value particular position , particular value. my adapter code this:- for (j = 0; j < arry_tickt_info.get(position).getarray_ticket_data().size(); j++) { // create linearlayout linearlayout ll = new linearlayout(context); ll.setorientation(linearlayout.horizontal); linearlayout.layoutparams qntityparams = new linearlayout.layoutparams(0,60, 1f); // create quantitiy edittext final edittext edqntity = new edittext(context); final arraylist<hashmap<string, string>> hashmaps = arry_tickt_info.get(j).getarray_ticket_data(); edqntity.settext(arry_tickt_info.get(position).getarray_ticket_data().get(j).ge...

arrays - How to implement a sticky header on mobile devices -

i know how implement sticky header on pc browser. however, on mobile devices, 'scroll' event behaves weired. fires once after window stopped scrolling, cannot monitor 'window.scrolltop' in real time. i tried 'position:sticky', supported on ios8 , above. so right way create sticky header on mobile browsers? ideas appreciate, thank you~ you can use framework bootstrap achieve that. here code snippet same. <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <...

java - State of required bundle resolved instead of active -

i have bundle depends on bundle b. when code in bundle runs , accesses class bundle b state of bundle b resolved (4) instead of active (32) , activator of bundle b didn't run well. assume there's wrong manifest of bundle b can't quite spot it. this manifest of bundle b, generated bnd. manifest-version: 1.0 export-package: org.jboss.logging;uses:="org.osgi.framework,org.eclips e.equinox.log,org.jboss.logmanager,org.apache.log4j,org.slf4j.spi,org .slf4j";version="3.2.0.beta1-snapshot" build-timestamp: sun, 17 mar 2013 15:07:31 +0100 tool: bnd-0.0.357 bundle-name: jboss logging 3 created-by: 1.7.0_10 (oracle corporation) bundle-vendor: jboss red hat scm-revision: 9e799bac390dbbf9c7cd55afe93dff9265fbed05 bundle-version: 3.2.0.beta1-snapshot bnd-lastmodified: 1363529254048 bundle-manifestversion: 2 bundle-activator: org.jboss.logging.activator bundle-description: jboss logging framework bundle-license: http://www.apache.org/licenses/license-2.0.txt ...

php - Replace text from the middle of the string -

<table border="1"> <tr> <th>id</th> <th>filepath</th> </tr> <tr> <th>1</th> <th>uploads/1233/a.jpg</th> </tr> <tr> <th>2</th> <th>uploads/1213/b.jpg</th> </tr> <tr> <th>3</th> <th>uploads/1243/c.jpg</th> </tr> <tr> <th>4</th> <th>uploads/1234/d.jpg</th> </tr> <tr> <th>5</th> <th>uploads/1273/e.jpg</th> </tr> </table> id , filepath coming mysql table. want replace numeric value between uploads folder , image name. how do in mysql or in php? try preg_replace function php. $filepath = "uploads/1233/a.jpg"; echo preg_replace('/(?<=\/)[1-9][0-9]*?(?=\/)/', "replacement_string_for_the_numeric_value", $filepath);

codeigniter - %20 is added instead of spaces -

i guess small issue yet had ask here since running short in project. when pass string function in controller, changes spaces %20 sign. guess controller thinks string passed url , encodes it. don't know how remove or if possible not let change spaces %20. here code use; $message="the user name provided in our database"; redirect('admin/add_user/'.$message); here controller function receive message; public function add_user($message) { echo $message; } i tried as; public function add_user() { echo $this->uri->segment(3); } but result same. here output of string; the%20user%20name%20you%20provided%20is%20already%20in%20our%20database try this: public function add_user($message) { echo urldecode($message); } you can read more urldecode here: http://php.net/manual/en/function.urldecode.php

ruby on rails 4 - How to check the progress of the rake db:seed -

i have data in seeds.rb, populate table. inside seeds.rb file, using create! methods, when goes wrong error message. when type rake db:seed don't confirmation saying things "data loaded success" . mean, have go rails db, , check table again. fine, know if there way add success message rake db:seed. edit db/seed.rb, add following in bottom puts "data loaded success"

vba - excel sheet Comparing two different columns if match copy its next two cells into new column -

Image
hey guys plz solve this... so... want compare column d a... here in example ... d1 matches a2 ... want b2 , c2 in e1 , f1 respectively .... d2 matches a6 ... want b6 , c6 in e2 , f2 respectively .... have recode of 2022 in column compared d... want 1 formula dat can fulfill desire in 1 shot selecting comparing columns... thanks in advance use index match formula achieve that. in e1 cell write below formula =iferror(index(b:b,match($d1,$a:$a,0)),"") in f1 cell write below formula (you can fill right above formula) =iferror(index(c:c,match($d1,$a:$a,0)),"")

android - How to render bigger image with high resolution ? Using GLsurfaceview -

i'm using code make effect images http://grishma102.blogspot.com/2013/10/apply-effects-on-image-using-effects.html but problem if choose image these sizes example ( width 4128) , ( hight 2322) it's giving me error message fatal exception: glthread 21709 java.lang.runtimeexception: gluseprogram: glerror 1281 @ com.mekdev.imageaffects.gltoolbox.checkglerror(gltoolbox.java:62) @ com.mekdev.imageaffects.texturerender.rendertexture(texturerender.java:95) @ com.mekdev.imageaffects.effectsfilteractivity.renderresult(effectsfilteractivity.java:566) @ com.mekdev.imageaffects.effectsfilteractivity.ondrawframe(effectsfilteractivity.java:584) @ android.opengl.glsurfaceview$glthread.guardedrun(glsurfaceview.java:1531) @ android.opengl.glsurfaceview$glthread.run(glsurfaceview.java:1248) please can ? you should chech glerror after texture loading. on large amount of mobile gpu maximun texture size 2048x2048. have use textures sides power of 2(1024,...

mysql - What kind a SQL query use rails to retrieve data in console -

when fire user.first.email in rails - 4 console gives me query select "users".* "users" order "users"."id" asc limit 1 query structure how can email column database firing select "users".* "users" in rails. please provide needful description this. if want query equivalent select "users".* "users" should using following in console: user.all if want select email field, generating query select "users"."email" "users" use pluck modifier, return array of emails: user.pluck(:email) notice we've dropped all query modifier. isn't required in instance, can add clarity if like: user.all.pluck(:email) be aware though return array containing requested attribute, not instances of model belong to. for that, use select modifier: user.select(:email) #or user.all.select(:email) this return instances of user class email populated data db. us...

Eclipse with pydev cant import theano -

i have installed theano. ipython detects theano, eclipse fails so. have installed pydev & normal python cods using numpy work fine. i have set theanorc follows: [cuda] /usr/local/cuda-7.0 [global] floatx = float32 device = gpu0 [nvcc] fastmath = true what settings have allow pydev detect theano? after installing theano when restarted eclipse, automatically displayed popup asking permission add theano pythonpath. have installed theano , eclipse in both windows , linux pc , both working fine. my steps follows: install anaconda (python distribution continuum analytics) setup eclipse use ( link ) in terminal (cmd windows) execute following 2 commands: a) pip install theano b) conda install pydot-ng start/restart eclipse , automatically dispay popup asking permission add theano pythonpath.

java - Sending File in mail in a loop -

i have requirement send different xls files different email. have created 1 loop in i'm performing 2 action 1) creation of file in temp 2) attache file mail message , send across. my problem file created i'm getting blank file without data in xls. my code generate file below, //in loop fos = new fileoutputstream(path1); wb.write(fos); //i think writing in progress , while file sent in mail hence getting blank destination = new file(path1); internetaddress = null; = new internetaddress("abc@gmail.com",stringpool.blank); mailmessage message=new mailmessage(to,to, "temp", createemailbody(email,numberofuser), true); message.addfileattachment(destination); mailserviceutil.sendemail(message); do wb.flush() , wb.close() before sending , set break point check if file written before sending it. hope help.

c# - Linq: Filter by calculation result and reuse this result -

i have collection (in dbset) want sort calculation result of property (distance) , transform (re-using distance) different model. calculation should happen once per entry (and dbset, it'll executed in db itself). class inputmodel { vector3 position; } class outputmodel { double distance; } var inputlist = getinputlist(); // returns iqueryable<inputmodel> var outputlist = inputlist .where( x => (){ var dist = calculatedistance( x.position ); // calculatedistance() boils down simple equation directly translated sql-query (when typed in statically hand) return dist < maxdistance; }) .select( x => () { return new outputmodel { distance = ???; // calculated distance somehow }) .tolist(); two possible solutions come mind: get entries out of database container , calculate distance , filter entries out in foreach-loop. filter distance , recalculate distance when transforming outputmodel. is possible in 1 go (preferred calcula...

Autofac: adding a decorator to a delegate registration that takes parameters -

i'm trying manage registration of wcf clients using autofac. i need resolve func<machineendpoint, ifooservice> , had registered service using: builder.register((c, p) => fooservice(c, p.typedas<machineendpoint>())).usewcfsaferelease() where fooservice is: private ijobservice fooservice(icomponentcontext c, machineendpoint endpoint) {...} this works fine, want add decorator handle security errors, tried following: builder.register((c, p) => fooservice(c, p.typedas<machineendpoint>())).usewcfsaferelease().named<ifooservice>("simple foo service"); builder.registerdecorator<ifooservice>((c, p, inner) => wrap(inner, p.typedas<machineendpoint>(), c.resolve<certificatelookupcache>()), "simple foo service"); but dependecyresolutionexception: autofac.core.dependencyresolutionexception: exception thrown while executing resolve operation. see innerexception details. ---> system.invalidoperationexcept...

Android Studio 2.0 preview 4 won't run if we delete or move the last opened project manually -

steps reproduce: open 1 project in android studio , close as. delete project manually computer , run again as. not start. any ? in windows there 2 folders @ location c:users/user_name : .android , .androidstudiopreview2.0 just delete both of them , android studio start setup first time have install it.

POST method in REST must be use only to create resources? -

several authors in rest architecture, post method should used create new resource, , put method used update existing resource (or create new one). problem put method idempotent, if resource has date field named "updatedtime" must set in server side reliability, updated operation no longer idempotent (because value of "updatedtime" change in each new operation), put can not used, , post used create new object how fix this? as per http's definition of idempotent : like definition of safe, idempotent property applies to has been requested user; server free log each request separately, retain revision control history, or implement other non-idempotent side effects each idempotent request . so you're free modify updated time in underlying server object long doesn't affect resource served http server. if you're concerned breaking idempotency (although 1 debate whether real violation), therefore advise store updatedtime in...

visual c++ - Interoperability issue between VC++ (ocx) & VB.NET applications -

we migrating product vb6 vb.net , facing issue. product interacts function defined in vc++ component (.ocx). vb6 & vb.net function call: result = testfunc(param1, param2, param3) vc++: a) function definition in .cpp file: long testfunc(long far* param1, const variant far& param2, long param3) { ... } disp_function(ctrl, "testfunc", testfunc, vt_i4, vts_pi4 vts_variant vts_i4) b) function signature in .odl file: long testfunc(long* param1, variant param2, long param3); c) function signature in .h(header) file: afx_msg long testfunc(long far* param1, const variant far& param2, long param3); "param2" in above "testfunc" defined byte array in vb6 & vb.net. in vc++, corresponding type "param2" in "testfunc" - "const variant far& param2". in vb6, byte array values passed gets modified in vc++ "testfunc" & modified values received in vb6 "para...

java - Which Map provides moving objects to different index? -

i need map takes key-value pair (probably hashmap<string, object> ) whereas key property of object itself, like: class person { string name; //i know string not unique key, ok illustrate example } person person = new person("john"); map.put(person.getname(), person); further, map must provide accessor similar arraylist.add(idx, object) . should thereby possible reorder object different position , adjust rest accordingly. which map/list suitable this? (by way: should runable gwt, external libs might problematic). there's no single standard container of this. however, combination of map , arraylist satisfy of requirements.

afnetworking 3 - Not able to parse response in JSON response -

i using afnetworking 3, xcode 7.2 ios 9. afurlsessionmanager *ses = [[afurlsessionmanager alloc] initwithsessionconfiguration:[nsurlsessionconfiguration defaultsessionconfiguration]]; ses.responseserializer = [afjsonresponseserializer serializer]; //request [[afjsonrequestserializer serializer] setvalue:@"application/json" forhttpheaderfield:@"accept"]; nsmutableurlrequest *request = [[afjsonrequestserializer serializer] requestwithmethod:@"get" urlstring:endpoint parameters:parameters error:nil]; nsurlsessiondatatask *datatask = [ses datataskwithrequest:request completionhandler:^(nsurlresponse *response, id responseobject, nserror *error) { if (error) { nslog(@"error: %@", error); } else { nslog(@"%@ %@", response, responseobject); } }]; [datatask resume]; but getting error response as: domain=com.alamofire.error.serialization.response code=-1016 "request failed: unacceptable content-typ...

java - Metrics of the class RankingMetrics, Spark -

i use class rankingmetrics , can calculate precision . according api of class, method calculating of recall doesn't exist. can tell me, can find implementation of recall spark java? ps have found useful link on metrics the recall method exists org.apache.spark.mllib.evaluation.multiclassmetrics , org.apache.spark.mllib.evaluation.multilabelmetrics , org.apache.spark.mllib.evaluation.binaryclassificationmetrics moment. check javadoc multiclassmetrics , multilabelmetrics , binaryclassificationmetrics . [with spark 1.1+]

java - TreeSet definition of an iterator is not consistent with the interface Iterator? -

i using legacy code uses treeset perform sort of collection of objects. ( alternatives using treeset reference, not looking change in particular ). the class has 2 methods iterator() iterator() returns iterator on elements in set in ascending order. and descendingiterator() descendingiterator() returns iterator on elements in set in descending order. my concept of iterator interface implemented collection or in own implementation, you can not assume specific ordering . in implementation provided assumed 2 calls give iterator in correct ordering. results now, fear is false assumption , since violates iterator interface principles, change in future. i not have experience treeset , not see traversal methods poll elements in order. there way or stick iterator 's , hope best? edit example usage: treeset<beatdesc> beatsorderedts = new treeset<>(new comparator<beatdesc>() { @override public int compare(beatdesc lh...

javascript - Unit testing an asynchronous service in angularjs -

i trying unit test service has asynchronous methods having no luck. i have tried implement promises using $q support in angularjs. any appreciated. http://jsfiddle.net/9pbze/37/ angular.module('myapp', ['myservice']); angular.module('myservice', []).factory('myservice', function($q) { var ls = {}; ls.doit = function() { var deferred = $q.defer(); settimeout(function(){ deferred.resolve(5); },3000); return deferred.promise; } return ls; }); describe('services', function () { beforeeach(module('myservice')); it("should equal 2", inject(function(myservice) { myservice.doit().then(function(returned) { expect(returned).toequal(2); }); })); }); first of all, settimeout particularly tricky test since hard mock. fortunately angularjs has wrapper around ( $timeout ) plays same role can mocked: ls.doit = function() { var...

vb.net - How to create a copy of mdb access and convert it's copy into csv on a same folder? -

conns = new oledb.oledbconnection("provider=microsoft.jet.oledb.4.0;" & "data source=" + newpath + "\ddcos.mdb") if not file.exists(newpath + "\ddcos.mdb") catnewdb.create("provider=microsoft.jet.oledb.4.0;" & "data source=" + newpath + "\ddcos.mdb") dim cmdd new oledb.oledbcommand("create table ddcos( " & _ "recnum int identity," & "zipfile nvarchar(50)," & "dvdname nvarchar(50)," & "seqno1 nvarchar(50)," & "seqno2 nvarchar(50)," & _ "jobcode nvarchar(50)," & "clientcode nvarchar(50)," & "totalimages nvarchar(50)," & "totalrecs nvarchar(50)," & "batchcount nvarchar(50)," & "batchdate nvarchar(50)," & "batchsize nvarchar(50)," & "constraint [pk_recnum] primary key (recnum)) ",...

asp classic - ASP Do While loop totals and subtotals -

i don't claim classic asp guy, gotta gotta do. problem custom built report through asp , user wants running subtotals , grand total displayed well, , i'm not sure how go it. entire report wrapped this, way it's displayed doesn't matter issue. <%do while (adorstrade.absolutepage = ipagecurrent) , (not adorstrade.eof) newrep = adorstrade("calincludedrep") if currep <> newrep or firsttime="t" , (not adorstrade.bof) %> add values currep , display them 'subtotals' <% firsttime="f" currep = adorstrade("calincludedrep") adorstrade.movenext loop %> any appreciated mentioned not asp guru means. thank you, nickg to update subtotal stuff; grand totals completed since can re-run while loop outside of loop displays of data , total it, easy-peezy (not really) run .movenext hit prior me being able check newrep; here totalling of sub-totals check if it's newrep means display sub-totals former rep ...

c# - Project Properties Tab string Value is missing spaces -

in project settings, have following string value: "tracking service". white space in string important because use access windows service. when @ config file after installing application on pc, string value missing white space. looking @ debug folder, string value missing space in .config file. is there way perserve white space settings tab in project properties? plan install application on multiple pcs , perfer string keep it's actual value having go in , modify each config file. thanks help! you can transform , settings. split: string [] variablename.split(new [] {'_'}); join: string remerged_variable= string.join(" ", splitparts); will purpose?

mysql - Limiting results of an sql query to last date entered per customer id -

having struggled using joins time, managed write query without syntax error. however, need limit data outputs dependant upon date. the brief select customer's id, @ total number of loyalty points have redeemed, , last date redeemed any. query works in far collect customer id, loyalty member id, , number of points, but, every date redeemed, , not last one. is there way can make query give last date given customer id? my query is: select gv.amount gv_amount, gv.customer_id gv_customer_id, h.date h_date, c.loyalty_id c_loyalty_id coupon_gv_customer gv inner join loyalty_codes_redeem_history h on gv.customer_id = h.customer_id inner join customers c on gv.customer_id = c.customers_id h_date in format yyyy-mm-dd hh:mm:ss this not hard. please take @ post answered while ago background on using joins. selecting multiple columns/fields in mysql subquery here's trick need: subquery finds latest date each i...

android - cakephp 3.x - $this->Auth->identify() isn't work(return false), while I trying from mobile application -

i've done user login web. it's working good. but, i'm using same method login mobile applications[ android , ios]. request : array ( [users] => array ( [username] => username [password] => password ) ) $this->auth->identify(); but it's return false mobile applications. i've solved problem given way. $this->loadcomponent('auth', [ 'authenticate' => [ 'form' => [ 'fields' => [ 'username' => 'username', 'password'=> 'password' ] ] ] ]); these code given initialize() method of appcontroller.php file

Unable to connect to stomp (activemq) push data server in python, whereas in Java it succeeds -

in java i'm able connect data push service , subscribe it. it's stomp or openwire protocol believe. point is, java code works (it's part of it): import javax.jms.connection; import javax.jms.connectionfactory; import javax.jms.jmsexception; import javax.jms.message; import javax.jms.messageconsumer; import javax.jms.session; import javax.jms.textmessage; import javax.jms.topic; connectionfactory factory = new activemqconnectionfactory(api_key, api_key, "ssl://api.something.com:61616"); connection connection = factory.createconnection(); connection.setclientid(clientid); session = connection.createsession(false, session.auto_acknowledge); topic topic = session.createtopic(topicname); messageconsumer = session.createdurablesubscriber(topic, subid); jmsmessagelistener listener = new jmsmessagelistener(); messageconsumer.setmessagelistener(listener); connection.start(); however in python can't error being stomp.exception.connectfailedexception . code: ...

java - Distributing jar file using launch4j -

i have created jar file , linked .exe file using launch4j, working in computer created software, when try distribute software, .exe file or .jar file or .jnlp file, none working. when double click .exe file, error package.mainclass not found. program exit how find error, if working in computer , not working when distribute it?