Posts

Showing posts from January, 2012

python - mongodb cursor id not valid error -

i trying iterate through loop: for doc in coll.find() i following error @ 100,000th plus record. file "build\bdist.win32\egg\pymongo\cursor.py", line 703, in next file "build\bdist.win32\egg\pymongo\cursor.py", line 679, in _refresh file "build\bdist.win32\egg\pymongo\cursor.py", line 628, in __send_message file "build\bdist.win32\egg\pymongo\helpers.py", line 95, in _unpack_response pymongo.errors.operationfailure: cursor id '1236484850793' not valid @ server what error mean? maybe cursor timed out on server. see if problem, try set timeout=false`: for doc in coll.find(timeout=false) see http://api.mongodb.org/python/1.6/api/pymongo/collection.html#pymongo.collection.collection.find if timeout problem 1 possible solution set batch_size (s. other answers).

PHP File Upload Script is not writing to temp directory -

alright, having issue image uploading script/application. have tried debugging time after time again , still cannot find out issue is. code seems fine, reason or file looks it's not saved in temp directory can moved on uploads directory on server. have made directory(uploads) i'm trying upload to, including temp directory, have read/write/execute permissions set , uploads set on in php.ini folder. have feeling files never getting saved temp folder, i'm not sure how check if case, since understand file deleted after script finishes executing. hope guys can me out, because have no clue do. there's code script. also, issue located at. if (is_uploaded_file($filetempname)) { $final = "../public_html/uploads/" . $filename; $result = move_uploaded_file($filetempname, $final); if($result) { echo 'success'; echo "<br>stored in: " . "public_html/uploads/&qu

Jquery hover bug? -

i used jquery hover show item detail user hovers on item on page - dev.oyehabla.com problem mouse leaves item details must hide remain... jquery bug or i'm doing wrong? use code: jquery('#big_container .item-image').hover(function(){ var $opt = $(this); $item_id = $opt.attr("id"); $post_id = $item_id.split('-'); jquery('#'+$item_id + ' .media_block .post-detail').show(); console.log($item_id + 'mouseover') },function(){ var $opt = $(this); $item_id = $opt.attr("id"); $post_id = $item_id.split('-'); jquery('#'+$item_id + ' .media_block .post-detail').hide(); console.log($item_id + 'mouseout') }); you don't need whole function.. use part jquery('#big_container .item-image').hover(function(){ var $opt = $(this); $item_id = $opt.attr("id"); $post_id = $item_id.split('-'); jquery('#'+$item_id +

objective c - NSScrollView scroll bar draws on top of all views -

Image
i have 2 overlapping views. an nstableview (the list of songs), i'll call table view a layer backed nsview (for play controls @ bottom), i'll call play controls view i using layer backed views render table view , caused scroll bar render behind play controls view, great! loaded table view 150+ rows of data app slows down pretty bad scroll. i changed setwantslayer: no , table view snappier, great! scroll bar seems render on top of play controls view. good: bad: any ideas whats going on here? (i'm core animation rookie if can't tell) why don't resize entire scrollview , put play controls view below list? seems sceenshot play controls view subview of scrollview. necessary?

ios - NSNotificationCenter crash after changing UIViewController -

Image
i'm implementing application, whith ios sdk 6.0, , i've got problem. when i'm opening first time uiviewcontroller implemented nsnotificationcenter detect when user clicking on home button, looks working when try click on home button , go app'. problem is, when i'm on uiviewcontroller, , go another, uiviewcontroller , try click on home button, app' looks crashing. this code : in viewdidload function : [[nsnotificationcenter defaultcenter] addobserver: self selector: @selector(applicationenteringbackground) name: uiapplicationdidenterbackgroundnotification object: nil]; [[nsnotificationcenter defaultcenter] addobserver: self selector: @selector(applicationenteringforeground) name: uiapplicationwillenterforegroundnotification

c# - Retrieve data from xml file -

below sample xml file data i'm after <ns2:response/"> <cachekey>-7ca7484a:13e22cb1399:-47c0</cachekey> <cachelocation>10.186.168.39:7302</cachelocation> </ns2:response> i have 2 classes, 1 class getting xml data, class passes data class have many other classes extract data. public static string getxmldata() { string xmlpath = "url"; var wc = new webclient(); wc.headers.add(httprequestheader.contenttype, "application/xml"); wc.headers.add(httprequestheader.accept, "application/xml"); var xmldata = wc.downloadstring(new uri(xmlpath)); var xmldoc = xdocument.parse(xmldata); return xmldoc.tostring(); } the second clas has following public class getcachekey { public string cachekey { get; set; } } below i'm having problem: public ienumerable<getcachekey> cachekey() { var doc = xdocument.parse(getxmldata()); var xkey = c in doc.descendants("res

multithreading - Python logger prints the same output several times in multithreaded environment -

this question has answer here: duplicate log output when using python logging module 11 answers in code, somehow logger prints out events twice, conventional print shows correct number of events. select 1,2 select 1,2 2013-04-19 18:37:30,618:4561354752 - sqllogger - debug - select 1,2 2013-04-19 18:37:30,618:4561354752 - sqllogger - debug - select 1,2 2013-04-19 18:37:30,618:4565561344 - sqllogger - debug - select 1,2 2013-04-19 18:37:30,618:4565561344 - sqllogger - debug - select 1,2 it not clear me why same message being published mutliple times in multithreaded situations. import logging threading import thread class sqlengine(object): def __init__(self, db_path): ch = logging.streamhandler() ch.setlevel(logging.debug) formatter = logging.formatter('%(asctime)s:%(thread)d - %(name)s - %(levelname)s - %(message)s')

django - How to setup TINYMCE to point to static_files? -

i using django 1.5.1, , know since django 1.3 world of media , statis files have been separated reasons. to surprise django-tinymce's documentation referring how tinymce_js_url pointing default media url. tinymce_js_url (default: settings.media_url + 'js/tiny_mce/tiny_mce.js') that doesn't make sense. in django 1.3+ have static_url self hosted js , css files. trying change confusing , doesn't work. this how setup static files settings: static_root = '/home/kave/project-env/site/static/' static_url = '/static/' staticfiles_dirs = ('/home/kave/project-env/site/static_files/',) in static_files directory have extracted tinymce zipfile: e.g. path this: /home/kave/project-env/site/static_files/tinymce/js/tinymce/tinymce.min.js then have set settings this: tinymce_js_url = static_url + 'tinymce/js/tinymce/tinymce.min.js' tinymce_js_root = static_root + 'tinymce/js/tinymce' however when app runs, see plain te

php - Send a functions parameter to an array in another included file? -

i'm trying build user signup class, i'm using language file, i've include class. when user tries signup, want class send user e-mail information. however, text use in mail function language file. in language file, have array call variable username in function in class, can't seem work. searched on internet, couldn't find solution. if you're wondering language language file in, can tell it's in danish. ------ class file: class user { #variables mail public $mail; private $lang; public function __construct(){ global $realname; require_once ('_lang/class.langdk.inc.php'); require_once ('class.phpmailer.php'); $this->lang = $lang; } public function registeruser($realname,$useremail){ echo 'brugeren er oprettet med: ' . $this->lang['welcome']; } } in class.langdk.inc.php, have: $lang= array( #mailsetup 'welcome' => 'hej '. $realname .&#

windows - MSI-X interrupts in WDF -

i'm having lot of trouble getting msi-x interrupts implemented in windows bus driver we're writing in wdf / kmdf. i've read msdn documentation , , there's not lot of helpful info there. understanding should "work". i've changed our driver's inf file add appropriate registry keys , confirmed being set working on install. i'm querying pci config space , determining whether msi-x interrupts supported. the problem once have information, don't know how change code set interrupt msi-x. standard calls configure wdf_interrupt_config_init stuct , call wdfinterruptcreate, interrupt created not message-signaled, , don't know needs done make happen. is there wdf version of steps here , or should doing standard wdfinterrupt creation steps here ? does have experience doing this? can provide source example? i have been struggling similar in last week. application different because trying plain msi interrupts rather msi-x interrupts w

How to mock Pusher with RSpec in Ruby? -

currently using pusher , rspec. pusher.should_receive( :trigger ).with( 'message', { :data => '12345' }) this work, except call pusher[ 'channel-id' ].trigger... how mock rspec? well [] function name can stubbed. in pusher source see: def_delegators :default_client, :webhook, :channel, :[] of these methods forwarded default_client . chain of methods. i want this. mock_client = mock('client') pusher.stub(:[]).with('channel-id').and_return(mock_client) mock_client.should_receive( :trigger ).with( 'message', { :data => '12345' }) i not have rspec handy right now, see no reason why not work.

parsing - Parse IMAP message and extract header information -

i trying extract header , body information email, following code retrieves header , body in raw form. have email object contains fields from , subject , date , , body . extract these values email , assign them email object. how around it? have tried several ways getting header info , using streamreader.readline() line got illegal path exceptions . know can use library need achieve way. what mean this, imap command returns header information. , want extract subject value, date value, sender e-amil, etc. , assign them email objects corresponding values like emailobject.subject = "subjectvalue" public class imap { static void main(string[] args) { try { path = environment.currentdirectory + "\\emailresponse.txt"; if (system.io.file.exists(path)) system.io.file.delete(path); sw = new system.io.streamwriter(system.io.file.create(path)); tcpc = new system.net.sockets.

java - How to convert a string from one pattern to another using regex? -

i have string want convert using regex: aa_bb_cc_dd => ee_bb_ff_dd tried using regex (aa)(.*)(ff) . did not work. can help? also nice if can point me regex guide. there many sites regex. not sure refer. how about string before = "aa_bb_cc_dd"; string after = before.replacefirst("aa(_bb_)cc(_dd)", "ee$1ff$2"); system.out.println(after); // ee_bb_ff_dd you haven't described how form of input string vary, difficult produce suitable regex. if wanted allow between aa , cc use (.*?) instead of (_bb_) etc. the above shows principle of using in replacement string content captured () , i.e. $1 refers content in first () , , $2 second () . links: regular-expressions.info . the java tutorials. lesson: regular expressions .

php - MySQL query and get id values -

thanks dropping by! i trying e-commerce website school project. purpose populate webpages content database , 1 specific conditional don't seem recorded me able pull data out db presented on website: one main page have code on residing on sidebar: leads php page retrieve products base on product category <ul class="left_menu"> <li class="odd"><a href="categories.php?catno=10familia">familia originals</a></li> <li class="even"><a href="categories.php?catno=20familia">ready cook</a></li> <li class="odd"><a href="categories.php?catno=30familia">siomai , buns</a></li> <li class="even"><a href="categories.php?catno=40familia">pork snacks</a></li> <li class="odd"><a href="categories.php?catno=50familia">ready made dishes</a></li

java - How to add two string array members into one string variable -

i've been trying figure out how add string array member string variable no luck. here code. mydirstring = mydirstring.trim(); string[] mydirstringparts = mydirstring.split(" +"); mysize = mydirstringparts[0]; mynum = mydirstringparts[1]; total = mydirstringparts[2]; myname = mydirstringparts[3]; basically want mydirstringparts[2]; included myname . myname = mydirstringparts[3] + mydirstringparts[2]; will work.

mobile - Does Marmalade SDK support in app purchase? -

i searching features supported marmalade sdk , not find in app purchase. knows how , can point me resources it? marmalade supports in-app purchase android, ios, blackberry , windows phone 8. need @ particular platform specific api have. example check out platform specific guide here .

c - Linux; Change UID to root if you are not root -

i write simple program when run program, if not root user, input root password, change uid root if (getuid()) { char *pass = getpass(""); //how change uid root ? } how change uid root when got root password? there no way change non-root user root. that's whole point. programs login , sshd , or su work starting root , either because of ancestry or having suid bit on executable file, , restricting can until authenticate password or other method, changing appropriate uid (either root or user you're logging in as) , exec 'ing program (usually, shell).

linux - storing logs/error message on C programming -

when error occurs, c code store error before exiting program. advised store stderr file (e.g., /home/logs.txt) or advised use different method keep logs/error report (considering programming environment linux ). e.g., code below, how apply method store logs/error message on /home/log.txt or /home/log file *fp1; fp1 = fopen("/sys/class/gpio/export","w"); if(fp1 == null){ fprintf(stderr, "errno:%s - opening gpio136 failed - line 739\n ", strerror(errno)); close(fp1); exit(1); } thank you. if stderr used print out error message, so, can redirect output specific file. $ program 2>~/logs.txt for better logging tool, can use: syslog standard function. log4c library.

java - How to issue a warning if required text field is empty? -

i trying make executable jbutton (which opens new window)radiobutton chosen , textfiled filled within specific range (the textfield should 1800 2013) . radiobuttons made default choise now, cannot figure out how can return warning textfield should filled (a number between 1800 , 2013) , if there run program. edit: if code is: jframe .... jpanel .... jtextfield txt = new jtextfield(); jbutton button = new jbutton("run"); button.addactionlistener(new actionlistener(){ public void actionperformed(actionevent e) { //do things here } }); txt.addfocuslistener(new focuslistener() { .... } how can use itemstatelistener . should define listener , what? public void actionperformed(actionevent e) { string s = txt.gettext(); char[] carr = s.tochararay(); arraylist<character> chars = new arraylist<character>(); (char c : carr) if (c.isdigit()) chars.add(c); carr = new char[chars.size()]; (i

Calculating accuracy within excel -

Image
i have prediction cell (a1), results cell (b1) , difference cell (c1) in excel. i have accuracy cell (d1) show accuracy of prediction based on result. example, if have 24 prediction , 24 results, accuracy should 100% difference of 0. if have prediction of 24 , results 12, accuracy should -50% difference of -12. here calculation i'm using in accuracy cell (d1): =(((c1+100)*a1)/b1)/(c1+100) this calculation showing expected results when prediction cell higher or equal results cell. assistance appreciated, thank you. format cell in col c "%" , try formula formula in c1 per snapshot =if(b1<a1,value("-"&(b1/a1)),(b1/a1)) formula in d1 per snapshot =b1-a1 various test scenarios below. let me know if have misunderstood question , rectify answer. followup try new formula =if(b1<a1,value("-"&(b1/a1)),if(b1=a1,b1/a1,(b1-a1)/a1))

android - How to show Tapped Product Information in WishProductDetails.java -

like: see in cart apps, when user selects item(s) , @ last stage he/she wants change quantity of item, here allow user tap on item in list view update quantity of item, , once user tap on item in list view, show him/her existing detail of item, has been tapped....in same way want allow user tap on item , want show him existing detail item....just want show existing product information has been tapped user in wishproductdetails.java still able show wishproductdetails.java not able show tapped item details in activity.. i using below code show existing item details in wishproductdetails.java have clicked in cart activity using list view item row... hashmap<string, string> item = constant.wishproducts.get(position); log.d("cartadapter", "onclick :: " + item); intent myintent = new intent (activity, wishproductdetails.class); log.d("cartadapter", "intent :: " + myintent); myintent.putex

Unable to get twitter friends list through socialauth-android-2.1.jar -

i've downloaded , replaced socialauth-android-2.1.jar when click friends button, unable twitter friends list. throws error. i got below error. 04-16 10:17:05.695: i/twitterimpl(14690): fetching contacts http://api.twitter.com/1/friends/ids.json?screen_name=sgm_friends&cursor=-1 04-16 10:17:05.700: d/socialauthadapter(14690): contact list not received 04-16 10:17:05.700: w/system.err(14690): org.brickred.socialauth.exception.socialauthexception: failed retrieve contacts http://api.twitter.com/1/friends/ids.json?screen_name=sgm_friends&cursor=-1 04-16 10:17:05.700: w/system.err(14690): @ org.brickred.socialauth.provider.twitterimpl.getcontactlist(twitterimpl.java:287) 04-16 10:17:05.705: w/system.err(14690): @ org.brickred.socialauth.android.socialauthadapter.getcontactlist(socialauthadapter.java:688) 04-16 10:17:05.705: w/system.err(14690): @ org.brickred.customui.customui.events(customui.java:199) 04-16 10:17:05.705: w/system.err(14690): @ org.brickred.cus

Zend Framework 2 layout.phtml -

so, can write code in controller affect view... code layout.phtml read from? (i assuming module.php, i'd feedback) edit: clear... in controller, can variable equal , access in view. i'd discover similar action inside layout. thanks you ask various questions in single post. try address few of them. how layout work? in zend framework 2 there concept of "view models". view model object has couple of variables , template assigned. template rendered given variables. furthermore, can nest view models. 1 view model (the "layout") has child created controller. child rendered , stored variable in parent view model. name of variable called "capture to". what happens, have controller , view model created. view model inserted child view model in new model, layout. child set "capture to" of content . in layout, result of child view model inserted in $content variable. how access layout variables in controller? there a

Regex C# searching file for matching pattern starts with and end with -

in c# want search match occurs starting integer in parenthesis followed these characters "pla" parenthesis , "match" (i'll read memory) until next set reached. thus sample code (1965 ("pla") ("gen_angle") ("line line angle") ( ("clinesegs" 3565.01 1265.99 "surface") ("clinesegs" 3618.02 1255.00 "surface") ) ((3586.02 1267.20 "surface")) (120.000) (90.000) ) (1966 ("pla") ("gen_angle") ("line line angle") ( ("clinesegs" 3831.98 1255.00 "surface") ("clinesegs" 3882.92 1268.07 "surface") ) ((3863.98 1267.20 "surface")) (120.000) (90.000) ) i want "match" data , grab data based on knowing "1965" id i'm looking for. (1965 ("pla") ("gen_angle") (&

ruby on rails - Devise broke by itself? /users/edit goes to 404 -

when clicking on user profile link edit_user_registration_path ( http://localhost:3000/users/edit ) used work yesterday. today goes 404 error looks this. routing error no route matches {:controller=>"devise/ideas"} try running rake routes more information on available routes. i checked rake routes , get like_idea /ideas/:id/like(.:format) ideas#like comment_idea post /ideas/:id/comment(.:format) ideas#comment ideas /ideas(.:format) ideas#index post /ideas(.:format) ideas#create new_idea /ideas/new(.:format) ideas#new edit_idea /ideas/:id/edit(.:format) ideas#edit idea /ideas/:id(.:format) ideas#show put /ideas/:id(.:format) ideas#update delete /ideas/:id(.:format) ideas#destroy new_user_session /users/sign_i

c++ - How to push back value to fusion vector during runtime? -

how push value fusion vector during runtime? typedef boost::fusion::vector<a*, b*, c*> vec_t; vec_t vec_; vec_.push_back(new a()); the sequence operations done on fusion::vector compile-time-only. once type has been computed @ compile time, fusion::vector becomes no more tuple. if want run-time mutable vector should use std::vector .

performance - My C-Code runs slowly in Mac comparing to Ubuntu -

i have written scientific code in c. compile code in ubuntu using gcc 4.7.2, , in mbp using gcc 4.2. makefile looks this: cc = gcc cflags = -c -fpic -wall -o3 -lpthread -g basedir = /users/admin/ libname = libttvs.so include = -i$(basedir)umfpack/include -i$(basedir)amd/include -i$(basedir)suitesparse_config lib = -l$(basedir)umfpack/lib -l$(basedir)amd/lib -l$(basedir)suitesparse_config -l$(basedir)gotoblas2 addfiles = -lumfpack -lamd -lsuitesparseconfig -lgoto2 staticlibs = $(basedir)umfpack/lib/libumfpack.a $(basedir)amd/lib/libamd.a $(basedir)suitesparse_config/libsuitesparseconfig.a $(basedir)gotoblas2/libgoto2.a all: algebrafuncs.o qsp.o updatealgvars.o algvarsjac.o extraroutines.o solvemultistepsolverc.o ttvs.o ttvs.h $(cc) $(include) $(lib) $(addfiles) -shared -lpthread -o $(libname) $^ -lm -g $(staticlibs) algebrafuncs.o: algebrafuncs.c ttvs.h $(cc) $(include) $(cflags) $^ qsp.o: qsp.c ttvs.h $(cc) $(include) $(cflags) $^ updatealgvars.o: updat

cakephp 2.0 - Using Facebook App to obtain contacts and profile details for user on my website, it works for some users and not for other -

i integrated facebook api importing facebook contacts profile details. working before. allows syncing few users , users unable acquire facebook details. using cakephp development , code working before. few users following error obtained an error occurred. please try again later. for users getting following error given url not allowed application configuration.: 1 or more of given urls not allowed app's settings. must match website url or canvas url, or domain must sub-domain of 1 of app's domains. for users there no error message account details not obtained while able sync accounts , obtain details. kindly me fix issue. thanks in advance fb has updated privacy policy recently, may causes error. if has private profile, fb may not allowing it. check profile status (is private?). google search, one or more of given urls not allowed app's settings. must match website url or canvas url many results. may you.

yui - Creating a dynamic custom proxy element in YUI3 drag -

i trying implement drag , drop using yui3. requirement when user drags particular division, image inside division must used proxy , when drop new div different original must created. wanna know how create different proxy original division? see clone attribute in ddproxy how can create different proxy?

PHP MYSQL SUM Until a row then stop -

basically creating sort of checking account type query. easy except want split pages. so have field called amount , can positive or negative number. the problem if on records 75-100 need have query sum of amount until record 75 , give me total. can run query records 75-100 , loop through amounts so: (supposing sum , including 74 $500) record# amount total 75 25.00 525.00 76 35.00 560.00 77 40.00 600.00 etc. what thinking idnum record 75 , sum until finds so: sum(case when idnum != $until amount else 0 end) however keeps going. doesn't stop @ 75 skips 75 sums 76, 77, etc.. appreciated. set @total=0; select recordno, amount, @total:= @total+ amount total table1 limit 75, 75 or select cur.id, cur.amount, sum(prev.amount) table1 cur left join table1 prev on cur.id >= prev.id group cur.id limit 75, 75 here limit function start records 76 75 records, can send parameter

c++ - implementing a non blocking udp socket by select() -

i wanted create asynchronous/non-blocking udp client server application client , server supposed chat away each other without waiting each other's turns. came know done select()... here server(mentioning communication part): fd_set readfds,writefds; while(1){ fd_zero(&readfds); fd_zero(&writefds); fd_set(sd,&readfds); fd_set(sd,&writefds); int rv = select(n, &readfds, null, null, null); if(rv==-1) { printf("error in select!!!\n"); exit(0); } if(rv==0) { printf("timeout occurred\n"); } if (fd_isset(sd, &readfds)) { int client_length = (int)sizeof(struct sockaddr_in); memset(&buffer,0,sizeof(buffer)); int bytes_received = recvfrom(sd, buffer,size, 0, (struct sockaddr *)&client, &client_length); if (bytes_received < 0) { fprintf(stderr, "could not receive datagram.\n");

c - Maintain a sorted array that a separate, iterative function can keep accessing -

i'm writing code decision tree in c. right gives me correct result (0% training error, low test error), takes long time run. the problem lies in how run qsort. basic algorithm this: every feature sort feature column using qsort remove duplicate feature values in column every unique feature value split determine entropy given split save best feature split + split value every training_example if training_example's value best feature < best split value, store in left[] else store in right[] recursively call function, using left[] training examples recursively call function, using right[] training examples because last 2 lines iterative calls, , because tree can extend dozens , dozens of branches, number of calls qsort huge (especially dataset has > 1000 features). my idea reduce runtime create 2d array (in separate function) each column sorted feature column. then, long maintain vector

asp.net mvc - Errors when passing data via jquery ajax -

i have pretty simple ajax request i'm sending on server in order data , fill edit modal. reason keeps returning error , can't figure out why. i've debugged server side, parameter comes in correctly , data found , returned, still error though. here's code might see missing here. request: function editnorm(id) { $.ajax({ type: "post", url: "@url.action("getnormviewmodel")", datatype: 'json', contenttype: 'application/json; charset=utf-8', data: json.stringify({id : id}), cache: false, success: function(data) { fillformforediting(data.nvm); }, error: function() { alert("error on editnorm function"); } }); } server side: public jsonresult getnormviewmodel(int id) { var nvm = new normviewmodel {norm = db.norms.find(id), materials = db.materials.tolist()}; return json(new {nvm

Getting multiple lines of input with scanf() in c -

i trying grab multiple lines of input scanf, lines have same formatting example line: 1, 05:05:04, 1, 1103 the current code have grabs 1 line scanf(" %d, %d:%d:%d, %d, %d", int1, int2, int3, int4, int5, int6); are looking this? while (scanf("%d,%d:%d:%d,%d,%d", &int1, &int2, &int3, &int4, &int5, &int6) == 6) { //use int1, int2, int3, int4, int5, int6 }

ssh - git push to remote repository "Could not read from remote repository" -

i searched while can't find solution problem. i have server can connect via ssh username git , local git repository. want push local repository newly created 1 on server. here did: created git repository in /home/git/test.git initialized repository bare added remote repository on local machine git remote add test ssh://git@serverip:/home/git/test.git now executed push command: git push test master i fatal: not read remote repository please make sure have correct access rights , repository exists. i working on local windows 7 machine , want upload linux server. can log in via ssh git user. tried root user(to things work once) same result. never asked ssh password . i don't know doing wrong. before call duplicate, searched lot problem , none seemed talk same problem. update: "which git" returns /usr/bin/git path echo includes /usr/bin id_rsa , id_rsa.pub files set , withput passphrase ssh git@serverip git-receive-pack works ,

linux kernel - Qemu emulator arm for tegra2 -

i have toradex colibri t20 embedded board linux image (u boot,kernel,roofs). colibri t20 based on tegra2 arm-cortex-a9 processor. want run linux kernel in qemu emulator.how can boot qemu? qemu-system-arm can run u-boot , kernel sw, when has support board sw configured/built for. arm's versatilepb , vexpress-a9 supported. there tutorials out there using boards, balau on kernel , kumar bare metal simulation less ambitious. there, speaking, qemu has emulate processor. check out balau on bare metal . quick search shows maybe there support in progress tegra2 . i'd suggest installing current packages on host, see machines , cpus supported. not sure of following syntax detail, qemu-system-arm -m ? way list of supported machines.

javascript - Can you fix the scrollbar on the screen? -

i have div has height bigger screen , want leave bit is, div has horizontal scrollbar @ bottom , 1 not visible until user scrolls way down, , bit strage. have scroll down, scroll right , scroll see need. wondering if there way fix bottom scrollbar @ bottom of screen it's available @ time user. here 2 prints demonstrate problem what have right now: http://imageshack.us/a/img132/2087/38417747.png how want make look: http://imageshack.us/a/img267/7452/90387247.png i going design scrollbar myself using jquery want know if doable without effort. example: here go: jsfiddle.net/jy3hk/ also, please try answer question without modifying it. want application customizable possible. there option cancel bottom scroll want add option too. thank you. it possible, require tricky js approach - there no possible css solution question far can reckon. i have created fiddle here - http://jsfiddle.net/teddyrised/szuzk/ , more or less proof-of-concept modification original fidd

jquery - Validate a form with javascript before submitting with ajax? -

i've been making website , want nice login/registration/forgot pass form. i wanted use 'ajax' make nice user and, consequently, have spent last 2 weeks on steep learning curve. i wanted check form valid used javascript , executed via onsubmit function. however, ajax submits regardless i'm wondering if better validating via jquery script? here code far: jquery(document).ready(function($) { $('#jtlogin_titletext').text("register or log in"); $("input[type='submit'][name='submit']").val("send"); $('#jtlogin_wrapper #forgotpass_div').hide(); $('#jtlogin_wrapper #matchpass_div').hide(); $('form#loginformid #username').change(function(){ $('form#loginformid span.jtlogin_usernamestaticmessage').hide(); $('form#loginformid span.jtlogin_usernameerrormessage').hide(); $('form#loginformid span.jtlogin_usernamedynamicmessage').show(); $('form#loginformid span.jt

java - Is it possible to let Play Framework 1 handle a sent JSON in a post request? -

is possible let play framework 1 handle sent json in post request? developer connecting backend not send in key/value pairs ampersand separator, wants send in json. problem data null, i.e name null. possible achieve? what have far: controller public static void mymethod(string name) { logger.info(name); } routes file post /test application.mymethod and send request header content-type: application/json , data in body { "name": "a name" } i did not find auto binding did this: mymodel mymodel = new gsonbuilder().create().fromjson(new inputstreamreader(request.body), mymodel.class); and worked perfectly!

python - Cannot open file with PyFITS -

i've got .fit files containing images ccd camera , can't seem open them using pyfits. i'm complete newbie pyfits don't know (if any) options have. here's i'm trying: import pyfits hdulist = pyfits.open('apex5_1_90s.fit') which returns error: traceback (most recent call last): file "\\uol.le.ac.uk\root\staff\home\l\lvh8\desktop files\prototype data\spextract.py", line 3, in <module> hdulist = pyfits.open('apex5_1_90s.fit')#, ignore_missing_end=true) file "c:\python27\lib\site-packages\pyfits\hdu\hdulist.py", line 118, in fitsopen return hdulist.fromfile(name, mode, memmap, save_backup, **kwargs) file "c:\python27\lib\site-packages\pyfits\hdu\hdulist.py", line 250, in fromfile save_backup=save_backup, **kwargs) file "c:\python27\lib\site-packages\pyfits\hdu\hdulist.py", line 803, in _readfrom hdu = _basehdu.readfrom(ffo, **kwargs) file "c:\python27\lib\site-pac

Admob ads not showing on android emulater -

i have added admob codes showing ads in app. when run app in emulator opens splash screen , app exits saying "unfortunately,your app has stopped". don't know why showing. works before addding admob codes.i have added code. me this. <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"`` android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background2" > <scrollview android:id="@+id/scrollview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_centerinparent="true" android:scrollbars="none"> <linearlayout android:layout_width="match_parent" android:l

javascript - Show answer elsewhere -

i'm new javascript , i've searched several topics, couldn't find desired answer. using google sites making (financial) calculations, , started of using simple template found on website. <script> function calcul(){ var x = parsefloat(document.getelementbyid("value1").value); var y = parsefloat(document.getelementbyid("value2").value); document.getelementbyid("answer").innerhtml=x+y; } </script> <form action="" id="nothing"> <input type="text" id="value1"> <input type="text" id="value2"> <input type="button" value="calculate" id="but" onclick="calcul()" /> </form> <p id="answer"></p> i understand piece of scripting, want show answer elsewhere. example, instead of clicking on calculate , show answer on next paragraph, want this: the answer is: <p id=