Posts

Showing posts from February, 2010

applet - Creating a connection pool in a java command line application -

is possible create command line application (without application server) uses connection pool in order access database?. , how it? i've tried using initialcontext object , datasource in context since don't have application server don't know how access resource. ideas? thanks http://commons.apache.org/dbcp/guide/jndi-howto.html shows how

c# - How to programmatically scroll TreeView control? -

please advice how can scroll .net treeview control programmatically. it doesn't implemented public methods scrolling. if need scroll node: treenode.ensurevisible();

sql - How do I find duplicate values in a table in Oracle? -

what's simplest sql statement return duplicate values given column , count of occurrences in oracle database table? for example: have jobs table column job_number . how can find out if have duplicate job_number s, , how many times they're duplicated? select column_name, count(column_name) table group column_name having count (column_name) > 1;

How do I do an LDAP query with JavaScript? -

trying make sidebar gadget has ldap query function, haven't been able find good, or any, useful documentation on matter. im not hugely experienced javascript, , know little nothing how ldap queries function, information @ useful. info: host: a.b.c.d.e port: 389 ou: people o: x_y_z c: us first snippet: var ssearchurl = "ldap://a.b.c.d.e:389/o=x_y_z,c=us"; var urlsuffix = "dc=" + form.searchdata.value; document.location = ssearchurl urlsuffix; other snippet: var ldap = getobject('ldap:'); var ad = ldap.opendsobject('ldap://a.b.c.d.e:389/o=x_y_z', 'cn=administrator,ou=people,o=rootname', 'password', 0); as long want run javascript in web browser, limited http protocol , domain script loaded in first place. so, talking ldap server not possible web browsers javascript engine. there javascript runtime environments have less...

event handling - C#, simplified code to handle both changes and updates of a dependency property -

obviously, i'm not expert in c#. simplify code using anonymous handler, or maybe lambda, not sure. valuehaschanged propertychangedcallback used when dp changed, ensures new object monitored update, both changes , updates processed using same code: processnewvalue . pity here create second handler valuehasbeenupdated call same method. there possibility remove definition of valuehasbeenupdated ? thanks. private static void valuehaschanged( dependencyobject sender, dependencypropertychangedeventargs args) { // instance myclass1 instance = sender myclass1; // unregister on old object if (args.oldvalue != null) (args.oldvalue myclass2).propertychanged -= instance.valuehasbeenupdated; // register updates on new object if (args.newvalue != null) (args.newvalue myclass2).propertychanged += instance.valuehasbeenupdated; // process new value anyway instance.processnewvalue(); } // value has been updated private void valuehasbee...

windows - Any tool similar to Hyperterminal application? -

hyperterminal program can use connect other computers, telnet sites, bulletin board systems (bbss), online services, , host computers, using either modem, null modem cable or ethernet connection. but main usage of hyperterminal communicate hardware through local (virtual )com ports. suppose removed in vista reason. are there other tools functions similar hyperterminal? [i curious know if not vista] here two: tera term tera term (pro) free software terminal emulator (communication program) ms-windows. supports vt100 emulation, telnet connection, serial port connection, , on. kermit 95 kermit 95: internet , serial communications microsoft windows® 95, windows 98, windows me, windows nt (4.0 , later), windows 2000, windows xp, , ibm os/2 kermit project @ columbia university, offers text-based terminal connections unix, vms, , many other kinds of hosts, allowing interact directly shells , applications, transfer files, and, if desired, automat...

border - How to Automatically Create ImageMaps of Grey Maps from Wikipedia? -

i have project using various members of wikipedia's grey maps: http://en.wikipedia.org/wiki/wikipedia:blank_maps . fill them in colors depending on countries, states or provinces user selects clicking on shape or checking checkbox. i write script creates imagemaps automatically of each country, state or province somehow getting x , y pixel location of borders of country, state or province albeit without names of these entities, fill in later. have done world map hand , found open source map image map demo. create maps more rapidly. i use php , gd floodfill shapes, guess use 1 central pixel location of shapes well. suggestions? script possibility still manual: http://abhinavsingh.com/blog/2009/03/using-image-maps-in-javascript-a-demo-application/ . mapedit, http://www.boutell.com/mapedit/ , has magic wand feature works pretty well, again have feeling can done automatically. an perfect solution issue using svg images , translator of svg code imagmap area tags...

iphone - posting comments to facebook results in "user not visible" error -

i writing facebook app iphone, when send request post comment following error: failed error: error domain=api.facebook.com code=210 "user not visible" userinfo=0x5a986b0 {request_args=( { key = text; value = "test comment"; }, { key = format; value = xml; }, { key = "post_id"; value = "100001297086328_132682710102963"; }, { key = "call_id"; value = 1279912620; }, { key = v; value = "1.0"; }, { key = "api_key"; value = xxxxxxxxxxxxxxxxxxxxxxx; }, { key = method; value = "facebook.stream.addcomment"; }, { key = "session_key"; value = "xxxxxxxxxxxxxxxxxxxxxxxxxx"; }, { key = sig; value = xxxxxxxxxxxxxxxxxxxxxxxxxxx; } when attempt comment on same post same user , facebook app using test console @ http://developers.facebook.com/docs/reference/rest/stream.addcomment works fine....

perl - What does Class::MethodMaker exactly do? -

i want know sequence of calls occurs when getter/setter created through class::methodmaker called? how costlier getter/setters defined methodmaker native ones (overwritten in module)? i don't have simple answer question regarding class::methodmaker performance. previous answer mentioned, can use debugger find out what's going on under hood. however, know class::methodmaker generates huge amounts of code @ install time. indicate 3 separate things me: regarding run-time, it's probably on faster side of whole slew of method generators. why generate loads of code @ install time otherwise? it installs o(megabytes) of code on disk! it may potentially slow @ compile time, depending on parts of generated code loaded simple use cases. you need spend few minutes think need. if want simple accessor methods auto-generated write more complicated hand, maybe @ class::accessor::fast. or, if want fastest possible accessor-methods, investigate class::xsaccessor, ext...

c# - check value exists in linq -

this xml file <persons> <person> <id>1</id> <name>ingrid</name> </person> <person> <id>2</id> <name>ella</name> </person> </persons> i using linq xml. here id should auto-generated.. i need check if value of node id exists . if not exists should create new id..how using linq. pointers? thank you xdocument doc = xdocument.parse(xml); int id = 1; // if need element xelement ingrid = (from person in doc.root.elements("person") (int)person.element("id") == id select person).firstordefault(); // if need know if there bool exists = (from person in doc.root.elements("person") (int)person.element("id") == id select person).any(); // generate new id int newid = ((from person in doc.root.elements(...

What technical considerations must a system/network administrator worry about when a site gets onto social bookmarking/sharing sites? -

the reason ask stack overflow has been dugg , slashdotted , , redditted . first, kinds of effect have on servers power website? second, can done system administrators ensure sites remain , running best possible? unfortunately, if haven't planned before happens, it's late , users have poor experience. scalability first immediate concern. may start getting more hits per second getting per month. first line of defense programming , design. make sure you're not doing stupid reloading data database multiple times per request instead of caching it. before spike happens, need realistic load tests see bottlenecks are. for absurdly high traffic, consider ability switch dynamic pages on static pages. having server architecture can scale helps. shared hosts don't scale. single dedicated machine doesn't scale. using amazon's ec2 host can help, if plan cluster of servers beginning (even if cluster single computer). you're next major concern...

java - How to update large XML file -

rather rewriting entire contents of xml file when single element updated, there better alternative updating file? i recommend using vtd-xml http://vtd-xml.sourceforge.net/ from faq ( http://vtd-xml.sourceforge.net/faq.html ): why should use vtd-xml large xml files? for numerous reasons summarized below: performance: performance of vtd-xml far better sax ease use: random access combined xpath makes application easy write better maintainability: app code shorter , simpler understand. incremental update: occasional, small changes become efficient. indexing: pre-parsed form of xml further boost processing performance. other features: cut, paste, split , assemble xml documents possible vtd-xml. in order take advantage of vtd-xml, recommended developers split ultra large xml documents smaller, more manageable chucks (<2gb).

Best way of constructing dynamic sql queries in C#/.NET3.5? -

a project i'm working on @ moment involves refactoring c# com object serves database access layer sql 2005 databases. the author of existent code has built sql queries manually using string , many if-statements construct complex sql statement (~10 joins, >10 sub selects, ~15-25 conditions , groupby's). base table same one, structure of joins, conditions , groupings depend on set of parameters passed class/method. constructing sql query work isn't elegant solution (and rather hard read/understand , maintain well)... write simple "querybuilder" myself pretty sure not first 1 kind of problem, hence questions: how you construct database queries? does c# offer easy way dynamically build queries? i used c# , linq similar log entries filtered on user input (see conditional linq queries ): iqueryable<log> matches = m_locator.logs; // users filter if (usersfilter) matches = matches.where(l => l.username == comboboxusers.text); //...

Double prompt and garbled R help with remote R on WinXP emacs -

i have installed modified emacs version windows xp vincent goulet , want run , edit r scripts contained on remote unix server using ess-remote. after lot of searching able connect remote r session in following way: open shell prompt m-x shell enter following command: plink -x -c username@server after entering password, start r in shell simple command r assign remote process command m-x ess-remote while able interact r successfully, double prompt , worse yet, if open file function, garbled text in same r process buffer, instead of new buffer opening legible r text. how can buffer open in separate window usual emacs , r interaction, , how can rid of double-prompts when execute shell? microsoft windows xp [version 5.1.2600] (c) copyright 1985-2001 microsoft corp. c:\documents , settings\username>plink -x -c username@remoteserver plink -x -c username@remoteserver username@remoteserver's password: [username@remoteserver ~]$ r r r version 2.11.0 (2010-04-22) copyr...

documentation - Sharepoint best practices -

i starting becoming sharepoint developer... not sure did in previous life warrant this, must have been bad! anyway getting buried in world of xml , guids seems should automated, each time add folder have add little bits number of different xml files, , woe betide if wrong guid in 1 of them (or hack wrong key out gac) please tell me has worked out how take pain sharepoint! no human can put long! you don't parts having trouble with. if project/solution generation, take @ stsdev . solutions, solution installer , wspbuilder . web parts, take @ smartpart . there in general usable tools on codeplex , search sharepoint there.

sql - How to list the tables in an SQLite database file that was opened with ATTACH? -

what sql can used list tables, , rows within tables in sqlite database file - once have attached attach command on sqlite 3 command line tool? the .tables , , .schema "helper" functions don't attached databases: query sqlite_master table "main" database. consequently, if used attach some_file.db my_db; then need do select name my_db.sqlite_master type='table'; note temporary tables don't show .tables either: have list sqlite_temp_master that: select name sqlite_temp_master type='table';

security - Why is my programmatically created user missing from the Welcome screen? -

i have program creates windows user account using netuseradd() api suggested microsoft . user created successfully, , can log in user. however, on windows xp, newly-created user missing welcome screen. if disable welcome screen, can log in new user typing user name in direcly. what property of account create causes omitted welcome screen? one thing add username value registry key: hkey_local_machine\software\microsoft\windows nt\currentversion\winlogon\specialaccounts\userlist use username (as reg_dword) , value of 1 show user , 0 hide.

python - What does this stand for? -

what '\r' mean? do? have never seen before , giving me headaches. doesnt seem have purpose, since 'a\ra' prints 'aa', not same string 'aa'. im using python 2.6 it's old control character typewriters. means "carriage return". in time, when pressed "enter", going next line, carriage went beginning of line (hence carriage return). computers, different oses made different choices represent new lines. on windows, have "\r\n" (carriage return + new line). on unices, have "\n" (no need carriage return, sort of implied new line). on old mac os, had "\r" only. nowadays, it's not used except newlines (or don't know other usages).

java - Should I keep my project files under version control? -

should keep project filesm eclipse's .project, .classpath, .settings, under version control (e.g. subversion, github, cvs, mercurial, etc)? you want keep in version control any portable setting files , meaning: file has no absolute path in it. includes: .project, .classpath ( if no absolute path used , possible use of ide variables, or user environment variables) ide settings (which disagree 'accepted' answer). settings includes static code analysis rules vitally important enforce consistently user loading project his/her workspace. ide specific settings recommandations must written in big readme file (and versionned of course). rule of thumb me: must able load project workspace , have in need set in ide , going in minutes. no additional documentation, wiki pages read or not. load up, set up, go.

numpy - How do you use the ellipsis slicing syntax in Python? -

this came in hidden features of python , can't see documentation or examples explain how feature works. you'd use in own class, since no builtin class makes use of it. numpy uses it, stated in documentation . examples here . in own class, you'd use this: >>> class testellipsis(object): ... def __getitem__(self, item): ... if item ellipsis: ... return "returning items" ... else: ... return "return %r items" % item ... >>> x = testellipsis() >>> print x[2] return 2 items >>> print x[...] returning items of course, there python documentation , , language reference . aren't helpful.

hibernate - Grails and Amazon SimpleDB -

how setup grails project use amazon simpledb? one possibility install gorm-jpa plugin , use simplejpa library, couldn't setup correctly. has experience combination? after many trials , errors managed use simple jpa project grails web application i have used : using entitymanagerfactory , jpa provider apis writing few service artifacts able use simple bd features seamlessly

Silverlight WCF service calling exception -

a silverlight 3.0 application tries call wcf service application can not establish connection endpoint. had checked urls etc. , every thing seems ok. accessing service other tools browser works. when debug application in visual studio when first call service made below output dumped: 'sllauncher.exe' (silverlight): loaded 'c:\program files\microsoft silverlight\4.0.50401.0\system.servicemodel.dll' first chance exception of type 'system.io.filenotfoundexception' occurred in mscorlib.dll when above error happens, application starts wait until timeout. also silverlight application out of browser 1 elevated permissions set true no need crossdomain.xml. i wonder if above system.io.filenotfoundexception can detailed doing something? or may may have come problem. thanks anyway. it issue of calling wcf service high level @ app.xaml.cs, problem gone when called mainpage.xaml.cs.

What are the best JVM settings for Eclipse? -

Image
what best jvm settings have found running eclipse? it time of year again: "eclipse.ini take 3" settings strike back! eclipse helios 3.6 , 3.6.x settings alt text http://www.eclipse.org/home/promotions/friends-helios/helios.png after settings eclipse ganymede 3.4.x , eclipse galileo 3.5.x , here in-depth @ "optimized" eclipse.ini settings file eclipse helios 3.6.x: based on runtime options , and using sun-oracle jvm 1.6u21 b7 , released july, 27th ( some sun proprietary options may involved ). ( by "optimized", mean able run full-fledge eclipse on our crappy workstation @ work, old p4 2002 2go ram , xpsp3. have tested same settings on windows7 ) eclipse.ini warning : non-windows platform, use sun proprietary option -xx:maxpermsize instead of eclipse proprietary option --launcher.xxmaxpermsize . is: unless using latest jdk6u21 build 7 . see oracle section below. -data ../../workspace -showlocation -showsplash org.e...

javascript - Determine if an HTML element's content overflows -

can use javascript check (irrespective of scrollbars) if html element has overflowed content? example, long div small, fixed size, overflow property set visible, , no scrollbars on element. normally, can compare client[height|width] scroll[height|width] in order detect this... values same when overflow visible. so, detection routine must account this: // determines if passed element overflowing bounds, // either vertically or horizontally. // temporarily modify "overflow" style detect // if necessary. function checkoverflow(el) { var curoverflow = el.style.overflow; if ( !curoverflow || curoverflow === "visible" ) el.style.overflow = "hidden"; var isoverflowing = el.clientwidth < el.scrollwidth || el.clientheight < el.scrollheight; el.style.overflow = curoverflow; return isoverflowing; } tested in ff3, ff40.0.2, ie6, chrome 0.2.149.30.

parsing - How to parse template languages in Ragel? -

i've been working on parser simple template language. i'm using ragel. the requirements modest. i'm trying find [[tags]] can embedded anywhere in input string. i'm trying parse simple template language, can have tags such {{foo}} embedded within html. tried several approaches parse had resort using ragel scanner , use inefficient approach of matching single character "catch all". feel wrong way go this. i'm abusing longest-match bias of scanner implement default rule ( can 1 char long, should last resort ). %%{ machine parser; action start { tokstart = p; } action on_tag { results << [:tag, data[tokstart..p]] } action on_static { results << [:static, data[p..p]] } tag = ('[[' lower+ ']]') >start @on_tag; main := |* tag; => on_static; *|; }%% ( actions written in ruby, should easy understand ). how go writing parser such simple langua...

.net - NHibernate + JSON/Ajax Parent/Child Relationships? Why this isn't working? -

i have typical parent/child relationship. writing news in .net , adding children works fine, nhibernate plays nice , adds correct relationships. however, when passing json object client method serializes json .net representation, nhibernate seems confused. comes correct query add parent (and assigns new guid id), however, doesn't associate parent id children objects in `sql tries execute. came quick , dirty hack, list below - wondering, there i'm missing here? ilist<backerentry> backerstemp = new list<backerentry>(); foreach (backerentry backerentry in jsonbackerentity.backerentries) { backerstemp.add(backerentry); } jsonbackerentity.backerentries.clear(); foreach (backerentry backerentry in backerstemp) { jsonbackerentity.addchild(backerentry); } doing way way can seem nhibernate see these children belong parent. inside addchild method looks this: public virtual void addchild(backerentry backerentry) { if (backerentry.backer != null) { ...

php - Why the following PDO transaction is committing? -

i think question pretty self-explanatory. code given below - <?php $pdo = null; $pdo_dsn = 'mysql:host=localhost;dbname=pdo_test'; $pdo_persistence = array( pdo::attr_persistent => true ); $db_user = 'root'; $db_pass = ''; $db_query = "insert person(name, address) values ('mamsi mamsi', 'katabon')"; try { $pdo = new pdo($pdo_dsn, $db_user, $db_pass, $pdo_persistence); } catch(pdoexception $e) { echo "error occured: ". $e->getmessage(); die(); } $pdo->setattribute(pdo::attr_errmode, pdo::errmode_exception); $pdo->setattribute(pdo::attr_autocommit, false); try { $pdo->begintransaction(); $pdo->exec($db_query); throw new pdoexception('generated exception'); $pdo->c...

Open the default browser in Ruby -

in python, can this: import webbrowser webbrowser.open_new("http://example.com/") it open passed in url in default browser is there ruby equivalent? cross-platform solution first, install launchy gem: $ gem install launchy then, can run this: require 'launchy' launchy.open("http://stackoverflow.com")

How do I setup remote debugging from scratch for an Asp.Net app -

i able step through application deployed remote location yet has nothing bar version 3.5 of .net framework. what steps need go through achieve , how long envisage taking? if have unrestricted tcp/ip access remote location, easy (as in, 5 minutes tops work): see how to: set remote debugging , how to: run remote debugging monitor steps involved. if development machine separated remote server firewalls, routers, etc., things bit more difficult. since remote debugging requires windows authentication, dcom , other things (and quite sensibly) blocked security policies, you'll require kind of vpn access remote network in order things work. setting routing , remote access service on target server quick way pptp dial-in access it, there significant security implications doing this. so, step take of time (and, depending on organization manages target network, lots of discussions network/security people...). my advice start testing remote debugging using test machine o...

RSS feed question -

do need xmlns links in rss code? what following code mean? <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/commentapi/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" > the xmlns properties define xml namespaces . for instance, xmlns:atom="http://www.w3.org/2005/atom" defines namespace atom uri http://www.w3.org/2005/atom . then, when create <atom:link> element, can see having uri http://www.w3.org/2005/atom/link , parser know link, defined in atom specification. note, parser cannot go name of namespace, have used xmlns:a="http://www.w3.org/2005/atom" , make <a:link> atom link tag.

Precedence: header in email -

my web application sends email often, , sends 3 kinds of emails: initiated user, in response event in system, , in automatic response email received application. i make sure third type of email not stuck in endless loop of auto-responders talking each other. currently, use header: precedence: junk but yahoo! mail treating these messages spam. not ideal, because read our auto-response , make decision on it, not out-of-office reply. what best way send email without triggering either junk filters or auto-responders? precedence: junk? precedence: bulk? precedence: list? x-priority: 2? rfc 2076 discourages use of precedence header. have noted, many clients filter off (especially precedence: junk variety). may better use null path avoid auto responder wars: return-path: <> ultimately use priority try around this, seems going against spirit of header. i'd suggest using return-path header this, , avoiding precedence. in cases may have write in way dro...

c# - How do I round a decimal value to 2 decimal places (for output on a page) -

when displaying value of decimal .tostring() , it's accurate 15 decimal places, , since i'm using represent dollars , cents, want output 2 decimal places. do use variation of .tostring() this? decimalvar.tostring ("#.##"); // returns "" when decimalvar == 0 or decimalvar.tostring ("0.##"); // returns "0" when decimalvar == 0

RTTI on objects in Delphi -

i'm trying parse objects xml in delphi, read calling object's classinfo method rtti info. the thing is, apparently works tpersistent objects. otherwise, have add compiler directive {$m+} source code compiler generate rtti info. so happily added directive, find that, if did return classinfo call (it used return nil), cannot retrieve class' properties, fields or methods it. it's created object empty. any idea missing here? thanks! did put properties , methods published section? besides that, 'classical' rtti ($typeinfo on) information on properties, not on methods. need 'extended' rtti ($methodinfo on) those. good starting point extended rtti: david glassborow on extended rtti (who believe minute finished writing code uses extended rtti , decided browse stack overflow little:))

What is the best open XML parser for C++? -

this question has answer here: what xml parser should use in c++? 5 answers i looking simple, clean, correct xml parser use in c++ project. should write own? how rapidxml ? rapidxml fast , small xml dom parser written in c++. aimed @ embedded environments, computer games, or other applications available memory or cpu processing power comes @ premium. rapidxml licensed under boost software license , source code freely available. features parsing speed (including dom tree building) approaching speed of strlen function executed on same data. on modern cpu (as of 2008) parser throughput 1 billion characters per second. see performance section in online manual. small memory footprint of code , created dom trees. a headers-only implementation, simplifying integration process. simple license allows use purpose, both commercial , non-commercial, without ob...

How can i detect Adobe AIR version through javascript? -

i want detect adobe air version through javascript..how that? you can use variable nativeapplication.nativeapplication.runtimeversion in javascript can use air.nativeapplication.nativeapplication.runtimeversion after including air alias file i don't know how going use it, better check supported features rather checking version. http://livedocs.adobe.com/flex/3/html/help.html?content=runtime_os_info_1.html

asp.net - Problems injecting server side variables using <%# -

i having problems inserting string following tag : <tr id="rowbulkoptions" style='<%# sbulkoptionsrowstyle %>'> don't ask why i'm using tables :) sbulkoptionsrowstyle public string in aspx.vb file. seemingly way can render put page.databind() in page_load, page_prerender etc.. causes me problems because page.databind() binds all controls on page. i use <%= part of code inserts controls page , apparently can't use <%= , insert controls. is there way can 'look, put sbulkoptionsrowstyle page please!' ? thanks. the <%# tag used when binding repeating control, take not doing? as dynamically modifying controls stated can not use <%= . my suggestion add tag runat="server" tr , assign variable style attribute of control within page load/init of code behind. e.g. <tr id="rowbulkoptions" runat="server"> and in code behind rowbulkoptions.attributes["...

git - Branch from *part* of main code, how to keep it up to date? -

was little bit difficult formulate title question since kind of abstract... let me try explain. have main code has git repository, decided take part of code , make stand alone app. own name , versions distributed. is there way keep main code , other branch updated? ex. if find workaround code on main, if can merge change stand alone (without adding of other functionality) if add new feature on stand alone, apply main code well. currently have branch im not sure if create own git repository soon. i aware of git add -p times have many changes , going 1 1 until arrive 1 want apply pain. any info appreciated the tool describe add-on git, known git-subtree: http://github.com/apenwarr/git-subtree/blob/master/git-subtree.txt it works bit submodules, projects aren't linked together, , can extract , re-merge as like. there ongoing discussions regarding whether tool distributed git itself.

postgresql - change pgsql port -

this question has answer here: how change postgresql listening port in windows? 1 answer i have installed pgsql instance running on port 1486 . want change port 5433 , how should proceed this? there should line in postgresql.conf file says: port = 1486 change that. the location of file can vary depending on install options. on debian-based distros /etc/postgresql/8.3/main/ on windows c:\program files\postgresql\9.3\data

c++ - How to compile Qt 4.6.3 for Windows Mobile (Windows CE) under Windows? -

lnk1112: module machine type ' x86' conflicts target machine type 'thumb' i'm trying build qt windows ce/windows mobile , i'm following guide: http://doc.qt.io/archives/4.6/install-wince.html these steps took far: i downloaded qt-everywhere-opensource-src-4.6.3 extracted c:\qt\qt-everywhere-opensource-src-4.6.3 opened visual studio command prompt , ran following command configure -platform win32-msvc2008 -xplatform wincewm60professional-msvc2008 -webkit -openssl -arch windowsce -opensource -qt-gif -qt-libjpeg -qt-libpng the configure step finished successfully. i try setcepaths wincewm60professional-msvc2008 , following error could not find specified sdk: windows mobile 6 professional sdk (armv4i) 'tmp_created_script_setup.bat' not recognized internal or external command, operable program or batch file. could not find c:\qt\qt-everywhere-opensource-src-4.6.3\tmp_created_script_setup .bat windows mobile 6 professi...

odbc - From SPSS, import data from SQL Server Analysis Services -

i'm wondering if there easy way load data analysis services (ssas) spss. spss offers product put spss functionality on analysis server, me backwards. don't want learn spss or have spss users in office learn else. i want give analysis services data spss users in spss. you better point ssps @ relational datasource ssas using. ssas not designed doing bulk exporting of data. evne if did figure out series of queries many times slower querying original source.

Rails text_field with no method associated -

i'm having problem create text_field without method association. maybe don't need :-) i have 2 radio_buttons associated same method: <%= radio_button :comment, :author, "anonymous" %> anonymous <br> <%= radio_button :comment, :author, "real_name" %> name <br> what have text_field when user click on radio_button "real_name" can verify value in new text_field. basically controller like: @comment = comment.new(params[:comment]) if @comment.author == "real_name" @comment.author = "value-from-the-new-textfield end there way it? regards, victor if want generate text_field without associated object/method, use text_field_tag

posix - scanf,back reference in awk -

is there implementation of scanf()(like in c) in awk(posix)? i know awk not have reference in sed , perl. easiest way simulate in awk? thanks nyan sprintf() , printf() may looking for. awk not support backreferences gawk's gensub(), or gsub() can provide backreferences. backreferences storing strings matched. so, making use of awk's capability differentiate fields , field delimiters, using internal variables ofs,fs,ors etc way go.. eg $ echo "test.txt" | sed 's/\(.*\).txt/\1.pdf/' test.pdf $ echo "test.txt" | awk -f"." '{$nf="pdf"}1' ofs="." test.pdf of course, simple example. idea.

php include problem -

when try load page resides in /var/www/vhosts/mypage/httpdocs/index.php using browser include error cannot include file in /var/www/fw/trunk. include path set include_path='.:/var/www/fw/trunk'. but when try load console using 'php index.php' loads fine, guess kind of permission problem can't seem find , where. you need make sure webserver or php process able read folder files @ least. search chown , chmod .

Building C++ CLR app for Platform Toolset v90 in VS2010 requires Visual Studio 2008 -

i've got shiny new laptop latest dev tools installed such visual studio 2010. now i've got task build c++ clr app targeting 2.0 runtime (this outside comfort zone). i've specifed v90 platform toolset when build get:- error msb8010: specified platform toolset (v90) requires visual studio 2008. please make sure visual studio 2008 installed on machine. seriously, need install 2008 well? there way round this, such copying in folders 2008 install? if not how of vs 2008 installation need? part of problem vs2010 redid how compiling in c++ (cli or not) works. uses msbuild structure believe trying need vcbuild framework not in 2010. you may able away using visual studio 2008 express build. if not should need c++ portion of vs2008. do need use vc90 target though? build c++/cli (still new myself) vc10 target , builds fine. (however targeting 4.0 framework referencing 2.0 portions)

multithreading - Deadlock detection in Java -

long time ago, saved sentence java reference book: "java has no mechanism handle deadlock. won't know deadlock occurred." (head first java 2nd edition, p.516) so, it? there way catch deadlock case in java? mean, there way our code understands deadlock case occurred? since jdk 1.5 there useful methods in java.lang.management package find , inspect deadlocks occurs. see findmonitordeadlockedthreads() , finddeadlockedthreads() method of threadmxbean class. a possible way use have separate watchdog thread (or periodic task) this. sample code: threadmxbean tmx = managementfactory.getthreadmxbean(); long[] ids = tmx.finddeadlockedthreads(); if (ids != null) { threadinfo[] infos = tmx.getthreadinfo(ids, true, true); system.out.println("the following threads deadlocked:"); (threadinfo ti : infos) { system.out.println(ti); } }

command line - What does "java: No match." mean? -

when running java command line: java -classpath bin:pellet-2.0.0/lib/* com.stuff.myclass argumenttextstuff i'm getting following reply: java: no match. what's mean? which java points expected file. , if take asterisk out, expected class not found error. google searches aren't fruitful because keep getting stuff matching regexp patterns. ah... figured out. worked when using bash shell, * treated differently in tcsh shell. switched bash , works. reason described here (per polygenelubricants's suggestion in comments below).

c - How to get keyboard input with x86 bare metal assembly? -

i'm in process of trying hack first bits of kernel. have entire kernel compiled down c code, , i've managed displaying text in console window , of fine goodness. now, want start accepting keyboard input can make use of thing , going on process management. i'm using djgpp compile, , loading grub. i'm using small bit of assembly jumps directly compiled c code , i'm happy there. all research i've done seems point isr @ $0x16 read in next character keyboard buffer. can tell, supposed store ascii value in ah, , keycode in al, or effect. i'm attempting code using following routine in inline assembly: char getc(void) { int output = 0; //crazy voodoo code asm("xor %%ah, %%ah\n\t" "int $0x16" : "=a" (output) : "a" (output) : ); return (char)output; } when code called, core crashes. (i'm running on virtualbox, didn't feel need try basic on real hard...

create hyperlink in gridview asp.net c# -

my code in c# asp.net 3.5 in following code "msg" has many words spaces , characters (eg:failed prepare sync favorites : directory not exist: \stl-fnp-02\ryounes$\sync\favorites). "msg" pulled database gridview. not able create hyperlink "msg" in gridview. since has spaces not creating hyperlink. i need create hyperlink "msg" , latter use in linq query. i think 1 shud either use eval or url encoder. not sure how it. can how go it? <asp:hyperlinkfield datatextfield="msg" headertext="msg" datanavigateurlfields="msg" datanavigateurlformatstring="sync.aspx?msg={0}" /> the easiest way around use <asp:templatefield headertext="msg"> <asp:hyperlink runat="server" text='<%# httputility.urlencode(eval("msg")) %>' navigateurl='<%#eval("msg")%>' /> </asp:templatefield> not 100% syntax correct...

How do I iterate through a string in Python? -

as example, lets wanted list frequency of each letter of alphabet in string. easiest way it? this example of i'm thinking of... question how make alltheletters equal said letters without alltheletters = "abcdefg...xyz". in many other languages letter++ , increment way through alphabet, far haven't come across way in python. def alphcount(text): lowertext = text.lower() letter in alltheletters: print letter + ":", lowertext.count(letter) the question you've asked (how iterate through alphabet) not same question problem you're trying solve (how count frequency of letters in string). you can use string.lowercase, other posters have suggested: import string alltheletters = string.lowercase to things way you're "used to", treating letters numbers, can use "ord" , "chr" functions. there's absolutely no reason ever this, maybe comes closer you're trying figure out: def getallthele...

LINQ to SQL multiple DataContext-s -

i'm trying figure best strategy how organize datacontexts. typical db work has between 50 , 100 tables in third-normal form , many relations between them. think have 2 options: put tables in single context. ensure committed in correct order in database. problem linq designer mess 50+ tables , i'm worrying performance may affected. create several data contexts based on logical grouping of tables. problem there places 1 side of relation in 1 context , other in one. we'll have manually take care of committing both context-s in correct order. is there recommended practice handle this? more details: i want create own entities , unit of work on top of linq sql. entities defined in xml model file mapping linq entities specified also. custom tool generate entities (poco) based on model. client code interact entities , unit of work; never directly datacontext or linq entities. not want duplicate linq sql provide out of box want use underlying linq datacontext. means c...

c# - Is it possible to throw a MessageQueueException? -

i using mock object in rhinomocks represent class makes calls messagequeue.getpublicqueues. want simulate exception thrown when message queueing operating in workgroup mode, messagequeueexception, ensure catching exception correctly the messagequeueexception has no public constructor, standard protected constructor exception. there appropriate way throw exception mock object / expect.call statement? reflection can break accessibility rulez. will void warranty, .net update can break code. try this: using system.reflection; using system.messaging; ... type t = typeof(messagequeueexception); constructorinfo ci = t.getconstructor(bindingflags.nonpublic | bindingflags.instance, null, new type[] { typeof(int) }, null); messagequeueexception ex = (messagequeueexception)ci.invoke(new object[] { 911 }); throw ex;

c# - Best Timer for using in a Windows service -

i need create windows service execute every n period of time. question is: timer control should use: system.timers.timer or system.threading.timer one? influence on something? i asking because heard many evidences non correct work of system.timers.timer in windows services. thank you. both system.timers.timer , system.threading.timer work services. the timers want avoid system.web.ui.timer , system.windows.forms.timer , respectively asp applications , winforms. using cause service load additional assembly not needed type of application building. use system.timers.timer following example (also, make sure use class level variable prevent garbage collection, stated in tim robinson's answer): using system; using system.timers; public class timer1 { private static system.timers.timer atimer; public static void main() { // normally, timer declared @ class level, // stays in scope long needed. // if timer declared in lo...

javascript - How to distinguish between live and non-live NodeList collections? -

both document.getelementsbytagname('div') , document.queryselectorall('div') return nodelist collection. difference first method returns live-collection , second 1 - static one. the question - there opportunity distinguish 1 object via inspecting these objects (i.e - not trying add/remove items test "liveness")? thanks in advance the nodelist interface agnostic of dead or live status. interface nodelist { node item(in unsigned long index); readonly attribute unsigned long length; }; it contains property length , , method item i'm afraid it's not possible determine if object live without manipulating dom , seeing effects.

javascript - ASP.NET: Warning on changed data closing windows -

i'd warn users when try close browser window if didn't save changes made in web form. i'm using asp.net 3.5 (with asp.net ajax). is there common solution implement? edit: maybe question wasn't clear: looking way integrates gracefully in asp.net server controls methodology. here asp.net extender control this: http://www.codeproject.com/kb/ajax/ajaxdirtypanelextender.aspx hope helps. may not fit needs @ least shows how.