design

Simulating a baseball game

It seems that baseball is perhaps the easiest sport to simulate due to its very linear nature. I'm curious as to whether not there is someone out there with some experience in this matter that can advise me as to the best route to go. There are several options, such as simulating each pitch, simulating an at bat as a single event, or s...

Why is Excel's 'Evaluate' method a general expression evaluator?

A few questions have come up recently involving the Application.Evaluate method callable from Excel VBA. The old XLM macro language also exposes an EVALUATE() function. Both can be quite useful. Does anyone know why the evaluator that is exposed can handle general expressions, though? My own hunch is that Excel needed to give people a w...

Comparing two Objects which implement the same interface for equality / equivalence - Design help

Hi All, I have an interface and two objects implementing that interface, massively simplied; public interface MyInterface { public int getId(); public int getName(); ... } public class A implements MyInterface { ... } public class B implements MyInterface { ... } We are migrating from using one implementation to...

Creating design document from existing java code.

I have existing java code and need to create Design Document based on that. For starter even if I could get all functions with input / output parameters that will help in overall proces. Note: There is not commeted documentation on any procedures, function or classes. Last but not least. Let me know for any good tool which will reduce...

Invoking code both before and after WebControl.Render method

I have a set of custom ASP.NET server controls, most of which derive from CompositeControl. I want to implement a uniform look for "required" fields across all control types by wrapping each control in a specific piece of HTML/CSS markup. For example: <div class="requiredInputContainer"> ...custom control markup... </div> ...

(Non-Relational) DBMS Design Resource

Hey guys, As a personal project, I'm looking to build a rudimentary DBMS. I've read the relevant sections in Elmasri & Navathe (5ed), but could use a more focused text- something a bit more practical and detail-oriented, with real-world recommendations- as E&N only went so deep. The rub is that I want to play with novel non-relational ...

Removing the block "Popular Tags" from the index view in Magento

Hi, I started working with Magento this week and I'm trying to create a new theme. Following the "Designing for Magento" article of the wiki, I tried to remove the Popular Tags block from the index view, adding this line to local.xml on magento\app\design\frontend\default\mytheme\layout: <remove name="tags_popular"/> I don't why, but ...

Can Drupal terms in different Taxonomies be synonymous?

Let's say Taxonomy_A is associated to Node_Type_A Taxonomy_B is associated to Node_Type_B. AND Both Taxonomy_A and Taxonomy_B have a term called 'yellow'. Is it possible to make terms 'yellow' synonymous, so that if I'm looking at a list of 'yellow' stuff, I'm seeing content of both types (Node_Type_A, and Node_Type...

I like the way they Design/Architecture it but how do I implement this

Summary: I have different components on homepage and each components shows some promotion to the user. I have Cart as one Component and depending upon content of the cart promotion are show. I have to track user online activities and send that information to Omniture for Report Generation. Now my components are loaded asynchronously...

iPhone User Interface Design

Hey guys, I've just had a nagging question for a while regarding iPhone app user interfaces. For example, consider WeightBot's User Interface. I am wondering, how are most of these user interfaces created? In general, of course. Is there a way to simply design controls (that is, the images) in a program like Photoshop, then use that 'sk...

How do you control access to your web application based on IP address?

We have a requirement to control access to our SaaS based web application based on IP addresses (that is, we will have to limit access to Company A users only if the request originates from the PCs in their subnet). How do you solve this issue? ...

WPF buttons same/recommended width

Suppose you have a window with multiple buttons such as Ok/Cancel or Yes/No/Cancel. All the buttons need to be the same width. Obviously this could be done by just guessing a number and hardwiring all of them to that number. Is there a better way to do it, one that would take into account preferred/recommended sizes (just how wide shoul...

What is the best way to design GUI Applications with C?

I always find good tutorials on the subject, but it almost always is C++. Is it hard or just doesn't make sense to make GUI applications with C? A good book, guide or a tutorial is fine. Platform: Linux Thanks ...

Cleanly handling events

I have code similar to this in all my observer classes that handle events fired by an event bus class. As you can see there are a lot of instanceof checks to choose the path of action needed to appropriately handle events, and I was wondering if this could be done more cleanly, eliminating the instanceof tests? @Override public void han...

log in as a proxy for a certain user

We have a requirement, wherein the administrative user needs to proxy in as a certain user in an environment where several users (Role: User) are managed by an administrator (Role: Admin). e.g If we have the following users in the database (admin, user1, user2, user3), we would want the admin to proxy as 'user2' and use the system in c...

Find recipes that can be cooked from provided ingridients

Sorry for bad English :( Suppose i can preliminary organize recipes and ingredients data in any way. How can i effectively conduct search of recipes by user-provided ingredients, preferably sorted by max match - so, first going recipes that use maximum of provided ingridients and do not contain any other ingrs, after them recipes that u...

Messaging strategies to connect different systems

I have a system to handle Applications online and a different system to send SMS/Email notifications to applicants on completion using web services. I can't guarantee the availability of the SMS/Email gateway. Option 1 After an application is complete, place a message on a JMS queue. A Message Driven bean receives the message and make ...

Design Pattern for "Context Sensitive" Right Click Menu

Hi, What is a design pattern I can use for generating "context-sensitive" right click menus ? I have in mind a "Windows Explorer"-like application where a user can right click on a folder and get a list of menu items but right click on a drive and get a totally different list. What design pattern should I use ? Would the factory design...

particle system: particle generation

Hello: I have a system that generates particles from sources and updates their positions. Currently, I have written a program in OpenGL which calls my GenerateParticles(...) and UpdateParticles(...) and displays my output. One functionality that I would like my system to have is being able to generate n particles per second. In my Gener...

Given a trace of packets, how would you group them into flows?

I've tried it these ways so far: 1) Make a hash with the source IP/port and destination IP/port as keys. Each position in the hash is a list of packets. The hash is then saved in a file, with each flow separated by some special characters/line. Problem: Not enough memory for large traces. 2) Make a hash with the same key as above, but ...