Posts

How to implement a login in Android using Volley? -

i have loginactitvity 2 textfields username , password , login-button. when user presses button, app starts async task. async task implements volleyhandler. checks if login parameters correct , fetches user data (using volley , json). while doing this, progressdialog appears. when async task finished, starts intent mainactivity in onpostexecute method. now question: idea make volley-requests in async task, or have better solution? thanks. you cannot use asynctask. volley care it. can use callback work data , ui. looks this: public class loginactivity extends singlepaneactivity implements downloadcallback { //... public void sendrequest(){ downloader download = new download(this); downloader.download(username, password); progresbar.show(); } public void requestfinish(){ progersbar.dismis(); //... continue } } callback: public interface downloadcallback { void requestfinish(); } in class downloader private requestqueue requestqueue; download...

how to create a training dataset for image processing -

i have dataset of 10 jpeg high quality aerial images txt files containing information each vehicle's bounding box (width, height, angle, x & y axis,...). example: @category:general @image:2012-04-26-muenchen-tunnel_4k0g0010.jpg #format: id type center.x center.y size.width size.height angle 0 30 1319 2338 35 11 56.451578 1 30 1337 2350 42 14 57.817368 2 30 224 3556 61 20 136.967797 how should create database of vehicles train in neural network using caffe ? should use photoshop crop each vehicle , save them 1 one? or can use txt files create different classes of vehicles train in network sth matlab ? with many vehicles not hand. in python can load image numpy array , select boxes data provided in files. can handle angles rotating whole array , select box same way select 'normal' one. if using different programming language should able follow approach need convert jpeg bitmap , somehow array. i don't know caffe required capture exact bound...

lua - Atomically move redis key on expiration -

is there way atomically move redis key 1 place when expires? there's ways of doing in client being notified of redis expire notifications, if no clients running when notification triggered event missed. but if there's way on server (through lua script maybe) can atomic , key exists in 1 place before expiry , other place after expiry. lua scripts cannot triggered keyspace notification. must on client side.

java - Web Service and method with parameters -

i'm using eclipse create webservice manage vehicle. have problem method want use in webservice. sofware return me error when select method need. here error : iwab0398e error in generating wsdl java: java.lang.illegalstateexception: error looking paramter names in bytecode: unexpected bytes in file (i past full trace @ end of message) i don't know why error happens. after few test, notice happens when try use parameters in method. by exemple have same error method 1 : public string test(string lol) { return "a"; } but not 1 : public string test() { return "a"; } it seems i'm missing important point can't find information. can guide me ? here full error trace if can : iwab0398e error in generating wsdl java: java.lang.illegalstateexception: error looking paramter names in bytecode: unexpected bytes in file java.lang.illegalstateexception: error looking paramter names in bytecode: unexpected b...

laravel 5 - How to use bootstrap in sass file in laravel5? -

i using node-module in project , download npm install , wanna use bootstrap on laravel project import in sass file using code @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; when use gulp command , check page source bootstrap not loaded.

Python: how to slice a dictionary based on the values of its keys? -

say have dictionary built this: d={0:1, 1:2, 2:3, 10:4, 11:5, 12:6, 100:7, 101:8, 102:9, 200:10, 201:11, 202:12} and want create subdictionary d1 slicing d in such way d1 contains following keys: 0, 1, 2, 100, 101, 102 . final output should be: d1={0:1, 1:2, 2:3, 100:7, 101:8, 102:9} is there efficient pythonic way of doing this, given real dictionary contains on 2,000,000 items? i think question applies cases keys integers, when slicing needs follow inequality rules , , when final result needs bunch of slices put in same dictionary. you use dictionary comprehension with: d = {0:1, 1:2, 2:3, 10:4, 11:5, 12:6, 100:7, 101:8, 102:9, 200:10, 201:11, 202:12} keys = (0, 1, 2, 100, 101, 102) d1 = {k: d[k] k in keys} in python 2.7 can compute keys (in python 3.x replace it.ifilter(...) filter(...) ): import itertools d = {0:1, 1:2, 2:3, 10:4, 11:5, 12:6, 100:7, 101:8, 102:9, 200:10, 201:11, 202:12} d1 = {k: d[k] k in it.ifilter(lambda x: 1 < x <= 11, d....

Parsing a string with a colon and setting both sides to different variables, C++ -

so trying write simple program takes time input user, , calculates angles between , around hands of analog clock. have run program without parsing , 2 separate inputs wanted parse time @ colon (say, 12:35) , set left side hour variable , right side minutes variable. however, reading examples hard when don't know of lines of code mean. me example , explain each line doing , why use method? this looking for: string time = "12:35"; unsigned int hour, minutes; sscanf(time.c_str(), "%2d:%2d", &hour, &minutes); cout << "hour: " << hour << endl; cout << "minutes: " << minutes << endl;