Posts

Featured post

javascript - looping promises in nodejs -

i learning promises in nodejs, below example code. output of below code test - 1 test - 2 test - 3 test - 4 var q = require('q'); var promise = q.when('test'); promise.then( function(val) { console.log(val + '-' + '1'); }); promise.then( function(val) { console.log(val + '-' + '2'); }); promise.then( function(val) { console.log(val + '-' + '3'); }); promise.then( function(val) { console.log(val + '-' + '4'); }); i know how can write same code using loop. this isn't specific promises. if you're creating callbacks in loop, you'll need closure scope , other it's quite standard. however, simplest way specific case use single callback only, attached same promise anyway , receive same value. use require('q').when('test').then(function(val) { (var i=1; i<=4; i++) { console.log(val + '-' + i); } });

Android Studio build failed at "processDebugResources" when using 9-patch images -

i following "the big nerd ranch's android programming guide" book (2nd edition) , in particular chapter (chapter 21), ask use 9-patch image image assets. until then, app wrote, called beatbox, worked fine , compiled without error. but, when go ahead , replace drawables 9-patch image, run build error , cannot make app build. following error get: executing tasks: [:app:generatedebugsources, :app:generatedebugandroidtestsources] configuration on demand incubating feature. :app:prebuild up-to-date :app:predebugbuild up-to-date :app:checkdebugmanifest :app:prereleasebuild up-to-date :app:preparecomandroidsupportappcompatv72311library up-to-date :app:preparecomandroidsupportrecyclerviewv72311library up-to-date :app:preparecomandroidsupportsupportv42311library up-to-date :app:preparedebugdependencies :app:compiledebugaidl up-to-date :app:compiledebugrenderscript up-to-date :app:generatedebugbuildconfig up-to-date :app:generatedebugassets up-to-date :app:mergedebugassets

converter - how do i convert photographs to tensors -

i neophyte neural network user trying grips tensorflow. have used mnist dataset test, , use real world data. can point me "howto" or paper or source tells me how go converting digital photographs in files, (jpeg, png, gif, wmf), tensors ready import tensorflow please? cheers! you can use tensorflow image functions load images , convert them tensors. after loading images, want @ tf.image.resize_bilinear resize images standard sizes.

sql - Sorting in a matrix SSRS -

Image
i try sort machine number ascending. if took out prduct description machines sorted ascending. show product description every machine , show machines sorted(m101,m102,m103...) where date between @startdatetime , @enddatetime , name in ('m101','m102','m103','m104','m105','m106','m107','m108','m109','m110', 'm111') group date, name, productname ) s order name asc it should here: did used matrix [![enter image description here][4]][4] i have try these 2 solution first use case when in order clause order case when name = 'm101' 1 when name = 'm102' 2 end it's not best solution it's can solved problem , second solution use substring in order clause this order cast(substring(name,2,10) int) and if use column group dynamic expand column don't forget delete delete sorting condition. hope it's help

Add marker to google maps in ios using url scheme -

when tap on "open in google maps" button in application, want application navigate google maps application , open address specified , put marker it. here code purpose: uialertaction* googlemaps = [uialertaction actionwithtitle:nslocalizedstring(@"google_maps", @"google maps") style:uialertactionstyledefault handler:^(uialertaction * action) { nsstring *customurl = @"comgooglemaps://?center=41.039400,28.994583&zoom=16&markers=size:mid%7ccolor:0xff0000%7clabel:1%7cvodafone+arena+stadyumu"; [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:customurl]]; }]; when tap on button, correctly navigates specific location. however, not put marker it. there way achieve this? thanks :) as per google doc, format specified in code wrong:- example:- comgooglemaps://?q=vodafone+arena+stadyumu&center=41.039400,28.994583&zoom=15&views=transit this shows marker in center of map

ios - How to setup a UIScrollView to arrange content dynamically? -

Image
i trying create user profile screen. screen have lots of information user. similar airb from looks of it, seems sort of scrollview? or tableview or collectionview? (because seems there rows in there think) does 1 here know how type of view can accomplished or can setup? edit 2 answers below says use uitableview, , 2 other answers says avoid it. there benefits/disadvantages using either? use 1 child uiview call containerview inside uiscrollview , place child views inside containerview . use constraint trailing , leading , top , bottom of containerview uiscrollview . , use constraint placing child views viewcontroller.view not containerview ios find child views have be. good tutorial find out how use constraint on scrollview apple technical note

php - Is it possible to insert the data inside sharedpreference into mysql database? -

is possible insert data inside sharedpreferences remote mysql database? insert product specific user logged in or maybe know better way doing that. using sharedpreferences login session. if know tutorial please kindly share, need in project , new android development. yes, can. first : retrieve data sharedpreferences : sharedpreferences sp = preferencemanager.getdefaultsharedpreferences(myactivity.this); integer myvalue = sp.getint("mykey", 0); then: insert returned value database: this tutorial shows how perform insert mysql database: http://sampleprogramz.com/android/mysqldb.php hope helps.