Posts

ios - Segue from ViewController to first tab of TabBarController -

i've created tabbed application. in first tab (viewcontroller+tableview), shows results taken db. i've button opens viewcontroller in user can filter results (for "city", example). now, how can return first tabbed page segue? because need pass parameters in order query db. if create segue between page , first viewcontroller doesn't show tabbed menu. thank guys. i assume trying achieve pass data 1 tab another. "now, how can return first tabbed page with segue? because need pass parameters in order query db. " actually, don't have perform segue pass data, instead can following: // somewhere in code when need pass data tab viewcontroller: if let tabbarcontroller = tabbarcontroller { let secondtabviewcontroller = tabbarcontroller.viewcontrollers![1] as! secondviewcontroller // let's assume want pass string secondtabviewcontroller.str = "my str!!" } secondviewcontroller: class secondviewcontroller: uiv...

c# - Async method in an async method -

my question: how wait input async method before going on? some background info: have c# app scans qr code, , loads data on basis of value scanned. above works, want app ask whether value scanned right card. the applied code follows: using zxing.mobile; mobilebarcodescanner scanner; private bool correct = false; //create new instance of our scanner scanner = new mobilebarcodescanner(this.dispatcher); scanner.dispatcher = this.dispatcher; await scanner.scan().continuewith(t => { if (t.result != null) handlescanresult(t.result); }); if (continue) { continue = false; frame.navigate(typeof(characterview)); } handlescanresult(result) being (skimmed down): async void handlescanresult(zxing.result result) { int idscan = -1; if (int.tryparse(result.text, out idscan) && idscan != -1) { string confirmtext = carddata.names[idscan] + " found, card wanted?"; messagedialog confirmmessage = new messagedialog(confirmte...

mediawiki - Parsoid test page fail during VisualEditor installation -

i'm trying install visualeditor in mediawiki wiki stuck when test parsoid. this result of test page: error: no api uri available prefix: enwiki; domain: undefined path: /_rt/mediawikiwiki/parsoid error: no api uri available prefix: enwiki; domain: undefined @ /usr/lib/parsoid/src/lib/config/mwparserenvironment.js:295:10 @ /usr/lib/parsoid/node_modules/prfun/lib/index.js:532:26 @ trycatch2 (/usr/lib/parsoid/node_modules/babybird/lib/promise.js:48:12) @ prfunpromise.promise (/usr/lib/parsoid/node_modules/babybird/lib/promise.js:458:15) @ new prfunpromise (/usr/lib/parsoid/node_modules/prfun/lib/index.js:57:21) @ /usr/lib/parsoid/node_modules/prfun/lib/index.js:530:18 @ trycatch1 (/usr/lib/parsoid/node_modules/babybird/lib/promise.js:40:12) @ promisereactionjob (/usr/lib/parsoid/node_modules/babybird/lib/promise.js:269:19) @ promisereactionjobtask.call (/usr/lib/parsoid/node_modules/babybird/lib/promise.js:284:3) @ flush (/usr/lib/parsoi...

php - How to prevent sharing of static variables in inherited classes? -

consider model.php : class model { protected static $class_name; protected static $table_name; protected $id; public static function initialize() { static::$class_name = get_called_class(); static::$table_name = strtolower(static::$class_name).'s'; } } and children, user.php , product.php : class user extends model { protected $username; protected $password; } user::initialize(); class product extends model { protected $name; protected $price; } product::initialize(); since every user or product have same $class_name , $table_name , makes sense make them static . actual values assigned when initialize() method called on child model (e.g. user::initialize(); , product::initialize(); ). problem i expect end following: user -> $class_name -> 'user', $table_name -> 'users' product -> $class_name -> 'product', $table_name -> 'products' yet followin...

android - How to test the uplink/upload link speed -

i'm struggling on how test uplink internet. know how download link speed upload problem. do have implement own server on internet? is there way use http post? connection-less protocol? i looked using ftp free server didn't find 1 allows remove file uploaded. any recommendations?

Android - Using Picasso in order to load an image for a game? -

i have used both picasso , glide in order load images asyncronously in grids images coming phone's external memory , in order download photos internet. android game in first screen need display image below title (the image takes available height). user taps on specific part of image , game starts. the image content drawable resource. so, specific use (a textview , imageview below takes remaining space), should do: -specify image imageview's src property. -use image loading library, such picasso or glide what suggest , why? thank you. edit: image static, static drawable resource.

python - How to sucsessfully ask the user to choose between two options -

new programmer here i'm trying ask user choose between 2 options can't right. inp = int(input()) while inp != 1 or inp != 2: print("you must type 1 or 2") inp = int(input()) if inp == 1: print("hi") if inp == 2: print("ok") quit() even if enter 1 or 2 when ask still spits "you must must type 1 or 2" my end goal if enter 1, continue program while if choose 2 end program. help. just work strings. if need turn "inp" variable integer, don't wrap int() function around input(), wrap variable (i.e. int(inp) ). also, change ors ands: inp = "" while inp != "1" , inp != "2": inp = input("enter 1 or 2: ") if inp != "1" , inp != "2": print("you must type 1 or 2") if inp == "1": print("hi") if inp == "2": print("ok")