Search Results

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

Page 70/237 | < Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >

  • How do I remove a folder from Windows Distributed File System?

    - by digiguru
    We recently moved to a webfarm and setup dfs, only to find a beta application was creating files like there was no tomorrow. 1.2 million files were replicated across the farm, and since then we have prevented the application from creating new files, but every time we try to remove the files, it replaces them on each server because of replication. The process of replacing them actually causes to server to run slowly and in some cases stall. Is there any way we can stop replication at a folder level?

    Read the article

  • Best practice? iphone: sync data

    - by Andy Jacobs
    So i'm working on a project where there is data visualization. My ultimate goal is that i have a set of data shipped with the download of the iphone app. But i want it connected to a backend, that if the iphone has a connection with the internet. it can sync the changes from the backend. The syncing is no problem or the connection between the backend & the iphone. But what should i use as data storage on my iphone? what is the best way. my data is purely text and doesn't have to be secure. But it's main feature should be updating certain parts of data ( adding and deleting are not so important ) so what is the easiest (read: least time consuming development ) or the best way? sqlite? plist? ..?

    Read the article

  • What is the best practice for using lock within inherited classes

    - by JDMX
    I want to know if one class is inheriting from another, is it better to have the classes share a lock object that is defined at the base class or to have a lock object defined at each inheritance level. A very simple example of a lock object on each level of the class public class Foo { private object thisLock = new object(); private int ivalue; public int Value { get { lock( thisLock ) { return ivalue; } } set { lock( thisLock ) { ivalue= value; } } } } public class Foo2: Foo { private object thisLock2 = new object(); public int DoubleValue { get { lock( thisLock2 ) { return base.Value * 2; } } set { lock( thisLock2 ) { base.Value = value / 2; } } } } public class Foo6: Foo2 { private object thisLock6 = new object(); public int TripleDoubleValue { get { lock( thisLock6 ) { return base.DoubleValue * 3; } } set { lock( thisLock6 ) { base.DoubleValue = value / 3; } } } } A very simple example of a shared lock object public class Foo { protected object thisLock = new object(); private int ivalue; public int Value { get { lock( thisLock ) { return ivalue; } } set { lock( thisLock ) { ivalue= value; } } } } public class Foo2: Foo { public int DoubleValue { get { lock( thisLock ) { return base.Value * 2; } } set { lock( thisLock ) { base.Value = value / 2; } } } } public class Foo6: Foo2 { public int TripleDoubleValue { get { lock( thisLock ) { return base.DoubleValue * 3; } } set { lock( thisLock ) { base.DoubleValue = value / 3; } } } } Which example is the preferred way to manage locking within an inherited class?

    Read the article

  • html & javascript: How to store data referring to html elements

    - by Dan
    Hello, I'm working on a web application that uses ajax to communicate to the server. My specific situation is the following: I have a list of users lined out in the html page. On each of these users i can do the following: change their 'status' or 'remove' them from the account. What's a good practice for storing information in the page about the following: the user id the current status of the user P.S.: I'm using jQuery.

    Read the article

  • Database design for credit based purchases

    - by FreshCode
    I need an elegant way to implement credit-based purchases for an online store with a small variety of products which can be purchased using virtual credit or real currency. Alternatively, products could only be priced in credits. Previous work I have implemented credit-based purchasing before using different product types (eg. Credit, Voucher or Music) with post-order processing to assign purchased credit to users in the form of real currency, which could subsequently be used to discount future orders' charge totals. This worked fairly well as a makeshift solution, but did not succeed in disconnecting the virtual currency from the real currency, which is what I'd like to do, since spending credits is psychologically easier for customers than spending real currency. Design I need guidance on designing the database correctly with support for the simultaneous bulk purchase of credits at a discount along with real currency products. Alternatively, should all products be priced in credits and only credit have a real currency value? Existing Database Design Partial Products table: ProductId Title Type UnitPrice SalePrice Partial Orders table: OrderId UserId (related to Users table, not shown) Status Value Total Partial OrderItems table (similar to CartItems table): OrderItemId OrderId (related to Orders table) ProductId (related to Products table) Quantity UnitPrice SalePrice Prospective UserCredits table: CreditId UserId (related to Users table, not shown) Value (+/- value. Summed over time to determine saldo.) Date I'm using ASP.NET MVC and LINQ-to-SQL on a SQL Server database.

    Read the article

  • Is it good or bad practice to use var everywhere? [closed]

    - by Earlz
    Possible Duplicate: Use of var keyword in C# Hello, I've recently been discovering the awesomeness that is the var keyword in C#. Well, I didn't think about it before but I just wrote lines of code that are along the lines of var con=CreateNewConnection(); Where this would usually be IdbConnection con=CreateNewConnection(); Is this a good use of var? Is it possible to use var too often? Are there any downsides to using it? Also, one more point of consideration: We are not worried about backwards compatability. We just care that it runs on .NET 3.5

    Read the article

  • Difference between URI and URL

    - by Sarfraz
    If you read the documentation of CodeIgniter or Kohana, there is a lot of confusion about the usage of URI and URL. Sometimes they use one and other times the other. They also incorporate URI class which makes it easier working with URLs. I know that: URI stands for Uniform Resource Identifier URL stands for Uniform Resource Locator But that doesn't make much sense. What exactly is the difference? or are they same?

    Read the article

  • Rank Source Control Optionsl-VSS vs CVS vs none vs your own hell

    - by Roman A. Taycher
    It seems like a lit of people here and on many programmer wikis/blogs/ect. elsewhere really dislike VSS. A lot of people also have a serious dislike for cvs. In many places I have heard a lot of differing opinions on whether or not using vss or cvs is better or worse then using no source control, please rate the worst and explain why!!!!! you rated them this way. Feel free to throw in your own horrible system in the rankings. If you feel it depends on the circumstances try to explain the some of the different scenarios which lead to different rankings. (note:I see a lot of discussion of what is better but little of what is worse.) second note: while both answers are nice I'm looking less for good replacements and more for a comparison of which is worse and more importantly why!!!!!

    Read the article

  • Convert methods from Java-actionscript to ObjectiveC

    - by eco_bach
    Hi I'm tring to convert the following 3 methods from java-actionscript to Objective C. Part of my confusion I think is not knowing what Number types, primitives I should be using. ie in actionscript you have only Number, int, and uint. These are the 3 functions I am trying to convert public function normalize(value:Number, minimum:Number, maximum:Number):Number { return (value - minimum) / (maximum - minimum); } public function interpolate(normValue:Number, minimum:Number, maximum:Number):Number { return minimum + (maximum - minimum) * normValue; } public function map(value:Number, min1:Number, max1:Number, min2:Number, max2:Number):Number { return interpolate( normalize(value, min1, max1), min2, max2); } This is what I have so far -(float) normalize:(float*)value withMinimumValue:(float*)minimum withMaximumValue:(float*)maximum { return (value - minimum) / (maximum - minimum); } -(float) interpolate:(float*)normValue withMinimumValue:(float*)minimum withMaximumValue:(float*)maximum { return minimum + (maximum - minimum) * normValue; } -(float) map:(float*)value withMinimumValue1:(float*)min1 withMaximumValue1:(float*)max1 withMinimumValue2:(float*)min2 withMaximumValue2:(float*)max2 { return interpolate( normalize(value, min1, max1), min2, max2); }

    Read the article

  • Split html text in a SEO friendly manner

    - by al nik
    I've some html text like <h1>GreenWhiteRed</h1> Is it SEO friendly to split this text in something like <h1><span class="green">Green</span><span class="white">White</span><span class="red">Red</span></h1> Is the text still ranking well and is it interpreted as a single word 'GreenWhiteRed'?

    Read the article

  • In Ruby, how to implement global behaviour?

    - by Gordon McAllister
    Hi all, I want to implement the concept of a Workspace. This is a global concept - all other code will interact with one instance of this Workspace. The Workspace will be responsible for maintaining the current system state (i.e. interacting with the system model, persisting the system state etc) So what's the best design strategy for my Workspace, bearing in mind this will have to be testable (using RSpec now, but happy to look at alternatives). Having read thru some open source projects out there and I've seen 3 strategies. None of which I can identify as "the best practice". They are: Include the singleton class. But how testable is this? Will the global state of Workspace change between tests? Implemented all behaviour as class methods. Again how do you test this? Implemented all behaviour as module methods. Not sure about this one at all! Which is best? Or is there another way? Thanks, Gordon

    Read the article

  • Normalize or Denormalize in high traffic websites

    - by Inam Jameel
    what is the best practice for database design for high traffic websites like this one stackoverflow? should one must use normalize database for record keeping or normalized technique or combination of both? is it sensible to design normalize database as main database for record keeping to reduce redundancy and at the same time maintain another denormalized form of database for fast searching? or main database should be denormalize and one can make normalized views in the application level for fast database operations? or beside above mentioned approach? what is the best practice of designing high traffic websites???

    Read the article

  • Should I map a domain object to a view model using an optional constructor?

    - by Byron Sommardahl
    I'd like to be able to map a domain model to a view model by newing up a view model and passing in the contributing domain model as a parameter (like the code below). My motivation is to keep from re-using mapping code AND to provide a simple way to map (not using automapper yet). A friend says the view model should not know anything about the "payment" domain model that's being passed into the optional constructor. What do you think? public class LineItemsViewModel { public LineItemsViewModel() { } public LineItemsViewModel(IPayment payment) { LineItemColumnHeaders = payment.MerchantContext.Profile.UiPreferences.LineItemColumnHeaders; LineItems = LineItemDomainToViewModelMapper.MapToViewModel(payment.LineItems); ConvenienceFeeAmount = payment.ConvenienceFee.Fee; SubTotal = payment.PaymentAmount; Total = payment.PaymentAmount + payment.ConvenienceFee.Fee; } public IEnumerable<Dictionary<int, string>> LineItems { get; set; } public Dictionary<int, string> LineItemColumnHeaders { get; set; } public decimal SubTotal { get; set; } public decimal ConvenienceFeeAmount { get; set; } public decimal Total { get; set; } }

    Read the article

  • Whats the point of STL?

    - by Jonathan D
    I've been programming c++ for about a year now and when i'm looking about i see lots of references to STL. Can some one please tell me what it does? and the advantages and disadvantageous of it? thanks

    Read the article

  • iPhone development: Best method to allow user to chose search scope

    - by Mark Pemburn
    Hi, I'm developing my first iPhone app and want to allow the user to select the scope of their search in a more complex way than the 'scope buttons' permit. The app is related to wines and I want to the user to be able to select the 'color' (Red, White, Blush, etc.) first, and then select the type/varietal within that category. Right now, I'm using the UISearchBar's scope buttons for the colors and tapping the button opens a view with the selection of colors. This is okay except that once the 'Red' button has been selected, I can't select it a second time to change my choice of type (e.g., change from 'Merlot' to 'Syrrah', etc.) If there's a better way to do this, I'm willing to scrap my method and start from scratch. Thanks!

    Read the article

  • MVC architectural question - Where should payment processing go?

    - by Keltex
    This question is related to my ASP.NET MVC 2 development, but it could apply to any MVC environment and a question of where the logic should go. So let's say I have a controller that takes an online payment such as a shopping cart application. And I have the method that accepts the customers' credit card information: public class CartController : Controller CartRepository cartRepository = new CartRepository() [HttpPost] public ActionResult Payment(PaymentViewModel rec) { if(!ModelState.IsValid) { return View(rec); } // process payment here return RedirectToAction("Receipt"); } At the comment process payment here should the payment processing be handled: In the controller? By the repository? Someplace else?

    Read the article

  • Best practice No1: inline search layout across browsers

    - by Sixfoot Studio
    Ok, I have managed to fix my version of this example using a multitude of hacks and I would like to see how others would tackle this problem making this cross-browser compatible without too many hacks. <div class="searchDiv"> <img src="Images/left.gif" class="left" height="19" width="3" /> <input id="TextBox" type="text" class="searchField" /> <img src="Images/right.gif" height="19"width="3" class="right" /> <a href="" class="submit">Submit</a> <img src="Images/box-arrow.gif" class="linkArrow" width="8" height="14" /> </div> I am using a Transitional DTD in my example. Based on the everyone else's CSS examples, comments and answers I will make the final vote. I'd love to see more of these scenarios come up so that people have a library of "best practice" methods which they can find on SO. Good luck

    Read the article

  • What is the best way to post data from web browser to server?

    - by Kronass
    Hi, I want to know what is the best way to send data from web browser to server using post method. I've seen a practice where they wrap all the elements data in XML, convert it into Base64 string and then post it to the server (via Ajax or hidden field). this way will not work if the Javascript is disabled, any how if I ignored this. is it a good practice to wrap elements into XML (or create my custom wrapper in general) and post them to server saying it will enhance the maintainability of the code or just stick with the classical way and no need to add unnecessary text in the post.

    Read the article

  • When should I be cautious using about data binding in .NET?

    - by Ben McCormack
    I just started working on a small team of .NET programmers about a month ago and recently got in a discussion with our team lead regarding why we don't use databinding at all in our code. Every time we work with a data grid, we iterate through a data table and populate the grid row by row; the code usually looks something like this: Dim dt as DataTable = FuncLib.GetData("spGetTheData ...") Dim i As Integer For i = 0 To dt.Rows.Length - 1 '(not sure why we do not use a for each here)' gridRow = grid.Rows.Add() gridRow(constantProductID).Value = dt("ProductID").Value gridRow(constantProductDesc).Value = dt("ProductDescription").Value Next '(I am probably missing something in the code, but that is basically it)' Our team lead was saying that he got burned using data binding when working with Sheridan Grid controls, VB6, and ADO recordsets back in the nineties. He's not sure what the exact problem was, but he remembers that binding didn't work as expected and caused him some major problems. Since then, they haven't trusted data binding and load the data for all their controls by hand. The reason the conversation even came up was because I found data binding to be very simple and really liked separating the data presentation (in this case, the data grid) from the in-memory data source (in this case, the data table). "Loading" the data row by row into the grid seemed to break this distinction. I also observed that with the advent of XAML in WPF and Silverlight, data-binding seems like a must-have in order to be able to cleanly wire up a designer's XAML code with your data. When should I be cautious of using data-binding in .NET?

    Read the article

  • What is considered a long execution time?

    - by stjowa
    I am trying to figure out just how "efficient" my server-side code is. Using start and end microtime(true) values, I am able to calculate the time it took my script to run. I am getting times from .3 - .5 seconds. These scripts do a number of database queries to return different values to the user. What is considered an efficient execution time for PHP scripts that will be run online for a website? Note: I know it depends on exactly what is being done, but just consider this a standard script that reads from a database and returns values to the user. Also, I look at Google and see them search the internet in .15 seconds and I feel like my script is crap. Thanks.

    Read the article

  • Is it bad practice to apply class-based design to JavaScript programs?

    - by helixed
    JavaScript is a prototyped-based language, and yet it has the ability to mimic some of the features of class-based object-oriented languages. For example, JavaScript does not have a concept of public and private members, but through the magic of closures, it's still possible to provide the same functionality. Similarly, method overloading, interfaces, namespaces and abstract classes can all be added in one way or another. Lately, as I've been programming in JavaScript, I've felt like I'm trying to turn it into a class-based language instead of using it in the way it's meant to be used. It seems like I'm trying to force the language to conform to what I'm used to. The following is some JavaScript code I've written recently. It's purpose is to abstract away some of the effort involved in drawing to the HTML5 canvas element. /* Defines the Drawing namespace. */ var Drawing = {}; /* Abstract base which represents an element to be drawn on the screen. @param The graphical context in which this Node is drawn. @param position The position of the center of this Node. */ Drawing.Node = function(context, position) { return { /* The method which performs the actual drawing code for this Node. This method must be overridden in any subclasses of Node. */ draw: function() { throw Exception.MethodNotOverridden; }, /* Returns the graphical context for this Node. @return The graphical context for this Node. */ getContext: function() { return context; }, /* Returns the position of this Node. @return The position of this Node. */ getPosition: function() { return position; }, /* Sets the position of this Node. @param thePosition The position of this Node. */ setPosition: function(thePosition) { position = thePosition; } }; } /* Define the shape namespace. */ var Shape = {}; /* A circle shape implementation of Drawing.Node. @param context The graphical context in which this Circle is drawn. @param position The center of this Circle. @param radius The radius of this circle. @praram color The color of this circle. */ Shape.Circle = function(context, position, radius, color) { //check the parameters if (radius < 0) throw Exception.InvalidArgument; var node = Drawing.Node(context, position); //overload the node drawing method node.draw = function() { var context = this.getContext(); var position = this.getPosition(); context.fillStyle = color; context.beginPath(); context.arc(position.x, position.y, radius, 0, Math.PI*2, true); context.closePath(); context.fill(); } /* Returns the radius of this Circle. @return The radius of this Circle. */ node.getRadius = function() { return radius; }; /* Sets the radius of this Circle. @param theRadius The new radius of this circle. */ node.setRadius = function(theRadius) { radius = theRadius; }; /* Returns the color of this Circle. @return The color of this Circle. */ node.getColor = function() { return color; }; /* Sets the color of this Circle. @param theColor The new color of this Circle. */ node.setColor = function(theColor) { color = theColor; }; //return the node return node; }; The code works exactly like it should for a user of Shape.Circle, but it feels like it's held together with Duct Tape. Can somebody provide some insight on this?

    Read the article

  • Spring MVC Best Practice Handling Unrecoverable Exceptions In Controller

    - by jboyd
    When you have a controller that does logic with services and DAO's that may throw an unrecoverable exception, what is the best practice in dealing with those method calls? Currently an app I'm working on has very lengthy try catch methods that simply err.out exception messages, this doesn't seem very robust and I think that this code smells, is there any cookie cutter best practice for handling this in spring-mvc?

    Read the article

  • Is it naughty to have a large utility file?

    - by banister
    In my C project I have quite a large utils.c file. It is really full of many utilities of different sorts. I feel a bit naughty just stuffing different miscellaneous functions in there. For example it has some utilities related to low level stuff such as a lowercase() function, and it also has some quite sophisticated utilities such as converting to/from different colour formats. My question is, is it very naughty to have such a large utils.c with many different types of utilities in it? Should I break it up into many different kinds of utility files? Such as graphics_utils.c and so on What do you think?

    Read the article

< Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >