Posts

Showing posts from June, 2012

c# - Can't Get .NET XPathNavigator to work -

i having problems xpathnavigator. have document bunch of "topic" elements w/o namespace in stream. i using (expression dumbed down bare minimum, first thought expressions wrong): xpathdocument xmldoc = new xpathdocument( stream ); xpathnavigator xml = xmldoc.createnavigator(); xpathnodeiterator iter = xml.select( "//topic" ); this doesn't work. can select */*/* or similar , "topic" elements alright. tried running expressions in online tester , other languages , work. question: what's wrong? have lingering suspicion has accursed namespacemanager object, causes me incredible pain every time parse document namespaces, time elements seeking don't have explicit namespace! added: xmlnamespacemanager s = new xmlnamespacemanager( xml.nametable ); and pass 2nd argument select - no avail. how supposed add "" namespace thing/use correctly? or, better yet, there way use xpath in .net without using horrible abomination of class...

php - cron after every 15 sec -

i cannot set cron time less 1 minute on dedicated server. need run every 15 seconds because calls betfair api , calculations highly time dependent. please advise. cron lets run things fast once minute. what do 15 second timings inside script. execute parent script once minute. execute children scripts every 15 seconds within script before exists , new cycle begins.

iphone - MPMoviePlayerController play video second time -

i need have possibility play more 1 video in app. unfortunately, second time press play, video appears blinking. i use code playing vide nsurl *url = [[[nsurl alloc]initfileurlwithpath:[[nsbundle mainbundle]pathforresource:@"movie" oftype:@"m4v"]] autorelease]; mpmovieplayercontroller *mp = [[mpmovieplayercontroller alloc]initwithcontenturl:url]; mp.moviecontrolmode = mpmoviecontrolmodedefault; [mp play]; movieplayer = mp; [mp release]; can tell me can problem? in advance! update 1: seems apple movieplayer example has same problem. you can setting initial playback time -1.0 before calling play function mp.initialplaybacktime = -1.0; put code before ur play method called.

c# - MVVM and DataGrid View re-use as embedded controls within otherviews with subset data -

okay here's situation. net 4 wpf no silverlight. i have several views present datagrid showing contents of observable collections e.g. observablecollection<classaviewmodel> sourcea; observablecollection<classbviewmodel> sourceb; observablecollection<classcviewmodel> sourcec; the collections populated call data access layer. can display data enough usercontrol contains datagrid bound appropriate collection. have classaview , classaviewmodel control display of single classa data, classbview , classbviewmodel control display of single classb data classcview , classcviewmodel control display of single classc data i have: allclassaview , allclassaviewmodel display datagrid data relating classa instances. allclassbview , allclassbviewmodel display datagrid data relating classb instances. etc. now classa contains subset of classb collection , subset of classc collection etc. in resource file have bound viewmodels , views in...

java - How can we handle the ConnectException? -

i have searched lot ,but couldn't find fine answer it.i use try_catch block exception(if exception thrown 1 frame shown user tell him/her message) still show exception in console.please me.thanks. submit() method throw exception: private void submit() throws connectexception { string id = idfield.gettext(); char[] pass1 = passfield.getpassword(); string pass = new string(pass1); if (id.equals("") || pass.equals("")) { joptionpane.showmessagedialog(this, "you should enter id , password", "sign_in problem", joptionpane.ok_option); return; } else { boolean b = manager.test(id, pass); if (b == true) { this.setvisible(false); main.runaclient(); listframe frame = new listframe(client); frame.setvisible(true); } else { joptionpane.showmessagedialog(this, "you have entered wrong datas,try again", "s...

c# - How to call a webservice in the same website? -

i have call webservice published in same website caller aspx is. when try "add web reference" editor not show webservice methods generated namespace. do have use "add web reference" or there way because webservice in same website? visual studio 2005, c# thanks, eduardo i used way andy rose wrote in comments: instantiate webservice class , call methods directly because accessible inside project (no need add web reference).

javascript - Is there really no way to hook into the reset event of an Ext.js component? -

when reset form in ext.js resets every child component, events fired invalid , valid . seems bit "hacky" hook them handle clearing of value, there no other way? "problem domain" writing plugin create dependent comboboxes: ext.plugins.combobox.dependson = function(dependson) { function init() { var cb = this, parent = ext.getcmp(dependson); parent.on("disable", function() { cb.clearvalue(); cb.disable(); }); parent.on("select", function() { cb.disable(); // dependents disabled cb.clearvalue(); cb.getstore().load(); cb.enable(); }); } return { init: function(cb) { cb.afterrender = cb.afterrender.createsequence(init); } } }; this works until call form.reset() @ point comboboxes remain enabled empty. i'd able hook reset event , there disable , enable top component ca...

delphi - GetDir in Delphi2010 not working under Windows 7? -

i have following sequence of commands in delphi2010: var netdir:string; .... opendialog1.initialdir:=netdir; .... opendialog1.execute... .... getdir(0,netdir); .... after executing opendialog should have in string netdir directory finished opendialog.execute. , in next opendialog.execute should start directory. works fine on xp, not on windows 7? starts directory program installed. any idea might wrong? thanks. your question cannot answered stands, because lacks several crucial details. is netdir global constant, or go out of scope every , then? do set netdir prior opendialog1.execute ? is question directory getdir return (as title suggests), or how make open dialog remember last visited directory (as body matter suggests)? i assume 1) netdir global constant, 2) not set initially, , 3) want open dialog remember last visited folder. have like unit unit3; interface uses windows, messages, sysutils, variants, classes, graphics, cont...

windows - Equivalent of svn import via Team Foundation Server command line -

subversion's svn import command allows repeatedly importing external directory tree source control. it's important note original directory tree not modified , ie not become checkout/working directory. what equivalent in tfs 2010 (team foundation server), using command line? you can create batch file first creates temporary workspace, add files , perform checkin, , removes workspace again: tf workspace /new temp /collection:http://mytfsserver:8080/tfs/defaultcollection /noprompt tf add *.* /recursive /noprompt tf checkin /recursive /noprompt tf workspace /delete temp /collection:http://mytfsserver:8080/tfs/defaultcollection /noprompt

datasource - Try to make a Connection Pool with Tomcat 6 -

i having nightmare configuring tomcat set connection pool. have done lot of reading of various forums , documents tomcat having ask here last resort. first time have tried connections container it's new me. i have been having namenotfoundexception's seem fixed when put context.xml file myapp/meta-inf/context.xml tomcat 6.0/conf/context.xml, reason it's not seeing context.xml file in myapp's meta-inf directory. ideas? now getting sqlnestedexception: cannot create poolableconnectionfactory (''@'localhost' (using password:yes)) first of suprises me user blank because have specified 'root' in context.xml. not being able create poolableconnectionfactory, have seen couple of example context.xml files had factory attribute. need this? if class should specify there? my context.xml is: <?xml version='1.0' encoding='utf-8'?> <context> <!-- configure jdbc datasource user database --> <resource name="j...

jquery - Loop through an Array of links and dynamically load the contents of each after a set interval -

using jquery loop through array of links , load contents of each link div after set interval. example, if have parent page "parent.html" , array of links - "test1.html, test2.html , test3.html" load test1.html div within parent.html , after set interval replace test1.html test2.html , test3.html repeating process indefinitely. i appreciate if me out. have tried using .get() , settimeout() don't have expertise , experience put together. welcome. thank you. this want. you can view working demo here. loads each link once, caches result. subsequent iterations pull cache. $(function(){ var curidx = 0, urls = $.map($("#links a"),function(el){ return $(el).attr('href') }), cache = {}; function nextpage(){ var url = urls[curidx], data = cache[url]; curidx += 1; if(curidx == urls.length) curidx = 0; if(!data){ $("#content").load(url, function(data){ ...

javascript - Force display text from Unicode in input field -

Image
this question has answer here: how decode html entities using jquery? 17 answers we doing ajax call retrieve database. since our clients may use different languages encode unicode store in database (saves worrying collations , such). when fetch such content displayed in input text field displaying unicode codes. checked html 4 documentation input , value cdata tells me unicode should displayed character. screen shot attached can see not case, i'm wondering if there way "force" behavior. since our clients may use different languages encode ascii store in database (saves worrying collations , such). imho storing html entities database bad approach. recommend using utf-8 encoding everywhere. save worrying collations , such.

Unix socket connection to MySql with Java to avoid JDBC's TCP/IP overhead? -

is possible make unix socket connection mysql java avoid jdbc's tcp/ip overhead? does know library (or few libraries, perhaps) makes possible? also mysql jdbc driver has been polished on long period , has several optimization tweaks , caching of metadata. surprised jdbc developers have left lot of tcp/ip overhead in driver. going on jni c based implementation cost more in jumping native code can gained reduced tcp/ip overhead. if want cut out tcp/ip overhead might consider using embedded database sqlite, derby or hypersonic.

regex - PHP: Return string between two characters -

i wanting use "keywords" within large string. these keywords start , end using my_keyword , user defined. how, within large string, can search , find between 2 * characters , return each instance? the reason might change it, parts of keywords can user defined, such page_date_y might show year in page created. so, again, need search , return between * characters. possible, or there better way of doing if don't know "keyword" length or might be? <?php // keywords between * $str = "php *best*, *most popular* , *i* love it."; if(preg_match_all('/\*(.*?)\*/',$str,$match)) { var_dump($match[1]); } ?> output: array(3) { [0]=> string(4) "best" [1]=> string(12) "most popular" [2]=> string(1) "i" }

merge - How is the Change.MergeSources Field Populated in TFS? -

we'd generate build notes following format: 1) associated changesets: 2) - changeset 45241, joe: "patching fix foobar" 3) 'foo.cs' integrated dev v. 22 qa v. 7 4) 'bar.cs' integrated dev v. 9 qa v. 3 so far, have custom build step accomplishes 1) , 2). looks @ information produced 'associatedchangesetsandworkitems' tfs build activity. here code: protected override bool execute(codeactivitycontext context) { streamwriter sw = new streamwriter(path.combine(buildnotespath.get(context),"build-notes.txt")); sw.writeline("associated changsets:"); foreach (changeset changeset in buildassociatedchangesets.get(context)) { sw.writeline(string.format("changeset {0}, {1}: {2}", changeset.changesetid, changeset.committer, changeset.comment)); foreach (change change in changeset.changes) { foreach (mergesource source in change.merg...

ajax - Jsp, Jquery and Json encoded characters issue -

working json quite new me, yet it. i'm facing annoying issue. here's how things work: jquery makes ajax request specific url, url struts action, and, on success, returns specific jsp jsp includes json taglib ( http://www.atg.com/taglibs/json ) in order render proper json formatting. shaping communications beetween client , server gives me : alt text http://www.freeimagehosting.net/uploads/e4a91d6251.jpg as can see, http headers seem fine, yet, json contains hex. characters, such &#039; the problem is, i'm using part of json answer output html using jquery; i'm facing problem creating tooltips on fly, each , every time ajax request made. maybe javascript code isn't made deal json input , heres bit of code handle json answer : var tooltip = $("<span/>").addclass("tooltip").text(article.description).hide().appendto(rowdescriptionarticle); as can see, quite retrieve description each article node, , insert using text() span. ...

asp.net - [Need help]: Issue with submit button and html file input control’s Click() method -

scenario: on click of button, dynamically create html file input (file upload) control on page , call file input controls click() method. user selects file disk. there “submit” button upload selected file. problem: problem is, when clicked on “submit” button first time, input value file input control cleared. , request not go server . when clicked second time, request goes server empty file input value. why first click on submit button not send request server. , why clears file input control value? note: issue observed when call click() method programmatically. if let user click browse, in case, "submit" not clear input value , sends request server on first click itself. any appreciated. in advance. by way, server side code in asp.net , client side in java script, testing on ie. -somesh can inject javascript code-behind call client-side click() event on file upload control? simulate user clicking submit button, know works.

3D Animation Rotating and Translating simultaneously in WPF -

i have modelvisual3d of cube. want translate , rotate @ same time. wish center of rotation in middle of cube(the cube rotates around own axis). when try applying both transformations effect not expect. since object translating center of rotation different making move , rotate in strange way. how desired effect? transform3dgroup transgroup = new transform3dgroup(); doubleanimation cardanimation = new doubleanimation(); cardanimation.from = 0; cardanimation.to = 3; cardanimation.duration = new duration(timespan.fromseconds(2)); transform3d transform = new translatetransform3d(0,0,0); transgroup.children.add(transform); rotatetransform3d rotatetransform = new rotatetransform3d(); axisanglerotation3d rotateaxis = new axisanglerotation3d(new vector3d(0, 1, 0), 180); rotation3danimation rotateanimation = new rotation3danimation(rotateaxis, timespan.fromseconds(2)); rotateanimation.decelerationratio = 0.8; transgroup.children.add(rotatetransform); model.transform = transgro...

Android: How to reference a library project from an Eclipse ADT application project? -

i have project compiles throws noclassdeffounderror on classname included sibling library project, when built eclipse. when build project ant file, runs fine. how tell eclipse build system application's .apk needs copy of .class files library project. this page... http://developer.android.com/guide/developing/eclipse-adt.html#libraryreference makes sound adding library should "just work" no other steps. , see has updated default.properties necessary link makes ant build work. despite following steps (my library project listed in android page of application's project properties), eclipse doesn't recognize new classes in editor. did standard eclipse step of adding library java build path. compiler , ide recognize class, app still crashes noclassdeffounderror, after checking library in java build path, order , export. what step missing? some background... built eclipse project first. then, in separate directory, used android create project .....

python - Why does assigning to True/False not work as I expect? -

as part of answering question, wrote following code behaviour seems bizarre @ first glance: print true # outputs true true = false; print true # outputs false true = true; print true # outputs false true = not true; print true # outputs true can explain strange behaviour? think has python's object model i'm not sure. it's version 2.5.2 under cygwin. python has these 2 (among others) builtin objects. objects; in beginning, don't have names yet, know refer to, let's call them 0x600d , 0xbad . before starting execute python (2.x) script, name true gets bound object 0x600d , , name false gets bound object 0xbad , when program refers true , looks @ 0x600d . because 0x600d , 0xbad know used names true , false , that's output when printed, i.e. __str__ method of 0x600d returns 'true' , on. true = false now binds name true different object. on, both names true , false refer same object 0xbad ...

c# - Replacing td tags with td and attributes -

my problem particular case occurring in project. in html document, want replace <td> <td class=”right”> tds except first 1 in <tr> tag. (if there <tr> inside <tr> tag needs handled). if input like: <tr> <td>1</td> <td>2</td> <td>3</td> <tr> output should like: <tr> <td>1</td> <td class=”right”>2</td> <td class=”right”>3</td> <tr> i have tried..this code.. public static string tableformat(string html) // add attribute td { int start = 0, end = 0, trstart = 0, trend = 0; // html = cleanupxhtml(html); // clean unnecessary p tags while (html.contains("<tr>")) { //start=end; trstart = html.indexof("<tr>", end); if (trstart == -1) break; trend = html.indexof(...

java - Swing on OSX: How to Trap command-Q? -

after being convinced ("schooled") swing apps on mac native , i'm trying make mine native possible. looks great, when hit command + q or menu, windowstatechanged(windowevent e) not firing on main jframe (if exit in other way, fire). how can respond real apple quit? the top voted answer excellent fill in "best way": system.setproperty("apple.eawt.quitstrategy", "close_all_windows"); this trigger standard window closing callback event should work nicely portable code. as result of discussion below seems crucial in app. wrote in static initializer of main class before ui code executed.

sql - Oracle - Having foreign keys in more than one table -

i'm not sure if 1 can need have foreign key reference 2 tables. table1 has 2 columns (a pk, b) table2 has 2 columns (c pk, d) table3 has 3 columns (a pk, b pk, e) , made of first 2 table. what hoping following: create table table3 ( varchar2 (4), c varchar2 (10), e char (1), constraint pk_a_c primary key (a, c), constraint fk_a_c foreign key (a, c) references (table1.a, table2.b) ); i hope makes sort of sense. thanks james a given foreign key constraint describes relationship 1 child table 1 parent table. you can, however, have 2 foreign key constraints, each pointing respective table: create table table3 ( varchar2 (4), c varchar2 (10), e char (1), constraint pk_a_c primary key (a, c), constraint fk_a foreign key (a) references table1(a), constraint fk_b foreign key (c) references table2(b) );

Connecting to SQL Server 2000 through TCP/IP on localhost failed -

Image
i have tried connect sql server 2000 through tcp/ip. i followed these steps , enabled sql server 2000 on port 1433. then used command test whether port opened up: telnet localhost 1433 but found following error: connecting localhost...could not open connection host, on port 1433: connect failed and failed connect server following these steps . how solve problem , connect sql server 2000 through tcp/ip? see configs by default tcp-ip disabled. need run sql server configuration manager->sql server network configuration , enable protocol, restart sql server service

jquery - python list to newline separated value -

im trying data in pylon use in jquery autocomplete, librarary i'm using autocomplete requires format abc pqr xyz and in python have data in format [["abc"], ["pqr"],["xyz"] how convert list above one. edit: trying use these autocompete , i'm using pylons, in query server return list in format [["abc"], ["pqr"],["xyz"] http://jquery.bassistance.de/autocomplete/demo/ library except remote call in abc pqr xyz i tried use "\n".join(item[0] item in my_list) but returns data in firebug this. 'asd\ndad\nweq' i want in abc pqr xyz any appreciated i'm php developer first time i'm trying code in python. thnaks "\n".join(item[0] item in my_list) however, what's got json...?

jdbc - Connecting to Informix 3.30 with SimbaServer middleware -

i have client i'm trying data migration out of old route-accounting system for. system has informix 3.30 database simbaserver middleware sitting on top of it. gather, odbc , jdbc support not added informix until version 5.x, that's out. also, have been unable find simbaclient odbc or jdbc driver connect simbaserver middleware. i'm trying connected database jasperetl jaspersoft. have thoughts on how might able accomplish this? are serious meaning informix 3.30? in, 3.30.14? in, product last released in 1986? creeps out of woodwork every often, hasn't done quite few years now. pre-sql product, database dictionary (catalog) in file 'database.dbd' , data in files such 'table.dat' , indexes in files such 'table.idx'? if so, there extremely unlikely odbc or jdbc drivers connect it. however, should contact me directly - see profile page - , can discuss options have. suffice still have access source code, , know how data out o...

php - HTML5 tag to display syntax highlighting -

i wondering if there tag auto-highlights syntax of html , or php in html5. i'm writing guide has code in it. since i'm using lot of new html5 tags (i use section outline of guide) use in native html5. if not exist, best way this? (like, php , css?) there's nothing in html5 afraid, can use highlight_string() php. if want purely on client side, try js highlighter prettify, stackoverflow uses code highlighting: http://code.google.com/p/google-code-prettify/ here other ones: syntaxhighlighter shjs (uses gnu source-highlight definitions)

wpf - How can I sort a bound ListBox with custom sort logic? -

i'd sort view instead of in viewmodel. every example i've seen uses sortdescription, it's not customizable. the viewmodel can responsible data consumed view , presentation, model should not concerned display of data. you bind view observablecollection on viewmodel, have. not saying how allow user sort, arguments sake assuming series of buttons, each button bound icommand on viewmodel, modify observablecollection change order. this refresh view new order in observablecollection. you still maintaining layers, , avoiding code behind , allowing sorting logic tested.

64bit - Can I install both x86/x64 windbg on my x64 WIN7? -

i need analysis x86 dump file, want install x86 windbg on computer. or if can use x64 windbg analysis x86 dump file? yes, , idea since you'll need 32 bit version debug 32 bit applications/dumps. files located in install directory, can have number of installations side side. also, keep in mind if use 64 bit tool create dump, you'll 64 bit dump - if process 32 bit. in case you'll dump of wow64 process, makes debugging dump bit more difficult. however, if use 32 bit tool create dump file, you'll regular 32 bit dump , can use 32 bit debugger would.

android - wired headphones plugged in and out -

i need event executing when user plugs in/out wired headphones, made in htc sense player. android.media.audiomanager doesn't generate event, doesn't return correct value iswiredheadseton() how can know if wired headset plugged or not? try action_headset_plug .

sql server - How to show the tablenames with foreign key = myId -

i trying figure out primary keys of table translation per language resides foreign key. this have ... select * ( select tm.seqtrans, t.trans, case t.seqlang when 1 'nl' when 2 'fr' when 3 'en' when 4 'de' when 12 'sk' end lang acc.translation_map tm inner join acc.translation t on tm.seqtrans = t.seqtrans tm.seqcust = @seqcust ) p pivot ( max(trans) lang in ([nl],[fr],[en],[de], [sk]) ) pvt now need somehow use system table check seqtrans , show tablenames. is possible? the system stored procedure sp_fkeys need, , can call this: execute sp_fkeys @pktable_name = 'translation' books online has more info other paramet...

php - How select button in JQuery -

<?php foreach ($list $item): ?> <tr> <td> <div id="<?php echo $item['id']; ?>"> <input type="text" name="name" id="name"/> <button type="submit" id="ajax_submit" value="<?php echo $item['id']; ?>">run</button> </div> </td> </tr> <?php endforeach; ?> in php-code generate html table. when user click on button activate jquery script <script> $(document).ready(function(){ $('button').click(function(){ var id = "#" + $("button").val(); $.post("data/js", { name: $("#name").val(),id : id }, function(data){ $(id).html(data); }); }) }); </script> but, when want select non-first button in table, script run function first. please normal. ps sorry english ;-( t...

performance - How to do OpenGL live text-rendering for a GUI? -

i'm implementing gui built on top of opengl. came problem each gui have -- text rendering. know of several methods of rendering text in opengl, however, i'm wonderin of them best suited gui. generally in gui have 2 types of text -- static , live. static easy enough -- can render ttf texture , forget it. it's "live" text more bothering me -- imagine console, or live chat in multi-player game. i thought of several options: no special cases -- render , load texture each time text changes, keeping in mind rerender when new text appears, , trying split larger text small parts (like per chat line). still leave hanging in cases score line changes time, or intro text renders "per character" (typewriter style seen in sci-fi games) quad-per character -- seems popular solution, prepare texture ascii table , render textured quad character. however, have serious doubts efficiency of such solution. tips how make faster welcome. hybrid solutions -- have no...

wcf - HttpContext.Current.User is always null -

i have wcf service has method return windows username of silverlight client consuming service . wcf service using basichttpbinding transportcredentialonly mode set , transportclientcredentialtype set windows. in iis windows authentication enabled , anon authentication disabled. despite (apparently) configuring service correctly when call service , ask return username errors. closer examination shows httpcontext.current.user null (so nullreferenceexception thrown). does have other ideas why not working? try adding - <servicehostingenvironment aspnetcompatibilityenabled="true" /> to config file

apache - Maintain HTTP Referer -

i've setup redirects on apache server. @ bit this: redirect /name/register /login.html my question this... there anyway preserve http referrer through redirect? seem default, apache discards information. if after redirect complete referrer say: http://the.orginalurl.com/name/register anyone if possible? if not, thoughts on alternative. many thanks, neil redirect won't preserve referrer because browser sent 301 , new address open. manual : the redirect directive maps old url new 1 asking client refetch resource @ new location. mod_rewrite , (i think) alias can rewrite directly (i.e. without causing browser redirect) , preserve referrer. mod_rewrite, can add referer parameter request, if want to.

WCF with Http Basic Authentication -

i'm building webservice needs accessible variety of potential platforms, including number of older asp , asp .net applications. after research, settled on wcf service both rest (webhttpbinding) , soap (wshttpbinding) endpoint (that way, can support wide range of platforms , still make .net coders happy). for security, i'm using ssl , http authentication basic against own database of username/passwords. i've written httpmodule handle usernames , passwords , check ssl. now, rest setup working perfectly, i'm having problems soap endpoint. no matter settings use, soap client never sends me www-authorization header can use authenticate. i'm assuming setting <message clientcredentialtype="username" /> should tell wcf expect authorization header, , information picked visual studio (or whatever client) when creates web reference. perhaps i'm being hopelessly naive. so summarize question: there way can tell wcf send me www-authorization header (i...

Font is not available to the JVM with Jasper Reports -

i'm trying generate report dynamicjasper, i'm getting following error: net.sf.jasperreports.engine.util.jrfontnotfoundexception: font 'arial' not available jvm. msttcorefonts installed, guess jvm not using fonts it. i'm using ubuntu 10.04. how can fix this? i tried installing mscorefonts, package installed , up-to-date. sudo apt-get update sudo apt-get install ttf-mscorefonts-installer i tried searching font in filesystem, with: ls /usr/share/fonts/truetype/msttcorefonts/ this folder had readme, correct instructions on how install. cat /usr/share/fonts/truetype/msttcorefonts/readme you need internet connection this: sudo apt-get install --reinstall ttf-mscorefonts-installer i re-installed ttf-mscorefonts-installer (as shown above, making sure accept eula!) , problem solved.

mysql - How can i convert a price field which is currently varchar to a decimal so my prices will order correctly? -

i using mysql. i have varchar field incorrectly used price. ordering of table not work correctly putting on 1000 bottom of list. i need convert price field in existing populated database varchar decimal guess? any appreciated. simply use alter table statement. if example table called 'products' , field called 'product_price' use: alter table products modify column product_price double; nb: anything, i'd tempted make backup of data (via mysqldump) prior performing operation - it'll take seconds , it's better safe rather sorry. :-)

stdout - Display output of a Bash command and keeping the output in a variable -

i'm not sure if possible want run bash command , storing output in variable , display if launched command normally. here code: var=`svn checkout $url` so want store output in var , still see result (and because svn checkout takes long time, can't echo $var after..) thanks if command run terminal, can do: var=$(svn checkout $url | tee /dev/tty)

c# - generating a batch of random passwords -

generating random password easy. generating batch more difficult. public static string getrandompassword(int letters, int getallen) { //int letters = 8; //int getallen = 5; char[] letterdeel = new char[letters]; int mingetal = (int)math.pow(10, getallen - 1); int maxgetal = (int)math.pow(10, getallen); string password; random r = new random(); int test = (int)(datetime.now.ticks); (int = 0; < letters; i++) { r = new random((int)(datetime.now.ticks) + i); bool capital = r.next(2) == 0 ? true : false; if (capital) { letterdeel[i] = (char)r.next(65, 91); } else { letterdeel[i] = (char)r.next(97, 123); } } password = new string(letterdeel); password += r.next(mingetal, maxgetal); return password; } this method, passwords should in letter-number format. works fine, if have fo...

Mercurial authentication caching? -

my mercurial server requires https authentication pulls. how can cache authentication information on client without exposing plain-text password on disk? i'm looking using sudo mercurial , ssh authentication https. have explored mercurial keyring ? it supports https , comes bundled latest version of tortoisehg . if don't have tortoisehg, can install other extension (although recommend tortoisehg if you're windows user).

Reading HTTP headers from JAX-WS Web Service -

i have jax-ws web service receives credentials in http header. these used basic authentication. there filter performs authentication reading http headers , checking against database. still, need username within web service in order perform other service logic related stuff. there way of accessing http headers within web service? thanks. the webservicecontext object work me. ca injected in web services resource: @resource private webservicecontext context;

flex3 - flex HTTP Basic authentication problem -

i'm trying xml file requires http basic authentication : private function authandsend(service:httpservice):void { var enc:base64encoder = new base64encoder(); enc.insertnewlines=false; enc.encode("login:pass"); service.headers["authorization"] = "basic " + enc.tostring(); service.headers["accept"] = "application/xml"; service.contenttype="application/x-www-form-urlencoded"; service.method = httprequestmessage.get_method; service.resultformat = "xml"; service.send(); } in air works well. in flex(3.5,4.1) raises pupup login window(standard web browser login form on basic http authentication). how avoid this? http headers, including authorization, blocked default being sent flash player. need allow authorization...

tfs2010 - Steps for changing process template for an existing project in TFS 2010 -

Image
i have tfs server installation through time has gone through upgrades tfs 2005 tfs 2008 , tfs 2010. during lifetime of installation lot of projects have been created , different project templates have been used. msf agile 4.0, 4.1, 4.2 , 5.0. , few msf cmmi ones. what "replace" project template used these projects use new 1 common one: microsoft visual studio scrum 1.0. i aware tfs project templates used templates creating new projects , cannot modify tfs projects definitions after creation. uptil version control , build server part of tfs have been used , there no existing work item types. additionally projects , build scripts depending on source code paths stay same. as see have following options: create new tfs projects using correct project template , move/branch source code new project. all code moved temporary team project. the old project deleted new project original name , correct process template created code moved new team project tempo...

javascript - Preventing jQuery click() conflicts -

i have table of locations. each location has individual url associated it. using 1 column activate / deactivate url can turn locations off , on. i'm using jquery's bind / click ajax request. i want make clicking anywhere on table row take user individual url. var url="http://mysite.com/"+jquery(event.target).siblings("td.url").text(); jquery(location).attr('href', url); the problem it's intercepting other columns click. there way like: if(event.target != jquery("td.active")){ //redirect } if(!jquery(event.target).is('.active')) { is want.

asp.net - Using ezStore123 CMS System and want to change layout? -

hello im using known cms system or maybe old cms system. simple asp.net application hand coded problem minor. cms displays catalog type website products database. display looks using html file house catalog want change html file layout. ive been trying find systemdefs , libarary no luck have idea these settings may stored? take @ page elements. more specifically, @ stylesheet references. if can locate stylesheets, step in right direction. an easy way @ html code, installing firebug (a firefox plugin). can analyze elements on page clicking on them. aside that, issue not entirely clear. sure html file exists, , not generated asp.net?

XSLT - Problem with foreach and incremented attribute name -

i'm using xslt , transform this: <attr> <header name="updateinformation1"> <detail name="info">blah</detail> </header> <header name="updateinformation2"> <detail name="info">blah2</detail> </header> ...other headers different names... </attr> to this: <updateinformation> <info>blah</info> </updateinformation> <updateinformation> <info>blah2</info> </updateinformation> ... i've been trying using foreach, i'm not having success. heres have, wildcards don't work in type of context: * wrong * <xsl:for-each select="attr/header[@name='updateinformation*']"> <updateinformation> <info> <xsl:value-of select="detail[@name='info']"/> </info> </updateinformation> </xsl:for-each...

c++ - behaviour of pthreads and pthread_join function -

i new multi-threaded programming , have question pthreads. this test code run , don't understand behaviour. can throw light on please. void *t1(void *args){ printf("returning t1\n"); return; } void *t2(void *args){ printf("returning t2\n"); return; } int main(){ pthread_t thread1,thread2; int r1,r2; r1=pthread_create(&thread1,null,t1,null); r2=pthread_create(&thread2,null,t2,null); pthread_join(thread1,null); // pthread_join(thread2,null); return 0; } the behaviour of program either of 5 shown below murtuza@murtuza:fftw$ ./ptest returning t2 returning t1 murtuza@murtuza:fftw$ ./ptest returning t1 returning t2 murtuza@murtuza:fftw$ ./ptest returning t1 murtuza@murtuza:fftw$ ./ptest returning t2 returning t2 murtuza@murtuza:fftw$ ./ptest returning t1 returning t2 returning t2 i don't understand 4th , 5th output. why thread ...

.net - Visual Studio 2010 Code Analysis - Run on Solution -

i manually run code analysis entire solution, not on building project, , not using fxcop, if possible. did enable ca on build really, slowed down build process, , can't have that. seems weird me code analysis can run per project manually through menus, not entire project. am missing something? thanks. i don't know of menu/command can used run ca projects, can create new solution configuration (e.g. codeanalysis based on debug) , set ca each project run configuration, letting run ca projects without slowing down regular debug build. create new configuration called "code analysis" (build -> configuration manager, <new...> under active solution configuration). in ca properties tab each project, set ca run "code analysis" configuration, , not run debug configuration (and other configurations don't want ca run on). you can same on code contracts tab if don't want contract checking on regular build configurations. now w...

javascript - How to disable tabs in JqGrid at runtime? -

two default grids defenition: initialise(){ $("#expensetable").jqgrid({ datatype : "local", mtype : 'get', colmodel : [ {name:'expnsid',label:'id', width:150 }, {name:'username',label:'name', width:150 }, {name:'catname',label:'category', width:150 }, {name:'date',label:'date', width:150 }, {name:'amount',label:'amount', width:150 }, {name:'status',label:'status', width:150 }], pager : '#exppager', rownum : 10, rowlist : [ 10, 20, 30 ], sortname : 'invid', sortorder : 'desc', viewrecords : true, autowidth : false, caption : 'expenses details', onselectrow : function(expnsid) { dispexpensdata(expnsid); } }); $("#tabs").tabs(); gettokens();//gets tokens logged in user. refreshexpens...

Javascript natural sort array/object and maintain index association -

i have array of items follows in javascript: var users = array(); users[562] = 'testuser3'; users[16] = 'testuser6'; users[834] = 'testuser1'; users[823] = 'testuser4'; users[23] = 'testuser2'; users[917] = 'testuser5'; i need sort array following output: users[834] = 'testuser1'; users[23] = 'testuser2'; users[562] = 'testuser3'; users[823] = 'testuser4'; users[917] = 'testuser5'; users[16] = 'testuser6'; notice how sorted value of array , value-to-index association maintained after array sorted (that critical). have looked solution this, tried making it, have hit wall. by way, aware technically not array since mean indices iterating 0 through n n+1 counting number proceeding n. define it, requirement project still same. also, if makes difference, not using jquery. the order of elements of array defined index. if specify values in different order, values stored in or...

How do I enable the PHP HTTP PECL extension on Windows? -

i have installation of xampp version 1.7.3 on windows 7 x64. want enable php http extension . how go doing so? is, dll, register it, etc. in advance. first, download pecl module php website. then unzipp , copy file php_http.dll in php extension folder. edit php.ini file (c:\windows\php.ini) , activate module : extension=php_http.dll

asp.net - Can content page use ContentPlaceHolderID of master parent of its master page (nested master pages) -

i have 3 level nested master pages , content page. parent1 top parent, parent2 parent of parent3 , parent3 parent of content page. i error ' cannot find contentplaceholder xxx... ' xxx contentplaceholder. resides in parent2 , content page trying fill it. can content pages use direct parent contentplaceholders or can use of higher master pages? there 1 way there slight problem under circumstances if relying on default content placeholder. in example, have parent1.master : <div id="content"> <h1>lorem ipsum, parent1</h1> <asp:contentplaceholder id="cphcontent" runat="server"> <p>i default content parent1...</p> </asp:contentplaceholder> </div> and have nested parent2.master , consumes placeholder parent1: <asp:content contentplaceholderid="cphcontent" runat="server"> <h2>i specific stuff parent2...</h2> <asp:co...

ruby - Using a rake task that accepts parameters as a prerequisite -

according http://rake.rubyforge.org/files/doc/rakefile_rdoc.html , can create task accepts parameters , has prerequisites: task :name, [:first_name, :last_name] => [:pre_name] |t, args| but if :pre_name task accepts parameters? syntax passing parameters :pre_name when used prerequisite? it's pretty simple - :pre task receive same parameters original task. need make sure signature similar - instance if first task receives :a,:b :pre task needs receive them well. see more here: rake params

is there standard sql that works in all database -

as seen below syntax different different database .isnt there standard way works in databases. there tool convert sql sql sqlserver2005: create table table01 ( field01 int primary key identity(1,1) ) sqlite: create table table01 ( field01 integer primary key autoincrement not null unique ); the "query" part of sql (commonly called dml - data manipulation language) reasonably standardized, , queries written on 1 database run on database if no "vendor enhancement" features used. "create database bits" parts of sql (often known ddl - data definition language) not standardized, , every database out there little differently. so, you've discovered, statements such create table written 1 database not work without tweaking on database. <soapbox> in opinion thing. ddl defines can created in database. if vendors use exactly same ddl, products going exactly same in terms of features support. example, in order allow...

css - PHP text-size selector within a Drupal site only working when logged in -

i have php text-size select function within drupal site: it uses selector...: <ul id="font-sizes"> <li class="one"><a href="<?php global $base_url; print $base_url;?>/sites/all/themes/x/resize.php?set=small">normal font-size</a></li> <li class="two"><a href="<?php global $base_url; print $base_url;?>/sites/all/themes/x/resize.php?set=medium">medium font-size</a></li> <li class="three"><a href="<?php global $base_url; print $base_url;?>/sites/all/themes/x/resize.php?set=large">large font-size</a></li> </ul> ...which modifies stylesheet link...: <link rel="stylesheet" type="text/css" media="screen" href="<?php global $base_url; print $base_url;?>/sites/all/themes/x/<?php echo isset($_cookie['sitestyle'])?$_cookie['sitestyle...

java - Network discovery programmatically -

is there specific protocol used network discovery? i'm looking code existing java project. i'm using port scanner handle case, i'm looking swap out can give me little more info. if possible i'd scan discover machine , pull ip addr, host name, mac addr, nic make/model, os, , else can get. there no 1 protocol you. i've had , basically, best approach involves using combination of heuristics locate, analyze , cross-reference network nodes , topology. here data sources used: traceroute allows identify edge devices , routers in network port-scanner allows identify services running on each node snmp allows detect type of device, network interfaces, other ip addresses, ip of devices connected each port on switches, routing table, process table, network configuration, etc... best source of data, requires node running snmp server (installed default on windows , linux distros) , have credentials. wmi windows hosts, provide same info snmp here '...

tcp - Sending data over tcpip using Microchip's PIC18F -

all of examples in tcpip demo app built using custom program designs webpage triggers callbacks when webpage changed. possible value sensor every x seconds , send data out on http post? i right now. reading value sensor every x seconds should pretty self-explanatory, encoding message "post" little trickier. i did following generic packet: tcpputromstring(mysocket, (rom byte*)"post "); tcpputromstring(mysocket, remoteurl); tcpputromstring(mysocket, (rom byte*)" http/1.1\r\nhost: "); tcpputromstring(mysocket, servername); tcpputromstring(mysocket, (rom byte*)"\r\ncontent-length: [put number of following characters here]\r\n\r\n"); tcpputromstring(mysocket, (rom byte*)"variable1=whatever"); tcpputromstring(mysocket, (rom byte*)"&variable2=whatever"); tcpputromstring(mysocket, (rom byte*)"&variable3=what...

ruby - Why does uniq! return nil if there are no duplicates -

i'm starting ruby , find following violation of "principle of least surprise". , is, quoting the documentation , uniq! "removes duplicate elements self. returns nil if no changes made (that is, no duplicates found)." can explain this, seems counter-intuitive me? means rather being able write 1 line of code below appending .uniq! end first line, instead have write following 2 lines: hooks = io.read(wt_hooks_impl_file).scan(/wt_rt_00\w{2}/) hooks = hooks.uniq or missing something, better way? edit: i understand uniq! modifies operand. here's problem illustrated better hope: hooks = io.read(wt_hooks_impl_file).scan(/wt_rt_00\w{2}/) puts hooks.length #50 puts hooks.uniq!.length #undefined method `length' nil:nilclass i contend way uniq! works makes senseless , useless. sure in case pointed out append .uniq first line. later in same program pushing elements onto array inside of loop. then, under loop, i'd "de-dupe...