Posts

selenium - how to verify view is scrollable in mobile application (Automation) -

anyone knows automation script verify view (homepage/browse) scrollable or not. can use scrollto(id) @ bottom of page. not correct method do, test case passes if element present in 1st page basically cannot. try cast view scrollview class custom view can implement scroll.

Python - TypeError: float() argument must be a string or a number, not 'list -

python newbie here. trying operate on lists contain floating point numbers. avg list parameter returned different method. however, when tried doing following, throws me error float() should have string or number , not list. avg1 should contain copy of lists float-type numbers instead of lists right? tried few edits read on other posts similar titles, couldn't solve this. starting out kindly tell me going wrong. def movingavg(ema,avg): ema=[] avg1 = [float(i) in avg] ema[:3] = avg1[:3] i,j in zip(ema[2:],avg1[3:]): =float(i)*0.67 + float(j)*0.33 ema.append(a) return ema the error follows : avg1 = [float(i) in avg] typeerror: float() argument must string or number, not 'list' using python 3.4 please check return type of avg think it's return type list's of list.

I want to find maximum number in sql server i have values with string part and integer part -

i have values sp-1 , sp-2 , sp-3 ..... sp-10 , sp-11 . i have maximum number here in sql server select max(substring(supplementid,4,10)) max_num supreg when execute code maximum number 9. try: select max(cast(substring(supplementid,4,10) int)) max_num supreg or select max(cast(replace(supplementid,'sp-','') int)) max_num supreg

jquery - Bootstrap select with values and option to create new value -

i want select field predefined options database , allow user either select predefined options or create new value if suitable value not in list. i'm using bootstrap 3 and creating select field using ajax like /* * select product attributes on change of product type */ $("#producttypes").on('change',function() { var id = $(this).val(); $("#product_attributes").html(''); if (id) { var datastring = 'id='+ id; $.ajax({ datatype:'json', type: "post", url: '/products/ajax-get-product-attribute-types' , data: datastring, cache: false, success: function(data) { var = 0; $.each(data, function(key, value) { var message = '<div class="form-group">' + '<label>'+value['title']+'</label>...

reactjs - updated nested Immutable in immutable.js -

how can update nested immutable map item without mutatiling whole tree ? example : var tree = map({ branch1:map([]), branch2:map({ 1: map({id:1,value:'hello'}) }), }); how can update tree.branch2.1.value ? will cause branch1 new copy ? i'm using in reactjs redux app. since i'm using selectors, want change value of branch2 without changin branch1 also, selectors wonnt recalculate again changing values in immutable.js object always return new object instead of mutating it. that's whole point of library. if worried unnecessary re-renders based on other aspects of state changing, should use shouldcomponentupdate lifecycle method ensure components update when value of part of app state changes, , not when new object. for case, make sense use setin method immutable maps. tree.setin(['branch2', 1, 'value'], 'newvalue');

Count of objects in JSON (UWP C#) -

i writing app windows 10. i have using woocommerce.net plugin download data worspress site. i download this. restapi rest = new restapi("http://simplegames.com.ua/wp-json/wc/v1/", "ck_9d64c027d2c5f81b8bed3342eeccc6d337be813d", "cs_60697b1e6cbdeb8d62d19e0765e339f8e3334754"); wcobject wc = new wcobject(rest); //get products var orders = await wc.getorders(); var products = orders[0].line_items; { "id": 1897, "parent_id": 0, "status": "processing", "order_key": "wc_order_57cec87491975", "currency": "uah", "version": "2.6.4", "prices_include_tax": false, "date_created": "2016-09-06t13:45:24", "date_modified": "2016-09-06t13:45:24", "customer_id": 0, "discount_total": 0.00, "discount_tax": 0.00, "shipping_total...

sql server - substring in sqlserver with casual format -

i have these rows 14-l-100-10008-g03s-n 1-dr-100-20057-g48-n 2-cl-100-12133-b12-p 2-fg-100-12202-b01-n 2-g-100-15520-b48-n 2-gm-100-10024-b01-n 2-hc-100-10022-g03s-n 2-hc-100-10023-g03s-n 2-hc-100-20023-g03s-n 32-g-100-15518-f03p2-n 32-g-100-15518-f03p2-n i need these parts .how can these parts using sql server code : result:g03s,g48,b12,b01,b48,b12 , ... you can below: ;with cte ( select '14-l-100-10008-g03s-n' val union select '1-dr-100-20057-g48-n' val union select '2-cl-100-12133-b12-p' val union select '2-fg-100-12202-b01-n' val union select '2-g-100-15520-b48-n' val union select '2-gm-100-10024-b01-n' val union select '2-hc-100-10022-g03s-n' val union select '2-hc-100-10023-g03s-n' val union select '2-hc-100-20023-g03s-n' val union select '32-g-100-15518-f03p2-n' val union select '32-g-100-15518-f03p2-n' ) select reverse(substring(reverse(val), charindex('-', rev...