Posts

Showing posts from January, 2013

javascript - position canvas on top of Scrollbar -

i simulation projectile motion path. i've 1 div css overflow property , curve drawn using canvas. want motion path appear @ top of everything. curve gets cut @ position scroll bar is. if change canvas z-index maximum or similar make canvas appear @ top scrollbar doesnt work... here jsfiddle demo of problem jsfiddle demo following javascript code: var canvas = document.getelementbyid('canvastron'); var context = canvas.getcontext('2d'); context.beginpath(); context.moveto(100, 150); context.lineto(350, 50); context.stroke(); is there way ??? if have no situation, go have mentioned, here solution . addition in css: #canvastron{position:absolute; clip: rect(48px, 351px, 151px, 99px);} with canvas, cannot scroll work effectively. occupy area of div below , not make scroll work. the provided solution has purely applied in case of worst case scenario, left no option , have under existing circumstances. otherwise, not possible. ...

java - Jettison with json marshalling converting string data type to integer type, when value is numeric -

we using jettison-1.3.3 converting jaxb json. we facing issue. whenever have string property contains numbers (i.e. string phone="12345";), json response display number (12345) without having double quotes. if value coming 1234as in case returns double quote. how fix , making sure has double quotes. please help there type converters in jettison. default uses default type converter. default type convert removes double quotes if value numeric type. to double quotes use simpleconverter. create system property - i.e system.setproperty("jettison.mapped.typeconverter.class", "org.codehaus.jettison.mapped.simpleconverter"); so jettison uses simple converter , output values string.

php - DataTables (CRUD) - Server Side Adding New Record -

i'm trying use datatables (crud) plugin can found on datatables data manager (crud) add-on so far working fine except when try add new record. i've followed instruction on example on link adding records , wiki example this code i'm using insert new record // open db connection $link = dbconnect('dbname'); $params = array(); $options = array( "scrollable" => sqlsrv_cursor_keyset ); // prepare insert $updatequery = "insert $tblname ($columns) values ($valuestemp)"; $id = 0; $entity_id = array(); // run insert , if it's been succesful enter if condition if(sqlsrv_query( $link, $updatequery ) == true){ // last inserted id $getid = "select max(entity_id) 'id' holdingtable client_id = '$client_id' , project_id = '$project_id'"; $result = sqlsrv_query( $link, $getid, $params, $options ); while ( $arow = sqlsrv_fetch_array( $result, sqlsrv_fetch_numeric )...

html - Not taking css property values to div generated by jQuery -

i have created css .tablescroll_wrapper { border-left:1;border-top:0; overflow-y:scroll; overflow-x:visible; width:1320px;height:300px;} jquery ;(function($){ var scrollbarwidth = 0; // http://jdsharp.us/jquery/minute/calculate-scrollbar-width.php function getscrollbarwidth() { if (scrollbarwidth) return scrollbarwidth; var div = $('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div></div>'); $('body').append(div); var w1 = $('div', div).innerwidth(); div.css('overflow-y', 'auto'); var w2 = $('div', div).innerwidth(); $(div).remove(); scrollbarwidth = (w1 - w2); return scrollbarwidth; } $.fn.tablescroll = function(options) { if (options == 'undo') { var container = $(...

java - How to read list elements with attribute via XStream -

i'm using xstream read below example xml file. <list> <file>/setup/x86-linux2/bin/zip.txt</file> <file type="dir">/src/bin/</file> <name>test xml</name> </list> below code reading above xml, public class listwithconverter { public static class fileconvertor implements converter { public boolean canconvert(final class clazz) { return clazz.equals(myfile.class); } public void marshal(object source, hierarchicalstreamwriter writer, marshallingcontext context) { throw new unsupportedoperationexception("not supported write file element yet."); //$non-nls-1$ } public object unmarshal(hierarchicalstreamreader reader, unmarshallingcontext context) { myfile file = new myfile(); (iterator<string> iter = reader.getattributenames(); iter.hasnext(); ){ string ...

php - RegEx for preg_match_all not working -

this string ( $string ): swatch: 'http://abc.com/aa.jpg', zoom:[ 'http://abc.com/bb.jpg' ], large:[ 'http://abc.com/cc.jpg' ], i use following pattern in php file , want match http://abc.com/bb.jpg : preg_match_all('/(?<=zoom:\[\s{15}\').*(?=\')/', $string, $image); but nothing returned. should do? to make simpler, won't use around , although said need s modifier, wrong it's used match new lines dots . won't using here, \s matches new line: $string = <<<jso swatch: 'http://abc.com/aa.jpg', zoom:[ 'http://abc.com/bb.jpg' ], large:[ 'http://abc.com/cc.jpg' ], jso; preg_match_all('/zoom:\[\s*\'(?<img>[^\']*)\'\s*\]/', $string, $m); print_r($m['img']); output: array ( [0] => http://abc.com/bb.jpg ) explanation: / # starting delimiter ...

Delphi 2010 forms shows on "wrong" monitor -

i have simple test app, 1 empty form, , second containing tbutton. button script this:- procedure tform1.button1click(sender: tobject); begin form2.show(); end; form2 auto-created @ startup. there's no other code @ all. when run app, can press button , form2 appears. can reposition/resize form2 on primary monitor, , close it. if press form1 button again, form2 correctly reappears in position last at. fine far... however, if position form2 onto secondary monitor, close it, , press button, form2 appears on primary monitor! i want form reappear on monitor last on - how can behaviour?? this because default value form's defaultmonitor property dmactiveform . set form2's defaultmonitor dmdesktop , , problem resolved.

apache - Capistrano deploy to www folder -

i have webserver external host. website run /www folder. configured , did capistrano deploy /www on remote server. after playing settings, deployment went expected. the problem on websserver have folders: /www/current /www/shared /www/releases but webserver runs wordpress site /www not www/current. cannot change myself don't have privileges so. best way solve ? @edit created command rsyncs current release www folder. works, best option ? namespace :emuse desc "copy files www directory" task :copyfiles run "rsync -azo /site/deployment/project/current/ /site/www" end end current path set that: set :current_path, "/www"

node.js - installing nodejs without dependencies -

hi having ubuntu server not have internet connection. need install node , npm related packages it.i have source file of nodejs , node modules. there way install build essential package , python dependencies without using below code sudo apt-get update sudo apt-get install build-essential -y sudo apt-get install python libssl-dev -y these commands hit external url impossible since there no internet connection.i stuck here.any helpful. $tar -zxf node-v0.10.5.tar.gz $cd node-v0.10.5 $./configure && make && sudo make install just download node first http://nodejs.org/download/ each npm package can stand alone, using npm on machine has connection, can move node_modules file modules new machine.

python - in python2.7 how to align the text with the button -

in python 2.7 i'm trying align text frankie anne next name button , 27 next age button can them in center far. tried left , bottom didn't work. helpful. from tkinter import * root = tk() toolbar = frame(root) b = button(toolbar, text="home", width=9) b.pack(side=left, padx=2, pady=2) b = button(toolbar, text="about-us", width=9) b.pack(side=left, padx=2, pady=2) b = button(toolbar, text="contact-us", width=9) b.pack(side=left, padx=2, pady=2) b = button(toolbar, text="travelling", width=9) b.pack(side=left, padx=2, pady=2) toolbar.pack(side=top, fill=x) o = label(root,text="frank anne",font =("italic",18,"bold")) o.pack() toolbar1 = frame(root) b = button(toolbar1, text="name",width=9) b.pack(side=left, padx=2, pady=2) o = label(root,text="27",font =("italic",10,"bold")) o.pack() o = label(root,text="frankie anne",font =("italic",10...

php - PEAR DB, moving from MySQL 4 to 5, .ini file issue? -

we're running custom made cms uses pear db class handle database. database using mysql 4.0. our hosting provider updating mysql 5.0 , deactivating databases using 4.0. i've exported old db , made new 5.0 1 (i recommend bigdump.php this, had around 500k lines). the migration successful, there's been side effects (some pages missing content there earlier, ones affected seems random). pear relies on sort of .ini files act maps of db. didn't code system i'm not familiar how works. copied old .ini files have feeling need somehow generate new ones. the manual describes createtables.php running nothing, script crashes no output. the ini file looks bit this: [artist] id = 129 first_name = 2 last_name = 130 display_name = 130 bio = 66 is_live = 145 is_deleted = 145 date_updated = 384 [artist__keys] id = n [artist_image] artist_id = 129 url = 130 date_updated = 384 , on db tables... i understand issue specific , it's hard help, if point me in right direc...

ios - iPhone : How to change color of particular pixel of a UIImage? -

i have uiimage, want change colour of particular pixel, 224 x 200th pixel. how can this? possible do? in advance. after searching lot complete day got exact solution, though found many none of them worked. here have got, works flawlessly -: // method creates image changing individual pixels of image. color of pixel has been taken array of colours('avgrgbsofpixel') -(void)createtexture{ self.sampleimage = [[uiimageview alloc]initwithimage:[uiimage imagenamed:@"whitebg.jpg"]]; cgrect imagerect = cgrectmake(0, 0, self.sampleimage.image.size.width, self.sampleimage.image.size.height); uigraphicsbeginimagecontext(sampleimage.image.size); cgcontextref context = uigraphicsgetcurrentcontext(); //save current status of graphics context cgcontextsavegstate(context); cgcontextdrawimage(context, imagerect, sampleimage.image.cgimage); // , draw point on wherever want this: // cgcontextfillrect(context, cgrectmake(x,y,1,1)); //fix error according @gsempe...

asp.net mvc - how to give a instance name? -

i'm using third party scheduler in project here example, http://scheduler-net.com/docs/simple_.net_application_with_scheduler.html public actionresult index() { var scheduler = new dhxscheduler(this); scheduler.loaddata = true; scheduler.enabledataprocessor = true; return view(scheduler); } how can replace word "this" instance name ? if understand question correctly, define constructor way: public myconstructor() { myinstance = this; } than can use myinstance instead of this . hope helps.

lambda - simplify this python generation -

i new python. there way simplify this: def getdivs(): divs = soup.findall(name = "div", attrs = {"class" : "resultcell"}, recursive = true) div in divs: h2 = div.find("h2") = h2.find("a") href = a["href"] yield (href) divs = list(getdivs()) i feel should able create anonymous function instead of getdivs. (pseudocode): divs = [ divs = soup.findall(name = "div", attrs = {"class" : "resultcell"}, recursive = true) div in divs: h2 = div.find("h2") = h2.find("a") href = a["href"] yield (href) ] thanks just use list comprehension: divs = [ div.find("h2").find("a")["href"] div in soup.findall(name = "div", attrs = {"class" : "resultcell"}, ...

algorithm - Is possible to denote a vector of numbers uniquely as a number? -

given vector of numbers: v=(v1, v2, ..., vn). these n numbers don't need distinct or sorted. suppose have few vectors v1, v2, ..., vm. possible use number (integer or float number) uniquely denote each vector, such vi not equal vj, corresponding numbers f(vi) , f(vj) not equal either. a simple solution have 1 number in range 0 m-1 id represent vector, assume kind of solution cannot work in case each vector stored in few distributed machines. is, portions of vectors in 2 machines might overlap, , algorithm doesn't know distribution of vectors globally. i'm assuming inputs in principle unbounded , output number, it's trivial otherwise. simple way concatenations representations of n , v1, v2, .. vn in base b. represent them in k-bit digits, annotate each k-bit digit continuation bit (0 if next k-bit group starts new number, 1 if belongs same number). isn't of use except equality tests, did not mention else. if care preserving locality (i.e. nearby po...

java - Converting multiple JFrames into one single JApplet -

as title suggests, have find way convert multiple jframes connected each other (they in same package way) single japplet. know should have used jpanels instead of jframes, have more 10 jframes , found nothing online(they converting single frame japplet) what tried far initialized programentrance (which beginning jframe of whole program) applet's init() method. didn't work. in desperate situation, helps or comments appreciated. in advance. convert 10 frames 10 panels. add 10 panels 1 panel cardlayout . add 1 panel to: a jframe launched a link using java web start . a japplet embedded in web page. btw what is question? why code applet? if due due spec. teacher, please refer them why cs teachers should stop teaching java applets .

sql - How do I use the grouping clause in my select statement with grouping sets? -

i learned of using grouping sets clause , believe can re write 1 of old queries. currently, union of 5 different groupings coming cte. understand should able change different hierarchies being grouped grouping sets of rollup, need specify literal @ each level or grouping. can't show actual code, have example below. select b.level_one, b.level_two, b.level_three, b.level_four, b.level_five, case when (grouping(b.level_five)=1) '' when ... when ... when ... when ... when ... end as'level_type', sum(b.value) total base b ... group grouping sets( (b.level_one, b.level_two, b.level_three, b.level_four, b.level_five), (b.level_one, b.level_two, b.level_three, b.level_four), (b.level_one, b.level_two, b.level_three), (b.level_one, b.level_two, b.level_four), (b.level_one, b.level_two), (b.level_one, b.level_two) ) this general idea of think want go. problem i'm havi...

php - Action Script 3. How to get time from game and insert to database? -

i'm creating flash game. here timer, counts how long player playing. when "game over" counter stops. , need write time database. counter format mm:ss, don't know how it. here code send data game php: var urlreq:urlrequest = new urlrequest ("band.php"); // set method post urlreq.method = urlrequestmethod.post; // define variables post var urlvars:urlvariables = new urlvariables(); urlvars.time = timer.currentcount; urlvars.username = "myusername"; // add variables urlrequest urlreq.data = urlvars; // add urlrequest data new loader var loader:urlloader = new urlloader (urlreq); // set listener function run when completed loader.addeventlistener(event.complete, onlogincomplete); // set loader format variables , post php loader.dataformat = urlloaderdataformat.variables; loader.load(urlreq); so send time variable php. here php code time: <?php $time = $_post['time']; $username = $_post['username']; $c...

java - How can I add policy file to the jar applet which is embedded in html file -

i have html: <html> <title>the hello, world applet</title> <hr> <applet code=javaapplication4.test.class archive="javaapplication4.jar" width=600 height=400> </applet> <hr> </html> and want add following policy file it: /* automatically generated on thu may 09 15:48:03 ast 2013*/ /* not edit */ grant { permission java.security.allpermission; }; because want let applet allpermission desktop application. how can ? if html insert policy file machine, huge security bug. fortunately, best of knowledge, not possible. if applet needs trust, digitally sign it.

c# - Routing the right way in .NET MVC4 -

i'm developing admin panel , have created new area called "admin" start. in adminarearegistration.cs file routing this context.maproute( "admin_default", "admin/{controller}/{action}/{id}", new { controller = "index", action = "index", id = urlparameter.optional } ); so can reach admin panel http://{mydomain}/admin/ and have 2 controllers. indexcontroller manage login, signin, etc. usercontroller manage listing users, adding new user, etc. when try access user's list url http://{mydomain}/admin/user/list/ pretty looking url. when try access signin new admin url this: http://{mydomain}/admin/index/signin/ but didn't 2nd url. can access index controller http://{mydomain}/admin/signin/ , others first one. and how approach kind of situation? want in right way for signin url, if have signin action set-up in indexcontroller, set-up route before "admin_default" route this: context...

html - JQuery Div expand and scroll to bottom -

im using jquery expand div when button clicked, here button code: <input type="button" value="reply" onclick="jquery('#replycont').slidetoggle()" /> and actual div: <div id="replycont" style="display:none; border:1px #000000 solid; padding:10px;"> <form method="post" action="index.php?id=viewticket&seq=<?php echo $_get["seq"]; ?>#updates_bottom" enctype="multipart/form-data" class="form-stacked"> <div class="control-group"> <label class="control-label bold" for="message">message</label> <div class="controls"> <textarea name="ticket_update" id="ticket_update" rows="12" style="width:100%;"></textarea> </div> </div> <p><input type="hi...

It is possible to show list/dictionary generator progress in python? -

i build big dictionary (2^20 elements) in python using dictionary generator expression (i'm using idle this). process long because of every element needs hard computing. possible known progress of operation? i understand easy if don't use generator expressions, nevertheless question interesting think. if use yield write generator function instead of using generator statement, put logging or other sort of feedback before every yield statement.

php - Show message if header location redirect fails -

this question has answer here: how can check if url exists via php? 15 answers i need redirect unknown address. if address not available show message user. how that? <?php header("location: http://www.example.com/"); exit; ?> the direct method retrieve page: if (file_get_contents('http://www.example.com/') !== false) { header("location: http://www.example.com/"); exit; } http://php.net/manual/en/function.file-get-contents.php however, tells if available @ page. won't tell if, instance, you got 404 error page instead . for (and save memory cost of downloading whole page), can get_headers() url instead: $url = "http://www.example.com/"; $headers = get_headers($url); if (strpos($headers[0],'200 ok') !== false) { // or header("location: ".$url); exit; }

jsf - p:commandButton don't redirect when ExternalContext#redirect() is called -

here's example button can throw exception: <h:commandbutton value="save" update=":formtable:tabledata"> <f:setpropertyactionlistener value="btn_one" target="#{tamplatetablebean.buttonselected}" /> </h:commandbutton> in exceptionhandler have: facescontext.getcurrentinstance().getexternalcontext().redirect("error.xhtml"); when use <h:commandbutton> (as above example) , exception occurs, redirect executed , error page displayed. when use <p:commandbutton> , redirect not happening (even though line redirect("error.xhtml") executed) , stay on same page if nothing happened. exception caught in exceptionhandler , jsf error page not displayed. how caused , how can solve it? as describe in link iin balusc comment - omnifaces solve problem. remove excetionhandler implementation , change omnifaces -> in docs, import omnifaces.jar, add faces-config.xml <factor...

primefaces - p:confirmDialog message not refreshed after f:setPropertyActionListener -

i have datatable , on each row there commandlink . on click of commandlink set row object property of baking bean using f:setpropertyactionlistener tag. when debut can see setter of property has been called , correct value getting passed. on commandlink oncomplete have call open confirmdialog , shows values selected row user before confirming action. the problem confirmdialog not showing latest value selected. <p:commandlink id="divadj" styleclass="commandlink" value="confirm" oncomplete="confirmation.show()" update="@form" process="@this"> <f:setpropertyactionlistener target="#{corporateactionbean.selectedcarecord}" value="#{dividendrecord}"/> </p:commandlink> <p:confirmdialog id="confirmdialog" header="confirm corporate a...

php - Placing text (or a link) on top of an image -

what i'm looking way place text, in case link, on top of image in specific location, preferable coordinates. know there's way place link on image via usemap, far know it's possible make link form, rectangle or circle. i have looked way far have come short, hope there's can little. <div style="position:relative"> <img src="http://www.example.com/blahblah.jpg"> <a style="position:absolute; left:0px; top:0px;" herf="http://www.example.com">some link</a> </div> you need contain link in element , give position of relative while giving link element position of absolute , , setting left , top , bottom , and/or right

c# - String manipulation: How to replace a string with a specific pattern -

i've question here related string manipulation based on specific pattern. trying replace specific pattern pre-defined pattern using c# for eg: scenario # 1 input: substringof('xxxx', [property2]) output: [property2].contains('xxxx') where string used within linq's where clause. my sol: var key= mystring.substring(mystring.split(',')[0].length + 1, mystring.length - mystring.split(',')[0].length - 2); var value = mystring.replace("," + key, "").replace([key dictionary], [value dictionary]);   expected string: key + '.' + value.replace("('", "(\"").replace("')", "\")"); but works above scenario. generalize teh below scenario's. scenario's: input: [property1] == 1234 , substringof('xxxx', [property2]) , substringof('xxxx', [property3]) output: [property1] == 1234 , [property2].contains('xxxx') , [property3]...

php - $GLOBALS superglobal gets modified when passed to a function -

i came across weird behavior in php: function f($var) { // not using references foreach ($var $k => $v) { unset($var[$k]); // shouldn't unset copy?! } } print '<pre>'; var_dump($globals); // array f($globals); var_dump($globals); // null?! http://3v4l.org/dqmqn anybody know why happening? print out it’s deleting , enable warnings see what’s happening ! =) $globals contains globals . unset it, removes actual global variable. if just pass-by-reference behaviour, empty array, not null .

ruby on rails 3 - Why doesnt a migration update a model? -

i'm new rails , trying understand relationship between migrations , models. far can tell migration seems affect datastore hence after use scaffolding create resource, responsible keeping model , migrations in sync? there tools assist in this? sorry if obvious question, i'm still working way through docs. all migrations modify database. rails handles maintaining sync between model , database. you can have user table has id , firs_name , class model might this class user < activerecord::base end as can see model class empty , can still pretty access methods on class this: @user = user.new @user.first_name = "leo" @user.save! and know it. migrations files allow modify database in incremental steps while keeping sane versioning on database schema. of course, rails complain if try call things model don't exist in database or activerecord::base parent class. @user = user.new @user.awesome #=> undefined method `awesome` #<user:s...

c# - Will a pointless semicolon have any performance impact? -

sometimes, notice add additional ; after statement. example: console.writeline("meow");; will effect performance in app? specifically, wondering c#. none whatsoever; not impact il code compiler generates. it may have performance impact on coworkers have maintain code... you might interested in reading empty statements , such bool processmessage() {...} void processmessages() { while (processmessage()) ; }

c++ - Force memory allocation to allocate from higher address (>4GB) on 64-bit Linux -

here're want do: have library built 64-bit linux. created application linking library. want make sure when run application, memory allocated library in higher location (>4gb). on windows, user can force allocations allocate higher addresses before lower addresses testing purposes, specify mem_top_down when calling virtualalloc or set following registry value 0x100000: hkey_local_machine\system\currentcontrolset\control\session manager\memory management\allocationpreference i wonder if there's similar strategy on linux. understand linux memory management different window, found clue such using mmap() or linker scripts. haven't been able achieve goal. provide more information? #include <sys/mman.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #define handle_error(msg) \ { perror(msg); exit(exit_failure); } while (0) int main() { void *addr1=0, *addr2=0; long sz = sysconf(_sc_page_size); // page size size_t length ...

multithreading - Handling background network operations in Python -

let me preface saying i'm not entirely familiar python, have plenty of experience programming in other languages. i'm working on tool allows me inject packets tcp network stream. idea code acts transparent proxy between 2 network endpoints. i've got code working such proxy works, , can parse packets , automate injection (i.e. detect particular state , modify / inject packets), end goal involve user interaction. what i'm trying work out how can go having network stuff run in background, whilst command line interface prompts user commands. when command given, might perform kind of injection. in c# i'd handle background worker task or thread, have cli trigger events, i'm not familiar how kind of design implemented in python. how should approach this? if you're familiar pattern of having background process , triggering events, take same approach in python. take @ multiprocessing module create background process (thus avoiding global inteprete...

java - Redis performance on AWS EC2 Micro Instance -

i have made funny observation on redis instance deployed on aws ec2 micro instance ( test environment) i measuring execution times of various operations have hit redis. summarise, execution times ( average) shown below: jedis -> redis connection 63 milliseconds read of top element in list using lrange(<listname>,0,1) 44 milliseconds read of entire elements of set 5ms iteration on entire set space 60ms( set space approx 130 elements) iteration on subset of elements of set 5ms ( subset element size 5) now worrying me first 2 operations ( connection , extraction of top element in list). for connection, code shown below: jedis redis= new jedis("localhost"); and extraction of top element in list: string currentdate = redis.lrange(holderdate,0,1).get(0); now redis lrange command documentation: time complexity: o(s+n) s start offset , n number of elements in specified range. now code s 0 , n 1. my question is: causing these execution times ...

java ee - Glassfish realm login redirects to wrong page -

here form in index.jsp page called: <form action="log_in" method="post"> <table> <tr> <td> <select name="user_type"> <option value="doctor">doctor</option> <option value="pharm">pharm</option> <option value="micro">micro</option> <option value="pat">pat</option> <option value="admin">admin</option> </select> </td> </tr> </table> <p><input type="submit" value="enter" ></p> </form> here's servlet , post...

oracle - Adding new column and index to a table with a billion records -

i want add new column table billion records. speed select statement, need add new index contain column , pk column. how long take add new index in billion records table? the new column example [field], value 0,1,2,9. of record's 9. in select condition field=0 or field=1 or field=2 used, field=9 not used. for example in billion records table , field value 0 records:100,000; field value 1 records:100,000; field value 2 records:100,000; field value 9 records:a billion-300,000 should create index on column? if not, select sql contain condition field=0 slow return results? if of values 9's can avoid including them in index with: create index my_index on my_table (case column_name when 9 null else column_name end); then query on ... select ... ... case column_name when 9 null else column_name end = 2 ... example. the time taken time required scan entire table, sort 300,000 records go in index. faster parallel index build, of course.

Accurev command for promoting all files upstream -

i wondering if there command can executed move files 1 stream parent stream? accurev appears can use -s , -s specify stream, not appear work needs. have stream like: base --> integration --> release --> developer workspace. i can create commands promote changes developer workspace release. want create command promote files on server upstream. example if there files in release promote them integration. thought? here used promote workspace release stream on server, not there don't have workspace location can specify set workspaces="c:\ittraining\accurev\new hire code\"* c: cd %workspace% rem prompts user log accurev prior performing actions if errorlevel 1 goto exit /d %%g in (%workspaces%) ( echo starting update to: %%g echo starting update to: %%g rem used run update on workspace echo accurev update echo adding external content to: %%g echo accurev add -x -c "new content" echo promoting content to: %%g r...

c# - format number with 3 trailing decimal places, a decimal thousands separator, and commas after that -

this simple question, , i'm sure there's way string.format() , numberformatinfo , cultureinfo or combination of them, need display large numeric values 3 trailing decimal places, decimal instead of comma thousands separator, , comma millions separator , up. the input either whole number or number followed 3 decimal places (20000, 123.456, 12.2) for example: 142650 should display 142,650.000 11200.50 should display 11,200.500 123.456 should remain 123.456 i suppose it's same dividing value 1000 , using string.format("{0:f3}", value) , hoping find didn't take arithmetic. string.format("{0:#,#.000}", value) gets me close, puts leading 0 on small numbers, 1.256 displaying 01.256, when need remain 1.256 the format string.format("{0:#,0.000}", value) ended doing me. works whole numbers , numbers anywhere 1 3 trailing decimal places.

php - Submit form to a directory (example.com/product/), form action=""? -

i've tried <form action="/product/" method="get"> , doesn't work. usually have php file such search.php in same directory such <form action="search.php" , i'm implementing different kind of search needs send request same place. what i'm getting: (e.g. if i'm on page example.com/product/foo ) example.com/product/foo?id={query} ; what want: example.com/product/?id={query} ; update: upon instpecting elements, seems it's action=" product " . something's slashes. checked source code, , seems fine. got work after changing double quotes single quotes... <form action="/product/" method="get"> .

spring jndi datasource setup -

hi trying use jndi data source. below code context.xml <context antijarlocking="true" path="/springmvctest"> <resource auth="container" driverclassname="com.mysql.jdbc.driver" maxactive="20" maxidle="10" maxwait="10000" name="jdbc/pluto" password="" type="javax.sql.datasource" url="jdbc:mysql://localhost:3306/spring?zerodatetimebehavior=converttonull" username="pluto"/> </context> in spring-servlet config bean is: <bean id="datasource" class="org.springframework.jndi.jndiobjectfactorybean"> <property name="jdbc/pluto" value="java:comp/env/jdbc/pluto"/> </bean> i getting error org.springframework.beans.factory.beancreationexception: error creating bean name 'contactcontroller...

javascript - jQuery don't post form after preventdefault -

i have form loaded ajax, , inside form have render recaptcha control. when post form, first validate, , use webservice validate captcha. if data right want post form. but last behavior don't append... i read posts: can't submit after preventdefault how reenable event.preventdefault? re-enabling submit after prevent default jquery: call action's form after calling preventdefault() but none of solutions work... :( my code: $('#myform').submit(function (e) { e.preventdefault(); var captchainfo = { challengevalue: recaptcha.get_challenge(), responsevalue: recaptcha.get_response(), }; $.ajax({ type: 'post', url: '@url.action("validatecaptcha")', data: json.stringify(captchainfo), contenttype: 'application/json; charset=utf-8', datatype: 'json', success: function (msg) { if (msg) { $('#myform').submit(); } else { helpers.setcaptcha("captcha...

ruby - What is the difference between the traditional test = method(arg) and test = send(method, arg)? -

i in order model of rails application, wish invoke method instance of email class. this first method takes instance of email class (in example called email ). works fine. def recursive_search_mails(user, settings) emails = user.emails.where(:datetime.gte => self.datetime) emails.each |email| notification = email.test_if_notification(user, settings) if notification == true email.destroy return end correspondance = email.test_if_correspondance(user, settings) if correspondance == true email.destroy return end end end a more concise version of above code one: def recursive_search_mails(user, settings) emails = user.emails.where(:datetime.gte => self.datetime) emails.each |email| %w(notification, correspondance).each |type| is_type = email.send("test_if_#{type}", user, settings) if is_type == true email.destroy return end end end end however, raises error...

c# - Bind property to method -

i developing windows 8 app in c# , using databinding <collectionviewsource x:name="departments" source="{binding departments}" d:source="{binding allgroups, source={d:designinstance type=data:department, isdesigntimecreatable=true}}"/> i can bind properties of class ui, class has method need public string getprofessorslist() i able bind method this... <textblock text="{binding getheads()}" fontsize="18" /> ...but not allowed. how can acheve functionality? try adding getter-property returns method: public string professorslist { { return this.getprofessorslist(); } } and bind property: <textblock text="{binding professorslist}" fontsize="18" />