Posts

Showing posts from July, 2010

android - How do you control Eclipse's generated Bluetooth java files? -

i've got android project built under eclipse-indigo works fine. copied many of files , rebuilt under eclipse-juno. app runs if install and/or run eclipse, if try generate apk, get: conversion dalvik format failed: unable execute dex: multiple dex file define landroid/bluetooth/ibluetooth; comparing directories shows src/android.bluetooth/ibluetooth.aidl , ibluetoothcallback.aidl identical, gen/android.bluetooth exists in working version not broken one. replacing these files manually makes eclipse whine, of course, question is: how control how eclipse generates particular files aidl inputs? alternatively, if has intelligent suggestion how rid of stupid error, i'll take instead :-) the answer not install android development kit, seems have borked libraries. instead, install eclipse java developers, , install android sdk separately. allowed correct libraries appear, , didn't give stupid errors duplicate dex files.

java - Does the sum of numbers depend on the sequence in which they are added? -

it intuition far sum set of numbers independent of order in added. in following, set of random numbers determined seed=0, sequence determined order of execution in threads. i use sum of large number doubles multi-threaded computation checksum. there way find rounding scheme sum maximally sensitive constituent numbers in sum, insensitive particular random sequence of additions? import java.io.ioexception; import java.util.arraylist; import java.util.random; import java.util.concurrent.callable; import java.util.concurrent.executionexception; import java.util.concurrent.executorservice; import java.util.concurrent.executors; import java.util.concurrent.future; public class test implements callable<double> { public static class sum { double sum = 0; public synchronized void add(double val) { sum += val; } public double getsum() { return sum; } }; sum sum; public test(sum sum) { this...

objective c - get property from id class -

abc *abc=[abc new]; id property=abc.property; but: id classname=nsclassfromstring(abc); id instance=[classname new]; id property=???????; i can't use instance.property,because id type. i want known property (id)type class. i try use: [ainstanse propertyforkey:<#(nsstring *)#>]; [ainstanse propertynamed:<#(nsstring *)#>]; but program crashes... can me, thanks. there many ways you can cast if know type @ compile time id property=((myclass *)instance).myproperty; ((myclass *)instance).myproperty = property; or not using dot syntax id property=[instance myproperty]; [instance setmyproperty:property]; or using valueforkey: id property=[instance valueforkey:@"myproperty"]; [instance setvalue:property forkey:@"myproperty"];

jquery - Button Not Responding On Click To Remove Element -

i'm backend developer , don't on front end, have major project responsible end end. such, i'm trying use twitter bootstrap , jquery finding myself stuck when trying remove list item created using jquery. feel missing obvious can't figure out is. here code, remove order section 1 doesn't when button clicked -- nothing @ seems happen: edit: couldn't jsfiddle play nice, i've added html here code. either inline (as test file) or called via cdn. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title> </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <!-- le styles --> <!-- html5 shim, ie6-8 sup...

tomcat - Cross-domain sharing session on Tomcat6.0.20 -

i had answers on web. got answer adds these segments in context.xml : <context sessioncookiedomain=".example.com" sessioncookiepath="/"> but unfortunately isn't applicable tomcat version, tell me how can this? you can check these links out , see if these help: best way allowing subdomain session cookies using tomcat http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

ios - Increase maximum zoom *out* of MKMapView in iPhone/iPad -

i'm having trouble getting mkmapview zoom far enough out (i need see every continent i.e. entire world in 1 mkmapview ) on iphone/ipad. maximum "out" zoom seems hard limited. there known way increase or remove limit? refer following link, http://troybrant.net/blog/2010/01/set-the-zoom-level-of-an-mkmapview/ , use like, [mapview setcentercoordinate:mycoord zoomlevel:24 animated:yes]; this allow show whole map on mkmapview according concept ( http://troybrant.net/blog/2010/01/mkmapview-and-zoom-levels-a-visual-guide/ )

sql - How to pull out certain value using php and this output -

i've come across weird scenario not know how code around. i'm creating json api wordpress site. i'm using connections plugin , trying pull out "original" image filename. output of sql command this: { ["options"]=> string(396) "a:4:{s:5:"entry";a:1:{s:4:"type";s:12:"organization";}s:5:"group";a:1:{s:6:"family";a:0:{}}s:4:"logo";a:2:{s:6:"linked";b:0;s:7:"display";b:0;}s:5:"image";a:3:{s:6:"linked";b:1;s:7:"display";b:1;s:4:"name";a:4:{s:9:"thumbnail";s:25:"invoicelogo_thumbnail.jpg";s:5:"entry";s:21:"invoicelogo_entry.jpg";s:7:"profile";s:23:"invoicelogo_profile.jpg";s:8:"original";s:24:"invoicelogo_original.jpg";}}}" } } i'm using following command acquire that: querystr = "select options {$wpdb->prefix}connection...

sql - Parsing error in DATEDIFF php -

below sql query in php. select * tbl_players datediff( day , now( ) , i.firstlogintime ) <1 limit 0 , 30 firstlogintime field in sql table has value of datetime. i want data inserted before 1 day. it gives me error: #1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near ' i.firstlogintime) &lt; 1 limit 0, 30' @ line 3 thanks help. as per knowledge, datediff function in mysql takes 2 arguments, can check on link and referring sql-server right takes 3 arguments in mysql not. so if write follow, won't give error select * tbl_players datediff( now( ) , i.firstlogintime ) <1 limit 0 , 30

c# - Build UpdateCommand for DataAdapter with some parsing applied to the SourceColumn? -

at first, i'll show standard way build custom updatecommand dataadapter (used commonly when select has many tables involved , can't use commandbuilder build commands automatically dataadapter ). here code dataadapter: sqldataadapter myadapter = new sqldataadapter("select id, name mytable", myconnection); here code building standard updatecommand myadapter . example above involves 1 single table, however, that's simple , demonstrative purpose. myadapter.updatecommand = new sqlcommand("update mytable set id=@id,name=@name id=@id2", myconnection); myadapter.updatecommand.parameters.add("id", sqldbtype.varchar).sourcecolumn = "id"; myadapter.updatecommand.parameters.add("name", sqldbtype.varchar).sourcecolumn = "name"; myadapter.updatecommand.parameters.add("id2", sqldbtype.varchar, 20, "id").sourceversion = datarowversion.original; the problem don't want bind the parameter so...

eclipse - Android Alarm not differentiate in AM And PM -

i developing multi time android alarm app in first step have problem not differentiate in , pm don't know wrong in code. below mainactivity class code in have problem getting time alarm time-picker. button start; timepicker timep; textview tv; edittext et; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); start = (button) findviewbyid(r.id.button1); timep = (timepicker) findviewbyid(r.id.timepicker1); et = (edittext) findviewbyid(r.id.edittext1); tv = (textview) findviewbyid(r.id.tex); // tv.settext(""+system.currenttimemillis()+20000); start.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { // todo auto-generated method stub string messg = et.gettext().tostring(); calendar time = calendar.getinstance(); time.set(calendar.hour, timep.getc...

objective c - NSMenu Not connecting method of another class -

-(void)rightmousedown:(nsevent *)theevent { cvcont = [[collectionviweitemsubclass alloc] init ]; nsmenu * m = [[nsmenu alloc] init]; //[cvcont openinfinder];----perfectly working------ [self settarget:cvcont]; [m additemwithtitle:@"show in finder" action:@selector(openinfinder) keyequivalent:@""];// not working----- [nsmenu popupcontextmenu:m withevent:theevent forview:self]; } i subclassed button , calling method class collectionviweitemsubclass . if calling working. method not connected via nsmenu . below code method class collectionviewitemsubclass -(void)openinfinder { nsstring *savedvalue = [[nsuserdefaults standarduserdefaults] stringforkey:@"filepath"]; [[nsworkspace sharedworkspace] selectfile:savedvalue infileviewerrootedatpath:nil]; }

java - no data in google charts line chart -

ajaxpost(action, "getdata", params, function(data) { var response = toobject(data).response; var chartdata = new google.visualization.datatable(); var array = []; for(var = 0; < response.occdata.length; i++){ var data = []; for(var j = 1; j < 32; j++){ array.push(response.occdata[i].daylist[j]); } chartdata.addcolumn("string",array); } new google.visualization.linechart(document.getelementbyid('chart_div')). draw(chartdata, {vaxes:[ {title: 'title 1', titletextstyle: {color: '#ff0000'}}, // left axis {title: 'title 2', titletextstyle: {color: '#ff0000'}} // right axis ],series:[ {targetaxisindex:1}, {targetaxisindex:0} ],curvetype: "function",width: 700, height: 240}); $("#" + "chart_div").fadein(2000); }); i'm using above code draw line chart! c...

java - Trying to understand following code for reversing a sentence -

please consider code below: public class sentencereversal { /** * @param args */ public static void main(string[] args) { string[] parts = "this interview question".split("\\b"); stringbuilder sb = new stringbuilder(); (int = parts.length; --> 0 ;) { sb.append(parts[i]); } system.out.println("[" + sb.tostring() + "]"); } } what "\b" doing in split function? removing producing following result(that means using split("")): [noitseuq weivretni na si siht] also, `-->' operator doing in loop? didn't quite understand. please me in understanding questions. thanks string.split() splits string based on regular expression. \b regex expression , denotes word boundary i.e. start of line, end of line, space, punctuation marks etc. it's passed \\b because java needs \ escaped \ . when split() "" you're s...

api - get active textview or activity using IME android -

im developing ime android. want activity or textview control information while using ime program. hwnd property in win32 api or sender property of focused control in .net . is there possible api available? sorry poor english. thanks. sha is there possible api available? no, because "the activity or textview control" in process, not process.

c++ - How to draw a line at angle in QT? -

i have co-ordinate , angle. want draw line co-ordinate upto length specified angle. how can achieve this?? can give idea? arthur's way of computing angle correct, actually, qt provides built-in methods of drawing lines @ specific angles, in particular functions of qlinef class in qlinef header: #include <qlinef> void angledemo::paintevent(qpaintevent *) { qpainter painter(this); painter.setpen(qpen(qt::black,1)); /* create line object: */ qlinef angleline; /* set origin: */ angleline.setp1(qpointf(80,80)); /* set angle , length: */ angleline.setangle(45); angleline.setlength(50); /* draw line: */ painter.drawline(angleline); } from online documentation of setangle() function : sets angle of line given angle (in degrees). change position of second point of line such line has given angle. positive values angles mean counter-clockwise while negative values mean clockwise direction. zero degrees @ 3 o'clock posi...

jquery - cannot view calendar in HTML table -

i have html table, contains startdate , enddate . want show calendar select date while clicking text boxes. select date calendar selected date display in text box. used following code. not working , not showing errors. problem code? modification need in code? or best way view calendar view in field? <!doctype html> <html> <body> <script src="http://localhost/js/jquery.js"></script> <script src="http://localhost/js/jqueryui.js"></script> <script> function calendar1(){ $( "#startdate" ).datepicker(); } </script> <table id='tblappend' bgcolor='#d2dfef'><col width='170'><col width='30'><tr><td>portfolio name:</td><td><input type='text' name='name'></td></tr> <tr><td>start date</td><td><input type='text' name='startdate' onclick='cal...

vb.net - iterate through every xml node and append node and value to string -

i have following xml format,which kml file google map.. <kml xmlns="http://www.opengis.net/kml/2.2"> <document> <name>testdoc</name> <style id="style1"> <polystyle> <fill>0</fill> </polystyle> </style> <folder> <name>folder1</name> <placemark> <name>placemark1folder1</name> <lookat> <longitude>-122.0839597145766</longitude> <latitude>37.42222904525232</latitude> </lookat> </placemark> <placemark> <name>placemark2folder1</name> <lookat> <longitude>-101.083959</longitude> <lat...

ios - Does this type casting assign the address or the data? -

cell of type uitableviewcell* locationcell *locationcell = (locationcell *)cell; is assigning address of cell locationcell , preserving same instance of object? equal locationcell *locationcell = &cell ? if cell variable of type locationcell * there no need cast. if cell type (such uitableviewcell * ), cast 1 thing - tells compiler know better. know object type , not type indicated variable's declaration. the value isn't changed in way. in words, yes, preserving same instance of object. not @ last sentence.

android - Sudoku crashes when 'about' button is clicked -

hi new android , have been trying simple sudoku application. facing problem now,whenever click "about" button applocation tends stop , takes me menu screen. can suggest problem crash?? below here code: sudoku.java public class sudoku extends activity implements onclicklistener { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_sudoku); view continuebutton=findviewbyid(r.id.button1); continuebutton.setonclicklistener(this); view newbutton=findviewbyid(r.id.button2); newbutton.setonclicklistener(this); view aboutbutton=findviewbyid(r.id.button3); aboutbutton.setonclicklistener(this); view exitbutton=findviewbyid(r.id.button4); exitbutton.setonclicklistener(this); } public void onclick(view v){ switch(v.getid()){ case r.id.button3: intent = new intent(this, about.class); startactivity(i); ...

css - Do I need to specify each link color state? -

i'm using following pseudo classes: a.recentposttitle:link,a.recentposttitle:visited {color:#000;} a.recentposttitle:hover {color:#56a49f;} a.recentposttitle:active {color:#000;} do need explicit or there more compressed way same result? no, there no shorthand. selectors can be: a {} to select links , or: .recentposttitle {} to .recentposttitle elements (we know links already). and thing, :link not needed really, can write: a {} a:visited {} a:hover {} a:active {} when write a {} , set declaration possible situations, so: a {} is identical to: a:link, a:visited, a:hover, a:active {} and remember, order of pseudo classes importent: : l ink : v isited : h over : a ctive or remember l o v e ha te.

asp.net - how to bind values from database to gridview? -

i new asp.net.plz me. i have gridview 2 columns named-property(template field) , value(template field). need bind property column(ie,gridview- item template(label)) database table 'properties'.properties table fields id , propertyname. how can bind them?? protected void page_load(object sender, eventargs e) { if (!ispostback) { bindview(); } datatable dt1 = new datatable(); sqldataadapter da1 = new sqldataadapter("select id,typename producttypes", con); da1.fill(dt1); dropdownlist1.datasource = dt1; dropdownlist1.datavaluefield = "id"; dropdownlist1.datatextfield = "typename"; dropdownlist1.databind(); } public void bindview() { datatable dt = new datatable(); string sql = "select * properties"; ...

java - How do I parse XML data with xmlbeans? -

i want parse xml data using xmlbeans , store objects,the following xml file, want parse it, have model want store data model objects, <?xml version="1.0" encoding="utf-8" ?> <data:events> <data:event> <data:name>test</data:name> <data:date>2013-05-20-04:00</data:date> <data:track> <data:name>test</data:name> <data:race> <data:racenumber>1</data:racenumber> <data:posttimedisplay>5:25 pm</data:posttimedisplay> <data:runner> <data:programnumber>1</data:programnumber> <data:ownername>user</data:ownername> </data:runner> <data:runner> <data:programnumber>7</data:programnumber> <data:ownernam...

smtp - Sending mail from javax.mail in android app -

i working on sending mail broadcast receiver using javax.mail . application sends mail when app running , in foreground. when move application background, error javax.mail.messagingexception: not connect smtp host: smtp.gmail.com, port: 587; java.net.connectexception: failed connect smtp.gmail.com/74.125.25.108 (port 587): connect failed: enetunreach (network unreachable) i have made sure broadcast receiver running in background. just little note, have had trouble doing internet based services broadcastreceiver in past. work 1 time, fail next. can simple slow 3g data or failed post. trouble broadcastreceiver gets aggressively shut down gc in cases , not meant long-running. things fail, or take long, or need retried (like sending email), consider rather starting service broadcastreceiver can continue retry , keepalive in event of failure. not essential, idea (in experience).

javascript - jquery validations not woking when ajax call is there -

i have js code validating form using jquery validations. , after calling ajax. $('.form').validate({ rules: { ---- } }); $('#submit').click(function() { $.ajax(url,{ data:data, success:onsuccess, error:onerror, type:post }); return false; }); onsuccess , onerror simple functions. url predefined but code not entering validations , directly calling ajax whatever might case. you should not bind click event on submit button. should place function on submithandler option of jquery validation. this $('.form').validate({ rules: { ---- }, submithandler: function(form){ //your code here.. } }); here's jquery validation docs better understand.

string - Java:jasper report remove trailing zeros -

i have report have used floor function result result gives out decimals 2.0 , want whole number 2 . this formula used result. floor(days(date(new integer($f{date_last_modified}.getyear()+1900),new integer($f{date_last_modified}.getmonth()+1),new integer($f{date_last_modified}.getdate())),date(2013,05,20))/7)+" "+"weeks "+days(date(new integer($f{date_last_modified}.getyear()+1900),new integer($f{date_last_modified}.getmonth()+1),new integer($f{date_last_modified}.getdate())),date(2013,05,20) ) % 7 +" "+"days"+" ago" just cast formula integer (int) yourformula then formula code (int) (floor(days(date(new integer($f{date_last_modified}.getyear()+1900),new integer($f{date_last_modified}.getmonth()+1),new integer($f{date_last_modified}.getdate())),date(2013,05,20))/7)+" "+"weeks "+days(date(new integer($f{date_last_modified}.getyear()+1900),new integer($f{date_last_modified}.getmonth()+1),n...

objective c - CLGeocoder returns error on iPhone but working on iPad and iPhone/iPad Simulator -

i'm using clgeocoder location of address. clgeocoder returns latitude , longtitude when code running in ipad device ios 5.1 , in iphone/ipad simulator. on contrary, when i'm running code in iphone 4 device ios 6.0.1, returns error message: pbrequester failed error error domain=nsurlerrordomain code=-1202 "the certificate server invalid. might connecting server pretending “gsp-ssl.ls.apple.com” put confidential information @ risk." userinfo=0x2287c720 {nserrorfailingurlstringkey= https://gsp-ssl.ls.apple.com/fwdgeo.arpc , nslocalizedrecoverysuggestion=would connect server anyway?, nserrorfailingurlkey= https://gsp-ssl.ls.apple.com/fwdgeo.arpc , nslocalizeddescription=the certificate server invalid. might connecting server pretending “gsp-ssl.ls.apple.com” put confidential information @ risk., nsunderlyingerror=0x22893b70 "the certificate server invalid. might connecting server pretending “gsp-ssl.ls.apple.com” put confidential ...

Cannot save all of the property settings for this Web Part - Sharepoint -

"cannot save of property settings web part. default namespace " http://schemas.microsoft.com/webpart/v2 " reserved namespace base web part properties. custom web part properties require unique namespace (specified through xmlelementattribute on property, or xmlrootattribute on class)." no regarding error. this when adding custom properties webpart, why cant save properties when edit webpart , click on save/apply? (then error) code-- [defaultproperty("text"), toolboxdata("<{0}:custompropertywebpart runat=server></{0}:custompropertywebpart>"), xmlroot(namespace = "executestoreproc")] public class custompropertywebpart : microsoft.sharepoint.webpartpages.webpart { const string c_mystringdefault = "sample string"; } // create custom category in property sheet. [category("custom properties")]...

objective c - iOS Using GLKMathUnproject to find screen point in world space -

how use glkmathunproject determine location in world space? user needs select 1 of several objects in world space. in doc says glkvector3 glkmathunproject ( glkvector3 window, glkmatrix4 model, glkmatrix4 projection, int *viewport, bool *success ); but modelview matrix? have bunch of models in world. model matrix should use. my world 2d, on x,y plane. z used camera movement. if understood correctly, glkmathunproject used find point in model space. how know model? need determine first model below fingers or what? - (ibaction)handletapunproject:(id)recognizer { bool success = no; glfloat realy; glint viewport[4] = {}; glgetintegerv(gl_viewport, viewport); nslog(@"%d, %d, %d, %d", viewport[0], viewport[1], viewport[2], viewport[3]); cgpoint touchorigin = [recognizer locationinview:self.view]; nslog(@"tap coordinates: %8.2f, %8.2f", touchorigin.x, touchorigin.y); realy = viewport[3] - touchori...

Android App not supported on many devices -

i cant find out why app not supported on many devices xperia z or samsung galaxy s4 , many more. newest devices , tablets not supported. here manifest: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.baoss_cdb" android:versioncode="3" android:versionname="1.2.1" > <supports-screens android:anydensity="true" android:largescreens="true" android:normalscreens="true" android:smallscreens="true" android:xlargescreens="true" android:resizeable="true"/> <uses-sdk android:minsdkversion="9" android:targetsdkversion="17" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_fine_location" /> <uses-permission android:name="android.permission.call_phone" /> <applicat...

php - Wordpress query_posts returns post from unspecified categories -

i trying retrieve post category using query_posts returns post unspecified category other parameters such sort , showposts works fine. extract(shortcode_atts(array( 'categories' => 'partners', 'imageswidth' => '200px', 'imagesheight' => '115px', 'imageslink' => 'web_link', 'partnerscount' => 'all', 'columnscount' => 1, 'imagescrop' => 'no', 'imagesblackhovercolor' => 'no', 'imagesopacity' => 100, 'imagesgrayscale' => 'no', 'imagescolorize' => '', 'imagesnegative' => 'no', 'imagessort' => 'date asc' ), $atts)); //$args = "category_name=".categories; //$catids = get_c...

.net - How can I make a PSDrive created within a function accessible out of this function? -

i assume creating new ps-drive within function makes drive accessible within function. how can make ps-drive created calling function main accessible out of function? $temprorarypsdrivename = "temprorarydrive" create-psdriveby $temprorarypsdrivename #private function creates psdrive based on logic dir $($temprorarypsdrivename + ":") #this not work 'teprorarydrive' not #accessible once exit create-psdriveby function give global scope psdrive: new-psdrive -name qq -psprovider filesystem -root c:\windows -scope global

paypal - How to know if user accepts the currency? -

i'm integrating paypal marketplace, , had payment failing following error: error id: 559044 message: receiver .... not accept payments in currency i able fix logging account , adding currency (eur) balance currencies account. now... need able detect when 'sellers' in marketplace not have eur enabled, can guide them through process , verify completed it. otherwise bad experience buyers. pp_mts_chad right, there no api that. can use adaptivepayments' pay call dummy amount find out whether throws 559044 error message. if receiver not accept given currency, found out ;) not nicest solution, works.

C++ String to class name -

this question has answer here: is there way instantiate objects string holding class name? 9 answers i read file, , based on each line create object of class same name first word of line, require me make "if statement" check each word , create object. there way convert string class name, can that: string classname = "someclass"; classname obj; no, can't... declaration/definitions need known @ compile-time. can achieve runtime-polymorphism building class-hierarchy (and/or interfaces), though.

ruby - How to do blocking subscribe using bunny RabbitMQ client? -

in java rabbitmq client can (code in ruby): consumer = queueingconsumer.new(channel); channel.basicconsume(queue_name, true, consumer); consumer.nextdelivery.getbody and third line blocks thread until message comes. how achieve in bunny client? can use block: channel.queue('').bind(@x, :routing_key => rk).subscribe(block: true) |_, _, payload| # end or non blocking pop: delivery_info, properties, payload = q.pop is there way achieve in jruby client using bunny? reason want after receiving message continue job in current context. the call subscribe blocking due passing :block => true . if need access payload outside of block, can take advantage of ruby's scoping rules: the_payload = nil queue = channel.queue('').bind(@x, :routing_key => rk) queue.subscribe(block: true) |delivery_info, _, payload| the_payload = payload channel.consumers[delivery_info.consumer_tag].cancel end # the_payload 1 received in block!

How to define simpleType globally in JaxB -

i have simpletype defined in 1 namespace. i use simpletype in namespace. far ok. jaxb generate simpletype in every package use it. expected , need 1 global simpletype definition. example: common.xsd (here me simpletype) -> package.common.myenum account.xsd -> package.account.somemecomplextype + package.account.myenum i like: common.xsd -> package.common.myenum account.xsd -> package.account.somemecomplextype + reference package.common.myenum common.xsd: <xs:simpletype name="barringscope"> <xs:restriction base="xs:long"> <xs:enumeration value="1"/> <xs:enumeration value="2"/> <xs:enumeration value="3"/> </xs:restriction> </xs:simpletype> binding.xjb: <jxb:bindings version="2.1" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/xmlschema"> <jxb:bindings schemalocation...

iphone - MPMoviePlayerController black screen when app enter foreground from background -

i'm using mpmovieplayercontroller playing video in iphone app. when mpmovieplayercontroller playing, press home button on iphone, make app enter background. then tap app's icon make app enter foreground, mpmovieplayercontroller 's view black screen short time, 1 15 seconds. how make mpmovieplayercontroller 's video shows when app came foreground? special thx! :d nsurl *movieurl = [nsurl urlwithstring:@"http://......"]; // initialize movie player object specified url self.movieplayer = [[mpmovieplayercontroller alloc] initwithcontenturl:movieurl]; self.movieplayer.controlstyle = mpmoviecontrolstylefullscreen; [self.movieplayer.view setframe:self.view.bounds]; [self.view addsubview:self.movieplayer.view]; [self.movieplayer play]; i hope you.

c++11 - Is empty struct defined by C++ standard? -

is there std::empty struct or similar or need define own: struct empty{}; this can used nice in combination std::conditional or other new std features , wonder if standard defines or not. there no such thing in c++ standard library. mentioned in comments, can still find boost::blank in boost resembles class looking for. if such class existed in standard library, don't think there many third-party libraries defining own struct empty {} . if want class no data members , smallest possible size - cannot smaller 1 - (and possibly benefit empty base optimization), can still use std::tuple<> . used exact purpose (empty base optimization) in implementation of classes in libstdc++. if want make sure std::tuple<> empty class: #include <iostream> #include <tuple> #include <type_traits> int main() { // prints 1 std::cout << std::is_empty< std::tuple<> >::value; }

c++ - Guess the output. (Declaration/ initialization of a character array) -

here piece of code. i'm using g++ void initialize(int p, char a[], char b[]) { for(int i=0;i<6*p;i++) { a[i]='-'; b[i]='-'; } } int main() { int p=9; char a[2*p],b[4*p]; initialize(p,a,b); cout<<a<<endl<<b<<endl; } here, way , b declared... should of size 18 , 36 respectively. aren't seen in output. happening? output: ------------------------------------------------------ ------------------------------------------------------------------------------------------------------ you're initialising far outside bounds of memory have allocated a , b you need do for(int = 0; < 2*p; ++i) { a[i]='-'; } for(int = 0; < 4*p; ++i) { b[i]='-'; } assigning memory outside of memory own literally anything. send fax dog.

android - How to center title in ActionBarSherlock with menu items? -

in order center title in topbar, set custom view actionbarsherlock this: ab.setdisplayshowcustomenabled(true); ab.setdisplayoptions(actionbar.display_show_custom); ab.setcustomview(r.layout.topbar); my custom view: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/textview" android:layout_width="fill_parent" android:layout_height="40dp" android:padding="5dp" android:background="#00ff00" > <imageview android:id="@+id/sidemenubutton" android:layout_width="40dp" android:layout_height="40dp" android:layout_centervertical="true" android:src="@drawable/icon_menu" /> <imageview android:layout_width="300dp" android:layout_height="wrap_co...

getattr - Why does Python look for __members__ rather than the requested field? -

i have class defines own __getattr__() in order interact xml tree instantiated objects contain. hides xml structure user , allows him set tag values, etc. if normal fields on object , works fine fields except one: 1 named field . here's how looks: >>> q = myquery() >>> q.file = "database" >>> print(q) <?xml version="1.0" encoding="utf-8" standalone="yes"?> <requestcollection xmlns="http://dwd.de/sky"> <read> <select> <referencedate> <value></value> </referencedate> </select> <transfer> <file name="my file"/> </transfer> </read> </requestcollection> >>> q.file that works fine, side effects should happen so. if try set field field , string method shouldn't returning. clarity, simplified version of __getattr__ : def __getattr__(self, key): logg...

php - get <img> tag from @imagecreatefromjpeg? -

i writing text on image using php.i creating new image current image , writing text on using php.but want when click on apply changes move new image directory (move_uploaded_file) , replace current image new image , new image name must same of previous image because downloading using php. here code using wrote text on it. html code : <img id="image" src="<?php echo "upload_pic/" . $_files["image_file"]["name"]; ?>" alt="your_image" /> <input type="button" name="save_image" id="save_image" value="save image" /> <input type="hidden" id="hidden_image_name" name="hidden_image_name" value="<?php echo $_files["image_file"]["name"]; ?>" /> jquery code : jquery('#save_image').click(function(){ var image_name = jquery('#hidden_image_name').val(); jq...

xslt - Override the element mapped in the main.xsl file to NULL in import.xsl -

we trying override element mapped in main.xsl file null in import.xsl file using call template. getting target mapped twice instead of overriding. kindly help. main.xsl <db:long_description xml:id="id_102"> <xsl:value-of select="corecomebo:reviseditem/corecomebo:description" xml:id="id_103"/> </db:long_description> <xsl:call-template name="long_description_custom"/> import.xsl <xsl:template name="long_description_custom"> <db:long_description xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/apps/inv_ebi_change_order_pub/process_change_order_list/" xml:id="id_102" > <xsl:value-of select="''"/> </db:long_description> </xsl:template> output <db:long_description xml:id="id_102">xxx</db:long_description> <db:long_description xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/apps/inv_ebi_change_o...

android - Synchronizing SQLite with external SQL database server -

i'm building android project creates sqlite database, stores data in , fine. i need application sync data sql database server located on pc. question is: can that? what best practice doing that? if have sync webserver check this http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/

c++ - Compile c code as c# -

hi may strange question have c++ code compile c# code using visual studio 2012. the code self compatible , compile both compilers. what have c# compiler treat .c files .cs files , compile them c#, reason still need particular c++ file old library dont want have 2 copies of code when update something. currently have batch file copies .c code c++ project within solution c# project within same solution , uses pre processor , compiles loose breakpoints, etc , bit of problem. the file extension not relevant set build action compile in properties of file. syntax highlighting might have problems not compiler.

Jquery Autocomplete starts with first letter -

here code <div> <label for="dynamicsearch">search:</label> <input id="dynamicsearch"> </div> $(function () { // autocomplete $("#dynamicsearch").autocomplete({ source: "dynamicsearch.php", minlength: 1 }); }); dynamicsearch.php <?php $con = pg_connect("connection"); if (!$con) { die("could not connect: " . pg_last_error()); } $dynamicsearch = "select name bkash_dist name '%".$_get['term']."%' limit 10"; $result = pg_query($con, $dynamicsearch); while($row = pg_fetch_array($result)) { $results[] = array('label' => $row['distrbutor']); } pg_close($con); $encoded = json_encode($results); // send response index.html // , end script execution die($encoded) ?> when searching "a " giving result contains " a " want tho...

apache poi - POI default formats Issue -

i noticed when spreadsheet created using poi, default style set comma style, set when opening in excel , clicking button comma style, in office 2007 onward, results in format includes currency symbol (contrary definition of comma style in excel). this occurs without format changing code in source, seems built poi , effect worksheet-wide. by creating such file , setting cell comma style excel , doing cell format (right click etc.), appears custom format, of form _("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_) in normal excel file, expected format have been accounting without currency symbol. is there way change default styles within poi in order correct behavior comma style? i testing npoi 1.2.5, net framework port, suppose full equivalent of apache poi form derived. with difficulty found reason , answering reference. i using latest stable release of npoi. 1.2.5. checking source(in file builtinformats.cs), st...