poke
  • Member for 11 years, 1 month
  • Last seen this week
How to ideally calculate profit margin with zero sales
7 votes

Don't ask Us! We're not the ones making business decisions based on the output of your calculations! Having said that, developers need to know how to approach these situations. In my experience, ...

View answer
Is it reasonable to null guard every single dereferenced pointer?
7 votes

As other have noted, this depends on whether or not msgSender can be legitimately NULL. The following assumes that it should never be NULL. void PowerManager::SignalShutdown() { if (!msgSender_) ...

View answer
Overcoming slow problem solving due to increased knowledge of what might go wrong
7 votes

Think about the practical consequences of a bug as compared to all the other problems that need solving. Consider the following consequences of creating a poorly written piece of code: Entire ...

View answer
Fixing bad data in a database - redo or incremental
Accepted answer
5 votes

Your latter strategy is likely the better choice. It will be difficult to find all the problems in the data while it is still resting in its current format. I would treat this an ETL process of ...

View answer
What are some possible alternatives for providing an 'Admin Password' for a desktop application?
5 votes

The manager is right about the password getting out. Its not a matter of if, but when. Since Active Directory isn't an option for some users, you could create a signed text file with a list of ...

View answer
How should I query the DB for a specific key without querying every time the feature is called?
2 votes

Do you need to be able to arbitrarily turn the "Caching Enabled" feature on or off while the app is running? If you do need to change it during runtime: Here are a few possibilities: Create a ...

View answer
Method parameter takes object from it's own class?
2 votes

This depends, in part, on which piece of code is responsible for controlling who the current player is. Is it CurrentGame or the code that uses CurrentGame ("the caller")? If CurrentGame is ...

View answer
Determinining "value" in multi-agent microeconomical simulation
1 votes

The key to this is each agent's cost of mining. Presumably, at any given time, some agents will be closer to a food mine than others. The cost of mining is energy + time. An agent further away from ...

View answer
Mapping 40 unique integers to 41 and back
1 votes

Edit: This answer is based on the incorrect assumption that the OP wanted the original 40 integers to be included in the set of 41. As such, it's wrong but I am leaving it for now because it adds an ...

View answer
What is the most efficient way to manage large collection
1 votes

Considering creating some type of drill-down interface. Rather than immediately trying to display 10,000 * 10,000 records to the user, summarize those 100,000,000 records into 100 ranges. Let the user ...

View answer
How to get from 1 byte to 2 bytes
0 votes

Byte is a term that refers to storage capacity. The contents of a byte-sized storage location is what you do math on. Doubling the value stored in a byte-sized bucket may or may not require two bytes ...

View answer
What is the best approach for overriding fields in a database?
0 votes

Your 2nd option provides the most flexibility with minimal extra complexity. In the sample record, have a nullable field that holds the local threshold level. Set the field to null if the sample is ...

View answer
Best Practices for Maintaining Uppercase vs Proper Case Data
0 votes

People's names aren't capitalized using proper case rules. In your example, the correct capitalization of O'neil is O'Neil. Depending on the individual, incorrect capitalization of one's name could be ...

View answer
Looking to build a 2 java applications. should it be web-based application or standalone application?
0 votes

Due to security, Java delivered via a browser is Not a Good Idea (TM). Sun has had a bad string of serious security holes that have resulted in a lot of patches. I'm concerned enough of about these ...

View answer