Posts

java - QueryDSL - Sum where a join is involed -

given following classes: class user { @onetomany set<transaction> transactions } class transaction { bigdecimal money; } i'm stumped how perform aggregate, functions don't appear available on following query: quser $user = quser.user; qtransaction $transaction = qtransaction.transaction; query().from($user) .innerjoint($user.transactions, $transaction) .where($user.eq(myuser)) // what? as bonus -- possible if money persisted joda money type, rather bigdecimal? (i'm using usertype's joda money support facilitate persistence) something should work quser $user = quser.user; qtransaction $transaction = qtransaction.transaction; query().from($user) .innerjoint($user.transactions, $transaction) .where($user.eq(myuser)) .singleresult($transaction.money.sum()); querydsl doesn't have (yet) direct support joda money, using joda money sum() method won't available directly.

c# - ObjectQuery, passing Time in Where clause -

how can construct clause of objectquery querying time part of datetime column? i've tried following it's not working. invalid exception on convert. objectquery<item> _query = itementities.createquery<item>("item"); _query = _query.where("convert(varchar,it.start_time,114) > '{0}'", starttime.timeofday); also, i'm using oracle database. tried to_char instead of convert , still same error. thanks. you should able time portion date using to_char , subsequently converting system type e.g. to_date(to_char(it.start_time,'hh24:mi:ss'), 'hh24:mi:ss') dual if objectquery doesn't support to_char try using extract , build time manually e.g. to_date(extract(hour it.start_time) || ':' || extract(minute it.start_time) || ':' || extract(second it.start_time) dual, 'hh24:mi:ss');

java - Get Active Shell in SWT, even if the Shell is not on focus -

display.getactiveshell() seems consider shell active if it's focused. if @ moment application has focus means display.getactiveshell() returns null . i need method tell me shell on focus on swt application, when swt application not on focus. i've hacked piece of code together, although assertionexception : public static shell getactiveshell() { display display = display.getdefault(); shell result = display.getactiveshell(); if (result == null) { shell[] shells = display.getshells(); (shell shell : shells) { if (shell.getshells().length == 0) { if (result != null) throw new assertionexception(); result = shell; } } } return result; } is there standard way approach issue other writing own method? recently, had similar problem , though found solution in meanwhile i'd share mine future reference. the shellactivationtracker adds disp...

android - PhoneGap Connection Error -

am working on android using jquerymobile , phonegap. i left app idle on screen, found "application error" when picked again. said connection server unsuccessful. had force close app in order open again. i mentioned code in activity: super.setintegerproperty("loadurltimeoutvalue", 60000); but still problem exists! use bigger value 60sec, emulator can extremely slow. super.setintegerproperty("loadurltimeoutvalue", 360000); i have laptop i5 processor , requires more 60sec sometimes.

database - Linq DataContext.CreateDatabase() force SQL Server 2005 -

i'm using linq datacontext.createdatabase() generate database. it's generating sql server 2008 database. know if it's possible make createdatabase() generate sql server 2005 database? thank you i did quick check of datacontext object in visual studio , doesn't appear sql version specific. assume if point datacontext object @ sql 2005 instance create database fine on sql 2005.

css - How to show content under a left-sided bootstrap tab -

Image
i'm using bootstrap show left-sided tabs, , nice if show content under tabs. my html looks this: <div class="tabbable tabs-left"> <ul class="nav nav-tabs"> <li class="active"><a href="#">tab 1</a></li> <li><a href="#">tab 2</a></li> <li><a href="#">tab 3</a></li> <li><a href="#">tab 4</a></li> </ul> <div class="tab-content"> tab content </div> </div> screenshot: you add li bottom of nav-tabs ul : <ul class="nav nav-tabs"> <li class="active"><a href="#tab1" data-toggle="tab">tab 1</a></li> <li><a href="#tab2" data-toggle="tab">tab 2</a></li> <li><a href="#tab3...

iphone - ios - How to decode XML document? -

this question has answer here: parsing local xml file in ios sdk 1 answer i'm new iphone development,i'm trying access token google,when logged in,i'm getting html content,in html content want token contained in binarysecuritytoken node. how in below html content? <head> <title>working...</title> </head> <body> <form method="post" name="hiddenform" action="http://localhost:26298/loginsuccess.aspx"> <input type="hidden" name="wa" value="wsignin1.0" /> <input type="hidden" name="wresult" value="<t:requestsecuritytokenresponse xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust"> <t:lifetime><wsu:created xmlns:wsu="http://docs.oa...