design

Horizontal Scrollbar when reducing browser window

Good day, I've been doing some modifications to this website and the owner wants to have a horizontal scroll bar appearing when the browser window is reduced to a size that is smaller than the 'container' of the website. Right now it doesnt appear. I think that my main CSS is responsible for this. This CSS has overflow-x:hidden; and...

Using templates for 2D/3D point

Is it worth to write classes representing 1D, 2D, 3D points using templates template <class T> class Point2D { protected: T X, Y; public: Point2D(const T x, const T y) : hot smileyx), Y(y)) {} ... }; template <class T> class Point3D : public Point2D<T> { protected: T Z; public: Point3D(const T x, const T ...

Maya MEL script to create implicit surfaces

I am trying to write a MEL script that will draw simple implicit surfaces in Maya. I have had a search online but could not find that much on the topic. Does anyone know how to create a MEL script to draw a simple implicit surface in Maya? Thanks in advance. ...

Quality of code improvements.

Hi, This is more of a improvement and suggestions question than one clear defined answer. I have been working on the website for Naked CSS Day 2011 for a bit and was wondering if anyone had any suggestions on my code quality/efficiency. In the spirit of the event I am attempting to bring everything into in the purest and cleanest form of...

design or implement services effectively

What characteristics do service classes have in terms of accessibility from other layers [clients], threading, performance, testability, extensibility and maintainability ? ...

How much documentation do we need and when should we write it?

This question is inspired by the following sources: Clean code by Robert C. Martin Agile Principles, Patterns, and Practices in C# by Robert C. Martin and Micah Martin What is software design? by Jack W. Reeves My current project (where we should comment everything in the code) Mr. Reeves states in his paper that the code is the desi...

Unstructured and not-documented software with bugs and problems

Some time ago I started to develop an application. I had to learn how to do it, so I started with testing pieces of code, modules and libraries. From this testing stage I assembled many pieces that worked okay until the application did almost what it needed to do. However, very often I ran into exceptions, bugs, trouble, memory issues et...

Is there anything wrong with this scheme for error logging?

I wrote this interface: //The idea is to use EHPrint to construct the error msg and then raise an error or //a warning, etc. This removes the need to implement all 3 'Raise' functions //as taking variable param list reducing code. class ErrorHandler ...

Sequential Counter Design question

This is more of a design question and my main intention to post here is to get diverse inputs on the problem's solution. What I want to create is a counter. A counter maybe single valued (single char / digit) or multivalued. So I've designed an hierarchy like this (read Key = Counter) : Key ...

Virtual constructor question.

I am talking about This. Now, my problem is that I have an interface header file which I really don't like to do any implementation in. Can a class derived from a base class declared in that header adopt this idiom? Because as far as I understood, I have to define the (protected) copy constructor for the base class which means that I hav...

c# is this design "Correct"?

I currently have the following if (!RunCommand(LogonAsAServiceCommand)) return; if (!ServicesRunningOrStart()) return; if (!ServicesStoppedOrHalt()) return; if (!BashCommand(CreateRuntimeBashCommand)) return; if (!ServicesStoppedOrHalt()) ...

Disable a list of users in Database

Hi All, I have a simple question regarding best practices in programming. I have a DB which contain members. After some processing I get a list of users who need to be disabled in DB. I have a stored procedure which takes UserId as Input and disable the user. Since I am sure that I always have to disable more than one user, I am thin...

Business Object "Warnings": Good Examples/Ideas?

I'm trying to come up with a reusable warning piece for the business objects in a project I'm working on. Before saving one of our business objects, sometimes we need to warn the user of what the potential impacts are. Say my business object was named "Company". Company.Delete() will get rid of the company and not really care about what ...

What are the "must reads" online for learning the ins and outs of multithreading?

Over the last couple months I've been working with programs that involve multi-threading aspects to them. Multi-threaded programs a very new to me and while I understand the crude basics, how to go about designing a multi-threaded program is still beyond my skill-set. I would like to know what resources that people have found online that...

php design question

Hello all, I have the following class: class Apiconnect { const URL = 'https://someurl.com/api.php'; const USERNAME = 'user'; const PASSWORD = 'pass'; /** * * @param <array> $postFields * @return SimpleXMLElement * @desc this connects but also sends and retrieves the information returned in XML */ public function Apiconnect($...

Best Practice: Order of application design

I can think of quite a few components that need to be created when authoring a web application. I know it should probably be done incrementally, but I'd like to see what order you usually tackle these tasks in. Layout your usual order of events and some justification. A few possible components or sections I've thought of: Stories (i...

Design questions re: EF4 and ASP.NET MVC 2

I have a couple of questions about good design with EF4 in an ASP.NET MVC 2 project. First, validation. Should I place my form validation within my entities' SavingChanges events? How would I obtain the form data within the partial class? Or is there a better way to do it? Second, maintaining logged in users. I come from a PHP back...

How Do I mix colors using CSS?

Hey guys, I want to have a box with two colors with silver on top and it should slowly fade into white, just as Apple's homepage background. How do i do that? Thanks as always. ...

What Methods Can Be Employed For Using Composition Over Inheritance?

I have a web application (in ASP.NET MVC) with a Quotations controller. This controller can handle multiple Quotation types, MotorQuotation, PropertyQuotation, etc... Currently it is using inheritance i.e. a Quotation model and it's children, to model the domain. The various children classes have differences in the data they store and n...

When divs don't resize with content?

I'm working on some complex design and have a silly question once again :) Well, let's say I have a div and some content inside, like: <div style="background-color: #fff; width: 1000px; margin: 0 auto;"> <img src="img.png" /> <p>Blablabla :)</p> </div> <div style="background-color: #000; width: 1000px; margin: 0 auto;"></div>...