Posts

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...