Posts

Showing posts from April, 2010

python - Using Mercurial to separate three versions: official/development/testing/ -

i'm working on deploying python module composed of several dozen files , folders; use mercurial managing software changes. i want keep same module in 3 branches: official 1 (which team uses), development 1 (this may more 1 development branch), , testing branch (not testing of official branch, collection of test related third party module used module - regression testing when third party module makes new releases). how can accomplish in mercurial? name 3 branches in same folder or cloning 1 version 3 places maintain them separately? any insight on how manage in general appreciated. thank you. the "official" way cloning repo in many branch need. but named branches within repo acceptable, if don't need work simultaneously on different development efforts (each associated respective branch) i find " guide branching model in mercurial " instructive on kind of choice. other information on mercurial branches in question well .

c# - Calculating Day, Month, Year -

how calculate day, month, year exactly? means.. from 2th jan 1990 9th may 2009 is.. xxx days, xxx months, xxx years. any idea how that? i tried timespan , tick().. both failed so.. you cannot through direct calculation (i.e. there's no "totalmonths" or "totalyears" property of timespan , because numbers not make sense arbitrary intervals of time). instead, can count number in loop, so: var dt1 = new datetime(1990, 1, 2); var dt2 = new datetime(2009, 5, 9); int years = 0; while (dt1.addyears(1) < dt2) { years ++; dt1 = dt1.addyears(1); } int months = 0; while (dt1.addmonths(1) < dt2) { months ++; dt1 = dt1.addmonths(1); } int days = (int) math.floor(dt2.subtract(dt1).totaldays); i haven't tested this, there might off-by-one errors or whatever, that's basic idea.

c++ - SSDP Get Shared folder list using M-SEARCH? -

i using ssdp send discover request using m-search list of services present. requirement want list of share folders present in server. currently , sending request in format : "m-search * http/1.1\r\n" "host: 239.255.255.250:1900\r\n" "man: \"ssdp:discover\"\r\n" "st:upnp:rootdevice\r\n" "mx:3\r\n" "\r\n"; and response these parameters : st:upnp:rootdevice usn:uuid:122261ae-7c37-4234-9366-ed5286752f2b::upnp:rootdevice location:http://172.24.17.221:2869/upnphost cache-control:: max-age = 900 server:: linux i want have shared folder list present on server. how can ? additional parameter need specify ? code snippet or ideas welcome. as far know not possible shared folders ssdp only. ssdp gives list of services turn connect service , "ask" shared folders. in example need connect to: location:http://172.24.17.221:2869/upnphost that give device configuration includ...

java - Stack in android -

it's first time me use java need use stack in android funcions if define stack out of function give me error (should parametrized) , application crashes public class televideo extends activity{ stack pila = new stack(); @override public void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); setcontentview(r.layout.main); pila.push(mystring); } @override public boolean onoptionsitemselected(menuitem item){ mystring = pila.peek(); } } how can use stack through class functions in java? parametrising means tell class (in case stack) type of objects instance (in case pila) contain. try code instead of yours: stack<string> pila = new stack<string>() however, should not error warning far know.

cocoa - Trap click event on dock icon using Qt on Mac -

i trying dock click event on dock icon on mac os x. using qt-cocoa. highly appreciated. thanks, rahul i've done open-source project. see code here: https://github.com/kdab/charm/blob/master/charm/macapplicationcore.mm

php - Acrobat and/or Reader Error ".tmp" when using fdf -

i'm populating pdf's via fdf (& php) , part works fine users getting either "acrobat cannot open "acrxyz.tmp" (or "reader cannot open "xyz.tmp", in cases). i've found info possible causes surrounding: apache "mod-deflate", ie cache , volatile memory & "fdf_close" among other things.. some config info: it's on apache 2 (the mod_deflate module), don't have fdftk installed can't fdf_close. fdf called include. , these through https ssl users on ie anywhere ie 6 ie 8 using acrobat 8 or reader 8.x or 9.2 most users pdf without problem but.... suggestions narrow search server setting user-config etc. or solutions helpful? here's header info if helps // header required explorer send file acrobat viewer header ("content-type: application/vnd.fdf"); // prevent caching header("cache-control: post-check=0, pre-check=0", false); header("pragma: public...

How can I calculate the height of an element cross-browser using jQuery? -

i created plugin bottom-align element. in it's simplest form did this: get height of outerelement (div) get height of current element result = outerheight - height of current element sett css attribute 'top' = result. and works... in firefox , ie8, not in opera or google chrome. i'm guessing has borders, padding , margin. have in order make work cross-browser? update code has been revised , working now. (function($){ $.fn.alignbottom = function() { var defaults = { outerhight: 0, elementheight: 0 }; var options = $.extend(defaults, options); var bpheight = 0; // border + padding return this.each(function() { options.outerhight = $(this).parent().outerheight(); bpheight = options.outerhight - $(this).parent().height(); options.elementheight = $(this).outerheight(true) + bpheight; $(this).css({'position':...

How to implement local database in .NET when the Database files cannot be Protected? -

i asked write database , it's gui frontend non-profit organization member of. the decision use .net know c# fariy , writing gui quite easy. though of implementing local sql server database (as worked earlier mysql) , connect via sqlclient interface. discover problem: machine database installed public. account database accessed freely available. far know bring portable ms access gain free access data stored in database. perhaps wrong , possible encrypt database password independent user account. don't know how (i not have ms access, basic office , visual studio express). or if impossible, best way replace sql server database? as several people have pointed out, if database files public data public. encryption not going you. switching sqlite not help; have make database files non-public. one way store database on private server , expose data through public api via soap, rest, web services or such. gui front-end send requests private server , display results. ...

objective c - Best way to set a configuration file in iOS app -

i'm making first ios application run adhoc release on ipad part of university project. i need have configurable file somewhere within source setting price constants accessed multiple subclasses of superclass. i'm wondering best way store these values, there 150 of them, should store them static constants in superclass? or? sorry, newby question, want make sure doing right way putting them static constants in superclass means have recompile every subclasses everytime modify 1 of values. use plist or json or whatever format , load application bundle static nsdictionary , use this. so when modify price, can see right @ next run without compiling.

Pass session information from php to python securely? (in agile) -

i have sign process in legacy framework , trying switch new framework...in fact different language. let's there 3 steps in sign process , each of 3 steps has it's own file(step1.php, step2.php, step3.php). if want change page2.php python file still need session information page1.php. how can transfer information between 2 pages while maintaining valid session , security. we want integrate language switch in same repository original 1 , doing releases of new changes. that's agile part. (i'm still not sold best way i'm more curious) in php, store session information in database, encoded in json. in python, pull session id cookie , session information in database.

How bad is SLOC (source lines of code) as a metric? -

we documenting our software development process. technical people, pretty easy: iterative development internal milestones every 4 weeks, external every 3 months. however, purpose of exercise expose things our project management in terms can understand. specifically, these non-technical managers need metrics can understand. i understand our options metrics , have proposed whole set (requirements met , actual costs vs. budgeted costs 2 of favorites). however, have old hands involved , tend hang onto metrics sloc. i understand temptation of sloc: seems easy non-software people understand , seems closest analog of physical thing (it's counting punched cards in old days!). so here's question: how can explain dangers of sloc non-technical person? here's concrete motivation: work on mature deployed system has years of history behind it. add features, sloc tends stay approximately level or decrease (refactoring removes old / dead code, new features adjustments o...

iphone - Modal View Controller Won't Start in Landscape Mode -

i have navigation based app has detail view (uiwebview) action buttons across bottom in uitoolbar. want add 'notes' when 'notes' button pushed. works fine when webview in portrait mode. press notes button, modal view opens fine , works great. the problem occurs when webview in landscape mode. if press notes button, code open modal view gets called white screen. 1 comment: if open modal view in portrait , rotate device, rotates fine landscape mode. won't open correctly in landscape mode. i have button brings mail composer has identical behavior. here code in uiwebviewcontroller: - (ibaction)addnotes:(id)sender { notesviewcontroller *notesviewcontroller; // create view controller , set root view of new navigation // controller notesviewcontroller = [[notesviewcontroller alloc] initwithprimarykey:self.record.primarykey]; uinavigationcontroller *newnavigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcont...

.net - SQL Exception on immediate reconnect -

i have winform app uses linqtosql it's dal. there central sql db , each laptop has local sqlexpress db. seperate module, using merge replication, keeps 2 in sync. when connection lost central db 'fails over' local. works great. however, when regain conection central db, if time period has not been real long, following exception --> a transport-level error has occurred when sending request server. (provider: tcp provider, error: 0 - existing connection forcibly closed remote host.) i have read through numerous posts here on so relating , msdn article outlines , explains, in great detail, going wrong yet, through of this, have still not found or read solution. i wondering how others have dealt this. find hard believe treading new ground here. there way remove old connections on reconnect? i losing hair on insight appreciated. edit also of note, quite positive data contexts wrapped in using , not have 'long-term' contexts. turnin...

design - Domain entity validation code inside or outside the object? -

where place validation code domain entity? inside class in method validate() or outside in context object being used? or both? if validation has consult objects inside entity put validation inside entity. person entity checking if age > 0 or name not empty should within entity in validate() method checking if course covered policy (from list of policies) involve quering/reading other course/policy objects may not related entity , should done context/service/validator outside entity

c# - Entity Framework 4 Code Genning - One Set of Entities? -

i looking setup architecture entity framework break apart entities multiple models. wondering if possible code-generate 1 set of entities, each model uses same set of data access classes? realize issue contexts, wondering if each context needed have own set of classes, or can create many contexts have 1 set of classes represent backend tables, using self-tracking entities generation feature. thanks. you can share poco classes across multiple models. for example class this: public class person { public int id {get;set;} public string firstname {get;set;} public string surname {get;set;} public string lastname {get {return surname;} set {surname = value;}} } would work in edmx defines person id,firstname,surname , work in second edmx defines person id,firstname,lastname not sure though self-tracking entities, stes 'poco' have model specific code might break if definition of entitytype different in 2 edmxs (like in above sample). you'...

.net - How do I start using patterns and practices efficiently? -

how start using patterns , practices efficiently developing .net applications? as always, best way of stuff write code. difficulty going have there large number of patterns , knowing when apply them if don't understand them difficult @ best. however, writing arbitrary code not giong work. because of recommend couple of books. read "head first design patterns", java book, it's close enough c# in-valuable. i'd @ "refactoring patterns" "joshua kerievsky". last book in particular takes code not pattern based , moves code pattern based. along side find mentor (if can) , work along side them. start coding.

.net - How can I test for null arguments in the constructor of abstract class using rhino mocks? -

i have class so: public abstract class classa<t> { protected classa(iinterface interface) { if (interface== null) { throw new argumentnullexception ("interface"); } } } i want write test verifies if pass null in exception thrown: [test] [expectedexception (typeof (argumentnullexception))] public testmethod() { classa classa = mockrepository.generatemock<classa<string>> (null); } but test keeps failing exception rather exception being expected. tried wrapping call in try catch block, same issue. tried generatestub , partialmock. what missing? i've run issue myself, unfortunately haven't been able find way tell rhino not wrap exception itself. far, best i've been able come follows: [test] [expectedexception(typeof(argumentnullexception))] public void testmethod() { try { classa classa = _mocks.createmock<classa>(null); } catch (exception...

smtp - How do I send multi-line output from Perl to /bin/mail? -

i have perl script prints multiple lines of output screen. need capture lines , either pipe them single piece of email ( /bin/mail ) or text file can send /bin mail in operation. actually, have figured out easy (dumb) way whereby use bash wrapper mailing bit. looks like, #!/usr/bin/bash source /nethome/zog/.bash_profile cd /nethome/zog/bin/perl /nethome/zog/bin/perl/find_free_space.pl > text.file /bin/mail -s freespace@nj3 zog@geemail.com < text.file i want using net::smtp smtp bit. above inelegant, least. i saw this: open(mail, "| /bin/mail -s freeports me\@geemail.com") || die "mail failed: $!\n"; print mail "this how goes." on stackoverflow failed redirect stdout mail. i'm using: $complete_output .= "\n"; "|/bin/mail -s freeports zog\@geeemail.com" || die "mail failed: $!\n"; i'm not sure if need see perl script in order help, it on pastebin . please let me know. stdout isn...

php - Generating Thumbnail, Copying It To Directory & Saving it To Database -

i wanting use pre-authored script generate thumbnail of image, , need modify needs, having copy saved file directory, , saving filename mysql database. unsure in script, can't determine when actual file output script(lack of skill). any appreciated, lea. the code add script follows: if( $new_height == "50" && $new_width == "50" ) { // write code here query, , copy file } the pre-authored script: /* timthumb script created tim mcdaniels , darren hoyt tweaks ben gillbanks http://code.google.com/p/timthumb/ mit license: http://www.opensource.org/licenses/mit-license.php paramters --------- w: width h: height zc: zoom crop (0 or 1) q: quality (default 75 , max 100) html example: <img src="/scripts/timthumb.php?src=/images/whatever.jpg&w=150&h=200&zc=1" alt="" /> */ /* $sizelimits = array( "100x100", "150x150", ); */ define ('cach...

In YAML, how do I break a string over multiple lines? -

in yaml, have string that's long. want keep within 80-column (or so) view of editor, i'd break string. what's syntax this? in other words, have this: key: 'this very very very long string' and i'd have (or effect): key: 'this very ' + 'long string' i'd use quotes above, don't need escape within string. using yaml folded style, each line break replaced space. indention in each line ignored. > long sentence spans several lines in yaml rendered string without carriage returns. http://symfony.com/doc/current/components/yaml/yaml_format.html

Using ADO.net Entity Framework 4 with Enumerations? How do I do it? -

question 1: playing around ef4 , have model class : public class candidate { public int id {get;set;} public string fullname {get;set;} public gender sex {get;set;} public educationlevel highestdegreetype {get;set;} } here gender , educationlevel enums like: public enum gender {male,female,undisclosed} public enum educationlevel {highschool,bachelors,masters,doctorate} how candidate class , gender , educationlevel working ef4 if: i model first development i db first development edit: moved question related object context question here . apparently int <-> enum won't supported in initial release of ef 4. agree sucks. i using property casting me public partial class myentity { public myenum hurrenum {get{return (myenum)hurr;} set{hurr = (int)value;}} } it doesn't bad if name stuff "correctly" (which means, doesn't stupid). instance, have reasoncode enum that's stored reason in database, have reason , reasoncode versi...

Validation / Error Messages in ASP.Net MVC 2 View Unrelated to a Property -

what pattern can use display errors on mvc 2 view not related single property? for example, when call web service process form data, web service may return error or throw exception. display user-friendly version of error, have no logical means relate error given property of model. update: trying use code suggested, no summary message displayed: mypage.spark: html.validationsummary(false, "oopps didn't work."); controller: viewdata.modelstate.addmodelerror("_form", "my custom error message."); // tried this: viewdata.modelstate.addmodelerror(string.empty, "my custom error message."); return view(); update 2 what mean? next each field. instead of displaying validation errors, html.validationsummary helper method has new option display model-level errors. enables model-level errors displayed in validation summary , field-specific errors displayed next each field. source: http://www.asp.net/learn/w...

.net - Remote Management and Data Capture: WCF, SQL Sync, SyncFramework, BITS or something else? -

we have few thousand windows xp client machines on various customer sites running interactive software instrumented collect anonymous usage data. client machines use old, old, old client-server software uploads data internet-based server, pushes configuration info down them , can ask clients tasks reboot. in essence, have following features (in pseudo c#/idl): interface iclienttoserver { void logusage(clientmachinename, anonymoususerid, pair[] usagedata, starttime, endtime); void logerror(clientmachinename, errormessage); void loguptime(clientmachinename, boottime); datetime syncclock(clientmachinename, timezone); } interface iservertoclient { void updatesettings(pair[] settings); bitmap getscreenshot(); void reboot(); string execute(cmdline); } ..but code has reached end of life (fragile, unmaintainable due lack of skills). we embark on greenfields, start-with-a-clean-slate project rework software using modern tools, sdks , frameworks. we have functional...

php - Mysqldump with empty result in gzip? -

when output mysql dump regularly, outputs 30mb file. when use gzip, 0kb. here code: $command = "<path to>mysqldump --opt -h $dbhost -u$dbuser -p$dbpass $dbname | gzip> test.sql.gz"; system($command); result: test.sql.gz 0 kb --------------------------- $command = "<path to>mysqldump --opt -h $dbhost -u$dbuser -p$dbpass $dbname > test.sql"; system($command); result: test.sql 30 mb do need specify full path gzip, instead of gzip? i'm not sure default path within php, doesn't cover you'd want.

sql - Searching for (freeware) database migration tool -

i'm searching tool dump database including ddl , content plain sql-sсript, can archived in plain text format. know e.g. oracle dump tools or mysql dump, there tool can connect different data sources , job done? gui great. check out http://squirrel-sql.sourceforge.net/ . gui, cross-platform , supports database jdbc driver.

cocoa - Is there a nice way to set up KVO on retained properties? -

quite encounter scenario when want observe changes on retained property: @interface anobserver {…} @property(retain) foo *foo; now when want set observing, need write own setter, repeating boilerplate setter code: - (void) setfoo: (foo*) newfoo { if (newfoo == foo) return; [foo removeobserver:self forkeypath:…]; [foo release], foo = [newfoo retain]; [foo addobserver:self forkeypath:…]; } this dumb, because pollutes source boilerplate code , it’s easy miss something. there better way set kvo on retained properties? wish write moose ’s after hook change kvo after property changed. in fact realized watch property itself: [self addobserver:self forkeypath:@"foo"…]; and change kvo when property changes :-), realize more complicated hand-written setter i’d avoid. ideas? how using key path? want observe changes on both value1 , value2 properties of foo . use: [self addobserver:self forkeypath:@"foo.value1"]; [self a...

Yank a region in VIM without the cursor moving to the top of the block? -

is there simple way (i.e. without writing script or elaborate keymap sequence) yank group of lines , leave cursor wherever yank performed, opposed @ start of block? according vim's help: "note after characterwise yank command, vim leaves cursor on first yanked character closest start of buffer." line-wise seems behave similarly. this bit annoying me since tend select large region top bottom, yank, , paste near or below bottom of selected region. today i'm setting mark (m-x) before yank , jumping back, suspect there may different yank sequence need. i've searched , web numerous times. there existing "vim shortcuts" material wade through yet i've not found solution 1 yet. thanks in advance. not quite answering question, perhaps '] solve problem? '] `] last character of changed or yanked text. {not in vi}

tfs2010 - TFS 2010 Fresh Install - on virtual or physical machines? -

i'm planning on installing tfs 2010 fresh install. i'm thinking i'll dual-server deployment start. db tier, i'll go physical. app tier, there reason not go virtual machine? thanks, --ed p.s. know why using tfs2010 install guide chm (tfsinstall-rtm-aug2010.chm - 510kb) "navigation webpage canceled" content in right pane? left pane shows tree no problem. i have installed on virtual machines (sql server, app tier , build server) , works well. there's no reason not using virtual machine app tier. p.s. .chm file right click on properties , there button says file downloaded internet , need unblock it.

c# - How to get duplicate items from a list using LINQ? -

i'm having list<string> like: list<string> list = new list<string>{"6","1","2","4","6","5","1"}; i need duplicate items in list new list. i'm using nested for loop this. the resulting list contain {"6","1"} . is there idea using linq or lambda expressions ? var duplicates = lst.groupby(s => s) .selectmany(grp => grp.skip(1)); note return duplicates, if want know items duplicated in source list, apply distinct resulting sequence or use solution given mark byers.

java - is it not allowed to implement a single local interface by two stateless beans? -

i getting following exception when local interface implemented 2 stateless beans, in 1 having normal functionality , other having enhanced functionality in it. java.lang.runtimeexception: not resolve global jndi name @ejb container userbean: reference class: org.app.securityservicelocal ejblink: duplicated in some.jar finally came know why getting exception i have used @ejb annotation inject stateless bean stateless bean name userbean following code @stateless(name="userbean") @ejb(name="app/securityservice", beaninterface=securityservicelocal.class) public class userbean implements userremote{ } if check injection details injecting securityservicelocal, implemented 2 stateless bean classes name sercurityservicebean , securityserviceenhabean. so, container in ambiguity state decide bean inject in both implementing same interface. this can resolved specifying more information beanname property value in @ejb annotation. th...

java - Struts2: Download File + WaitAndExecute -

i have little problem: i have action configured these params: <action name="exportcsv" class="it.asd.exportaction"> <interceptor-ref name="defaultloginstack" /> <interceptor-ref name="execandwait"/> <result name="success" type="stream"> <param name="contenttype">application/x-zip-compressed</param> <param name="inputname">filestream</param> <param name="contentdisposition">attachment;filename="${filename}"</param> <param name="buffersize">2048</param> </result> <result name="wait" type="tiles">waitpage</result> <result name="error" type="redirectaction" >visualizzaasd</result> </action> i want that, after downloading, page ret...

c# - Get value from ASP.NET MVC Lambda Expression -

i trying create own html helper takes in expression (similar built-in labelfor<> helper. have found examples obtain value of property when expression similar this: model => model.forename however, in of models, want obtain properties in child elements, e.g. model => mode.person.forename in these examples, cannot find anyway (easily) obtain value of forename. can advise on how should getting value. thanks if using same pattern labelfor<> method uses, expression lambdaexpression , can execute value. var result = ((lambdaexpression)expression).compile().dynamicinvoke(model); generally, can wrap generic expressions in lambdaexpressions , compile & invoke them value. if want isn't value of forename, field (fx. print out string "forename") option use form of expressionwalking. in c#4 framework provides class called expressionvisitor can used this, earlier versions of framework have implement - see: http://msdn.microsoft.com/en-...

c# - problem sending mail from my website using gmail-mailservers -

i want use gmail-mail servers, have registrated google app , have company mails in gmail. iam getting error: system.net.webexception: remote name not resolved: 'smtp.gmail.com' why not working, iam using email , password mailmessage message = new mailmessage(from, to, subject, body); message.isbodyhtml = true; message.priority = mailpriority.high; smtpclient mailclient = new smtpclient(); mailclient.credentials = new system.net.networkcredential ("___@gmail.com", "__________"); mailclient.port = 587; mailclient.host = "smtp.gmail.com"; mailclient.enablessl = true; mailclient.send(message); message.dispose();

linux - Declaring User Defined Variable in Shell Scripting (csh shell) -

i trying learn shell scripting , trying create user defined variable within script, first : howdy="hello $user !" echo $howdy however, when execute script ( ./first ) this: howdy=hello aaron!: command not found. howdy: undefined variable. what doing wrong? you have 2 errors in code: you using sh syntax instead of csh 1 set variable you not escaping "!" character (history substitution) try this: #!/bin/csh set howdy="hello $user \!" echo $howdy

c++ - Seg Fault with SOCI -

so haven't been coding in c++ quite while now, i'm pretty sure issue related soci , not general knowledge of memory usage in c++. here problem : i'm using soci query table , field, , sql statement line cause segmentation fault. quite troublesome... here code : string engine::getreview(int rev_id) { try { session sql; string post; sql.open("mysql", "db=ranking_dev user=****** password=*******"); sql << "select post reviews id = 3", into(post); //faulty line return post; } catch (exception const &e) { cerr << "error: " << e.what() << '\n'; return ""; } } i'm positive line root of error. tried initialize "post" variable, no avails. also, if retrieve integer value table (and store data in integer), there's no seg fault. , guess issue related way i'm using string, can see overly wrong in fun...

iphone - How do you deal with singleton objects in your app? -

the first approach comes mind put singleton object in appdelegate object property. in way can access anywhere using #import "myappdelegate.h" // ... [[(myappdelegate *)[uiapplication sharedapplication] delegate] singletonobj] the downside have explicitly cast , import header of delegate tell class you're working singletonobj property of delegate. , think makes code smell little. the second approach create legit singleton class. this, however, require more work. , think 1 singleton class, more enough. i'm not programmer appreciate corrections on reasoning, , opinions on subject. best practice ever put uiapplicationdelegate -related things in appdelegate class. evarr. decide if need singleton. if do, make legit singleton class. will easier in long run; did notice how long took type monster of line, tried singleton object out of appdelegate ? agh. (also, little bit of idiom: classes start capital letter, , methods start lowercase letter; hence,...

C#, VB6 and the Decimal data type -

im writing c# class library going used proxy between vb6 application , wcf service. some of wcf service methods use decimal data types parameters im unable duplicate directly in interface provide vb6 application unsupported type. how implement in com interface , safely convert decimal type wcf interface expecting? decimal available in vb6 subtype of variant . dim d variant d = cdec(1) msgbox typename(d) you therefore implement variant appropriate subtype in interface.

c# - How to specify each DataTable in each Row in Datagridview -

dt0 dt1 | dt1 dt2 | dt2| dt3| i want them arranged this.all different datatable.specifying each row values. how can achieve this. assuming have dataset readily available can do // set grid's data source datagridview1.datasource = ds.tables[0]; if have multiple datasets, have merge data grid's datasource before setting it dataset ds1 = new dataset(); dataset ds2 = new dataset(); //fill these datasets , merge ds1.merge(ds2); follow this link further information on it...

Show the permission of a indexed file in git -

this related question asked storing non-bare repository in dropbox easy movement between computers, may helpful read question background. the gist filemode keeps reporting diff number of files. can't find way reproduce consistently, happens frequently. i've noticed file, has 644 permissions on both machines reports diff 755 on 1 of machines. makes me think git believes executable bit set, can't figure out whether can see how git has bit set. to see git thinks files in commits , index, use git ls-tree <tree> , git ls-files -s <path> respectively. by way, seems git looks @ executable bit, , assumes 644 else. @ create_ce_mode in cache.h if want try debugging weird issue.

wpf - Borderless window application takes up more space than my screen resolution -

i have created borderless application in wpf, , works pretty good. however, when set windowstate full screen, application takes more space screen resolution, there pixels outside screen in directions! (looks hard coded negative margins added hide default border) any ideas how prevent happening? my xaml: <window x:class="myapp.shell" windowstyle="none" borderthickness="0" allowstransparency="true" background="transparent" resizemode="canresizewithgrip" windowstate="{binding mainapplicationwindowstate}" ... also, problem have seen windows toolbar / taskbar covered in fullsize state, looks "actual" screen height used , not "available" screen height, meaning screen height minus windows toolbar / taskbar! anyone found solution these issues? thanks i solved problem way: xaml: windowstyle="none" left="0" top="0" wid...

model view controller - Has anyone ever written a clean MVC based ruby-gnome2 application? -

do know of serious , clean, (by clean mean rails like) mvc based ruby gui application gtk. actually, if there ruby gui applications clean , mvc based, delighted, no matter toolkit. what looking open source apps, can @ code, inspiration , instruction. you should check out gem: rugui . homepage: rugui framework aims building desktop applications. rugui inspired ruby on rails framework, taking of features it. rugui approach provide mvc design application, separating business logic application presentation, making easy maintain , evolve application. i've been experimenting - no expert on rugui - happy using it. developers open improvement. supports unit-testing , rspec (with basic support gui-testing, few days after asking them). it lacks documentation, if know way around in gtk it's easy catch up. check out these blogposts: hello rugui getting feet wet rugui

c - Getting the address of a triple pointer to char -

gcc 4.4.4 c89 i wondering why getting different memory address. when print address of animals in main following: animals [ rabbit ] : [ 0xbfab2e48 ] animals [ rabbit ] : [ 0xbfab2e48 ] however, when print in function, different memory locations. think should same. ptr animals [ rabbit ] : [ 0xbfab2e08 ] ptr animals [ rabbit ] : [ 0xbfab2e08 ] many advice, int main(void) { char *animals[] = {"rabbit", "cat", "dog", "elephant", "racoon", null}; char *countries[] = {"india", "amercia", "france", "spain", "canada", "mexico", null}; char *cars[] = {"ford fista", "masda 3", "honda city", "toyata cote", null}; char **ptr_data[] = {animals, countries, cars, null}; printf("animals [ %s ] : [ %p ]\n", *animals, (void*)animals); printf("animals [ %s ] : [ %p ]\n", animals[0], &animals[...

What's the advantage of Google Chrome's strange setup strategy? -

possible duplicate: what advantages of installing programs in appdata google chrome? it install somewhere in %homepath%. why not in %programfiles%? i've assumed avoid forcing user have administrative privileges.

plsql - Is recompiling Oracle Packages safe -

hi have third party oracle based application, ships precompiled binary(wrapped) packages. when compile them in oracle sql developer (right click -> compile all), invalidated. is recompiling safe operation no side effects? the major side effect if compile package package dependant upon risk invalidating dependant package existing sessions - if compile has no errors. fine applications sessions short-lived applications sessions long-lived problem. if you're using connection pools in jdbc cached sessions long lived , invalidated. have flush cached sessions avoid error. the error you're looking "ora-04068: existing state of packages has been discarded". see here more info. specifically regards sql developer - not handle recompilation of wrapped packages well. if going recompile them try tool toad or pl/sql developer or use "alter package" command in sql plus command line.

JQuery: Click anywhere on body to close modal dialog for this code -

the same question asked here. doesn't state source, , solution given not directly applicable in case afaik. might modded down this, asking anyway. my entire code: <html><head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/humanity/jquery-ui.css" type="text/css" /> </head> <body><div id="dialog" title="title box"> <p>stuff here</p> </div> <script type="text/javascript"> jquery(document).ready(function() { jquery("#dialog").dialog({ bgiframe: true, autoopen: false...

Need a working example of configuring log4j RollingFileAppender via properties -

i using log4j logging, , property file configuration. currently, log files big (3.5 gb large log file). think need use rollingfileappender - when log file continues grow overly large. believe have misconfigured it; have working example of configuring rollingfileappender? for record, current configuration looks this: log4j.appender.main_log.file=${catalina.base}/logs/webtop.log log4j.appender.main_log=org.apache.log4j.rollingfileappender log4j.appender.main_log.layout=com.mycompany.util.log.log4jsimplelayout log4j.appender.main_log.datepattern='.'yyyy-mm-dd log4j.appender.main_log.maxfilesize=10mb log4j.appender.main_log.maxbackupindex=99 log4j.appender.main_log.append=true log4j.rootcategory=all, main_log an alternative rollingfileappender fine solution. i believe have misconfigured it; have working example of configuring rollingfileappender? this seems work fine me @mcherm. see below. are sure using log4j.properties think are? try changing .file...

Delphi Self-Pointer usage -

i need pointer class instance inside instance. can't use "self" directly, need store pointer future usage. tried next code: type ttest = class(tobject) public class function getclasspointer: pointer; function getselfpointer: pointer; end; class function ttest.getclasspointer: pointer; begin result := pointer(self); end; function ttest.getselfpointer: pointer; begin result := pointer(self); end; and both result wrong - code: test := ttest.create; writeln('actual object address: ', inttohex(integer(@test), 8)); writeln('class "self" value: ', inttohex(integer(test.getclasspointer()), 8)); writeln('object "self" value: ', inttohex(integer(test.getselfpointer()), 8)); returns: actual object address: 00416e6c class "self" value: 0040e55c object "self" value: 01ee0d10 please, me understand, "self" value ? "self" pointer class in...

SQL Server 2005 deadlock with nonclustered index -

can me deadlock in sql server 2005? for simple test, have table "book" has primary key (id), , column name. default index of primary key nonclustered . the deadlock happens when 2 sessions run @ same time. activity monitor shows first session "//step 1" locks row(rid lock) x lock. second session keeps row u lock , key u lock. deadlock picture shows "//step2" of first session requires key u lock. if index clustered , there no deadlock in case. "//step 1" keep row , key lock @ same time, there no problem. can understand locking row lock index since leaf node of clustered index row data. but, why nonclustered index in way? if second session holds key u lock, why "step 1" of first session not hold lock since same update statement. --// first session begin tran update book set name = name id = 1 //step 1 waitfor delay '00:00:20' update book set name = 'trans' id = 1 //step2 commit --// second session b...

Mysql JOIN of four tables with two key tables -

i hate admit knowledge of mysql lacking when comes more complex queries. have 4 tables 2 of them contain data want return, , 2 relational tables linking data. table a present provide filler table d.aid . +--------+ +--------+ +--------+ +-----------+ +-----------+ |table | |table b | |table c | | table d | | table e | +---+----+ +---+----+ +---+----+ +---+---+---+ +---+---+---+ |aid|name| |bid|name| |cid|name| |did|aid|bid| |eid|did|cid| +---+----+ +---+----+ +---+----+ +---+---+---+ +---+---+---+ | 1 | a_1| | 1 | b_1| | 1 | c_1| | 1 | 1 | 1 | | 1 | 1 | 1 | +---+----+ | 2 | b_2| | 2 | c_2| | 2 | 1 | 2 | | 1 | 1 | 2 | +---+----+ | 3 | c_3| +---+---+---+ +---+---+---+ +---+----+ the relationship created these tables is: table > table b > table c . data wanting belongs table b > table c relationship. +--------+---------+--------+---------+ |tblb.bid|tblb.name|tblc.cid|tblc.name| +--------+---------+--------+---------+ | 1 | ...

makefile - Is there a unit testing framework for GNU make? -

there number of unit test frameworks of languages, haven't come across unit test gnu make. has conditionals , loops (the $(foreach ...) statement), , allows write pretty sophisticated code. examples might things bsd ports, garnome, , opencsw gar. there's a debugger gnu make. however, i've never come across unit test framework it. there in existence? unit-tests assumes language has form of mechanism modularization, gnu make doesn't have. "units" testing? individual targets? how set inputs/outputs of each test? also, since makefiles executed during build, 1 argue makefiles "test themselves", leaving little room explicit "makefile test suites" good.

Django ForeignKey issue -

i have 2 classes class a(models.model): id=models.integerfield(primary_key=true) name=models.charfield(max_length=200) store_id=models.integerfield() type=models.foreignkey(b) class b(models.model): id=models.integerfield(primary_key=true) type=models.charfield(max_length=10) class c(models.model): id=models.integerfield(primary_key=true) store=models.charfield(max_length=200) class d(models.model): id=models.integerfield(primary_key=true) type=models.charfield(max_length=10) in class a type foreignkey on b , store_id logical foreign key on c or d depending upon value of type . in field set want show value of store depending upon type after calculations. type tells me table i.e c or d , vlaue of store tell me row in table c or d .now want show value on browser without overwriting values.is possible? maybe should @ generic relations .

project management - Is there a recommended skill set structure for medium sized software development teams? -

i'm looking references or best practices regard proportion of different skill sets needs me on typical medium sized software development team. assuming 40 development staff, proportion should sqa, ui designers, project managers, data specialists etc? the problem domain general engineering. realize seems vague question correct answer provide references industry standards , best practices opposed bunch of numbers. opinions , words of wisdom appreciated! regards. you may want consider "controversial" surgical team structure, first proposed harlan mills , , described in detail fred brooks in the mythical man month . the surgical team structure led 1 chief-person performing critical work himself while directing team assist or overtake other important less critical parts. books defines surgical team in following summary: the surgical team http://img705.imageshack.us/img705/1599/image022b.gif the surgeon chief programmer of whole team. produces spe...

How can I prevent that visitors set fullcalendar (arshaw) to editable:true via firebug? -

http://arshaw.com/fullcalendar/docs/event_ui/editable/ the option editable can manipulatet visistors of site via firebug , change data in database. there solution? $('#calendar').fullcalendar({ editable: false, [...] no, not really, though minifying should close enough people give up. however, if minify , obfuscate it, determined enough able de-obfuscate , reverse it. there reason why mantra of "never trust client" repeated. need add server side checks data ensure consistent , expected, if real worry.

Django json dumps help -

i have following code need encoding json , appending data file, foo.json here code: user = request.user print 'user id ', user.id // 83 sour = json.dumps({"toast" : [{"uid" : user.id }]}) print 'sour toast: ', sour.toast # i'm getting error: attributeerror: 'str' object has no attribute 'toast' basically want create json file contains user.id value can accessible front end through jquery. if can me error i'm getting or tips on go after fix error, appreciate it. json.dumps returns string. when do: sour = json.dumps({"toast" : [{"uid" : user.id }]}) print sour simple prints string looks this: {"toast" : [{"uid" : user.id }]} not actual object or dict can individual values from, string can print or write file or whatever else want strings. looks want print this: source toast: [{"uid":83}] to you'd want following: sour = json.dumps([{"uid...

osx - How to build 64-bit Python on OS X 10.6 -- ONLY 64 bit, no Universal nonsense -

i want build on development machine -- binary install python.org still 32 bits , installing extensions (mysqldb, example) driving me nuts trying figure out proper flags each , every extension. clarification: did not replace system python, installed python.org binary normal place @ /library/..., not /system/library/.... everything else seems build 64 bit default, , default python 2.6.1 64 bit (before replaced python.org build figuring direct replacement)` i want 64 bit build run on 1 machine without cruft. does have simple answer? thanks much, ssteinerx@gmail.com if happen using macports , it's simple specifying variant tells not compile universal, so: sudo port install python26 -universal you can view available variants using variants command: % port variants python26 python26 has variants: darwin: platform variant, selected automatically no_tkinter: disable tkinter support, break idle uc...

stlmap - Does map<key, data> in C++ STL support native data types like Structures? -

i trying write this. question how map key native data type structure. wrote snipped couldn't compile it. have ideas on how achieve thing? #include <map> #include <iostream> typedef struct _list { int a,b; }list; map<int,list> test_map; int main(void) { cout <<"testing"<< endl; return 0; } a number of problems here: you're missing either using::std or std::map , compiler doesn't know map<int,list> means. assuming have using namespace std declaration, typedef list might collide stl collection of same name. change name. your typedef struct _tag {...} tag; construct archaic holdover 80's. not necesarry, , frankly rather silly. gets nothing. here's code fixed: #include <map> #include <iostream> struct mylist { int a,b; }; std::map<int,mylist> test_map; int main(void) { std::cout <<"testing"<< std::endl; return 0; }