Posts

Showing posts from March, 2011

twitter4j - android twitter retrieveRequestToken 401 on request token -

i trying following sample app twitter oauth. http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html private void askoauth() { try { consumer = new commonshttpoauthconsumer(consumer_key, consumer_secret); provider = new defaultoauthprovider("http://twitter.com/oauth/request_token", "http://twitter.com/oauth/access_token", "http://twitter.com/oauth/authorize"); string authurl = provider.retrieverequesttoken(consumer, callback_url); toast.maketext(this, "please authorize app!", toast.length_long).show(); this.startactivity(new intent(intent.action_view, uri.parse(authurl))); } catch (exception e) { log.e(app, e.getmessage()); toast.maketext(this, e.getmessage(), toast.length_long).show(); } } when run following cod...

Distribute a database made with JavaDB with Java program -

i'm creating program in java in have use lot of tables. made decision create tables in javadb file. however, want distribute filled javadb file jar file distribution, since connecting server not option. in past distribute empty database jar using derby package. any ideas? thank much! i'm not sure understood question possible package read-only database inside jar. derby documentation: accessing databases-in-a-jar in class path once archive containing 1 or more derby databases has been created can placed in class path. allows access database within application without application's knowing path of archive. when jar or zip files part of class path, not have specify jar subsubprotocol connect them. to access database in zip or jar file in class path: set class path include jar or zip file before starting derby: classpath="c:\dbs.jar;%classpath%" connect database within jar or zip file 1 of fol...

language agnostic - Graph Algorithm To Find All Connections Between Two Arbitrary Vertices -

i trying determine best time efficient algorithm accomplish task described below. i have set of records. set of records have connection data indicates how pairs of records set connect 1 another. represents undirected graph, records being vertices , connection data edges. all of records in set have connection information (i.e. no orphan records present; each record in set connects 1 or more other records in set). i want choose 2 records set , able show simple paths between chosen records. "simple paths" mean paths not have repeated records in path (i.e. finite paths only). note: 2 chosen records different (i.e. start , end vertex never same; no cycles). for example: if have following records: a, b, c, d, e , following represents connections: (a,b),(a,c),(b,a),(b,d),(b,e),(b,f),(c,a),(c,e), (c,f),(d,b),(e,c),(e,f),(f,b),(f,c),(f,e) [where (a,b) means record connects record b] if chose b starting record , e ending rec...

compilation - Location of generated class files when used in clojure repl -

when enter (use 'some.namespace) in repl, corresponding clojure file compiled , loaded. compiled class files stored on file system, or reside in memory? repl started command line, no editor/ide involved. when use namespace, no class files generated anywhere know of. time class files generated if explicitly aot compile code, , of time, won't need to. you can learn more compilation here: http://clojure.org/compilation

Algorithm for joining e.g. an array of strings -

i have wondered time, nice, clean solution joining array of strings might like. example: have ["alpha", "beta", "gamma"] , want join strings one, separated commas – "alpha, beta, gamma". now know programming languages offer kind of join method this. wonder how these might implemented. when took introductory courses, tried go alone, never found satisfactory algorithm. seemed rather messy, problem being can not loop through array, concatenating strings, add 1 many commas (either before or after last string). don’t want check conditions in loop. don’t want add first or last string before/after loop (i guess maybe best way?). can show me elegant solution? or tell me why there can’t more elegant? the elegant solution found problems (in pseudocode) separator = "" foreach(item in stringcollection) { concatenatedstring += separator + item separator = "," } you run loop , after second time around separator ...

How do I configure Firebug to use Eclipse/Netbeans as editor -

i want use real ide editing javascript files in combination firebug. in 'add editor' dialog firebug i'm allowed specify executable , arguments. question how open file in eclipse/netbeans command line. extra points allowing me choose between opening new eclipse/netbeans instance , reusing running one. not exact answer i'm afraid, information might help. eclipse - running eclipse fireclipse: debug ff straight eclipse

javascript - variable declaration causing page not to load? -

i've got following variable declaration.. var html = "<b>" + name + "</b> <br/>" + message + ' <div align="left"> ' + '<a href="path/to/php? id='+name'&message='+message+'&id='+id+'&lat='+lat+'&lng='+lng+'&type='+type+'" target="_blank">click me!</a>' + ' </div> <form name="myform" action="delete.php" method="post"> <div align="right"> ' + '<br/> <input type="radio" name="id" value= '+id+' > delete entry<br/> <input type="submit" /> </div> </form>'; inside function function createmarker(point, name, message, type, file, id, lat, lng) i can't seem spot why variable declaration appears crashing page. have idea what's wrong declaration? than...

What's a good program to record video or screencast being played on screen? -

what's program record videos or screencasts being played on screen? i've had success camtasia / camstudio. check out http://showmedo.com tutorials. it's little recursive though - better capture source.

javascript - How do you resize an IE browser window to 1024 x 768 -

in firefox can enter following awesome bar , hit enter: javascript:self.resizeto(1024,768); how do same thing in ie? javascript:resizeto(1024,768); vbscript:resizeto(1024,768) will work in ie7, consider using like javascript:moveto(0,0);resizeto(1024,768); because ie7 doesn't allow window "resize" beyond screen borders. if work on 1024,768 desktop, happens... firefox: 1024x768 window, going behind taskbar. if drop moveto part, top left corner of window won't change position.(you still 1024x768 window) ie7: close possible requested size without obscuring taskbar or allowing part of window lie beyond screen borders. safari: close possible requested size without obscuring taskbar or allowing part of window lie beyond screen borders, can ommit moveto part. safari move top left corner of window you. opera: nothing happens. chrome: nothing happens.

How do you find out the ProductCode from a .Net Installer class custom action -

i need know application's productcode in installer.oncommitted callback. there doesn't seem obvious way of determining this. you can avoid hardcoding product code, using /productcode=[productcode] in customactiondata property.

How to implement database engine independent paging? -

task: implement paging of database records suitable different rdbms. method should work mainstream engines - mssql2000+, oracle, mysql, etc. please don't post rdbms specific solutions, know how implement of modern database engines. i'm looking universal solution. temporary tables based solutions come mind @ moment. edit: i'm looking sql solution, not 3rd party library. there have been universal solution if sql specifications had included paging standard. requirement rdbms language called rdbms language not include paging support well. many database products support sql proprietary extensions standard language. of them support paging mysql limit clause, rowid oracle; each handled differently. other dbms's need add field called rowid or that. i dont think can have universal solution (anyone free prove me wrong here;open debate) unless built database system or unless there company abc uses oracle, mysql, sql server , decide have various database syste...

paypal - What do I need to know to build a charity website? -

my friend starting microfinance website , wants site development. want knowledge in html , css, i'm not quite sure else should learn. i'm not clear on advantages , disadvantages of using perl, asp, javascript, php, etc. are. also, need create payment option, , thinking of using paypal. language should know api , choice payment? paypal payment option enables more user confidence (they don't have provide bank details, etc. other sites). i'd suggest learning html 5 , css, , basic php (by basic mean, include() , that's it) reusing of site design don't have copy , paste. don't use cms; great learning experience - html/css/php isn't hard.

MySQL Interview Questions -

i've been asked screen candidates mysql dba / developer position role requires enterprise level skill set. i myself sql server person know looking point of view regards scalability / design etc there specific should asking regards mysql? i ideally ask them enterprise level features of mysql typically use when working on big database. need separate out enterprise developers home / small website kind of guys. thanks. although sql server , mysql both rdbms, mysql has many unique features can illustrate difference between novice , expert. your first step should ensure candidate comfortable using command line, not gui tools such phpmyadmin. during interview, try asking candidate write mysql code create database table or add new index. these basic queries, type gui tools prevent novices mastering. can double-check answers more familiar mysql. can candidate demonstrate knowledge of how joins work? example, try asking candidate construct query returns rows table 1 no...

visualization - Does anyone have a handy visulization widget that I can use for a web project? -

what want lots of nodes can expand making mind map. i'd ideally expand , collapse nodes. able navigate either dragging around page, or following expanded nodes. i have colleague needed kind of functionalities graph maven dependencies between projects. ended using freemind visualization. had write xml file conforming freemind format. think can use opml file format , find ready use xslt transform freemind format. maybe freemind supports opml directly (i havent used long time). once have data in freemind, can either export them, or use freemind applet display interactive mindmap on website.

sql server - How do I perform an IF...THEN in an SQL SELECT? -

how perform if...then in sql select statement? for example: select if(obsolete = 'n' or instock = 'y' ? 1 : 0) saleable, * product the case statement closest if in sql , supported on versions of sql server select cast( case when obsolete = 'n' or instock = 'y' 1 else 0 end bit) saleable, * product you need cast if want result boolean value, if happy int , works: select case when obsolete = 'n' or instock = 'y' 1 else 0 end saleable, * product case statements can embedded in other case statements , included in aggregates. sql server denali (sql server 2012) adds iif statement available in access : (pointed out martin smith ) select iif(obsolete = 'n' or instock = 'y', 1, 0) saleable, * product

How create threads under Python for Delphi -

i'm hosting python script python delphi components inside delphi application. i'd create background tasks keep running script. is possible create threads keep running if script execution ends (but not host process, keeps going on). i've noticed program gets stuck if executing script ends , there thread running. if i'll wait until thread finished goes fine. i'm trying use "threading" standard module threads. python has own threading module comes standard, if helps. can create thread objects using threading module. threading documentation thread documentation the thread module offers low level threading , synchronization using simple lock objects. again, not sure if helps since you're using python under delphi environment.

plc - Any successful profibus communications from .NET? -

has talked profibus .net application? if did, device/card did use accomplish this, application, , did use kind of preexisting or available code? we've not used profibus, have used devicenet (another can based protocol), ethernet/ip , controlnet have similar challenges. we've been doing since late 1990's , therefore rely on our own generated code using off-the-shelf hardware. companies have shown longevity during period remember are:- anybus (hms, www.anybus.com ) we've started using gateway products can place fieldbus interfaces close hardware , communicate on normal ethernet (usually using ethernet/ip www.odva.org ). has advantage of separating hardware , pc using network cable. ethernet/ip .net classes written ourselves nothing on market @ time. i'm sure quick google search find suitable class libraries sst ( www.mysst.com ) have had fieldbus interfaces more decade. last sst card used devicenet still had vb6 sample code. selection of fi...

EtherPad Database Schema? -

does have etherpad database schema? googled it, see tons of requests, can't seem find one. i'm interested in taking look. i'm curious how etherpad handler revisions/timeline. create new records each save in main pad table? here's full schema dumped mysql: http://padm.us/schema here's blog post it: http://appolo85.wordpress.com/2010/03/22/first-steps-understanding-etherpad/

html - Issue with Regular expressions in python -

ok, i'm working on regular expression search out header information in site. i've compiled regular expression: regex = re.compile(r''' <h[0-9]>\s? (<a[ ]href="[a-za-z0-9.]*">)?\s? [a-za-z0-9.,:'"=/?;\s]*\s? [a-za-z0-9.,:'"=/?;\s]? ''', re.x) when run in python reg ex. tester, works out wonderfully. sample data: <body> <h1>dog </h1> <h2>cat </h2> <h3>fancy </h3> <h1>tall cup of lemons</h1> <h1><a href="dog.com">dog thing</a></h1> </body> now, in redemo, works wonderfully. when put in python code, however, prints <a href="dog.com"> here's python code, i'm not sure if i'm doing wrong or if lost in translation. appreciate help. stories=[] response = urllib2.urlopen('http://apricotclub.org/duh.html') html = response.read().lower() p =...

Visual Studio Web Developer 2010 Express window numbers and debugging crashes -

installed visual studio web developer 2010 express iso available page: http://www.microsoft.com/express/downloads/ if helps info visual studio window: microsoft visual studio 2010: version 10.0.30319.1 rtmrel microsoft .net framework - version 4.0.30319 rtmrel installed version: wd express for reason silly big red numbers appearing in right hand side , on tool bar windows. whenever resize window numbers change , extremely annoying. have been through settings , options , cannot find 'turn off silly big red numbers everywhere' check box. can show me please? vs2010 window numbers http://www.solutionrevolution.net/stackoverflow/vs2010-window-numbers.png more annoying silly big red numbers debugging against iis7 visual studio hangs , nothing work again until restart. vista business running 32 bit. vs2008 works fine on same machine. if has pointers or me appreciated definitely looks fraps. vs2010 written in wpf, , wpf uses directx render everythin...

java - How do you create automated tests of a Maven plugin using JUnit? -

i've got (mostly) working plugin developed, since function directly related project processes, how develop unit , integration tests plugin. best idea i've had create integration test project plugin uses plugin during lifecycle , has tests report on plugins success or failure in processing data. anyone better ideas? you need use maven-plugin-testing-harness , <dependency> <groupid>org.apache.maven.shared</groupid> <artifactid>maven-plugin-testing-harness</artifactid> <version>1.1</version> <scope>test</scope> </dependency> you derive unit test classes abstractmojotestcase . you need create bare bones pom, in src/test/resources folder. <project> <build> <plugins> <plugin> <groupid>com.mydomain,mytools</groupid> <artifactid>mytool-maven...

asp.net - When to enable/disable Viewstate -

i generaly disable viewstate asp.net controls unless explicitly know going require view state them. have found can reduce page size of html generated. is practice? when should enabled or disabled? yes idea. 1 argue should have been disabled default microsoft, caching. to see how bad viewstate in terms of size increased can use tool called viewstate analyzer . particularly useful when have existing application developed viewstate enabled. another reason disable viewstate is hard disable @ later stage, when have loads of components depending on it.

html - How to horizontally center a <div> in another <div>? -

how can horizontally center <div> within <div> using css (if it's possible)? <div id="outer"> <div id="inner">foo foo</div> </div> you can apply css inner <div> : #inner { width: 50%; margin: 0 auto; } of course, don't have set width 50% . width less containing <div> work. margin: 0 auto actual centering. if targeting ie8+, might better have instead: #inner { display: table; margin: 0 auto; } it make inner element center horizontally , works without setting specific width . working example here: #inner { display: table; margin: 0 auto; } <div id="outer" style="width:100%"> <div id="inner">foo foo</div> </div>

codebase - Organizing the source code base when mixing two or more languages (like Java and C++) -

i ran problem few days ago when had introduce c++ files java project. started need measure cpu usage of java process , decided way go use jni call out native library (a shared library on unix machine) written in c. problem find appropriate place put c files in source repository (incidentally clearcase) consists of java files. i thought of couple of alternatives: (a) create separate directory putting c files (specifically, 1 .h file , 1 .c file) @ top of source base like: /vobs/myproduct/javasrc /vobs/myproduct/cppsrc i didn't because have 2 c files , seemed odd split source base @ language level this. had substantial portions of project been written more or less equally in c++ , java, okay. (b) put c files java package uses it. i have calling java classes in /vobs/myproduct/com/mycompany/myproduct/util/ , c files go in there. i didn't either because think c files don't belong in java package. has solved problem before? generally, what's strategy foll...

bash - Count number of occurrences of token in a file -

i have server access log, timestamps of each http request, i'd obtain count of number of requests @ each second. using sed , , cut -c , far i've managed cut file down timestamps, such as: 22-sep-2008 20:00:21 +0000 22-sep-2008 20:00:22 +0000 22-sep-2008 20:00:22 +0000 22-sep-2008 20:00:22 +0000 22-sep-2008 20:00:24 +0000 22-sep-2008 20:00:24 +0000 what i'd love number of times each unique timestamp appears in file. example, above example, i'd output looks like: 22-sep-2008 20:00:21 +0000: 1 22-sep-2008 20:00:22 +0000: 3 22-sep-2008 20:00:24 +0000: 2 i've used sort -u filter list of timestamps down list of unique tokens, hoping use grep like grep -c -f <file containing patterns> <file> but produces single line of grand total of matching lines. i know can done in single line, stringing few utilities ... can't think of which. know? i think you're looking for uniq --count -c, --count ...

What free screen design tools are available -

i looking free tool create screen design in workshop customer (for web application). the focus of tool should on functional definition of screens , not on design of them. do have suggestions appropriate tool? i've found mockupscreens pretty good. designs works in progress , keeps clients getting distracted

php - How to print all sessions currently set? -

without having call each session name, there way display contents of sessions set? echo '<pre>'; var_dump($_session); echo '</pre>'; or can use print_r if don't care types. if use print_r , can make second argument true return instead of echo, useful for... echo '<pre>' . print_r($_session, true) . '</pre>';

ruby - How can I force require a file in the console? The 'reload!' command just dosen't work! -

i use rails-3.0.0.beta3 , ruby-1.9.2-preview3. i have defined new methods in application_controller.rb, , need test them in console. if changed codes in application_controller.rb. have restart console. have tried use 'reload!' command, dosen't work. , use "require 'applicatioin.rb'", still dosen't work. help! make sure you're in dev mode, try this: activesupport::dependencies.clear

tdd - How deep are your unit tests? -

the thing i've found tdd takes time tests set , being naturally lazy want write little code possible. first thing seem test constructor has set properties overkill? my question level of granularity write unit tests at? ..and there case of testing much? i paid code works, not tests, philosophy test little possible reach given level of confidence (i suspect level of confidence high compared industry standards, hubris). if don't typically make kind of mistake (like setting wrong variables in constructor), don't test it. tend make sense of test errors, i'm careful when have logic complicated conditionals. when coding on team, modify strategy test code we, collectively, tend wrong. different people have different testing strategies based on philosophy, seems reasonable me given immature state of understanding of how tests can best fit inner loop of coding. ten or twenty years we'll have more universal theory of tests write, tests not write, , how tell...

javascript - How can I do cross-domain postMessage? -

the documentation postmessage implies cross-domain messaging possible. however: // when popup has loaded, if not blocked popup blocker that isn't clear note of how it. imagine 2 websites: [parent] hosted on qc-a.nfshost.com [child] hosted on qc-b.quadhome.com in parent: document.addeventlistener('message', function(e) { alert('parent got (from ' + e.origin + '): ' + e.data); e.source.postmessage('round-tripped!', 'http://qc-b.quadhome.com'); }, false); function go() { var w = window.open('http://qc-b.quadhome.com', 'test'); /* doesn't work because same-origin policy prevents knowing when opened window ready. */ w.postmessage('vain attempt.', 'http://qc-b.quadhome.com'); } and, in child: document.addeventlistener('message', function(e) { alert('child got (from ' + e.origin + '): ' + e.data); }, false); window.opener.postmessage('ready...

c# - How can I tell when .Net System.Diagnostics.Process ran successfully or failed? -

i'm writing scheduler or sorts. it's table list of exes (like "c:\a.exe") , console app looks @ records in table every minute or , runs tasks haven't been run yet. i run tasks this: system.diagnostics.process p = new system.diagnostics.process(); p.startinfo.useshellexecute = false; p.startinfo.filename = someexe; // "a.exe" p.start(); how can tell if particular task failed? example if a.exe throws unhandled exception? i'd above code know when happens , update tasks table "the particular task failed" etc. how can this? i'm not using sql agent or windows scheduler because else told me not to. has more "experience" i'm following orders. feel free suggest alternatives. you can catch win32exception check if process.start() failed due file not existing or execute access denied. but can not catch exceptions thrown processes create using class. in first place, application might not written in .net...

java - How tdo I get the day of the week, of the first day of the month? -

this question has answer here: how first day of current week , month? 11 answers july 1, 2010 corresponds thursday, how value of thursday programmatically. calendar day= new gregoriancalendar(2010, calendar.july, 1); int dayofweek = day.get(calendar.day_of_week); // 5=thursday

What is MATLAB good for? Why is it so used by universities? When is it better than Python? -

i've been asked learn matlab basics class. what make cool researchers , people works in university? saw it's cool work matrices , plotting things... (things can done in python using libraries). writing function or parsing file painful. i'm still @ start, missing? in "real" world, should think use for? when should can better python? better mean: easy way write performing. update 1: 1 of things i'd know "am missing something?" :d update 2: thank answers. question not buy or not buy matlab. university has possibility give me copy of old version of matlab (matlab 5 guess) free, without breaking license. i'm interested in capabilities , if deserves deeper study (i won't need more basic matlab in oder pass exam :p ) better python specific kind of task in real world. adam partially right. many, if not most, mathematicians never touch it. if there computer tool used @ all, it's going mathematica or maple . enginee...

c# - How to prevent an exception in a background thread from terminating an application? -

i can hookup appdomain.currentdomain.unhandledexception log exceptions background threads, how prevent them terminating runtime? first, should try not have exceptions thrown - , not handled - in background thread. if control way delegate run, encapsulate in try catch block , figure way pass exception information main thread (using endinvoke if explicitly called begininvoke, or updating shared state somewhere). ignoring unhandled exception can dangerous. if have real un-handlable exception (outofmemoryexception comes mind), there's not can anyway , process doomed. back .net 1.1, unhandled exception in backgroundthread thrown , main thread gladly plough on. , have nasty repercussions. in .net 2.0 behavior has changed. now, unhandled exception thrown in thread not main thread terminate process. may notified of (by subscribing event on appdomain) process die nonetheless. since can inconvenient (when don't know run in thread , not absolutely sure it's guard...

.net - DocumentViewer toolbar and context menu -

how hide default toolbar , disallow default context menu of documentviewer control? you can prevent default context menu appearing handling contextmenuopening event, , setting contextmenueventargs.handled true. as toolbar, i'm not sure - maybe somehow change default style of documentview not include toolbar? haven't ever done styles, i'd start looking.

actionscript 3 - Flex: How do you apply a style (from an external CSS) within the init/constructor of a custom as3 component? -

i had custom mxml component, have converted pure as3 component extends canvas. took stylings i.e. alpha, color etc. mxml , added them .css file under /src/assets/. my question is, how apply these styles within custom as3 component i.e. constructor or init()? i read declare style source in mainapp.mxml using <mx:style source="assets/css/swimlanestyle.css"/> . if so, how apply it? the .css example below /* css file */ canvas.roundedcanvasyellow{ backgroundcolor:#ffffcc; cornerradius:5; dropshadowenabled:true; dropshadowcolor:#2a2929; borderstyle:solid; borderthickness:0; backgroundalpha:0.9; } should straight forward doing: this.stylename = "roundedcanvasyellow" (i've used this. in example make clear, wouldn't include in real code). or when create in instance of component programmatically instance.stylename = "roundedcanvasyellow" , or if create instance in mxml set stylename att...

java - detecting server crash during long-polling http request -

i have java client uses httpclient connect server , wait response. response may return after long time (the client waits event server). other using timeouts, there way detect when server crashes? considering server has "crashed" cannot relied upon send message indicating has crashed, no. the solution use timeout, set upper limit on amount of time client willing wait request.

How can I display Word documents in a textarea using PHP? -

i trying test code using com class display word files cannot seem answer , still searching. errors , sometimes, programs not display @ all. please give me ideas. i'm working php 4. if site hosted on windows machine word may able use com extension php give access word documents. using automation methods exposed word's automation model, export word document html , render html frame/div on page. haven't looked @ code or tried it, has created word/php class here: http://www.phpclasses.org/browse/package/3553.html there many others. although have seen code in past read word document directly without use of automation, wouldn't recommend broken new versions or oddities in file format.

cocoa - Why is raising an NSException not bringing down my application? -

the problem i'm writing cocoa application , want raise exceptions crash application noisily. i have following lines in application delegate: [nsexception raise:nsinternalinconsistencyexception format:@"this should crash application."]; abort(); the problem is, don't bring down application - message logged console , app carries on it's merry way. as understand it, whole point of exceptions they're fired under exceptional circumstances. in these circumstances, want application quit in obvious way. , doesn't happen. what i've tried i've tried: -(void)applicationdidfinishlaunching:(nsnotification *)note // ... [self performselectoronmainthread:@selector(crash) withobject:nil waituntildone:yes]; } -(void)crash { [nsexception raise:nsinternalinconsistencyexception format:@"this should crash application."]; abort(); } which doesn't work , -(void)applicationdidfinishlaunching:(nsnotification *)note ...

.net - Remote machines cannot connect to Visual Studio web server -

i remember when ms developing cassini - believe rolled vs 05/08, think cassini web server question. i using windows xp visual studio 2008, , find quite inconvenient when want test web page/styling multiple browsers , multiple oses. right have deploy code on our server, , if there updates need happen, process turns quite time drain. since using xp/iis 5, option of using iis not option. use of iis on xp requires prefix project, breaks links, css etc. quick development project things root dir should pulled out config aren't, quite on board type of solution wasn't implemented in project. seems sketchy ms wouldn't allow simple flag somewhere allow remote connections - quite simple ( http://www.devx.com/dotnet/article/11711 ) don't want recompile cassini. does know how allow integrated development web server in visual studio 2008 seen other computers? save loads of time. just figured out solution: 1) set fiddler on development machine 2) set remote mac...

version control - Delphi: Moving away from VSS -

we team of few delphi developers have been using vss since years (i know it's pity), don't use of advanced features of vcs, working fine in many cases (but times driving me crazy :( ). the thing have vss use third-party plug-ins integrate vss delphi, working great, when our projects becomes larger, , move way vss. i have looked @ few other vcs (free , commercial) , found of them seems made linux guys, , have use command line many admin work(i know i'm windows guy :p). what i'm looking new version control should easy use , maintain , integrated nicely delphi ide (d2007), or @ least have ui admins developers. just use svn , excellent tortoisesvn client integrates windows explorer. p.s. found question: what best set of tools develop win32 delphi applications? , delphi ide/tortoisesvn integration tools in 1 of answers: http://delphiaddinfortortoisesvn.tigris.org/

Alternative IDE for VB6 and VBA -

Image
i've been spoiled visual studio 2008 , eclipse , have little maintainence work on vb6 app. does know of alternative/ updated ide vb6? a rewrite not option i'm fixing couple of bugs , it's big codebase. i have never heard of alternative ide vb6. however, these 2 (free) vb6 add-ins indispensable , make life easier - if there lot of code. equally effective vba in microsoft office. mz-tools : provides superb collection of ide tools - finding unused variables, unused methods, great "search all", code snippets. written carlos j. quintero, whom owe hours , hours of time. http://www.mztools.com/v3/mztools3.aspx and smartindenter , takes care of auto-indenting. 1 thing , well. http://www.oaltd.co.uk/indenter/default.htm

rosetta stone - Palindrome Golf -

the goal: language. smallest function return whether string palindrome. here mine in python : r=lambda s:all(a==b a,b in zip(s,reversed(s))) 50 characters. the accepted answer current smallest 1 - change smaller ones found. please specify language code in. 7 characters in j: not sure if best way, i'm new j :) p=:-:|. explanation: |. reverses input. -: compares. operands implicit. p 'radar' 1 p 'moose' 0

interop - CUDA for .net? -

i know there lot of cuda language bindings, such pycuda, there good bindings .net? 1 i've seen this one , i'd know if there others. here's library: http://sourceforge.net/projects/brahma-fx/ edit : i've been looking @ documentation project listed, , can interface makes me think: point of using .net. project i've listed has cleaner interface no documentation. project listed seems more dedicated in development path ( recent 2.1 release), svn of brahma isn't old (5 wks). another poster listed accelerator framework. looks very promising, although license non-commercial (you must contact them if intend use commercial work), , when installed it, said installed right , can't find on system (this have been vista issue)! edit : have looked various libraries, , can here "recommendations": if planning on using linq , .net 3.5, use brahma. if non-commercial in goal, use accelerator project other poster gave (tim, believe). higher ...

ruby on rails - How do I retrieve relevance value for ThinkingSphinx search results? -

is there way retrieve relevance values results array returned thinkingsphinx? percentages, points or whatever, can work with? yep - can iterate on result set, , retrieve weight each: results = thinkingsphinx::search.search(params[:q]) results.each_with_weighting |result, weight| puts "#{result.name} #{weight}" end

xml - Using XPATH to search text containing &nbsp; -

i use xpather browser check xpath expressions on html page. my end goal use these expressions in selenium testing of user interfaces. i got html file content similar this: <tr> <td>abc</td> <td>&nbsp;</td> </tr> i want select node text containing string " &nbsp; ". with normal string "abc" there no problem. use xpath similar //td[text()="abc"] . when try an xpath //td[text()="&nbsp;"] returns nothing. there special rule concerning texts " & " ? it seems openqa , guys behind selenium, have addressed problem. defined variables explicitely match whitespaces. in case, need use xpath similar //td[text()="${nbsp}"] . i reproduced here text openqa concerning issue (found here ): html automatically normalizes whitespace within elements, ignoring leading/trailing spaces , converting spaces, tabs , newlines single space. when selenium ...

c# - How to convert a Unix timestamp to DateTime and vice versa? -

there example code, starts talking millisecond / nanosecond problems. the same question on msdn, seconds since unix epoch in c# . this i've got far: public double createdepoch { { datetime epoch = new datetime(1970, 1, 1, 0, 0, 0, 0).tolocaltime(); timespan span = (this.created.tolocaltime() - epoch); return span.totalseconds; } set { datetime epoch = new datetime(1970, 1, 1, 0, 0, 0, 0).tolocaltime(); this.created = epoch.addseconds(value); } } here's need: public static datetime unixtimestamptodatetime( double unixtimestamp ) { // unix timestamp seconds past epoch system.datetime dtdatetime = new datetime(1970,1,1,0,0,0,0,system.datetimekind.utc); dtdatetime = dtdatetime.addseconds( unixtimestamp ).tolocaltime(); return dtdatetime; } or, java (which different because timestamp in milliseconds, not seconds): public static datetime javatimestamptodatetime( double javatimestamp ) { // java timestamp mil...

android - Customizing the More menu button icon -

i wondering if possible customize icon used more menu option (displayed when there more 6 menu options)? stock vanilla android ui appears disclosure-type arrow , on htc sense ui it's ellipsis icon. curious if these fixed icons defined in android resources or if there way programmatically set them? any insight appreciated! thanks! justin those system resources - 1 you're referring android.r.ic_menu_more. don't know of way replace them or have menu system use different resource instead.

c# - How can I assign a Func<> conditionally between lambdas using the conditional ternary operator? -

generally, when using conditional operator, here's syntax: int x = 6; int y = x == 6 ? 5 : 9; nothing fancy, pretty straight forward. now, let's try use when assigning lambda func type. let me explain: func<order, bool> predicate = id == null ? p => p.employeeid == null : p => p.employeeid == id; that's same syntax, , should work? right? reason doesn't. compiler gives nice cryptic message: error 1 type of conditional expression cannot determined because there no implicit conversion between 'lambda expression' , 'lambda expression' i went ahead , changed syntax , way did work: func<order, bool> predicate = id == null ? predicate = p => p.employeeid == null : predicate = p => p.employeeid == id; i'm curious why doesn't work first way? (side note: ended not needing code, found out when comparing int value against null, use object.equals) you can convert lambda expressi...

mysql - I am going crazy [syntax error] -

i can't believe having problem. i've been looking , looking can't see wrong. hate error message. you have error in sql syntax; check manual corresponds mysql server version right syntax use near ' poster_ip, message, posted, thread_id posts ' @ line 1 mysql_query("insert poster, poster_ip, message, posted, thread_id posts values ( {$post_info['poster']}, '".mysql_real_escape_string($_server['remote_addr'])."', '".mysql_real_escape_string($post_info['message'])."', {$post_info['posted']}, {$post_info['thread_id']}") or die (mysql_error()); your sql syntax wrong . you should using similar to: insert posts (poster, poster_ip, message, posted, thread_id) values (...)

Duplicate a SharePoint list -

is there way duplicate sharepoint list code wise? judging sharepoint tag, i'm assuming meant ask "how copy sharepoint list (splist) programmatically?" without testing (or trying compile it), like: spweb web; /* add code initialize current web */ splist sourcelist = web.lists["nameofsourcelist"]; sourcelist.saveastemplate("templatefnm.stp", "templist", "templistdescription", true /* include list content */); splisttemplate template = web.listtemplates["templist"]; web.lists.add("newlistname", "newlistdescription", template); web.update(); splist newlist = web.lists["newlistname"]; also, here's link blog post achieves same accross web applications. and word of advice: you'll better search results if use "programmatically" instead of "code wise". hope helps.

VBScript to search two Strings in a TXT -

i try make vbscript read txt , search 2 strings , gives out only last results. string 1: hello123 string 2: test123 the txt looks this: 27.07.2010 09:45 ... dumdumdum ... 27.07.2010 09:45 ... blablabla ... 27.07.2010 09:45 ... hello123 ... 27.07.2010 09:45 ... blablabla ... 27.07.2010 09:45 ... dumdumdum ... 27.07.2010 09:45 ... dumdumdum ... 27.07.2010 09:45 ... hello123 ... 'this result 27.07.2010 09:45 ... blablabla ... 27.07.2010 09:45 ... blablabla ... 27.07.2010 09:45 ... dumdumdum ... 27.07.2010 09:45 ... test123 ... 27.07.2010 09:45 ... dumdumdum ... 27.07.2010 09:45 ... test123 ... 'and result 27.07.2010 09:45 ... dumdumdum ... 27.07.2010 09:45 ... blablabla ... i try this, don't know how this: read txt readall think , search part. if string 1 not found msgbox "nothing found" goto next else if string 2 not found msgbox "nothing found" else msgbox "found" end i...

c# - Converting docx files to WPF Flow Documents -

i'm trying convert bunch of microsoft word documents, containing few pictures , many lines of text , headings flow documents . i found this article useful, couldn't add images form docx files flow documents properly. a sample code or guidance appreciated. this 1 of more popular converters: word xaml converter . ain't perfect, it's great start. there's article on subject @ openxml + flowdocument = openflowdocument? wpf. finally, can check out textglow - although it's silverlight , not using flowdocument, it's see how of conversions linq.

.net - A check for update feature -

i creating small .net 4 application require small frequent updates. there free/cheap services out there provide update feature? or, has developed application? you can use .net application updater component

c++ - How to allocate a memory with execute permissions? -

i want allocate memory execute permissions. use mprotect change permissions.. page aligned memory use valloc function. void * temp = (void *) valloc(x); and then if( mprotect(temp, block_size, (prot_read | prot_write |prot_exec))) { exit(-1); } now want add more memory allocated block. hence use realloc function. void * new_temp = (void *) realloc(temp, 1024); will reallocate automatically change permissions of allocated memory ones had set earlier ?? in case realloc moves entire block different location, permissions of allocated memory earlier , newly allocated memory? should mprotect used again execute permissions memory. , there api realloc on page size boundary valloc . ? try allocating new region valloc , , copying old contents across. better yet, stop using deprecated valloc , , replace either posix_memalign calls, or directly mmap large allocations. using mremap realloc page-aligned memory regions.

linux - Bash Shell Scripting: what simple logic am I missing -

this may generic question but... stumped trying move through directories within shell script. i'm not *nix power user, comfortable working through command line tasks. i'd call script can move 'me' directory instead of script process similar following: prompt:> goto lit where goto alias -> goto='./goscript' and goscript has simple code in such as: cd /path work dirs/lit/user dir (assuming each user has directory inside /lit) i've avoided issue myself setting personal alias' move desired directory, run script, return original directory. question brought me co-worker uses similar method, wanted make process more generic don't need create every single alias need. thought easy problem solve, i'm stumped don't have great deal of shell scripting experience ...as of yet. even better using alias others have described, check out cdpath variable! it's equivalent of path functionality, applied cd command. ...

c++ - Initializing ArcEngine, Make it Faster? -

i working on c++/com project using arcengine(from esri). aside fact there little no support in terms of documentation (sdk there.) anyways, wondering if here has had experience in making initialization process of arcengine faster. right takes 30-35 seconds initialize engine. going running several of these applications. have experience, this? its werid , odd task, esri's developer forums no help. , couldnt find on google. any ideas? it's been decade since last played esri stuff, can't specific arcengine. maybe can pool instances? in best case scenario able reuse arcengine instances, , return instance pool after you're done it. if that's not possible, @ least try have number of instances ready roll, although whether possible and/or useful depends lot on specifics of app.

asp.net - The type 'System.Web.UI.ScriptManager' is ambiguous: it could come from assembly -

when run asp.net app error the type ‘system.web.ui.scriptmanager’ ambiguous: i having same problem person having http://forums.asp.net/t/1313257.aspx , when change 1.0.61025.0 3.5 , re-compile resets 1.0.61025.0 what can resolve this. i've been trying app running hours now. thanks edit ~ helpppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp i see 2 system.web.extensions in gac. tried remove gacutil.exe /u system.web.ext ensions, version=1.0.61025.0, culture=neutral, publickeytoken=31bf3856ad364e35 microsoft (r) .net global assembly cache utility. version 2.0.50727.42 copyright (c) microsoft corporation. rights reserved. unknown option: version=1.0.61025.0 doing wrong. edit ~ solution i went "add remove programs" , un-installed ajax web extensions 2.0 version 1.0.61025.0 it looks (perhaps indirectly) referencing old system.web.extensions dll. check config file , search application "system.web.extensions"...

xml - How to Burn a Data Driven SWF to CD/DVD? -

i have movie made of series of swf files read xml. there way burn cd/dvd or @ least convert 'burnable' format such avi, mpeg, or iso? in order burn have funky screen capture stuff , recorded dvd way. flash cs3 has nifty way export swf (including use scripts) video, reason available when exporting .mov open animation in flash, if don't have .fla available making simple wrapper loads swf should work too. go file -> export -> export movie, , choose quicktime. set various fiddly bits liking, , flash step through animation fast can, saving both risk of dropped frames , having wait 1 fps capture.

python - Turn a string into a valid filename? -

i have string want use filename, want remove characters wouldn't allowed in filenames, using python. i'd rather strict otherwise, let's want retain letters, digits, , small set of other characters "_-.() " . what's elegant solution? the filename needs valid on multiple operating systems (windows, linux , mac os) - it's mp3 file in library song title filename, , shared , backed between 3 machines. you can @ django framework how create "slug" arbitrary text. slug url- , filename- friendly. their template/defaultfilters.py (at around line 183) defines function, slugify , that's gold standard kind of thing. essentially, code following. def slugify(value): """ normalizes string, converts lowercase, removes non-alpha characters, , converts spaces hyphens. """ import unicodedata value = unicodedata.normalize('nfkd', value).encode('ascii', 'ignore')...

c# - When is it better to use String.Format vs string concatenation? -

i've got small piece of code parsing index value determine cell input excel. it's got me thinking... what's difference between xlssheet.write("c" + rowindex.tostring(), null, title); and xlssheet.write(string.format("c{0}", rowindex), null, title); is 1 "better" other? , why? before c# 6 to honest, think first version simpler - although i'd simplify to: xlssheet.write("c" + rowindex, null, title); i suspect other answers may talk performance hit, honest it'll minimal if present @ all - , concatenation version doesn't need parse format string. format strings great purposes of localisation etc, in case concatenation simpler , works well. with c# 6 string interpolation makes lot of things simpler read in c# 6. in case, second code becomes: xlssheet.write($"c{rowindex}", null, title); which best option, imo.

SIP Stack iPhone -

does have docs/guides/code samples on implementing sip based ip or video connection on iphone? looking place start, google not being friendly on one. check out pjsip library hosted on google. http://code.google.com/p/pjsip-iphone-audio-driver/ it's stable, well-tested framework, used in production. voalté generously donated framework oss community. robbie hanson leads project.

user interface - Emulate android preference category look/feel -

i title bar style android preference category. in activity (not preferenceactivity ) how can use same style? since spent last few hours trying answer old question, i'll here else. turns out resource preference category style using listseparatortextviewstyle. you use this: <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="hello, world" style="?android:attr/listseparatortextviewstyle"/> using style="?android:attr/preferencecategorystyle" didn't work.

vba - How to check if a table exists in MS Access for vb macros -

possible duplicate: check if access table exists i'm new vba macros. idea how check if table exists or not? have searched previous posts did not clear solution this. setting reference microsoft access 12.0 object library allows test if table exists using dcount. public function iftableexists(tblname string) boolean if dcount("[name]", "msysobjects", "[name] = '" & tblname & "'") = 1 iftableexists = true end if end function

xsd - How do I set a minimum length for an integer in an XML Schema? -

i in process of creating xml schema , 1 of values year. such, i'd ensure values have 4 characters. so, using following syntax: <xs:element name="publish_year" maxoccurs="1"> <xs:simpletype> <xs:restriction base="xs:positiveinteger"> <xs:totaldigits value="4"/> </xs:restriction> </xs:simpletype> </xs:element> if i'm understanding "totaldigits" correctly, pass in "publish_year" value of "2008" or "200". both valid. such, how can structure xsd ensure 4 digits required? @ first blush, i'm guessing i'd use regex, i'd know if i'm overlooking that's baked in (like "totaldigits") update: i went following solution. may overkill, gets point across: <xs:simpletype> <xs:restriction base="xs:positiveinteger"> <xs:totaldigits value=...

regex - How to find {min,max} repeats regular expression patterns in Visual Studio or SSMS "Find and Replace"? -

i knew have in regular expression syntax world. *the syntax {min,max}, min positive integer number indicating minimum number of matches, , max integer equal or greater min indicating maximum number of matches. so {0,} same , , {1,} same + http://www.regular-expressions.info/repeat.html but how can use in sql server management studio or visual studio "find , replace" window. find related microsoft syntax in msdn . like: [0-9]^4 matches 4-digit sequence. the visual studio regex implementation (in versions until vs 2010) nonstandard 1 least, , doesn't have feature. can spell out: * or @ : match 0 or more of preceding expression + or # : match 1 or more of preceding expression ^n : match n repetitions of preceding expression so a{2,4} you'd have use a^4|a^3|a^2 (see polygenelubricant's comment explanation why need in descending order). more recent versions of vs support entire set of .net regexes.

Is SharePoint uses indexing service of windows? -

let me know if uses built-in service or has own service search in documents? no, sharepoint uses it's own algorithm document search, since windows indexing service doesn't have support file versions, history , such stuff, sharepoint uses it's own service. both services can coexist , operate on same server.

filesystems - How to find the disk that holds a given partition in C#? -

does know way find out programatically physical disk holds given partition? manually, can find info using start->run->diskmgmt.msc , can see (on computer) partitions c: , d: on disk 1, e: & f: on disk 0. this optimizing file crunching operations doing them in parallel if files on different physical disks. you can obtain information using wmi system.management namespace quering win32_diskdrive class. here's basic info wmi in .net.

c++ - Lagging video display using cvShowImage() -

i'm trying display video file @ 25fps smoothly without lag. code below this, achieves 10fps, taking 0.1ms execute. cvwaitkey(1) around 0.03 0.04ms, perfect, named window stays grey , doesn't show video! is because cvshowimage() slow? there other way speed code , output video smoothly? see code below. thanks lot in advance, adrian #include <cv.h> #include <iostream> #include <highgui.h> #include <cxcore.h> #include <cvaux.h> #include <sstream> #include <time.h> using namespace std; using namespace cv; int main(int argc, char** argv) { cvcapture* vid = 0; iplimage* input; //input image int fps; int i=0; clock_t start, end; /*creates gui output processed images*/ cvnamedwindow("video input", 0); /*open input video*/ if (argc!=2) { cout << "please specify input video." << endl; return -1; } else { vid=cvcreatefilecapture(argv[1]); if...

javascript - How to set Date Value for x Axis using gRaphael Line Graph -

i've started use graphael graphing needs , pretty impressed far. however, have run difficulty when producing line graphs, when attempt set values x axis dates, graph fails render. code generate graph is: <script type='text/javascript' charset='utf-8'> var r = raphael('holder'); var lines = r.g.linechart(20, 20, 600, 300, [[1, 2, 3, 4, 5, 6, 7]], [['4.16','6.35','1.77','3.1','9.79','10.03','-0.3']], {nostroke: false, axis: '0 0 1 1', symbol: 'o', smooth: false}).hovercolumn(function () { this.tags = r.set(); (var = 0, ii = this.y.length; < ii; i++) { this.tags.push(r.g.tag(this.x, this.y[i], this.values[i], 160, 10).insertbefore(this).attr([{fill: '#fff'}, {fill: this.symbols[i].attr('fill')}])); } }, function () { this.tags &...

How to Include Multiple Javascript Files in .NET (Like they do in rails) -

i'm jealous of rails guys. can this: <%= javascript_include_tag "all_min" %> ... , i'm stuck doing this: <script src="/public/javascript/jquery/jquery.js" type="text/javascript"></script> <script src="/public/javascript/jquery/jquery.tablesorter.js" type="text/javascript"></script> <script src="/public/javascript/jquery/jquery.tablehover.pack.js" type="text/javascript"></script> <script src="/public/javascript/jquery/jquery.validate.js" type="text/javascript"></script> <script src="/public/javascript/jquery/jquery.form.js" type="text/javascript"></script> <script src="/public/javascript/jquery/application.js" type="text/javascript"></script> are there libraries compress, gzip , combine multiple js files? how css files? also have @ article on codeproject...