Posts

android - NullPointerException while trying to startActivityForResult -

android - NullPointerException while trying to startActivityForResult - edit: reply not phone call startactivityforresult on called activity object, instead invoke caller's context. this code, exception on lastly line: 107 intent intent = new intent(callingactivity.this, calledactivity.class); 108 calledactivity calledactivity = new calledactivity(); 109 calledactivity.startactivityforresult(intent, called_activity_code); inside callingactivity: @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); log.i(sr.tag,"req=" + requestcode + " res=" + resultcode); //never getting here } manifest file snippet: <activity android:name=".ui.callingactivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.main" /> <category and...

php - Statement match there condition -

php - Statement match there condition - i have question regarding condition. question : combined length of 2 sides of triangle must greater length of 3rd side segments form triangle. example, 8, 6 , 12 can form triangle because sum of 2 of 3 segments greater 3rd segment. however, 24, 5, , 15 cannot form triangle because sum of segments 5 , 15 not greater length of segment 24. so, coding : $aa = $_get['a']; $bb = $_get['b']; $cc = $_get['c']; if(($aa + $bb > $cc) || ($bb + $cc > $aa) || ($aa + $cc > $bb)){ echo"triangle"; } else{ echo"not triangle"; } it can run, but, test number : 8, 6 , 12 , display triangle. number :24, 5, , 15 display triangle reply not triangle. can tell me why? tq because all of these 3 conditions must met, not single one. replace if(($aa + $bb > $cc) || ($bb + $cc > $aa) || ($aa + $cc > $bb)){ with if(($aa + $bb > $cc) && ($bb + $cc > $aa) ...

java - printStackTrace() on appengine -

java - printStackTrace() on appengine - i'm noob here. on appengine servlet gives me 500 error caused this: try{ classifiedtweet = sentanalysis.classifytext("en", "i happy"); }catch(mashapeclientexception mce){ mce.printstacktrace(); } when comment out works, want see why not working. help please update 1 i found similar here just solution doesn't work me you should see stacktrace on console itself. if uploading app appspot.com can go appengine.google.com application go logs. there find stacktrace under tag error. java google-app-engine

scala - Beginner: How do I say "any superclass of generic A" -

scala - Beginner: How do I say "any superclass of generic A" - i'm playing quicksort illustration @ start of scala example , trying adapt generic type a , rather int s. what i've got working far is def sort[a <: ordered[a]](xs: array[a]) which allows sort run on types reflexively ordered, like richboolean . but i'd allow types a extend ordered[b] b superclass of (so, instance, extends ordered[any] ). how can this? what got work, agilesteel's answer: case class x( : int ) extends ordered[x] { def compare( x : x ) = x.i - } class y( : int, j : int ) extends x(i) case class z( : int ) extends ordered[any] { def compare( : ) : int = { if (! a.isinstanceof[z] ) sys.error("whoops") val z = a.asinstanceof[z] z.i - } } object quicksort { def main( args : array[string] ) { val xs = array( 3, 1, 2, 4 ) map x sort( xs ); val ys = array( 3, 1, 2, 4 ) map { => new y(i, -i) } sort[x...

php - Only submit this.val on form when submitted? -

php - Only submit this.val on form when submitted? - i'm making form displays dynamic value , have forms action in jquery function , want take value out of $(this).closest('tr') <input type="text" class="line_order_id" value="'.$order_id.'" size="5" readonly> want take value .line_order_id , send php page process. jquery $(document).ready(function(e) { $('.viewthis').live({ click: function() { var $tr = $(this).closest('tr'); var order_id = $('.line_order_id', $tr).val(); $('form#orderslist').attr({ action: "phpdump.php", target: "_blank", }).submit(); homecoming false; } }); }); any ideas?? given existing code seems value input in question , set in order_id variable, question how set value form , submit it? if so, think 2 obvious ways set in hidden input fiel...

asp.net 4.0 - Microsoft ReportViewer over 65536 rows? -

asp.net 4.0 - Microsoft ReportViewer over 65536 rows? - i have reportviewer version 10 in webforms project. when export info excel (and theres more 65536 rows) error. guess has old/new excel file format (biff or ever). guess if export xslx solve it. here error msg: "excel rendering extension: number of rows exceeds maximum possible rows per sheet in format; rows requested: 287005, max rows: 65536" does know if theres way prepare this, can export excel file on 65536 rows/records? this sounds more excel issue but... when had similar problem, decided rather trying create study viewer work take chance process properly. i suggest not using reportviewer exporting , either write process dump info out csv or utilize 3rd party library. went csv route. there plenty of samples of using c#/vb , asp.net output csv file sql server. if want excel formatting, best utilize 3rd party dll (don't utilize office stuff requires server have office installed)...

iphone - UIKeyboardBoundsUserInfoKey Deprecated -

iphone - UIKeyboardBoundsUserInfoKey Deprecated - i trying utilize code below xcode tells me uikeyboardboundsuserinfokey deprecated , wondering newer code instead: nsvalue* avalue = [info objectforkey:uikeyboardboundsuserinfokey]; and below code in context: -(void) keyboarddidhide: (nsnotification *)notif { nsdictionary* info = [notif userinfo]; nsvalue* avalue = [info objectforkey:uikeyboardboundsuserinfokey]; cgsize keyboardsize = [avalue cgrectvalue].size; cgrect viewframe = self.view.frame; viewframe.size.height += keyboardsize.height; scrollview.frame = viewframe; if (!keyboardvisible) { //nslog(@"keyboard hidden. ignoring notification."); return; } keyboardvisible = no; } you can utilize uikeyboardframebeginuserinfokey or uikeyboardframeenduserinfokey key instead of uikeyboardboundsuserinfokey. iphone cocoa-touch