Posts

Featured post

javascript - How to bind ViewModel Store to View? -

i'm pretty new ext js , trying embed multiselect inside panel . the viewmodel has stores property can see here: ext.define('test.view.controls.search.searchfiltermodel', { extend: 'ext.app.viewmodel', alias: 'viewmodel.filter', data: { title: '' }, stores: { test: { fields: [ 'id', 'name' ], proxy: { type: 'ajax', url: 'api/test', reader: 'array' }, autoload: true } } }); i bind in view this: viewmodel: { type: 'filter' }, layout: 'fit', border: 1, plain: true, scrollable: 'y', layout: 'fit', bind: { title: '{title}', }, items: { xtype: 'multiselect', scrollable: false, allowblank: true, ddreorder: true, bind: { store: '{test}' }, valuefield: 'id', displayfield: 'name' }

Sort a complex associative array in PHP -

this question has answer here: php sort array subarray value 5 answers i have associative array in php like: $newarray1 = array ( [producta] => array ( [link] => http://sanjosespartan.com/blog/products/agile-java-development/ [visitcount] => 4 ) [productd] => array ( [link] => http://sanjosespartan.com/blog/products/intro-to-go/ [visitcount] => 1 ) [productg] => array ( [link] => http://sanjosespartan.com/blog/products/node-js-for-developers/ [visitcount] => 1 ) [productb] => array ( [link] => http://sanjosespartan.com/blog/products/beginning-mysql/ [visitcount] => 1 ) [productc] => array ( [link] => http://sanjosespartan.com/blog/products/computer-networks/ [visitcount] => 1 )

OSX App: Get max resolution of the user's display (Swift) -

i'm trying max resolution of user's display-- not current resolution, maximum display supports. know can current resolution this need maximum (ie: on mbp 13inch resolution 2560x1600). i know can in terminal using this , avoid trying hack-y in terminal, , instead swift. suggestions on how can this? thanks. you need use quartz display services. first, list of displays, cggetactivedisplaylist . then, each display, use cgdisplaycopyalldisplaymodes . iterate on array of modes, using cgdisplaymodegetwidth , cgdisplaymodegetheight figure out highest resolution.

ios - Can someone show me a more efficient way to handle multiple text field delegates? -

i'm working on project user have 5 text fields input data. "calculate" button calculates required computations based on user input. solution create 5 iboutlet uitextfields , connect them in xib file. each text field handle events based on input following code. can show me efficient way solve problem? - (bool)textfieldshouldreturn:(uitextfield *)textfield{ if(textfield == self.numberofnightstf){ self.numberofnights = [self.numberofnightstf.text intvalue]; nslog(@"the number of nights set %.d days", self.numberofnights); } else if(textfield == self.nightlychargetf){ self.nightchargecost = [self.nightlychargetf.text floatvalue]; nslog(@"the cost of charge per night set %.2f$", self.nightchargecost); } else if(textfield == self.roomservicetf){ self.roomservicecost = [self.roomservicetf.text floatvalue]; nslog(@"the additional room service cost set %.2f$", self.roomservicecost); } else if(textfield == self.telep

php - Best way to save orders in array by date -

my database is: table: orders, columns: id (int), order_status(varchar), time (timestamp), price (decimal); i want receive sum of orders prices each day in 1 array. best way that? i've used this, lasts 24h, 48h, 72h... orders , not each day (from 00:00 until 23:59). $timeback = time() - 86400; $time = time(); $month = array(); for($i = 0; $i < 30; $i++){ //query example $month[$i] = select orders `order_status` = 'completed' , `time` between {$timeback} , {$time} order `id` asc"); $timeback = $timeback - 86400; $time = $time - 86400; }

python - Selenium action chains to click inside silverlight plugin object in a page -

currently trying click button inside of silverlight web app, , yes know beforehand silverlight not supported think @ least worth try action chain module. here best come until now: profile = firefoxprofile() profile.set_preference('plugin.default.state', 2) driver = webdriver.firefox(profile) driver.get('http://www.trypython.org') time.sleep(8) sldiv = driver.find_element_by_xpath('//*[@id="silverlightcontrolhost"]') builder = actionchains(driver) builder.move_to_element_with_offset(sldiv, 372, 44) builder.click() it not clicking, or @ least not in expected coordinates (where button is). away this? if so, able type text after clicking inside textbox? do not mention silverlight-selenium outdated project

c# - How can I set a max. ExpirationDate TimeSpan on a azure Media Service Locator? -

i mistakenly set wrong time several locator url's connected uploaded videos. trying correct setting locator maxvalue ensure not go away, several others have already. tried following, context.locators.create(locatortype.ondemandorigin, outputasset, accesspermissions.read, timespan.maxvalue), , resulted in "the added or subtracted value results in un-representable datetime". maximum timespan can possibly set if not want locators expire? you set 100 years expiryon time, should sufficient.