Disclaimer
Please don't just vote to close this because the title looks subjective, and if it's been asked before please point me to the previous question in the comments and I'll delete this one -- I really did look high and low trying to find a previous question on the subject.
Background
Given I have the following interface and co...
I have a webapp written in PHP using a MySQL database backend. This question could just as easily apply to any language and application trying to use an SQL database and MVC OOP design.
How do you keep your SQL code restricted to the Model?
There's a rather longer story specific to my case behind the question. As previously mentioned ...
I am having a lot of headaches maintaining a website right now. Most often things would end up breaking after a couple of updates. This website was started by two developers in our team and then passed on to me. I was wondering if it would be alright to go with unit testing and acceptance testing considering that I'm halfway through the ...
I'm looking for an algorithm to calculate ln(1-x). x is often small (<0.01), but occasionally it might be larger. Algorithm needs to be accurate, and not too slow. I'd rather not use library for ln(x), because I might lose accuracy.
...
Hi all,
I'm tackling an interesting machine learning problem and would love to hear if anyone knows a good algorithm to deal with the following:
The algorithm must learn to approximate a function of N inputs and M outputs
N is quite large, e.g. 1,000-10,000
M is quite small, e.g. 5-10
All inputs and outputs are floating point values, ...
e.g.
int a=3;//-----------------------(1)
and
int a_long_variable_name_used_instead_of_small_one=3;//-------------(2)
out of (1) and (2) which will acquire more memory space or equal space would be aquire?
...
I was reading Wikipedia's definition of Dependency inversion principle, and it uses those two terms, which I wasn't able to figure out..
What are they and what does Dependency inversion principle have to do with them?
Thanks.
...
A big part of my C++ application uses classes to describe the data model, e.g. something like ClassType (which actually emulates reflection in plain C++).
I want to add a new module to my application and it needs to make use of these ClassType's, but I prefer not to introduce dependencies from my new module on ClassType.
So far I have ...
Hello,
I was just curious, afer seeing an ad on S/O, and clicking on it, then downloading it from Google Code...
Why would anybody want/need to create a Fake Object? I don't object to it, or don't think there's anything wrong with it, I just really don't know.
Thanks!
...
I am using PHP and jQuery for a project.
As some forms are reused across different functionality, I've coded a strategy class to render the forms. An example of one such class looks something like this:
class strategy_render_member_form()
{
public function execute() {
return '<form>
<input type="text" name="us...
Hi, I'm looking to write a little comp-geom library, in Ruby.
I'm about to write the code for lines, and was wondering which line equation I should use:
ax + by + c = 0
r + tv (where r and v are vectors)
Thanks.
...
Real-life case (helps understand the question)
I am building a device that can freely rotate around all its axis (x, y, z) and is equipped with:
an accelerometer (A) that gives me a vector pointing to the centre of the Earth (Va)
a 3D magnetometer (M) that gives me the direction of the magnetic field of the Earth (Vm)
The two vector...
I've got a simple grammar. Actually, the grammar I'm using is more complex, but this is the smallest subset that illustrates my question.
Expr ::= Value Suffix
| "(" Expr ")" Suffix
Suffix ::= "->" Expr
| "<-" Expr
| Expr
| epsilon
Value matches identifiers, strings, numbers, et cetera. The Suffix ru...
I'd been told, that using "if" statements is preferred , because of harder debugging of the code, when "else if" is used? Is there a grain of truth in this statement?
...
Sometimes I come across this problem where you have a set of functions that obviously belong to the same group. Those functions are needed at several places, and often together.
To give a specific example: consider the filemtime, fileatime and filectime functions. They all provide a similar functionality. If you are building something l...
I've been writing software for years, but have never mastered the art of testing. My typical testing includes thorough run-throughs on my machines, and then testing in various operating systems via VMware. Mainly a brute-force play-with-it-until-it-breaks-or-doesn't approach. Where possible I work on actual hardware, but this isn't al...
Possible Duplicates:
Using Foo and Bar in examples
What do the placeholders foo, bar and baz mean?
What are the origins of the placeholders "foo", "bar" and "baz"? Does anyone know for sure?
...
Given a set of external apps (app1.exe, app2.exe, ... ). Invoking one app will change something. Sometimes the result needs to be analyzed, sometimes is just a prerequisite for other apps. If one fails, abort process.
All apps need to be invoked, in a specific order, and they must succeed in order to finalize without errors.
Is there a...
Hi,
I am a C# developer. In my current job, I am learning a mix of Java and related languages (Clojure etc).
How beneficial is it to a career learn Java too? Has anyone been in this position? Any examples of the benefits?
Thanks
...
I play an MMORPG and there exists a third party program that can add things to the game's GUI. It can display your HP as a number (as opposed to the green bar), display how long until a power recharges, and other such nifty things.
What I can't understand is how on earth the third party program can extract this data? The MMORPG is not ...