It seems like none of the algorithm textbooks mentions about space efficiency as much, so I don't really understand when I encounter questions asking for an algorithm that requires only constant memory.
What would be an example of a few examples of algorithms that uses constant memory and algorithms that doesn't use constant memory?
...
I've been dwelling on this topic for a long time now. I just wondered if anyone else out there shared my opinion. Isn't it essentially a bad idea integrating preview versions of programming frameworks into your project code before they are at release candidate level?!
I had a situation a few months ago where my boss insisted on using th...
Personally, I've never liked the MyObject naming of classes. I would guess that the status quo would agree but I'd like to see the other side of the argument and if there's any validity to it.
...
I have a client/server connection over a TCP socket, with the server writing to the client as fast as it can.
Looking over my network activity, the production client receives data at around 2.5 Mb/s.
A new lightweight client that I wrote to just read and benchmark the rate, has a rate of about 5.0Mb/s (Which is probably around the max ...
In a book chapter about compilers, there's the following grammar definition and example code.
...
statement: whileStatement
| ifStatement
| ... // Other statement possibilities
| '{' statementSequence '}'
whileStatement: 'while' '(' expression ')' statement
ifStatement: ... // Definition of "if"
statemen...
Hello Folks,
I had started working on GPGPU some days ago and successfully implemented cholesky factorization with good performacne and I attended a conference on High Performance Computing where some people said that "GPGPU is a Hack".
I am still confused what does it mean and why they were saying it hack. One said that this is hack b...
If one has a object which can persist itself across executions (whether to a DB using ORM, using something like Python's shelve module, etc), should validation of that object's attributes be placed within the class representing it, or outside?
Or, rather; should the persistent object be dumb and expect whatever is setting it's values t...
Is there a way to find out if my program is running on XP embedded? I've tried .NET System.Environment.OSVersion, but the version information looks like that of a "normal" Windows XP, except for the minor version number, and relying on that seems to fragile to me.
...
We've started a huge project. We know what it has to look like but not how to implement it. We started by writing prototypes to test different implementations. What we're lacking is the overview of the overall development progress. We don't know if we spend too much time on details or if those details are important enough to spend the ti...
So I need to get hours, minutes and seconds out of entries like these:
04:43:12
9.43.12
1:00
01.04
59
09
The first two is hours, minutes and seconds.
Next to is minutes and seconds.
Last two is just seconds.
And I came up with this regexp, that works..:
\A(?<hours>\d{1,2})(?::|\.)(?<minutes>\d{1,2})(?::|\.)(?<seconds>\d{1,2})\z|...
If you go to the following link you'll see a really cool Javascript simulation of a cube that rotates based on your mouse position.
Simulation: here.
If you view the source of the cube rotating script you'll see:
<script type="text/javascript">
/* I wrote this script in a few minutes just for fun. It's not made to win any
compe...
Hello,
I have a cost optimization request that I don't know how if there is literature on. It is a bit hard to explain, so I apologize in advance for the length of the question.
There is a server I am accessing that works this way:
a request is made on records (r1, ...rn) and fields (f1, ...fp)
you can only request the Cartesian prod...
When debugging an HTTP client, one of your first tests is likely to be a Google search, which lets you see whether your client does non-SSL GETs properly. Everyone knows where it is, everyone can use it, and everyone can see whether it succeeded.
My client has a problem with HTTPS POST. I can reproduce it locally with my specially set...
I'm reviewing a quite old project and see code like this for the second time already (C++ - like pseudocode):
if( conditionA && conditionB ) {
actionA();
actionB();
} else {
if( conditionA ) {
actionA();
}
if( conditionB ) {
actionB();
}
}
in this code conditionA evaluates to the same result on both compu...
The exact background color is known.
Imagine an anti-aliased font on a green background. Now we want to change the background color of the image to red.
So.. How do I extract the "non-background" portion of the color from the pixel and add it (or "blend") on top of another bg color afterwards?
We also know the font color, so we know w...
The challenge
The shortest code by character count to generate seven segment display representation of a given hex number.
Input
Input is made out of digits [0-9] and hex characters in both lower and upper case [a-fA-F] only. There is no need to handle special cases.
Output
Output will be the seven segment representation of the inpu...
I write hobby code from time to time. The thing is these tools, classes or tiny libraries of code end up in a flash stick with hopeless future! I would love to develop my projects further, and let other programmers trust them. If you were going to use something you found on the Internet, what is the most important thing you look for in t...
Possible Duplicates:
Am I wasting my time learning C and other low level stuff ?
Is knowing some basic low-level stuff essential to all programmers?
Lots of people recommend to me learning a low-level programming such as Forth, C, or even Assembler, but I'm still a little uncertain of the actual importance of learning a low-le...
I recently attempted a large refactoring (yes I know smaller increments and unit testing along the way is preferred) that I just had to walk away from. It's not that I couldn't have done it, but I realized that the time to do it right wasn't justified in the business sense. Normally I am one to tackle refactoring with no fear because of ...
A software application that I'm working on needs to be able to assign tasks to a group of users based on how many tasks they presently have, where the users with the fewest tasks are the most likely to get the next task. However, the current task load should be treated as a weighting, rather than an absolute order definition. IOW, I need...