Search Results

Search found 7182 results on 288 pages for 'factory pattern'.

Page 6/288 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • iPad: How To Soft Reset, Restore Factory Settings And Erase All Content

    - by Gopinath
    iPad is an amazing gadget from Apple and everyone of us loves to own it. If you are a lucky one to own an iPad here are some basic troubleshooting features that you should be aware. There is no doubt that iPad is an amazing gadget, but similar to other electronic gadgets it refuses to work now and then. When your iPad hangs or refuses to respond you can soft reset it by holding the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. This just reset your iPad and it’s similar to force rebooting your PC. All your settings and data are untouched during this process. The embedded video below shows how to turn off and soft reset an iPad. If iPad Doesn’t Work After Soft Reset – Restore Factory Settings Soft reset should resolve most of the iPad issues like hanging, not responding properly, etc. In case even if your iPad does not work properly after soft reset you can try reset all the setting to factory defaults by navigating through the Home screen > Settings > General > Reset > Reset All Settings.  This will reset all your settings and other iPad customizations to factory defaults but your data(images, documents, apps, etc.) are left untouched. How To Erase All Content Of iPad You may ask why should I erase all the content of iPad? Well may be you are willing to sell it off on eBay by erasing all the content or you want start afresh or some other reason. It is easy to reset all the settings of iPad as well as wipe out all content by navigating through Home screen > General > Reset >  “Erase All Content and Settings.” CC Image credit flickr/korosirego This article titled,iPad: How To Soft Reset, Restore Factory Settings And Erase All Content, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • Aggregate Pattern and Performance Issues

    - by Mosh
    Hello, I have read about the Aggregate Pattern but I'm confused about something here. The pattern states that all the objects belonging to the aggregate should be accessed via the Aggregate Root, and not directly. And I'm assuming that is the reason why they say you should have a single Repository per Aggregate. But I think this adds a noticeable overhead to the application. For example, in a typical Web-based application, what if I want to get an object belonging to an aggregate (which is NOT the aggregate root)? I'll have to call Repository.GetAggregateRootObject(), which loads the aggregate root and all its child objects, and then iterate through the child objects to find the one I'm looking for. In other words, I'm loading lots of data and throwing them out except the particular object I'm looking for. Is there something I'm missing here? PS: I know some of you may suggest that we can improve performance with Lazy Loading. But that's not what I'm asking here... The aggregate pattern requires that all objects belonging to the aggregate be loaded together, so we can enforce business rules.

    Read the article

  • Visitor Pattern can be replaced with Callback functions?

    - by getit
    Is there any significant benefit to using either technique? In case there are variations, the Visitor Pattern I mean is this: http://en.wikipedia.org/wiki/Visitor_pattern And below is an example of using a delegate to achieve the same effect (at least I think it is the same) Say there is a collection of nested elements: Schools contain Departments which contain Students Instead of using the Visitor pattern to perform something on each collection item, why not use a simple callback (Action delegate in C#) Say something like this class Department { List Students; } class School { List Departments; VisitStudents(Action<Student> actionDelegate) { foreach(var dep in this.Departments) { foreach(var stu in dep.Students) { actionDelegate(stu); } } } } School A = new School(); ...//populate collections A.Visit((student)=> { ...Do Something with student... }); *EDIT Example with delegate accepting multiple params Say I wanted to pass both the student and department, I could modify the Action definition like so: Action class School { List Departments; VisitStudents(Action<Student, Department> actionDelegate, Action<Department> d2) { foreach(var dep in this.Departments) { d2(dep); //This performs a different process. //Using Visitor pattern would avoid having to keep adding new delegates. //This looks like the main benefit so far foreach(var stu in dep.Students) { actionDelegate(stu, dep); } } } }

    Read the article

  • Is is possible to create a factory class in PHP?

    - by user198729
    Like the BeanFactory in java: In the much more common case where the BeanFactory itself directly creates the bean by calling its constructor (equivalent to Java code calling new), the class attribute specifies the class of the bean to be constructed. In the less common case where the BeanFactory calls a static, so-called factory method on a class to create the bean, the class attribute specifies the actual class containing the static factory method. Note:it's not the factory method

    Read the article

  • pattern matching and returning new object based on pattern

    - by Rune FS
    Say I'v got some code like this match exp with | Addition(lhs,rhs,_) -> Addition(fix lhs,fix rhs) | Subtraction(lhs,rhs,_) -> Subtraction(fix lhs,fix rhs) is there any way that would allow me to do something like match exp with | Addition(lhs,rhs,_) | Subtraction(lhs,rhs,_) -> X(fix lhs,fix rhs) where X be based on the actual pattern being matched

    Read the article

  • CEO Taken Captive in His Own Factory?

    - by Stephen Slade
    Last Friday was no ordinary day for Chip Starnes, the 42 year old factory owner of Specialty Medical Supplies in China. He recently announced movement of some of the production of their diabetes testing equipment from Beijing to Mumbai India.  Of the 110 employees at the facility, about 80 protested by blocking the doors and refusing to let Chip Starnes out of the facility.  He has been trapped in his office several days now.  The employees think the factory was closing but Mr. Starnes said it was not. Mis-information? Poor communications? Work-stoppage. This is a good example of supply chain disruption. Parked cars are blocking the entrance to the facility, front gates are chained close, the CEO a prisoner in his own factory. Chip Starnes was presented with documents to sign in Chinese indicating he would pay severance and other demands he did not understand, possibly bankrupting the company.    If you depend on supply from China and other foreign suppliers, how reliable are your sources? For example how are the shopfloor employee relations? Is it possible to predict these types of HR risks and plan around them? What are your contingencies? It's important to ask the right questions and hear good answers. Having tools in place to rapidly evaluate, assess and react to these disruptions are the keys to survival. Hear how leading organizations are reinforcing their supply chains and mitigating risk through technology with Oracle's latest release of Oracle Supply Chain Management. Source: WSJ pg.B1, June 25, 2013

    Read the article

  • Looking for a better Factory pattern (Java)

    - by Sam Goldberg
    After doing a rough sketch of a high level object model, I am doing iterative TDD, and letting the other objects emerge as a refactoring of the code (as it increases in complexity). (That whole approach may be a discussion/argument for another day.) In any case, I am at the point where I am looking to refactor code blocks currently in an if-else blocks into separate objects. This is because there is another another value combination which creates new set of logical sub-branches. To be more specific, this is a trading system feature, where buy orders have different behavior than sell orders. Responses to the orders have a numeric indicator field which describes some event that occurred (e.g. fill, cancel). The combination of this numeric indicator field plus whether it is a buy or sell, require different processing buy the code. Creating a family of objects to separate the code for the unique handling each of the combinations of the 2 fields seems like a good choice at this point. The way I would normally do this, is to create some Factory object which when called with the 2 relevant parameters (indicator, buysell), would return the correct subclass of the object. Some times I do this pattern with a map, which allows to look up a live instance (or constructor to use via reflection), and sometimes I just hard code the cases in the Factory class. So - for some reason this feels like not good design (e.g. one object which knows all the subclasses of an interface or parent object), and a bit clumsy. Is there a better pattern for solving this kind of problem? And if this factory method approach makes sense, can anyone suggest a nicer design?

    Read the article

  • IoC containers and service locator pattern

    - by TheSilverBullet
    I am trying to get an understanding of Inversion of Control and the dos and donts of this. Of all the articles I read, there is one by Mark Seemann (which is widely linked to in SO) which strongly asks folks not to use the service locator pattern. Then somewhere along the way, I came across this article by Ken where he helps us build our own IoC. I noticed that is is nothing but an implementation of service locator pattern. Questions: Is my observation correct that this implementation is the service locator pattern? If the answer to 1. is yes, then Do all IoC containers (like Autofac) use the service locator pattern? If the answer to 1. is no, then why is this differen? Is there any other pattern (other than DI) for inversion of control?

    Read the article

  • Repository Pattern with Entity Framework 3.5 and MVVM

    - by Ravi
    I am developing a Database File System. I am using - .Net framework 3.5 Entity Framework 3.5 WPF with MVVM pattern The project spans across multiple assemblies each using same model. One assembly,let's call it a "server", only adds data to the database using EF i.e. same model.Other assemblies (including the UI) both reads and writes the data.The changes made by server should immediately reflect in other assemblies. The database contains self referencing tables where each entity can have single OR no parent and (may be) some children. I want to use repository pattern which can also provide some mechanism to handle this hierarchical nature. I have already done reading on this on Code Project. It shares the same context(entities) everywhere. My question is - Should I share the same context everywhere? What are the advantages and disadvantages of doing that?

    Read the article

  • Repository Pattern and Entity Framework.

    - by vitorcast
    Hi people, I want to make an implementation with repository pattern with ASP.NET MVC 2 and Entity Framework but I have had some issues in the process. First of all, I have 2 entities that has a relationship between them, like Order and Product. When I generate my dbml file it gaves me a class Order with a property that map a "ProductSet" and one class Product with a property that map wich Order that Product relates itself. So I create my Repository pattern like IReporitory with the basic CRUD operations and inside my controllers I implement the ProductRepository or OrderRepository. The problem occurs when I try to create Product and have to assign my Order on it, like ProductOne.Order = _orderRepository.Find(orderId); That operation gave me some strange behavior and I can't find out what is wrong with it. Thanks for the help.

    Read the article

  • Repository Pattern with Entity Framework 3.5

    - by Ravi
    I am developing a Database File System. I am using - .Net framework 3.5 Entity Framework 3.5 WPF with MVVM pattern The project spans across multiple assemblies each using same model. One assembly,let's call it a "server", only adds data to the database using EF i.e. same model.Other assemblies (including the UI) both reads and writes the data.The changes made by server should immediately reflect in other assemblies. The database contains self referencing tables where each entity can have single OR no parent and (may be) some children. I want to use repository pattern which can also provide some mechanism to handle this hierarchical nature. I have already done reading on this on Code Project. It shares the same context(entities) everywhere. My question is - Should I share the same context everywhere? What are the advantages and disadvantages of doing that?

    Read the article

  • Repository Pattern with Entity Framework 3.5

    - by Ravi
    I am developing a Database File System. I am using - .Net framework 3.5 Entity Framework 3.5 WPF with MVVM pattern The project spans across multiple assemblies each using same model. One assembly,let's call it a "server", only adds data to the database using EF i.e. same model.Other assemblies (including the UI) both reads and writes the data.The changes made by server should immediately reflect in other assemblies. The database contains self referencing tables where each entity can have single OR no parent and (may be) some children. I want to use repository pattern which can also provide some mechanism to handle this hierarchical nature. I have already done reading on this on Code Project. It shares the same context(entities) everywhere. My question is - Should I share the same context everywhere? What are the advantages and disadvantages of doing that?

    Read the article

  • I'm using a sequence in Factory Girl to get unique values but I'm getting validation errors

    - by Sean Seefried
    I have a model defined this way class Lga < ActiveRecord::Base validates_uniqueness_of :code validates_presence_of :name end I've defined a factory for Lgas with Factory.sequence(:lga_id) { |n| n + 10000 } Factory.define :lga do |l| id = Factory.next :lga_id l.code "lga_#{id}" l.name "LGA #{id}" end However, when I run Factory.create(:lga) Factory.create(:lga) in script/console I get >> Factory.create(:lga) => #<Lga id: 2, code: "lga_10001", name: "LGA 10001", created_at: "2010-03-18 23:55:29", updated_at: "2010-03-18 23:55:29"> >> Factory.create(:lga) ActiveRecord::RecordInvalid: Validation failed: Code has already been taken

    Read the article

  • Variable 'app' in url-pattern for servlet mapping

    - by Brian
    I'm learning Spring MVC (and servlets in general) and following springsource's mvc-ajax example, which uses annotated controller methods. It appears that there is only one url-pattern (in web.xml) mapped to a servlet in that example: /app/* I've deployed the app as a WAR file, and the actual, ugly URL I'm requesting is http://127.0.0.1:8080/org.springframework.samples.mvc.ajax-1.0.0-20100407.233245-1/account. So, it appears that 'app' in '/app/*' is a variable corresponding to 'org.springframework.samples.mvc.ajax-1.0.0-20100407.233245-1', however, it isn't universal because it isn't usable in my own app, and it contradicts my understanding that url-pattern contains the portion of the URL after the app name. So, what is 'app'? Where is it configured?

    Read the article

  • Understanding pattern matching with cons operator

    - by Mathias
    In "Programming F#" I came across a pattern-matching like this one (I simplified a bit): let rec len list = match list with | [] -> 0 | [_] -> 1 | head :: tail -> 1 + len tail;; Practically, I understand that the last match recognizes the head and tail of the list. Conceptually, I don't get why it works. As far as I understand, :: is the cons operator, which appends a value in head position of a list, but it doesn't look to me like it is being used as an operator here. Should I understand this as a "special syntax" for lists, where :: is interpreted as an operator or a "match pattern" depending on context? Or can the same idea be extended for types other than lists, with other operators?

    Read the article

  • When to use the Flyweight Pattern

    - by elmt
    So I've just gotten on the boost train and was checking out the flyweight pattern and was interested in implementing it in my project. Obviously, it doesn't make sense to use it on any class that has only has one instance of it. However, say I have 5 instances of an class. Should I be using the flyweight pattern or should it be only used for a class that has at least N instances. I realize that many factors will influence this answer (how many fields there are, the size of the fields, etc.).

    Read the article

  • Problem with literal arguments in the PATTERN string for a python 2to3 fixer

    - by Zxaos
    Hi folks. I'm writing a fixer for the 2to3 tool in python. In my pattern string, I have a section where I'd like to match an empty string as an argument, or an empty unicode string. The relevant chunk of my pattern looks like: (args='""' | args='u""') My issue is the second option never matches. Even if it's alone, it won't match. However, if I simply say args=any and then output args, I can catch cases where args is exactly equal to the second option. Is there some weird unicode handling thing going on? Why won't the second literal option ever match?

    Read the article

  • Matching Line Boundaries in a Regular Expression (Pattern.MULTILINE/(?m)) is broken in Java?

    - by Mister M. Bean
    The example on http://www.exampledepot.com/egs/java.util.regex/Line.html gives false for me twice but should'nt! Why? CharSequence inputStr = "abc\ndef"; String patternStr = "abc$"; // Compile with multiline enabled Pattern pattern = Pattern.compile(patternStr, Pattern.MULTILINE); Matcher matcher = pattern.matcher(inputStr); boolean matchFound = matcher.find(); // true // Use an inline modifier to enable multiline mode matchFound = pattern.matches(".*abc$.*", "abc\r\ndef"); // false System.out.println(matchFound); // false matchFound = pattern.matches("(?m).*abc$.*", "abc\r\ndef"); // true System.out.println(matchFound);// false !!!!!

    Read the article

  • sed find pattern on line with another pattern

    - by user2962390
    I am trying to extract text from a file between a '<' and a '', but only on a line starting with another specific pattern. So in a file that looks like: XXX Something here XXX Something more here XXX <\Lines like this are a problem ZZZ something <\This is the text I need XXX Don't need any of this I would like to print only the "<\This is the text I need". If I do sed -n '/^ZZZ/p' FILENAME it pulls the correct lines I need to look at, but obviously prints the whole line. sed -n '/</,//p' FILENAME prints way too much. I have looked into grouping and tried sed -n '/^ZZZ/{/</,//} FILENAME but this doesn't seem to work at all. Any suggestions? They will be much appreciated. (Apologies for formatting, never posted on here before)

    Read the article

  • Saving complex aggregates using Repository Pattern

    - by Kevin Lawrence
    We have a complex aggregate (sensitive names obfuscated for confidentiality reasons). The root, R, is composed of collections of Ms, As, Cs, Ss. Ms have collections of other low-level details. etc etc R really is an aggregate (no fair suggesting we split it!) We use lazy loading to retrieve the details. No problem there. But we are struggling a little with how to save such a complex aggregate. From the caller's point of view: r = repository.find(id); r.Ps.add(factory.createP()); r.Cs[5].updateX(123); r.Ms.removeAt(5); repository.save(r); Our competing solutions are: Dirty flags Each entity in the aggregate in the aggregate has a dirty flag. The save() method in the repository walks the tree looking for dirty objects and saves them. Deletes and adds are a little trickier - especially with lazy-loading - but doable. Event listener accumulates changes. Repository subscribes a listener to changes and accumulates events. When save is called, the repository grabs all the change events and writes them to the DB. Give up on repository pattern. Implement overloaded save methods to save the parts of the aggregate separately. The original example would become: r = repository.find(id); r.Ps.add(factory.createP()); r.Cs[5].updateX(123); r.Ms.removeAt(5); repository.save(r.Ps); repository.save(r.Cs); repository.save(r.Ms); (or worse) Advice please! What should we do?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >