Posts

python - How do I implement a custom MIB in PySNMP? -

i have mib text file (do need make .py file somehow??). trying use pysnmp (not net-snmp). have been able connect device , print out info, info not helpful (just objectname, objectidentifier, etc). want able communicate device (send commands change , read values), of tutorials have seen seem of little help. know how can use custom mib communicate device? sites missing? http://pysnmp.sourceforge.net/ ok, need else... to use mibs pysnmp should first convert mib pysnmp format (which collection of python objects). conversion done pysnmp/tools/build-pysnmp-mib shell script in following manner: $ sh build-pysnmp-mib -h build-pysnmp-mib: illegal option -- h convert mib text file pysnmp-compliant module, see http://pysnmp.sf.net. usage: build-pysnmp-mib [-o pysnmp-mib-file ] [ mib-text-file ] make sure have libsmi installed (pysnmp scripts use smidump tool libsmi distribution). unless put new pysnmp mib file pysnmp/smi/mibs/ (which not idea), have point pysnmp location own m...

java - Specifying an applications number of work threads -

i'm working on application heavy number crunching. intended run on single computer. recently, we've started looking @ multithreading speed calculations. of algorithms can made run parallel without effort, , use fixed thread pool run each of sub tasks. what wondering is: how number of threads (the size of pool), typically specified these kinds of algorithms? suspect typically done using either configuration file, or commandline parameter, haven't seen examples that, wondering if there better ways. related this: relevant specify number of threads? thinking setting pool size number of assignable cores run fastest, thread-contention processing power in case of on assignment relevant performance? eg: setting 20 max threads on 4 core machine worse setting 4 max threads? edit: application intended sale, have no idea computers run on. i'm looking general guidelines, , best practices. a rule of thumb use number_of_cores + 1 threads (certain parallel build sy...

http - TCP Termination -

what happening tcp connection after end of http session? example, after loading static webpage webserver thanks a http session refers server keeping association specific user , potentially of length (using, instance, cookies association tokens). a http session therefore contains multiple tcp sessions. non persistent http connections, every request has own tcp session (and closed after). persistent http connections on other hand, multiple http resources fetched wihtin tcp session , either side close upon reached timeout threshold on either side. wikipedia article on persistent http connections (keep-alive: true)

Google Maps API V3 grey box on one site, works fine on another -

i have site http://beta.aico.co.uk/trained-installers.html , when loads grey box. have same code on following site (different template) http://joomla.bemoore.com/index.php?option=com_content&view=article&id=22&itemid=29 , works fine. therefore suppose must css issue, life of me can't figure out might be. has got idea problem is? thanks, bob it indeed css issue. here css rule culprit: div { overflow: hidden !important; overflow-y: hidden !important; overflow-x: hidden !important; } line 397 of trained-installers.html you'll need modify rule apply relevant divs, not divs.

Setting up django on apache (mod_wsgi, virtualenv) -

i'm putting django site in production first time please forgive ignorance. i'm trying put django site on apache. i've read documentation mod_wsgi , tried simple hello world configured ok. problem i'm having seems using virtualenvs it. wanna set things including virtualenvs , i'm ready future sites. to problem now. the error i'm getting in apache log is: no module named django.core.handlers.wsgi so seems not reading virtualenvs properly. this wsgi script: import os import sys import site site.addsitedir('/home/user/.virtualenvs/myapp/lib/python2.7/site-packages') path = '/home/user/django/myapp/myapp' if path not in sys.path: sys.path.append(path) sys.stdout = sys.stderr print sys.path os.environ['django_settings_module'] = 'myapp.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.wsgihandler() and error log apache. printed out sys.path can see looks like. [tue jun 05 14...

objective c - Whats different between two values -

this question has answer here: using iphone/objective c cgfloats: 0.1 okay, or should 0.1f? 1 answer what's different between: cgfloat gray[4] = {0.9f, 0.9f, 0.9f, 1.0f}; and cgfloat gray[4] = {0.9, 0.9, 0.9, 1.0}; ? i think same don't know sure. i believe indicating number float (i.e. single-precision floating point) opposed double (double-precision floating point),

java - Setting the value of a TextField to a Random number -

i writing android app has button calls selfdestruct() . there textview should show 1 or 2 , chosen randomly. however, if shows 1 , 1 set, same 2 . should create random number. this code, please me achieve this... public class mainactivity extends activity { /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); } @override public void selfdestruct(view view) { textview tx= (textview) findviewbyid(r.id.text); random r = new random(); int x=r.nextint(2-1) + 1; if(x==1) { tx.settext("1"); } else if(x==2) { tx.settext("2"); } } } this you: public class mainactivity extends activity { /** called when activity first created. */ @override public void oncreate(bundle savedinstance...