Search Results

Search found 16179 results on 648 pages for 'extension methods'.

Page 27/648 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • constructor should not call methods

    - by Stefano Borini
    I described to a colleague why a constructor calling a method is an antipattern. example (in my rusty C++) class C { public : C(int foo); void setFoo(int foo); private: int foo; } C::C(int foo) { setFoo(foo); } void C::setFoo(int foo) { this->foo = foo } I would like to motivate better this fact through your additional contribute. If you have examples, book references, blog pages, or names of principles, they would be very welcome. Edit: I'm talking in general, but we are coding in python.

    Read the article

  • Constructor should generally not call methods

    - by Stefano Borini
    I described to a colleague why a constructor calling a method can be an antipattern. example (in my rusty C++) class C { public : C(int foo); void setFoo(int foo); private: int foo; } C::C(int foo) { setFoo(foo); } void C::setFoo(int foo) { this->foo = foo } I would like to motivate better this fact through your additional contribute. If you have examples, book references, blog pages, or names of principles, they would be very welcome. Edit: I'm talking in general, but we are coding in python.

    Read the article

  • Methods to access US Netflix from Chromecast?

    - by lfk
    I need to access US Netflix using Chromecast but changing router configuration is not an option (I don't have access to the wireless router). On my laptop I use VPN, so one option is to use my laptop as a hotspot, but I don't always have cable connection for my laptop. Besides I was hoping to need only my iPad to use the Chromecast. Is there any other way or should I return the Chromecast while I still can?

    Read the article

  • Methods Of Preventing Spams In Blogs

    One of the most widely used form of spamdexing method in today';s market is comment spam. This method involves the use of random and irrelevant comments, commonly promoting a commercial service in blo... [Author: Margarette Mcbride - Web Design and Development - June 08, 2010]

    Read the article

  • Lookup table display methods

    - by DAXShekhar
    public static client str lookupTableDisplayMethod(str _tableId) {     SysDictTable        dictTable   = new SysDictTable(str2int(_tableId));     ListEnumerator      enum;     Map                 map         = new Map(Types::String, Types::String);     ;     if (dictTable &&         dictTable.rights() > AccessType::NoAccess)     {         enum = dictTable.getListOfDisplayMethods().getEnumerator();         while (enum.moveNext())         {             map.insert(enum.current(), enum.current());         }     }     return pickList(map, "Display method", tableid2pname(_tableId)); }

    Read the article

  • Interface extension

    - by user877329
    Suppose that I have an input stream interface, which defines a method for reading data. I also have a seekable interface which defines a method for seeking. A natural way of defining a input file is then to implement both input stream and seekable. I want to construct a data decoder from the input stream interface so I can read data from a file or from another stream. The problem is that I also want to implement seek functionality to the data decoder, since I want to be able to step individual records not raw bytes. This is not possible if I only provide an input stream, which does not have the bytewise seek method. Should I skip the seekable interface and add the seek method to input stream instead and force all streams to at least leave it as a nop.

    Read the article

  • Techniques and methods to improve and speedup development

    - by Jlouro
    I just got a new project. It’s a WinForm app. And it’s interesting because I will have the possibility to learn how fish farms work and are managed. I will have to develop touch interfaces, and use datasnap to communicate and sync data between farm and office. The development will be done in DELPHI win32, still not sure about the database, but maybe SQLlite. So now comes the difficult part of the project, building it. I am just finishing one. It took me a lot of time to do it and I am a bit “burned out”. I will have time to relax, not much, but a few days. What I am looking is some tips and tricks and possibly tools to be able to speed up the development. It must be up and running in 2 months. So what tricks do you use to speed up things?

    Read the article

  • Whether to separate out methods or not

    - by Skippy
    I am new to java and want to learn best coding practices and understand why one method is better than another, in terms of efficiency and as the coding becomes more complicated. This is just an example, but I can take the principles from here to apply elsewhere. I have need an option to display stuff, and have put the method stuff separately from the method to ask if the user wants to display the stuff, as stuff has a lot of lines of code. For readability I have done this: public static void displayStuff () { String input = getInput ("Display stuff? Y/N \n"); if (input..equalsIgnoreCase ("Y")) { stuff (); } else if (input.equalsIgnoreCase ("N")) { //quit program } else { //throw error System.out.print("Error! Enter Y or N: \n"); } } private static String stuff () { //to lots of things here return stuff (); } Or public static void displayStuff () { String input = getInput ("Display stuff? Y/N \n"); if (input..equalsIgnoreCase ("Y")) { //to lots of things here stuff; } else if (input.equalsIgnoreCase ("N")) { //quit program } else { //throw error System.out.print("Error! Enter Y or N: \n"); } } Is it better to keep them together and why? Also, should the second method be private or public, if I am asking for data within the class? I am not sure if this is on topic for here. please advise.

    Read the article

  • Sharepoint Guidance Logger: usage, setup and extension

    - by spano
    Introduction Log records are essential to any application for troubleshooting problems. When beginning a new Sharepoint project, one of the first needs is to have a core logging component that can be used throughout the application code. In this post I will talk about the logging solution that we are using (based on the Patterns & Practices Sharepoint Logger ), how to set it up, configure and read logs. SharePoint 2010 includes enhanced functionality for logging and tracing. You can now throttle...(read more)

    Read the article

  • Using "prevent execution of method" flags

    - by tpaksu
    First of all I want to point out my concern with some pseudocode (I think you'll understand better) Assume you have a global debug flag, or class variable named "debug", class a : var debug = FALSE and you use it to enable debug methods. There are two types of usage it as I know: first in a method : method a : if debug then call method b; method b : second in the method itself: method a : call method b; method b : if not debug exit And I want to know, is there any File IO or stack pointer wise difference between these two approaches. Which usage is better, safer and why?

    Read the article

  • Creating Visual Studio Extension Files (VSIX) for Template Deployment

    While working on some plugins for the new Seesmic Desktop PlatformI got sick of copying and pasting some boiler plate code over and over. I had created some helper templates for myself so that I could say FileNew Seesmic Desktop Plugin and get everything I needed initially. This weekend I had some time and formalized those templates into an easy-to-use installer for anyone to consume. NOTE: It is likely that Seesmic themselves will create developer project/item templatesthese were for my own...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • overriding implemented base class methods

    - by user793468
    I read somewhere that the chain of inheritance breaks when you alter a behavior from derived class. What does "altering a behavior" mean here? Is overriding an already implemented method in base class considered as "altering behavior"? Or, does the author mean altering method signatures and the output? Also, I ready Duplicating code is not a good practice, and its a maintenance nightmare. Again, does overriding an already implemented method in base class considered "Duplicating code"? If not, what would be considered as "Duplicating code"? I

    Read the article

  • Can data classes contain methods for validation?

    - by Arturas M
    OK, say I have a data class for a user: public class User { private String firstName; private String lastName; private long personCode; private Date birthDate; private Gender gender; private String email; private String password; Now let's say I want to validate email, whether names are not empty, whether birth date is in normal range, etc. Can I put that validation method in this class together with data? Or should it be in UserManager which in my case handles the lists of these users?

    Read the article

  • Extension to add button "Report to Bugzilla"?

    - by Alois Mahdal
    We have: internal MediaWiki installation for internal documents (we don't use it in completely wiki-like style—only maintainers should normally make changes) internal Bugzilla installation for internal issues including these internal documents on the MediaWiki site Now only the icing on the cake is missing: an automatic button that would appear on each page, being able to open a Bugzilla page pre-fill some fields with information about that page Basically, name What I imagine as a best solution would be a sibling to the ubiquitous "[edit]" button, probably sitting next to it, like in this mock-up:

    Read the article

  • calling methods if previous call success

    - by New Developer
    I my c# program I have to perform 5 steps(tasks) sequentially. basically these five should execute one after the other only the previous task performed is success. Currently I have done it in following style. But this is not very good code style to follow. var isSuccess=false; isSuccess=a.method1(); if(isSuccess) isSuccess=a.method2(); if(isSuccess) isSuccess=a.method3(); if(isSuccess) isSuccess=a.method4(); if(isSuccess) isSuccess=a.method5(); How can I re factor this code. What is the best way I can follow?

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >