Posts

Showing posts from July, 2014

how can i suppress all compiler and code analysis warnings from msbuild at the command line? -

this has been asked , wasn't answered. answer (use /warn:1 ) doesn't work msbuild.exe, csc.exe. perhaps i'm missing between csc , msbuild? i'd suppress compiler warnings , code analysis warnings (e.g. "the variable 'variablenamehere' assigned value ..." or code analysis warning : ca1805 : microsoft.performance : ... ) when i'm using command line msbuild. don't want alter solution file. there several hundred warning messages in large solution i'm building -- fixing them far out of scope project. i tried /v:quiet didn't work. is there way via command line? update: this: c:\windows\microsoft.net\framework\v3.5\msbuild.exe c:\dev\reallybigsolution.sln /p:nowarn=true /p:nowarn=ca1031 absolutely doesn't work . still hundreds of warnings, including 1 blocked (ca1031). using /p:runcodeanalysis=never or /p:runcodeanalysis=false apparently doesn't suppress code analysis warnings or errors. can use nowarn

unix - ar on an existing .a file? -

essentially, want this: gcc foo.c -o foo.o ar rcs foo.a foo.o gcc bar.c -o boo.o ar rcs bar.a bar.o foo.a i want archive both object , static library static library. unfortunately, last command doesn't end containing foo.o (it contains bar.o , foo.a), when linking stage, linker can't find symbols foo.o. is there way want here? i'm doing of out of make, i'm looking solution doesn't involve extracting & re-archiving objects (which seems kinda painful). there way make kind of "archive archive" setup work? actually, not want archive 1 whole '.a' file inside another. might want archive members of 1 archive in other - wholly different operation. the 'ar' program capable of storing source files, gzipped tar files, html files, xml files, , pretty other type of file in '.a' (and '.a' suffix conventional, not mandatory) -- try time. however, treats object files (and object files) specially, , makes them avai

javascript - jQuery get lasted clicked on element...? -

hey, hope can this.. how can previous id of clicked div element using jquery? is possible? e.g. have 2 div's named div1 , div2 , click on div1 on div2 , how can id of div1? many thanks store in variable. var lastclicked = null; $("div").click(function() { if (lastclicked) { // use lastclicked here } // current click stuff lastclicked = this; });

email - PHP SMTP BCC, not going through -

recipients named in bcc/cc (in headers) not received. i've found couple of posts similar questions, no answers... the code below, question is: "have of had similar problems?" require_once "mail.php"; $host = "mail.mailserver.com"; $username = "notification@yourhost.com"; $password = "getyourownpassword"; $headers = array ('from' => "user name <$username>", 'to' => $to_, 'cc' => 'patty <patty@gmail.com>', 'subject' => $subj_, 'content-type' => 'text/html'); $smtp = mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($t

joomla1.5 - CB Joomla Redirect each user to page after login? -

hi there there free cb extension or hack me out redirecting user after login specified page administrator setups user. thanks components, community builder, configuration. on registration tab, can set url of redirection first time logins. otherwise there third-party component: http://extensions.joomla.org/extensions/extension-specific/community-builder-extensions/community-builder-management/11372 that should trick.

javascript - Reaching variables in jQuery -

i have code : <script type="text/javascript"> var currentpicture;//default picture var picel;//the image viewer element jquery("#backimageshower").hover( function(i) { picel = jquery("#dynloadarxdock > img"); currentpicture = picel.attr("src"); picel.attr("src","back.jpg"); }, function() { picel.attr("src",currentpicture); } ); </script> but when run code, says picel not defined. think because of closures code runs : <script type="text/javascript"> var currentpicture;//default picture jquery("#backimageshower").hover( function(i) { currentpicture = jquery("#dynloadarxdock > img").attr("src"); jquery("#dynloadarxdock > img").attr("src","back.jpg");

uml - Visual Studio Diagramming Dependencies -

i dependencies (association, inheritance, etc) represented non-orthogonal lines. how turn off ortho-snap provided default? also, ms says possible visually convert associations properties . more specifically, call "hiding association , inheritance lines." unfortunately, context menu option "hide" not exist, despite claim of documentation. must have "visualization , modelling feature pack 2" make work? the convert associations properties available class diagram ( .cd extension) has been in vs since 2005. new uml class diagram ( .classdiagram extension) part of vs2010 ultimate not provide feature. as non-orthogonal lines (aka straight lines) cannot in vs class diagram (aka class designer) nor can in in vs2010 uml class diagrams. both of these features request feature pack 3 or sp1.

lua - Making an AI - How to make path finding? -

hey, making ai on roblox , can't seem figure out start path finding, common ai feature. can help? p.s. don't know raycasting, can't use option. as suggested, you'll want take @ a* algorithm . it's workhouse of pathfinding. if don't think can that, try simpler. there many techniques out there, including breadcrumb trails pursuing ai characters, example. apply barebones (1,0,0) vector moving right, (-1,0,0) vector moving left, , on @ specific intervals while game running. working first. in case, you'll encounter graphs @ 1 point or while adding pathfinding, read on subject.

Clear PHP CLI output -

i'm trying "live" progress indicator working on php cli app. rather outputting as 1done 2done 3done i rather cleared , showed latest result. system("command \c cls") doesnt work. nor ob_flush(), flush() or else i've found. i'm running windows 7 64 bit ultimate, noticed command line outputs in real time, unexpected. warned me out wouldn't... does... 64 bit perk? cheers help! i want avoid echoing 24 new lines if can. try outputting line of text , terminating "\r" instead of "\n". the "\n" character line-feed goes next line, "\r" return sends cursor position 0 on same line. so can: echo "1done\r"; echo "2done\r"; echo "3done\r"; etc. make sure output spaces before "\r" clear previous contents of line. [edit] optional: interested in history & background? wikipedia has articles on "\n" (line feed) , "\r" (carriage ret

New to C: whats wrong with my program? -

i know way around ruby pretty , teaching myself c starting few toy programs. 1 calculate average of string of numbers enter argument. #include <stdio.h> #include <string.h> main(int argc, char *argv[]) { char *token; int sum = 0; int count = 0; token = strtok(argv[1],","); while (token != null) { count++; sum += (int)*token; token = strtok(null, ","); } printf("avg: %d", sum/count); printf("\n"); return 0; } the output is: mike@sleepycat:~/projects/cee$ ./avg 1,1 avg: 49 which needs adjustment. any improvements , explanation appreciated. in line: sum += (int)*token; casting char int takes ascii value of char . 1, value 49. use atoi function instead: sum += atoi(token); note atoi found in stdlib.h file, you'll need #include well.

C#: How to initialize a generic list via reflection? -

i have list of object properties read xml file , want create object through reflection (not xml serialization). example, have property list<employee> employees { get; set; } i want initialize list follwing xml file: <employees> <employee> <firstname>john</firstname> <lastname>zak</lastname> <age>20</age> </employee> </employees> i create employees object dynamically though e.g. type employees = (type of employees through reflection) object obj = activator.createinstance(employees); my problem how can populate employees list? want in generic way (no cast employee) make code reusable. if understand question correctly, should ( employees , obj variables code): var employee = buildemployeefromxml(); employees.getmethod("add").invoke(obj, new[] {employee}); // repeat above many employee objects have console.writeline(list); the code assumes know how build employee

Which PHP frameworks can handle large scale applications? -

many conversations on frameworks tend discuss ease of use , speed of development. these issues important tend come developers creating new low traffic projects on , on different clients. important in situation able knock out solid solution client in little time possible. myself have operated in area many years , have used many mvc frameworks successes. but when working on single high traffic application several years? ease of use , speed of development start take seat scalability , speed. doesn't matter how easy use or how fast can write code if application won't function because of speed , scale. my question large scale developers out there is, frameworks still useful in situation , if have been used in large scale production situations? common frameworks: zend, symphony, codeignitor, cakephp when comes large applications, it's not framework should concerned about, it's database. first decide database going use, framework has support database. if w

how to create a bar graph in android? -

this question has answer here: any graphing packages android? [closed] 19 answers i have requirement create horizontal bar graph shows comparison between 2 values. need create 2 horizontal bars, first 1 total amount , second 1 consumed amount. could 1 please me suggestions create bar chart in android. forward hearing @ earliest. thanks in advance just check bar chart in android out built in jars . here can draw charts without built in jars. simple graph creation using concept of setting height textview in listview. i implemented using horizontal listview . here have 2 double arrays equal size of elements. , graph adjust according orientation(portrait , landscape). if want more charts in 1 activity, can implement horizontal listview in layout. i hope you....

Python - Find longest (most words) key in dictionary -

is there way query dictionary object in order find key (all keys of string type) words? i.e., if item largest key had 5 words {'this largest key': 3}, how query dict , have int '5' returned? best, georgina max of - count of words per key: max(len(k.split()) k in d.keys())

visual studio 2010 - Where to put content, in Installer project (WiX) or in code project -

so see 2 solutions current problem, wondering pros , cons are, or if there defacto best practices approach. so current project has number of configuration files, files, , other external content. need content local run , debug application. duplicate content in standard windows installer project. bad idea. moving new setup uses wix installer, , i'm setting project next code project , trying figure best way share resources. see 2 solutions. one can put resources in wix project , add them links in code project. way know i'm debugging installer. the other option leave content in code project , path in installer using reference variables. right seems 6 1 way, half dozen other. persuasive arguments either method? assuming these configuration , files going installed in same directory executables put them in code project, mark them content, , add reference code project installer project. if you're using wix 3.5 files automatically included in installer alo

Using old DLLs in C# .Net 4.0 -

this follow question asked yesterday problems using older dlls in visual c# 2010. have added configuration file , dll runs well. issue i'm having avoid having entire project run in legacy mode. i have gone around creating new console project command line access functions need dll , read output in main project. way acts separate component, , don't have worry legacy mode affecting in main project. the problem feel though slow down application in long run, , since developing needs fast, wondering if there approach doing this. mentioned in previous question, cannot rebuild dll in 4.0. thanks, pm sounds misunderstand setting means. doesn't mean project "runs in legacy mode", exact opposite. .net 4.0 clr version used old dll setting. instead of new policy available in 4.0 allows run old version of clr. known in-process side-by-side feature. new policy doesn't support mixed-mode assemblies, that's why complained. you really don'

This doesn't happen often: Why is this JavaScript code only broken in Chrome? -

i've decided i've fallen in love markdown editor on stack overflow. it's fork showdown.js john fraser. want use parser on project of mine, after analyzing source, found bit messy taste. so set modifying javascript code meet needs, namely: getting rid of global variables, combining variable declarations single var per scope, changing concatenation array joins, various other tweaks intended make minified source smaller. i've got working beautifully, except 1 small problem: autocomplete code in command.dolist function wonky in chrome. i've tested work in internet explorer, firefox, , safari. i've isolated matter down following lines: // item prefix - e.g. " 1. " numbered list, " - " bulleted // list. getitemprefix = function () { var prefix; if (isnumberedlist) { // `s` variable string space. prefix = [s, num, '. '].join(''); num++; } else { prefix = [s, bullet,

controls - What is the output of SSCheck.Value in VB6? -

Image
i have third party control sscheck found not supporting in project. maybe dll or ocx corrupt or deleted. didn't exact cause of problem. question is: which built-in control can used replace sscheck control? maybe answer checkbox. if checkbox answer, please suggest me output sscheck.value can adjust code accordingly. the sscheck control checkbox intended replacement or enhancement standard checkbox control in vb6 toolbox. provided part of sheridan sscontrols threed32.ocx, no longer supported . assume why you're running problems it. you're correct in thinking best solution replace these third party controls in application standard controls. particularly in case of sscheck , should straightforward, drop-in replacement. the value property of sscheck control boolean type, meaning takes either "true" or "false" indicators of checked state. however, value property of standard checkbox control takes 1 of following integer values:

python - Concurent Access to datastore in app engine -

i want know if db.run_in_transaction() acts lock data store operations , helps in case of concurrent access on same entity. does in following code guarantied concurrent access not cause race , instead of creating new entity not over-write is db.run_in_transaction() correct/best way so in following code m trying create new unique entity following code def txn(charmer=none): new = none key = my_magic() + random_part() sk = snake.get_by_name(key) if not sk: new = snake(key_name=key, charmer= charmer) new.put() return new db.run_in_transaction(txn, charmer) that safe method. should same name generated twice, 1 entity created. it sounds have looked @ transactions documentation. there more detailed description . check out docs (specifically equivalent code) on model.get_or_insert , answers question asking: the , subsequent (possible) put wrapped in transaction ensure atomicity. ths means get_or_insert() never overw

jquery - To fetch and edit image inside tinymce -

i need find image file path (file_path) available inside tinymce. since using jquery tinymce version. think can find image inside tinymce specified file path. function call thickbox parent window self.parent.edit_img(title,alternate,align,file_path); function declaration in parent function edit_img(title,alternate,align,file_path) { var content=tinymce.get('comment').getcontent(); alert('image path: '+file); alert(content); } help me fetch image inside tinymce , need edit image attributes solution problem here function call thickbox parent window self.parent.edit_img(title,alternate,align,file_path); function declaration in parent function edit_img(title,alternate,align,file_path) { file=decodeuricomponent(file); //to image name image_path file_arr=file.split('/'); file=file_arr[file_arr.length-1]; //checking image inside tinymce , changing edited attributes

Tapestry5 Grid pagination not working in a Tapestry Loop -

currently working on report generation. facing issue pagination using tapestry grid component. for given date search criteria (1-nov-2010 2-nov-2010). using tapestry “loop” component iterate on date range list, internally contains list of transactions per day being displayed using grid component. here grid component configured “rowsperpage=5” pagination. • assume 1-nov-2010, there 11 rows, i.e., displays [1, 2 , 3] pagination links. here pagination works expected. • 2-nov-2010, there 21 rows, i.e., displays [1, 2, 3, 4, 5] pagination links. here on click of pagination link 4 , 5, doesn’t list out next set of rows. in initial investigation observed first grid pagination takes precedence on other grids pagination. would know, if there other configuration available resolve issue or there any other approach/solution there overcome problem. <t:loop source="reports" value="report" encoder="reportencoder"> <t:grid source=&quo

c# - Unable to Open an Excel file using System.Data.OleDb.OleDbConnection -

this question has answer here: excel “external table not in expected format.” 16 answers iam trying open xlsx file (so can create datatable ) iam using the below code. system.data.oledb.oledbconnection oledbcon; system.data.oledb.oledbdataadapter oledbdataad; oledbcon = new system.data.oledb.oledbconnection("provider=microsoft.jet.oledb.4.0;data source='" + filepath + "';extended properties=excel 8.0;"); but when file path contains file extension xlsx , error "external table not in expected format." above code works fine when file of extention xls. do have change connection string ? any ?thanks in advance. changed connection string to public static string connstr = "provider=microsoft.ace.oledb.12.0;data source=" + path + ";extended properties=excel 12.0;";

Google detects invalid keywords on my site -

i have question keywords detection used webmaster tools. google detects invalid keywords on site "to", "for", "and" etc. that words used repeatedly in of internet sites. seems google ignore keywords meta tag. how can fix problem? the keywords meta tag should contain list of keywords related content of site, not sentences or generic words "to" or "for". modern search engines don't take tag account anyway.

A quick way to mock a REST service, for Android/GSon usage? -

we tried wcf , complex, , returns nulls in json, gson chokes on. is there quick , dirty way mock rest service, android/gson usage ? had test rest client on different server responses, ended writing one: https://github.com/mkotsur/restito .

cache control - Who set the If-Modified-Since for request header? -

for static content, such images, css, js, etc, request header if-modified-since set web browser or web server? waiting answer, thanks! set web browser, in http request. the web browser set date cached file, "i have version of file <date>; send me file again if has been modified since then."

opengl - Interpolate camera movement along an arc of circle -

in scene, have camera defined through position , target in 3d space. given center c , 2 points pold , pnew, both @ distance of r center, how can interpolate cameras position in arbitrary amount of steps on arc? my goal perform smooth animation of view around object located @ center point. it's called spherical linear interpolation, , need can find here .

regex - What Delimiter to use for preg_replace in PHP (replace working outside of PHP but not inside) -

myself , team stuck on one, have following code. $text = "lorem ipsum dolor sit amet, consectetur adipiscing elit. ut bibendum augue eu arcu mollis cursus. curabitur nec purus ipsum. fusce ut erat leo, vitae malesuada lacus. quisque varius gravida justo ut aliquam. integer accumsan, ante non volutpat semper, orci sem luctus odio, sit amet convallis odio justo id nisl. nunc sed lacus nisi, quis accumsan massa. donec ante enim, fermentum sit amet placerat nec, eleifend elementum nibh [[blogimage_20090303011757.jpg||480]] dolor nec est. pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. etiam accumsan blandit purus eget vestibulum. nullam neque sem, suscipit sit amet mattis eu, imperdiet quis ligula. integer aliquam dapibus gravida. pellentesque ultrices sapien orci. suspendisse @ eros non dolor accumsan cursus mattis nec justo. [[blogimage_20090303011819.jpg||480]] aenean cursus lacinia arcu vitae malesuada. fusce fermentum enim

graphics - How does Photoshop's magnetic lasso work? -

seems gimp's intelligent scissor based on paper siggraph '95 on "intelligent scissors image composition" , seen in 1 of comments in source. however magnetic lasso in photoshop differs lot, while gimp's tool gives users option click vertices of desired figure , approximates along edges found in image, photoshop's magnetic lasso on other hand, gives users way run freehand , gives between computerized approximation , user desired draw. looking @ behavior quite obvious magnetic lasso style selection quite cool selection in touch based interfaces. pointers on how magnetic lasso differs gimp's tool? specific papers/algorithms into? one algorithm can marching squares .

Populating two dropdown menus in one loop Javascript -

i'm trying populate 2 dropdown menus in javascript numbers within same loop, 1 ever populated (the last one) for (var i=1; i<10; i++) { var option = document.createelement("option"); option.text = i; option.value = i; document.getelementbyid('first').options.add(option); document.getelementbyid('second').options.add(option); } the element 'second' populated, other not, if put 'second' above 'first' 'first' populated. how can without using 2 loops? have tried passing id via function loop , still same output. thanks. little modification in script for (var i=1; i<10; i++) { var option = document.createelement("option"); option.text = i; option.value = i; var newoption = option.clonenode(true); document.getelementbyid('first').options.add(option); document.getelementbyid('second').options.add(newoption);

jboss - org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://schemas.xmlsoap.org/soap/http/ -

in wsdl-file have following line: when deploy webapplication (on jboss 5.1.0) , try access wsdl following exception: org.apache.cxf.busexception: no destinationfactory found namespace http://schemas.xmlsoap.org/soap/http/. org.apache.cxf.transport.destinationfactorymanagerimpl.getdestinationfactory(destinationfactorymanagerimpl.java:115) org.apache.cxf.endpoint.serverimpl.initdestination(serverimpl.java:85) org.apache.cxf.endpoint.serverimpl.<init>(serverimpl.java:69) org.apache.cxf.frontend.serverfactorybean.create(serverfactorybean.java:118) org.apache.cxf.jaxws.jaxwsserverfactorybean.create(jaxwsserverfactorybean.java:167) org.apache.cxf.jaxws.endpointimpl.getserver(endpointimpl.java:346) org.apache.cxf.jaxws.endpointimpl.dopublish(endpointimpl.java:259) org.apache.cxf.jaxws.endpointimpl.publish(endpointimpl.java:209) org.apache.cxf.jaxws.endpointimpl.publish(endpointimpl.java:404) sun.reflect.nativemethodaccessorimpl.invoke0(native method) sun.reflect.nat

artificial intelligence - Pacman Ghost moving in android -

i want play game pacman. there problem exists in moving of pacman ghosts. how can move ghost. use random method moves in same direction or down or left or right. want actual theory behind pacman movement this page has extremely detailed analysis of pac-man information ai of each ghost.

Delphi 2010 lock the menu at the top? -

every often, accidentally move panels @ top of ide. i.e. move file menu don't want, , have move again, need rearrange icons below. are there neat tricks locking top panel never need accidentally move icons , menus again? nobody answer this, found out if install cnpack (cnwizards) option of checking "lock toolbar" http://www.cnpack.org/showdetail.php?id=689&lang=en you many other things, might want disable, show taborder on form etc etc

php - Doctrine - Comma separated values in field -

i'm trying implement doctrine on top of legacy mysql database. wokrs kind great. but... i have events table whitch has following structure: create table `events` ( `uid` int(11) not null auto_increment, -- skipped --- `title` varchar(255) not null default '', `category` text, )... and table categories , whitch has categories. structure like... create table `tx_tendsical_category` ( ... `title` varchar(255) not null default '', ... ) now... category ids stored comma (,) separated values in events.category field. how can setup relations without hassle... need hasmany etc... if having problems database schema, write own hydrators. when you'll have data fetched, parse , return proper object collections.

apache - .htaccess blocking access to PHP page -

i have directory in apache web service. if have no configuration file in can access test.php file in it, add following .htaccess file 404 error. why , needs added or changed in .htaccess file? <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d # note: if added web_prefix config, add here too, e.g.: rewriterule (.*) /shindig/index.php [l] #rewriterule (.*) index.php [l] # oauth signatures work posted data, # always_populate_raw_data needs turned on php_flag always_populate_raw_post_data on php_flag magic_quotes_gpc off </ifmodule> temporarily change [l] [l,r], , see if redirecting. it may need removing / before shindig working.

How to do SVN Update on my project using the command line -

how svn update project using command line? then manage call these command lines c#. i'm .net developer, , i'm using tortoisesvn . svn update /path/to/working/copy if subversion not in path, of course /path/to/subversion/svn update /path/to/working/copy or if in current root directory of svn repo (it contains .svn subfolder), it's simple as svn update

java me - J2ME AES Decryption Error(org.bouncycastle.crypto.InvalidCipherTextException: pad block corrupted) -

i doing encryption , decryption using aes algorithm bouncy castle my encryption , decryption works ok gives me error when plain text size bigger even giving non decrypted data public static boolean setencryptionkey(string keytext) { byte[] keybytes = keytext.getbytes(); key = new keyparameter(keybytes); engine = new aesfastengine(); cipher = new paddedbufferedblockcipher(engine); return true; } encryption: public static string encryptstring(string plaintext) { byte[] plainarray = plaintext.getbytes(); cipher.init(true, key); byte[] cipherbytes = new byte[cipher.getoutputsize(plainarray.length)]; int cipherlength = cipher.processbytes(plainarray, 0, plainarray.length, cipherbytes, 0); cipher.dofinal(cipherbytes, cipherlength); string cipherstring = new string(cipherbytes); return cipherstring; } decryption: public static string decryptstring(string encryptedtext) { byte[] ciphe

certificate - How to view the identity of person who signed the apk on Android device? -

i need view signed application have installed onto device. possible on device or on pc? (assuming can obtain access raw apk file - can, if know or make educated guess of name , location, though can't list contents of /data on non-rooted phone) you open apk zip file , filter ascii text binary content of meta-inf/cert.rsa or using actual tool, jarsigner -verify -certs -verbose some_application.apk of course way verify signer claim else signed same key party via direct or verified means , compare signing key fingerprints - how android verifies app upgrades , app id sharing come same party existing apk target.

c# - How to move object between dictionaries? -

i have simple task need check objects in 1 dictionary , if criteria met move another. asking if there pattern can use language feature achieve that. straight approach simple - use temporaty collection, first step determine canditates, second step actual move. ok not cool. current code class order { public int id; public bool isready; } dictionary<int, order> activedictionary; dictionary<int, order> processeddictionary; public update() { // temporary list, uncool list<order> processed = new list<order>(); // fist step foreach(order ord in activedictionary) { if(ord.isready) { processed.add(ord); } } // ok lets move foreach(order ord in processed) { activedictionary.remove(ord.id); processeddictionary.add(ord.id, ord); } } there nothing wrong code have. as exercise in alternatives, like... processeddictionary = processeddictionary .concat( activedictionary.where(kvp => kvp.value.ready) )

java - How to convert an int[] array to a List? -

i expected code display true : int[] array = {1, 2}; system.out.println(arrays.aslist(array).contains(1)); the arrays.aslist(array) result in singleton list of int[] . it works expect if change int[] integer[] . don't know if helps though.

Open source java library to read outlook emails, calendar etc -

i looking open source java lib read emails, calendar, contacts microsoft outlook. know of these lib or workaround? right requirement read data , present on jsp page. thanks if running on windows can use jawin . open source library wraps com object , provides java api access them. far remember distribution contains example of how connect ms exchange server. other similar packages know jintegra (costs money) jinterop (open source too) both libraries implement dcom protocol in java, can run application uses them on platform , connect exchange server. other way use pop3 or smtp protocol supported exchange. there lot of packages support them, e.g. javamail. and last way: if application running on client side, i.e. on client's computer can parse files created outlook itself. not remember these files stored remember many years ago have discovered issue , saw emails stored in file system in clear text format. edit: found out jacob : other library uses jni

jsf 2 - JSF - Browse and print values from ArrayList<String[]> using EL -

i have arraylist bean : ... public arraylist<string[]> getarticlelist() { ... } ... i need print these values (with getter method) using el on jsf2 (such #{bean.articleslage} how can this? cheers i don't remember if jsf supports arrays, if can convert arraylist<array> arraylist<arraylist<string>> , should work <ui:repeat value="#{bean.articlelist}" var="t"> <ui:repeat value="#{t}" var="s"> #{s} </ui:repeat> </ui:repeat>

c# - Why is my SQL query returning duplicate results? -

the sql below - each result coming 3 times rather once. select consignments.legacyid, tripdate, collectionname, deliveryname, pallets, weight, baserate, consignments.fuelsurcharge, additionalcharges, baserate * quantity 'invoicevalue', consignments.customer, invoicenumber, case when child.legacyid = consignments.customer child.legacyid when parent.legacyid = consignments.customer parent.legacyid else this.legacyid end 'invoiceacc' sageaccount left join sageaccount parent on parent.legacyid = this.invoiceaccount left join sageaccount child on this.legacyid = child.invoiceaccount join consignments on (consignments.customer = this.legacyid , this.customer = 'true') or (consignments.customer = parent.legacyid , parent.customer = 'true') or (consignments.customer = child.legacyid , child.customer = 'true') (this.legacyid = @customer) , (tripdate between @fr

interop - merge word documents to a single document -

i used code in link mentioned below merge word files single file http://devpinoy.org/blogs/keithrull/archive/2007/06/09/updated-how-to-merge-multiple-microsoft-word-documents.aspx however, seeing output file realized unable copy header image in first document. how merge documents preserving format , content. that code inserting page break after each file. since sections control headers, if second or subsequent document has header, you'll wanting keep original section properties, , insert after first document. if @ original document docx, you'll see section document level section properties element. the easiest way around problem may create second section properties element inside last paragraph (which contains header information). should stay there when documents merged (ie other paragraphs added after it). that's theory. see http://www.pcreview.co.uk/forums/thread-898133.php haven't tried it; assumes insertfile behaves expect should.

svn - What are the arguments to put in eclipse subversion merge program arguments to make subversive work with TortoiseMerge? -

Image
what arguments put in eclipse subversion merge program arguments make subversive work tortoisemerge? take @ tortoisemerge command line switches . if using subclipse (which prefer), tells right in dialog. :) i prefer since simpler setup, , has worked solidly me.

SQL Database Design for Test Data -

so, trying learn how set good, , usable databases. have ran problem involving storing large amounts of data correctly. database using mssql 2008. example: we test 50,000 devices week. each 1 of these devices have lot of data associated them. overall, looking @ summary of data calculated raw data. summary easy handle, raw data i'm trying enter database future use in case wants more details. for summary, have database full of tables each set of 50,000 devices. but, each device there data similar this: ("devid") i,v,p i,v,p i,v,p ... ("devid") wl,p wl,p wl,p ... totaling 126 (~882 chars) data points first line , 12000 (~102,000 chars) data points second line. best way store information? create table each , every device (this seems unruly)? there data type can handle info? not sure. thanks! edit: updated ~char count , second line data points. you normalize 1 table create table device ( id bigint auto_increment primary key , devid

plsql - Stored procedure to return a list of sequence IDs -

i need little stored procedure following logic? procedure_name(seq_name in varchar2(50), block_count in int, return_ids out) loop 1 block_count return_ids := select 'seq_name'||.nextval dual; end loop return return_ids basically want have stored procedure lets me pass in sequence name, how many ids need , return me generated listed of ids can use in java. reason me return list of ids can use in java , no 1 else using sequence ids. used in other bulk inserts later down line. in essence, reserve block of sequence ids. here 1 way return array pl/sql procedure. create collection type of numbers, initialize in procedure , populate numbers return. example: create or replace type narray table of number; create or replace procedure get_seq_ids(seq_name in varchar2, block_count in number, return_ids out narray) begin return_ids := narray(); return_ids.extend(block_count); in 1 .. block_count loop execute immediate 'select 

jquery - Dynamically populated table disappearing when triggering update -

using tablesorter first time. have table updated dynamically via ajax. when updated not mean appending removing rows, change status column in table. the sort doesn't seem work correctly after this. suspect need trigger update cache update , tablesorter regcognise change. when call elements in table deleted, header, rows everything. left table tag itself. function updatetablesort() { jquery("#data-table").trigger("update"); var sorting = [[0, 0], [1, 0]]; jquery("#data-table").trigger("sorton", [sorting]); } any ideas? thanks ian seems it's pretty tough, tablesorter not designed that. there's another topic might want have at. i've tried of solutions didn't work. if manage working, tell me :)

vba - Creating an array of arrays of data objects? -

i have data object i have arrays of these data objects i want put these arrays of data objects array dim arrayofdataobjects1(10) new dataobject dim arrayofdataobjects2(10) new dataobject dim arrayofdataobjects3(10) new dataobject 'now, want put of these array, how can i? thanks! edit: know need create array size 3, type define array as? if not concerned type-safety, use variant. example in excel vba: sub a() dim arrayofdataobjects1(10) worksheet dim arrayofdataobjects2(10) worksheet dim arrayofdataobjects3(10) worksheet dim arr(3) variant set arrayofdataobjects1(1) = activesheet arr(1) = arrayofdataobjects1 arr(2) = arrayofdataobjects2 arr(3) = arrayofdataobjects3 msgbox arr(1)(1).name end sub

java - How to override the current system date within junits -

i want curent system date overriden junits.please help. one technique use not call usual date/calendar factory methods/constructors, nor system.getcurrenttimemillis. instead inject date/time "factory," namely interface methods whatever need in way of getting system time. then during test inject instance control directly (hard-coding time, or storing in file, depending on i'm testing). otherwise inject implementation makes appropriate real calls system. it's not work sounds, , makes testing time/date-sensitive code straightforward.

c++ - std::unordered_set constructors -

i've been looking @ constructors of unordered_set. not possible construct unordered_set custom allocator instance without setting number of hash buckets? i'd rather not mess implementation details because want custom allocator, , type provides no definitions default value. msdn gives 3 overloads constructor, none of terribly useful. edit: holy crap. stl implementation of std::hash won't specialize strings custom allocator type- can explicit typedefs std::string , std::wstring. mean, can understand not wanting try hash random character strings, because it's got custom allocator? disgusts me. tokens(std::unordered_set<string>().bucket_count(), std::hash<string>(), std::equal_to<string>(), stl_wrapper::hash_set<string>::allocator_type(this)) template<typename char, typename chartraits, typename allocator> class std::hash<std::basic_string<char, chartraits, allocator>> : public std::unary_function<std::basic_string<

multithreading - C# - Live text feed from one thread to another -

in thread "a", want read long file, , happens, want send each new line read thread "b", -something- them. basically, don't want wait file-loading finish before start processing lines. (i want 2 threads , communication between them; i've never done before , wanna learn) so, how go doing this? thread should wait thread b finish processing "current line", before thread sends line thread b. won't efficient; how buffer in thread b?(to catch lines) also, please give example of methods have use cross thread communication since haven't found/seen useful examples. thank you. first of all, it's not clear 2 threads useful here. single thread reading 1 line @ time (which pretty easy streamreader ) , processing each line go might perform @ least well. file reads buffered, , os can read ahead of code requesting data, in case of reads either complete because next line has been read off disk in advance os, or both of threads have

Objective C: Memory Allocation on stack vs. heap -

i confused when things allocated on heap (and need release them) , when allocated on stack (and don't need relese them). is there rule of thumb? i think in c++ rule of thumb if use new keyword on heap. rule objective c? how can tell when allocated on stack? will line of code allocated on stack? nsstring *user = @"default"; in objective-c, it's easy: objects allocated on heap. the rule is, if call method alloc or new or copy in name (or call retain ), own object, , must release @ point later when done it. there has been plenty written on subject. the example give special case: that's static string, believe located in program's data segment (on heap), it's static don't need worry releasing it.

iPhone Coding: Problem with UITableView selection -

i have strange problem uitableview. want cells in table selectable, such if cell selected, appropriate action executed. cells in table selectable apart cell @ row 0 (the cell @ appears @ top of table). cell not selectable, though has been set allow selection. ideas? - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { tableview.allowsselection = yes; static nsstring *settingstableid = @"settingstableid"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:settingstableid]; if (cell == nil) { cell = [[[uitableviewcell alloc] initwithstyle:uitableviewcellstylevalue1 reuseidentifier: settingstableid] autorelease]; } cell.textlabel.text = [tableheadingsarray objectatindex:row]; cell.accessorytype = uitableviewcellaccessorydisclosureindicator; return cell; } many thanks. sorry everyone, i'm being stupid. :) code in viewcontroller sub-class. copie

ajax - how does Google gmail, docs, etc. get its push-notification of changes? -

i assume there ajax request on client side polls updates, amazingly tight response. can provide more insight tricks may doing in protocol? two methods used in case polling: javascript code polls server every (for instance) 10 seconds see if there fresh news show persistent connection: xmlhttprequest request performed client, , server keeps connection until there news (replies data client in case), or if given time-out reached - client tries again , on. google uses 2nd option, replying , updating faster.

xaml - What is the preferred dpi for Adobe Illustrator when designing for WPF? -

my designer sending me files adobe illustrator 72dpi. i'm having problems when use shapes after importing expression. actual size in expression looks fine - imports @ 72 dpi. shapes bigger on screen when run wpf app however, assume because desktop resolution set 96 dpi. should request designer switch 96dpi? or should take care of how in expression? i realized issue. adobe illustrator files fine. import in expression makes document 72 pixels per inch. going expression , changing document size 96 pixels per inch not indicate change document width/height when hit ok unless tab off of first - got me. have change 96 pixels per inch tab off -expression then suggest new width , height bigger. had manually put was. artwork looks great , xaml i'm extracting looks great in wpf app. in case curious, kiosk app running @ 96dpi. wpf app needs illustrator files.

nhibernate - FluentNhibernate WithTable vs Join -

i'm trying populate property in object via joined table using fluentnhibernate. i'm attempting link outlines: http://www.codeinsanity.com/2009/05/fluentnhibernate-mappings-join.html the problem don't have withtable available method in mapping class. mapping class defined this: public abstract class baseobjectmap<tobject> : classmap<tobject> tobject : baseobject so guess question withtable? i see references using join method. difference between join , withtable? withtable join called 1.5 years ago.

64bit - MongoDB limit storage size? -

what mongodb's storage size limit on 64bit platforms? can mongodb store 500-900 gb of data within 1 instance (node)? largest amount of data you've stored in mongodb, , experience? the "production deployments" page on mongodb's site may of interest you. lots of presentations listed infrastructure information. example: http://blog.wordnik.com/12-months-with-mongodb says they're storing 3 tb per node.

.net - Serialization Circular exception caused by self-referencing Read-only property -

when trying return object json asp.net 3.5sp1 webservice (not wcf, classic asp.net webservice scriptservice attribute), have "a circular reference detected while serializing object of type 'geo.bound'" error, caused self-referencing read-only property : simplified code : namespace geo <datacontract(namespace:="geo", isreference:=true)> _ public class bound <datamember(name:="sw", isrequired:=false)> _ public southwestcoord double public sub new() southwestcoord = 1.5# end sub <ignoredatamember()> _ public readonly property bds() bound return me end end property end class end namespace i want keep read-only property because it's used implementing interface. adding "isreference:=true" attribute bound class changes nothing. if use datacontractjsonserializer (outside context of webservice, exemple : link text ), works , have correct json. if remove "bds" read-only property w

osx - Eclipse workspace as htdocs in XAMPP not working in Mac? -

i've bought macbook air(i've been converted pc guy mac) today , have installed xampp , eclipse mac , try set workspace eclipse htdocs folder in xampp. warning: workspace in use or cannot created, choose different one! the directory try set /applications/xampp/htdocs i've been trying set directory works fine long not 1 above. have done wrong? want directory above. pls. help the solution this: go htdocs folder , hit cmd+i bring "get info" window in window, go bottom right , click on padlock icon, enter password unlock permissions settings in window you'll see list of users , respective permissions. change "admin"'s permission "read & write" click padlock once more save changes , lock permissions htdocs folder start eclipse , select htdocs workspace, , voila! you're done. hope helps.

nhibernate - FluentNhibernate Mapping of lookup table in to properties of Parent Object -

using fluentnhiberante there way map following: parent table (employee) employeeid int primary key firstname lastname employeetypeid lookup table (employeetype) employeetypeid int primary key employeetypedescription my class defined as: public class employee { int employeeid {get; set;} ... string employeetypedescription {get; set;} } is there way via fluentnhibernate mapping populate employeetypedescription property in employee object employeetypedescription table looking using employeetypeid column in employee? i'm pretty sure normal , proper way using references in mapping file , adding employeetype property employee class , accessing description using employee.employeetype.employeetypedescription. i'm unable change code @ time wondering how set employeetypedescription property now. it should possible tweaking examplecode below: public class employeemap : classmap<employee> { public employeemap() { ...

taglib - Struts 1.x tags usage question -

i have jsp page tags: <logic:iterate id="var" ... .... <bean:write name="var" property="p1" ... etc. and need, on each iteration, generate href composed various bean's properties. need urlencode of them link works. something like <logic:iterate id="var" ... .... <html:link action="otheraction.do?_x_ <bean:write name="var" property="p1" ... etc where x generated collecting bean's properties; like string x="p1="+urlencode(p1)+"&p2="+simpledateformatof(p2)+"&p3="+p3; how can ? thanks in advance. better make 1 pojo class. 1. assign values object in action being called before jsp page comes in picture. 2. keep object of pojo request attribute. 3. value request attribtue on jsp using <bean:write> tag.

php - ajaxupload jeditable and zend framework -

i trying use jeditable ajaxupload, can see demo here . using plugin in zend view file follows: js code $(".ajaxupload").editable("<?php echo $this->baseurl('/inside/students/update-student'); ?>", { indicator : "<img src='<?php echo $this->baseurl('img/indicator.gif'); ?>'>", type : 'ajaxupload', submit : 'upload', cancel : 'cancel', tooltip : "click upload..." }); html code <img class="left-floating-image=" src="<?php echo $this->baseurl($this->user['img_path']); ?>" /> <p id="img_path" class="ajaxupload">upload</p> my php code in zend controller: public function updatestudentaction() { $this->_helper->layout->disablelayout(); $this->_helper->viewrenderer->setno

http - Read url to string in few lines of java code -

i'm trying find java's equivalent groovy's: string content = "http://www.google.com".tourl().gettext(); i want read content url string. don't want pollute code buffered streams , loops such simple task. looked apache's httpclient don't see 1 or 2 line implementation. this answer refers older version of java. may want @ ccleve's answer below. here traditional way this: import java.net.*; import java.io.*; public class urlconnectionreader { public static string gettext(string url) throws exception { url website = new url(url); urlconnection connection = website.openconnection(); bufferedreader in = new bufferedreader( new inputstreamreader( connection.getinputstream())); stringbuilder response = new stringbuilder(); string inputline; while ((inputline = in.readline()) != null) response.append

perl - Getting UTF-8 Request Parameter Strings in mod_perl2 -

i'm using mod_perl2 website , use cgi::apache2::wrapper request parameters page (e.g. post data). i've noticed string $req->param("parameter") function returns not utf-8. if use string as-is can end garbled results, need decode using encode::decode_utf8(). there anyway either parameters decoded utf-8 strings or loop through parameters , safely decode them? to parameters decoded, need override behaviour of underlying class apache2::request libapreq2 , losing xs speed advantage. not straightforward possible, unfortunately sabotaged cgi::apache2::wrapper constructor: unless (defined $r , ref($r) , ref($r) eq 'apache2::requestrec') { this wrong oo programming, should say … $r->isa('apache2::requestrec') or perhaps forego class names altogether , test behaviour ( … $r->can('param') ). i say, obstacles, it's not worth it. recommend keep existing solution decodes parameters explicitly. it's clear enough.

C++ Boost random numeric generation problem -

i must generate random number using boost libraries, use code: boost::mt19937 gen; boost::uniform_int<> dist(kuiminmanport, kuimaxmanport); boost::variate_generator< boost::mt19937&, boost::uniform_int<> > var(gen, dist); unsigned int value = (unsigned int)var(); return boost::lexical_cast<std::string>(value); obviously import necessary libraries. code compiles problem obtain same numbers.... ok ok... not worry, not such newbie when talking casual (or better pseudo-casual) number generation. know must provide seed , that, depending on seed, sequence of pseudocasual numbers provided. so code becomes this: boost::mt19937 gen(static_cast<unsigned int>(std::time(0))); boost::uniform_int<> dist(kuiminmanport, kuimaxmanport); boost::variate_generator< boost::mt19937&, boost::uniform_int<> > var(gen, dist); unsigned int value = (unsigned int)var(); return boost::lexical_cast<std::string>(value); well, problem same n

javascript - Custom scrollbar -

is possible replace standard scrollbar (only appearance) custom 1 (the 1 http://scripterlative.com/files/autodivscroll.htm top-left example http://www.dyn-web.com/code/scroll/demos.php?demo=vert ) script still work , scrollbar behave wasn't modified? thanks! webkit supports possible in safari , in chrome. tried once, works well. my problem: doesn't support showing scrollbar @ left or top of container.

Is there a way to use Windows Authentication (Active Directory) for a Git server? -

i have found articles regarding how install git on windows server , use ssh (such copssh) authentication. little surprised remember reading 1 should not use windows machine shared git repository (sorry don't remember read that). question can setup git use windows authentication rather ssh? considerably easier me administer. since machine administered me in "spare time", easier better. you can use shared folder git repository inside domain , administer domain users. c:/> git clone \\myserver\repository\myfolder

c++ - Whats the difference between ofstream "<<" and Write -

i had opened file in binary mode , write file . ofstream ofile("file.txt",ios_base::binary) int = 1; float f = 0.1; string str = 10; ofile<<a<<f<<str; like know difference between writing using "<<" , using "ofile.write" . best , effective write in binary mode. operator<< format data text. whereas write output data in same format it's stored in ram. so, if writing binary files, want use write. however, if writing non-pod types, need careful. can't say: write( &mystring, sizeof(std::string) ); you need have way output actual data, not stored in class or struct itself.

MySQL/PHP Database Normalisation -

im working amongst group of fellow students creating relational mysql database used in conjunction php. we attempting normalise database , differing in opinion. when normalising , creating new table 2 of group, myself included feel best practice foreign key left behind in existing table unique identifier in new table becomes new pk. the remainder of group have been taught/feel should implemented other way, i.e. primary key left behind. could case long relationship present job, or case 1 method correct on other. thanks in advance gary this depends on doing. when removing partial dependency rule is: r = (a, b, c, d) , b makes composite primary key , c dependent on r1 = (a, c) r2 = (a, b, d) if removing transitive dependency then: r = (a, b, c) primary key , c dependent on b r1 = (a, b) r2 = (b, c)

Using Fluent NHibernate with Castle Windsor and the NHibernate Facility -

ive managed fluent nhibernate 1.1 playing nicely castle windsor 2.1. involved me recompiling nhibernate.bytecode.castle.dll , works fine. ive managed same thing time castle windsor 2.5, havent tried yet not complaining enough me @ moment. im using castle nhibernate facility , story. version of nhibernate facility compatible castle 2.5 requires later version of nhibernate. is there easy way nhibernate facility work nhibernate 2.1 , castle core 2.5?

types - typemap rule is confusing -

according mpi 2.2 standard section 4.1: create new data type have define typemap sequence of (type, displacement) pairs. displacements are not required positive, increasing, nor distinct. suppose define typemap of following sequence: {(double, 0), (char,0)} not make sense, yet possible, how can standard provide flexibility? if that's thing find confusing typemaps, you're smarter am. particular example -- c unions this; why shouldn't typemaps allow it?

iphone - positioning frame does not work after move to iOS 4.2 -

i'm having trouble moving view: - (void)viewdidload { cgrect newframe = self.popup.view.frame; newframe.origin.y = self.view.bounds.size.height; self.popup.view.frame = newframe; [[self view] addsubview:[self.popup view]]; [super viewdidload]; } this should put subview popup below current screen not seem moving it. i'm positive working pre-4.2. ideas might going on? sorry vagueness. if have questions feel free ask. did try moving [super viewdidload] top of method? call superclass's method can affect state of inherited vars. good post on this: `[super viewdidload]` convention

c# - ConfigurationManager return null instead of string values -

i trying retrieve values app.config file stored in working directory, when run program returns null. confused why so, , have looked on code many times in attempt spot error. here app.config file code: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appsettings> <add key="provider" value="system.data.sqlclient" /> </appsettings> <connectionstrings> <add name="connection" connectionstring="data source=(local)\sqlexpress;initial catalog=autos;integrated security=true;pooling=false" /> </connectionstrings> </configuration> here c# code: using system; using system.collections.generic; using system.linq; using system.text; using system.configuration; using system.data; using system.data.common; namespace dataproviderfun { class program { static void main(string[] args) { string p = configurationmanager.appsettings["prov

ruby on rails - All day event icalendar gem -

i using below setup event export ical icalendar gem. @calendar = icalendar::calendar.new event = icalendar::event.new event.dtstart = ev.start_at.strftime("%y%m%d") event.dtend = ev.end_at.strftime("%y%m%d") event.summary = ev.summary @calendar.add in order make event day needs this: dtstart;value=date:20101117 dtend;value=date:20101119 right using event.dtstart = "$value=date:"+ev.start_at.strftime("%y%m%d")" this output dtstart:$value=date:20101117 and replace ":$" ";" with @allday = @calendar.to_ical.gsub(":$", ";") is there more direct way save dates day? i played around , figured out 1 way. can assign properties event dates, in form of key-value pairs. assign value property so: event = icalendar::event.new event.dtstart = date.new(2010,12,1) event.dtstart.ical_params = { "value" => "date" } puts event.to_ical # output begin:vevent dtstam