Posts

Showing posts from September, 2010

How could you group/ungroup data in an HTML page like you can in Excel? -

is possible group/ungroup data in static html page, can in excel? i have requirement allow grouping/ungrouping of data in excel. if not possible in static html page, kindly suggest me best way in order same result in html page. you can use jquery ( or js framework of choice ) filter/group client side or if getting data database ( such mysql ) can group data query before rendering client. have @ http://plugins.jquery.com/project/grouprows

vb.net - Computer based examination Application to be run on net wrok -

i have developed computer based examination application. have designed application when initialized admin. client computers take exam logins. i using sql server compact edition. tested small network (shared computers through hub) works well. i not @ networking things. can used same way when client computers more 50? there better alternative? thanks furqan

.net - Advice to implement cache solution for a site -

i'm working on public site not longer 100% public. paid users able access 100% of features while "anonymous" users access reduced version. the problem anonymous users , paid users access same pages, they'll see different things. i wonder how keep using cache pages. have 100% sure show correct content each type of user. extremely bad show cached version of paid site anonymous user (and other way around). preferably, without adding url differentiate user type. thanks! you can use application cache business data, dictionary of key value pairs, can put into. can programatically check if they're logged in. you'll still rendering page on each visit, retrieving cached data provide required performance boost. alternatively, might possible turn off output-cache programatically, described in question. quote this answer david ebbo : in oninit: if (yourarbitrarycondition) { outputcacheparameters outputcachesettings = new outputcacheparamet

testing - Looking for "test execution manager" software to manage automated tests -

we develop several products , have extensive unit-tests , automated functional tests them. problem tests don't run frequently, manually developer or before shipping new version. i'm looking "test execution manager" software allow: defining test suites collection of existing tests ; executing test suites on multiple machines in our test lab ; collecting results , presenting them nicely ; preserve test execution history , results most "testing solutions" i've found concentrate on "writing automated tests" (which have working) or closely integrate other aspects of software development, defining requirements , filing bugs (which have , don't want change). can recommend simple , flexible software above without forcing specific development processes? i though on using (or abusing) hudson ci this. hudson can run tests, collect results , present them, both periodically or due code commit; not designed test suite definiti

sql - How do I find out which database a connection is using? -

i'm using sql server 2008. i'm trying find out connection within database server using database want drop, can kill connection. i can select session_id, login_name sys.dm_exec_sessions etc find sessions in database, how session_id database session connected? take here: http://msdn.microsoft.com/en-us/library/ms179881.aspx look @ dbid column.

css - Issues with "font-size: 100%" -

i'm new css i'm sorry if dumb question. i making site , used this: body { font-size: 80%; } later, today, tried apply ericmeyer's css reset page above 80% declaration, it's causing sorts of trouble font sizing. i didn't think issue because thought font-size 100% wouldn't change font, "use font of parent" that's not case. what font-size 100% declaration do? why applied every element in reset (i.e. html,body,div,span,a,b,i,font,etc {font-size} rather body{font-size} using, seemed inherited fine)? before "just remove 100%" i'd know it's doing. 100% mean, , why mr. meyer apply bunch of elements rather body doing? does using font-size: 0.8em; work? since 1em "the size of character", 0.8em should give want.

javascript - Show popup under specific asp control -

i working textbox in asp.net , added javascript pop calendar control on "onclick" event (i using window.open() open popup). there way show popup right under textbox? thanks. why using window.open? have looked jquery using a div popup? you can use jquery find location of textbox , place popup near x,y offset of textbox.

asp.net - Trouble validating dynamically generated link -

the problem validating following link: <link href="/webresource.axd?d=iu6d9qgztdnsqojdmy0qjqvxyeu9bc_dzhpputglpxu8yzwget7ofpf9pflyz5sdwzul1hvwxtsrzapovmcmrfw9p0tosd3gfatioaqfokhtyh7u0&t=634254225425826735" type="text/css" rel="stylesheet" /> and w3c finds error: …ukrzqungmzmpjmefoz3frjkft3xfwsvmynyc0&t=634254231258016859" type="text/css" re… …krzqungmzmpjmefoz3frjkft3xfwsvmynyc0&t=634254231258016859" type="text/css" rel… in first 1 says " t " problem , in second 1 says " = ". you have escape & using &amp; .

MS Word 2007 - target word count -

i set daily or partial word count target in ms word 2007? it seems total word count displayed, or count selected text. not count displays current words typed against target, e.g 500 (current)/1500 (final) thanks i not aware of method show customized variables in status bar, may include macro show whatever want. example: sub macro1() ' ' macro1 macro ' dim wordcount long dim myrange range set myrange = activedocument.range wordcount = 500 - myrange.computestatistics(wdstatisticwords) msgbox wordcount & " words left" end sub

Is there any git hook for pull? -

i need perform actions (prepare gettext *.mo message files) on project everytime run git pull . there suitable git hook, use purpose please? the githooks man page complete list of hooks. if it's not on there, doesn't exist. that said, there is post-merge hook, , pulls include merge, though not merges pulls. it's run after merges, , can't affect outcome. never gets executed if there conflicts; you'd have pick post-commit hook if matters, or invoke manually.

javascript - jquery binding events on selected tab -

i have few tabs same form inside of them, difference location of work in hidden element. i'm loading tabs ajax href="blah.htm" i want bind onclick element in form, problem since form same on tabs jquery operates on first instance, i.e. first tab. question ..how can use jquery on selected tab instead on first tab? you're not giving out lot of details, if guess correctly following work you $('.myform input').click(function() { //do here }) ie. refer form class instead of ids or names. with added bonus of having per tab onclick handlers 0 efforts: $('#tab1 .myform input')

Can i trace the requirement in each stage of Software developemnt life Cycle in Rational RequisitePro -

can trace requirement in each stage of software developemnt life cycle requirement, design, coding, testing , deployement in rational requisitepro. yes. should mapping stages of life cycle requisitepro. 1 of first steps should taking while starting requisitepro project creating requirement management plan where, between other things defining requirement type using , represent. each 1 of conceptual requirement types creating actual requirement type object in project. as example, end requirements following: need: stakeholder needs sys: system features suppl: supplementary requirements feat: product features uc: use cases tc: test cases and creating requirements of each of types , creating traceability relationships between them. as can see, can model life cycle process inside project , start creating traceability relationships between different stages of process. its quite easy use.

css - min-height Vs height -

i attempting div expand 100% of browser's height. know commonly asked question , have read countless forums in order find answer have yet find work across browsers. my css file looks this: html{height:100%;} body { background: #ffffff; font-size: 0.8em; line-height: 1.7; color: #09123e; height:100%; } #wrapper { background: #ffffff url(../images/assets/wrapper.bg.gif) repeat-y center center; margin: 0 auto; height:100%; } this renders expected in browsers except later versions of internet explorer, notably ie7 , ie8. have found if use min-height instead of height on #wrapper desired result in problematic browsers messes rendering in else. have tried using conditional stylesheet #wrapper style specified seems ignored. any appreciated. this works fine in browsers, make sure use doctype! <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http:/

spring - How to get the md5sum of a file in Java? -

i have file need reload in application everytime changes. i'm checking lastmodified , i'd check md5sum before process it. i'm using spring framework, in case there useful in there. what's best way check this? examples/libraries should check? thanks. the explanation , code snippet in link might you just record , there common issue in of snippets use biginteger , biginteger class removes zeros @ start of string might want add check string res =new biginteger(1,m.digest()).tostring(16); if (res.length() == 31) res = "0" + res;

keyboard shortcuts - Emacs: How add custom key bindings to be used with char mode of ansi-term? -

i wanna add key bindings on ansi-term's char mode couldn't yet... have tips that? possible? all key bindings works in line mode, obviously, how can enable key bindings (not all) in char mode? there 2 different modes used ansi-term character mode (acts more terminal line mode (acts more emacs buffer) for character mode, you'll want modify term-raw-map , like: (define-key term-raw-map [(control ?a)] 'term-send-raw) will send \c-a underlying terminal. don't know key-map line-mode, i'm guessing it's character mode want play with.

postgresql - Rails case sensitive applications with Postgres -

i'm running new rails app on postgresql , not understand why on earth made postgreql case sensitive , didn't make option turn off. i mean, really, if registeres "sam" on site, won't able log in "sam", there can 2 different accounts "sam" , "sam". disaster, taking consideration fact all other major databases case insensitive. now instead of looking user like user.find_by_name(params[:name]) i'll have this user.all(:conditions=>["name ilike ?", params[:name]]).first i can't believe there's no way avoid in rails because destroys 1 of main principles of framework: database independence. is there better way implement case insensitive username/e-mail schema? i suppose have 2 db columns, if preserving case important you: one login name, convert lower case when user signs up, , use login user, after converting name login form lower case one display name, what's displayed username ,

osx - Can fsi run with the 4.0 runtime on MAC OS and if so how do I configure it -

kinda self explanatory... i variety of errors when try access 4.0 dlls in fsi. rather go through each one, think above question right one. this repost more or less of question here in f# on mac osx , ubuntu error running fsi in 4.0 thanks gary edit trying run following in demo on macbook mono 2.8 , fsharp. (the code chosen else) open system.numerics open system let maxiteration = 100 let modsquared (c : complex) = c.real * c.real + c.imaginary * c.imaginary type mandelbrotresult = | didnotescape | escaped of int let mandelbrot c = let rec mandelbrotinner z iterations = if(modsquared z >= 4.0) escaped iterations elif iterations = maxiteration didnotescape else mandelbrotinner ((z * z) + c) (iterations + 1) mandelbrotinner c 0 y in [-1.0..0.1..1.0] x in [-2.0..0.05..1.0] match mandelbrot (complex(x, y)) | didnotescape -> console.write "#" | escaped _ -> c

classic asp sending email -

is possible send email without cdo , else installed dlls? if don't want use dll send email, think solution make call asp external mail server responsible sending of emails. use http post accomplish it. on server, code should like: dim url, httpbroker url = "http://mail.yourdomain/send.asp" set httpbroker = createobject("msxml2.serverxmlhttp") httpbroker.open "post", url, false httpbroker.setrequestheader "content-type", "application/x-www-form-urlencoded" httpbroker.send "to=name@gmail.com&body=<html><body>hello!</body></html>" response.write httpbroker.responsetext set httpbroker = nothing on mail server, send.asp responsible send email using dll installed on server or cdonts. this solution work if have server required dll installed . now, if don't have server @ disposal, should have @ api of mail engine installed on server. if using mail enable , there exists

sorting - Fast reverse sort in (SWI) Prolog -

i'm looking fast way sort list in reverse order in prolog. algorithmically should perform standard sort, options i've come slower, obvious reasons. predicate rsort1/2 sorts , reverses. rsort1(l1, l2) :- sort(l1, tmp), reverse(tmp, l2). predicate rsort2/2 uses predsort/3 custom comparator. rsort2(l1, l2) :- predsort(reverse_compare, l1, l2). reverse_compare(delta, e1, e2) :- compare(delta, e2, e1). to test performance i've generated huge random list this: ?- size = 1234567, findall(n, (between(1, size, _), n random(size)), ns), assert(test_list(ns)). size = 1234567, ns = [183677, 351963, 737135, 246842, 22754, 1176800, 1036258|...]. these runtimes standard sort : ?- test_list(ns), time(sort(ns, nss)). % 2 inferences, 7.550 cpu in 8.534 seconds (88% cpu, 0 lips) ns = [183677, 351963, 737135, 246842, 22754, 1176800, 1036258, 625628|...], nss = [0, 1, 3, 5, 8, 10, 12, 14, 16|...]. ... rsort1 : ?- test_list(ns), time(rsort1(ns, n

java - Is there a good patterns for distributed software and one backend database for this problem? -

i'm looking high level answer, here specifics in case helps, i'm deploying j2ee app cluster in weblogic. there's 1 oracle database @ backend. a normal flow of app is - users feed data (to inserted rows) app - app waits data reach size , batch insert database (only 1 commit) there's constraint in database preventing "duplicate" data insertions. if app gets constraint violation, have rollback , re-insert 1 row @ time, duplicate rows can "renamed" , inserted. suppose had 2 running instances of app. each of instances insert 1000 rows. if there 1 duplicate, 1 instance have rollback , insert rows 1 one. i can see smarter re-insert non-conflicting 999 rows batch in instance, if had 3 running apps , 999 rows had chance of duplicates? so question this: there design pattern kind of situation? this long question, please let me know clarify. thank time. edit: 1000 rows of data in memory each instance, cannot see rows of each other. way know i

.net - Cancelling background-worker -

i have following problem , hope able me it. i have worker in vb .net (2010) runs shell-program. the shell program service , output stuff like: server initializing... server opening port... more info... i able 'catch' output of shell , add textbox (using set text function). and able cancel worker clicking on stopbutton, when there no more output shell cannot stop worker anymore. at least suspect that's case. i've tried checking endofstream (commented section) doesn't work. i've tried same code test text in stead of 'clsprocess.standardoutput.readline' , works. so came conclusion must have clsprocess.standardoutput.readline being @ end??? try clsprocess.startinfo.useshellexecute = false clsprocess.startinfo.redirectstandardoutput = true clsprocess.startinfo.redirectstandarderror = true clsprocess.startinfo.filename = serverpath + config_executable clsprocess.startinfo.createnowindow = true

java - Language choices for writing very fast abstractions interfacing with Python? -

i have system written in python can separated backend , frontend layers. python slow, want rewrite backend in fast compiled language while keeping frontend in python, in way lets backend functionality called python. best choices so? i've considered cython it's limited , cumbersome write, , not faster. remember of boost python c++, it's annoying maintain bridge between languages. there better choices? my main factors are: speed of execution speed of compilation language declarative c++ swig can generate of glue code need. long avoid excessive jumps between c++ , python it'll fast c++. swig interfaces straightforward generate unless you're doing "odd".

python - How to check if an argument from commandline has been set? -

i can call script this: python d:\myscript.py 60 and in script can do: arg = sys.argv[1] foo(arg) but how test if argument has been entered in command line call? need this: if isset(sys.argv[1]): foo(sys.argv[1]) else: print "you must set argument!!!" don't use sys.argv handling command-line interface; there's module that: argparse . you can mark argument required passing required=true add_argument . import argparse parser = argparse.argumentparser(description='process integers.') parser.add_argument("foo", ..., required=true) parser.parse_args()

Magento Custom module - how to add custom select box with parent categories -

i wrote module have own menu bar, rather using categories menu bar. so, here want show added menus while adding new menu in tab/form.php in custom menu module. how can show of existing menu names dropdown/options list on form. here code used have menu form. $form = new varien_data_form(); $this->setform($form); $fieldset = $form->addfieldset('menu_form', array('legend'=>mage::helper('menu')->__('menu information'))); $note = "name of menu"; $fieldset->addfield('title', 'text', array( 'label' => mage::helper('menu')->__('menu name'), 'class' => 'required-entry', 'required' => true, 'note' => $note, 'name' => 'title', )); $note = "menu level"; $fieldset->addfield('level', 'select', array( 'label' =&g

Any statistics on how much time developers spend on fixing unit tests/integration tests? -

can provide link respectfull webpage shows statistics of how time development teams spent on fixing unit tests fails (unit test regression) ? regards it depends on complexity of case. don't think there standard measurement of this. cheers!

sql server 2005 - unique constraint on large text field -

i have table column xml feed entry (nvarchar(max)) , executed hash function (md5) on column hash key aid in searching , maintain uniqueness. typically on 900 bytes long.now have realized hash key not guarantee uniqueness since did count of duplicate rows on column , amazed , when tried create unique index on hash key column itself, sql server gave me error of cannot create unique index on non deterministic column..something that. now have searched , found in cases should use type (ntext) , create unique index on that; others mention using checksum , index on that, whilst others mention triggers, checksum, etc. best method implement on field uniqueness keeping in mind table has 22 million records , cannot afford lose data. in advance microsoft recommends not using ntext types because deprecated in future. documentation here . go using checksums , putting unique index on that. this post discusses this.

Zend Framework: Zend_Form in layout -

how add zend_form layout? layout has no "controller" in initiate form. how do this? in response phil brown's comment: class my_view_helper_addmyform extend zend_view_helper_abstract() { public function addmyform() { return new my_form_myform(); } } now in layout: echo $this->addmyform(); i have not tested it, should work assuming have registered my/view/helper helper path. less code, , call when need it.

c++ - Any one have used Posix pthread win32 library, dll files -

i trying setup mqueue in win32 env, need pthread win32 lib, http://sourceware.org/pthreads-win32/ . 1 knows how link vs project? thanks you need link 1 of visual c++ .lib files, named differently depending on exception handling wish in library. see faq here , items 2. , 3. further details. in general: pthread[vg]{se,ce,c}.dll pthread[vg]{se,ce,c}.lib where: [vg] indicates compiler v - ms vc g - gnu c {se,ce,c} indicates exception handling scheme se - structured eh ce - c++ eh c - no exceptions - uses setjmp/longjmp example: pthreadvse.dll (msvc/seh) pthreadgce.dll (gnuc/c++ eh) pthreadgc.dll (gnuc/not dependent on exceptions)

iphone - Apple's MFi program -

does here have experience developing hardware under "made iphone" program? have device broadcasts information via bluetooth, , far way make iphone app displays info if go through mfi program , add apple provided chip hardware. is right? has more details it? that correct. mfi can difficult approved - standards higher app store, , require changes bluetooth widget in order authenticate ios device. if product , company exists, going through mfi process easier startups.

android - Access GPS through NDK applications -

i building simple application android using ndk , needs coordinates gps. i've searched web, have come empty handed. there api or such ndk-programs access gps? no, ndk supports limited number of libraries. designed used things processor intensive, , benefit being written in native language. docs , supported areas: libc (c library) headers libm (math library) headers jni interface headers libz (zlib compression) headers liblog (android logging) header opengl es 1.1 , opengl es 2.0 (3d graphics libraries) headers libjnigraphics (pixel buffer access) header (for android 2.2 , above) minimal set of headers c++ support

gwt2 - cellBrowser placed in composite - do I have to attach directly to the rootpanel (or rootlayoutpanel) -

when using cellbrowser , adding widget flowpanel (to placed wherever, downstream), reason end result dead (a blank screen)...vs if add directly rootpanel (or layout panel) also had same problem. had use <g:htmlpanel> parent of cellbrowser (as seen in gwt showcase).

java - Tapestry 5 user authentication -

i following slim tutorial on tapestry website tapestry 5 , introduced basic database interactions not how user authentication. go more comprehensive guidance in tapestry 5? went tapestry wiki (http://wiki.apache.org/tapestry/tapestry5howtos) wasn't looking bunch of how-to's. know of sources? you can 'roll own' or use 1 of 3rd party modules such tynamo's tapestry-security . if write own, it's idea see how others have implemented have @ source . my first attempt @ writing own security module had me creating class hierarchy components , pages (inheritance supplied security checks) not follow tapestry paradigm. unfortunately seems fashionable tapestry , tapestry modules have sparse documentation.

ns2 - Bug in um-olsr for NS 2.34? -

i think there bug in olsr::degree() method: this method calculates number of symmetric neighbors of node y, excluding members of n. i think olsr_nb_tuple* nb_tuple = state_.find_nb_tuple(nb2hop_tuple->nb_main_addr()); should be olsr_nb_tuple* nb_tuple = state_.find_nb_tuple(nb2hop_tuple->2_hop_addr()); am right? yes friend, you're right. bug. correct line is: olsr_nb_tuple* nb_tuple = state_.find_nb_tuple(nb2hop_tuple->2_hop_addr());

java - How to generate PDF reports that spans multiple pages horizontally -

i have generate pdf reports many (defined @ runtime) columns. these reports may span multiple pages horizontally when user selects many fields show. i'm using dynamicjasper , generate dynamic reports when columns fit in 1 page. when don't, report cropped , few columns shown. i've tried changing page width in runtime , report not cropped, can't printed correctly because page size not standard. right way generate kind of reports? goal split big tables in multiple pages if exceed page width, when printing spreadsheet. possible achieve using jasperreports? thanks in advance. since want print report, have work standard print sizes (such a4 , a3) , landscape orientation since width issue. to possible on page: 1) use smaller fonts 2) use landscape page orientation 3) use larger page size (a3, a2...) long printer can handle it if still can't fit on page, think how want lay out result - see if gave big table you? need split table columns 1 page , column

php - MySQL connection error -

i trying execute following php script (called test1.php, say) on web server running apache. script tries connect mysql server: =============================================== $myhost = "localhost"; $myuser = "anyone"; $mypwd = "1234"; $link = mysql_connect($myhost,$myuser,$mypwd); if (!$link) { die(mysql_errno().": ".mysql_error()."\n"); } echo "connected successfully.\n"; ================================================ i kept receiving errors this: 2002: can't connect local mysql server through socket '/var/lib/mysql/mysql.sock' (13) however, root or normal user, can execute above script shell: shell>php /var/www/html/test1.php connected successfully. i confused , grateful if has hints problem. much. execute <?php phpinfo(); both under apache , cli , compare mysql.default_socket value. after valid socket path (from cli phpinfo) - can specify same php.ini, or right i

java - Removing redundant JUnit testsuite tests -

in our junit testsuite, have spotted few tests not drive coverage, , should removed (they take time not add value test suite). i wondering tools exist can spot redundant tests me? i'd consider misuse of code coverage metric. because test doesn't increase metric, not redundant - test specific execution path consists of loc covered several other tests together, represents behaviour none of other tests cover. , remember: code behaviour influenced state, no test coverage tool know measures coverage of state space. unless runtime of test suite serious problem, there better things can time eliminate possibly redundant tests.

Where to declare/load background image sprites for CSS so that it loads only once? -

i want use single image sprite web page, should declare in css? should in body or where? example: body { background-image:url(/img/sprites.png); } #somediv { background-position: -10px -20px; /* can this? */ } #someotherdiv { background-position: -30px -40px; /* , this? */ } haven't tried because want know first if possible construct sprites. thanks you reference same image each selector: a.mylink { background-image: background-image:url(/img/sprites.png); } a.mylink:hover { /*you don't need re-define styles hover elements, unless want them change*/ background-position: -50px 0; } #someotherdiv { background-image: background-image:url(/img/sprites.png); background-position: -130px -40px; /* , this? */ } there no "global include" in css, reference in each selector. loaded once :)

acquisition - Good ways to acquire resources from parent folders in Plone? -

i have plone (4.0.1) site requires changes in layout depending on folder. imagine structure like: university > faculty > institute a1 > person a11 > person a12 > institute a2 > person a21 ... now if put needed resources (custom css file, images, etc.) zodb, pages person a11 automatically pick fac-image.gif located in faculty folder. however, avoid confusion, not want expose fac-image.gif users. (this part of framework they're not supposed touch anyway.) if register resource, can access stuff ++resource++theme.images/path, no acquisition parents taking place, ++resource++theme.images/facultya/institutea1/fac-image.gif won't find image. worse, have separate directory structure maintain now. what i'm doing hand-rolling "best effort" traversal process through file system directory view try go down path, stay if subdirectory doesn't exist (i.e. resource tree doesn't hav

unit testing - Can Android use standard built JAR files? -

im pretty sure answer no, im using new intellij eap version , have project worked on while written against jdk 1.6 applet based application. however see how useful in android app im interested in creating. do have re-write code/tests again targeting android sdk or can drop in existing jar file , use android ui layer. its android seems make testing way harder needs be, , have alot of existing tests written , working, if wasnt hard write quick unit test (standard junit @test style) wouldnt mind porting, dont whole instrumentation thing, dont need ui @ moment... anyway point, can use existing jdk built code in android app? no! android uses "dalvik" vm project harmony uses different set of bytecodes incompatable standard java jvm bytecodes. this done both optimise vm opreration on mobile platforms, and, more importantly try , avoid copyright , patent disputes sun , oracle. more info here however there tool called "dx" can perform conversion

Why do daemons fork? -

i'm aware (all?) daemons fork when they're being started. i'm under impression run child processes less privileged users, if daemon http server. why necessary though? couldn't process start , drop privileges without forking child process? "mandatory" forking, or there other special reason (other running multiple child worker processes)? i'm new , appreciate can get. i think daemons fork several reasons: one reason to detach process shell starts it . shells (bash, instance) kill children upon exit, unless special, shell-specific precautions made. forking generic way evade this. another reason to report daemon started . assume doesn't fork. how know daemon has been started successfully? can't read , parse daemon output, because daemon management programs should in generic way. way return code of program. indeed, if daemon failed start (for example, couldn't find config file), know immediately. hey, if daemon has been

php - Create a link on the fly when a user enters a code in a form box -

i have form.... <form id="orderform" method="post" orderform="" name=""> <table width="533" cellspacing="0" cellpadding="2" border="0" id="ordertable"> <tbody> <tr> <td>product code</td> <td>meterage</td> <td>sample img</td> </tr> <tr class="item"> <td class="prodcode"> <input type="text" id="prodcode" name="prodcode"> </td> <td class="meterage"> <input type="text" id="meterage" name="meterage"> </td> <td class="imgsample"></td> </tr> </tbody> </table> </form> what when user clicks out of box on prodcode searches folder image reference...creates link on under im

wcf - Is it possible to set a default operation when setting up a service route -

i'm evaluating setting rest system using wcf against using mvc (which have). i've got running able replicate functionality mvc. that is, need able specify wcf equivalent of 'default action'. whilst service route has defaults property, i've not found docs on set in here (assuming used in wcf). the next step, can see, write own service host factory , have custom attribute takes me 1 step far (potentially anyway) i'm using autofac di service dependencies. is default 'operation contract' possible rest on wcf? creating new project using rest 4.0 template includes following: [webget(uritemplate = "")] public list<sampleitem> getcollection() { // todo: replace current implementation return collection of sampleitem instances return new list<sampleitem>() { new sampleitem() { id = 1, stringvalue = "hello" } }; } the /service1/help screen lists following: uri method de

keyboard shortcuts - Jump with Ctrl-O/I doesn't work in my Vim -

i use gvim 7.2 on windows xp. in installation of jump commands don't work, such + o , ctrl + i , whereas :jump , ctrl + t work. what might reason this? checked _vimrc file remapping of <c-o> there doesn't seem remapping. should find reason of problem? to more unix-like behaviour of vim on windows need comment out these lines c:\program files\vim\_vimrc file: source $vimruntime/mswin.vim behave mswin ctrl-o should start working after restart of vim.

asp.net mvc 2 - How to force download in MVC2? -

i have pdf , want offer user simple "download" link. how can made? my idea is - compute url pdf document on server side , store in "viewmodel.pdfurl", - add <a href=...> view calls function. - function use $.post("forcepdfdownload", { pdfurl: <%: model.pdfurl %> } ); to call serverside method: [httppost] public jsonresult forcepdfdownload(string pdfurl) { string path = path.getfullpath(pdfurl); string filename = path.getfilename(pdfurl); response.appendheader("content-disposition", "attachment; filename=" + filename); response.contenttype = "application/pdf"; response.writefile(path); response.end(); return null; } but return null; makes no sense me, methode must return something, otherwise wont visual studio compile... any idea? thanks in advance! no need use json, ajax, jquery or whatever. simply: public actionresult forcepdfdownload(string pdfurl) {

wiki - How to copy test case from one suite to another in FitNesse? -

i have 2 test suites created in frontpage, lets suite1 , suite2. have 1 test case created in suite1, lets testcase1, , have copy of testcase1 inside suite2, may know how can use "recfactor" feature in fitnesse "copy" testcase1 suite2? thanks @! assuming suites suite1 , suite2 have been created directly on frontpage. to move testcase1 suite1 suite2 can click on refactor link of testcase1 page or open link: http://localhost:8000/frontpage.suite1.testcase1?refactor then enter frontpage.suite2 in "new location" field under move section. , click on move page button. testcase1 has been moved under suite2 suite1.

javascript - Multi step form with jQuery which degrades nicely if JS is turned off -

i had form set each section refreshed using ajax, didn’t degrade gracefully javascript turned off , i’ve looked putting each part of form in separate view works fine isn’t great honest. i know client wants nice thought using jquery show , hide forms, if javascript turned off of forms build in 1 long form. problem facing after each section user needs submit information validated before next stage completed. how can if javascript turned off because other forms visible... any ideas? thanks. you might consider using 1 long form divided sections, , if javascript enabled hide 1 section @ time, providing navigation between sections (via tabs , instance). alternately, @ using script , noscript sections, end duplicating form (once in script sections, once in noscript sections) , starts getting maintenance problem.

php - Accessing a single XML DOM Document node -

i new dom documents, trying do, load rss feed in , select 1 node, , save xml file. here xml loading web feed: <?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> <channel> <title>markets</title> <description/> <link>http://www.website.com</link> <language>en-us</language> <copyright>xml output copyright</copyright> <ttl>15</ttl> <pubdate>tue, 16 nov 2010 09:38:00 +0000</pubdate> <webmaster>admin@website.com</webmaster> <image> <title>title</title> <url>http://www.website.com/images/xmllogo.gif</url> <link>http://www.website.com</link> <width>144</width> <height>16</height> </image> <item>

State vs behaviour testing on code which doesn't cross integration boundaries -

i have method has data objects passed it, calculations populate empty fields on objects based on other fields , sends results. method not cross integration boundaries - data objects entities complex tree of dependencies on other entities, method's perspective objects state (thank orm). it seems me unit testing require check of state - set data, run code calculations , check results. legitimate case ignoring seems across board advice tests should check behaviour, not state? or misreading test-driven literature somewhat? i'd you're testing behaviour of method calculations, it's not problem. some people might suggest having behaviour in separate method (as service) , not on classes hold data code smell, that's different issue.

trace - Postgresql Tracing -

is query tracing on postgresql possible? using 9.0 on windows oledb interface. also, need in real-time, not buffered default... i assume mean tracing statements on server side? in case, change parameter log_min_duration 0 in postgresql.conf. you don't need restart server, reload configuration (pg_ctl reload)

database design - Creating a table with volatile columns at first to reduce log size -

i not sure this, think read before, , know if true or false: when creating tables, better put volatile columns first , static columns. mean, put columns updatable, , not updatable @ end. reduce size of transaction log because each time row modified, log write old row, , columns of new row till last updated. row id-pk, code, name , message 1 , 10 , "john doe", "a funny message" update to 1 , 10 , "john doe", "the message changed." in case, log write new row. however, if change order of columns: row id-pk, message , code, name<br/> 1 , "a funny message" , 10 , "john doe" update to 1 , "the message changed.", 10 , "john doe" the transaction log write till last modified column (1, "the message changed.") , improve performance while writting , shipping logs machine when using hadr. i know if true, , can found information this. when full dat

php - How to send email from local machine to gmail? -

i learning php , it's first question on site. hope, me. want send email local machine gmail. have tried didn't got success. please how this. code form processing return mail( $message['to'], join("\n", $headers)) }; ?> you want mail() function see: php.net/manual/en/function.mail.php mail('kushagra@gmail.com', 'my first email', 'the body of email'); you need mail server running on local machine such postfix *nix or pegasus windows. if not have ability run mail server on machine might need use php class allows connect smtp server such swiftmailer or phpmailer . be aware though lot of isps block connections on port 25 (smtp) protect against spamming (see encounter of optus few years ago http://blog.simonholywell.com/post/374223466/optus-cable-port-25-smtp ). if blocking need use smtp server. there tool linked in blog post above allow determine if blocked or not see: http://www.zoneedi

html - How to generate attractive website buttons -

Image
what best way generate attractive buttons web application, example this: is there tool pre-generate images, or library generates them @ runtime? the ideal solution java library generates images via ant task during compilation allows me specify sizes, colors, fonts , of course text (and possibly icon before/after text) generates highlighted versions active/hover generates more interesting glass-like effects beyond simple gradient you can use css3 pie create wonderful buttons 0 weight: http://gradients.glrzad.com/ create buttons and pie make work internet explorer: http://css3pie.com/

Stuck on my Java homework -- Hangman game with StringBuilder -- help? -

*note: not asking homework. stuck. i designing hangman class right now. apparently, need 3 stringbuilders (a) 1 display hyphens: "--------" length of word, b) 1 display correct letters guessed: "--a--e---" , , c) 1 opposite of b (guessed letters replaced hyphens , unguessed letters revealed). purpose of c) see if there matches during guessing. my biggest problem can't find many practical stringbuilder examples on google, namely biggest issue can/should instantiate 3 stringbuilders in hangman class? thanks... i'm guessing here have hangman class works model 3 things (relevant this) is: gives string 1 - each character in word guess gives string shows correctly guessed characters in right position gives string shows characters have been used these dependent on state of model be the word characters guessed based on i'd should have 3 methods return strings , in each of methods create new stringbuilder instance. building stri

html - How to make whole table as a link? -

is possible make whole table link? i have table displays statistical data, wish add additional functionality table .. when user clicks on any part of table , webpage should guide him/her new page. it's not possible. however, can emulated javascript. need asign onclick event handler table , make change document.location property: var mytable = document.getelementbyid("my-table"); mytable.onclick = function(){ document.location.href = "http://example.com"; } you can provide , adequate cursor css: table#my-table{ cursor: pointer; }

objective c - How can I fade out an AVAudioPlayer on a background thread? -

i have audio file needs fade out while user scrolling uiscrollview. however, performselector:withobject:afterdelay: method blocked until user has stopped scrolling. have tried create code perform fadeout on thread: - (void)fadeout { [nsthread detachnewthreadselector:@selector(fadeoutinbackground:) totarget:self withobject:self.audioplayer]; } - (void)fadeoutinbackground:(avaudioplayer *)aplayer { nsautoreleasepool *mypool = [[nsautoreleasepool alloc] init]; [self performselector:@selector(fadevolumedown:) withobject:aplayer afterdelay:0.1]; [mypool release]; } - (void)fadevolumedown:(avaudioplayer *)aplayer { aplayer.volume = aplayer.volume - 0.1; if (aplayer.volume < 0.1) { [aplayer stop]; } else { [self performselector:@selector(fadevolumedown:) withobject:aplayer afterdelay:0.1]; } } it gets far performselector, no further because guess it's trying perform on thread has no access to. can't change perfo

amazon ec2 - Setting up php-mysql based web application on EC2/linode -

i have new web application based on php-mysql.it publisher/advertiser platform can expect lot of traffic if things go in right direction. i considering 2 solutions host site:cloud(ec2) , vps(linode). ec2 looking expensive vendor compare linode. please guide me how set cloud based web application on ec2 minimal cost involved. thanks, this post : http://www.john-nousis.com/development/tutorial-running-a-phpmysql-server-on-ec2-with-ebs/ gives step step tutorial on how set php/mysql app on ec2. info may little bit dated though.

flex - Compile .FLA files using maven -

i using flexmojos build flex projects. have flash project containing .fla files needs compiled swf does have ideas on how that? one solution thought use command line script , force maven call script. this any other ideas? it looks maven similair ant; if so, check out: http://code.google.com/p/flashanttasks/ http://blog.jodybrewster.net/2009/04/26/flashanttasks-compiling-flash-movies-with-ant/

c++ - Using GCC to find unreachable functions ("dead code") -

hey guys, looking way of finding statically unreachable functions in (very) big c++ project. had tried using doxygen , other static analysis tools suggested here seemed project complicated them handle. decided using gcc tools (g++, gprof, gcov, etc.) safest option, although couldn't figure out how it. think g++ optimizations eliminate statically unreachable functions i'm not sure how names of functions eliminates. do have suggestions? thanks! dead code optimization typically done linker - compiler doesn't have overview. however, compiler might have eliminated unused static functions (as have internal linkage). therefore, shouldn't looking @ gcc options, @ ld options. seems want --print-gc-sections . however, note want gcc put each function in own section, -ffunction-sections . default gcc put functions in same section, , ld isn't smart enough eliminate unused functions - can eliminate unused sections.

assemblies - How do I fix the CRT dependency causing a FileLoadException with my vc2005 mixed-mode DLL on XP? -

i have mixed-mode dll built in visual studio 2005. in dependency walker, dll showing dependency of following crt dlls. note on windows 7 developement machine. c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4927_none_d08a205e442db5b5\msvcp80.dll "\msvcr80.dll "\msvcm80.dll 8.0.50727.4927 on windows 7 dev machine using visual studio 2005 compiles , runs fine. problem wont run on windows xp test machine latest crt installed. when drag dll depenency walker on xp machine seems searching dlls in \system32... (i went show full path , there no paths them, yellow exclamation mark) the problem version (build 4927) of crt in winsxs not installed on xp test machine. has visual studio 2005 latest crt installed (sp1?). 8.0.50727.4053 latest version find on msdn. i realize not exciting question posted on so, know 4927 runtime? * edit * the manifest generated mt.exe: <?xml version="1.0" encoding="utf-8" standalone=&quo

Sessions in Codeigniter -

i using sessions store data multi step form when user completes 3 sections of form information inserted in database. have built form user can go stage , modify information have submitted, thing though, values repopulate form stored in sessions if user leaves form page , goes elsewhere in website , returns form information still in form…is there better way this? want data destroyed if leave form… thanks assuming form exists in 1 controller , isn't spread across multiple ones, unset session values in __construct of every other controller. (you extend base controller if have lots save hassle of adding functionality many. that way if user visits section, values lost, providing remain within "form" can remain intact.

Simultaneous Translations on Android -

i'm trying several translations simultaneously on android. i have 2 or more buttons on layout (all same size), , when press 1 want others move out of screen. i've done test app try implement behaviour. on i've set listener on click of 1 button test, like: button.setonclicklistener(new view.onclicklistener() { public void onclick(view view) { button tomove = (button) findviewbyid(r.id.button_test2); button tomove2 = (button) findviewbyid(r.id.button_test3); animationset set = new animationset(true); translateanimation anim = new translateanimation(0, -tomove .getwidth(), 0, 0); anim.setfillafter(true); anim.setduration(1000); tomove.setanimation(anim); tomove2.setanimation(anim); set.addanimation(anim); set.startnow(); } the view: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com

hibernate - Gorm returned value type -

i have object foo hasmany association bar object class foo { string value static hasmany = [ bars: bar ] } class bar { string value } when try follwing def foo = foo.find("from foo f f.value=:value",[value:value]) the type of returned value foo foo, while when this def foo = foo.find("from foo f left join f.bars b b.value=:value",[value:value]) the type object can explain me why ? thx, ken. because second query selects properties of not foo bar . if println foo , output second foo this: [foo : 3, bar : 2] if add loggingsql = true datasource definition, hibernate output actual sql it's using stdout - like: select foo0_.id id0_0_, bar2_.id id2_1_, foo0_.version version0_0_, foo0_.value value0_0_, bar2_.version version2_1_, bar2_.value value2_1_ foo foo0_ left outer join foo_bar bars1_ on foo0_.id=bars1_.foo_bars_id left outer join bar bar2_ on bars1_.bar_id=bar2_

ruby on rails - Mongoid many-to-many, is this normal? -

here models: class user include mongoid::document include mongoid::timestamps references_many :roles, :stored_as => :array, :inverse_of => :users ... end class role include mongoid::document field :name, :type => string references_many :users, :stored_as => :array, :inverse_of => :roles ... end i first create roles via seed, rake db:seed. seed file contains: puts '*** add default roles' [ { :name => 'user' }, { :name => 'artist' } ].each |h| role.create(h) end the roles created successfully. however, when add role user, do: foobar = user.first foobar.roles.create(:name => 'user') i notice 2 things: 1) adds role reference in user collection. 2) creates 3rd role in role collection. this kind of strange because have 3 roles: user, artist , user. 2nd user collection has user_ids reference contains foobar's id. is normal? i think rather want do: foobar = user.first foob

how do print labels next to a plot in R? -

Image
i plotting 2 lines using plot(x,y, type="l", color="red") and points(x2,y2, type="l", color="blue") i want able add label next each line (instead of legend). pretty sure possible using package in http://directlabels.r-forge.r-project.org/ . yet, don't find easy way of doing that. you can use locator() within text() point&click method. y <- rnorm(100, 10) y2 <- rnorm(100, 20) x <- 1:100 plot(x, y, type = "n", ylim = c(0, 40), xlim = c(0, 120)) lines(x, y) lines(x, y2, col = "red") text(locator(), labels = c("red line", "black line)"))

java - drawing random circles, storing their coorindates in an array -

for homework want draw circles randomly around screen. if of circles overlap, want fill in circles. starting code draws circles on screen wherever mouse pointer clicked. confused how use random values determine circles , how store values in array or arraylist. think fill in circles use statement comparing distance between centerpoints of circles. thank suggestions. here starting point trying figure out how modify: import java.util.arraylist; import javax.swing.jpanel; import java.awt.*; import java.awt.event.*; public class dotspanel extends jpanel { private final int size = 6; // radius of each dot private arraylist<point> pointlist; //----------------------------------------------------------------- // constructor: sets panel listen mouse events. //----------------------------------------------------------------- public dotspanel() { pointlist = new arraylist<point>(); addmouselistener (new dotslistener()); setbackgroun

c# - How should I 'rotate' or 'flatten' this research data? PIVOT, self join or something else? -

i'm having hard time finding examples close i'm doing, or i'm not understanding examples i'm finding. i have research database contains persons responses multiple questions @ different points in time. 'admin#' below represents "administration" of test data represents. or can think of containing 'time' test given, example, time1, time2, time3 respondentid# admin# question1 question2 question3 question4 question5 1 1 b c d e 1 2 e d c b 1 3 q w e r t 2 1 z x c v b 2 2 p o u y 2 3 y h n u j what need arrange data each set of responses particular respondent in same row. we'd take 5 question fields , turn them 15 question

C++ forward declaration error -

i have error goes this in file included level.hpp:12, main.cpp:4: corridor.hpp: in method `void game::corridor::update()': corridor.hpp:41: invalid use of undefined type `class game::level' corridor.hpp:13: forward declaration of `class game::level' corridor.hpp:42: invalid use of undefined type `class game::level' corridor.hpp:13: forward declaration of `class game::level' corridor.hpp:43: invalid use of undefined type `class game::level' corridor.hpp:13: forward declaration of `class game::level' corridor.hpp:44: invalid use of undefined type `class game::level' corridor.hpp:13: forward declaration of `class game::level' corridor , level ... // corridor.hpp #ifndef game_corridor_hpp #define game_corridor_hpp #include <moot/math.hpp> //#include <level.hpp> #include <gamewindow.hpp> namespace game { class level; // <-- line 13 class corridor { static const unsigned int def

php - Matching x words in brackets regex -

i trying remove brackets string if contains 4 or more words. have been scratching head , cannot anywhere it. preg_replace('#\([word]{4,}\)#', '', $str); # pseudo code sample string: robert alner fund standard open nh flat race (supported andrew stewart charitable foundation) to match (more x words in brackets) , remove: (supported andrew stewart charitable foundation) i have 2 sources of data, , using: similar_text($str1, $str2, &$percent) to compare , longish strings in brackets unique 1 source. well, you're close... preg_replace('#\((\b\w+\b[^\w)]*){4,}\)#', '', $str); basically, inner sub-pattern (\b\w+\b[^\w)]*) matches word-boundary (meaning not in-between 2 word characters) followed @ least 1 word character (a-z0-9), followed word-boundary, , followed 0 or more characters not word characters , not ) ... testing with: $tests = array( 'test1 (this three)', 'test2 (this 4 words)

sql server 2008 - find which tables contain specific text -

i have database has few hundred tables i need find specific string in of columns in of tables. how approach problem>?? to find table columns use: select table_name=sysobjects.name, column_name=syscolumns.name sysobjects join syscolumns on sysobjects.id = syscolumns.id join systypes on syscolumns.xtype=systypes.xtype sysobjects.xtype='u' order sysobjects.name,syscolumns.colid if want data in tables use dynamic sql can on these lines: declare @sql varchar(100) declare @temp table (ind int, tablename nvarchar(100)) insert @temp select row_number() over(order [name]), [name] ( select [name] sys.tables ) d declare @index int set @index = 1 while @index < (select count(*) @temp) begin set @sql = ' select * ' + (select tablename @temp ind = @index) exec (@sql) set @index = @index + 1 end

iphone - plist as persistent storage for storing and retrieving data between closing and restarting app -

i trying save few property plist when user starts app first time, , have retrieve data , show user, when user restart app, don't have ask same data again. i guessing should straight forward, may missing something. it nice if 1 can point me sample code doing same thing, nice if code saves , retrieves data dictionary plist , plist dictionary. i looked apple property list programming guide , used code reading , writing property list data http://developer.apple.com/library/mac/documentation/cocoa/conceptual/propertylists/readwriteplistdata/readwriteplistdata.html#//apple_ref/doc/uid/10000048i-ch8-sw1 but, when restart app, don't data have stored. * edit * i adding code 1 can point out if making mistake. i created plist file "data.plist" in project resources folder. this how save data in 1 of view controller nsstring *path = [[nsbundle mainbundle] bundlepath]; nsstring *finalpath = [path stringbyappendingpathcomponent:@"data.plist"]; /