Posts

mysql - SQL mass insert based off of data pulled from another table -

i don't know if worded correctly, i'll try explain want. table 1 - x id | name | blah table 2 - y id | xid | configkey | configval what want is, create row in table 2 in table 1, corresponding id table 1 goes column xid in table 2. i'm java background , not keen on sql, not sure how this. there lot of rows in table 1, why script out. i pretty want this: table1 (the object table) 1 test1 2 test3 b 3 testn n run query populate this table 2 (the config table) ...exisitng rows 59 1 dosomething true 60 2 dosomething true 61 3 dosomething true so, pretty want add in config row (all same values) except id corresponds (column 2 in table 2 should col 1 table 1) thanks to use fixed values 'dosomething' , 'true' inserted records: insert table2 (xid, configkey, configval) select id, 'dosomething', 'true' table1

internet explorer - Selenium / WatiN - Automating Embedded IE inside Desktop Application -

i trying automate functional test of web application launches in embedded ie. using white automation framework reach point till application opens web app in embedded ie. looking way hook embedded ie , can drive workflow. how do that? know not possible thru selenium /watin out of box , let me know other ways it. thanks j try autoit. has pretty functional tool called "window info".

Facebook SDK and Android - Feed post succeeds with error -

i'm doing feed post through facebook sdk on android. it working fine before, since changed fb app id, post works sdk throws null facebookerror exception. tracing little more, can see fb request returns false, though correctly completes post! if use former app_id, works without hitch. if use new app_id, error, means has nothing code, app setting. however, don't know setting is. just in case, here code. pretty straight out of example: private class sampledialoglistener extends fbbasedialoglistener { public void oncomplete(bundle values) { final string postid = values.getstring("post_id"); if (postid != null) { //post id valid here _app.fb.getasynchrunner().request(postid, new wallpostrequestlistener()); } else { showchallenge.this.runonuithread(new runnable() { public void run() { string errormsg = getresources().getstring(r.string.errorunabletopostfeed...

What version of Javascript is supported in node.js -

i'm getting started node.js , i'm having hard time figuring out version of javascript supported node makes difficult figuring out features can use. here's know. node uses v8 v8 implements ecmascript specified in ecma-262, 3rd edition ecma-262, 3rd edition javascript 1.5 given this, assume can use javascript 1.5 compatible code in node. however, turns out can use array.foreach , among other constructs, though according mdc isn't available until javascript 1.6 -- ecma-262, 5th edition. where going wrong? there document somewhere details available language features? this matrix (v8 follows webkit column closely) seems pretty answer question "what features can use?" can't find canonical answer "what version of javascript supported?" far can tell, best answer this: ecma-262 3rd edition supported, many features of 5th edition supported. there's explanation of why v8 follows webkit , javascriptcore functionality on this ...

Transforming an image to gray-scale in Java -

i want display gray scale image (16 bits per pixel). far, have this: datainputstream afile = new datainputstream(new fileinputstream("filename.raw")); bufferedimage abufferedimage = new bufferedimage(2000, 2000, bufferedimage.type_ushort_gray); writableraster araster = abufferedimage.getraster(); byte[] arow = new byte[2000*2]; afile.readfully(arow, 0, 2000*2); now, question how set 16-bit intensity values arow abufferedimage ? based on http://java.itags.org/java-tech/17212/ , convert byte array int or double array (to have 1 array cell per pixel), , use writableraster.setsamples() or writableraster.setpixels() . avoid doing byte-to-ushort conversion yourself, can use datainputstream.readunsignedshort() .

javascript - How to get selected text/caret position of an input that doesn't have focus? -

is possible (reliably) selected text/caret position in input text box if field doesn't have focus? if not, what's best way , retain data? basically, when user clicks button want insert text @ caret position. however, user clicks button, field loses focus , lose caret position. the following script hold caret position , button click insert text @ stored position: javascript: <script type="text/javascript"> //gets position of cursor function getcaret(el) { if (el.selectionstart) { return el.selectionstart; } else if (document.selection) { el.focus(); var r = document.selection.createrange(); if (r == null) { return 0; } var re = el.createtextrange(), rc = re.duplicate(); re.movetobookmark(r.getbookmark()); rc.setendpoint('endtostart', re); return rc.text.length; } return 0; } function inserttext() { var textarea = document.getelementbyid('txtarea...

visual studio 2010 - How can I prevent a .vdproj compile from updating the PackageCode on every compile? -

i have visual studio 2010 solution web application contains of projects make web application, plus .vdproj file builds installer. of files under configuration management. whenever compile solution no changes in source code, visual studio check out .vdproj file , make changes. @ minimum, packagecode changed a different guid. @ other times change order of hierarchy within "deployproject" section of .vdproj file in addition updating packagecode. this not happen of our other .vdproj files. 1 thing makes .vdproj unique in addition containing primary output other projects in solution, contains on 50 additional .iso, .kml, .jpg files not originate visual studio project. these causing packagecode change in way? the package code should changed each time "release" msi, see http://msdn.microsoft.com/en-us/library/aa370568 . since vs doesn't know whether distribute msi or not, plays safe , modifies package code. visual studio should able handle in combina...