Our architect has spoken about using SOA techniques throughout our codebase, even on interfaces that are not actually hosted as a service. One of his requests is that we design our interface methods so that we make no assumptions about the actual implementation. So if we have a method that takes in an object and needs to update a propert...
Is it generally considered bad practice to provide Iterator implementations that are "infinite"; i.e. where calls to hasNext() always(*) return true?
Typically I'd say "yes" because the calling code could behave erratically, but in the below implementation hasNext() will return true unless the caller removes all elements from the List t...
I've been running into some problems with my design. Here is what I have now...
Controller
...
<AcceptVerbs(HttpVerbs.Post)> _
Public Function Edit(ByVal id As Integer, ByVal dryShots As Integer, ByVal clock As Integer) As ActionResult
Dim job As Shift_Summary_Job = _shiftSummaryJobService.GetShiftSummaryJob(id)
_shiftSummaryJ...
I have a couple of base/interface classes each of which has several derived classes. I have a need to store metadata on each derived class that has a lot of overlap, but different values.
I also have a Factory class for creating instances of the derived classes that's implemented as a singleton and has a few macros. For example, you'd:
...
I saw this question and it reminded me of AutoGenerateColumns in the old DataGrid. The few times I've used them, I ended up backing it out because I needed data formatting past the standard "spit out the Data Source columns." Likewise, with toggle, it sounds like it would save time, but then you end up needing to keep track of state or s...
I need to store a set of numbers in a database which are imported from a spreadsheet.
Sometimes a number is just a number. But in other times, a value can be "missing", "N/A", or blank and these all represent different things.
What would be a good approach to store these numbers in the database? Originally I only had to account for N...
There was an article here:
http://msdn.microsoft.com/en-us/library/Ee817667%28pandp.10%29.aspx
The first part of tut implemented this pattern with abstract classes. The second part shows an example with Interface class. But nothing in this article discusses why this pattern would rather use abstract or interface.
So what explanation (a...
I have a Win32 C++ program that validates user input and updates the UI with status information and options. Currently it is written like this:
void ShowError() {
SetIcon(kError);
SetMessageString("There was an error");
HideButton(kButton1);
HideButton(kButton2);
ShowButton(kButton3);
}
void ShowSuccess() {
Set...
I'm trying to understand if a DHT can be used to solve a problem I'm working on:
I have a trading environment where professional option traders can get an increase in their risk limit by requesting that fellow traders lend them some of their risk limit. The lending trader can either search for traders with certain risk parameters which ...
I'm wondering how to achieve this effect that Apple uses. It looks as though the button is depressed into the bar, can't figure out how to do the same effect for my graphics.
Thanks!
...
We have some applications up and running. We have implemented an Access Control List (ACL) in order to control, which users can do what (guests included). And here is the trouble:
Whenever we disallow a guest to see something, the usual procedure for our software is to set a .htaccess and copy users/passwords from the ACL to the .htacce...
On a project I spent an hour trying to fix a bug with MovieClips not appearing. The cause was that I was adding one MovieClip first to one parent and then to another. Flash allows this, but since display objects can only have on parent, it silently removes the MovieClip from the first parent.
Not getting any error information, I didn't ...
I am writing a simulation in Java whereby objects act under Newtonian physics. An object may have a force applied to it and the resulting velocity causes it to move across the screen. The nature of the simulation means that objects move in discrete steps depending on the time ellapsed between the current and previous iteration of the a...
Is there any way at all to create a "mock" entity type for use in a WCF Service Operation?
We have some queries we do that we need to optimize by exposing as a ServiceOperation. The problem is in order to do so we would result in a very long list of primitative types...
Ex
SomeoneHelpMe(int time, string name, string address, string...
Is there a better way to do "input forms" in WebForms?
I always end up with code like this:
Double d = 0; // chuckle inside
if(Double.TryParse(myNumberTextField.Text, out d))
{
myObject.DoubleVal = d;
}
Is there a better way to process free-form "numeric" input.
...
I am tackling the challenge of using both the capabilities of a 8 core machine and a high-end GPU (Tesla 10).
I have one big input file, one thread for each core, and one for the the GPU handling.
The Gpu thread, to be efficient, needs a big number of lines from the input, while
the Cpu thread needs only one line to proceed (storing mul...
Hello,
I am biulding an e-shop that will have configurable products. The configurable parts will need to have different prices and stocks from the main product.
What database design would be best in this case?
I started with something like this.
Features
id
name
Features Options
id
id_feature
value
Products
id
name
price
P...
Hello! I am writing a button calculator. I have the code split into model, view and a controller. The model knows nothing about formatting, it is only concerned with numbers. All formatting is done in the view. The model gets its input as keypresses, each keypress is a part of an enum:
typedef enum {
kButtonUnknown = 0,
...
my English is not good enough to explain my problem. But I will try my best.
I used to be a Java programmer but have been using C++ more than a year. The one thing always bothers me is the strategy of creating business objects from network(like through SNMP, Web Service or other data sources...) and save it to database and load it when...
I have a wpf gui which displays a list of information in separate window and in a separate thread from the main application. As the user performs actions in the main window the side window is updated. (For example if you clicked page down in the main window a listbox in the side window would page down).
Right now the architecture for th...