Posts

Showing posts from February, 2012

Fastest way to destroy a tree structure in VB6 -

i have code in vb6 creates moderately-large tree structure (a few thousand nodes). performance adequate except when destroying last reference tree. can take second or more. i've tried killing internal references within each node before deleting node itself, doesn't seem help. there trick speed whatever vb6 doing reference counters? there seems significant n^2 aspect performance. incidentally, know vb6 obsolescent, have complaining code wrote quite time ago still in use. btw, tree not binary tree, instead allows each node have arbitrary number of children, held in collection , accessed name (so 1 node might thetree!this!that!theotherthing!whatever, aka thetree("this")("that")("theotherthing")("whatever")). vb6 collection objects notorious being slow release contents, esp when there's lot of contained references. you might try replacement collection, this . there's number of other replacement collections vb6

HTML JSP code creation question -

i have submit button, created - when clicked want groupbox appear below submit button is....any suggestions? i've tried request given of click doesn't me. thought logic similar this: <form> <input type="checkbox" name="group" value="yes" />yes <input type="checkbox" name="group" value="no" /> no <input type="submit" value="submit" /> </form> <% string[] select = request.getparametervalues("group"); /* add code creation here */ %> any suggestions or examples can think of? thanks greatly, u. first replace checkboxes radio buttons. right it's possible check both yes , no . makes no sense. <form> <input type="radio" name="group" value="yes" /> yes <input type="radio" name="group" value="no" /> no <input type="submit"

c++ - #pragma hdrstop -

is there way use pre-compiled headers in vc++ without requiring stdafx.h? regarding first answer question above, i tried implement solution using visual studio 2010, , failed: fatal error c1010: unexpected end of file while looking precompiled header. did forget add '#include "stdafx.h"' source? any ideas? the objective not use #include "stdafx.h" anywhere, instead decide on whether or not use during compile time. if /yc or yu not used, #pragma hdrstop has no effect if yu used, #pragma hdrstop replaced #include "stdafx.h", or @ least thats claimed behavior. the error message indicates had option /yu "stdafx.h" when compiling. answer suggested leave "stdafx.h" part of /yu option blank.

visual studio 2010 - MS Office file diff under TFS -

when compare 2 versions of ms word doc/excel book in team foundation server source explorer, result boring "binary filles differ" dialog. it not have way though. relevant apps (word/excel) have excellent built-in diff interface. can witness when work versioning-enabled sharepoint file library , compare previous version. also, tortoisesvn brings when diffs. question - can enable in tfs? you can configure comparison (diff) , merge tools per file type (extension). available via tools -> options -> source control -> visual studio team foundation server -> configure user tools" button or via command-line tf diff /configure in order set comparison tool, you'll specify extension (use .* if want used files not otherwise specified), operation you're setting (compare or merge), command invoke , arguments command. arguments, variables available use following: %1 = original file (in diff, pre-changes file, in merge, "server" or

c# - Silverlight memories -

why memory in silverlight? data: i having many check boxes , others on user interface sometimes. matter of course, removing check boxes , other controls visuals, memory usage of silverlight increases; never decreases. how ensure memory released? is problem garbage collection? how find root of remaining objects no reference not yet collected? i can provide more data if needed. the memory management engine silverlight uses similar 1 clr uses wpf , other traditional .net applications. based on garbage collection , if maintain references objects, accidentally, prevents them being garbage collected, memory consumption continue increase. if have problem in silverlight application can around leaks or can try use tools leaks , find of memory being allocated. quickest way memory profiler. unfortunately there not lot of memory profilers work silverlight ants profiler, has free trial version, supposedly does: ants memory profiler 7.0

list - Fibonacci sequence value in haskell -

how sum of fibonacci sequence using code: fibs= 0 : 1 : zipwith (+) fibs (tail fibs) edit: take 5 fibs gives list of [0,1,1,2,3], value of 5th element 3, extract have type : 'last(take(5 fibs))' , 3. , on if use interpreter seek 5th element list of [ 0, 1, 2, 3] last element same value of 5th element, how last element of list? can 'make' using last , have ideas, you? i'm not entirely clear you're asking, if have non-empty non-infinite (i.e., not fibs but, example, take n fibs n ) list, can indeed obtain last element applying last it. alternatively, if want n-th element of list (starting @ 0 , assuming list has @ least n+1 elements), can listname !! n extract it.

excel - Help with SUMIF function with CONTAINS functionality -

suppose have following table: state companytypes year sales az a, c 2008 ca b, c, d 2009 tx c 2007 wa a, d 2008 i need fill out sales column, based on sum of sales across company types particular state in particular year. the source table data looks this: year state companytype totalsales 2008 az 100 2008 az c 500 2009 ca b 9000 2009 ca c 15664 2009 ca d 12351 2008 tx c 5 2009 wa 789 i familiar sumif , not know how fill in sales column of first table because of comma separated values in companytypes column. does know?? ray, notice sales table has following property: in each row, state , year combination unique in sense "az" , "2008"

Visual Studio does not create output directory -

i have following lines in vclinkertool section of project: outputfile="$(outdir)\bin\engine.dll" importlibrary="$(outdir)\lib\engine.lib" programdatabasefile="$(outdir)\pdb\engine.pdb" stripprivatesymbols="$(outdir)\pbs\engine.pdb" the directories "bin", "lib", , "pdb" automatically created in $(outdir) directory, "pbs" directory not. any ideas why happening? have no custom-, pre-, or post-build sections. because not stripping private symbols pdbs. you need explicitly set in property pages (linker -> debug) if want pbs versions of pdb files.

java - Overriding methods and threads -

iam having bit of problem question have been asked complete following class. public class updowntrack extends opentrack { //alloweddirection attribute required private traindirection alloweddir; //add constructor set initial state down public updowntrack() { alloweddir = down; } //override usetrack method 1 train @ time //can use track public synchronized void usetrack(traindirection traindir, int id) { try { entertrack(traindir, id); traverse(); exittrack(traindir,id); } catch(exception e) { system.out.println("error" + e); } } // override entertrack method so,a train going in opposite // direction allowed enter track //then display train has entered track public synchronized void entertrack(traindirection traindir, int id) { if(alloweddir != traindir) { try { system.

language agnostic - Create a set of "coupon codes" based on an algorithm; no need to store the codes -

i have situation print out runs of "discount cards" unique code printed on card user can redeem on online store discount. we create many of these cards, few of them being used, i'd use form of way identify valid code using method rather storing each individual code in database. create 5,000 of these codes @ time. 5 times year. ideally i'd able like: $coupons->generate(5000, 'unique_salt', 'prefix_'); which generate 5,000 "random" codes like: prefix-23-3424-4324-3344 or prefix-4h-34re-22k3-pe3w the unique salt , prefix_ saved database. these codes able verified using prefix_ lookup salt , identify code valid or not. i have form of working using number salt, find numbers divisible salt, , reorder digits appears random. long enough codes, take work figure out pattern. i'd think there's better way... there's many numbers yield large amounts of codes divisible salt . (for example, salt of 2 yield 5,000 cod

sql server - sp_dropserver and sp_addserver not working -

i using sql server express 2008 r2 , wanted change instance name "machine name"\sqlexpress2008r2 "machine name". ran: sp_dropserver 'old_name' go sp_addserver 'new_name', 'local' go then restarted sql service. when @ select @@servername --this correct but isn't correct? select serverproperty('servername') --this still shows old name so when try connect instance via ssms still have connect using old instance name isntead of new on applied? doing wrong? why new name not taking? thanks, s this books online: although @@servername function , servername property of serverproperty function may return strings similar formats, information can different. servername property automatically reports changes in network name of computer . in contrast, @@servername not report such changes. @@servername reports changes made local server name using sp_addserver or sp_dropserver stored procedure. and first comm

QuickStart zend -

i following quickstart tutorial. servername "quickstart.local" works fine when click guestbook link "quickstart.local/guestbook" doesn't work , message "an error occurred application error" displayed. idea? tried find answers hard no avail. thanks help make sure resources.frontcontroller.params.displayexceptions = 1 (in config) if don't have logging enabled , should see exception details. modify errorhandler (default: application/controllers/errorcontroller.php) error details emailed you, etc. if using zend studio / eclipse, try using debugger if available.

Rails 3 upgrade: using Prototype + jQuery. Replace instances of '$' in rails.js with 'jQuery?' -

we upgraded rails 3. we replaced default "rails.js" file jquery version. because our legacy app uses prototype , '$' reference, assume need replace '$' references 'jquery' in jquery version of "rails.js." however, have not done so, , seems work fine. moreover, can't find documentation suggesting need to. is necessary? it's not clear how "rails.js" automatically knows use jquery instead of prototype when comes '$' references. usually way done (as mentioned in comment) this: (function($){ $(some_stuff_that_uses_$); })(jquery); this anonymous self-executing function. you're taking anonymous function function($){} , running passing parameter jquery it. quick way make sure jquery code stays separate other frameworks might try use $ . however, think rails.js this...so it's possible won't have anything. it's practice have of jquery files regardless of whether or not have mu

actionmailer - Rails 3 Setting Up Action Mailer -

everything going well... gem 'mail' installed enter > $ rails g scaffold user name:string email:string enter > $ rake db:migrate (fine can see on http://localhost:3000/users/new ) then... enter > $ rails g mailer user_mailer on command huge error - , how resolve it? users/mailer_app/config/initializers/setup_mail.rb:14: uninitialized constant developmentmailinterceptor (nameerror) /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/engine.rb:201 /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/engine.rb:200:in `each' /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/engine.rb:200 /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec' /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run' /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `run_initializers' /opt/local/lib/ruby/gem

How to clear basic authentication details in chrome -

i'm working on site uses basic authentication. using chrome i've logged in using basic auth. want remove basic authentication details browser , try different login. how clear current basic authentication details when using chrome? it seems chrome show login prompt if include username in url e.g. http://me@example.com this not real full solution, see mike's comment below.

nsdictionary - iPhone - Changing a sub-sub-sub NSMutableDictionary value -

if have data tree : nsmutabledictionary (dict1) nsmutabledictionary (dict2) nsmutablearray (array) nsmutabledictionary (dict3) key1 key2 nsmutabledictionary (dict_n) keyn keyn nsmutabledictionary (dict_n) nsmutablearray (array_n) nsmutabledictionary (dict_n) keyn keyn nsmutabledictionary (dict_n) keyn keyn if want change value of key1, there simplier way than... getting dict1 getting dict2 getting array getting dict3 converting dict3 mutable dictionary setting key1 converting array mutable array setting dict3 array converting dict2 mutable dictionary setting array dict2 converting dict1 mutable dictionary setting dict2 dict1 doing each value have change real headache, , code consuming. you can't send message object unless have pointer object, in basic sense answer question no, there's no other way.

c++ - getline wont work in switch and cin does not take the data appropriately? Can anyone help? -

hey guys, im working on project job, cant seem figure out. i need take in make model , years of car particular product fits. program going write file text in outline of html need crucial information inserted correct spots able add products our web page. when use switch statement or if statements separate categories of products, input gets messed , not let me answer 1 of questions. can't use cin because need take dates "2008 - 2009 - 2010 - 2011" here i've got far! 1 regular cin , have tried getline c started yesterday , i'm pretty new forgive me if easy fix, cant find anything. #include <iostream> #include <string> #include <fstream> using namespace std; void proinfo(); int main() { //sytem information system("title beta of product information template version 0.0.2"); //i'm using welcome screen inform users of new improvements on patches , other pertinent information users cout << "welcome

json - JQuery getJSON callback not executing -

it's been while since i've worked front-end, , seem have forgotten all. cannot call bing api work, or . . . $( document ).ready( function() { $.getjson( 'http://api.search.live.net/json.aspx?appid=**my app id**6&query=sushi&sources=web', function( data ) { alert ( 'bam!' ); } ); } ); i've looked @ other questions haven't found works. error log shows nothing. ready function executing, tested that, getjson callback never executes. is possible bing api returning malformed json? you need jsonp-response cross-domain-requests. take @ this: bing search api using jsonp not working, invalid label

php - Zip Code missing leading 0 when retrieved from mySQL tables -

i storing 5 digit zip codes in mysql tables char(5). when zip code leading zeroes (ie. 02138) retrieved tables, becomes 2138. since being stored in tables 02138 (checked phpmyadmin), has php stripping off leading 0? how can make sure retain leading 0? i'm using quite long sql query string using activerecords in codeigniter. foreach($q $row){ /// bunch of code adds more elements $row array $data['rows'][] = $row; } str_pad($zip, 5, 0, str_pad_left);

c# - How to embed SDL video in an existing OpenGL project -

i'm working on opengl game, , play video on 3d surfaces within game. sdl seems excellent choice video playback, possible create surface inside of existing opengl context? how go doing this? sdl has, knowledge, no functions video playback; don't fooled api names sdl_video . used window management. what need using video decoder library decode video image buffers, pass these image buffers opengl texture. open source video player mplayer (which internally uses ffmpeg libavformat , libavcodec libraries video/audio decoding) has opengl video output module. suggest fetch mplayer source code , take opengl video output module, idea how this. edit: since you're using sdldotnet, suggest using sdldotnet.graphics.surfacegl target surface sdldotnet.graphics.movie .

c# - Windows form: Black filled combo and input boxes when run from other machine -

i extract 2003 solution , converted 2005 since im using ide. works fine , edit , run it. ive noticed in gui form1 uses (developer made dll)controls input boxes , comboboxes on ( something control consisting subcontrols ). in contrast newly added windows.form.combobox, is, built-in control windows , plain single control. when im done , finished, passed project in .zip machine , other person tried run there. application working fine all input boxes , combo boxes turns black filled except newly added windows.form.combobox. i dont know if other machine uses vs2003 or 2005. update i guess custom made dll doesnt work in vs 2005 environment. i made new project , compile in vs 2003. (no more conversion vs2005) it works fine on other machine. for answer given ankit: suspect might default color custom controls not set properly. not case since explicitly change default color of custom control , still nothing happens. "it might customized dll compiled lower version w

java - Is there a way (e.g. an Eclipse plugin) to automatically generate a DTO from an Entity (JPA)? -

i plain forward dto generation tool either generate on fly (e.g. cglib - create class , dto object on fly) or eclipse plugin take entity , generate dto (user specify tree graph include, , non included, include foreign keys instead of related entities etc) e.g. take this @entity @table(name="my_entity") public class myentity { @id @generatedvalue(strategy=generationtype.auto) private long id; private string name; @manytoone private relatedentity related; public relatedentity getrelated(){ return related; } ... and generate : @entity @table(name="my_entity") public class myentity imlpements myentitydto { @id @generatedvalue(strategy=generationtype.auto) private long id; private string name; @manytoone private relatedentity related; //overrides myentity interface, it's allowed narrow return type public relatedentity getrelated(){ return related; } ...

What does "String[] args" contain in java? -

when run following program: public class test { public static void main(string[] args) { system.out.println(args); } { it prints: [ljava.lang.string;@153c375 and when run again, prints: [ljava.lang.string;@1d1e730 it gives me different output each time so, " [ljava.lang.string;@153c375 " mean? update : realized never answered question "what “string[] args” contain in java?" :-) it's array of command-line arguments provided program, each argument being string in array. and resume our regularly-scheduled answer... args array . see individual command-line arguments, index array — args[0] , args[1] , etc.: you can loop through args this: public class test { public static void main(string[] args) { int index; (index = 0; index < args.length; ++index) { system.out.println("args[" + index + "]: " + args[index]); } } } for java test 1 2

asp.net - how to save crystal report that converted to pdf in asp .net -

i wrote code converts crystal report pdf, can't store pdf file automatically project. protected void page_load(object sender, eventargs e) { crystalreportviewer1.reportsource = getreportdocument(); crystalreportviewer1.databind(); // report document reportdocument repdoc = getreportdocument(); // stop buffering response response.buffer = false; // clear response content , headers response.clearcontent(); response.clearheaders(); try { // export report response stream in pdf format , file name customers repdoc.exporttohttpresponse(exportformattype.portabledocformat, response, true, "tfa"); // there other format options available such word, excel, cvs, , html in exportformattype enum given crystal reports } catch (exception ex) { console.writeline(ex.message); ex = null; } } private reportdocument getreportdocument() { // file path crystal report string repfilepat

Concatenation php variables: -

i have problem in creating variable in loop , accessing third variable value, did try many way don't know how that.... code is.. $rand_1 = random_username($_post['txtuser_name']); $rand_2 = random_username($_post['txtuser_name']); $rand_3 = random_username($_post['txtuser_name']); $username = ""; for($i=1; $i<=3; ++$i){ $name = "rand_".$i; $username .= $name."<br />"; } echo $username; any suggestion..... try $$name , variable variable . still, when see var_1 etc, means should using array. then make code... $rand = array(); foreach(range(0, 2) $index) { $rand[] = random_username($_post['txtuser_name']); } $username = join('<br />', $rand) . '<br />';

twitter - Streaming API vs Rest API? -

the canonical example here twitter's api. understand conceptually how rest api works, query server particular request in receive response (json, xml, etc), great. however i'm not sure how streaming api works behind scenes. understand how consume it. example twitter listen response. response listen data , in tweets come in chunks. build chunks in string buffer , wait line feed signifies end of tweet. doing make work? let's had bunch of data , wanted setup streaming api locally other people on net consume (just twitter). how done, technologies? node js handle? i'm trying wrap head around doing make thing work. twitter's stream api it's long-running request that's left open, data pushed , when becomes available. the repercussion of server have able deal lots of concurrent open http connections (one per client). lot of existing servers don't manage well, example java servlet engines assign 1 thread per request can (a) quite expens

unix - suppress the output to screen in shell script -

hi have written small script: #!/usr/bin/ksh in *.dat awk 'begin{ofs=fs=","}$3~/^353/{$3="353861958962"}{print}' $i >> $i_changed awk '$3~/^353/' $i_changed >> $i_353 rm -rf $i_changed done exit i tested , wrking fine. giving output screen dont need output screen. need final file made $i_353 how possible? wrap body of script in braces , redirect /dev/null: #!/usr/bin/ksh { in *.dat awk 'begin{ofs=fs=","}$3~/^353/{$3="353861958962"}{print}' $i >> $i_changed awk '$3~/^353/' $i_changed >> $i_353 rm -rf $i_changed done } >/dev/null 2>&1 this sends errors bit-bucket too. may not such idea; if don't want that, remove 2>&1 redirection. also: beware - need use ${i}_changed , ${i}_353 . why output not going files...your variables ${i_changed} , ${i_353} not initialized, , hence redirections don't name file.

plink - Passing shell script file -

i have linux shell script file collects various data linux server. (services, process, freespace etc.). from windows collect data using plink connect linux boxes , run shell script plink root@servername -pw password -noagent -m batch-file. and using pscp copy file windows location. now when try same esxi plink command fails error below. fatal error: server unexpectedly closed network connection though if give direct command below. plink root@servername -pw password -noagent ls /etc works out. let me know how use plink esxi .. if possible. after seeing messages log looks issue esxi's limitation read long character string. message log fails in session string long , post message of closing connection. thus approach copy shell script pscp connection, run file executable permission , collect data gathered , delete file system.

graphics - Android: Is View class appropriate for graphical elements? -

we're designing application displays several hundred graphical elements on single screen need respond touch events , can animated -- however, not full-blown widgets (no focusing , other event handling). view class appropriate this, or there more lightweight class should use? (for familiar qt framework, we're looking qgraphicsitem class) view fine. provides full functionality , flexibility may need obtain graphical elements.

Regex Javascript -

i using below regex in javascript password policy check: ^.*(?=.{8,})(?=.*[a-z])(?=.*[a-z])(?=.*[0-9])(?=.*[@#$_])(?=.*[\d\w]).*$ i tried above regex using online regex checker http://www.nvcc.edu/home/drodgers/ceu/resources/test_regexp.asp test cases passed expected, negative test cases failed. same regex when deployed in application not validate properly. for eg: tracker@123 not work, tracker@123 works asd56544#12 works fine. can please point out what's wrong in regex above? are sure syntax correct? have @ jsfiddle, in test cases pass http://jsfiddle.net/pclpx/

scala - Dynamic Trait NoSuchFieldError @2.9.0RC4 -

is following bug or on purpose? trait dyn { val d1 = new dynamic { def applydynamic(name: string)(args: any*) = "hi" } object d2 extends dynamic { def applydynamic(name: string)(args: any*) = "hey" } } trait t { self: dyn => def foo1 = d1.x def foo2 = d2.x } object t extends t dyn object dyn extends dyn t.d1.x // works dyn.d1.x // works t.foo1 // doesn't work: java.lang.nosuchfielderror: reflpoly$cache1 t.d2.x // works dyn.d2.x // works t.foo2 // works that's instance of bug #4560

c++ - Access a derived private member function from a base class pointer to a derived object -

possible duplicate: why can access derived private member function via base class pointer derived object? #include <iostream> using namespace std; class b { public: virtual void fn1(void) {cout << "class b : fn 1 \n"; } virtual void fn2(void) {cout << "class b : fn 2 \n"; } }; class d: public b { void fn1(void) {cout << "class d : fn 1 \n"; } private: void fn2(void) {cout << "class d : fn 2 \n"; } }; int main(void) { b *p = new d; p->fn1(); p->fn2(); } why p->fn2() call derived class function though fn2 private in d ? access modifiers, such public , private , protected enforced during compilation. when call function through pointer base class, compiler doesn't know pointer points instance of derived class. according rules compiler can infer expression, call valid. it semantic error reduce visibility of member in derived class. modern progra

c# - Windows Phone 7 Information -

i need following information windows phone 7 using c#: in-built storage memory (not ram) phone model operator name whether storage card installed. if yes, capacity of storage card whether carkit, headset, camera, wi-fi, bluetooth available os name (windows phone 7) wi-fi, bluetooth - mac address, h/w & s/w version while apis can used fetch above information windows phone 7? msdn has several pages on subject, not covering of them @ least some. http://msdn.microsoft.com/en-us/library/ff941122%28v=vs.92%29.aspx http://msdn.microsoft.com/en-us/library/microsoft.phone.info.deviceextendedproperties%28v=vs.92%29.aspx

android - Refreshing SQL database -

i'm using databasehelper class load sqlite database. if doesn't exist, create it. xml file used create database in specific folder on sdcard. i reload sql database xml file via menu. have menu setup, can't seem find way reload sql. there easy way without having uninstall app , reinstall removes/recreates database. here's code databasehelper: package samples.myapp; import java.io.file; import java.io.fileinputstream; import java.io.inputstream; import javax.xml.parsers.documentbuilder; import javax.xml.parsers.documentbuilderfactory; import org.w3c.dom.document; import org.w3c.dom.nodelist; import android.content.context; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqliteopenhelper; import android.widget.toast; public class databasehelper extends sqliteopenhelper { public static final string database_name = "projectdocuments"; protected context context; public databasehelper(context context) {

responding to the model's property changes in asp.net mvc2 -

i having model not in ef, in plain text. have have updated events handled each of model's properties can log changes. is there way achieved. implement inotifypropertychanged interface. a simple example: using system.componentmodel; public class mymodel : inotifypropertychanged { string _myproperty; public event propertychangedeventhandler propertychanged; public string myproperty { { return _myproperty; } set { _myproperty = value; notifypropertychanged("myproperty"); } } public void notifypropertychanged(string info) { if (propertychanged != null) { propertychanged(this, new propertychangedeventargs(info)); } } } you can use like... public class test { public static void main() { var model = new mymodel(); model.propertychanged += new propertychangedeventhandler(logchange); model.myprop

html listbox with Vertical scrollbar -

i want create listbox in webpage . listbox whould have vertical scrollbar; 1 item should alowed select; i can kind of listbox applepineapplemango gives me exactlyy listbox vertical scrollbar, when no of items in list box many. allows select multiple items. want 1 item selected thanks or suggestions in advance here go: <select size="5"> <option value="1">item #1</option> <option value="2">item #2</option> <option value="3">item #3</option> <option value="4">item #4</option> <option value="5">item #5</option> <option value="6">item #6</option> <option value="7">item #7</option> </select> live example of this: http://jsfiddle.net/b4rnr/

.net - C# Dataset error -

i have following code: namespace company.project.dataprovider { partial class mydataset { partial class mydatatable { } } } namespace company.project.dataprovider.mydatasettableadapters { public partial class mytableadapter { public int commandtimeout { set { (int = 0; (i < this.commandcollection.length); = (i + 1)) { if ((this.commandcollection[i] != null)) { this.commandcollection[i].commandtimeout = value; } } } } } protected void objectdatasource1_objectcreating (object sender, objectdatasourceeventargs e) { company.project.dataprovider.mydatasettableadapters.mytableadapter = (company.project.dataprovider.mydatasettableadapters.mytableadapter) e.objectinstance; // set comm

How to Play Youtube video in webview in iphone? -

how remove default done button of mpmoviecontroller in iphone? try this, http://iphoneincubator.com/blog/audio-video/how-to-play-youtube-videos-within-an-application http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html

How to get a part of a string from MySQL? -

i have table row id | text 1 | {"category_layout":"","image":"images\/icon-48-info.png"} how can image path text inside brackets? what need this: images/icon-48-info.png (note there 2 slashes in text \ / while need 1 / edit : simple, , found nice solution: $json = $row->text; $obj = json_decode($json); echo $obj->{'image'}; no need regexp or else. read string functions reference , try using regexp or substring_index

a question about Spring controller -

a piece of code this: @controller public class homecontroller { public static final int default_spittles_per_page = 25; private spitterservice spitterservice; @inject public homecontroller(spitterservice spitterservice) { this.spitterservice = spitterservice; } @requestmapping({"/","/home"}) public string showhomepage(map<string, object> model) { model.put("spittles", spitterservice.getrecentspittles(default_spittles_per_page)); return "home"; } } i confused servlet know pass method? in example pass map model showhomepage, want know model , contains in model? the method not need pass model view, servlet implicitly pass argument model view? you should study the extended spring documentation on @requestmapping it explains string returned method interpreted view name, , map passed argument serve enrich model passed view cheers groo

java - eclipse errors when calling methods of imported abstract classes or interfaces from different project -

i've downloaded large project source control includes multuple projects-as i've done before without trouble. class depencies defined , can import packages eclipse without difficulty. this time seem have difficulty communication between projects. errors seem due classes extending/implementing abstract classes or interfaces. if class in 1 project extends or implements class or interface project end getting exceptions when class tries call or override inherited methods. i've checked build path , seems correct, , i'm able import abstract class , interfaces, not use methods them. issues occur when interface or class being implemented exists in different package class implementing it. i've tried refreshing packages, cleaning , rebuilding, , doing rebuild ant scripts, none of these changes seemed help. can suggest may wrong? incidentally when checked out source control think may have gotten of eclipse metadata had been checked in mistake; may explain how ec

sqlite - Android data storage issue -

i have app stores data in sqlite database, when app installed uses 8kb of data , when start inserting data size increases. weird thing when start cleaning database tables, empty database never recover first 8kb of data more, in cases more 100kb, data come from? a database not filesystem, when delete data database, not recover space used. database driver tend prefer keep old allocated space. you can compact database, recover space manually executing sqlite vacuum command. it may possible enable auto_vacuum mode, needs done before database creation.

Reliable encrypted logging for .NET (4.0 - C#)? -

i'm relatively new c# please bear me. looking logging solution project (desktop small business application). know has been asked zillion times, have additional requirements , questions. is there logging tool .net (all of following): - reliable (logging send logger, last exception before crash, log4net doesn't guarantee that) -fast (not blocking caller -> asynchronous) - thread-safe (can called multiple threads @ same time , write 1 file) - encrypts log files (or allows totally custom logging - writes gets, no additional information) -free well, that's list of requirements. know tolls fit? i've read log4net, seems old (uses .net 2.0 , reinvents wheel), nlog sounds promising asynchronous, yet again think can't encrypt. don't know if both of them totally thread safe. should write own little logger? thought making logging thread, list (or queue) of logs, , using locking append list appropriate logs, logging thread convert (probably string, o

r - How to label the barplot in ggplot with the labels in another test result? -

Image
i label plot label output of test, eg., lsd test output (a, b, ab, etc) using lsd.test in library agricolae. here running example. library(ggplot2) library(agricolae) wt<-gl(3,4,108,labels=c("w30","w60","w90")) pl<-gl(3,12,108,labels=c("p0","p1","p2")) gp<-gl(3,36,108,labels=c("a","b","c")) dat<-cbind( a=runif(108), b=runif(108,min=1,max=10), c=runif(108,min=100,max=200), d=runif(108,min=1000,max=1500) ) dat.df<-data.frame(wt,pl,gp,dat) dat.m<-melt(dat.df) ggplot(dat.m,aes(x=wt,y=value,group=pl,facet=gp,fill=pl))+ stat_summary(fun.y=mean,geom="bar",size=2,position="dodge")+ stat_summary(fun.ymin=function(x)(mean(x)-sd(x)/sqrt(length(x))),geom="errorbar", fun.ymax=function(x)(mean(x)+sd(x)/sqrt(length(x))),position="dodge")+ facet_grid(variable~facet,scale="free_y")+ opts(legend.

html - I need a Jquery caroussel that support content of different size -

my problem quite simple. need jquery add-on provide me carousel carousel need support different element size. ex: note following list contain more tant 3 element carousel hide them '''''''''' '''''''''' '''''''''''''''''' ''''''''''''''''''''''''''' '''''''' 'previous' 'element1' ' element2 ' ' element 3 ' ' next ' '''''''''' '''''''''' '''''''''''''''''' '''''''''''''''''''''

mysql - How can I make each row in the resultset returns multiple times? -

i'm writing application uses mysql , tables don't have many data in it. want test how application handles larger amount of data. in order need each row in resultset repeat several times. i know can run query , union same query , union same query. there different way makes easier me choose how many duplications occur? make sure have table insert into to generate dummy data. http://www.generatedata.com generate data insert scripts. then create massive dataset

data synchronization - Sync 2 .net applications -

good morning/afternoon/evening! there 2 systems - crm (customized splendidcrm) и home-brewedmonster (crm+cms+backoffice). crm - asp.net 2.0 website, sql server 2008; implemented using views, stored procedures, triggers; example auditing implemented trigger + sp; website simple ui; ado datasets used dtos home-brewed monster - asp.net 3.5 webapplication, sqlserver 2008; implemented using listtosql; sql server used storage only; logic , auditing implemented in c# code; vs`s designer generated classes used dtos. i need implement 'duplex' synchronization between them: object updated in crm -> changes applied in home-brewed monster object updated in home-brewed monster -> changes applied in crm sync should work in 'almost realtime mode' - delays acceptable. there not data - around 35000 objects , 120000 audit entries now, can 100000 objects. objects not big (60 columns in database). for both systems there api allows updates: web service crm , wcf serv

hibernate - javax.servlet.ServletException: PWC1232: Exceeded maximum depth for nested request dispatches: 20 -

i error when deploy jsf page. use hibernate. want create simple jsp form 1 java class. javax.servlet.servletexception: pwc1232: exceeded maximum depth nested request dispatches: 20 my faces-config.xml : <?xml version="1.0" encoding="utf-8"?> <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xi="http://www.w3.org/2001/xinclude" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> <managed-bean> <managed-bean-name>modeltime</managed-bean-name> <managed-bean-class>org.projet.modeltime</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> <navigation-rule> <display-name> home</display-name> <from-view-id> /index.jsp</from-view-id> &

websocket - How can I code an email client without servers? -

i wanted make own email client . alternative gmail, or own email service. can make own email service without servers ? is there way websockets? you need kind of server listening email connection, recieve mail. so yes need kind of service (which have run on server) listen out email. might need how smtp email connection works first http://en.wikipedia.org/wiki/simple_mail_transfer_protocol this should show process, each mail server goes through send , recieve email. lets careful definition of server here well, listening service need run on somthing has internet connection time. (put simply) just add, question little miss-leading. answers provided should put in right direction.

asp.net - Attached DB Can login but not create user "invalid value for key 'attachdbfilename'" -

i have application running on our server (it works fine on computer not matters). windows server 2003, sql express 2008 r2 server. im using attached db storing users (the asp.net supplied db). i can login web application no problem when try create user says invalid value key 'attachdbfilename' yellow screen of death. here have connection string in web.config <add name="connectionstringaspnetdb.mdf" connectionstring="data source=localhost\sqlexpress_2008;attachdbfilename=|datadirectory|\aspnetdb.mdf;integrated security=true;user instance=true" providername="system.data.sqlclient" /> and membership provider <add name="daganteckning" type="system.web.security.sqlmembershipprovider, system.web, version=2.0.3600.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a" connectionstringname="connectionstringaspnetdb.mdf" enablepasswordretrieval="false"

bug tracking - JVM crashes while executing swing application with native JNI code -

my application using swingworker executing different tasks in turn communicating many third party dlls, attach herewith crash log : please : ___________________________________________________________________ # # fatal error has been detected java runtime environment: # # exception_access_violation (0xc0000005) @ pc=0x6d7e757a, pid=6248, tid=11036 # # jre version: 6.0_22-b04 # java vm: java hotspot(tm) client vm (17.1-b03 mixed mode windows-x86 ) # problematic frame: # c [zip.dll+0x757a] # # if submit bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # crash happened outside java virtual machine in native code. # see problematic frame report bug. # --------------- t h r e d --------------- current thread (0x48f3e400): javathread "awt-eventqueue-0" [_thread_in_native, id=11036, stack(0x49270000,0x492c0000)] siginfo: exceptioncode=0xc0000005, reading address 0xb19d9dc0 registers: eax=0xcc6028cc, ebx=0x492be144, ecx=0x48be3310, edx=0x