design

Querying for names

I have a table (say "Demographics") on SQL Server. In this table are the following columns "LastName", "FirstName", "MiddleName", "Prefix" , "Suffix". I have one textbox to search for them on a webpage. My question: Whats a good design strategy for queries where the user could be searching for various combinations of names including las...

[Design Question] When to open a link on a new window?

Hi All, When designing a web application/web site, is there an accepted practice on when to open a link on a new window? Currently, if the site being linked to is outside the domain (say Google.com), I am always launching it on a new window. If the page being linked is within the same domain, I open it on the current active window. I'...

A PHP design pattern for the model part [PHP Zend Framework]

I have a PHP MVC application using Zend Framework. As presented in the quickstart, I use 3 layers for the model part : Model (business logic) Data mapper Table data gateway (or data access object, i.e. one class per SQL table) The model is UML designed and totally independent of the DB. My problem is : I can't have multiple instance...

Iterator performance contract (and use on non-collections)

If all that you're doing is a simple one-pass iteration (i.e. only hasNext() and next(), no remove()), are you guaranteed linear time performance and/or amortized constant cost per operation? Is this specified in the Iterator contract anywhere? Are there data structures/Java Collection which cannot be iterated in linear time? java.uti...

Design Pattern for one-time loaded configuration properties?

I'm often faced with the problem of storing, in memory, a few (possibly complex) configuration settings loaded from files on the filesystem. I'm wondering if there's a better way to architect a pattern to this problem, however, than what I've been using. Essentially, my current solution involves three steps. Build a singleton. Since d...

Sites with 1-column css styles

where i may found simple 1-column css styles? EDIT: templates like it - http://mashable.com/2007/09/13/one-column-website-templates/ but another sorry my english EDIT2: bignose, ok, thanks ...

Python class design - Splitting up big classes into multiple ones to group functionality

OK I've got 2 really big classes > 1k lines each that I currently have split up into multiple ones. They then get recombined using multiple inheritance. Now I'm wondering, if there is any cleaner/better more pythonic way of doing this. Completely factoring them out would result in endless amounts of self.otherself.do_something calls, whi...

highly scalable socket server design

How do i design a socket server, which accept various trades ( stock symbol, its value ) Trades are coming in the form of continuous stream. I need to process those trades based on the subscription client list. ...

Getting rid of "static" references in C#

Hello. I've recently begun learning C# but have encountered an annoying problem. Every variable I want available to all functions in my program I have to put a "static" in front of and also every function. What I'd like to know is how to avoid this, if possible? Also, small side question: creating public variables inside functions? Thi...

date representation in user interface

Most of the sites capture the date (e.g. birth date) information as either a single entity (i.e via a calendar control) or instead as separate fields (date, month, year). Are there any benefits in showing them as separate fields? Are they represented in the database as DATE data type or as separate fields. I am just trying to under...

capturing user identity for an online application

We are designing an online application (college admission form) which mandates the user to upload a scanned copy of his photo along with his signature, so that this information can be used to cross verify the applicant when he appears for a exam + personal interview at a later point in time. This entire process requires a scanner for the...

Is it better to use a "partial" for loop for this code or a while loop?

I just came across the following code: for(Iterator<String> iterator = stuff.iterator(); iterator.hasNext();) { ... } This strikes me as a sort of misuse of a for... Wouldn't this code be better as: Iterator<String> iterator = stuff.iterator(); while(iterator.hasNext()) { ... } ? Any specific reasons anyone can think of to u...

Did anybody know how to create skin for Android game aiMinesweeper?

Hi! I found that game aiMinesweeper support skins. I have a images but i don't know how they have to be packed. Try to find any documentation about this, but nothing. Please help! ...

Design Clarification in Android. List Activity vs Activity

I have a simple question. I am trying to design a simple Android app, which based on keywords searches something and shows a listing view of results. Currently it merely searches SMSes in the cellphone. Here are some of the things I am faced with: I have a simple first page with a textbox and a submit button. It's rendered by "Activit...

Application that depends heavily on stored procedures

We currently have an application that depends largely on stored procedures. There is a heavy use of temp tables. It's an extremely large application. Facing this situation, I would like to use Entity Framework or Linq2Sql for a rewrite. I might consider using Fluent Hibernate or Subsonic, as i've used them quite extensively in the past....

linq2sql - where to enlist transaction (repository or bll)?

My app uses a business layer which calls a repository which uses linq to sql. I have an Item class that has an enum type property and an ItemDetail property. I need to implement a delete method that: (1) always delete the Item (2) if the item.type is XYZ and the ItemDetail is not null, delete the ItemDetail as well. My question is wh...

Design pattern to use instead of multiple inheritance

Coming from a C++ background, Im used to multiple inheritance. I like the feeling of a shotgun squarely aimed at my foot. Nowadays, I work more in C# and Java, where you can only inherit one baseclass but implement any number of interfaces (did I get the terminology right?). For example, lets consider two classes that implement a common...

Elegant way of parsing Data files for Simulation

I am working on this project where I need to read in a lot of data from .dat files and use the data to perform simulations. The data in my .dat file looks as follows: DeviceID InteractingDeviceID InteractionStartTime InteractionEndTime 1 2 1101 1105 1,2 1101 and 1105 are tab delimited and ...

Recommendations for an in memory database vs thread safe data structures

TLDR: What are the pros/cons of using an in-memory database vs locks and concurrent data structures? I am currently working on an application that has many (possibly remote) displays that collect live data from multiple data sources and renders them on screen in real time. One of the other developers have suggested the use of an in mem...

Is it possible to create a domain model for legacy code without refactoring?

I currently have a client that wants me to 'abstract' out a domain model from the existing code but they specifically said that I shouldn't refactor the existing code itself. My question is 1) whether or not this is advisable and 2) what techniques would you apply in this scenario if you can't refactor the code yet they expect you to com...