Posts

c - how to reuse the variable in linux kernel? -

extern unsigned long current_rx_time; export_symbol(current_rx_time); int netif_rx(struct sk_buff *skb) { current_rx_time = jiffies; } i modified kernel source code in dev.c shown above. later creating loadable kernel module in procfs , using currentrx_time send user space shown below : static int my_proc_show(struct seq_file *m, void *v) { //i printing value below seq_printf(m, "%lu\n", current_rx_time *1000/hz); return 0; } but getting error when compile module above current_rx_time undeclared. tell me how solve problem? first need declare variable , can export it. so declare in dev.c unsigned long current_rx_time; then export in dev.c export_symbol(current_rx_time); and in other loadable module want use (let's in temp2.c)... extern unsigned long current_rx_time; now make sure when going compile temp2.c @ time dev.c getting compile.

java - How to set delay time for the AsyncTask execution when it uses also another Thread? -

i set delay time in milliseconds class extends asynctask. class using java thread. there classes stream mjpeg on android few changes question: android ics , mjpeg using asynctask this class extends asynctask: public class getcameramjpeg extends asynctask<string, void, mjpeginputstream> { @override protected mjpeginputstream doinbackground(string... params) { try { url url = new url(params[0]); httpurlconnection connection = (httpurlconnection) url.openconnection(); connection.setrequestmethod("get"); if (username != null && password != null) { string authencoded = base64.encodetostring((username + ":" + password).getbytes(), base64.default); connection.setrequestproperty("authorization", "basic " + authencoded); } connection.connect(); return new mjpeginputstream(connection.getinputstream()); ...

c# - Thread Synchronisation : Threads having their own copy of string type lock -

recently came across code following: void callthisindifferentthreads(return return) { var lock = "lock"; lock(lock) { //do here. } } my first reaction lock in code won't work because creating lock , using in same method. every thread calling method has it's own copy of lock there no synchronisation. but later realized should work because string goes string pool , there 1 instance of particular string. i'm not sure if i'm correct. locking on strings super bad . don't it. have no guarantee other clever soul not lock on strings, , because "super" global because of string interning, moment becomes accepted practice, wheels fall off. lock private object has 1 purpose... locking. strings don't fit description. locking string. safe/sane? is ok use string lock object?

mysql - Joining three tables in SQL, Inner join does not work properly -

we have 3 tables, document , department , contact . all tables linked 'id' column. want result follows firstname lastname address upload_date department_name the below query fetches first 4 columns select contact.firstname, contact.lastname,contact.address , document.upload_date contact join document on document.id= contact.id , contact.status = 1 , document.defaultdoc=1 so it's inner join. but fetch last column, department_name added similar join contact.deptid=department.id , query returns 0 results. wrong ? if add join department on contact.deptid=department.id it should work.

ssl - server giving msxml3.dll error '80072f7d' when trying to access secure url -

for years have used classic asp connect secure site of supplier using msxml3.dll - since morning, getting; msxml3.dll error '80072f7d' error occurred in secure channel support i have had around , can see not 1 have seen - cannot find solution. the partner site has updated ssl certificate. if try connect remote url server using ie or chrome, fails connect reporting nonvalid digital signature on site's certificate. however, if try connect local computer, works without problem , can see server identity has been correctly established. any appreciated. in microsoft windows server 2003, applications use cryptography api (capi) cannot validate x.509 certificate. problem occurs if certificate secured secure hash algorithm 2 (sha2) family of hashing algorithms. applications may not work expected if require sha2 family of hashing algorithms. http://support.microsoft.com/kb/938397 fixed problem me.

git - How to properly set permission for github webhook -

i have set github webhook server auto pull specified branch repo. make work made www-data owner of repo files on server (else won't able write files). but read it's bad let www-data owner of files. case? if yes how can setup properly? thanks helping!

timedelta - How can I accurately display numpy.timedelta64? -

as following code makes apparent, representation of numpy.datetime64 falls victim overflow before objects fail work. import numpy np import datetime def showmedifference( t1, t2 ): dt = t2-t1 dt64_ms = np.array( [ dt ], dtype = "timedelta64[ms]" )[0] dt64_us = np.array( [ dt ], dtype = "timedelta64[us]" )[0] dt64_ns = np.array( [ dt ], dtype = "timedelta64[ns]" )[0] assert( dt64_ms / dt64_ns == 1.0 ) assert( dt64_us / dt64_ms == 1.0 ) assert( dt64_ms / dt64_us == 1.0 ) print str( dt64_ms ) print str( dt64_us ) print str( dt64_ns ) t1 = datetime.datetime( 2014, 4, 1, 12, 0, 0 ) t2 = datetime.datetime( 2014, 4, 1, 12, 0, 1 ) showmedifference( t1, t2 ) t1 = datetime.datetime( 2014, 4, 1, 12, 0, 0 ) t2 = datetime.datetime( 2014, 4, 1, 12, 1, 0 ) showmedifference( t1, t2 ) t1 = datetime.datetime( 2014, 4, 1, 12, 0, 0 ) t2 = datetime.datetime( 2014, 4, 1, 13, 0, 0 ) showmedif...