Posts

Android RecyclerView: How to avoid scroll interruption(scroll twice) when scroll state is not IDLE? -

how avoid recyclerview being scrolled when scrollstate not idle ? i have tried ideas overriding canscrollhorizontally() in linearlayoutmanager , return false when scrollstate != idle or same concept applied dispatchtouchevent() in activity , stuck screen forever. i tried asyntask method while loop made never escape doinbackground , go onpostexercute: @override public void onscrollstatechanged(recyclerview recyclerview, int newstate) { super.onscrollstatechanged(recyclerview, newstate); if (previousscrollstate != 0) { new asynctask<void, void, boolean>() { @override protected boolean doinbackground(void... params) { while (previousscrollstate != 0) { log.i(tag, "doinbackground " + previousscrollstate); } return true; } @overr...

visual studio 2010 - Concatenate string and constant in resource file in C++ (MFC) -

i have c++ project mfc , resource file. in about-dialog want add constant contains version of programm. idd_aboutbox dialog discardable 34, 22, 237, 65 style ds_modalframe | ws_popup | ws_caption | ws_sysmenu caption "about monitor" font 8, "ms sans serif" begin icon idr_mainframe, idc_static, 11, 22, 20, 20 #ifdef __64bit__ ltext "communication monitor v" app_version " x86_64", idc_static, 40, 13, 150, 8 #else ltext "communication monitor v" app_version " x86_32", idc_static, 40, 13, 150, 8 #endif //__64bit__ defpushbutton "ok", idok, 200, 6, 32, 14 end if looks error 1>src\monitor.rc(80): error rc2116: expecting number id 1>src\monitor.rc(80): error rc2108: expected numerical dialog constant i tried concatenate + idd_aboutbox dialog discardable 34, 22, 237, 65 style ds_modalframe | ws_popup | ws_caption | ws_sysmenu caption "about monitor...

Set toplevel for Python package -

Image
i have folder structure: okay, have below code in main application ( main.py ) from modules.core import core1 print core1.housenumber() and below code in core1.py : from ..engine import engine1 def housenumber(): house = engine1.badluck() return house also code in engine1.py : def badluck(): return 13 this work without problem, alright. now, here interesting part, have below code in widget1.py def door(): return 'black' and code in core2.py : from ...widgets import widget1 def doorcolor(): door = widget1.door() return door and if change main.py to: from modules.core import core1, core2 print core1.housenumber() print core2.doorcolor() i error: attempted relative import beyond toplevel package . okay, if take main.py out of projectx in drive d , change main.py codes this: from projectx.modules.core import core1, core2 print core1.housenumber() print core2.doorcolor() it work perfectly. okay, understand if from...

regex - Parsing text using grep -

i have textfile called netlist.txt following contents: m1 nmos1 m2 nmos2 p1 pmos1 m3 nmos3 m4 nmos4 p2 pmos2 i want retrieve line starts tab/space , matching "m" values indented, using regex. in order accomplish entered following expression in bash: egrep [:space:]*[m][0-9]+ netlist.txt but doesn't recognize space. retrieves lines regardless of having space or not. please give me advice on this. thanks, pedro you can use: grep '^[[:blank:]]m[0-9]' file output: m3 nmos3 [[:blank:]] matches either single space or single tab @ line start. [[:space:]] on other hand matches space or tab or newline.

mysql - fill a database using data of another database in c# -

i'am working on winform c# , phpmyadmin (database). have 2 differents databases(db1 , db2). i want fetch data of 1 column of table1 in db1 , store these information in table2 of db2 such if there modifications in column of db1, db2 should automacally updated. this logic used it's not working: using mysql.data.mysqlclient; namespace gnms { public partial class doublecoonection : form { dataset ds; mysqldataadapter da1; mysqldataadapter da2; mysqlconnection connec1; //for 1st database mysqlconnection connec2;//for 2nd 1 public doublecoonection() { initializecomponent(); } private void button1_click(object sender, eventargs e) { string str_conn = "server=localhost;username=root;password=****;port=3306"; string query1 = "select id,city enugro.city;"; //query1 1st db connec1 = new mysqlconnection(str_conn); try { ...

Android app sanity tests with appium using javascript -

my experience of writing tests has been casperjs javascript. have android app test automation using appium. have gone through many tutorials unable create first test using javascript appium. out there can me creating first test. p.s. have installed android studio , andriod sdk tools, set andriod_home , path environment variables. downloaded https://github.com/acolby/testdroid_example.git npm install run stuck while running npm install -g mocha , getting error npm err! darwin 14.0.0 npm err! argv "node" "/usr/local/bin/npm" "install" "-g" "mocha" npm err! node v0.12.4 npm err! npm v2.10.1 npm err! path /usr/local/lib/node_modules/mocha/changelog.md npm err! code eacces npm err! errno -13 npm err! error: eacces, unlink '/usr/local/lib/node_modules/mocha/changelog.md' npm err! @ error (native) npm err! { [error: eacces, unlink '/usr/local/lib/node_modules/mocha/changelog.md'] npm err! errno: -13, npm err...

json - Android Volley JsonArrayRequest send and get List<Object> -

i want send jsonarrayrequest linkedlist param , same type result. error 400 means wrong request: requestqueue volleyqueue = volley.newrequestqueue(context); final type type = new typetoken<linkedlist<myclass>>() {}.gettype(); linkedlist<myclass> data = new linkedlist<>(); //populate data... try { jsonarrayrequest request = new jsonarrayrequest( request.method.get, base_url, new jsonarray(new gson().tojson(data)), new response.listener<jsonarray>() { @override public void onresponse(jsonarray response) { try { processresultdata((linkedlist<myclass>) new gson().fromjson(response.tostring(), type)); } catch (exception e) {} } }, ...