Search Results

Search found 29534 results on 1182 pages for 'bill best'.

Page 13/1182 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Best practice for Python Assert

    - by meade
    Is there a performance or code maintenance issue with using assert as part of the standard code instead of using it just for debugging purposes? Is assert x >= 0, 'x is less then zero' and better or worse then if x < 0: raise Exception, 'x is less then zero' Also, is there anyway to set a business rule like if x < 0 raise error that is always checked with out the try, except, finally so, if at anytime throughout the code x is < 0 an error is raised, like if you set assert x < 0 at the start of a function, anywhere within the function where x becomes less then 0 an exception is raised?

    Read the article

  • Best practice with respect to NPE and multiple expressions on single line

    - by JRL
    I'm wondering if it is an accepted practice or not to avoid multiple calls on the same line with respect to possible NPEs, and if so in what circumstances. For example: getThis().doThat(); vs Object o = getThis(); o.doThat(); The latter is more verbose, but if there is an NPE, you immediately know what is null. However, it also requires creating a name for the variable and more import statements. So my questions around this are: Is this problem something worth designing around? Is it better to go for the first or second possibility? Is the creation of a variable name something that would have an effect performance-wise? Is there a proposal to change the exception message to be able to determine what object is null in future versions of Java ?

    Read the article

  • c# object initializer complexity. best practice

    - by Andrew Florko
    I was too excited when object initializer appeared in C#. MyClass a = new MyClass(); a.Field1 = Value1; a.Field2 = Value2; can be rewritten shorter: MyClass a = new MyClass { Field1 = Value1, Field2 = Value2 } Object initializer code is more obvious but when properties number come to dozen and some of the assignment deals with nullable values it's hard to debug where the "null reference error" is. Studio shows the whole object initializer as error point. Nowadays I use object initializer for straightforward assignment only for error-free properties. How do you use object initializer for complex assignment or it's a bad practice to use dozen of assigments at all? Thank you in advance!

    Read the article

  • IF-block brackets: best practice

    - by MasterPeter
    I am preparing a short tutorial for level 1 uni students learning JavaScript basics. The task is to validate a phone number. The number must not contain non-digits and must be 14 digits long or less. The following code excerpt is what I came up with and I would like to make it as readable as possible. if ( //set of rules for invalid phone number phoneNumber.length == 0 //empty || phoneNumber.length > 14 //too long || /\D/.test(phoneNumber) //contains non-digits ) { setMessageText(invalid); } else { setMessageText(valid); } A simple question I can not quite answer myself and would like to hear your opinions on: How to position the surrounding (outermost) brackets? It's hard to see the difference between a normal and a curly bracket. Do you usually put the last ) on the same line as the last condition? Do you keep the first opening ( on a line by itself? Do you wrap each individual sub-condition in brackets too? Do you align horizontally the first ( with the last ), or do you place the last ) in the same column as the if? Do you keep ) { on a separate line or you place the last ) on the same line with the last sub-condition and then place the opening { on a new line? Or do you just put the ) { on the same line as the last sub-condition? Community wiki.

    Read the article

  • objectWithFieldNAme Best Practice for CoreData

    - by Rafael
    Hello, I'm trying to implements some methods for my CoreData models and I'm wonndering if the way I'm doing it is a good practice. I want to implement methods of the type getObjectsWithFieldName. This methods could be used by severals views. So the way I'm doing it is implementing a Class method in the model in the following way: +(NSArray *)getObjectWithFieldName:(NSString *)fieldName andContext:(NSManagedObjectContext *) context; Is this a good practice? Or there is another way to do it for iPhone Development? Thanks in advanced.

    Read the article

  • What is the best place to display the language in your url

    - by Saif Bechan
    I have a multi-language website that makes use of pretty urls, so called search engine friendly urls. Now there are a few places to define the language in the url. 1) www.mydomain.com/en/articles/random www.mydomain.com/nl/articles/random 2) en.mydomain.com/articles/random nl.mydomain.com/articles/random 3) www.mydomain.com/articles/random?lang=en www.mydomain.com/articles/random?lang=nl Is there any preffered way of showing this, or is there another way better that I did not show. I would like to hear your comments on this.

    Read the article

  • Best practice for using Wcf service by silverlight?

    - by bonefisher
    How would you structure the code for calling a wcf service in silverlight application? Using only-once instanciated wcf service-proxy (aka singleton) and using it across the whole SL app? If so, how did you solve the unsubscribing controls from ws-call-completed event? or creating the wcf service-proxy for each ws-call? Where do you close the proxy then?

    Read the article

  • Extend legacy site with another server-side programming platform best practice

    - by Andrew Florko
    Company I work for have a site developed 6-8 years ago by a team that was enthusiastic enough to use their own private PHP-based CMS. I have to put dynamic data from one intranet company database on this site in one week: 2-3 pages. I contacted company site administrator and she showed me administrative part - CMS allows only to insert html blocks & manage site map (site is deployed on machine that is inside company & fully accessible & upgradeable). I'm not a PHP-guy & I don't want to dive into legacy hardly-who-ever-heard-about CMS engine I also don't want to contact developers team, 'cos I'm not sure they are still present and capable enough to extend this old days site and it'll take too much time anyway. I am about to deploy helper asp.net site on IIS with 2-3 pages required & refer helper site via iframe from present site. New pages will allow to download some dynamic content from present site also. Is it ok and what are the pitfalls with iframe approach?

    Read the article

  • Best practice for near reuse of model components?

    - by Chris Knight
    I have a requirement to use a Fund model in my code. It will contain a fund name and fund code. In the interest of reuse I've poked around the package containing the other models used and found an existing Fund model. However the issue here is that, in addition to fund name and code, it also contains an amount. Amount isn't directly relevant in my context. So, do I: 1) Use the existing Fund model as is, ignoring the setters/getters for fund amount. 2) Put a FundDescription interface onto the existing Fund model for accessing only the information I'm interested in. 3) Make a FundDescription base class from which the existing Fund model could now extend 4) Create a whole new seperate model since the two are slightly contextually different

    Read the article

  • When is C++ covariance the best solution?

    - by Neil Butterworth
    This question was asked here a few hours ago and made me realise that I have never actually used covariant return types in my own code. For those not sure what covariance is, it's allowing the return type of (typically) virtual functions to differ provided the types are part of the same inheritance hierarchy. For example: struct A { virtual ~A(); virtual A * f(); ... }; struct B : public A { virtual B * f(); ... }; The different return types of the two f() functions are said to be covariant. Older versions of C++ required the return types to be the same, so B would have to look like: struct B : public A { virtual A * f(); ... }; So, my question: Does anyone have a real-world example where covariant return types of virtual functions are required, or produce a superior solution to simply returning a base pointer or reference?

    Read the article

  • Best practice for debug Asserts during Unit testing

    - by Steve Steiner
    Does heavy use of unit tests discourage the use of debug asserts? It seems like a debug assert firing in the code under test implies the unit test shouldn't exist or the debug assert shouldn't exist. "There can be only one" seems like a reasonable principle. Is this the common practice? Or do you disable your debug asserts when unit testing, so they can be around for integration testing? Edit: I updated 'Assert' to debug assert to distinguish an assert in the code under test from the lines in the unit test that check state after the test has run. Also here is an example that I believe shows the dilema: A unit test passes invalid inputs for a protected function that asserts it's inputs are valid. Should the unit test not exist? It's not a public function. Perhaps checking the inputs would kill perf? Or should the assert not exist? The function is protected not private so it should be checking it's inputs for safety.

    Read the article

  • Best practice- How to team-split a django project while still allowing code reusal

    - by Infinity
    I know this sounds kind of vague, but please let me explain- I'm starting work on a brand new project, it will have two main components: "ACME PRODUCT" (think Gmail, Meebo, etc), and "THE SITE" (help, information, marketing stuff, promotional landing pages, etc lots of marketing-induced cruft). So basically the url /acme/* will load stuff in the uber cool ajaxy application, and every other URI will load stuff in the other site. Problem: "THE SITE" component is out of my hands, and will be handled by a consultants team that will work closely with marketing, And I and my team will work solely on the ACME PRODUCT. Question: How to set up the django project in such a way that we can have: Seperate releases. (They can push new marketing pages and functionality without having to worry about the state of our code. Maybe even separate Subversion "projects") Minimize impact (on our product) of whatever flying-unicorns-hocus-pocus the other team codes into the site. Still allow some code reusal. My main concern is that the ACME product needs to be rock solid, and therefore needs to be somewhat isolated of whatever mistakes/code bloopers the consultants make in their marketing side of the site. How have you handled this? Any ideas? Thanks!

    Read the article

  • Best practice question

    - by sid_com
    Hello! Which version would you prefer? #!/usr/bin/env perl use warnings; use strict; use 5.010; my $p = 7; # 33 my $prompt = ' : '; my $key = 'very important text'; my $value = 'Hello, World!'; my $length = length $key . $prompt; $p -= $length; Option 1: $key = $key . ' ' x $p . $prompt; Option 2: if ( $p > 0 ) { $key = $key . ' ' x $p . $prompt; } else { $key = $key . $prompt; } say "$key$value"

    Read the article

  • The 50 Best Ways to Disable Built-in Windows Features You Don’t Want

    - by The Geek
    Over the years, we’ve written about loads of ways to disable features, tweak things that don’t work the way you want, and remove other things entirely. Here’s the list of the 50 best ways to do just that. Just in case you missed some of our recent roundup articles, here’s a couple of roundups of our very best articles for you to check out: The 50 Best Registry Hacks that Make Windows Better The 20 Best How-To Geek Explainer Topics for 2010 The 20 Best Windows Tweaks that Still Work in Windows 7 The 50 Best How-To Geek Windows Articles of 2010 The 10 Cleverest Ways to Use Linux to Fix Your Windows PC If you’ve already been through those, keep reading for how to disable loads of Windows features you might not want Latest Features How-To Geek ETC How to Upgrade Windows 7 Easily (And Understand Whether You Should) The How-To Geek Guide to Audio Editing: Basic Noise Removal Install a Wii Game Loader for Easy Backups and Fast Load Times The Best of CES (Consumer Electronics Show) in 2011 The Worst of CES (Consumer Electronics Show) in 2011 HTG Projects: How to Create Your Own Custom Papercraft Toy Calvin and Hobbes Mix It Up in this Fight Club Parody [Video] Choose from 124 Awesome HTML5 Games to Play at Mozilla Labs Game On Gallery Google Translate for Android Updates to Include Conversation Mode and More Move Your Photoshop Scratch Disk for Improved Performance Winter Storm Clouds on the Horizon Wallpaper Existential Angry Birds [Video]

    Read the article

  • using Quick Sequence Diagram Editor for sequence diagrams

    - by Jason S
    Anyone have experience with Quick Sequence Diagram Editor? The combination of instant display + text source code + Java implementation is very attractive to me, but I can't quite figure out how to make the syntax do what I want, and the documentation's not very clear. Here's a contrived example: al:Actor bill:Actor atm:ATM[a] bank:Bank[a] al:atm.give me $10 atm:al has $3=bank.check al's account balance al:atm.what time is it atm:al.it's now atm:al.stop bugging me atm:al.you only have $3 atm:bill.and don't you open your mouth bill:atm.who asked you? bill:atm.give me $20 al:atm.hey, I'm not finished! atm:bill has $765=bank.check bill's account balance atm:yes I'm sure, bill has $765=bank.hmm are you sure? atm:bill.here's $20, now go away atm:great, he's a cool dude=bank.I just gave Bill $20 al:atm.what about my $10? atm:al.read my lips: you only have $3 Here's the result from QSDE in single-threaded mode: and in multi-threaded mode: I guess I'm not clear what starts/ends those vertical bars. I have a situation which is single-threaded, but there's state involved, and all the messages are asynchronous. I guess that means I should use an external object to represent that state and its lifetime. What I want is for one timeline to represent the message sequence al:atm.give me $10 atm:bank.check al's account balance bank:atm.al has $3 atm:al.you only have $3 and another timeline to represent the message sequence bill:atm.give me $20 atm:bank.check bill's account balance bank:atm.bill has $765 atm:bank.hmm are you sure? bank:atm.yes I'm sure, bill has $765 atm:bill.here's $20, now go away atm:bank.I just gave Bill $20 bank:atm.great, he's a cool dude with the other "wisecracks" representing other miscellaneous messages that I don't care about right now. Is there a way to do this with QSDE?

    Read the article

  • What are industry standards and professional best practices in network hosts naming? [closed]

    - by Ivan
    Possible Duplicate: Naming convention for computers It seems an important and difficult dilemma for me how to name network hosts (routers, servers (while a server can be a router and host diverse services at the same time), virtual machines (while they host important services and can migrate), workstations and notebooks (using pc-username is not the best idea as users may change), printers & MFUs, surveillance IP cameras, etc). Are there known and accepted best practices for this task? Excuse me if there already was a similar question here (I think it probably was), I haven't found it.

    Read the article

  • Best Practices to Accelerate Oracle VM Server Deployments

    - by Honglin Su
    IOUG (Independent Oracle User Group) Virtualization SIG is hosting the webcast on the best practices of Oracle VM server virtualization. July 11, 2012 - Best Practices to Accelerate Oracle VM Server on SPARC Deployments. Register here. To learn the best practices on Oracle VM Server for x86,  watch the session replay here. For more white paper about best practices, visit Oracle VM OTN page here.

    Read the article

  • Should I reuse variables?

    - by IAdapter
    Should I reuse variables? I know that many best practice say you should not do it, however later when different developer is debugging the code and have 3 variables that look a like and only difference is that they are created in different places in the code he might be confused. unit-testing is a great example of this. However I do know that best practice are most of the time against it. For example they say not to "overide" method parameters. Best practice are even are against nulling the previous variables (in Java there is Sonar that has warning when you assign null to variable that you don't need to do it to call garbage collector since Java6. you cant always control what warnings are turned off, most of the time the default is on)

    Read the article

  • The University with the best Computer Science degree?

    - by Shinnok
    Which University provides the best Computer Science degree in your opinion(non US Universities welcomed too)? I do realize that you most probably didn't attend more then one University so you can't really provide a truly insightful opinion on several institutions, but what you can do instead, is describe the one you attended and outline it's strengths and weaknesses. What do i mean by the best is essentially the University that upon graduation and given a subject's assumed reasonable level of passion and interest in the field, one can trust upon the fact he was at least exposed to the best and most deep, correct and up to date courses on Programming, Operating Systems, Internet and Computer Technology overall. We have all heard of recent horror stories in Computer Science teaching, thus an exposure the best of the best, essentially the University you would grant your children to if they were to be interested into this field, would be a great thing.

    Read the article

  • What are the Best Practices and tools for managing Windows Desktops from a linux sever ?

    - by JJ
    I know this is a loaded question! What are the best ways to manage Windows (2000, XP, Vista, Win7) workstation from a centralized linux server. I would like to replace the fuctionaility of MS SBS Server with a linux box. The following issues would need to be addressed. File Sharing Authentication, Authorization, and Access Control Software Installation Centralized Login Script Centralized Backup

    Read the article

  • Best Practices for "temporary" accounts in a Windows server environment?

    - by Millman
    Are there any best practices for "temporary worker" accounts in a Windows server environment? We have a couple of contractors joining the organization temporarily. They only need access to a few folders. Aside from joining them to the "Domain Guests" group and granting them access only to the folders specified. Are there any other issues to be aware of? We are in a Windows Server 2003 domain environment.

    Read the article

  • Microsoft Windows 64-bit application development best practises installation folder.

    - by abmv
    My problem is that a vendor is providing me with a 64bit application (packed in a 64bit installer) but it goes and installs to the x86 (Program Files) Folder and he keeps telling me its OK but I want it to install in the Program Files directory; as the 32 bit version does that and scripts for the app are developed based on this assumption. Can someone direct me to the Microsoft recommended best practices for 64bit applications(links). Thanks in advance.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >