Posts

Showing posts from July, 2010

tfs - Setting up Team foundation server -

i have setup team foundation server company, don't have experience in. the company have 5 or developers using it. is big task or easy (with instructions)? helpful tutorials can recommend? any recommendations on server specs team of 5-10? your first step should download latest tfs installation guide (tfsinstall.chm) here: http://www.microsoft.com/downloads/details.aspx?familyid=ff12844f-398c-4fe9-8b0d-9e84181d9923&displaylang=en you should use tfs 2008 sp1, since latest release , includes many new features , performance improvements. if planning on installing windows 2008 & sql 2008, need "integrate" tfs 2008 sp1 installation disc. instructions included in tfsinstall.chm, martin woodward has walkthrough on blog: http://www.woodwardweb.com/vsts/creating_a_tfs.html (this isn't required sql 2005 sp2 + windows 2003) the install guide has hardware recommendations. for team of size, should consider running tfs instance virtual machine. al...

regex - Emacs query-replace with textual transformation -

i want find text in file matches regexp of form t [a-z] u (i.e., match t followed capital letter , match u , , transform matched text capital letter lowercase. example, regexp x[a-z]y xay becomes xay and xzy becomes xzy emacs' query-replace function allows back-references, afaik not transformation of matched text. there built-in function this? have short elisp function use? update @marcel levy has it: \, in replacement expression introduces (arbitrary?) elisp expression. e.g., solution above is m-x replace-regexp <ret> x\([a-z]\)z <ret> x\,(downcase \1)z it looks steve yegge posted answer few years back: "shiny , new: emacs 22." scroll down "changing case in replacement strings" , you'll see example code using replace-regexp function. the general answer use "\," call lisp expression part of replacement string, in \,(capitalize \1) . reading text, looks it's in interactive mode, seems 1 pla...

c# - What is the overhead cost associated with IoC containers like StructureMap? -

after attending recent alt.net group on ioc, got thinking tools available , how might work. structuremap in particular uses both attributes , bootstrapper concepts map requests ithing concretething . attributes automatically throw flags me either reflection or il injection going on. know how works (for structuremap or other ioc tools) , associated overhead might either @ run-time or compile-time? i can't other ioc toolkits use spring.net , have found there 1 off initial performance penalty @ startup. once container has been configured application runs unaffected.

.net - WPF Application fails on startup with TypeInitializationException -

i have simple wpf application trying start. following microsoft patterns , practices "composite application guidance wpf". i've followed instructions wpf application fails "typeinitializationexception". the innerexception property reveals "the type initializer 'system.windows.navigation.baseurihelper' threw exception." here app.xaml: <application x:class="mynamespace.app" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <application.resources> </application.resources> </application> and here app.xaml.cs (exception thrown @ "public app()"): public partial class app : application { public app() { bootstrapper bootstrapper = new bootstrapper(); bootstrapper.run(); } } i have set "app" class startup object in project. what going ast...

Painless resource management in java -

in c++ acquiring resource in constructor , release in destructor. so when exception rises in middle of function there no resource leak or locked mutexes or whatever. afaik java classes don't have destructors. how 1 resource management in java. for example: public int foo() { resource f = new resource(); dosomething(f); f.release(); } how can 1 release resource if dosomething throws exception? can't put try\catch blocks on code, can we? yes can , should put try/catch/finally block around code. in c# there shorthand "using" statement, in java stuck with: public int foo() { resource f = new resource(); try { dosomething(f); } { f.release(); } }

What is the best way to do per-user database connections in Rails -

what best way per-user database connections in rails ? i realize poor rails design practice, we're gradually replacing existing web application uses 1 database per user. complete redesign/rewrite not feasible. put in application controller. i'm using subdomain plus "_clientdb" pick name of database. have databases using same username , password, can grab db config file. hope helps! class applicationcontroller < actioncontroller::base before_filter :hijack_db def hijack_db db_name = request.subdomains.first + "_clientdb" # lets manually connect proper db activerecord::base.establish_connection( :adapter => activerecord::base.configurations[env["rails_env"]]['adapter'], :host => activerecord::base.configurations[env["rails_env"]]['host'], :username => activerecord::base.configurations[env["rails_env"]]['username'], :password =...

PDF Creator and Reader in PHP -

i want make online pdf creator , reader in php support features available in adobe acrobat bookmarking, signing, commenting, editing, header , footer, watermark etc etc.. can please suggest me php library me that? google search led me http://davidwalsh.name/read-pdf-doc-file-php reading pdf, creating pdf use tcpdf , best free 1 have used although font files large library.

sql - Ambiguity in Left joins (oracle only?) -

my boss found bug in query created, , don't understand reasoning behind bug, although query results prove he's correct. here's query (simplified version) before fix: select ptno,ptnm,catcd parts left join categories on (categories.catcd=parts.catcd); and here after fix: select ptno,ptnm,parts.catcd parts left join categories on (categories.catcd=parts.catcd); the bug was, null values being shown column catcd, i.e. query results included results table categories instead of parts. here's don't understand: if there ambiguity in original query, why didn't oracle throw error? far understood, in case of left joins, "main" table in query (parts) has precedence in ambiguity. wrong, or not thinking problem correctly? update: here's revised example, ambiguity error not thrown: create table parts (ptno number, catcd number, seccd number); create table categories(catcd number); create table sections(seccd number, catcd number); sele...

email - send mail from client and server in php -

i have request form in site. submit form in php mail send server.i need code mail send server , "thank request" mail send client @ time . example: <?php ob_start(); $namecp = $_post['namecp']; $namec = $_post['namec']; $mobile = $_post['mobile']; $lname = $_post['lname']; $problem = $_post['problem']; $failure_date = $_post['failure_date']; $failure_hours = $_post['failure_hours']; $failure_minutes = $_post['failure_minutes']; $failure_sec = $_post['failure_sec']; $service_required_date = $_post['service_required_date']; $service_hours = $_post['service_hours']; $service_minutes = $_post['service_minutes']; $service_sec = $_post['service_sec']; $door_no = $_post['door_no']; $area_nagar = $_post['area_nagar']; $city = $_post['city']; $state_district = $_post['state_district']; $postal_code = $_post['postal_code']; $en...

excel - Save each sheet in a workbook to separate CSV files -

how save each sheet in excel workbook separate csv files macro? i have excel multiple sheets , looking macro save each sheet separate csv (comma separated file) . excel not allow save sheets different csv files. here 1 give visual file chooser pick folder want save files , lets choose csv delimiter (i use pipes '|' because fields contain commas , don't want deal quotes): ' ---------------------- directory choosing helper functions ----------------------- ' excel , vba not provide convenient directory chooser or file chooser ' dialogs, these functions provide reference system dll ' necessary capabilities private type browseinfo ' used function getfoldername howner long pidlroot long pszdisplayname string lpsztitle string ulflags long lpfn long lparam long iimage long end type private declare function shgetpathfromidlist lib "shell32.dll" _ alias ...

java - Can eclipse automatically rename the unit test class when the class under test is renamed? -

i use refactor -> rename functionality in eclipse , have habit of naming associated unit test testedclassnametest. when rename tested class must not forget rename unittest. extremely useful rename unit test automatically when tested class renamed. i guess wouldn't difficult create plugin job maybe isn't necessary? after several googling , eclipse searches, seems such feature not yet available. today there no notion of "class being unit tested" in eclipse. mean here, can create unit test classes testing want: full package, single class, single method, full plugin .... to more accurate, there "no relation in eclipse's model" between tested class , associated unit test. i totally agree nice such feature in eclipse. go further cool able generate unit tests skeletons , have these tests classes linked tested ones. may can laucnh discussion on eclipse buzilla, maybe in pde category. manu

linux - generate image (e.g. jpg) of a web page? -

i want create image web page looks like, e.g. create small thumbnail of html + images. not have perfect (e.g. flash /javascript rendering). i call use code on linux, ideally java library, command line tool cool well. any ideas? try cutycapt , command-line utility. uses webkit rendering , outputs in various formats (svg, png, etc.).

Ada: interfacing with Matlab -

since ada doesn't possess libraries scientific computing, wondering if has been able use matlab mathematical functions such eig (for calculations of eigenvalues , eigenvectors) within ada. i see interfaces exist simulink , ada. i'm not user of simulink. able use matlab mathematical functions through perhaps ada functions , procedures. ps: in earlier ada documents there lots of talks , promises create numerical libraries similar nag or numal. wonder why has never been concretized successfully, , , robust scientific computing library made available. sure ada language doesn't pale before other scientific computing language in opinion. thanks lot... i can't find it, indeed bit surprising. if has c interface, possible write own bindings routines need. use interfacing pragmas . types defined in package ada.interfaces.c of help. getting things linking , tested on custom binding can wee bit of challenge though. also, looks recent versions of gnat come bi...

iphone - CALayer or UIView backgroundColor UIImage on iOS 4 -

good day all; i not sure has changed prevent working. on ios 3 sdk, following code worked fine in catiledlayer class: - (void)drawincontext:(cgcontextref)context { uiimage* image = [[resourcesmanager sharedresourcesmanager] getuiimagefromarray:image_cell_background index:[mazecell zone]]; uicolor* color = [[uicolor alloc] initwithpatternimage:image]; [self setbackgroundcolor:[color cgcolor]]; [color release]; however, compiling ios 4 , executing on simulator fails render image. baffled since images added sublayers render fine. background doesn't render. ok after spending few days on have come work-around. firstly, tried doing in uiview , still had same issues. tried other types of gui components have backgroundcolor property. they produced same issue. can tell, appears bug , new image loading / caching process implemented interprets whether or not use hd or sd graphics. basically, workaround load background image subview or sublayer (de...

visual studio 2008 - Why would breakpoints in VS2008 stop working? -

i have c# asp.net web app. breakpoints in database layer no longer stopping execution breakpoints in ui layer still working okay. can hazard guess why might happening? i've checked usual suspects (debug build on projects) , recompiled projects in solution... i ensure ui layer referencing appropriate 'debug' .dll's. i'd consider pressing ctrl+alt+u ( modules view ) when you're debugging see if symbols loaded bll , dal .dlls. if not visual studio unable find .pdbs file. debug files (.pdbs) in same directory .dlls being referenced modules window?

How to reset the mockrepository object to call the original method after all the calls in mocks.record() are made? -

i have .net 3.5 win form application 3 classes login.cs,main.cs,dbtansaction.cs. writing testcase main.cs makes calls dbtransaction.cs. mocked dbtransaction.cs return diff values each call , works fine. after testcase run in teardown, close application calls login.cs check if user allowed close application. login.cs makes call dbtransaction.cs , since mocked class in testcase throws exception saying unexpected call. how reset mock objec redirect original dbtransactio.cs when called teardown. thanks if you're writing unit test main.cs, of dependencies (login , dbtransaction) should mocked. you're mocking dbtransation. suggest mock out login don't have worry any external dependencies in tests.

android - Way to get accelerometer reading every x seconds? -

to able accurate calculations want app, need able accelerometer reading every 100ms. haven't found way on android, seems way accelerometer readings put listener can listen @ different intervals. basically, there way reading @ exact intervals? -jake i register accelerator listener , in listener, read system time , if 1 second passed, can update further methods.

file - Get FCIV (or same) checksum in VBA -

how can execute fciv , obtain hash file using vba? every pure vba implementation have seen has been painfully slow (sometimes on minute per file). there may way tapping windows com library not aware of such method. (i hope someome knows of 1 though , you'll see why in second:)) best have been able come ugly workaound following suggestion may not suitable in scenarios there very fast command line utility available ms here: http://support.microsoft.com/kb/841290 . utility md5 , sha1. although site says it's windows xp can verify works versions through , including windows 7. haven't tried on 64 bit though. a few caveats: 1. utility unsupported. have never had issues it. it's still consideration. 2. utility have present on machine intended run code on , may not feasible in circumstances. 3. bit of hack/kludge may want test little error conditions etc. 4. banged together. haven't tested it/worked it. take 3 seriously:) option explicit public en...

Nhibernate <version> feature not working -

i have started working nhibernate. have found pretty till have hit issue unable solve. appreciated. i trying use "version" feature implement optmistic locking. below mapping file , portion of code related class. problem no matter how many times modify field, "version" column on database not updated. my mapping file: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="mytest" assembly ="mytest"> <class name="project" table="dbo.m_project"> <id name="projectid" type="int32" unsaved-value="null"> <column name="projectid" sql-type="int" not-null="true" unique="true" /> <generator class="native" /> </id> <version name="version" column="vers...

iphone - What is the best way for a view added via presentModalViewController to communicate its dismissal with the class which invoked the call? -

what best way view added via presentmodalviewcontroller communicate dismissal class invoked call? in 1 of methods, use presentmodalviewcontroller:animated: popup scoreboard player enters name, clicks ok. working fine scoreboard, when use dissmissmodaleviewcontroller i'd way class called presentmodeviewcontroller display alert. i tried following in method called presentmodalviewcontroller: [self presentmodalviewcontroller:"mynib" animated:yes]; [alert show]; but alert code runs after presentmodalviewcontroller runs, assume when presentmodalviewcontroller called, doesn't stop code executing outside of it. anyway, need alert options handled within class calls presentmodalviewcontroller, best way go it? in opinion best implementing protocol , suscribe caller class delegate of scoreview, try implementing in scoreview header file: @portocol scoreviewdelegate <nsobject> - (void)userdidenterdata:(nsstring *)data; @end @interface scoreview:.....

linq - Sum of items in a collection -

using linq sql, have order class collection of orderdetails. order details has property called linetotal gets qnty x itemprice. i know how new linq query of database find order total, have collection of orderdetails db, there simple method return sum of linetotal directly collection? i'd add order total property of order class. imagine loop through collection , calculate sum each order.orderdetail, i'm guessing there better way. you can linq objects , use linq calculate totals: decimal sumlinetotal = (from od in orderdetailscollection select od.linetotal).sum(); you can use lambda-expressions this, bit "cleaner". decimal sumlinetotal = orderdetailscollection.sum(od => od.linetotal); you can hook order-class if want: public partial class order { ... public decimal linetotal { { return orderdetailscollection.sum(od => od.linetotal); } } }

jrubyonrails - Braces: [Brackets], (Parentheses) & {Curlies} in Ruby & Rails -

so loose tolerance of ruby use braces sometimes , not require them has led alot of confusion me i'm trying learn rails , when/where use each , why? sometimes parameters or values passed (@user, @comment) , other times seem [ :user => comment ] , still others it's just: :action => 'edit' i'm talking of [ ] vs ( ) vs { } what rules? , there tricks have remember? parentheses () grouping logical or mathematical expressions , grouping arguments function call, e.g.: a = 2 * (3 + 4) b = (x==y) || (m==n) hash.new.send('[]=', :a, :b) curly braces {} used hash literals , blocks, e.g.: h = {1=>2, 2=>3} h.each {|k,v| puts k+v} square brackets [] used array literals, array indexing , slicing, , fetching hash, e.g.: arr = [1, 2, 3] 2 = arr[1] 3 = h[2] to confuse matter, hash literals can used in-place argument method call without needing curly braces or parentheses long last argument (thanks samuil). additionally, hash l...

object pool vs connection pool -

what exact difference between object pool , connection pool? there difference in algorithm utilizing memory. msdn says "object pooling lets control number of connections use, opposed connection pooling, control maximum number reached." mean? please me clarify above. a connection pool object pool contains connection objects. "object pooling lets control number of connections use, opposed connection pooling, control maximum number reached." an object pool allows application limit number of instances in use @ 1 time. if application needs more instances limit, object pool has decide how deal problem. there number of possible strategies: return null throw exception block until instance available increase size of pool a connection pool object pool, has same decision make. a specific implementation of object pool (or connection pool) use 1 of these strategies, or several in combination. in opinion statement quoted misleading unless tal...

php - yiiadmin - many-to-many in yii-framework admin interface -

i extending yii-s admin extension, yiiadmin. what easiest way listbox multiple-select field in model-create view, display many-to-many relation, example have 'pivot' table holds these article-category relationships, along article , category tables. i have these relations defined in models, , managed other relations list view, author.name acquired through author_id field in article table. now want article creation form contain multiple select listbox save pivot table automatically multiple choices of categories article belongs to. those be, therefore, multiple entries/rows article_category pivot table 1 article submission. at same time, article table not contain field refers category. pivot table therefore picks article's id attribute , connects categorie's (another model/table) id , makes row out of this. so, example, have these tables/models: article >>> id | title | author | text category >>> id | name | description a...

debugging - IIS crashes when serving an ASP.NET application under heavy load. How to troubleshoot it? -

i working on asp.net web application, seems working when try debug in visual studio. when emulate heavy load, iis crashes without trace -- log entry in system journal generic, "the world wide web publishing service terminated unexpectedly. has done 4 time(s)." how possible more information iis troubleshoot problem? download debugging tools windows: http://www.microsoft.com/whdc/devtools/debugging/default.mspx debugging tools windows has has script (adplus) allows create dumps when process crashes: http://support.microsoft.com/kb/286350 the command should (if using iis6): cscript adplus.vbs -crash -pn w3wp.exe this command attach debugger worker process. when crash occurs generate dump (a *.dmp file). you can open in windbg (also included in debugging tools windows). file > open crash dump... by default, windbg show (next command line) thread process crashed. the first thing need in windbg load .net framework extensions: .loadby sos mscorwks t...

c# - MVC 2 routes appearing as parameters -

i trying build route format of {controller}{action}{classificationid}{reviewid}{categoryid}\ but want able address without final categoryid , have default 1 isn't given. here routes: routes.maproute( "default", // route name "{controller}/{action}/{id}", // url parameters new { controller = "home", action = "index", id = urlparameter.optional } // parameter defaults ); routes.maproute( "schoolroutenocategory", // route name "{controller}/{action}/{classificationid}/{reviewid}/", // url parameters new { controller = "school", action = "edit", classificationid = "sbp", reviewid = "sar" } // parameter defaults ); routes.maproute( "schoolroute", // route name "{controller}/{action}/{schoolid}/{reviewid}/{categoryid}/", //...

soap - Is there a way to tell WCF to use security in the request, but ignore it on the response? -

we have connect third party soap service , using wcf so. service developed using apache axis, , have no control on it, , have no influence change how works. problem seeing expects requests formatted using web services security, doing correct signing, etc. response 3rd party however, not secured. if sniff wire, see response coming fine (albeit without timestamp, signature etc.). underlying .net components throw error because sees security issue, don't receive soap response such. there way configure wcf framework sending secure requests, not expect security fields in response? looking @ oasis specs, doesn't appear mandate responses must secure. for information, here's exception see: the exception receive is: system.servicemodel.security.messagesecurityexception caught message="security processor unable find security header in message. might because message unsecured fault or because there binding mismatch between communicating parties. can occur if ser...

database - Surrogate vs. natural/business keys -

here go again, old argument still arises... would better have business key primary key, or rather have surrogate id (i.e. sql server identity) unique constraint on business key field? please, provide examples or proof support theory. both. have cake , eat it. remember there nothing special primary key, except labelled such. nothing more not null unique constraint, , table can have more one. if use surrogate key, still want business key ensure uniqueness according business rules.

Parse XML using LINQ to SQL -

im trying parse following xml using linq-to-sql visual studio doesn't seem want play ball. i've tried using xelement , xdocument , tried selecting root node or api_item node directly, doesn't seem happen me. can advise bit of linq-to-xml? i've tried following (and many variations of it!) no avail. (note: e.result contains xml string) var deals = el in xelement.parse(e.result).elements("api_response").elements("deals").elements("api_item") select new { title = el.element("title").value, description = el.element("description").value }; thanks! (heres snippet of xml coming api) <?xml version="1.0" ?> - <api_response> - <deals> - <api_item> <title>palit geforce gtx460 768mb: £143.56 @ cclonline</title> ...

terminology - What does the term Plain Old Java Object (POJO) exactly mean? -

what term plain old java object (pojo) mean? couldn't find explanatory enough. pojo's wikipedia page says pojo ordinary java object , not special object. now, makes or doesn't make , object special in java? the above page says pojo should not have extend prespecified classes, implement prespecified interfaces or contain prespecified annotations. mean pojos not allowed implement interfaces serializable , comparable or classes applets or other user-written class/interfaces? also, above policy (no extending, no implementing) means not allowed use external libraries? where pojos used? edit: more specific, allowed extend/implement classes/interfaces part of java or external libraries? plain old java object name used emphasize given object ordinary java object, not special object such defined ejb 2 framework. class {} class b extends/implements c {} note: b non pojo when c kind of distributed framework class or ifc. e.g. javax.servlet.http.httpse...

web services - Automated testing of FLEX based applications -

what tools, preferably open source, recommended driving automated test suite on flex based web application? same tool having built in capabilities drive web services nice. adobe distributes test framework themselves: flexunit .

cocoa touch - Get a file from iPhone -

i have program creates files in application's documents directory. need files device debugging. how can it? i looking way not need jailbreaking, partly because have figure out million letter directory attack, , partly because talking cupertino in near future. i sure common issue. example in games it's necessary see save-file. you access through organizer : xcode > window > organizer or access programmatically.

iphone - New NSString substringWithRange: Error Message -

i'm getting interesting new error ios 4: -[nscfstring substringwithrange:]: invalid range {11, 4294967295}; become exception apps linked on snowleopard. warning shown once per app execution. the error caused snippet of code got blog post helps title case string, , it's not going hard fix, haven't seen mentioned anywhere else, , i'm assuming apple wants people stop using magic 4294967295 number. does know history / background of change? edit: source title case code located at: http://vengefulcow.com/titlecase/ it's objective-c port (obviously). line 116 offender. it's problem under specific condition. i'm still tracking down. unsigned 4294967295 same signed uint32_t value -1. i've seen problems 32 bit app archived -1 , 64 bit app unarchived big ass length (terribly fun when xcode calling malloc(4294967295) during 64-bit bring-up). the cocoa frameworks detecting passed in range length longer string itself. warning now, truncated...

sql server - Crystal Report 9 is displaying only the 1st record if records vary only by millisecond -

i using sql sever 2005, vc 6 ++ , crsystal report api print report in child window. if records vary only milliseconds , crystal report showing 1st record . otherwise, fine. i picking timestamp sql server datetime field. in formula inside crystal report, giving following expression tablename.timestampfield . the field format timestamp field mm/dd/yyyy hh:mm:ss (in 24 hrs) can please tell change need make records displayed? note:- if run same sql query give crystal report in sql server, gives me records. new ---- edited after posting question..... i want make change in crystal report. actaull, records inside cystal report being supprested based on following formala: if not previousisnull ({table.timestamp}) if {table.timestamp} = previous ({table.timestamp}) , {table.object_id} = previous ({table.object_id}) true somehow, cystal report comparing timestamp field till seconds. can tell me how force crystal report consider milliseconds whi...

internet explorer - IE Automation Book or Resource?? using MSHTML/ShDocVw VB.Net -

can recommend book or website explains internet explorer automation using vb.net? understand mshtml , shdocvw.dll can this, need resource explain me. want read/write values click buttons. the book have come across far .net test automation recipes. 1 me? thanks! you can take @ watin if want source code goes in depth in terms of automating ie. in fact may trying do.

C++ linker error after change in thrift file -

i think related c++ linker error thrift. made change thrift file , regenerated cpp & java classes. after change, started getting linker errors in cpp. here error undefined symbols: "com::xxxx::thrift::employee::savingsinfo::operator<(com::xxxx::thrift::employee::savingsinfo const&) const", referenced from: std::less::operator()(com::xxxx::thrift::employee::savingsinfo const&, com::xxxx::thrift::employee::savingsinfo const&) constin employee_types.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [thriftcppsamples] error 1 i added savingsinfo type thrift file, change made. give options mentioned in doc g++. gave -i/usr/local/include/thrift , -i/path-to-boost , -l/path-to-boost-lib , -lthrift . after change started getting above linker error. couldn't understand reason this. error points generated thrift. reason error? this error "operator <", posting code relevant it. full code available 2 links p...

c# - FirstOrDefault on collection of objects -

i have following classes: public class animal { ... } public class cow : animal { ... } public class animalcollection : list<animal> { public animal getfirstanimal<t>() { foreach(animal animal in this) { if(animal t) return t animal } return null; } } a few questions: possible use firstordefault on collection instead of having getfirstanimal() method? syntax if can? efficient? isn't going massive collection. alternatively, there better way of doing same thing together? var firstcow = animals.oftype<cow>().firstordefault();

c# - DataGridView and adding columns programmatically -

i need use datagridview control display large number of columns. have datagridviewcell class specifies custom paint method each cell. have added columns so... int columncount = 5000; datagridviewtextboxcell cell = new datagridviewtextboxcell(); (int = 0; < columncount; i++) { datagridview1.columns.add(new datagridviewcolumn() { celltemplate = cell, fillweight = 1 }); } the problem is, takes ages add columns, longer should take. when add columns can see size of scroll bar @ bottom of datagridview getting smaller grid drawing each column each time add one. does know of quicker way add large number of columns, or how prevent datagridview updating until columns have been added? i've tried disabling resizing, suspendlayout() , , setting datagridview1.visible = false . if use virtualmode = true datagridview, can refresh screen portion.

open source - Releasing a PHP CMS... how to? -

i'm release cms written in php (using zend framework). it's powerful , easy manage once understand it. i wondering release under commercial license (i want money) realized there's saturation of cms's on market. so think i'm going release under open-source license. know have choose license question is: once license choosen need release it? turn official, 1 cannot "steal" it's code , created it. i read on website need create file called "license" , write license there security? know code cannot compiled or obfuscated do "turn official" created it? thank attention. licenses don't prevent viewing/taking code - give grounds take legal measures against if violate terms of license. a license official moment specify it's license applies code. common way of doing including text file license part of download (and many of common open-source licenses refer including license code if copies made), it's valid if ...

How do I move this JavaScript event from an inline event to its own .JS file? -

happened across snip of js i've managed make work uses, i'm brand new javascript, i'm unsure whether i've understood how & why works. stands, it's inline (inside html tag, i'd see either in own .js file can used several thousand links on 1 of several hundred pages on site i'm putting together. the purpose of javascript looking kill or disable link (and link) on page after had been clicked once. didn't want disappear, i'd seen mention of, made un-clickable. anyway, found. assistance appreciated. <a href="testvid.avi" onclick="this.onclick=function(){return false;}"><div id="box1">this video file</div></a> again, question is, how take onclick event & place in own .js file. thank you. with plain js can use same code: document.getelementbyid('videolink').onclick = function() { this.onclick = function() { return false; } } with jquery can try: $(...

c++ - Restore context of a thread and continue its execution? -

how can idle thread activated again such context restored , execution continued (like if want thread activate after 10 seconds , activated after every 5 seconds, in mean time other threads may continue running)? can't have thread sleep required time? context inherently part of thread, automatically restored.

c - How to declare triple pointers in array of pointers -

how declare triple pointer array of pointers have char *mainmenu[] = {"menu1", "menu2", "menu3"} see picture alt text http://www.freeimagehosting.net/uploads/6988d25305.png how connect menu1,2,3 picture m1p1 m2p1 ??? need syntax please me ... all[0] of type char ** , , match definition of mainmenu , albeit appears terminating null in array. char ***all; char *mainmenu[] = {"menu1", "menu2", "menu3", null}; all[0] = mainmenu;

javascript - How to prevent iframe load event? -

i have iframe , couple of tables on aspx page. when page loads these tables hidden. iframe used upload file database. depending on result of event have show particular table on main page (these tables have "retry","next" buttons...depending on whether or not file uploaded have show respective button). now have javascript on "onload" event of iframe hiding these tables start with. when control comes after event show particular table. iframe loads again , tables hidden. can 1 me problem. don't want iframe load second time. thanks mmm said you're on aspx page, suppose iframe postback, reload page. if can't avoid postback, you've set flag on main page before posting back, , check against while you're loading... ...something like: mainpage.waittillpostback = true yourfunctioncausingpostback(); .. onload=function(){ if(!mainpage.waittillpostback){ hidetables(); } mainpage.waittillpostback = false; }

java - How do I split strings in J2ME? -

how split strings in j2me in effective way? there stringtokenizer or string.split(string regex) in standard edition (j2se), absent in micro edition (j2me, midp). there few implementations of stringtokenizer class j2me. 1 ostermiller include functionality need see this page on mobile programming pit stop modifications , following example: string firsttoken; stringtokenizer tok; tok = new stringtokenizer("some|random|data","|"); firsttoken= tok.nexttoken();

c# - Adding WCF Service Reference doesn't generate code -

scenario : web site project under .net 3.5 visual studio 2010 wcf service reference problem : i'm trying extend class marked datacontract attribute. though generated class declared partial , extend it. tried declaring partial class within same namespace same name, doesn't seem recognize class it's extending. tried locating generated code file (reference.cs) thought existed after reading article inside reference folder, wasn't there. when trying navigate class's definition, found out in compiled library, , biggest problem wasn't declared partial. question : difference related fact i'm using web site , not web project? if so, there way make code generator (which seems compile generated code) declare class partial? yes there way can declare datacontract classes partial. for you'd want use dto pattern . means defining "shared" classes in different assembly, , having both service, , app consumes service, both reference...

.net - C# Automatic Properties -- setting defaults -

what's easiest/straight-forward way of setting default value c# public property? // how set default this? public string myproperty { get; set; } please don't suggest use private property & implement get/set public properties. trying keep concise, , don't want argument why that's better. thanks. set default in constructor: this.myproperty = <defaultvalue>;

tfs2010 - Team Foundation server (TFS) restore, Missing services? -

i'm testing out backup , restore of tfs, before migrating our source control. problem is, i'm getting confused restore part of msdn documentation. in particular, part required update service accounts ( http://msdn.microsoft.com/en-us/library/ms252458.aspx#updateaccounts ). you must update service account team foundation server (tfsservice) my assumptions term services mean windows services. based on this, i'm assuming when talk tfsservice , name of service need locate. so problem comes when try , locate tfsservice in services.msc dialog find out user account running under , therefore need update. doesn't seem exist! so questions are: is service right 1 need for, , if is, reasons why wouldn't have it. am understanding section of documentation correctly? i.e. need find account tfs server service runs under, , use command line specified update it? i'm using tfs 2010 on vm testing if helps! thanks, andy. ** update ** just look...