Posts

Showing posts from January, 2014

java - Unable to get object from datastore using objectify -

i working on simple expenses manager deployed on google appengine. using objectify appengine orm. problem unable simple object datastore. session here null !! when check out in localhost datastore can see there ! @override public string findemailbysessionid(string sid) { session session = datastore.load().type(session.class).id(sid).now(); if (session != null && (session.getdate().after(new date()) || session.istoberemembered())) { return session.getemail(); } // null ! return null; } @entity public class session { private string email; @id private string sessionid; private date date; private boolean toberemembered; @parent private key<user> parent; ......... } @entity public class user { @id private string email; private string name; private string password; private date dateofbirth; private string hashsalt; public user() { } ok, i've got answer

What is the source of the discrepancy in Java versions: Java 6 (in Terminal, Eclipse) and Java 7 (in Java Control panel)? -

Image
eclipse complains: jre version 1.6.0; version 1.7.0 or later needed run google plugin eclipse . in terminal, java concurs: > java -version java version "1.6.0_65" java(tm) se runtime environment (build 1.6.0_65-b14-462-11m4609) java hotspot(tm) 64-bit server vm (build 20.65-b04-462, mixed mode) but in system preferences \ java \ java control panel says your system has recommended version of java: java 7 update 51 and points /library/internet plug-ins/javaappletplugin.plugin/contents/home/bin/java . eclipse preferences show installed jre at: /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home to point eclipse java 7 (1.7.0), it's enough change preference: what source of discrepancy in java versions? instance of having different paths between command-line mac , windowed-mac? edit if edit /usr/local/adt-bundle-mac-x86_64/eclipse/eclipse.app/contents/macos/eclipse.ini adding -vm "/library/internet plug-ins/javaapplet

r - Chi square goodness of fit without Yates correction -

i want conduct theoretical chi square goodness of fit test: actual <- c(20,80) expected <- c(10,90) chisq.test(expected,actual) sample size n=100, alpha=0.05, df=1. gives critical chi value of 3.84. hand can calculate test statistic ((20-10)^2)/10 + ((80-90)^2)/90 = 100/9 > 3.84 however, above code yields pearson's chi-squared test yates' continuity correction data: expected , actual x-squared = 0, df = 1, p-value = 1 where mistake? i don't think you're testing intend on testing. @ ?chisq.test states, yates' continuity correction via correct= argument is: " a logical indicating whether apply continuity correction when computing test statistic 2 2 tables ." instead, try: chisq.test(x=actual,p=prop.table(expected)) # chi-squared test given probabilities # #data: actual #x-squared = 11.1111, df = 1, p-value = 0.0008581 you use optim find right values give chi-square statistic above critical value: crit

Map on Android flickers after implementing dialog for datepicker -

Image
i able implement map in fragment tab on android without flicker , after implementing click handlers action bar initiates dialog fragment datepicker , map flickers , overlaps action bar . might possible cos of error ? as can see above , map overlapping date picker dialog after flicker , , after touch datepicker dialog , map goes in background. similar problem happens action bar , i.e upon flicker action bar becomes transparent , map visible , runs fine ps: implementing googlemapv2 what can possible cause such flicker , overlapping issues? in advance , hint appreciated .

spring - Use Tiles without `views.properties` -

i'm trying reduce of configuration of our web application , have noticed our views.properties file has lot of redundant values can calculated programmatically. for example: welcome.(class)=org.springframework.web.servlet.view.tiles2.tilesview welcome.url=welcome home.(class)=org.springframework.web.servlet.view.tiles2.tilesview home.url=home login.(class)=org.springframework.web.servlet.view.tiles2.tilesview login.url=login is there way entirely without views.properties file (i'd rather more opinionated "file names must match view names" error-prone "updated these x config files") thanks time! so have been using hack rid of lame views.properties file 6 years now. here amazing solution of laugh at/use: define viewresolver way instead <bean id="viewresolver" class="com.yourcompany.util.tilesresourcebundleviewresolver"/> here implementation of resolver looks directly @ tiles views package com.yourcompan

css - Sphinx inline code highlight -

Image
i use sphinx make website contains code samples. i'm successful using .. code-block directive syntax highlighting. can't inline syntax highlighting using code: .. role:: bash(code) :language: bash test inline: :bash:`export foo="bar"`. .. code-block:: bash export foo="bar" which produces output i.e. inline code not highlighted while block code is: problem me generated html inline code contains long class names while not code blocks. here output html (indented readability): <p>test inline: <tt class="code bash docutils literal"> <span class="name builtin"> <span class="pre">export</span> </span> <span class="name variable"> <span class="pre">foo</span> </span> <span class="operator"> <span class="pre">=</span>

java - GWT Garbage Collection on unused Widgets? -

i interested in question when , if gwt garbage collection triggered in following example. i have composite: class extends composite implements hasclickhandlers { ... focuspanel panel = new focuspanel(); @override public handlerregistration addclickhandler(clickhandler handler) { return focuspanel.addclickhandler(handler); } } in view class create widget add click handler , add widget panel: a widget = new a(); widget.addclickhandler(someclickhandler); somepanel.add(widget); at point in application clear panel have entered widget. widget not attached dom anymore , there no reference pointing on widget. void removeall() { somepanel.clear(); } what happens widget , click handler. gwt garbage collection takes care of it? have save handler registration , remove click handler myself? one of advantages widget system manages of these memory issues you. provided combined widgets adding them other widgets (and never use getelement().appe

javascript - Cannot get right value from XML -

i have below xml <person> <age>10></age> <name>jason</name> <bankdetails> <bankname>wfc</bankname> <accountno>xxx</accountno> </bankdetails> <person> in code if try access person.bankdetails.bankname or other field in bankdetails structure getting undefined. how calling $value.bankdetails.bankname here $value being passed root , works fine other param not bankname , accountno try change bankname bankname on codes why giving undefined error try code <person> <age>10></age> <name>jason</name> <bankdetails> <bankname>wfc</bankname> <accountno>xxx</accountno> </bankdetails>

No post data with Ajax JQuery Json and Symfony 2 -

Image
i'm trying send data in json format via jquery ajax, seems impossible receive posted data de controller's action. here jquery/javascript code: $.ajax({ type: "post", url: "app_dev.php/ajax_save_contents", contenttype: 'application/json', data: {'data':'whatever'}, datatype: "json", success: function(data) { alert(data.ok); }, error: function(xmlhttprequest, textstatus, errorthrown) { alert('error : ' + errorthrown); } }); and symfony2 controller public function ajax_save_contentsaction(request $request) { if ($request->isxmlhttprequest()) { $r = array('ok'=>$_post); return new jsonresponse($r); } return new response('this not ajax!', 400); } this works fine, except because in controller don't have post data. things i've trie

html - Font coming out as Times New Roman in Older Browsers -

older browsers don't seem compute following css: .text { font: normal 10px arial; } when @ page in older browsers, text comes out times new roman. what best way declare font family , size recognized widest possible audience? now i'm not expert myself, font-family: attribute can declare s many fonts want (ie font-family: arial, 'times new roman', sans-serif; ) browser can go through list 1 one see if can run it. if not it'll go the next item on list. far fonts run on majority of browsers not same, main reason why put several fonts backup. can import other font styles web site. google fonts , example, provides wide range of styles can use. google font's provide link code import code. regarding older browsers don't know if feature works newer versions (since haven't had issue myself). 2 styles default no matter what, know of, sans-serif , serif . size text use font-size: attribute. feature can use percentages (text 2x size of

Rails: Could not find rake-10.1.1 in any of the sources -

i experiencing error running rake command. when try rake in rails project, error says could not find rake-10.1.1 in of sources . i put rake 10.1.1 in gemfile, appears nothing when bundle install. i've tried uninstalling installing rake gem in computer's ruby, rvm ruby-2.1.0, rvm ruby-2.1.0@global, , rvm gemset created specific project. i've tried removing gemfile.lock , bundle installing. i've tried manually run rake out of terminal in multiple different ruby/gems files including rvm. gives error: /users/me/.rvm/gems/ruby-2.1.0/gems/rake-10.1.1/bin/rake ; exit; ~ me$ /users/me/.rvm/gems/ruby-2.1.0/gems/rake-10.1.1/bin/rake ; exit; rake aborted! no rakefile found (looking for: rakefile, rakefile, rakefile.rb, rakefile.rb) i have rakefile in project , have tried renaming (rakefile.rb, rakefile). when run rake commands such rake db:migrate , error: rake aborted! undefined local variable or method config' main:object /users/me/railsproject/confi

java - How to execute multiple queries in teradata? -

for example query : create table ; select xxx ; delete ; how execute in 1 session ? i saw 1 answer similar question mysql. trick turn on allow multiple queries string dburl = "jdbc:mysql:///test?allowmultiqueries=true"; for teradata specifically, solution ? i tried string dburl = "jdbc:odbc:dsn?allowmultiqueries=true"; it not working ? you're looking multi statement request (msr). it's sending multiple sql statements server sepatarated semicolons. but can't mix ddl , dml in single msr because ddl must commited , msr treated transaction (when running in teradata session). try 2 seperate requests: create table ; select xxx ; delete ;

javascript - Try to implement shooting by bullets -

hello try implement shooting drawing bullets. created function shoot , called keyboard detection condition.... however, when press key shoot stopped , no shooting, no bullets....whats happening?! appreciated thanks. <html> <head> <title>spaceman invaders</title> <script> window.onload = function() { var posx = 20; var posy = 0; var go_right = true; var go_down = false; var canvas = document.getelementbyid("screen"); context = canvas.getcontext("2d"); context2 = canvas.getcontext("2d"); var alien = function(x, y) { this.x = x; this.y = y; this.posx = 30 + x*30; this.posy = 90 + y*30; this.go_right = true; this.go_down = false; } function player() { this.x=0, this.y = 0, this.w = 20, this.h = 20; this.render = function (){ context.fillstyle = "orange"; cont

sql - Nesting qualify statements in Teradata -

is possible "nest" qualify statements in teradata? i have data looks this: event_id = 1: user_id action_timestamp 971,134,265 17mar2010 20:16:56 739,071,748 17mar2010 22:19:59 919,853,934 18mar2010 15:47:49 919,853,934 18mar2010 15:55:21 919,853,934 18mar2010 16:01:20 919,853,934 18mar2010 16:01:48 919,853,934 18mar2010 16:04:52 472,665,603 20mar2010 18:23:58 472,665,603 20mar2010 18:24:07 472,665,603 20mar2010 18:24:26 .... event_id = 2: 971,134,265 17mar2069 20:16:56 739,071,748 17mar2069 22:19:59 919,853,934 18mar2069 15:47:49 919,853,934 18mar2069 15:55:21 919,853,934 18mar2069 16:01:20 919,853,934 18mar2069 16:01:48 919,853,934 18mar2069 16:04:52 472,665,603 20mar2069 18:23:58 472,665,603 20mar2069 18:24:07 472,665,603 20mar2069 18:24:26 for user 919,853,934, grab "18mar2010 16:04:52" action (the last 1 in first cluster of events). i tried this, not grab right date: sele

java - creating a method in using a (sum series) Write a method to compute the following series -

then output looks followed: m(i) 1 0.5 2 1.1667 ... 19 16.4023 20 17.3546 /** * write description of class fiveonethree here. * * @author (your name) * @version (a version number or date) */ public class homework { public static void main( string args[] ) { double value = 0; system.out.println("i" + "\t\t" + "m(i)"); system.out.println("-------------------"); for( int i=0; < 21; i++) { system.out.println( + " \t\t " + value + "\n" ); value += ((double) + 1)/(i+2); } } } i have output correct , everything, professor wants in method. find methods difficult, created simple loop. directions are: write method compute following series: 1/2+2/3.......+i/i+1 i'm guessing he/she wants method looks like public double th

Creating a python daemon -

i have script streams twitter, , catches real-time data it. data analyzed company work's products. the issue is, want script continuously run on server without having supervise it. have no idea how this, , whatever read on stackoverflow far has been complicated. can tell me basics of process of making daemon process in python, , how 1 go it? going through http://www.gavinj.net/2012/06/building-python-daemon-process.html , , tutorial,but opinion too. i made twitter client in python collect real time data, i set run on schedule, runs every 10 minutes prevent going on rate limit, i using mac osx , set "launchd" task run python script, you need create "plist" file configures run schedule, page help. http://launched.zerowidth.com/

c++ - Friend Classes: Cannot Access private members? -

i learning c++ friend classes. says on books , tuts, friend class can access members (private , protected) too. not happen in case. i know there's stupid error cannot see. please me find :d my code: #include <iostream> using namespace std; class a; class b { private: int num; public: b(int n=0):num(n){} friend int add(a, b); friend int mul(a, b); friend int sub(a, b); void showthis(a); friend class a; }; class a{ private: int num; public: a(int n=0):num(n){} friend int add(a, b); friend int mul(a, b); friend int sub(a, b); }; int add(a a, b b){ return a.num+b.num; } int sub(a a, b b){ return a.num-b.num; } int mul(a a, b b){ return a.num*b.num; } void b::showthis(a a){ cout<<a.num<<endl; } int main(){ a(3); b b(6); cout<<add(a,b)<<endl; cout<<mul(a,b)<<endl; cout<<sub(a,b)<<endl; b.showthis(a); } the error: q17.cpp:

c - Find executable that a core dump was generated against -

is there way embed version info such git commit hash in elf executable such can retrieved core dumps generated it? see this question git hash. then, change build procedure (e.g. makefile ) include it. instance, generate 1 line c file with git log --pretty=format:'const char program_git_hash[] = "%h";' \ -n 1 > _prog_hash.c then link program _prog_hash.c , remove file after linking. add timestamping information e.g. date +'const char program_timestamp="%c";%n' >> _prog_hash.c then use gdb or strings on binary executable find it. you may want declare extern const char program_git_hash[]; in header file, , perhaps display (e.g. when passing --version option program)

c# - What is exacly ms_nfp_launchargs in Windows Phone? -

if want run parameters of application write: navigationcontext.querystring.trygetvalue("ms_nfp_launchargs", out value); what exacly ms_nfp_launchargs ? defined? background of value? i know key, want know more. it used nfc functionality. allows pass parameters app when launching nfc tag. wp 8 translates parameters passed nfc tag special-purpose url parameter named ms_nfp_launchargs. can detect if app launched or launched nfc tag within onnavigatedto method of app's startup page. (test if navigationeventargs.uri contains "ms_nfp_launchargs")

c# - What is a NullReferenceException, and how do I fix it? -

i have code , when executes, throws nullreferenceexception , saying: object reference not set instance of object. what mean, , can fix error? what cause? bottom line you trying use null (or nothing in vb.net). means either set null , or never set @ all. like else, null gets passed around. if null in method "a", method "b" passed null to method "a". the rest of article goes more detail , shows mistakes many programmers make can lead nullreferenceexception . more specifically the runtime throwing nullreferenceexception always means same thing: trying use reference, , reference not initialized (or once initialized, no longer initialized). this means reference null , , cannot access members (such methods) through null reference. simplest case: string foo = null; foo.toupper(); this throw nullreferenceexception @ second line because can't call instance method toupper() on string reference pointing null .

Custom plugin with live templates not working in PHPStorm but does in Intellij IDEA? -

i've created basic plugin adds live-template / snippet phpstorm. i installed zipping files together, entering phpstorm > settings > plugins , clicking on "install plugin disk". after selecting correct zip file, appeared in plugins list, asked me restart , worked - or @ least that's thought! my issue is, when go settings > live template new livetemplate group doesn't show , when try , trigger live template using "test-tag" followed tab expands "" not expected behaviour. why happening?? https://github.com/jasonmortonnz/test-phpstorm-plugin note: strange thing though, when install plugin in intellij idea 13 works perfectly. live template group appears in settings , live templates trigger fine! why be? sooo frustrating :( please see http://confluence.jetbrains.com/display/ideadev/plugin+compatibility+with+intellij+platform+products on how make plugin compatible other ides based on intellij platform.

css - Child Div Percentage of Parent Div -

i trying tocreate fixed position nav bar 25% of container div, reason, nav bar being sized @ 25% of viewport , i'm not sure how fix it. i've replicated issue in jsfiddle: http://jsfiddle.net/g6yjg/1/ edit: although changing positioning of nav div fixed absolute fixes size problem, causes navigation not able scroll page. there work around allow me fix position nav , still have 25% of parent container? here code: html: <div class="container"> <nav> <ul> <li><a href="index.html">home</a></li> <li><a href="#">coffee menu</a></li> <li><a href="#">locations</a></li> <li><a href="#">about</a></li> </ul> </nav> <section class="main">

java - Input Mismatch Exception error -

i'm getting input mismatch error i'm not sure why. working on different computer seems not working on laptop.at first thought might txt file not reason. import java.io.*; import java.util.*; public class findgrade { public static final int num_score_types = 5; public static void main(string[] args) { scanner scan = null; int[] quizarray = null; int[] labarray = null; int[] attendance = null; int[] midterms = null; int quizgrade =0; int labgrade=0; int attendance_1=0; int midterms_1 =0; string name; try { scan = new scanner(new file("input.txt")); } catch (filenotfoundexception e) { e.printstacktrace(); return; } // each iteration single exam type (ie: quizzes 1st one) (int = 0; < num_score_types; i++) { name = scan.next(); int numscores = scan.nextint(); int maxgrade = scan.nextint(); if (name.equals("quizzes")

build.gradle - Android Gradle Issue -

i know there 100's of questions/answers around topic, none of them seem give me answer. know some(if not all) of problems around lack of understanding of gradle in general. but, i'm hoping help. i've got project working fine on desktop. i'm traveling week, , wanted work on over laptop. have files, , have same version of android studio on both machines. kept getting kinds of gradle errors when opening project. think i've went on several wild goose chases @ point. so decided step , create new blank project in studio. has kinds of gradle issues. tried uninstalling android studio , re-insatlling, , still no dice getting basic project not give gradle errors. i getting 11:12:27 pm gradle 'myapplication' project refresh failed: fatal exception has occurred. program exit. : gradle settings as error. below 2 gradle files. top level file(which blank in actual project, has in in default one) // top-level build

php - x-editable does not allow zero as valid value -

i trying insert '0' value in x-editable, keep getting 400 bad request. did var_dump , used console debug, not figure out modify script allow '0' valid value. keep in mind value other zero, valid... here's have far: array(3) { ["name"]=> string(4) "qnty" ["value"]=> string(1) "0" ["pk"]=> string(1) "5" } request method:post status code:400 bad request name:qnty value:0 pk:6

Jquery checking checkbox on click doesn't check it -

okay i'm using supersimple code check checkboxes. have invisible ahref on elements , checkbox next them. here's html: <a href="#" class="transparent-checkbox-thingy" id="<?php echo $id;?>" onclick="check(<?php echo $id;?>)"></a> <input type="checkbox" value="<?php echo $id;?>" name="users[]" class="newconvo-check" id="<?php echo $id;?>"> so i've tried using method, check() function , input tags have same id, using following jq: function check(id) { var newid = '#'+id; $(newid).prop('checked', true); }; or 1 function check(id) { $('#' + id).prop('checked', true); }; or one function check(id) { $(id).prop('checked', true); }; none of them work. return valid info on alert(id) or alert(newid) don't check damned checkbox. tried one: $(document).ready(function() {

aix - Why might "--enable-load-relative" not work for a ruby install? -

i need install ruby @ several sites, exact location of install may different between various sites. i configured , compiled using -enable-load-relative . seems work linux install not aix. when configured linux used --enable-load-relative --prefix=blah --exec-prefix=blah/linux_code_rel i able test relative loading doing following: first install dir named linux_code_rel blah/linux_code_rel/bin/ruby -e " puts 'hello' " then after renaming directory linux_code, ran blah/linux_code/bin/ruby -e " puts 'hello' " both times got hello when did same thing aix, not seem work. configured , installed using --enable-load-relative --prefix=blah --exec-prefix=blah/aix_code_rel after installing if run blah/aix_code_rel/bin/ruby -e "puts 'hello' " i back hello if rename aix_code_rel aix_code , run blah/aix_code/bin/ruby -e "puts 'hello' " i get <internal:gem_prelude>:1:in `require'

java - How to filter xml nodes based on filter in xpath -

i have xml need apply filter filter out nodes . filter criteria sent client via request xml using xpath notation ie. objectdata[vdata[@destcode = beanr0170100497]] when reply client need filter , send above data. can jaxb or other simple parser ? sample highly appreciate. xpath built default api, example... documentbuilderfactory dbf = documentbuilderfactory.newinstance(); document doc = dbf.newdocumentbuilder().parse(...); xpathfactory xf = xpathfactory.newinstance(); xpath xpath = xf.newxpath(); string query = ... xpathexpression xexp = xpath.compile(query); nodelist nl = (nodelist) xexp.evaluate(doc, xpathconstants.nodeset); (int index = 0; index < nl.getlength(); index++) { node node = nl.item(index); system.out.println(node.gettextcontent()); }

c++ - Is there a better way to rewrite this ugly switch and if statement combination? -

essentially have system of gamma detectors segmented 4 crystals each, in case when 2 of of crystals register hit can determine if pair perpendicular or parallel plane of reaction generating gamma-ray. in process of writing logic wound writing huge , ugly combination of switch statements in each detector checks combinations of crystal numbers (which unique across whole array of detectors , crystals). here code, including function in question. //the parallel , perpendicular designations used in addition double //designation 90 degree detectors if diagonal scatter in detectors //then use double designation enum scattertype{single, double, triple, quadruple, parallel, perpendicular}; scattertype eventbuffer::checkdoublegamma(int det) { int num1=evlist[cryslist[0]].crystalnum; int num2=evlist[cryslist[1]].crystalnum; switch(det) { case 10: //first of 90 degree detectors if( (num1==40 && num2==41) || //combo 1 (num1==41 && num2=

ios - How can i add UIViewController after splash screen in phonegap project? -

Image
i have created 1 phonegap ios project.in after splash screen loading index.html file. add 1 introduction viewcontroller below image after splash screen , user have option close introduction viewcontroller can see index.html file. is there anyway add uiviewcontroller file before loading index.html ?? eg: splash screen --> introduction viewcontroller --> index.html go classes >> appdelegate.m file replace didfinishlaunchingwithoptions function code - (bool)application:(uiapplication*)application didfinishlaunchingwithoptions:(nsdictionary*)launchoptions { cgrect screenbounds = [[uiscreen mainscreen] bounds]; self.window = [[[uiwindow alloc] initwithframe:screenbounds] autorelease]; self.window.autoresizessubviews = yes; self.viewcontroller = [[[mainviewcontroller alloc] init] autorelease]; self.viewcontroller.usesplashscreen = yes; uiviewcontroller *mycontroller = [[uiviewcontroller alloc] init]; uiview *myview = [[uiview alloc] initwithframe:

angularjs - AngularUI dropdown toggle has duplicates -

why there duplicate names in dropdown list? how turn dropdown toggle dropdown button without having black bullet on left http://test.shibagames.com/ here's code: <!doctype html> <html ng-app="plunker"> <head> <meta charset="utf-8" /> <title>angularjs plunker</title> <link data-require="bootstrap-css@3.0.3" data-semver="3.0.3" rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" /> <script>document.write('<base href="' + document.location + '" />');</script> <link rel="stylesheet" href="style.css" /> <script data-require="angular.js@1.2.x" src="http://code.angularjs.org/1.2.10/angular.js" data-semver="1.2.10"></script> <link rel="stylesheet" type="text/css" href="cs

angularjs - Angular - Form Validation Custom Directive, how to pass result to another element for the error display? -

so i'm building myself new directive form validation , got working except 1 thing believe not coded. know form validation directive validate <input ngx-validation="alpha"> how pass error text, occurs inside directive other element (a bootstrap <span class="text-danger">{{ validation_errors["input1"] }}</span> right below input? moment, created scope variable exist inside controller , work...until user forgets create actual variable... how suppose share information 1 element another? way, variable array holding input error messages... here code @ moment: <!-- html form --> <input type="text" class="form-control" name="input1" ng-model="form1.input1" ngx-validation="alpha|min_len:3|required" /> <span class="validation text-danger">{{ validation_errors["input1"] }}</span> js code // controller myapp.controller('ctrl', ['

Not ableto migrate from eclipse 3.x to eclipse 4.x -

we've rcp application based on 3.x api trying migrate eclipse 4.x. problem some part of code using eclipse internal classes present in workbench.jar . added workbench.jar jar previous eclipse(helios) new eclipse(kepler) resolved errors .but application not able start.so wanted know correct approach 1. can have 2 workbench.jar jars(3.105 , 3.6) in application . 2.if no there way search internal classes using in new jars using internal classes related layout , prespectives(like : org.eclise.ui.internal.layyoutpart ,org.eclipse.internal.ui.perspectives ) 3. is there way using can avoid rewriting code . eclipse 4.x substantial rewrite there little chance internal classes 3.x going work. multiple workbench jars not going work in case. the layout , perspective classes mention not exist in eclipse 4.x, going have rewrite code. see eclipse api rules of engagement

android - Use Facebook credentials to log my application -

Image
i want add log in facebook button application. tried follow guide. getting started facebook sdk android i tried android key hash. couldn't run on pc cmd. this code tried. i added home path %homepath% . keytool -exportcert -alias androiddebugkey -keystore %homepath%\.android\debug.keystore | openssl sha1 -binary | openssl base64 but shows error. can me fix error. firstly download openssl a link second extract local disk c: name openssl i.e folder name third set in environment variables. procedure follows right click on my computer->properties->advanced->environment variables under system variables->click on path , click edit now insert ';' semi-colon , paste path of folder openssl. ok. now u can see openssl recognized command in cmd. to keyhash execute follwing cmd keytool -exportcert -alias androiddebugkey -keystore "path of ur debug.keystore" | "c:\openssl\bin\openssl.exe" sha1 -binary | "c:\op

c++ - How to execute a cmd command using QProcess? -

i attempting execute cmd command using qprocess::startdetached("cmd /c net stop \"myservice\""); this not seem stop service. however, if run start >> run, works. qprocess::startdetached take first parameter command execute , following parameters, delimited space, interpreted separate arguments command. therefore, in case: - qprocess::startdetached("cmd /c net stop \"myservice\""); the function sees cmd command , passes /c, net, stop , "myservice" arguments cmd. however, other /c, others parsed separately , not valid arguments. what need use quotes around "net stop \"myservice\" pass single argument, give you: - qprocess::startdetached("cmd /c \"net stop \"myservice\"\""); alternatively, using string list use: - qprocess::startdetached("cmd", qstringlist() << "/c" << "net stop \"myservice\"");

java - how to send arraylist<hashmap<string, string>> value from fragmentactivity to fragment for listview -

please me this.. please tell me how send arraylist> value fragmentactivity fragment value have create listview using simple adapter.. before have send value activity fragmentactivity using putextra(string, serializable) fetching in fragmentactivity using getintent.getserializable extra..but after don't know hwo use value fragment list view.. this mainactivity sending value @override protected void onpostexecute(void result) { // todo auto-generated method stub super.onpostexecute(result); progress.dismiss(); intent = new intent(mainactivity.this, pager.class); i.putextra("datalist", datatlist); //toast.maketext(getapplicationcontext(), "bundle value" +datatlist, toast.length_long).show(); startactivity(i); this pager extends fragmentactivity intent intent = getintent(); data = (arraylist<hashmap<string, string>>) intent.getserializableextra("datalist"); toa

java - Android Support Library troubles with v7 appcompat using Eclipse -

new forums! :) looking forward participating here ;) in mean while, stuck! have ran sdk manager , have been date. my program runs fine, when add in support 7 appcompat doesn't sit well. here here! have spent 2 days trying fix this:p all want app compat halo themes lol app run on pretty android versions in advance guys & gals i had put picture links in pastebin because allowed 2 links because have no rep! :) http://pastebin.com/yfxznv8u 1 addition picture show package explorer -> http://gyazo.com/b46ac98bacfbd051ecc1a2b3250bd68b all alrighty fixed problem! not answer own question because not enough rep! well fixed finally! enough research :) all did changed target api in project.properties 7 19 , volla! well fixed finally! enough research :) giving on support library v7. did wrong? all did changed target api in project.properties 7 19 , volla!

Pull dynamic content from jQuery load div iframe -

how can pull dynamic content page's div of same domain using jquery load function $(document).ready(function(){ $( "#bres" ).load( "http://www.mydomain.com/front-desk #b_col" ); }); <div id="bres"></div> http://www.mydomain.com/front-desk page this not working, there anyway how can achieve this? tried few years ago worked not not working.

JQuery DatePicker widget showing next, previous png image icons as well as "Next" "Prev" text overlapping those icons -

inspite of referencing required .js , .css file along script tag code required in .aspx page below, <link href="../styles/jquery.ui.all.css" rel="stylesheet" type="text/css" /> <link href="../styles/jquery.ui.datepicker.css" rel="stylesheet" type="text/css" /> <link href="../styles/jquery.ui.theme.css" rel="stylesheet" type="text/css" /> <link href="../styles/jquery.ui.base.css" rel="stylesheet" type="text/css" /> <script src="../scripts/1.7.2.jquery.min.js" type="text/javascript"></script> <script src="../scripts/jquery-1.11.0.min.js" type="text/javascript"></script> <script src="../scripts/jquery.min.js" type="text/javascript"></script> <script src="../scripts/jquery-1.9.1.js" type="text/javasc

javascript - Can't pass data and image into handler .ashx -

i have piece of code sends image , coordinates of cropped image ashx handler. but can't read in handler. error: value cannot null. parameter name: path jquery: var pic = new formdata(); jquery.each($("#user_photo")[0].files, function (i, file) { pic.append("file-" + i, file); }); var coords = { "c": { "x1": x1, "x2": x2, "y1": y1, "y2": y2, "w": w, "h": h } } coords = json.stringify(coords); pic.append("coordenates", coords); $.ajax({ url: "handler.ashx", type: "post", contenttype: false, processdata: false,

java - How to explicitly perform garbage collection -

with built-in garbage collection, java allows developers create new objects without worrying explicitly memory allocation , deallocation, because garbage collector automatically reclaims memory reuse. afaik garbage collector runs when app runs out of memory. holds graph represents links between objects , isolated objects can freed. though have system.gc() , if write system.gc() in code java vm may or may not decide @ runtime garbage collection @ pointas explained post system.gc() in java so having doubts regarding garbage collection process of java. i wonder if there such method in java free() such in c language, invoke when explicitly want free part of memory allocated new operator. also new performs same operation malloc() or calloc() ? are there alternates delete() , free() , malloc() , calloc() , sizeof() methods in java. afaik garbage collector runs when app runs out of memory. little disagree on that. no. runs asynchronously , collect