-
as seen on Programmers
- Search for 'Programmers'
I have always been skeptical of rewriting working code - porting code is no exception to this. However, with the advent of TDD and automated testing it is much more reasonable to rewrite and refactor code.
Does anyone know if there is a TDD tool that can be used for porting old code? Ideally you…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
This is very basic question from programming point of view but as I am in learning phase, I thought I would better ask this question rather than having a misunderstanding or narrow knowledge about the topic.
So do excuse me if somehow I mess it up.
Question:
Let's say I have class A,B,C and D…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Is there an accepted general term that subsumes the concepts of variables, class instances and arrays? Basically "any typed thing that needs memory". In C++, such a thing is called an object, but I'm looking for a more language-agnostic term.
§ 1.8 The C++ object model
1 The constructs in…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
A lot of the code I've been working on recently, both professionally (read: at work) and in other spheres (read: at home, for friends/family/etc, or NOT FOR WORK), has been worked on, redesigned and re-implemented several times - where possible/required. This has been in an effort to make things smaller…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi there:
I might be doing a coding competition soon, I was wondering if anyone made one and what where the guidelines/ process.
I'd like to make the competition appealing to all devs, and I m trying to come up with ideas as to how.
the scenario is: There is an event running and we(of the coding…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
What are some real world use cases of the following bitwise operators?
AND
XOR
NOT
OR
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi
Could someone translate this statement into pseudo-code (or just plain english)?
var c:uint = 0xFF << 24 | r << 16 | g << 8 | b;
>>> More
-
as seen on Game Development
- Search for 'Game Development'
I've got the following code in a shader:
// v & y are both floats
nPixel = v;
nPixel << 8;
nPixel |= y;
and this gives me the following error in compilation:
shader.fx(80,10): error X3535: Bitwise operations not supported on legacy targets.
shader.fx(92,18): ID3DXEffectCompiler::CompileEffect:…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I need to make transparency, having 2 pixels:
pixel1: {A, R, G, B} - foreground pixel
pixel2: {A, R, G, B} - background pixel
A,R,G,B are Byte values
each color is represented by byte value
now I'm calculating transparency as:
newR = pixel2_R * alpha / 255 + pixel1_R * (255 - alpha) / 255
newG…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
The challenge is to find the fastest way to determine in C/C++ the length of a c-string using bitwise operations in C.
char thestring[16];
The c-string has a max size of 16 chars and is inside a buffer
If the string is equal to 16 chars doesn't have the null byte at the end.
I am sure can be done…
>>> More