design

Gettting rid of old thinking patterns when moving to a new language/framework/platform

I have been programming in C then C++ then Java and now doing C#. Here's the embarrassing admission: My C# is being written like I am writing C++ !!! I am having trouble completely shaking the thinking that has been embedded in my mind for 10 years and I need to know how others have solved the same problem. ...

Flip a label throught design panel in Visual studio

Is there a peramerter or setting that I can turn on or use to rotate a label 90 degrees? I want to use it through the design panel. I would like to avoid having to do it through code if possible. Im currently using c# as my base ...

Use of a separate class to connect to a service when using MVP for a form

Consider a case of a form that is getting its data from a service and is implemented using the MVP pattern. Do I need to isolate the service access in a separate class or it can be kept in the Model class itself. In my particular case, the model class only acts as a pass through to the data access class that eventually calls the service....

Event driven architecture...infinite loop

I have an event driven architecture where A is waiting for a change from B and B is waiting for a change from C and C is waiting for a change from A, forming a cycle. Now, if B changes, then A fires an event to C, which fires to B, which fires to A, which fires to C...ad infinitum. I can change my program right now to not contain thi...

Parse a log file and get entry data

I have a big log file with multiple lines separated by new line. Each line entry stores four values. If I am reading the log file and want to store this information, what data type/object should I use? Example: source1 destination1 result time source2 destination1 result time sources3 destination2 result time The values are not uni...

Method Calls on Objects that Aren't "Guaranteed" to be Instantiated

I recently wrote a section of code wherein upon finishing, I received a warning from the compiler telling me that one of my variables is being used before it is assigned a value. In practice, the method call on this object will never be made without the object being instantiated beforehand. Here is the snippet of code Try fs = New F...

php and javascript design

question relates to PHP and Javascript for now every table has a form with input tags that each of them has id="field_from_table" GLOBAL_TABLE=name of that table GLOBAL_FIELDS=name of fields in that table GLOBAL_ID=ID value for table. every field also have a label for im. some of the fields are not text. I want to get/set those inp...

Moving from single user desktop applications to multiuser development.

I'm trying to bootstrap a micro ISV on my nights and weekends. I have an application at a very early stage of development. It is written in C# and consists mainly of a collection of classes representing the problem domain. At this point there's no UI or data persistence. (I haven't even settled on the .NET platform. Its early enough that...

css js menu help

I'm designing a menu for a photography site. What I would like is a menu that on hover does two things: pops up an individual image in line with the menu <li>, and also displays just below the menu some text that stays centered in the page, i.e. has position:fixed;. I've taken care of the first requirement, but I'm stuck as to how to a...

How do you get a css box to extend the entire width of the browser window?

For example, if you look at Facebook, they have a short blue bar on top that extends the entire width of the browser. I thought about using width:100%; but I know that it needs to have a parent element to be able to do that. ...

In css, I'm having trouble with the "after-the-link-has-been-clicked" action.

So I know how to control what happens when you hover over a link, and after you have pressed a link. But my question is how do you change a link after you have clicked another link? For example, you click "Profile" on Facebook. The "profile" box is highlighted after you've clicked it. Then you click "home" and the "profile" box goes bac...

With CSS, how do you unhighlight a link after clicking a different link?

For example, on a navigation bar, you only want one link to be hightlighted, the one that the user had most recently clicked. If a user clicks a different link, then the previously highlighted link goes back to normal. How do you do with with CSS? ...

A C++ based variants chess engine design question

I have a chess variants engine that plays suicide chess and losers chess along with normal chess. I might, over time, add more variants to my engine. The engine is implemented completely in C++ with proper usage of OOP. My question is related to design of such a variant engine. Initially the project started as a suicide-only engine whi...

Namespace in definition and implementation

If one has a header file, let's say "test.h" including namespace test { enum ids { a = 1, b = 2, c = 3, d = 30 }; char *names[50]; }; and a source file, "test.cc" basically only including test::names[test::a] = "yum yum"; test::names[test::c] = "pum pum"; // ... Wouldn't it make more sense to wr...

Designing a generic cancellable async operation interface

I've been considering a general purpose generic / cancellable interface for asynchronous request / responses. The requirements are as follows, it must: Support asynchronous calls Be cancellable Be generic Support request / response Support either returning in the current thread or processing the response in another response So here's...

Java generic interfaces with typesafe implementations

I'm look for good alternatives to invoking a specific interface from a generic framework. I'll exemplify with code. Look to the question part, the example code is primarily included for thoroughness, and for putting the example into a real scenario. Example Assume we want to build a report based on a list of components. Say we have tw...

how can I become an image creator?

I'm a web developer but I usually have difficulties making my apps beautiful. I need to learn how to create good images, icons, backgrounds, logos, etc. the problem is, I don't know for sure where do I start. I need guidance. can you guys show me a pathway to learn that kind of stuff from zero to expert? what do I have to read? what do ...

which one of those python implementations is better

which one of the following is considered better a design and why ?. i have 2 classes , one for the gui components and the other is for it's events. please put in mind that the eventClass will be implemented so many times, (sometimes to get data from an oracle databases and sometimes mysql databases ) class MainWindow: def __ini...

Good design to build a whole program as a FSM?

I have built a parser using a FSM/Pushdown Automaton approach like here (and it works, well!): http://stackoverflow.com/questions/3176110/c-fsm-design-and-ownership It allows me to exit gracefully and output a helpful error message to the user when something goes wrong at the parser stage. I have been wondering about a good way to get t...

iPhone UI Design: Okay button or no okay button

I am compulsive and like visually clean designs. Theres a pop up in my app that tells the user that there's an error. I made a clear button over the entire pop up (about 200x100 px) so the user can just touch the notification to dismiss it. But i'm afraid the user might not know that you can just touch the pop up to dissmiss and woul...