Posts

Oracle equivalent of stored procedure that returns an inline table? -

example in t-sql (sql server - taken here ): create proc proc_authors @au_lname varchar(40) select au_id, au_fname, au_lname, city, state authors au_lname = @au_lname go is possible in oracle create stored procedure returns inline table (without declaring type - above)? if not, closest alternative? i.e. declare inline type, use it. idea minimize number of db permissions granted. please include sample code part of answer. reasoning behind using stored procedure vs function - have legacy software can execute stored procedures, or raw queries. appears stored procedures in there have support parameterized execution, after. try ref cursor procedure proc_get_tada(ip_user in varchar2, op_error_code out number, op_cursor out sys_refcursor,) begin open op_cursor select * your_table yt yt.user = ip_user; exception when others op_error_code := -1; end proc_get_tada; you collection o...

android - InstanceId#getId() doesn't return stable Id -

according docs instanceid: provides unique identifier each app instance and instance id stable may become invalid, if: app deletes instance id device factory reset user uninstalls app user clears app data however testing, appears following call returns different id if app has been swiped recents. instanceid.getinstance(context).getid(); is bug in google play services or using plain wrong? 2 tymm answer: client library instance id code: boolean needrefreshtoken() { string appversion = ssharedpreferenceshelper.get("appversion"); if (appversion == null) { return true; } if (!appversion.equals(scurrentappversion)) { return true; } string lasttokenacquiringtime = ssharedpreferenceshelper.get("lasttoken"); if (lasttokenacquiringtime == null) { return true; } long l = long.parselong(lasttokenacquiringtime); i...

html - Strikethrough Element Without Going Over or Under Element -

Image
i want draw lines left , right of element edge of parent element. i'm not sure how describe otherwise, maybe screenshot trick: as can see, close perfect, , if put overflow: hidden; on heading, better, can't see nice rounded corners (red circled parts in screenshot) because it's cut-off. at moment, is, html: <div id="intropage" class="intropage"> <div class="test">heading</div> </div> where "intropage" gray part see. my css this: .intropage { position: relative; max-width: 1000px; margin: auto; padding-top: 50px; height: 100%; background: gray; } .test { position: relative; /* overflow: hidden; */ text-align: center; } .test:before, .test:after { content: ""; position: relative; background: #0099ff; height: 6px; display: inline-block; width: 50%; border-radius: 2px; } .test:before { right: 10px; margi...

Is it possible to generate a dll with android ndk for testing purposes? -

i developing app uses native library. test using non-android dependent framework robolectric. the problem is, native functionality cannot loaded using system.loadlibrary("mylib"); because on windows looks "mylib.dll", , able build libmylib.so not compatible windows. is there way build dll (it used testing purposes ofc)? if want test application on windows, need *.dll. *.so files unix "shared libraries" - same functionality windows' dll. have build c++ sources ide visual studio, code blocks, or else can build sources windows. in fact, when building "ndk-build" android, cross-compiling unix system arm architecture mostly. when running on windows, you'll on x86 / x86_64.

android - Trying to send a Hashmap array with web service -

i'm trying send array contains hashmap <string,object> using web service in android, i'm having exception says "can not serialize hashmap", hope me guys. in advance! here web service class below: public class adduser { string namespace = "the name space"; private string url = "the url"; string soap_action; soapobject request; soapserializationenvelope envelope; androidhttptransport androidhttptransport; adduser() { } //set envelope protected void setenvelope() { try { envelope = new soapserializationenvelope(soapenvelope.ver11); envelope.dotnet = true; envelope.setoutputsoapobject(request); androidhttptransport = new androidhttptransport(url); androidhttptransport.debug = true; } catch (exception e) { system.out.println("soap exception---->>>" + e.tostring()); } } public string setficheuser(string methodname,object full_tab) { try { so...

datetime - Python timestamps with time() -

i have few timestamps in database trim down 10 timestamps, latest oldest. timestamps in db made using time() in python. create timestamp: _timestamp = time.time() timestamps: 1435652632.92778 1435652633.01 1435652633.07 1435652633.13 1435652642.71371 1435652642.77 1435652675.13 1435652675.22 1435652717.74 1435652735.11 1435652735.16 1435652735.24 how can ask python remove oldest timestamp? i convert timestamp readable format using below string in script. print datetime.datetime.fromtimestamp(1434615010.27858) >>2015-06-18 08:10:10.278580 i have no code yet remove oldest timestamps, appreciate please. this epoch timestamp seconds passed since 1970-01-01t00:00:00z. in case, sort timestmaps , take 10 top elements. timestmaps = [1435652632.92778, 1435652633.01, 1435652633.07] timestmaps.sort(reverse=true) latesttimestamps = timestmaps[:10]

java - Could not parse configuration: hibernate.cfg.xml caused by org.dom4j.DocumentException: Error on line 2 of document -

i not hibernate , have following problem trying follow tutorial. using hibernate 4 so have client class named helloworldclient : public class helloworldclient { public static void main(string[] args) { session session = hibernateutil.getsessionfactory().opensession(); session.begintransaction(); message message = new message( "hello world hibernate & jpa annotations" ); session.save(message); session.gettransaction().commit(); session.close(); } } as can see class use hibernateutil retrieve hibernate session object, one: public class hibernateutil { private static final sessionfactory sessionfactory = buildsessionfactory(); private static sessionfactory buildsessionfactory() { try { // create sessionfactory hibernate.cfg.xml configuration configuration = new configuration().configure("hiber...