Search Results

Search found 5915 results on 237 pages for 'practices'.

Page 117/237 | < Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >

  • Handling Multiple Form Actions on One View?

    - by Pandiya Chendur
    I have multiple master pages in my asp.net mvc web application... Each of the pages add,edit,view and delete functionalities.... What it does is i have to create multiple views for handling add,edit,view and delete functionalities (ie) the user has to navigate to another view to edit/view the details of a record... How to Handle Multiple Form Actions (ie) add,edit,view and delete functionalities on One View?

    Read the article

  • Patterns for avoiding jQuery silent fails

    - by Matias
    Is there any good practice to avoid your jQuery code silently fail? For example: $('.this #is:my(complexSelector)').doSomething(); I know that every time this line get executed, the selector is intended to match at least one element, or certain amount of elements. Is there any standard or good way to validate that? I thought about something like this: var $matchedElements = $('.this #is:my(complexSelector)'); if ($matchedElements.length < 0) throw 'No matched elements'; $matchedElements.doSomething(); Also I think unit testing would be a valid option instead of messing the code. My question may be silly, but I wonder whether there is a better option than the things that I'm currently doing or not. Also, maybe I'm in the wrong way checking if any element match my selector. However, as the page continues growing, the selectors could stop matching some elements and pieces of functionality could stop working inadvertently.

    Read the article

  • Need help in sorting the programming buzz-words

    - by cwap
    How do you sort out the good buzz from the bad buzz? - I really need your help here :) I see a lot of buzz-words nowadays, both here on SO and in school. For example, we had a teacher who everyone respected, who said "be careful about gold-plating and death-by-interfacing". Now, everyone and their mama cries whenever I'm creating an interface.. Another example would be here on SO where lately "premature optimization is the root of all evil", so everytime someone asks a perfomance question, he'll get that sentence thrown in his face. A few months ago I remember it was all about NHibernate in here, etc., etc... These things comes and goes, but only the good buzz stays. Now, how do you seperate the good from the bad? By reading blogs from respected persons? By trying to come to a conclusion on your own, and then try to convince others that you're right? By simply ignoring it?

    Read the article

  • CSS Brace Styles

    - by Nimbuz
    I'm unable to figure how the standard (or just popular) brace style names apply to CSS. Here're all the brace styles: /* one - pico? */ selector { property: value; property: value; } /* two */ selector { property: value; /* declaration starts on newline */ property: value; } /* three */ selector { property: value; property: value; } /* four - Allman or GNU?*/ selector { property: value; /* declaration starts on newline */ property: value; }? /* five */ selector { property: value; property: value; } /* six - horstmann? */ selector { property: value; /* declaration starts on newline */ property: value; } /* seven - banner?*/ selector { property: value; property: value; } /* eight */ selector { property: value; /* declaration starts on newline */ property: value; } Can someone please name each brace style for me? Many thanks!

    Read the article

  • Foreach loop and tasks.

    - by Scott Chamberlain
    I know from the codeing guidlines that I have read you should not do for (int i = 0; i < 5; i++) { Task.Factory.StartNew(() => Console.WriteLine(i)); } Console.ReadLine(); as it will write 5 5's, I understand that and I think i understand why it is happening. I know the solution is just to do for (int i = 0; i < 5; i++) { int localI = i; Task.Factory.StartNew(() => Console.WriteLine(localI)); } Console.ReadLine(); However is something like this ok to do? foreach (MyClass myClass in myClassList) { Task.Factory.StartNew(() => myClass.DoAction()); } Console.ReadLine(); Or do I need to do the same thing I did in the for loop. foreach (MyClass myClass in myClassList) { MyClass localMyClass = myClass; Task.Factory.StartNew(() => localMyClass.DoAction()); } Console.ReadLine();

    Read the article

  • ASP.NET Template Selector/Builder - Dynamic CMS

    - by Ugene
    I am currently building my own CMS for various reasons that could take a long to explain... However i am looking for a dynamic solution to create templates for pages within the CMS and all areas must be editable via the administration area, maybe large text areas broken into multiple areas, text and image area on a page etc. Following on from the above i would like to create the following: Create a new page (selecting a pre-defined template like below) http://img525.imageshack.us/img525/9872/nestedpages.png and then upon editing the page it would have created as many text editors required for each editable region or a file upload control for an image area for example. i am thinking of using nested masterpages for the design elements, just unsure the best-practice way to achieve the above (db structure etc) I somehow hope this provides enough information but are happy to answer any questions you may have. Thanks

    Read the article

  • Programming DataEntry&Forms: Population of Official Common Data Lists

    - by rlb.usa
    As a programmer of data-entry forms of all kinds, I often find myself making fields for things like Country and State. Consider: Perhaps a list the 50 United States names is an easy thing to find (does one include DC?) , but the countries are not. Nearly every site you find has a differing list with all of the political goings on over the years, and they become outdated quickly. What's the best practice regarding population of these kinds of lists? Is there an official list somewhere that one uses to populate these kinds of formal/official fields? Where do you get this data from, when it's not exactly specified in the specs?

    Read the article

  • Global State and Singletons Dependency injection

    - by Manu
    this is a problem i face lot of times when i am designing a new app i'll use a sample problem to explain this think i am writing simple game.so i want to hold a list of players. i have few options.. 1.use a static field in some class private static ArrayList<Player> players = new ArrayList<Integer>(); public Player getPlayer(int i){ return players.get(i); } but this a global state 2.or i can use a singleton class PlayerList{ private PlayerList instance; private PlayerList(){...} public PlayerList getInstance() { if(instance==null){ ... } return instance; } } but this is bad because it's a singleton 3.Dependency injection class Game { private PlayerList playerList; public Game(PlayerList list) { this.list = list; } public PlayerList getPlayerList() { return playerList; } } this seems good but it's not, if any object outside Game need to look at PlayerList (which is the usual case) i have to use one of the above methods to make the Game class available globally. so I just add another layer to the problem. didn't actually solve anything. what is the optimum solution ? (currently i use Singleton approach)

    Read the article

  • Is it okay to violate the principle that collection properties should be readonly for performance?

    - by uriDium
    I used FxCop to analyze some code I had written. I had exposed a collection via a setter. I understand why this is not good. Changing the backing store when I don't expect it is a very bad idea. Here is my problem though. I retrieve a list of business objects from a Data Access Object. I then need to add that collection to another business class and I was doing it with the setter method. The reason I did this was that it is going to be faster to make an assignment than to insert hundreds of thousands of objects one at a time to the collection again via another addElement method. Is it okay to have a getter for a collection in some scenarios? I though of rather having a constructor which takes a collection? I thought maybe I could pass the object in to the Dao and let the Dao populate it directly? Are there any other better ideas?

    Read the article

  • Assignment in conditional operator

    - by DuoSRX
    I've seen a lot this kind of code recently : if ($foo = $bar->getFoo()) { baz($foo); } Is this considered good or bad practice ? For example, Netbeans IDE give a notice if you use this kind of code : Possible accidental assignment, assignments in conditions should be avoided What do you think ?

    Read the article

  • Mandatory method documentation

    - by Sjoerd
    On my previous job, providing all methods with javadoc was mandatory, which resulted in things like this: /** * Sets the Frobber. * * @param frobber The frobber */ public setFrobber(Frobber frobber) { ... } As you can see, the documentation adds little to the code, but takes up space and work. Should documenting all methods be mandatory or optional? Is there a rule for which methods to document? What are pros and cons of requiring every method to be documented?

    Read the article

  • Python: Calling method A from class A within class B?

    - by Tommo
    There are a number of questions that are similar to this, but none of the answers hits the spot - so please bear with me. I am trying my hardest to learn OOP using Python, but i keep running into errors (like this one) which just make me think this is all pointless and it would be easier to just use methods. Here is my code: class TheGUI(wx.Frame): def __init__(self, title, size): wx.Frame.__init__(self, None, 1, title, size=size) # The GUI is made ... textbox.TextCtrl(panel1, 1, pos=(67,7), size=(150, 20)) button1.Bind(wx.EVT_BUTTON, self.button1Click) self.Show(True) def button1Click(self, event): #It needs to do the LoadThread function! class WebParser: def LoadThread(self, thread_id): #It needs to get the contents of textbox! TheGUI = TheGUI("Text RPG", (500,500)) TheParser = WebParser TheApp.MainLoop() So the problem i am having is that the GUI class needs to use a function that is in the WebParser class, and the WebParser class needs to get text from a textbox that exists in the GUI class. I know i could do this by passing the objects around as parameters, but that seems utterly pointless, there must be a more logical way to do this that doesn't using classes seem so pointless? Thanks in advance!

    Read the article

  • java swt design patterns

    - by zachary
    What are some good design patterns for creating a form in java? I have an app that has 6 tabs with a different form in each. How does the typical java programmer go about making these items accessible? For example as a wpf programmer I might databind all these controls to underlying objects. What do java programmers like to do?

    Read the article

  • Will this be garbage collected in JVM?

    - by stjowa
    I am running the following code every two minutes via a Timer: object = new Object(this); Potentially, this is a lot of objects being created and a lot of objects being overwritten. Do the overwritten objects get garbage collected, even with a reference to itself being used in the newly created object? I am using JDK 1.6.0_13. Thanks for the help.

    Read the article

  • Imposing email limits on web page

    - by Martin
    To avoid spammers, what's a good strategy for imposing limits on users when sending email from our site? A count limit per day on individual IPs? Sender emails? Domains? In general terms, but recommended figures will also be helpful. Our users can send emails through our web page. They can register and log in but are also allowed to do this without logging in, but with a captcha and with a field for the senders email. Certainly, there is a header, "The user has sent you the following message.", limiting the use for spammers, so perhaps it's not a big problem. Any comments on what I'm doing will be greatly appreciated.

    Read the article

  • SQL - when should you use "with (nolock)"

    - by Andy White
    Can someone explain the implications of using "with (nolock)" on queries, when you should/shouldn't use it? For example, if you have a banking application with high transaction rates and a lot of data in certain tables, in what types of queries would nolock be okay? Are there cases when you should always use it/never use it?

    Read the article

  • Tracking user changes in ASP.NET MVC

    - by Ian Roke
    I have a requirement to track what authenticated users change with regards to the data when logged in. I don't need to track what pages they look at although that could be very useful in future. I have thought about saving the User Guid but that seems very clunky. Are there other methods/best practises?

    Read the article

  • Do I need to cast the result of strtol to int?

    - by Kristo
    The following code does not give a warning with g++ 4.1.1 and -Wall. int octalStrToInt(const std::string& s) { return strtol(s.c_str(), 0, 8); } I was expecting a warning because strtol returns a long int but my function is only returning a plain int. Might other compilers emit a warning here? Should I cast the return value to int in this case as a good practice?

    Read the article

< Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >