Posts

android - Starting new activity from asynctask in tabhostView -

i have problem code: i working on app requires log in. app consists of loading screen , tabview 4 tabs. last tab activity wil let login. have set edittext views here , login button. the login activity done far here's code: package com.appsoweb.kvodeventer; import org.json.jsonobject; import android.app.activity; import android.app.progressdialog; import android.content.intent; import android.os.asynctask; import android.os.bundle; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; public class kvomeldingen extends activity { public static final jsonobject jsonresult = null; button blogin, bcreateaccount, bresetpassword; edittext etusername, etpassword; static string username; static string password; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview...

objective c - Trouble casting UIView in iOS -

i have class called fooview subclass of uiview , i'm trying cast uiview object fooview . i follows fooview *myview = (fooview*) myviewcontroller.view nslog(@"leg class of %@",nsstringfromclass([myview class])); // uiview here. the ivar of myviewcontroller uiview type. i uiview result, idea why happens? casting compile-time operation. doesn't magically change type of object. it's compile time checking , little runtime magic. myview still uiview , not fooview . these 2 lines in question should give answer: the ivar of myviewcontroller uiview type. uiview result all objective-c objects have pointer called isa points object of type class . casting not change pointer, nor change size of object. if want use fooview , need change property type in controller , if you're using interface builder, change type of uiview in inspector on right.

scroll - Problems with scrollTo() in android -

i´m developing application incorporates chat , when type new message stores file in internal memory. also, when type new message, automatically scrolls bottom of edittext (where messages are), , works fine on first try,but when open application again , loads history file, automatic scrolling no longer works because, although scrolling bottom well, hides last line of text. here .java file: public class chatactivity extends activity { private static edittext messagehistory; // private edittext messageinput; // private button sendbutton; // private scrollview scroller; @override public void oncreate (bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.chat); //prevents keyboard appearing when not rquested getwindow().setsoftinputmode(windowmanager.layoutparams.soft_input_state_always_hidden); projectdata.chatlogfile = new filehandler(getapplicationcontext(), projectdata.chat_log_file); projectdata.chatlogfile.create(...

android - findViewById usage in View -

i'm struggling problem few days , couldn't find solution problem far. have 2 classes: - startactivity extends activity - timegraphview extends surfaceview what want achieve add dynamically buttons within timegraphview view (linearlayout). wanted linearlayout inside timegraphview findviewbyid() returns null, , should because call in timegraphview not in root element used setcontentview(); so question how can add button dynamically custom view level view. and code: public class startactivity extends activity { public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.time_graph); linearlayout layout = (linearlayout) this.findviewbyid(r.id.timegraphlayout); //here can add button it's not want } } and ... public class timegraphview extends surfaceview implements surfaceholder.callback, runnable { public timegraphview(context context) { super(context); }...

Firefox, SVG, text-decoration -

consider following snippet of code: <text style="text-decoration:underline;"> underline </text> it renders me in both latest version of chrome & safari; however, fails in latest version of firefox. question: if text-decoration not part of svg standard? or does firefox not support entirety of svg? and lastly: how underline / strike through / on line in firefox svg text given above? thanks! edit hmm, https://bugzilla.mozilla.org/show_bug.cgi?id=317196 confirm firefox, in 2012, not support svg underline? :-) the bug linked it. and no 1 supports "the entirety of svg" (at least of svg 1.1). chances are, no 1 ever will.

machine learning - How to improve accuracy of decision tree in matlab -

i have set of data classify them in matlab using decision tree. divide set 2 parts; 1 training data(85%) , other test data(15%). problem accuracy around %90 , not know how can improve it. appreciate if have idea it. i guess more important question here what's accuracy given domain: if you're classifying spam 90% might bit low, if you're predicting stock prices 90% high! if you're doing on known domain set , there previous examples of classification accuracy higher yours, can try several things: k-fold cross validation ensamble learning generalized iterative scaling (gis) logistic regression

jquery - Switch text of span element based on whether the div is expanded or collapsed -

i trying have 3 divs , closed.when div closed span right side shown arrow pointing towards right , when click div want corresponding span arrow points down , again when div collapsed should point right.here fiddle .i think missing , can me out this. if 1 let know better ways of doing task (entire collapse , expansion) , appreciated. thanks i've made few amends code, including using classes group elements. code set selected arrow, needed change divs default state before completing actions on clicked one. try this: $('.main').click(function() { var $el = $(this); if (!$el.next(".sub").is(":visible")) { // reset $('.sub').slideup("slow"); $('.arrow').html("&#9654;"); // set current $el.next('.sub').slidedown("slow"); $('.arrow', $el).html("&#9660;"); } }); <div class="main"> ...