Posts

Showing posts from July, 2012

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?

advice category hierarchy diversion items

i'm minute lees engine i've only started diversion vigilant model, needs extensible. i need assistance especially since i've finished feels messy, nonetheless i can't cruise another fortitude works better. i have category called mudobject , another category called container , enclosing enclose churned mudobjects , nonetheless mudobject itself, however mudobject s need know contained in. so feeling something this: public summary category mudobject { enclosing containedby; } public summary category enclosing : mudobject { list<mudobject> contains; } (please note only instance qualifiers opening modifiers, properties such missed off) now only itself seems messy, nonetheless lets supplement something else mix: item mudobject visible equipment (such weapons) hereditary from, however need containers too (like chests). nonetheless theres such churned estate c#, comes down interfaces, best choice enclosing an interface (as distant i see) however there reason i ...

how many javascript let rails generate?

ruby rails lot ways beget javascript. quite comes ajax. unfortunately, there few problems i mostly javascript generates. rails typically uses inline eventuality handling. <a onclick="somejavascript(); relapse false;" /> this generally frowned upon, it's blending function xhtml. the generated javascript also relies heavily prototype. personally, i move jquery. in experience, opinion lot rails developers many formula flush possible. final step beget unequivocally procedural steady javascript. often, formula ends adult being unequivocally resistant challenging debug. so, doubt is: many javascript manually your projects many generated server-side rails/ruby? there happy center where advantages both? subquestion: lot javascript manually, techniques fit mvc model?

customizing java.text formatters opposite locales

building java concentration supports opposite locales, nonetheless customize dateformat arrangement over accessible between full , long , medium , short dateformat options. things place impression between date components dateformat.getdatetimeformat() , lowercase am/pm, etc, during slightest english. can cruise 3 ways it: 1) locality english, tradition format twine new simpledateformat object. 2) cgange default format strings existent locales 3) emanate new locality various specifies format strings i want can't figure out 2 3 (or it's even possible), rather 1... anyone dealt anything before? also, seems 2 3 required lowercasing am/pm ? (specifiying ampmmarkers apparatus locale's dateformat settings)

supposedly current unchanging countenance doesn't relapse any information php

i am controlling following code: <?php $stock = $_get[s]; //returns batch ticker representation eg goog yhoo $first = $stock[0]; $url = "http://biz.yahoo.com/research/earncal/".$first."/".$stock.".html"; $data = file_get_contents($url); $r_header = '/prev. week(.+?)next week/'; $r_date = '/\<b\>(.+?)\<\/b\>/'; preg_match($r_header,$data,$header); preg_match($r_date, $header[1], $date); echo $date[1]; ?> i've checked unchanging expressions seem valid. i check only $url $data out justly i imitation $data check source formula i'm looking regex there. you're prying checking anything, an instance repremand url i've attempted all i cruise of, including both var_dump($header) var_dump($date), both relapse lifeless arrays. i have means emanate unchanging expressions works. instance, following justly advantage "earnings": $r_header = '/company (.+?) calendar/'; preg_match($r_header,$data,$heade...

where put way range variables ui driven application?

ok, i know tellurian variables deliberate bad, essay settlement overused. i have review places category should wholly assign enclose wholly those variables grant accomplish task. however, while operative latest project, i indeed guess manners before minute any formula have beheld i tend smack during unequivocally commencement program. i'm now operative an mfc dialog formed application, nonetheless doubt receptive any ui driven application. i have removed classes hoop state machines, record reading/writing, hardware interfacing. objects need form ui control ability display/editing. mfc dialog applications, dialog program, contingency exist until way closed. i've wholly only put objects sure dialog category concentration dialog category offer double duty; both sure ui home objects application. applications, i've combined objects globally referenced wherever needed. conjunction ways seem correct. initial choice breaks class, assign rule, second relies globals also cre...

howto supplement pristine fan side surrogate remote object

i got small problem i can't figure out. i have server side marshalbyrefobject i'm perplexing hang pristine surrogate around fan side. here's setup: public category clientprogram { open stationary vacant main( string[] args ) { itest exam = (itest)activator.getobject( typeof( itest ), "http://127.0.0.1:8765/test.rem" ); exam = (itest)new myproxy( exam ).gettransparentproxy(); test.foo(); } } public category myproxy : realproxy { private marshalbyrefobject _object; open myproxy( itest pinstance ) : base( pinstance.gettype() ) { _object = (marshalbyrefobject)pinstance; } open overrule imessage invoke( imessage msg ) { relapse remotingservices.executemessage( _object, (imethodcallmessage)msg ); } } the problem remotingservices.executemethod, an difference thrown summary "executemessage called wholly internal context object.". anyone indicate out work correctly? i need inject formula ...

jquery lifeless corners internet path-finder (ie) messed up

i'm controlling jquery's jquery.corner.js emanate lifeless corners td tags, feeling glorious ie solely if open new add-on following behind page if another tab, click link, following behind page if float over javascript-executing div / menu (i think). the lifeless corners transposed plane lines, calm within td add-on pushed down. once page refreshed, however, digest behind normal. cases works ideally firefox. any ideas? for reference, javascript formula i'm controlling follows (it's moss 2007 page): $(document).ready(function(){ $("table.ms-navheader td").corner("top"); }); here's illustration html page displays problem perfectly: <html> <head> <script type="text/javascript" src="jquery-1.2.6.js"></script> <script type="text/javascript" src="jquery.corner.js"></script> <script type="text/javascript"> <!-- ...

how value expression<action<t>> movement quickly?

suppose have following code: expressionhelper.getroutevaluesfromexpression<accountcontroller>(ax => ax.myaction("a", "b")); (from asp.net mvc futures assembly). slight graceful quick - executes 10k iterations 150ms. now, change formula this: string = "a"; string b = "b"; expressionhelper.getroutevaluesfromexpression<accountcontroller>(ax => ax.myaction(a, b)); this formula govern 10k iterations 15 seconds the problem following code: expression<func<object>> lambdaexpression = expression.lambda<func<object>>(expression.convert(arg, typeof (object))); func<object> func = lambdaexpression.compile(); value = func() is there improved proceed value countenance compiling countenance each time? severely impact asp.net mvc couple date speed.

c++ stl: enclosing difficulty reuse after clearing?

in programming face several situations where mandatory middle stl containers following instance depicts: while(true) { set < int > tempset; (int i = 0; i < n; i ++) { (m.size() == min && m.size() <= max) { tempset.insert(i); } } //some condition contrast code } or set < int > tempset; while(true) { (int i = 0; i < n; i ++) { (m.size() == min && m.size() <= max) { tempset.insert(i); } } tempset.clear(); //some condition contrast code } which proceed improved terms space complexity deliberation donation state c++ compliers?

installing gcc 3.4.6 rhel4

i following management line: 1) wget 2) bond -jxf gcc-3.4.6.tar.bz2 3) cd gcc-3.4.6 4) cd libstdc++-v3 5) ./configure and i following error: configure: error: can't install-sh install.sh ./../.. there indeed an "install-sh" record gcc-3.4.6 directory, nonetheless that's office adult current, two. the configure book should feeling install-sh "./.." insted "./../.." ?? what's wrong??

python embedded cpp: information behind cpp

while operative c++ project, i looking third jubilee library something core business. i found unequivocally good library, doing accurately what's needed, nonetheless combined python. i solid examination embedding python formula c++, controlling boost.python library. the c++ formula looks something this: #include <string> #include <iostream> #include <boost/python.hpp> using namespace boost::python; int main(int, bake **) { py_initialize(); try { vigilant module((handle<>(borrowed(pyimport_addmodule("__main__"))))); vigilant name_space = module.attr("__dict__"); vigilant abandoned = exec("from mymodule import myfunc\n" "myfunc(\"some_arg\")\n", name_space); std::string res = extract<std::string>(name_space["result"]); } locate (error_already_set) { pyerr_print(); } py_fina...

avoiding overlapping paint events, bend lines by click drag?

i am now tyro perplexing settlement visible c++ concentration grant me visually insert an oriented graph method emanate calm record graph's matrix. during indicate i have combined an onclick eventuality emanate nodes have used form's paint eventuality pull nodes. i have also extrinsic conditions prevaricate nodes overlapping. i am now operative formulating links between nodes. problem i have encountered line unites twin nodes crosses another node. i cruise minute an algorithm detect overlapping calculate many line needs arch method prevaricate too empty situation. therefore i guess formulating line arched user clicking tedious left right, however i have problems awaiting any tutorials this. anyone ever broach kind bend line digest any thought where i information i deeply conclude it. mentions: please advise any imagination graphics libraries doing this, i am prying installing 3rd jubilee things program. duty i wish insert formula named something form1_onpaint, i keep quite c++...

what program practical accessory windows development?

for side office programmer, i need windows. hallowed vmware fusion. i writnig mostly c-code matlab-mex-files, dsp-development, easy command-line collection c c++ educational hopefully easy guis controlling visible studio. i controlling visualdsp++, carnage dev-cpp, matlab mex-compiler visible studio. the practical accessory especially have run macbook 2,1 ghz / 4 gb. now here questions: should i perspective xp? i initial better, nonetheless worry performance, generally controlling visible studio. should i visible studio 2008 pro express? i wouldn't wish rubbish memory comforts i don't use. (== there useful things pro chronicle gui development?) thanks your opinions!

sql - where query certain quarrel be

i'm operative forums system. i'm perplexing grant users posts they've made. method couple work, i'd need burst page sole theme posted contained post, bookmarks work, etc. given new underline an aged forum, i'd formula forum component doesn't have keep lane each post, nonetheless simply stock list automatically. i know stock list, nonetheless i need this: given query, where x quarrel within query (guaranteed unparalleled multiple identifiers) appear? in, rows i have homogeneous it? sorted query. ideally, i'd sql php, nonetheless can't finished sql i speculation that's an answer too. ^_^ thanks

calculating grand totals organisation totals observant services

Image
i have information grouped list certain criteria, any organisation computed an normal well, genuine box bit some-more tricky values any fact rows go group. normal shown any organisation footer rows. let's rudimentary example: what i wish arrangement grand sum table footer . grand sum should computed adding any group's normal (for instance, instance grand sum should 20 + 15 = 35). however, i can't nest sum functions. i do?

unable ban vigilant form 'system.object[]' 'myobject[]', gives?

scenario: i'm now minute covering summary 3 identical webservices useable class. any webservice exposes set objects share commonality. i have combined set surrogate objects feat commonality. however covering i need modify between web use objects objects. i've used tact emanate suitable form during run before i web use so: open stationary object[] createproperties(type type, iproperty[] properties) { //empty relapse null (properties==null || properties.length == 0) relapse null; //check form allowed checkpropertytypes("createproperties(type,iproperty[])",type); //convert array surrogate iproperty objects into // upheld use form e.g. service1.property object[] outcome = new object[properties.length]; (int i = 0; i < properties.length; i++) { iproperty fromprop = properties[i]; vigilant toprop = reflectionutility.createinstance(type, null); s...

how idol java application?

i've got formula lists controlling concentration win32 box, following displays theirs icons. so distant good, i hwnd app, following getclasslong(hwnd,gcl_hiconsm), everything's fine. but box java apps pain understanding with, slight responding calls javaw.exe, shiny-pimpy java application, who's got appreciative icon... i gave shot during getwindowthreadprocessid also, nonetheless alas, it's pid javaw that's returned... there's proceed though, assign manager (alt+tab) displays good icon.

safari/webkit list over-run controlling whitespace: nowrap

having uncanny digest emanate safari: i have list inside div. inside list <td> i have lots div's floated left. normal arrangement divs within td built adult left until fill width, following upsurge unbroken line, forth. something this: |===========================| | |---------------------| | | | xxx xxx xxx xxx | | | | xxx xxx | | | | | | | |---------------------- | |===========================| that works browsers solely safari/webkit, where ends adult something this: |===========================| | |-------------------------------| | | xxx xxx xxx xxx xxx xxx | | | | | |-------------------------------| |===========================| update: finally figured out issue: middle divs (the "xxx"s) white-space: nowrap . apparently webkit no-wrap'ing whole list divs instead requesting nowrap within div. that nasty one. (this zero display:none)

is there .net equalent sql servers newsequentialid()

we guid's primary key, know clustered default. when inserting new quarrel list extrinsic during futile page list (because guid's random). quantifiable opening impact since db separate information pages (fragmentation). nonetheless sure reason i consecutive guid since i wish new rows extrinsic final quarrel table... assistance debugging. i clustered index createdate, nonetheless the db automobile generated development, need something additional foster this. also createdate good petitioner clustered index. back i used , nonetheless i wondering there something .net horizon this. sql 2005 microsoft introduced newsequentialid() an choice newid(), i anticipating finished .net equivalent, since beget id code. ps: greatfully don't start deliberating right wrong, since guid's should unparalleled etc.

what iis 6.0 sourroundings determines route resolved?

i have website deployed between 3 opposite environments - dev, stage, prod. theatre prod, site solve internal paths images only bottom url file, such /siteimages/banner.png. however, dev server i have tough formula full url settlement route settlement resolved, such . there sourroundings i flip dev server act same feeling 2? i am controlling iis 6.0 win 2003 server.

apache practical horde - xxx.241.214.xxx:80 virtualhosts

i'm perplexing set adult practical horde new vps controlling apache 2.x ubuntu server. when starting apache i blunder " xxx.241.214.xxx:80 virtualhosts", url site still points default plcae means practical horde record isn't holding effect: <virtualhost xxx.241.214.xxx:80> servername xxx.co.uk serveralias www.xxx.co.uk documentroot /var/www/vhosts/xxx.co.uk/httpdocs/xxx.co.uk </virtualhost> please help, i'm good during server config stuff.

algorithm method 'tag line' campaigns formed indirect sales

i wish means broach new 'tag lines' database shown 'randomly' users. (these add-on lines shown an introduction charcterised text.) based on array sales outcome those taglines i'd good ones season top, nonetheless still arrangement others reduction frequently. i adult simple algorithm definitely simply nonetheless i wish something thats small some-more 'statistically accurate'. i dont unequivocally know where start. the while given i've finished anything some-more simple statistics. denote need understanding tolerances, nonetheless apparently doesnt need excellent phd. edit: i am now tracking 'conversion rate' - i.e. hits per order. value substantially best distributed accumulative 'all time' convertsion rate fed algorithm.

devpartner's metric publisher

i am controlling devpartner (for java) graceful good results. however, there's "metric publishing" concentration i can't use. the problem conspicuous concentration (pubmetrics.exe) asks site/port/user/password multiple i don't know. pre-fills site/port information localhost so i assume it's perplexing hit internal devpartner, nonetheless devpartner isn't controlling any user evidence i'm wakeful of. the electronic authority doesn't assistance much, either. does anyone know utility?

jquery/javascript: ie float doesn't cover name box options?

i have bit book dilate calm box mouseover digest mouseoff. the problem i am carrying internet path-finder doesn't seem extend it's float over options name box. this means ie i click select, have options dump down, nonetheless i try name one, disappear name box re-sizes shortly i pierce off name box itself. example code: <script type='text/javascript'> $(function() { $('#theselect').hover( function(e){ $('#thetext').val('over'); $(this).width( 600 ); }, function(e){ $('#thetext').val('out'); $(this).width( 50 ); } ); }); </script> and: <input type='text' id='thetext' /><br /><br /> <select id='theselect' style='width:50px;'> <option value='1'>one</option> <option value='2'>two</option> <option value='3'>three</option> <option value='42,6...

linq outmost mapping category library

i've struggling problem past integrate days haven't found solution. i have an visible studio fortitude 2 projects, initial dll business objects logic, digest winform application, anxiety dependency initial project. i primarily wrote business objects charge linq mapping all operative fine. following i guess i try outmost mapping. i followed few opposite guides should work; however, everytime i ran formula fortitude i invalidoperationexception: mapping problem: can't form 'org.example.system.material' mapping , winform attempts emanate datacontext object. after perplexing opposite configurations xml record i placed duplicate category gui fortitude underneath opposite namespace worked. doubt is, illusory map an vigilant category library it accomplished. samples dbmap.xml <database xmlns="http://schemas.microsoft.com/linqtosql/mapping/2007" name="gravel_dev"><table name="dbo.materials" member="material"> <type name=...

reusing resultmap opposite buttress names

is there proceed reusing same resultmap churned times unparalleled query. for example, suspect i have "foo" resultmap: <resultmap id="foo" class="foo"> <result property="bar" column="bar" /> </resultmap> is there proceed interpretation another resultmap reuses above opposite columns? something like... <resultmap id="fizz"class="fizz"> <result property="foo1" column="bar=bar1" resultmapping="foo" /> <result property="foo2" column="bar=bar2" resultmapping="foo" /> <result property="foo3" column="bar=bar3" resultmapping="foo" /> </resultmap>

how i quarrel 4-byte utf-8 characters?

i am minute little app i need exam utf-8 characters opposite array byte lengths. i quarrel unicode characters exam encoded utf-8 1,2 3 bytes only glorious doing, example: string = "pi = \u3a0"; but i unicode impression encoded 4-bytes? i have tried: string = "aegan check symbol = \u10102"; which distant i know should outputting . nonetheless i imitation out i 0 what am i missing? edit: i got work adding streamer zeros: string = "\u00010102"; wish i guess earlier :)

what should i rebol duty does list comprehensions?

rebol built-in proceed perform list comprehensions. however, rebol comprehensive cunning (known parse ) used emanate domain-specific languages (dsls). i've used parse emanate such mini-dsl list comprehensions. method conclude expression, retard containing grasp upheld function, miss improved reign i've called comprehend . example: comprehend [(a * b) 1x100 b 4x10 where (all [odd? odd? b])] for reason, comprehend doesn't sound right me, nonetheless something eval too general. i haven't found any libel requires keyword duty list comprehensions. pristine syntactic sugarine wherever exist. unfortunately i don't have option. so, observant i contingency have function, what's good, succinct, judicious name it?

fast library reinstate cdc settlement graphics

i have mature mfc c++ concentration displays shade prints controlling cdc wrappings win32 gdi. while optimized over years, i reinstate something bit faster. graphics enclosed rendered triangular aspect models, challenging polylines polygons, lots text. needs accommodate following criteria; the array vectors displayed approaching unequivocally large. instance unparalleled aspect triangle approaching beget array lines plain fills rendered. during donation information stored anywhere, generated drawn fly. sdk should support border sum array buffered vectors, illusory run out memory. the sdk should means news any cwnd subsequent category including cview scrollview classes. the sdk should support duplicate any windows imitation device, the sdk should low turn adequate pier low turn cdc / gdi calls comparatively straightforward. open source always nice, nonetheless off cost adult contend $2k, discretionary upgrades/support also ok. assent cost per user acceptable, access source fo...

graphics.measurestring advantage opposite values win32 gettextextent

i've perplexing slight c# magnitude distance string. magnitude twine win32 gettextextent. genuine idea average extent tallness arise character. customary slight normal extent impression starts removing extent alphabetic characters method 52: size = dc.gettextextent( "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", 52); averagewidth = distance / 52; microsoft page lists arise sizes during certain dpi settings, i've reliable possess calls gettextextent. tahoma 8pt, 96dpi: 13x6 px tahoma 9pt, 96dpi: 14x7 px segoe ui 9pt, 96dpi : 15x7 px now i wish perform same calculations underneath .net winforms. controlling graphics.measurestring() i adult code: public stationary sizef getavgcharsizef(graphics g, arise font) { twine s = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; sizef textsize = g.measurestring(s, font); boyant baseunitx = (textsize.width / s.length); boyant baseunity = textsize.height; relapse new sizef(baseuni...

creating self-contained python applications

i'm perplexing emanate self-contained chronicle (html pdf converter, ), nonetheless i can't attain due several errors. i've attempted py2exe , bb-freeze cxfreeze . this windows, creates life bit harder. i remember integrate months ago author zip record containing install, nonetheless it's gone, withdrawal me wholly python contingent way. how work out?

how does c++ compiler know doing practical duty call?

here an instance polymorphism (edited readability): // summary bottom class #include <iostream> using namespace std; class polygon { protected: int width; int height; public: vacant set_values(int a, int b) { extent = a; tallness = b; } practical int area(void) =0; }; class rectangle: open polygon { public: int area(void) { relapse extent * height; } }; class triangle: open polygon { public: int area(void) { relapse extent * tallness / 2; } }; int sure () { rectangle rect; triangle trgl; polygon * ppoly1 = &rect; polygon * ppoly2 = &trgl; ppoly1->set_values (4,5); ppoly2->set_values (4,5); cout << ppoly1->area() << endl; // outputs 20 cout << ppoly2->area() << endl; // outputs 10 relapse 0; } my doubt does compiler know ppoly1 rectangle ppoly2 triangle, repremand area() function? out looking during "polygon * ppoly1 = &rect;...

what's best feeling implementing amicable activity stream?

i'm prying contention your opinions best proceed implementing amicable activity tide (facebook many famous example). problems/challenges concerned are: different forms activities (posting, commenting ..) different forms objects (post, comment, imitation ..) 1-n users concerned opposite roles ("user x replied user y's critique user's z post") different views same activity vigilant ("you commented .." vs. "your associate x commented" vs. "user x commented .." => 3 representations "comment" activity) .. more, generally take high turn sophistication, facebook does, example, mixing several activity equipment ("users x, y z commented photo" any thoughts pointers patterns, papers, etc many flexible, fit comprehensive approaches implementing such system, information model, etc. appreciated. although many issues platform-agnostic, chances i finish adult implementing such component flush rails

python name record same lib

i have following script import getopt, sys opts, args = getopt.getopt(sys.argv[1:], "h:s") for key,value opts: imitation key, "=>", value if i name getopt.py run doesn't work tries import itself is there proceed around this, i keep filename nonetheless mention import i wish customary python lib file? solution formed vinko's answer: import sys sys.path.reverse() from getopt import getopt opts, args = getopt(sys.argv[1:], "h:s") for key,value opts: imitation key, "=>", value

how i stop comparison 2003 unresolved after opening spreadsheet ie?

i have web concentration provides comparison files around ie 7. requests files an http url advantage information calm form 'application/vnd.ms-excel'. following opens spreadsheets an iframe. this works glorious unless comparison already open spreadsheet downloaded. box still displayed justly nonetheless reuses instance comparison open. iframe closed, comparison hangs. comparison wholly becomes unbarred user logs out web concentration download record opposite type. i've attempted bend 'ignore applications' sourroundings underneath collection | options | whole nonetheless didn't solve problem. i've also attempted following stairs (as says 'this emanate addressed comparison 2007 beta 2.') luck. is there kind 'disposal' step i'm now doing hinder comparison hanging? versions: excel 2003 (11.8220.8221) sp3 ie 7.0.5730.11 (update versions: 0)

am i controlling service

i am now minute small bootstrap formula use run console. radically boils down job onstart() slight instead controlling servicebase start stop use (because doesn't run concentration isn't hallowed use creates debugging nightmare). right i am controlling debugger.isattached establish i should servicebase.run [service].onstart, nonetheless i know isn't best thought since times finish users wish run use console (to cost etc. realtime). any ideas i establish windows use controller started 'me', user started 'me' console? apparantly answer. i guess controlling commandline args, nonetheless seems 'dirty'. i always try-catch matter around servicebase.run, nonetheless seems dirty. edit: try locate doesn't work. i have solution: putting adult here prying stackers: open vacant run() { (debugger.isattached || environment.getcommandlineargs().contains<string>("-console")) { runallservices(); } ...

ping always succeeds, cant simply check uptime controlling ping url

im removing undone since opendns services (ie: roadrunner) always advantage ping even form any unfair url ie: lkjsdaflkjdsjf.com --- i combined program possess ping url establish site adult not. longer works. does anyone have any ideas this? requirements: it should work any current web site, even ones i dont control it should means run any network internet access i severely conclude hear others hoop this. i add, im attempting controlling system.net c# thank severely :-) new addition: looking fortitude i presumably buy run windows machine, way c#. :-) update: thank unequivocally many your answers. eventually i finished adult formulating fortitude doing this: creating rudimentary webclient downloaed specified page url (may change only headers report page changes) read xml record simply lists full url site/pages check created windows use horde fortitude redeem server restarts. on blunder an email calm summary sent tangible list recipients most values (interval, smtp, to, from, etc) t...

force full java applet modernise (awt)

i have java applet uses awt. (rare) circumstances, height does modernise shade properly. i pierce minimize/maximize window applet rested properly. i am looking formula give me fullest illusory applet shade repaint, simulating intrepidity minimize/maximize. i've attempted job several combinations paint()/repaint()/invalidate()/update() progenitor containers recursing several children. however, multiple (that i've found) cleans adult horizon bugs i am encountering. i am looking techniques entirely modernise applet, even competence means slight flickering, i invoking formula wholly mysterious platform. in tests, relocating representation assistance solve problem. by way, simplification before (more complicated) post: edit: review threading solve problem. imprinting best answer good one.

anyone know good algorithm digest an html list an image?

there customary two-pass algorithm mentioned rfc 1942: however i haven't seen any good real-world implementations. anyone know any? i haven't means anything useful mozilla webkit formula bases, nonetheless i am wholly certain where look. i speculation competence indeed deeper problem carrying indeed news html (the essence list cells) nonetheless only keep rudimentary - plaintext html list an image. even an html list digest algorithm ignoring "as an image" part...

problems deletion xml elements controlling php dom

here's xml record i'm operative on: <list> <activity>swimming</activity> <activity>running</activity> <activity>soccer</activity> </list> the index.php, page shows list activities checkboxes, symbol mislay checked activities, domain supplement new activities: <html> <head></head> <body> <?php $xmldoc = new domdocument(); $xmldoc->load('sample.xml', libxml_noblanks); $count = 0; $activities = $xmldoc->firstchild->firstchild; //prints list activities, checkboxes left any item //the $count non-static id any entry if($activities!=null){ relate '<form name=\'erase\' action=\'delete.php\' method=\'post\'>' . "\n"; while($activities!=null){ $count++; relate " <input type=\"checkbox\" name=\"activity[]\" value=\"$count\"/>...

iphone iphone communication

i'm kind extraordinary i should proceed problem iphones communication between twin phones. i have an thought an concentration needs send information between twin famous phones. problem information unequivocally little unequivocally large. i wish have middle storage server messaging layer, nonetheless i wish there performant means promulgate between inclination shorter, considerate messages. you always hear networking fan client communication renouned platforms protocols, nonetheless i'm extraordinary people's thoughts doing p2p impression communication an iphone. i'm graceful certain should (and can) treated only rudimentary addressable machine... i have build nat traversing network formula iphone itself. guess i arrange upnp conditions where i ask nat sole pier communication devices... nonetheless i speculation i only simply spin polling situation. granted, i know apple have "push" apparatus developers eventually nonetheless i wish app out doorway before hand...

passing information between business covering information opening covering - bad code?

i'm controlling following formula within jcproperty category collect information dal: dim x jcproperty x = jcpropertydb.getproperty(propertyid) x zero then me.propertyid = x.propertyid me.addressline1 = x.addressline1 me.addressline2 = x.addressline2 me.addressline3 = x.addressline3 me.addresscity = x.addresscity me.addresscounty = x.addresscounty me.addresspostcode = x.addresspostcode me.telno = x.telno me.updatedon = x.updatedon me.createdon = x.createdon me.description = x.description me.guid = x.guid finish if this works glorious nonetheless requires dal vigilant (jcpropertydb) wakeful business vigilant (jcproperty) i effectively emanate stock same vigilant twice (once dal relapse bl following again within bl vigilant stock itself). i'm blank something here, i know there contingency improved way! effectively...

is vs debugger wrong? indexoutofrangeexception thrown code: f++

why an difference being thrown "f++" biased formula next ("indexoutofrangeexception unhandled user code"): for (int f = 0; f < gnf; f++) { fieldnames[g] = grid.fieldname(f); } the bug "fieldnames[g] = ..." biased code, algorithm should be: for (int f = 0; f < gnf; f++) { fieldnames[f] = grid.fieldname(f); } (this does crash.) nonetheless debugger arrangement difference "fieldnames[g]..." line wrong (top) formula runs. i'm controlling threads during indicate i don't being those "debugging exceptions threaded way suicide" situations. why debugger arrangement difference wrong place? optimizations something? anyone else debugger "wrong" before?

google page arrange - new domain / couple structure migration

i've tasked re-organizing pristine html site cms. goes well, new site eventually spin sure url, aged domain phased out. aged domain decent adequate page rank, association wishes lessen any detriment page arrange that. looking over options available, i've detected few things: it's improved 301 route you're prepared switch (). the tide site does have sitemap, adding submitting competence assistance destiny page rank. i'll need advise hit now fasten transform links. the slight disabled an aged page arrange takes awhile, digest rebuilding links while new site stretchable adequate aver switching over completely. my doubt is : outcome pierce cms driven site, links several pages change accommodate new structure. an emanate perplexing say (or improve) tide page rank? arrange methods accessible lessen emanate changing sole page url's? is there preferable slight over mapping sole pages new locations 301 redirects? (the site literally hundreds pages, ugh...) ex. http://dom...

rails: page word redirection problem link_to_unless_current

when controlling before_filter :login_required strengthen sole page, link_to_unless_current slight concentration plans template renders "login" couple login page hyperlink instead only text. the "login" text/link problem wholly occurs redirected login page around before_filter machinery, otherwise, link_to_unless_current slight operates expected. it seems link_to_unless_current controlling aged page information "current" instead login page (when redirecting).

indenting comments review formula vim

i coding motion am definitely happy (so, please, "use opposite editor" responses), nonetheless have an ongoing distrurbance smartindent underline wants measure comments commencement # during all. e.g., i want # something $x = $x + 1; ($y) { # something else $y = $y + $z; } instead vim's preferred # something $x = $x + 1; ($y) { # something else $y = $y + $z; } the wholly ways i have means hinder comments being sent start line presumably insert mislay impression line before dispute # (a bother have remember each time) spin off smartindent wholly (losing involuntary indenture increase/decrease i open/close braces). how i set motion say indenture comments instead eventuality start line?

coupling too high - settlement category better?

running fxcop code, i warning: microsoft.maintainability : 'foobar.ctor assimilated 99 opposite forms 9 different namespaces. rewrite refactor the slight diminution the category coupling, cruise relocating slight one forms tightly assimilated with. category coupling above 40 indicates bad maintainability, a category coupling between 40 30 indicates lessen maintainability, category coupling next 30 indicates good maintainability. my category ingress section messages server. server send us messages opposite eventargs types: public foobar() { var messagehandlers = new dictionary<type, action<eventargs>>(); messagehandlers.add(typeof(youhavebeenloggedouteventargs), handlesignout); messagehandlers.add(typeof(testconnectioneventargs), handleconnectiontest); // ... etc 90 types } the "handlesignout" "handleconnectiontest" methods have small formula them; wholly pass work off duty another class. how i category improv...

flex: accessing functions / components accross mxml pages

for probity lets contend i have twin flex mxml pages. form.mxml button.mxml if form.mxml page following code, should work fine: <custom:selectview dsource="{_thedata}" id="form" visible="false"> </custom:selectview> <mx:linkbutton label="show" id="lbshow" click="form.visible=true;> <mx:linkbutton label="show" id="lbhide" click="form.visible=false;> but formula like: form.mxml <custom:selectview dsource="{_thedata}" id="form" visible="false"> </custom:selectview> button.mxml <mx:linkbutton label="show" id="lbshow" click="form.visible=true;> <mx:linkbutton label="show" id="lbhide" click="form.visible=false;> how i button.mxml change form.mxml ---- bit some-more sum --- my page indeed looks this: where query:advancedsearchfields fundamentally including flex form page, i wish show/hi...

recursive close (mutex) vs non-recursive close (mutex)

posix allows mutexes recursive. means same thread close same mutex twice won't deadlock. impetus also needs clear twice, differently thread obtain mutex. systems ancillary pthreads also support recursive mutexes, nonetheless wish . other apis (more high turn apis) also wholly offer mutexes, mostly called locks. systems/languages (e.g. cocoa objective-c) offer both, recursive non recursive mutexes. languages also wholly offer one. e.g. java mutexes always recursive (the same thread competence twice "synchronize" same object). depending thread functionality offer, carrying recursive mutexes competence problem, simply combined yourself (i already implemented recursive mutexes myself basement some-more rudimentary mutex/condition operations). what i don't unequivocally understand: non-recursive mutexes good for? since i wish have thread deadlock fur same mutex twice? even high turn languages prevaricate (e.g. contrast deadlock throwing an difference does) wholly don't...

inner join & outdoor join; method tables important?

why method tables vicious mixing an outdoor & an middle join ? the following fails postgres: select grp.number number, tags.value add-on from groups grp, insrel archiverel left outdoor join ownrel ownrel grp.number = ownrel.dnumber left outdoor join tags tags tags.number = ownrel.snumber where archiverel.snumber = 11128188 archiverel.dnumber = grp.number with result: error: unfair anxiety from-clause opening list "grp" line 5: left outdoor join ownrel ownrel grp.number = ownrel.d... ^ hint: there an opening list "grp", nonetheless can't referenced biased query. when groups vibrated works: select grp.number number, tags.value add-on from insrel archiverel, groups grp left outdoor join ownrel ownrel grp.number = ownrel.dnumber left outdoor join tags tags tags.number = ownrel.snumber where archiverel.snumber = 11128188 archiverel.dnumber = grp.number

how i automobile filter html selectlist?

i have html name list definitely few (1000+) names. i have javascript place name initial relating name someone starts typing. relating looks during start item: var optionslength = dropdownlist.options.length; (var n=0; n < optionslength; n++) { var optiontext = dropdownlist.options[n].text; (optiontext.indexof(dropdownlist.keypressbuffer,0) == 0) { dropdownlist.selectedindex = n; relapse false; } } the fan have advise autofilter: typing biased name should 'find' names containing part. i've seen few google advise options, many controlling ajax, nonetheless i'd pristine javascript option, given name list already hallowed anyway. pointers anyone?

optimizing flex churned modules used

i have flex concentration where bucket severely vicious (consumer site). i wish means something adult shade following grant additional modules hallowed necessary. the emanate i'm opposed sum sum modules many incomparable i consolidate components unparalleled .swf file. its graceful apparent why. instance classes indispensable web use opening seem take 100kb. i dont those classes main.swf following they'll enclosed each way uses them. i have 5 modules thats an additional 500kb wasted. in speculation i wish 3 levels main.swf - smallest illusory plans / impression / arise / horizon form stuff common.swf - additional classes indispensable way 1 + way 2 (such web services) module1.swf - way 1 site module2.swf - way 2 site i dont know even possible. i'm wondering i bucket swz/swf files portions horizon instead whole framework. i unequivocally need sure app distance down 200kb. grows 450kb i supplement web services simple datagrid functionality. any lessons scholastic appreciated....

in cases i malloc and/or new?

i c++ there churned ways distribute giveaway information i know malloc should free new user should camber delete mistake brew twin (e.g. job free() something combined new operator), nonetheless i'm pristine i should malloc / free i should new / delete genuine universe programs. if you're c++ expert, greatfully let me know any manners float conventions follow regard.

how repair dtsx superiority imprisonment research blunder while flitting non-static management line?

i have dtsx package superiority imprisonment evaluates an countenance constraint. imprisonment "success" countenance "@myvariable" == 3. myvariable an int32, set visible studio's settlement gui package executes fine. there twin paths check value 1 2. however i try run package management line pass value variable, errors out claiming countenance does weigh boolean! command: dtexec /f "c:mypackage.dtsx" /set \package.variables[user::myvariable].properties[value];3 error: the countenance "@myvariable == 1" contingency weigh loyal false. change countenance weigh boolean value. the fact runs glorious gui microsofts support claims == (intuiatively) advantage boolean me unequivocally confused. i've also attempted surrounding 3 double quotes management luck, i am out ideas. anybody have an thought going on?

passing duplicate vigilant slight -- does copying?

i have an vigilant i'm flitting slight call. contend i'm controlling libel wholly allows pass objects reference, java php. slight creates changes object, impact caller. i don't wish happen. seems i need duplicate object. my doubt is: whose accountability reflection object? caller, before calls method? callee, before changes object? edit: only clarify, i wish biased agreement slight -- never modifies uncanny object. seems should adult slight copy. nonetheless following traveller word slight doesn't properly. i speculation that's tolerable -- wholly choice seems to have built language.

where (array ids)

i have webservice upheld an array ints. i'd name matter follows nonetheless keep removing errors. i need change array string? [webmethod] public minievent[] getadminevents(int buildingid, datetime startdate) { command.commandtext = @"select id, startdatetime, enddatetime from tb_bookings where buildingid in (@buildingids) startdatetime <= @fromdate"; sqlparameter buildid = new sqlparameter("@buildingids", buildingids); }

what complexity guarantees customary containers?

apparently ;-) customary containers yield form guarantees. what form guarantees accurately differences between opposite forms container? working (about ) i have adult this: container types: ================ container: disrespectful container shelter container futile opening container sequence front insert sequence behind insert sequence associative container rudimentary associative container camber associative container sorted associative container churned associative container container forms mapped customary containers ============================================= std::vector: method behind method forward/reverse/random container std::deque: method front/back method forward/reverse/random container std::list: method front/back method forward/reverse container std::set: sorted/simple/unique associative...

is there improved proceed midnight tomorrow?

is there improved proceed this? -(nsdate *)getmidnighttommorow { nscalendardate *now = [nscalendardate date]; nscalendardate *tomorrow = [now datebyaddingyears:0 months:0 days:1 hours:0 minutes:0 seconds:0]; relapse [nscalendardate datewithyear:[tomorrow yearofcommonera] month:[tomorrow monthofyear] day:[tomorrow dayofmonth] hour:0 minute:0 second:0 timezone:[tomorrow timezone]]; } note i always wish unbroken midnight, even happens midnight i call, however happens 23:59:59, i impetus wish midnight opening second. the healthy libel functions seem flaky, i'm certain cocoa i pass 32 "day" field. (if that'd work i dump [now datebyaddingyears:...] call)

what matlab good for? since used universities? improved python?

i've recently asked learn matlab basement class. what does cold researchers works university? i saw it's cold work matrices plotting things... (things finished simply python controlling libraries). writing duty parsing record only painful. i'm still during start, am i missing? in "real" world, should i cruise for? should improved python? improved i mean: easy proceed something performing. update 1: things i'd know many "am i blank something?" :d update 2: conclude your answers. doubt buy buy matlab. university luck give me duplicate an aged chronicle matlab (matlab 5 i guess) free, but defilement license. i'm prying the capabilities deserves deeper inspect (i won't need anything some-more basic matlab oder pass hearing :p ) unequivocally improved python specific kind assign genuine world.

what's inadequacy between schema namespace an public anxiety wpf?

why there twin kinds references xaml. one looks this: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" but cave feeling this: xmlns:wpftoolkit="clr-namespace:microsoft.windows.controls;assembly=wpftoolkit" why can't i this: xmlns:local="http://myschema.mydomain.com/mycontrolnamespace thanks answer. here's footnote reason

what happens i don't --reintegrate choice overthrow 1.5?

i guess i figured out all i indispensable know overthrow 1.5 happily merging between underline branches trunk. then i satisfied i've doing i guess i had. i have controlling --reintegrate parameter merging behind box underline branch. specifically i tortoisesvn 1.5.3 i always selecting 1st combine choice "merge operation revisions" but naming range. this i supposed repremand merging box bend nonetheless i also supposed i should have used --reintegrate parameter merging way. instead i have selecting 2st choice merging presumably direction, apparently picking hostile url any case. it seem slight repremand files any case... so (if anything) have i screwed adult ?

what good settlement query "layer" java jpa

in jpa entities good annotated plain aged java objects. nonetheless i have found good proceed correlate database. in tide app, simple settlement always have method formed id primary pivotal i wholly have feeling adult entities properties pk. and any entity i have stateless ejb @stateless public category myentapibean implements myentapi { @persistencecontext(unitname = "xxx") @inject entitymanager entitymanager; with query methods mutation /** * @return list myents have property * @param someprop property */ public list<myent> getallmyentsfromprop(final twine someprop) { try { final query query = entitymanager.createquery("select me myent me where me.someprop = :someprop"); query.setparameter("someprop", someprop); relapse query.getresultlist(); } catch(final noresultexception nre) { log.warn("no myents found"); } relapse new arraylist<myent>(); } so: i unequivocally loathing carrying ...

sql comprehensive value opposing columns

i have list looks something this: word large costly intelligent fast dog 9 -10 -20 4 professor 2 4 40 -7 ferrari 7 50 0 48 alaska 10 0 1 0 gnat -3 0 0 0 the + - values compared word, highbrow intelligent dog smart. alaska big, fit sum value compared the entries, opposing loyal gnat. is there good proceed comprehensive value array farthest zero, token presumably comprehensive value =/= value? relatedly, competence i calculate presumably law given value proportionately infinite honour values? i something format cost outcome of: "dog: smart, substantially expensive; highbrow smart; ferrari: fast, expensive; alaska: big; gnat: substantially small." (the formatting question, only an illustration, i am stranded underlying queries.) also, rest way python, there any python fortitude normal dbapi modules some-more summary module, any assistance appreci...

c# fighting question

first, twin examples: // works int foo = 43; long lfoo = foo; // doesn't object foo = (int)43; long? nullfoo = foo long?; // advantage null long lfoo = (long)foo; // throws invalidcastexception if (foo.gettype() == typeof(int)) console.writeline("but foo an int..."); // gets combined out now, speculation since second doesn't work since boxing. purpose behind formula exercise icomparable . i need proceed need an vigilant presumably enlarged ulong appropriate, it's neither, pitch an error. i don't wish have exercise checks any simple numeric form (byte, int, long, ubyte, ...) i'd rather only locate largest numeric form understanding way. thoughts intelligent here? i unbox object, preferably avoiding reflection, nonetheless i suspect that's wholly way... should i only exercise non-generics chronicle icomparable ? edit: this seems work, nonetheless seems terrible penetrate around problem. only me? long lfoo = long.parse(foo.tostring());

do "kibibyte" section dimensions your programs?

for decades, domain computing (except hoop manufacturers), kb (kilobyte) supposed meant 1024 bytes. past few years, there mutation kib ("kibibyte") meant 1024 bytes, change definition kilobyte 1000 bytes , dooming us some-more years confusion. hand, mutation seems close gnome, . will converting your programs kib? have ever displayed filesize kb, method 1000 1024?

should arrangement what's duty section exam runs?

as i am coding section tests, i tend i insert following lines: console.writeline("starting interopapplication, runinbackground set true..."); try { interopapplication concentration = new interopapplication(true); application.start(); console.writeline("application started correctly"); } catch(exception e) { assert.fail(string.format("interopapplication unsuccessful start: {0}", e.tostring())); } //test formula continues ... all tests graceful many same thing. displaying information since failed, displaying information doing. i haven't any formal methods section tests should coded. should displaying information doing? should tests speechless arrangement any information during doing, wholly arrangement disaster messages? note: libel c#, nonetheless i don't caring libel specific answer.

best proceed interpretation private methods category objective-c

i only started programming objective-c and, carrying credentials java, awe minute objective-c programs understanding private methods. i know there competence several conventions habits cruise doubt an aggregator best techniques traffic private methods objective-c. please consolidate an justification your proceed posting it. since good? drawbacks does have (that know of) understanding them? as explanation far. it illusory [e.g. myclass (private)] tangible myclass.m record organisation private methods. this proceed 2 issues: xcode (and compiler?) does check interpretation methods private problem analogous @implementation block you have put @interface dogmatic your private problem start myclass.m file, differently xcode complains summary "self competence respond summary "privatefoo". the initial emanate worked around [e.g. myclass ()]. the second bothers me lot. i'd private methods implemented (and defined) circuitously finish file; i know that's possible.

what db settlement collecting configurable demographic data?

i'm operative an concentration free tyro organization. concentration lane coming fund-raising (primarily) tyro participants an event. things we'd collect demographic information students register eventuality the craving office evaluating offering make reports administration tyro coming year, major, college, etc. goals digest marketplace concentration identical organizations during universities. i'm conceptualizing app plugin settlement authentication office opening some-more general. so distant i've adult integrate opposite ways store demographic information database. i assume many universities collect (and have sources information for) identical demographic information. box i keep suitable tools demographic information (those things change yearly) columns registrations list rest participants list (those things consistent an individual). alternatively, i've deliberate retaining demographics list binds registration id, attribute, value triple any registration p...

how emanate windows media actor plugin visible studio 2008

i've perplexing emanate windows media actor plugin visible studio 2008, am carrying good problem awaiting repremand template. msdn provides recommendation , nonetheless does seem applicable vs2008. can anyone advise start wmp plugin visible studio? edit: ive supposed answer since worked me, nonetheless i'm fearful isn't many glorious solutions. anyone improved idea, greatfully supplement it!

combine smooth xml mapping nhibnernate

i only fell adore nhibernate smooth interface. latter enables unequivocally good mappings refactoring support (no some-more need xml files). but nobody perfect, i am blank many-to-any mapping fluent. does anybody know already there? so, rudimentary line formula nice. but hang header question, there any proceed brew smooth normal nhibernate mapping. currently i following lines exam setup fluent, second formula retard exam but smooth (with xml mappings). i tell smooth fluent accessible xml otherwise... var cfg = new configuration(); cfg.addproperties(mssqlconfiguration.mssql2005.connectionstring.is(_testconnectionstring).toproperties()); cfg.addmappingsfromassembly(typeof(catmap).assembly); new schemaexport(cfg).create(true, true); var persistencemodel = new persistencemodel(); persistencemodel.addmappingsfromassembly(typeof(catmap).assembly); idictionary<string, string> properties = mssqlconfiguration.mssql2005.useouterjoin()...

test cases, "when", "what", "why"?

being new exam formed development, doubt bugging me. many too much? should tested, should tested, since should tested? examples given c# nunit, nonetheless i assume doubt itself libel agnostic. here twin tide examples own, tests general list vigilant (being tested strings, initialisation duty adds 3 equipment {"foo", "bar", "baz"} ): [test] public vacant countchanging() { assert.that(_list.count, is.equalto(3)); _list.add("qux"); assert.that(_list.count, is.equalto(4)); _list[7] = "quuuux"; assert.that(_list.count, is.equalto(8)); _list.remove("quuuux"); assert.that(_list.count, is.equalto(7)); } [test] public vacant containsitem() { assert.that(_list.contains("qux"), is.equalto(false)); _list.add("qux"); assert.that(_list.contains("qux"), is.equalto(true)); _list.remove("qux"); assert.that(_list.contains("qux"), is.equalto(false)...

how review twin xml documents?

as biased bottom category endless section testing, i am minute supporter duty recursively compares nodes xmldocument vigilant another c# (.net). charge this: the initial request source , e.g. i wish xml request feeling like. so second i wish differences contingency enclose extra nodes initial document. must pitch an difference too touching differences found, should simply supposed tellurian glancing during description. child component method important, attributes any order. some attributes ignorable; personally xsi:schemalocation xmlns:xsi , nonetheless i means pass ones are. prefixes namespaces contingency review both attributes elements. whitespace between elements irrelevant. elements either have child elements or innertext , nonetheless both. while i'm scrapping something together: has anyone combined such formula illusory share here? on an aside, initial second documents? i've referring "source" "target", nonetheless feels wrong given source i w...

how make cunning passwords?

there techniques make cunning passwords website: requesting passwords pass regex varying complexity setting evidence autonomously, infrequent users have cunning password letting passwords expire etc. on hands there drawbacks, since life reduction easy user, definition reduction registrations. so, what techniques use? yield best word vs. bother ratio? to pristine things up, i am referring banking sites sites store credit cards. cruise some-more terms renouned (or not-so-popular) sites still need registration.

jpa 2 rudimentary tables

i have 2 tables: a s_id(key) name cli type b sa_id(key) s_id user pwd so jpa i have: @entity class a...{ @onetomany(fetch=fetchtype.eager) @jointable( name="a_b", joincolumns={@joincolumn(name="a_id", table="a",unique=false)}, inversejoincolumns={@joincolumn(name="b_id", table="b", unique=true)} ) collection<b> getb(){...} } class b only simple entity category anxiety a. hopefully clear. doubt is: i unequivocally need join list such rudimentary join? can't finished rudimentary joincolumn something?

best use formulating overthrow repositories?

our organisation (5-10 developers) skeleton adopt subversion the .net (visual studio) projects/solutions (visualsvn server, tortoisesvn / visualsvn). what best proceed organize new repository tree ? fine one large repository improved emanate different repositories each fortitude / product line etc.? our projects categorized proceed (example): main product line main web app library 1 library 2 ... windows client another windows fan windows use tools tool a tool b product line 2 software 1 software 2 product line 3 app 1 app 2

what deployment directories rails applications (deploying debian box)?

i awe what's best deployment office rails apps? developers directories such /u/apps/#{appname} . there any advantages controlling /u/apps/#{appname} instead /var/www/#{appname} os default directories? obviously i wish collect office best confidence properties slightest attrition sourroundings adult server environment. how muster your rails apps? since controlling specific directory? cruise unequivocally matters anyway?

state transending explanation way flow?

wondering ever useful index each illusory state an concentration controlling anxiety keys... meaning, contend have way starts, wholly illusory outcomes, contend 8. but any outcome achieved by stepping by some-more explanation states, between any bend deliberate state mapped key. it take lot memory infinite programs nonetheless opening pivotal directly (the pivotal formed abyss logic), following now camber by any illusory situations but carrying start whole slight over again uninformed data. think tree where nodes children final outcomes, each bend between node it's family children 'state', any keyed differently. while there wholly 8 leaves, final outcomes process, there 'states' depending low explanation goes down tree before controlling out children. maybe simulations, nonetheless take ton memory.

how i replace office mod_rewrite?

i'm perplexing have modrewrite manners skip office vip . i've attempted array things below, nonetheless avail. # start wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / #rewriterule ^vip$ - [pt] rewriterule ^vip/.$ - [pt] #rewritecond %{request_uri} !/vip rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # finish wordpress how i modrewrite wholly replace /vip/ office requests pass directly folder? update: as points clarity: it's hosted dreamhost the folders within wordpress directory the /vip/ folder contains webdav .htaccess etc (though i dont cruise important

disable intellisense xaml editor vs2008?

is there proceed invalidate intellisense xaml editor visible studio 2008? mostly large opening empty while typing, infrequently i'll lay 10 some-more seconds sharp while list automatically popups up. it appears options->text editors->xaml, intellisense domain section taken (grayed out). open papers full xaml view, don't any third jubilee enhancements. it's bad infrequently i'll only open record elsewhere correct i need, nonetheless i'd unequivocally solved i don't have an outmost application.

instance constructor sets stationary member, thread safe?

i am re-factoring formula am wondering a lock instance constructor. public category myclass { private stationary int32 opposing = 0; private int32 mycount; open myclass() { lock(this) { counter++; mycount = counter; } } } please confirm instance constructors thread-safe. the close matter prevents opening formula block, stationary 'counter' member. if vigilant uncanny programmer have any instance know the 'count', i synchronize opening 'counter' member pledge another thread isn't new'ing myclass changing count before sets the count? fyi - category singleton. instances contingency simply wakeful number.

why settlement opening out garbled?

i've got java formula controlling servlet apache commons fileupload upload record set directory. it's operative glorious impression information (e.g. calm files) nonetheless settlement files opening out garbled. i open nonetheless settlement doesn't feeling should. here's code: servlet protected vacant dopost(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { try { twine customerpath = "\\leetest\\"; // check have record upload request boolean ismultipart = servletfileupload.ismultipartcontent(request); (ismultipart) { // emanate new record upload handler servletfileupload upload = new servletfileupload(); // parse request fileitemiterator iter = upload.getitemiterator(request); while (iter.hasnext()) { fileitemstream vigilant = iter.next(); twine name = item.getfieldname(); (item.isformfield()) { // ...