Search Results

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

Page 121/237 | < Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >

  • [asp.net-mvc]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

  • One database or many?

    - by dsims
    I am developing a website that will manage data for multiple entities. No data is shared between entities, but they may be owned by the same customer. A customer may want to manage all their entities from a single "dashboard". So should I have one database for everything, or keep the data seperated into individual databases? Is there a best-practice? What are the positives/negatives for having a: database for the entire site (entity has a "customerID", data has "entityID") database for each customer (data has "entityID") database for each entity (relation of database to customer is outside of database) Multiple databases seems like it would have better performance (fewer rows and joins) but may eventually become a maintenance nightmare.

    Read the article

  • Can JavaScript be overused?

    - by ledhed2222
    Hello stackoverflow, I'm a "long time reader first time poster", glad to start participating in this forum. My experience is with Java, Python, and several audio programming languages; I'm quite new to the big bad web technologies: HTML/CSS/JavaScript. I'm making two personal sites right now and am wondering if I'm relying on JavaScript too much. I'm making a site where all pages have a bit of markup in common--stuff like the nav bar and some sliced background images--so I thought I'd make a pageInit() function to insert the majority of the HTML for me. This way if I make a change later, I just change the script rather than all the pages. I figure if users are paranoid enough to have JavaScript turned off, I'll give them an alert or something. Is this bad practice? Can JavaScript be overused? Thanks in advance.

    Read the article

  • Preferred way of filling up a C++ vector of structs

    - by henle
    Alternative 1, reusing a temporary variable: Sticker sticker; sticker.x = x + foreground.x; sticker.y = foreground.y; sticker.width = foreground.width; sticker.height = foreground.height; board.push_back(sticker); sticker.x = x + outline.x; sticker.y = outline.y; sticker.width = outline.width; sticker.height = outline.height; board.push_back(sticker); Alternative 2, scoping the temporary variable: { Sticker sticker; sticker.x = x + foreground.x; sticker.y = foreground.y; sticker.width = foreground.width; sticker.height = foreground.height; board.push_back(sticker); } { Sticker sticker; sticker.x = x + outline.x; sticker.y = outline.y; sticker.width = outline.width; sticker.height = outline.height; board.push_back(sticker); } Alternative 3, writing straight to the vector memory: { board.push_back(Sticker()); Sticker &sticker = board.back(); sticker.x = x + foreground.x; sticker.y = foreground.y; sticker.width = foreground.width; sticker.height = foreground.height; } { board.push_back(Sticker()); Sticker &sticker = board.back(); sticker.x = x + outline.x; sticker.y = outline.y; sticker.width = outline.width; sticker.height = outline.height; } Which approach do you prefer?

    Read the article

  • where to place browser event (resize/scroll) detection call

    - by karl
    I'm trying to alert a message when the browser is resized or scrolled. I'm detecting the 2 events in the body <body onResize="doDisp();" onScroll="doDisp();" > where doDisp is this inside the <script> tag <script type="text/javascript"> function doDisp(){ alert("browser changing state"); } </script> but isn't it bad practice to have javascript in the body tag? Is there a cross-browser way to keep all the javascript inside the <script> tags?

    Read the article

  • Parent-child table layout

    - by cyberzed
    I'm currently planning a piece of software for dogbreeders and I'm in doubt about my datadesign...whether I'm doing something smart or stupid :) The plan at the moment is one holistic "dog" table sorta like this... Id | Name | FatherId | MotherId ------------------------------- 1 | A | 0 | 0 2 | B | 1 | 0 3 | C | 0 | 0 4 | D | 0 | 3 5 | E | 1 | 3 6 | F | 5 | 2 7 | G | 4 | 3 My questions is, is it common to make it like this or is it really sloppy. I can see a quick lookup reason to have it but I'm really in doubt whether it's good or bad in the end. I thinking it would be better designed if I had a rel-table on the side with Id coupling, but I'm really in doubt how well any of the cases are. A side note is that it'll only be me personally looking at the data this way (or someone adopting the project from me)

    Read the article

  • When using Sessions is bad thing, and whats wrong with it?

    - by Amr ElGarhy
    I know that in community server which means that you can't use Sessions, and few years ago i remember i was working on a website where we were not allowed to use sessions. In my point of view sessions are a very helpful tool if we managed how to use the right way, but is using session variable in a website is something bad, when its bad and when its not?

    Read the article

  • Beginner for Delphi Network!

    - by Blagoj
    Hello, I worked in Delphi 6 a few years. Now I was beginning in Delphi network and I need some source code For following things: I want make chat application which to have two peer to peer clients But I don’t know how I to measure time for two clients and show it on both Screens. I also want to mark first client with 1,second with 2 ,,,,, In some application I want to have value who accounting number of sending of both clients Generally does it exist variable which is mutual for both clients?! Can somebody to send me source code of this kind?! Comments in source code will be welcome. Thank You Blagoj [email removed, return to this site for answer(s)]

    Read the article

  • Is it a bad programming practice to have "Public" members inside an "Internal" class?

    - by Amby
    I mean, won;t it be more specific and appropriate if i "only" keep "protected","internal" and "private" members (field,method,property,event) in a class which is declared as "internal" ? I have seen this practice ( having "public" members in an "internal" class) in various code so just wanted to know is it a bad practice or does it has some benefit or advantage. [Only concerned about C#] Thanks for your interest.

    Read the article

  • Abstract away a compound identity value for use in business logic?

    - by John K
    While separating business logic and data access logic into two different assemblies, I want to abstract away the concept of identity so that the business logic deals with one consistent identity without having to understand its actual representation in the data source. I've been calling this a compound identity abstraction. Data sources in this project are swappable and various and the business logic shouldn't care which data source is currently in use. The identity is the toughest part because its implementation can change per kind of data source, whereas other fields like name, address, etc are consistently scalar values. What I'm searching for is a good way to abstract the concept of identity, whether it be an existing library, a software pattern or just a solid good idea of some kind is provided. The proposed compound identity value would have to be comparable and usable in the business logic and passed back to the data source to specify records, entities and/or documents to affect, so the data source must be able to parse back out the details of its own compound ids. Data Source Examples: This serves to provide an idea of what I mean by various data sources having different identity implementations. A relational data source might express a piece of content with an integer identifier plus a language specific code. For example. content_id language Other Columns expressing details of content 1 en_us 1 fr_ca The identity of the first record in the above example is: 1 + en_us However when a NoSQL data source is substituted, it might somehow represent each piece of content with a GUID string 936DA01F-9ABD-4d9d-80C7-02AF85C822A8 plus language code of a different standardization, And a third kind of data source might use just a simple scalar value. So on and so forth, you get the idea.

    Read the article

  • BlackBerry - Multiple Screens or Single Screen with Content Manager?

    - by Max Gontar
    Hi! I've seen projects which use many screens each one for different layout and functionality. I've seen projects with only one screen (like wizard workflow) where content is changed on user interaction (and this seems to be logical to use single screen in wizards). But also I've seen projects (apps like game or messenger or phone settings utility) which use single screen for different functionalities. I can see such advantages of having single screen in app: keep same decoration design and menu or toolbar (which may be also achieved with inheritance) keep single screen in ui stack (which may be achieved by pop/push screen) easy to handle data over application Can you tell other advantages/disadvantages of single screen app? When its better to use this approach? Thank you!

    Read the article

  • Creating and Compiling a C++ project on Windows

    - by sc_ray
    I need to work on C++ project on my windows machine. My project will consist of various classes(.h and .cpp) as well as the startup file to start the application. The preliminary design is simple but the application has the potential to gain complexity as time goes by. What I need here is ideas to set up the C++ project compiler/IDE/Makefile etc..etc. as well as some standard tools besides Visual C++ to compile/build/link projects such as these on a Windows OS. Thanks

    Read the article

  • Throwing special type of exception to terminate unit test

    - by trendl
    Assume I want to write a unit test to test a particular piece of functionality that is implemented within a method. If I wanted to execute the method completely, I would have to do some extra set up work (mock objects expectations etc.). Instead of doing that I use the following approach: - I set up the expectations I'm interested in verifying and then make the tested method throw a special type of exception (e.g. TerminateTestException). - Further down in the unit test I catch the exception and verify the mock object expectations. It works fine but I'm not sure it is good practice. I do not do this regularly, only in cases where it saves me time and effort. One thing that comes to mind as an argument against using this is that throwing exceptions takes long time so the tests execute slower than if I used a different approach.

    Read the article

  • What goes into the "Controller" in "MVC"?

    - by P72endragon
    I think I understand the basic concepts of MVC - the Model contains the data and behaviour of the application, the View is responsible for displaying it to the user and the Controller deals with user input. What I'm uncertain about is exactly what goes in the Controller. Lets say for example I have a fairly simple application (I'm specifically thinking Java, but I suppose the same principles apply elsewhere). I organise my code into 3 packages called app.model, app.view and app.controller. Within the app.model package, I have a few classes that reflect the actual behaviour of the application. These extends Observable and use setChanged() and notifyObservers() to trigger the views to update when appropriate. The app.view package has a class (or several classes for different types of display) that uses javax.swing components to handle the display. Some of these components need to feed back into the Model. If I understand correctly, the View shouldn't have anything to do with the feedback - that should be dealt with by the Controller. So what do I actually put in the Controller? Do I put the public void actionPerformed(ActionEvent e) in the View with just a call to a method in the Controller? If so, should any validation etc be done in the Controller? If so, how do I feedback error messages back to the View - should that go through the Model again, or should the Controller just send it straight back to View? If the validation is done in the View, what do I put in the Controller? Sorry for the long question, I just wanted to document my understanding of the process and hopefully someone can clarify this issue for me!

    Read the article

  • Is object clearing/array deallocation really necessary in VB6/VBA (Pros/Cons?)

    - by Oorang
    Hello, A lot of what I have learned about VB I learned from using Static Code Analysis (Particularly Aivosto's Project Analyzer). And one one of things it checks for is whether or not you cleared all objects and arrays. I used to just do this blindly because PA said so. But now that I know a little bit more about the way VB releases resources, it seems to me that these things should be happening automatically. Is this a legacy feature from pre VB6, or is there a reason why you should explicitly set objects back to nothing and use Erase on arrays?

    Read the article

  • Parsing timestamps - do it in MySQL or in PHP?

    - by Andrew Heath
    Let's say you've got a table with a timestamp column, and you want to parse that column into two arrays - $date and $time. Do you, personally: a) query like this DATE(timestamp), TIME(timestamp) , or perhaps even going as far as HOUR(timestamp), MINUTE(timestamp b) grab the timestamp column and parse it out as needed with a loop in PHP I feel like (a) is easier... but I know that I don't know anything. And it feels a little naughty to make my query hit the same column 2 or 3 times for output... Is there a best-practice for this?

    Read the article

  • Guidance on using drop in DLLs

    - by Scott Chamberlain
    I have been giving the task to rewrite a internal utility in .net for my work. One of program requirements the new system has is have a dll that implements a set of interfaces and have the program call the DLL. Now this dll will be changed out a lot per deployment. My question is what is the best way to do it from a development standpoint? Do I add a template DLL (one that only has the interfaces but no implementation) to the project references like I would do any other dll that I would use. Or do I need to use somthing like this every time I want to use code from the dll? var DropIn = System.Reflection.Assembly.LoadFrom("DropInDll.dll"); var getActions = DropIn.GetType("Main").GetMethod("GetActions"); List<IAction> ActionList = (List<IAction>)getActions.Invoke(null, null);

    Read the article

  • One SVN repository or many?

    - by nickf
    If you have multiple, unrelated projects, is it a good idea to put them in the same repository? myRepo/projectA/trunk myRepo/projectA/tags myRepo/projectA/branches myRepo/projectB/trunk myRepo/projectB/tags myRepo/projectB/branches or would you create new repositories for each? myRepoA/trunk myRepoA/tags myRepoA/branches myRepoB/trunk myRepoB/tags myRepoB/branches What are the pros and cons of each? All that I can currently think of is that you get mixed revision numbers (so what?), and that you can't use svn:externals unless the repository is actually external. (i think?) The reason I ask is because I'm considering consolidating my multiple repos into one, since my SVN host has started charging per repo.

    Read the article

  • How do you like to define your module-wide variables in drupal 6?

    - by sprugman
    I'm in my module file. I want to define some complex variables for use throughout the module. For simple things, I'm doing this: function mymodule_init() { define('SOME_CONSTANT', 'foo bar'); } But that won't work for more complex structures. Here are some ideas that I've thought of: global: function mymodule_init() { $GLOBALS['mymodule_var'] = array('foo' => 'bar'); } variable_set: function mymodule_init() { variable_set('mymodule_var', array('foo' => 'bar')); } property of a module class: class MyModule { static $var = array('foo' => 'bar'); } Variable_set/_get seems like the most "drupal" way, but I'm drawn toward the class setup. Are there any drawbacks to that? Any other approaches out there?

    Read the article

  • Should the function or the caller be resonsible for input validation?

    - by haudenschilt
    I'm doing a security audit on a fairly large php application and was wondering where I should include my user-input validation. Should I validate the data, then send the clean data off to the back-end functions or should I rely on each function to do it's own validation? Or even both? Is there any standard or best-practice for this sort of thing? Currently the app does both inconsistently and I'll like to make things more consistent.

    Read the article

  • Is it the best practice to extract an interface for every class?

    - by the_drow
    I have seen code where every class has an interface that it implements. Sometimes there is no common interface for them all. They are just there and they are used instead of concreate objects. They do not offer a generic interface for two classes and are specific to the domain of the problem that the class solves. Is there any reason to do that?

    Read the article

  • Where does one get data like Country:(list) State:(list)

    - by rlb.usa
    As a programmer of data-entry forms of all kinds, I often find myself making fields for things like Country: <choose from list>, State: <choose from list>, Race/Ethnicity: <choose from list>. 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/common practice regarding population of these kinds of lists? Where does this data come from if it's not given in the specs?

    Read the article

  • How to deal with multiple screensizes + dynamic controls in Android?

    - by chobo2
    Hi I am learning how to program on Android phone. However I am unsure how to make my application work for the different screen sizes and resolutions. I read the tutorial on the android site and still unsure how to do it. First I know there are different files so could make a layout for each of the sizes but my problem is most of the screen needs to be dynamically created so there would not be much to put in these files. So I am not sure how to android to re size dynamic controls based on the screen size. I have also read it is bad practice to make controls in anything but the xml file as it separates view logic and programming logic. However they never talk about if you need to make these controls dynamically what you should do. So is there some other way to do it that is considered good practice?

    Read the article

< Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >