design

Any valid reason for code duplication?

I'm currently reviewing a very old C++ project and see lots of code duplication there. For example, there is a class with 5 MFC message handlers each holding 10 identical lines of code. Or there is a 5-line snippet for a very specific string transformation every here and there. Reducing code duplication is not a problem in these cases a...

I need to match a font from a designer to something similar for web

I don't know if this is an Illustrator spec or where exactly, but a designer gave me this spec for a font: Helvetica Neue (T1), 35 thin, 20 pt, off/ 454545, on/70a63a There are other similar ones for different areas of the page, but if you can tell me how to match this one using CSS, hopefully I can figure out the rest. Thanks!...

To Annotate or Not Annotate

I'm thinking of annotating my Domain Objects. This will ease manipulation of the DOs. Keeping the domain code free from other external stuff is also important for me. Any comment on the "corruption" of the domain code by adding annotations? Are you for/against adding annotation to Domain Objects, and why? ...

Global State and Singletons Dependency injection

this is a problem i face lot of times when i am designing a new app i'll use a sample problem to explain this think i am writing simple game.so i want to hold a list of players. i have few options.. 1.use a static field in some class private static ArrayList<Player> players = new ArrayList<Integer>(); public Player getPlayer(int...

C# WinForm with different Types ?

Hi! I have a form which encapsulates all the functionality, but works with a concrete Type T1. Now I want to create the same form with the difference, that it will use another Type T2. T1 and T2 don't inherit from anything, so I can't use inheritance. How could I do that without copying the whole code again and again? I was thinking ...

Automated letter generation

I work for a doctor and am looking for a solution to speed up his process of composing medical reports. Most of the text in the medical reports are redundant and should be able to be generated by a selection process What I would like is to present him with a form with various options, checkboxes and the selections he makes will drive th...

tricky POS printer design question

I'm looking at designing an application to run on POS terminals in addition to the software already installed. I'd like it to receive POS printer commands and then on some of them intercept and modify them. So for example when a receipt is printed, we'd like to add a custom reference number in the middle of it without having to modify th...

Performance-oriented design of a graph-based (key/value) database

I am in the preparation phase of the design a graph-based (or key-value) database library for C++ which many here will find similar to projects such as http://neo4j.org/. Since this is a very early phase of design, my requirements are simple, unrefined and (I admit) probably still rather naive: A directed acyclic graph A tree-like st...

Is Tahoma's font safe for the web?

Should I use Tahoma in webdesign? If I couldn't opt for anything different (i.e. because the designer used it in his design), with wich fonts could I make an stack of replacement fonts in a CSS stylesheet? ...

Build a Form Builder with Ruby and JQuery

I'm looking for some advice on designing the above for a RoR application that basically has two sections: 1) Admin Form Builder 2) End User Form (that was created by the admin in step 1) I've prototyped the JQuery form (end result) I want and it uses "progressive disclosure" (similar to Yehuda Katz's Bamboo example in the JQuery in Ac...

C# architecture guidelines vs JavaEE

When I first switched from Java to C#, I was really impressed with C#'s features. However, it seems to me that C# has yet to provide solid infrastructures in the way JavaEE does. Everytime I try to integrate C#'s features into scalable or complexe architectures, it always comes down to: How can I twist this so it can be MVC / MVP? Datab...

J2ME UI Screen Design

Are there any tools for UI screen design for mobile devices or Is most of the design done in a generic Image/DTP editing/creating software like MS Windows Paint or the likes? I found a few tools for creating sprite image filmstrips, like MotionWelder, However I haven't found any tools for UI screen design and am generally working in a...

File Server Design Approaches.

I have been working on designing a file server that could take the load off from the primary website, and serve images/files over the web to the client. Primary goals of the file server: - Take off load from primary server hosting the site - Reuse the existing web server code base and avoid duplication of code/logic for better maintaina...

MVC - Separation of Concerns

I'm a newbie. I want to ask about the MVC model for separation of concerns. I have read up a few MVC tutorials but I don't yet have a full understanding of the roles of each of the Model, View and Controller. For instance say I am writing an application for a user to monitor a portfolio. I would like the landing page to display lists o...

What code or output is art worthy?

I am wondering what code or even output of a program people would consider as art. Are there any examples of a program artefact that should/could belong in an art gallery for the public or for programmers, or where one could say it was beautifully designed and/or produced something beautiful? ...

Making a DataTemplate blendable

How can I make a Datatemplate for a ViewModel blendable (designable in expression blend). When I go to resources and try to edit the DataTemplate directly all I see on the Drawingborad is a blank rectangle. This is because the DataTemplate is not bound to anything. Of course I can create a UserControl and create some designtime data in c...

Designing an MDI style interface in Cocoa

I have an application that works on the concept of 'workspaces' that will eventually be ported to Cocoa. In the current Windows incarnation the each workspace is an MDI window which can contains sub windows. These sub windows need to be easily separated, visually, from sub windows in other workspaces since workspace state is saved (not ...

I know I'm doing validation wrong. Please persuade me to stop :)

First let me explain how I currently handle validation, say, for an IPv4 address: public struct IPv4Address { private string value; private IPv4Address(string value) { this.value = value; } private static IPv4Address CheckSyntax(string value) { // If everything's fine... return new IPv4Address(v...

deadline shortcuts

Most of the time I write very maintainable and well design code(even at home). However I just wrote db + msword report app for my friend and code is really bad - lots of code duplication and development speed driven db design - I just dont care at all about this code. I just wanted to finish it fast and go to sleep. I came up with some ...

How to prevent line breaks for menu item using in CSS

Im trying to put a link called submit resume in menu using li tag. when i give space between submit and resume it wraps down. How to prevent wrapping. help me ...