Posts

python - library problems

i'm comparatively new python am carrying problems programming scapy, python network plan tool. however, i can't tell it's many scapy problem being-a-python-newbie problem. , give illustration way i'm means run possess machine: #! /usr/bin/env python import sys from scapy import sr1,ip,icmp p=sr1(ip(dst=sys.argv[1])/icmp()) if p: p.show() to i get: traceback (most new last): record "test.py", line 4, <module> scapy import sr1,ip,icmp importerror: can't import name sr1 so doubt following is: installing python libraries, i need change route anything similar? also, there something i run interpreter tell me essence scapy package? i run from scapy import * only fine, nonetheless given i have thought what's inside it, it's tough it.

class methods eventuality handlers javascript?

is there best-practice common proceed javascript have category members eventuality handlers? consider following rudimentary example: <head> <script language="javascript" type="text/javascript"> clickcounter = function(buttonid) { this._clickcount = 0; document.getelementbyid(buttonid).onclick = this.buttonclicked; } clickcounter.prototype = { buttonclicked: function() { this._clickcount++; alert('the symbol clicked ' + this._clickcount + ' times'); } } </script> </head> <body> <input type="button" id="btn1" value="click me" /> <script language="javascript" type="text/javascript"> var btn1counter = new clickcounter('btn1'); </script> </body> the eventuality handler buttonclicked gets called, nonetheless ...

creating stored way fly. risks/problems?

i am pondering formulating stored procedures fly. ie controlling emanate procedure... (web) concentration running. what risks problems cause? i know database comment needs have additional privileges. it does occur everyday. wholly time. i am controlling sql server prying mysql postgres well. update1: thanks comments, i am deliberation formulating new chronicle stored way switching over instead altering sp. example: sp1 -> sp2 -> sp3 update2: the reason: my schema changes since tradition fields (unknown array form columns) i attempted enterprising sql sp_executesql first. impetus works. enterprising sql works greate 1,2,3 rudimentary update,inserts. but got too dizzy lot work does brew good stored procedure, problems sql parameterization since used inside stored way array form params famous during accumulate (long story). at slightest simple unfolding fortitude complicated. the explanation sp does change. any tradition domain i have supplement new parameter sp supplement buttress ...

how name unparalleled nodes

i found describing muenchian method, nonetheless i cruise i'm requesting wrong. consider relapse set ages: /doc/class/person/descriptive[(@name='age')]/value 1..2..2..2..3..3..4..7 but i nodeset wholly node any age. 1..2..3..4..7 each seem relapse values, instead unparalleled values: /doc/class/person/descriptive[(@name='age')][not(value=preceding-sibling::value)]/value /doc/class/person/descriptive[(@name='age')]/value[not(value=preceding-sibling::value)] what am i missing?

round increments 2.5?

i need spin value adult nearest churned 2.5. for example: 6 --> 7.5 7.6 --> 10 etc. this seems best proceed this? duty roundtoincrement(byval originalnumber decimal, byval increment decimal) decimal low num = math.round(originalnumber / increment, midpointrounding.awayfromzero) * increment originalnumber mod increment <> 0 num < originalnumber then num += increment finish if relapse num finish function

clean adult record names visible studio's tabbed request interface?

inside visible studio digest i have following folders (for example) foo/ bar/ longfoldername/ when i open adult record longfoldername/ add-on gets labeled longfoldername/l...me.ascx i'd move longfilename.ascx (omitting name folder). any proceed set visible studio replace folder name labeling tab? edit: here add-on bar looks like: notice names files truncated past readability. i've got "eventcalendar," "monthlyeventcalendar," "weeklyeventcalendar" stands the rather tough tell difference. i know files usercontrols/. i vs stop explanation me? edit: the name record window | windows menu longfoldername/longfilename due window i switch vs mdi interface.

how combobox buttress twin information sources (for datagridview)

the information sources have same structure, nonetheless opposite data. used rows saved (view mode), rows being total edited (edit/new rows). acomplished? i have customary unfamiliar pivotal buttress references customary lookup list an id, name active (bit). combo box buttress uses lookup list arrangement list, nonetheless wholly active items. let's contend lookup vigilant used after deactivated (active = 0). combo box buttress shows errors since id found list. does anyone have any ideas solve it?