Search Results

Search found 6569 results on 263 pages for 'specification pattern'.

Page 23/263 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Best way to display a background with a pattern in an iPhone/iPad app

    - by Dr Dork
    Here's an example of the type of background image I'm talking about... Clearly, there's a pattern in it. My question is, if this were an iPad app and the background image was twice the size, would there be any significant benefits to taking advantage of this pattern by tiling the image? Or would it really make no difference in terms of performance and just be easier to load the entire image into a UIImageView? Thanks in advance for all your wisdom!

    Read the article

  • php str_replace pattern

    - by user331071
    Hello , I have a php application that saves the pictures on the server and also stores the picture names in the database . The issue that I have is that the picture names include the path/folder where it was saved from (e.g 1220368812/chpk2198933_large-2.jpg) so I need a str_replace pattern to remove "1220368812/" and have the picture name correct stored in the db . Also I would appreciate if you will send me a good link that explains how exactly the str_replace patterns work or at least how the pattern that you use work .

    Read the article

  • Repository Pattern: SaveOrUpdate() in Entity Framework and L2S

    - by JMSA
    These web articles uses separate Save() and Update() methods in the repository pattern. I am using repository pattern. How can I write a SaveOrUpdate() method in Entity Framework with the help of ObjectContext and in Linq-To-SQL with the help of DataContext? That is, how can I write a single method that shall do both save and update job?

    Read the article

  • Doubleton Pattern Implementation

    - by Pierreten
    I'm leveraging the Doubleton Pattern from this link http://www.codeproject.com/KB/architecture/designpattern_doubleton.aspx in my own code. I think it makes things a lot easier since the Singleton only provides one instance, but I get two with this pattern. I was wondering if it would make sense to have it implement an interface so I can inject it into my domain layer.

    Read the article

  • Help me to find a better approach-Design Pattern

    - by DJay
    I am working on an ASP.Net web application in which several WCF services are being used. At client level, I am creating channel factory mechanism to invoke service operations. Right now, I have created an assembly having classes used for channel factory creation code for every service. As per my assumption this is some sort of facade pattern. Please help me to find a better approach or any design pattern, which I can use here.

    Read the article

  • Example of Singleton pattern

    - by Supereme
    Hi, Can anybody tell me a good example of Singleton pattern? Also I've one doubt to ask, Is the following scenario is that of singleton pattern: When we have many printers connected in LAN but only one printer queue?

    Read the article

  • value from resource bundle as pattern in formatDate

    - by binary_runner
    I want to read pattern for JST formatDate also from resource bundle but this naive approach does not working, what I'm doing wrong ? in com/company/MyPortlet.properties is this key: company.date.format = yyyy-MM-dd HH:mm:ss In page I have: <fmt:setBundle basename="com.company.MyPortlet"/> <fmt:formatDate value="${date}" pattern="${company.date.format}" />

    Read the article

  • My User control belonging to which Design Pattern??

    - by prashant
    Hello, I am creating a reusable component in C#.net. For that i have started a Control Library project and added a Control. Class MyControl : Control{} My user control just displays some images which will be used in many Windows Applications. Can you please tell me which design pattern i am using here. I am unable to decide which pattern they belongs. Thanks

    Read the article

  • What Design Pattern is this?

    - by 01
    I know that everything we do in programming can be described as design pattern(even abstract method has design pattern called template method) public class Guicer extends AbstractModule { private static Injector injector = Guice.createInjector(new Guicer()); public static void setInjector(Injector injector) { Guicer.injector = injector; } public static T getInstance(Class c) { return injector.getInstance(c); } @Override protected void configure() { } } What design patterns are used in this code?

    Read the article

  • How to dispose the objects created by factory pattern

    - by Ram
    Hi, I am using Factory pattern to create .NET objects of a class. I also need to make sure that all such objects should be disposed before application terminates. Where and How can I dispose the objects created by factory pattern? Shall I dispose in the class in which I am getting the objects created by factory?

    Read the article

  • Need help on awk/sed/ perl pattern with regex / grep

    - by Jayakumar K
    Sample file output from grep file1:my $dbh = DBI->connect("dbi:mysql:$database_name", $DB_USER, $DB_PASSWD) file2:($dbc,$rc) = mysql_connect($mysql_host,$mysql_user,$mysql_password); The awk pattern should get values databasename, DB_USER And DB_PASSWD from line 1 and mysql_host,mysql_user and mysql_password from line 2 i.e all variables inside the function. Then it should search for the declaration of that variable in file before : (semicolon) ex: databasename in file1 may be $databasename = "dbweb" ; ex: mysql_user in file2 may be $mysql_user="root" ; Result: It should display variable declarations of all 6 variables along with filenames file2:$mysql_host = "db1"; file2:$mysql_user = "root"; file1:$DB_USER = 'user';

    Read the article

  • Windows freezes, showing a random color or pattern

    - by Manu
    I have a PC with windows 7, and I'm experiencing random freezes with increasing frequency. After some time (from 30 minutes to a few hours) the screen will shows a random color or pattern (vertical lines) and nothing works anymore, I need to reboot manually. I've checked the events log, but nothing is shown except for the unexpected reboot. I've tested the RAM with Memtest86+ 4.20, and the graphics card with FurMark 1.10.3, no errors have been found. I've updated the graphic drivers and openned the case to remove dust, but the issue is still there. Also, the problem doesn't seem to arise when I'm playing games fullscreen, but when I'm surfing the web, using itunes, or coding. My hardware is as follows : intel core i5 750 CPU, ATI Radeon HD 5670 graphics card, ASUSTeK P7P55D motherboard, two 2Gb KINGSTON DDR3 ram sticks, 2 SATA hard drives, a Netgear dongle for wifi.

    Read the article

  • Find command exclude files whose path match a certain pattern

    - by user40570
    I have a find command that looks for files that was modified recently and outputs the date find /path/on/server -mtime -1 -name '*.js' -exec ls -l {} \; I would like it to exclude any deeply nested folder that matches a certain pattern e.g. there are a number of folders that have a "statistics" directory and ".svn" directories. So i'd like to be able to say if the file that was modified yesterday is in a folder named statistics ignore it. Or perhaps not search for files in those folders at all.

    Read the article

  • Modifying a column with the 'Identity' pattern is not supported in WCF RIA Services

    - by Banford
    I've been following the walkthrough for creating your first WCF RIA Services Application from Microsoft and have encountered a problem when trying to edit and update data using the SubmitChanges() method of the Data Context. The table being updated has an Identity Specification set in SQL Server 2008 on the 'CourseID' column. However the PRIMARY key is a composite of two other fields. When using SubmitChanges() the application locks up in the browser an presents an unhandled exception. By handling this exception I managed to get the message: Modifying a column with the 'Identity' pattern is not supported. This is referring to the 'CourseID' column. Turning identity specification off solves the problem, but I need the auto-incrementing ID. In what way isn't this supported. Or where am I going wrong?

    Read the article

  • Ideas for a TLA+ project

    - by luvieere
    Please give me some suggestions regarding a project topic in the TLA+ language. I'm taking a course on the language, it's the first year I'm learning about specification and verification and I have no clue what to choose to implement in two weeks time. Any ideas?

    Read the article

  • How to create multiple Repository object inside a Repository class using Unit Of Work?

    - by Santosh
    I am newbie to MVC3 application development, currently, we need following Application technologies as requirement MVC3 framework IOC framework – Autofac to manage object creation dynamically Moq – Unit testing Entity Framework Repository and Unit Of Work Pattern of Model class I have gone through many article to explore an basic idea about the above points but still I am little bit confused on the “Repository and Unit Of Work Pattern “. Basically what I understand Unit Of Work is a pattern which will be followed along with Repository Pattern in order to share the single DB Context among all Repository object, So here is my design : IUnitOfWork.cs public interface IUnitOfWork : IDisposable { IPermitRepository Permit_Repository{ get; } IRebateRepository Rebate_Repository { get; } IBuildingTypeRepository BuildingType_Repository { get; } IEEProjectRepository EEProject_Repository { get; } IRebateLookupRepository RebateLookup_Repository { get; } IEEProjectTypeRepository EEProjectType_Repository { get; } void Save(); } UnitOfWork.cs public class UnitOfWork : IUnitOfWork { #region Private Members private readonly CEEPMSEntities context = new CEEPMSEntities(); private IPermitRepository permit_Repository; private IRebateRepository rebate_Repository; private IBuildingTypeRepository buildingType_Repository; private IEEProjectRepository eeProject_Repository; private IRebateLookupRepository rebateLookup_Repository; private IEEProjectTypeRepository eeProjectType_Repository; #endregion #region IUnitOfWork Implemenation public IPermitRepository Permit_Repository { get { if (this.permit_Repository == null) { this.permit_Repository = new PermitRepository(context); } return permit_Repository; } } public IRebateRepository Rebate_Repository { get { if (this.rebate_Repository == null) { this.rebate_Repository = new RebateRepository(context); } return rebate_Repository; } } } PermitRepository .cs public class PermitRepository : IPermitRepository { #region Private Members private CEEPMSEntities objectContext = null; private IObjectSet<Permit> objectSet = null; #endregion #region Constructors public PermitRepository() { } public PermitRepository(CEEPMSEntities _objectContext) { this.objectContext = _objectContext; this.objectSet = objectContext.CreateObjectSet<Permit>(); } #endregion public IEnumerable<RebateViewModel> GetRebatesByPermitId(int _permitId) { // need to implment } } PermitController .cs public class PermitController : Controller { #region Private Members IUnitOfWork CEEPMSContext = null; #endregion #region Constructors public PermitController(IUnitOfWork _CEEPMSContext) { if (_CEEPMSContext == null) { throw new ArgumentNullException("Object can not be null"); } CEEPMSContext = _CEEPMSContext; } #endregion } So here I am wondering how to generate a new Repository for example “TestRepository.cs” using same pattern where I can create more then one Repository object like RebateRepository rebateRepo = new RebateRepository () AddressRepository addressRepo = new AddressRepository() because , what ever Repository object I want to create I need an object of UnitOfWork first as implmented in the PermitController class. So if I would follow the same in each individual Repository class that would again break the priciple of Unit Of Work and create multiple instance of object context. So any idea or suggestion will be highly appreciated. Thank you

    Read the article

  • Anyone know why the Intel q9400 cpu is embedded?

    - by Wil
    I was just looking through the Intel site and I came across this - http://ark.intel.com/ProductCollection.aspx?familyID=28398 Anyone know why the 9400 has a tick in the embedded column? I have tried to contact Intel and not had a response. I have looked around but cannot find any additional reference and it seems to be available from shops just like any other CPU. Anyone have any ideas?

    Read the article

  • Static factory pattern with EJB3/JBoss

    - by purecharger
    I'm fairly new to EJBs and full blown application servers like JBoss, having written and worked with special purpose standalone Java applications for most of my career, with limited use of JEE. I'm wondering about the best way to adapt a commonly used design pattern to EJB3 and JBoss: the static factory pattern. In fact this is Item #1 in Joshua Bloch's Effective Java book (2nd edition) I'm currently working with the following factory: public class CredentialsProcessorFactory { private static final Log log = LogFactory.getLog(CredentialsProcessorFactory.class); private static Map<CredentialsType, CredentialsProcessor> PROCESSORS = new HashMap<CredentialsType, CredentialsProcessor>(); static { PROCESSORS.put(CredentialsType.CSV, new CSVCredentialsProcessor()); } private CredentialsProcessorFactory() {} public static CredentialsProcessor getProcessor(CredentialsType type) { CredentialsProcessor p = PROCESSORS.get(type); if(p == null) throw new IllegalArgumentException("No CredentialsProcessor registered for type " + type.toString()); return p; } However, in the implementation classes of CredentialsProcessor, I require injected resources such as a PersistenceContext, so I have made the CredentialsProcessor interface a @Local interface, and each of the impl's marked with @Stateless. Now I can look them up in JNDI and use the injected resources. But now I have a disconnect because I am not using the factory anymore. My first thought was to change the getProcessor(CredentialsType) method to do a JNDI lookup and return the SLSB instance that is required, but then I need to configure and pass the proper qualified JNDI name. Before I go down that path, I wanted to do more research on accepted practices. How is this design pattern treated in EJB3 / JEE?

    Read the article

  • Factory pattern vs ease-of-use?

    - by Curtis White
    Background, I am extending the ASP.NET Membership with custom classes and extra tables. The ASP.NET MembershipUser has a protected constructor and a public method to read the data from the database. I have extended the database structure with custom tables and associated classes. Instead of using a static method to create a new member, as in the original API: I allow the code to instantiate a simple object and fill the data because there are several entities. Original Pattern #1 Protected constructor > static CreateUser(string mydata, string, mydata, ...) > User.Data = mydata; > User.Update() My Preferred Pattern #2 Public constructor > newUser = new MembershipUser(); > newUser.data = ... > newUser.ComplextObject.Data = ... > newUser.Insert() > newUser.Load(string key) I find pattern #2 to be easier and more natural to use. But method #1 is more atomic and ensured to contain proper data. I'd like to hear any opinions on pros/cons. The problem in my mind is that I prefer a simple CRUD/object but I am, also, trying to utilize the underlying API. These methods do not match completely. For example, the API has methods, like UnlockUser() and a readonly property for the IsLockedOut

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >