Posts

apache spark - Understanding MultiFileWordCount example in Hadoop -

i'm trying understand multifilewordcount example in order implement combinefileinputsplit in hadoop. most of easy except 2 lines i'm finding confusing https://github.com/hanborq/hadoop/blob/master/src/examples/org/apache/hadoop/examples/multifilewordcount.java#l142 i'm not clear why skipfirstline needed , why offset decreased 1. this same thing used in post ibm well. here appreciated.

c# - How can I debug multi-project using VS Code? -

Image
i working on solution have several projects, can see following image: and question can debug main program counld not debug dependency project; did have solutions solve problem? can give me reply? i have found solution,just modify project.json can touch breakpoint @ dependency project; "buildoptions": { "debugtype": "portable" }, value debugtype portable

c# - Better for loop performance to check radiobuttons -

i have 512 separate radio buttons , each of them related bool display. i made function for loop uses lots of cpu. there better way this? for (int k = 0; k < numwords_for_plctohmi_bools * 16; k++) { string sradiobuttonname = "radiobutton_plctohmi_bool" + k.tostring(); radiobutton r = controls.find(sradiobuttonname, true)[0] radiobutton; r.checked = kepwarearrwordtobools_plctohmi[k]; } you retrieve radiobuttons first, , iterate them afterwards in memory this: var radiobuttons = this.controls.oftype<radiobutton>(); (int k = 0; k < numwords_for_plctohmi_bools * 16; k++) { string sradiobuttonname = "radiobutton_plctohmi_bool" + k.tostring(); radiobutton r = radiobuttons.single(x => x.name == sradiobuttonname); r.checked = kepwarearrwordtobools_plctohmi[k]; } this should more efficient.

linux - Exec format error while executing the file in embedded device from telnet -

i have embedded device consist of 32-bit arm-7 winbond cpu , uclinux os. have windows 7 64-bit machine. have install virtual box ubuntu compiling program uploading through ftp server. file in embedded device being executed telnet server. device has own vdi file unable open image in virtual box install ubuntu in virtual box. the problems are: when compile program , upload in device through ftp, while executing file telnet not execute program , shows "exec format error". debugged executable file shows " stack smashing detected ". how solve this? when copy sample code windows ubuntu server in virtual machine , loaded program in device through ftp not executed. , same did windows 7, uploaded sample code in device through windows ftp program being executed. why happens? you can't run program built different architecture. app built x86 64-bit architecture, , try run on 32-bit arm) have cross-compile program given architecture. here can read cros...

javascript - Jquery post response not available -

i'm new javascript, , problem may trivial need help. goal send post python server based on tornado. in following function : var machin = $.post( '/room/testroom', function( data ) { truc = data; return truc; i never content of truc . variable has url inside used create new websocket connection. when console.dir(machin); see wanted responsetext wanted url in console, i'm not able outside of console. the variable data inside function has wanted data, if : alert(data) see alert box wanted url. feel free ask me details may not entirely clear. server side, python code one: def post(self, roomname): print 'je poste' db = connect(host=config.sqlserver, user=config.sqluser, passwd=config.sqlpass, db=config.sqldb) cursor = db.cursor() uri = self.request.uri url = uri.split('/') roomname = url[2] sql = 'select roomid abcd_un roomname = %s', [roomname] cursor.execute(*sql) room...

python - Graphene-django - How to catch response of query? -

i use django , django graphene make graphql api. in view of application, use reactjs , react-bootstrap-table . react-bootstrap-table expects pass object array not support nested objects . i created query in schema.py : class applicationnode(djangoobjecttype): class meta: model = application filter_fields = ['name', 'sonarqube_url'] interfaces = (relay.node,) class query(objecttype): application = relay.node.field(applicationnode) all_applications = djangofilterconnectionfield(applicationnode) the answers these queries json nested objects this: { "data": { "allapplications": { "edges": [ { "node": { "id": "qxbwbgljyxrpb25ob2rloje=", "name": "foo", "sonarqubeurl": "foo.com", "flow":{ "id": "qybwbgljyxrpb45...

PHP can't login to MySQL server? -

i have client.php file in server a use database server server b . both centos. i have installed necessary services such php, phpmyadmin, mysql on both servers , @ first, encountered issue "reading initial communication packets, lost connection sql" when login using php file , researched, needed run following commands. setsebool -p httpd_can_network_connect=1 setsebool -p httpd_can_network_connect_db=1 after running commands, error message doesn't appear anymore doesn't log in @ all.. stuck in login page. do have allow features php able work mysql in centos remotely? please kindly out im newbie in linux.