Posts

Showing posts from March, 2013

statistics - How to combine False positives and false negatives into one single measure -

i'am trying measure performance of computer vision program tries detect objects in video. have 3 different versions of program have different parameters. i've benchmarked each of versions , got 3 pairs of (false positives percent, false negative percent). now want compare versions each other , wonder if makes sense combine false positives , false negatives single value , use comparation. example, take equation falsepositives/falsenegatives , see smaller. a couple of other possible solutions: -your false-positive rate (fp) , false-negative rate (fn) may depend on threshold. if plot curve y-value (1-fn), , x-value (fp), you'll plotting receiver-operator-characteristic (roc) curve. area under roc curve (auc) 1 popular measure of quality. -auc can weighted if there regions of interest -report equal-error rate. threshold, fp=fn. report value.

debugging - How can I get break on runtime exception(or error) in javascript (or ecmascript?) -

how can break on error? i have code: throw new error("some error"); and i'm using recent version of web inspector (webkit) , firebug(mozilla). these tools catch , print error, not break. may don't know how to. please let me know how can these? in webkit need click enable break on error. if click again break on warnings , clicking again disable it. alt text http://a.yfrog.com/img832/3580/screenshot20100723at101.png

IDE for developing in ActionScript (Flash). Any suggestions? -

i started work adobe flash , code editor lacks few features before being considered ide. do know other solution developing in flash? as3 coding only, don’t care designer , timeline… want work efficiently code. i'm surprised nobody has come yet flashdevelop . in top 2 of code editors. it's free, problem it's windows only. then, if eclipse, there's editor called fdt , 1 have pay for. people it's totally worth money, don't use because don't eclipse and when tried in linux had various glitches here , there.

visual studio - Compiling code on an external drive -

to make things easier when switching between machines (my workstation @ office , personal laptop) have thought trying external hard drive store working directory on. looking @ firewire 800 drives (most 5400 rpm 8mb cache). wondering if has experience doing visual studio projects , sort of performance hit see. it depends on size of project. throughput low , latency high, you're going hit every way, due latency you'll hit harder if have lot of little files rather few large ones. have considered carrying around git or other distributed repository , updating machine repositories move around? can compile locally , treat drive , roving server. since changes moved across, should faster, , code 'backed up' in more places. if forget drive, breaks, or lost/stolen, can still sit down @ pc , program no code missing if you're @ last pc used, or little code missing (which updated later resync anyway). and it's hop skip , jump away using network move chan...

linux - Hardware recommendations for Ubuntu XEN server -

we're planning set xen virtualization server using ubuntu. i'm looking recommendations regard watch out when buying hardware system. some information our planned usage of system: the server going host 4 or 5 instances of linux/apache/mysql/j2ee stack. each of instances contain mysql database no more 4 gb of data. of these instances being used mirroring setup of our customers servers able reproduce problems they're reporting, these instances idle of time (if they're started @ all). other instances going used testing purposes , we're going restart them quite often, startup time of our jboss-applicationserver (which cpu-bound) gonna important. contstraint amount of memory our instances need, 1.5 gb jboss , 500 mb mysql. to clarify question little bit: can of course math calculate amount of ram , disk space need run 5 instances given constraints stated above. i'm particularly interested in topics important interplay of xen , hardware (if there any) because...

bash - Know any tricks for navigating the MySQL CLI? -

for example, ^e jumps beginning, ^e jumps end, , ^w deletes next word. ^l clear, ^k deletes, ^j enters, ^b goes backwards... it seems similar bash shortcuts still different. ending query in \e takes editor, handy modifying long, convoluted queries select foo bar\e

Which are the most intuitive and easiest SDKs to develop mobile phone application? -

apart windows mobile, android , iphone there other sdks build applications quick , simple? sdk should support nice animation apis. thanks in advance :) qt used create mobile applications. important know nokia bought creators of qt (trolltech) few years ago, see qt homepage .

java - What GUI should I run with JUnit(similar to NUnit gui) -

what gui should use run junit tests, , how do that? entire background in .net, i'm used firing nunit gui , running unit tests. if lights green, i'm clean. now, have write java code , want run similar using junit. junit documentation nice , clear adding attributes necessary create tests, pretty lean on how fire runner , see results of tests. eclipse by-far best i've used. couple junit code coverage plug-in , eclipse best unit-tester.

In SQL, what’s the difference between count(*) and count('x')? -

this question has answer here: in sql, what's difference between count(column) , count(*)? 10 answers i have following code: select <column>, count(*) <table> group <column> having count(*) > 1; is there difference results or performance if replace count(*) count('x')? (this question related previous one ) to select count(*) vs count(1) results in dbms returning "columns" pure bunk. may have been case long, long ago self-respecting query optimizer choose fast method count rows in table - there no performance difference between select count(*), count(1), count('this silly conversation') moreover, select(1) vs select(*) not have difference in index usage -- dbms optimize select( n ) select(*) anyway. see ask tom: oracle has been optimizing select(n) select(*) better part of decade, if not longer:...

svn - Best way to migrate from VSS to Subversion? -

i'm single developer looking off of visual source safe , move svn. a quick search brings several tools, don't see clear winner , can't afford spend lot of time testing different tools. has done successfully, , can recommend method? i recommend adding code new subversion repository rather importing vss. vss has convoluted version control model doesn't translate many other systems, , starting fresh best way avoid taking clutter you. if need keep history around, make vss repository read-only.

windows - MS Server 2003 vs MS Server 2008 -

is there big differences in os-s. before worked win 2003, should switch servers win 2008? need special trening or study start using win 2008? if yes, should study? thank answers!!!! what's new: http://www.microsoft.com/windowsserver2008/en/us/whats-new.aspx http://www.betanews.com/article/top_10_new_features_in_windows_server_2008/1180045346

iphone - UILongPressGestureRecognizer gets called twice when pressing down -

i detecting if user has pressed down 2 seconds: uilongpressgesturerecognizer *longpress = [[uilongpressgesturerecognizer alloc] initwithtarget:self action:@selector(handlelongpress:)]; longpress.minimumpressduration = 2.0; [self addgesturerecognizer:longpress]; [longpress release]; this how handle long press: -(void)handlelongpress:(uilongpressgesturerecognizer*)recognizer{ nslog(@"double oo"); } the text "double oo" gets printed twice when press down longer 2 seconds. why this? how can fix? uilongpressgesturerecognizer continuous event recognizer. have @ state see if start, middle or end of event , act accordingly. i.e. can throw away events after start, or @ movement need. class reference : long-press gestures continuous. gesture begins (uigesturerecognizerstatebegan) when number of allowable fingers (numberoftouchesr...

operating system - Is there a child's PID? -

i in operating systems class , teacher spent half of class period talking pids. mentioned, many know, processes know parent's id. my question this: does process's pcb know child's id? if so, way go obtaining it? as far know process doesn't have explicit list of children's pids, can built, since process should know child processes spawns. example unix fork() call returns child pid in parent process , 0 in child process, createprocess() on windows returns (iirc) pid of new process created.

virtualization - Technical issues when switching to an unmanaged Virtual Private Server (VPS) hosting provider? -

i'm considering moving number of small client sites unmanaged vps hosting provider. haven't decided 1 yet, understanding they'll give me base os install (i'd prefer debian or ubuntu), ip address, root account, ssh, , that's it. ideally, create complete vm image of configured setup , ship bits provider. has had experience this? i've seen jeff talk in coding horror . i'm not sure if experience typical. suppose depends on type of vm server used host. also, such hosts provide reverse-dns? that's kinda useful sites send out e-mails. know gmail tends bounce originating server without it. finally, i'd need multiple ip addresses @ least couple of sites have ssl protection doesn't work name-based virtual hosts. has run trouble multiple ips through vps? wouldn't think so, i've heard whisperings contrary. slicehost ( referral link , if choose) offers reverse dns, multiple ips ($2/month/ip), ubuntu/debian (along others). criteria...

javascript - Get Jquery modal box to appear on page load -

i need jquery box appear on page load. right appears when user clicks link. here trigger: <script type="text/javascript"> $(document).ready(function() { //select tag name equal modal $('a[name=modal]').click(function(e) { //cancel link behavior e.preventdefault(); //get tag var id = $(this).attr('href'); //get screen height , width var maskheight = $(document).height(); var maskwidth = $(window).width(); //set heigth , width mask fill whole screen $('#mask').css({'width':maskwidth,'height':maskheight}); //transition effect $('#mask').fadein(1000); $('#mask').fadeto("slow",0.8); //get window height , width var winh = $(window).height(); var winw = $(window).width(); //set popup window center $(id).css('top', winh/2-$(id).h...

unit testing - Mocking Static Blocks in Java -

my motto java "just because java has static blocks, doesn't mean should using them." jokes aside, there lot of tricks in java make testing nightmare. 2 of hate anonymous classes , static blocks. have lot of legacy code make use of static blocks , these 1 of annoying points in our push in writing unit tests. our goal able write unit tests classes depend on static initialization minimal code changes. so far suggestion colleagues move body of static block private static method , call staticinit . method can called within static block. unit testing class depends on class mock staticinit jmockit not anything. let's see in example. public class classwithstaticinit { static { system.out.println("static initializer."); } } will changed to public class classwithstaticinit { static { staticinit(); } private static void staticinit() { system.out.println("static initialized."); } } so can following in junit. public cla...

asp.net - IIS uses proxy for webservice request. How to stop this? -

i have problem little .net web application uses amazon webservice. integrated visual studio web server works fine. after deploying iis on same computer following error message: ein verbindungsversuch ist fehlgeschlagen, da die gegenstelle nach einer bestimmten zeitspanne nicht ordnungsgemäß reagiert hat, oder die hergestellte verbindung war fehlerhaft, da der verbundene host nicht reagiert hat 192.168.123.254:8080 which translates "cant connect 192.168.123.254:8080" the computer part of active directory. ad-server installed on network uses 192.168.123.254 proxy. not reachable , should not used. how prevent iis using proxy? i think has policy settings internet explorer. "old" ad user has setting, newly created user not. checked group policy settings , proxy defined. the web server running in context of anonymous internet user account on local computer. local users settings ad? if how can change setting, if cant login user? what can do, else check? ...

Change link to another link in Jquery -

a site working on has links add cart change link point different page how can achieve in jquery. $(document).ready(function() { //alert('welcome startrackr! no longer under police …'); $("a[href='http://www.somesite.com/scadditem.aspx?action=add&bjid=421&extra=type,journalissue,volume,2,issue,<web::issue>,npus,$99.00,npcdn,$99.00']").attr('href', 'http://www.live.com/'); }); i trying got idea here how change href hyperlink using jquery it's not working me appreciated. use selector * : $("a[href*='scadditem']").attr('href', 'http://www.live.com/'); the links' href attribute changed link contains scadditem somewhere in url. can modify exact string though. more readings: xpath selectors attr method

Is there a way to insert assembly code into C? -

i remember in day old borland dos compiler this: asm { mov ax,ex etc etc... } is there semi-platform independent way now? have need make bios call, if there way without asm code, equally useful me. using gcc __asm__("movl %edx, %eax\n\t" "addl $2, %eax\n\t"); using vc++ __asm { mov eax, edx add eax, 2 }

c# - Is there a way to asynchronously filter an IList? -

ok, there has way this... no? if not i'd love ideas. i have 2 repeaters , image inside update panel along ajax dropdowns link buttons left. want update data inside update panel fast possible values selected dropdowns. what think best way update data? repeaters populated objects, if filter objects properties end correct data. no new data server needed. anyone have ideas? as far know, not easy data , data-bind repeater on client side. but, might want check out .

dns - TXT records in dnsPython -

i have implemented simple dns server. responds txt record. hosting script ns server example.com. ns server x.y.z.k. works fine when issue like: $ dig demo.example.com @x.y.z.k ; <<>> dig 9.3.6-p1-redhat-9.3.6-4.p1.el5_4.1 <<>> demo.example.com @x.y.z.k ;; global options: printcmd ;; got answer: ;; ->>header<<- opcode: query, status: noerror, id: 10028 ;; flags: qr rd ra; query: 1, answer: 1, authority: 2, additional: 2 ;; question section: ;demo.example.com. in ;; answer section: demo.example.com. 1000 in txt "test message" but not work when ask same question 1 of public name servers (for example sun's dns @ 4.2.2.1): $ dig demo.example.com @4.2.2.1 (i same thing when issue $ dig demo.example.com @4.2.2.1 txt ) ; <<>> dig 9.3.6-p1-redhat-9.3.6-4.p1.el5_4.1 <<>> demo.example.com ;; global options: printcmd ;; got answer: ;; ->>header<<- opcode: query, status: servfail, id: 10905 ...

read/write to Windows Registry using Java -

how possible read/write windows registry using java? i know question old, first search result on google "java read/write registry". found amazing piece of code which: can read/write part of registry. does not use jni. does not use 3rd party/external applications work. does not use windows api (directly) this pure, java code. it uses reflection work, accessing private methods in java.util.prefs.preferences class. internals of class complicated, class easy use. for example, following code obtains exact windows distribution from registry : string value = winregistry.readstring ( winregistry.hkey_local_machine, //hkey "software\\microsoft\\windows nt\\currentversion", //key "productname"); //valuename system.out.println("windows distribution = " + value); here original class. copy paste , should work: import java...

java - What are the best practices for the Middleware API? -

we developing middleware sdk, both in c++ , java used library/dll by, example, game developers, animation software developers, avatar developers enhance products. what know this: there standard "best practices" development of these types of api? i thinking in terms of usability, readability, efficiency etc. my 2 favourite resources on subject: http://mollyrocket.com/873 , http://video.google.com/videoplay?docid=-3733345136856180693

c# - How do you know what to test when writing unit tests? -

using c#, need class called user has username, password, active flag, first name, last name, full name, etc. there should methods authenticate , save user. write test methods? , need worry testing properties since .net's getter , setters? many great responses on question: " beginning tdd - challenges? solutions? recommendations? " may recommend taking @ blog post (which partly inspired question), have got feedback on that. namely: i don’t know start? start afresh. think writing tests when writing new code. can re-working of old code, or new feature. start simple. don’t go running off , trying head round testing framework being tdd-esque. debug.assert works fine. use starting point. doesn’t mess project or create dependencies. start positive. trying improve craft, feel it. have seen plenty of developers out there happy stagnate , not try new things better themselves. doing right thing, remember , stop giv...

c# - Has anyone used the Hessian binary remoting protocol to bridge applications using Java and .NET? -

hessian custom binary serialization protocol, (which open-source - think), forms basis binary cross platform remoting framework. i'd know if here has used it, , if so, sort of performance can expect solution bridges java app on 1 side c# app on other. (let consider serializing simple classes, , may arrays, lists, dictionaries of simple classes.) have looked @ hessianc# project ( http://www.hessiancsharp.org/ )?

linux - What does the number in parentheses shown after Unix command names in manpages mean? -

for example: man(1), find(3), updatedb(2)? numbers in parentheses (brit. "brackets") mean? it's section man page command assigned to. these split general commands system calls c library functions special files (usually devices, found in /dev) , drivers file formats , conventions games , screensavers miscellanea system administration commands , daemons original descriptions of each section can seen in unix programmer's manual (page ii).

html - Python: Detecting the actual text paragraphs in a string -

the big mission: trying few lines of summary of webpage. i.e. want have function takes url , returns informative paragraph page. (which first paragraph of actual content text, in contrast "junk text", navigation bar.) so managed reduce html page bunch of text cutting out tags, throwing out <head> , scripts. of text still "junk text". want know actual paragraphs of text begin. (ideally should human-language-agnostic, if have solution english, might too.) how can figure out of text "junk text" , actual content? update: see people have pointed me use html parsing library. using beautiful soup. problem isn't parsing html; got rid of html tags, have bunch of text , want separate context text junk text. you use approach outlined @ ai depot blog along python code: the easy way extract useful text arbitrary html

jQuery tablesorter - rowspan in headers causes odd behavior -

example of failure: http://progamonth.com/files/testfile.html desired behavior: ideally, headers colspan shouldn't affect sorting. right now, receive sorting buttons, , if specify headers: {index: {sorter: false}} each of colspan headers, still affect sorting. when click headers no rowspan or colspan (1.1.2 etc), seem causing sorting occur 4 columns right! example of working, cannot reproduce: http://lovepeacenukes.com/tablesorter/2.0/docs/ this page seems show behavior working, can't reproduce this. example rowspan doesn't manually turn headers off, what's going on?! see colspan headers in example have no header class, seems being applied tablesorter plugin. does know what's going on? working picture: alt text http://progamonth.com/files/working.png not working picture: alt text http://progamonth.com/files/notworking.png the feature disabled says here: link text i found way have same effect, inside tablesorter js around row 298 th...

web - How do I make sure my website can block automation scripts, bots? -

i'd make sure website blocks automation tools selenium , qtp. there way ? settings on website selenium bound fail ? with due consideration comments on original question asking "why on earth this?", need follow same strategy site uses verify user human. methods such asking users authenticate or enter text images or work, have effect of blocking google crawlers , else. doing based on user agent strings or useless. trivial fake. rate-limiting connections or similar might have limited effectiveness, seems you're going inadvertently block web crawlers too.

c++ - How to get rid of "unsafe" warnings / errors in Visual Studio (strcpy, sprintf, strdup) -

i'm trying rid of compiler warnings strcpy, sprintf, etc unsafe. why they're unsafe, can't think of way fix code, in c++ style. here's excerpt of code: extlist->names[i]=(char *)malloc(length*sizeof(char)); strcpy(extlist->names[i],extname); // unsafe // strncpy(extlist->names[i],extname,length); // unsafe here's message: c4996: 'strcpy': function or variable may unsafe. consider using strcpy_s instead. disable deprecation, use _crt_secure_no_warnings. see online details. i can't think of safe way copy data on in c++ without knowing length of stuff copy. know there's strlen(), that's unsafe since assumes (maybe incorrectly) data null-terminated. also: // used concatenate: sprintf(extstr,"%s%s",platextstr,glextstr); c4996: 'sprintf': function or variable may unsafe. consider using sprintf_s instead. disable deprecation, use _crt_secure_no_warnings. see onlin...

sql - Datamapper "first" method is querying the whole relation -

i'm using datamapper 1.0 sinatra , sqlite3 backend. i have devices, have multiple locations, , want latest location of device. problem generated sql above line query locations device not latest 1 (and device can have 10-20k locations). not optimal, i'm asking: doing wrong? or datamapper works way , have resort plain sql? there better workaround? i have following data schema: class location include datamapper::resource property :id, serial property :lat, integer property :lon, integer property :time, time belongs_to :device end class device include datamapper::resource property :id, serial has n, :locations def lat # , lon locations.first(:order => [:time.desc]).lat end end here call d.first.lat (where d device acquired using d = devices.all ) result in query of locations, instead of first matching one. i have these 2 models, , querying simple too: in controller: @devices = device.all in view: @devices.each { |d| d.lat } and...

c# - Finding the variable name passed to a function -

let me use following example explain question: public string examplefunction(string variable) { return something; } string whatismyname = "hello world"'; string hello = examplefunction(whatismyname); when pass variable "whatismyname" example function, want able string of original variables name. perhaps like: variable.originalname.tostring() is there way this? **no.**i don't think so. the variable name use convenience , readability. compiler doesn't need & chucks out if i'm not mistaken. if helps, define new class called namedparameter attributes name , param. pass object around parameters.

mod rewrite - How do I use .htaccess to redirect to a URL containing HTTP_HOST? -

problem i need redirect short convenience urls longer actual urls. site in question uses set of subdomains identify set of development or live versions. i url requests redirected include http_host such don't have create custom .htaccess file each host. host-specific example (snipped .htaccess file) redirect /terms http://support.dev01.example.com/articles/terms/ this example works fine development version running @ dev01.example.com. if use same line in main .htaccess file development version running under dev02.example.com i'd end being redirected wrong place. ideal rule (not sure of correct syntax) redirect /terms http://support.{http_host}/articles/terms/ this rule not work , merely serves example of i'd achieve. use exact same rule under many different hosts , correct result. answers? can done mod_alias or require more complex mod_rewrite? how can achieved using mod_alias or mod_rewrite? i'd prefer mod_alias solution if possible. clarifi...

Any good book on domain driven design? -

i'm trying find good, simple introduction domain driven design, proving difficult. the books have looked @ share same problems. they massive 300+ pages. wish practice change computer books. they shine in chapter 1, explaining introductory , basic concepts. when comes down getting material blaze through advanced concepts poor examples , little explanation, jump next concept. am asking when ask there book domain driven design under 300 pages progresses @ constant pace? i hate when books spend time on introductory concepts, yet don't bother explaining more advanced stuff. update the reason want sub 300 page book because 500+ page monsters have lot of fluff in them , can't seem point (or skip altogether). try 1 - available online @ infoq. on plus side, it's free. on downside, might basic you. if want introduction though, surely it's basic concepts want grips first before delving advanced topics? domain driven design quickly - 104 pages. ...

c# - How to create a scalable Moebius-strip in WPF? -

Image
a moebius strip surface 1 side. how 1 define such object in xaml/wpf? how such object manipulated in 3d, scaled , down , rotated using c#? using helix toolkit able 1 on-screen in couple of minutes. 1 of demo-apps renders parametric surface on screen , allows change equations. 'magic' in math, copied mathematica stackexchange-site : u *= 2 * pi; v = (v - 0.5) * 2 * pi; x = ( 1 + (v/2) * cos(u/2)) * cos(u); y = ( 1 + (v/2) * cos(u/2)) * sin(u); z = (v/2) * sin(u/2); on screen looks this:

Hidden Features of C++? -

no c++ love when comes "hidden features of" line of questions? figured throw out there. of hidden features of c++? most c++ programmers familiar ternary operator: x = (y < 0) ? 10 : 20; however, don't realize can used lvalue: (a == 0 ? : b) = 1; which shorthand for if (a == 0) = 1; else b = 1; use caution :-)

c++ - How to do remote debugging with Eclipse CDT without gdbserver? -

we're using eclipse cdt 5 c++ ide on windows develop c++ application on remote aix host. eclipse cdt has ability perform remote debugging using gdbserver. unfortunately, gdbserver not supported on aix. is familiar way debug remotely using eclipse cdt without gdbserver? perhaps using ssh shell connection gdb? finally got gdb run remotly anyhow now. @ bug-symbol on taskbar took debug configurations - gdb hardware debugging. in main c/c++ applications set full path on samba share of executable ( x:\abin\vlmi9506 ). set linked folder on x:\abin in project. modified batch-script in gdb setup. it's not directly calling gdb in plink-session unix-shell-script, opens gdb. have possibility set unix environment-variables program before doing debug. call in batch: plink.exe prevoax1 -l suttera -pw xxxxx -i /proj/user/dev/suttera/vl/9506/test/vlmi9506ddd.run 20155 dev o m in unix script started gdb command line params eclipse, found in former tryals. call in shell c...

java - if (a != null && a instanceof A) ... or if (a instanceof A) -

for following conditionals: if (a != null && instanceof a) or if (a instanceof a) is there advantage (for example, performance-wise) check null first? both conditionals should equal in result. no advantage whatsoever, can if(a instanceof a) {} this return evaluate false if null

css - HTML element percentage height problem -

i made myself speed dial-like homepage links visit most. now, made elastic, when browser window narrowed horizontally, boxes getting narrower too. what want when browser window narrowed vertically, boxes narrower again. i tried several percentage height rules didn't work, need help. here page i'm working on one-file page css not separated. http://www.purplerspace.com/dl/ you have add height percentages divs if want work. add height: 100% html, body wrappers , lis , yeah, style too.

How is a web service request handled in ASP.Net -

when client makes web service request, how asp.net assign instance of service class handle request? is new instance of service class created per request or there pooling happening or there singleton instance used handle requests? for classic asmx services new instance each request, aspx request. wcf service (.svc) have more options, such running singleton. if interested in doing work singleton , pooling can use asmx service lightweight proxy pass parameters , forth. implementation of service singleton lives app pool web site. need account app pool being reset how iis manages asp.net sites. what can run windows service wcf service running. service listen localhost on endpoint accessible same machine. can have asmx service call wcf service locally. allow ensure state alive long when iis restarts app pool. naturally, can change security wcf windows service allow access remotely password if want allow multiple web services use same service host purpose of improved resour...

reporting services - Report design using stored procedures in Report builder (SSRS)? -

is possible use stored procedures designing reports in report builder? if you're asking if it's possible use sprocs in ssrs reports create, yes. call sproc in query dataset normaly.

svn - Subversion branch reintegration -

when branch reintegrated trunk, branch dead? can make modifications branch after reintegration , merge trunk @ later date? you can technically, branch not dead nor disabled, not recommended merge branch trunk after reintegration. you can find full discussion reason that, here: subversion merge reintegrate basically, says, possible merge changes again trunk, since reintegration forces merge trunk branch prior reintegrate operation you'll facing reflective/cyclic merge problematic in subversion 1.5. according article, recommended delete reintegrated branch after reintegration , create new 1 same (or different) name instead. this known subversion behavior addressed in future version (probably in 1.6)

Biggest advantage to using ASP.Net MVC vs web forms -

what of advantages of using 1 on other? the main advantages of asp.net mvc are: enables full control on rendered html. provides clean separation of concerns(soc). enables test driven development (tdd) . easy integration javascript frameworks. following design of stateless nature of web. restful urls enables seo. no viewstate , postback events the main advantage of asp.net web form are: it provides rad development easy development model developers coming winform development.

Trialware/licensing strategies -

i wrote utility photographers plan sell online pretty cheap ($10). i'd allow user try software out week or before asking license. since personal project , software not expensive, don't think purchasing services of professional licensing providers worth , i'm rolling own. currently, application checks registry key contains encrypted string either specifies when trial expires or have valid license. if key not present, trial period key created. so need week free delete registry key. don't think many users that, when app $10, i'm curious if there's better way not onerous legitimate user. write web apps , haven't dealt stuff before. the app in .net 2.0, if matters. edit: can make current licensing scheme considerable more difficult crack storing registry information in local security authority (lsa). users not able remove key information there. search lsa on msdn should give information need. opinions on licensing schemes vary each individua...

wpf - How does a XAML definition get turned into an object instance? -

xaml allows specify attribute value using string contains curly braces. here example creates binding instance , assigns text property of textbox element. <textbox text="{binding elementname=foo, path=bar}"/> i want extend xaml developer enter valid... <textbox text="{mycustomobject field1=foo, field2=bar}"/> this create instance of class , set field1/field2 properties appropriate. possible? if how do it? if possible have followup question. can take string "{binding elementname=foo, path=bar}" , ask framework process , return binding instance specified? must done somewhere make above xaml work , there must way ask same thing processed. take @ markupextensions http://blogs.msdn.com/wpfsdk/archive/2007/03/22/blogpost-text-creatingasimplecustommarkupextension.aspx

scala - How do I kill a RemoteActor? -

not sure whether missing something. when making actor remote, main method not terminate. here snippet demonstrates problem. import scala.actors._ import scala.actors.remote._ object testme { def main(args : array[string]) : unit = { object jim extends daemonactor { // comment out these 2 lines , application terminate remoteactor.alive(12345) remoteactor.register('jim,this) def act { loop { receive { case 'quit => println("\nquiting") exit('normal) case => println(any) } } } } jim.start jim ! "hello" jim ! 'quit } } put .alive , .register calls inside act() , code terminates.

actionscript 3 - Flash error 1151 in a for loop -

i have strange problem regarding flash error 1151: conflict exists definition in namespace internal. here problematic code: for(var i:number=dt.getfullyear(); >= dt.getfullyear()-90; i--) { dtyear.additem( {label:i, data:i} ); } //for //-*-*-* month for(var i:number=0; < months.length; i++) { dtmonth.additem( {label:i, data:i} ); } //for or more blatant example: for(var i:number=0; < 12; i++) { trace(i); } //for //-*-*-* month for(var i:number=0; < 12; i++) { } //for adobe gives explanation: you cannot declare more 1 variable same identifier name within same scope unless such variables declared of same type. in actionscript 3.0, different code blocks (such used in 2 loops in same function definition) considered in same scope. what friggin hell this? mean variable time exists number, typecasted number, why hell above code fail? if modify way, works, thats ugly , why needed? aaarggghhhh...flash development makes me crazy. gimme gun :). explai...

c# - Easier way to debug a Windows service -

is there easier way step through code start service through windows service control manager , attaching debugger thread? it's kind of cumbersome , i'm wondering if there more straightforward approach. if want debug service, drop in debugger.break() in there. when line reached, drop me vs. don't forget remove line when done. update: alternative #if debug pragmas, can use conditional("debug_service") attribute. [conditional("debug_service")] private static void debugmode() { debugger.break(); } on onstart, call method: public override void onstart() { debugmode(); /* ... rest */ } there, code enabled during debug builds. while @ it, might useful create separate build configuration service debugging.

javascript - How do I programmatically force an onchange event on an input? -

how programmatically force onchange event on input? i've tried this: var code = ele.getattribute('onchange'); eval(code); but end goal fire listener functions, , doesn't seem work. neither updating 'value' attribute. ugh don't use eval anything . well, there things, they're extremely rare. rather, this: document.getelementbyid("test").onchange() look here more options: http://jehiah.cz/archive/firing-javascript-events-properly

sql server - Cursor verus while loop - what are the advantages/disadvantages of cursors? -

is idea use while loop instead of cursor? advantages/disadvantages of cursors? some of these depends on dbms, generally: pros: outperform loops when comes row-by-row processing works reasonably large datasets cons: don't scale well use more server resources increases load on tempdb can cause leaks if used incorrectly (eg. open without corresponding close)

business intelligence - Cognos 8 Javascript to select values in a multi select list box prompt -

i have multi select list box value prompt in cognos 8.3. contains values: adelaide north adelaide south adelaide east adelaide east sydney north sydney south sydney east sydney west etc. i want able add button onto prompt page when clicked, selects predetermined options, such adelaide north, south east , west. for example: adelaide button select adelaide north, adelaide south, adelaide east , adelaide west, instead of making user select 4 choices in multi-select list box. is there way can this? have named list box cbofsa in miscellaneous area of properties. any appreciated. i'm assuming web-based cognos interface? if so, should you: if name cbofsa assigned id attribute of <select> use: <select size="6" id="cbofsa" multiple="multiple"> <option>adelaide north</option> <option>adelaide south</option> <option>adelaide east</option> <option>adelaide east</option...

python - obtaining pid of child process -

i using python's multiprocessing module spawn new process as follows : import multiprocessing import os d = multiprocessing.process(target=os.system,args=('iostat 2 > a.txt',)) d.start() i want obtain pid of iostat command or command executed using multiprocessing module when execute : d.pid it gives me pid of subshell in command running . any valuable . thanks in advance similar @rakslice, can use psutil : import signal, psutil def kill_child_processes(parent_pid, sig=signal.sigterm): try: parent = psutil.process(parent_pid) except psutil.nosuchprocess: return children = parent.children(recursive=true) process in children: process.send_signal(sig)

windows - Using the "start" command with parameters passed to the started program -

i have virtual machine in virtual pc 2007. to start desktop, have following command in batch file: "c:\program files\microsoft virtual pc\virtual pc.exe" -pc "my-pc" -launch but leaves dos prompt on host machine until virtual machine shuts down, , exit out of virtual pc console. that's annoying. so changed command use start command, instead: start "c:\program files\microsoft virtual pc\virtual pc.exe" -pc my-pc -launch but chokes on parameters passed virtual pc. start /? indicates parameters indeed go in location. has used start launch program multiple command-line arguments? start has peculiarity involving double quotes around first parameter. if first parameter has double quotes uses optional title new window. i believe want is: start "" "c:\program files\microsoft virtual pc\virtual pc.exe" -pc my-pc -launch in other words, give empty title before name of program fake out.

asp.net - How do I convert a string to an int type in C#? -

i taking string value textbox named txtlastappointmentno , want convert int , store in database using linq sql getting error "input string not in proper format". my input string 2. my code is: objnew.lastappointmentno=convert.toint32(txtlastappointmenno.text); please point out mistake. assuming using webforms, need access textbox value , not textbox itself: objnew.lastappointmentno = convert.toint32(txtlastappointmenno.text); or if referencing html control then: objnew.lastappointmentno = convert.toint32(request["txtlastappointmenno"]);

javascript - jQuery $.extend() - how to not add new members to the first object if they don't exist? -

i stumbled on small problem when extending javascript objects using jquery. when executing var item = $.extend(options.itemdefaults, item); options.itemdefaults extended properties in item , result passed item . far, good. but next time line executed, options.itemdefaults has property values item had, instead of original defaults. defaults lost! i realize store defaults object in temporary variable, , extend temporary variable instead, seems bit lengthy. there way i'm after (overriding default values supplied ones, taking defaults when no values supplied, not changing default object) without detour? update: seems wasn't easy around hoped. when var defaults = options.itemdefaults; var $item = $.extend(defaults, { attributemodel: options.attributemodel }, item); defaults = undefined in each iteration, still add properties item on options.itemdefaults ! how around this? try, var item = $.extend(true, {}, options.itemdefaults, item); the true...

java - Is it possible to search for same value on multiple columns with Hibernate Criteria? -

i have search query has many optional parameters , search word field searches many columns. possible use hibernate criteria purpose? need search many columns same search word. example code (what not working correctly) if(isnotempty(searchword)) { criteria.add(restrictions.like("description", searchword)); criteria.add(restrictions.like("name", searchword)); } it looks need or: criterion description = restrictions.like("description", searchword); criterion name = restrictions.like("name", searchword); logicalexpression orexp = restrictions.or(description, name); criteria.add(orexp);

how to restric user of Certain role from certain page in Asp.net C# -

i using built-in asp.net roles , membership provider in website. what want restrict user in role "nurse" page name doctordiscussionboard.aspx . help me how it. i guess write code in page load method. you can suggest: if (user.isinrole("nurse")) //redirect that method in system.security.principal namespace. you can in web.config: <configuration> <location path="doctordiscussionboard.aspx"> <system.web> <authorization> <deny roles="nurses" /> <allow roles="doctors" /> <deny users="*" /> </authorization> </system.web> </location> ....

sql - Table structure of a student -

i want table structure can store details of student below format. if student in 10 th standard -> need aggregate % 1st standard 9th standard. 5 th standard -> need aggregate % 1st standard 4th standard. 1 st standard -> no aggregate % has displayed. and important thing ' need use 1 table'. please form table structure no redundant values. any ideas appreciated...... no friends not home work. asked in oracle interview, conducted in hyderabad day before yesterday '24th july, 2010',. asked me table structure. he did not asked me query. asked me how design table. please advice me. id | name | grade | aggregate this trick, id primary key, name students first last name, grade grade in , aggregate aggregate % based on grade. fro example rows might be: 10 | bill cosby | 10 | 90 11 | jerry seinfeld | 4 | 60 bill cosby have aggregate percent of 90 in grades 1-9, , jerry have 60 in grade...

c# - avoid duplicate values in datatable -

in db have values true/false/false/true.... need distinct values true , false , not values true & false & false & true... my code: datatable dv= dt.defaultview.totable(true, col.header); dv.casesensitive=true; but got values true & false & false. how avoid both similar values if caps / small letters , true & false values. it should done @ backend. in c# not through query...... with linq can this: var s = (from p in dv orderby p.yourcolumn select p.yourcolumn.toupper()).distinct(); here blog post you.

Custom user in ASP.NET MVC 2 -

i'm trying implement custom user object in asp.net mvc 2. i've seen solution can magic in global.asax turn controller.user type, customuser. controller.user still iprincipal, means have cast customuser every time want use it, , don't @ all. would considered wrong, or bad practice, have a base controller getuser() method, getuser() calls user repository, , uses controller.user fetch our own custom user object? what i'm trying add couple of properties user object. would considered wrong, or bad practice, have a base controller getuser() method, getuser() calls user repository, , uses controller.user fetch our own custom user object? i don't think so. way it. ;)

Restoring page results in ASP.NET MVC -

i working in asp.net 3.5 mvc application. have functionality search "customer search results", using parameters. if user enter search parameters say, date of birth/ssn/address, , hits search, search results displayed in grid below. 1 of records in results can clicked , navigates customer information page. , page can click on "return search results" come search results page again, can potentially show search parameters , results of last search. we use sql server session state. , using viewmodel , model binder store search parameters , results. when user comes customer information page search results page using data stored in model binder bind search results back. however user in customer information page , time session expires, , when user tries return search results page, search parameters , search results lost. i should able pull search parameters somewhere can restored(the store should not session) when information lost. trying store parameters in sql ...

count - Paragraphs in javascript -

do know if there easy way of counting paragraphs in textarea using nothing javascript? thanks, try one: document.getelementbyid('textarea_id').value.replace(/\n$/gm, '').split(/\n/).length; this ignore empty strings (see @sean vieira answer)

Form renderer for PHP -

i tried drupal form apis , lot. stand-alone php classes exist perform similar functions? http://code.google.com/p/php-form-builder-class/ pretty php form builder class. handles usual form needs plus captcha, google map, jquery ui integration , others.

visual c++ - How to load a large array of strings in to an MFC combobox control fast as possible? -

i have array of 1000 strings load combo box. fastest way load array of strings combo box? is there way other iterating on list of strings, putting each string combo box 1 @ time? and how copy combo box data once loaded 10 other combo boxes? if have 1,000 strings repeated in 10 comboboxes, may want consider using owner drawn combobox, draws strings on fly based on indices array, rather storing them in combobox @ all. way faster, way more memory efficient. check out drawitem method , drawitemstruct structure in on-line help. basically, using initstorage , insertstring (as mentioned nusonic) create 1000 blank items in combobx, , override drawitem extract , draw required string, based on index, needs drawn.

tfs2010 - Merge Issues With Visual Studio 2010 Database Project Schema Compare & TFS -

i experiencing issue working database project in visual studio 2010 ultimate tfs. following describes work flow use: i work locally modifying sql schema via sql server management studio. next open visual studio database project & perform "schema compare" operation. i choose local database latest changes "source schema" , "target schema" database project. next @ "schema comparison" results , choose "skip" "update action" on items not want change. items want change choose appropriate "update action". when finished choose "write updates" command apply changes database project. the problem have when @ database project, of database tables told ignore updated in database project commenting out database create script. for example 1 looks like: /*create table [schemaname].[tablename] ( [col1] bigint identity (1, 20) not null, [col2] int null );*/ the qu...

asp.net - calling alert from code-behind -

i have dropdownlist , listbox both asp.net controls i trying prevent user add duplciate items listbox control i able block want display div or alert box saying,"duplciate names not allowed" protected void btn_addrecipientaction_onclick(object sender, eventargs e) { if (convert.toint32(this.ddlrecipient.selectedvalue) > 0) { if (ddlrecipient.text.length > 0) { //var items = new system.collections.arraylist(this.lstrecipient.items); for(var = lstrecipient.items.count - 1; >= 0; --i) { if (lstrecipient.items[i].text == ddlrecipient.selecteditem.text) { lstrecipient.items.removeat(i); **//alert("duplicate entry not allowed") //div display message , disappears after few secon...