We have a server (Java EE) application, it will do some image processing jobs based on user request. Such as convert image format (e.g. TIFF to JPEG), convert image color (e.g. RGB to Gray to BW), resample (resize) image. Some customer from printing industry use very large image, such as 2000 dpi, 6 * 8 inch, 4 color components, which wi...
For some reason, I'm having a hard time trying to cover the block of code below. This code is an excerpt from the UNIX uniq command. I'm trying to write test cases to cover all blocks, but can't seem to reach this block:
if (nfiles == 2)
{
// Generic error routine
}
In context:
int main (int argc, char **argv)
{
int optc = 0;...
I am trying to write a simple program, preferably in C, that will watch a given directory. Whenever a process accesses that directory, I just want to print out the name of that process. It seems simple, but I am coming up short for solutions on MSDN. Does anyone know which library calls I will need for this, or any helpful advice? I have...
I have a situation that demands, passing the registry path as a parameter for application launch, say I have IE as default launcher for http types
HKEY_CLASSES_ROOT\http\shell\open\command\
Default = iexplore %1
Any shell launch of a URL would invoke iexplore <<"URL String">>.
My requirement is additionally pass the registry path as p...
Is it possible for the sizeof operator to ever return 0 (zero) in C or C++? If it is possible, is it correct from a standards point of view?
...
If I define some macro:
#define foo(args...) ({/*do something*/})
Is there some way to actually loop through args rather than pass it along to another function? Something like
#define foo(args...) \
{ \
for (int i = 0; i < sizeof(args); ++i) { \
/*do something with args[i]*/ \
} \
...
Hello,
I have a program that generates/'rolls' two dice. I would like to output these two values to a MessageBox, for example: "Dice Rolled: 1 and 3".
The problem I am having is how to go about concatenating these integers to the string. The code I have so far is as follows:
MessageBox( NULL, // hWnd - window own...
Hello
What's the difference between "focus" and "focus-in(out)-event" signals in GTK+? Which one is emitted firs? How are they related to keyboard(TAB) & mouse clicks. Do they depend on each other?
I'm asking this because I want to keep track of currently focused widget within toplevel window and I don't want to test HAS_FOCUS flag of ...
Is it possible to resize an openGL window (or device context) created with wglCreateContext without disabling it? If so how? Right now I have a function which resizes the DC but the only way I could get it to work was to call DisableOpenGL and then re-enable. This causes any textures and other state changes to be lost. I would like t...
Possible Duplicate:
Should C++ eliminate header files?
In languages like C# and Java there is no need to declare (for example) a class before using it. If I understand it correctly this is because the compiler does two passes on the code. In the first it just "collects the information available" and in the second one it check...
Guys,
I know that when working with the MSP430F2619 and TI's CCSv4, I can get more than one interrupt to use the same interrupt handler with code that looks something like this:
#pragma vector=TIMERA1_VECTOR
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void){
ServiceWatchdogTimer();
}
My question is, when I find myself in...
A z buffer is just a 3d array that shows what object should be written in front of another object. each element in the array represents a pixel that holds a value from 0.0 to 1.0. My question is if that is all a z buffer does, then why are some buffers 24bit, 32bit, and 16 bit ??
...
Given a list of URLs, such as a/b/e/f, b/c/d/k/g, s/e/c/d, how to match an input URL to the one in the list, for example, an input c/d should be matched to s/e/c/d, not b/c/d/k/g
...
Does anyone know any more details about google's web-crawler (aka GoogleBot)? I was curious about what it was written in (I've made a few crawlers myself and am about to make another) and if it parses images and such. I'm assuming it does somewhere along the line, b/c the images in images.google.com are all resized. It also wouldn't s...
Whenever any question is asked, and a reference text is needed, I never see MSDN C++ Language Reference being referred.
I was browsing through it and I personally feel that it is extremely well written.
Is there some specific reason it is not used as often as a standard?
Is it because it contains some VC++ specific features?
...
hi.
Can you recommend efficient/clean way to manipulate arbitrary length bit array?
right now I am using regular int/char bitmask, but those are not very clean when array length is greater than datatype length.
std vector<bool> is not available for me.
thanks
...
Possible Duplicate:
Best way to detect integer overflow in C/C++
There's (1):
// assume x,y are non-negative
if(x > max - y) error;
And (2):
// assume x,y are non-negative
int sum = x + y;
if(sum < x || sum < y) error;
Whichs is preferred or is there a better way.
...
When reading some FreeBSD source code (See: radix.h lines 158-173), I found variable declarations that followed the "function heading" in the definition.
Is this valid in ISO C (C99)? when should this be done in production code instead of just declaring the variables within the "function heading?" Why is it being done here?
I refer to...
I am reading a binary file byte-by-byte,i need determine that whether or not eof has reached.
feof() doesn't works as "eof is set only when a read request for non-existent byte is made". So, I can have my custom check_eof like:
if ( fread(&byte,sizeof(byte),1,fp) != 1) {
if(feof(fp))
return true;
}
return false;
But the probl...
I'm looking for a way to efficiently insert bits into a bitstream and have it 'overflow', padding with 0's.
So for example if you had a byte array with 2 bytes: 231 and 109 (11100111 01101101), and did BitInsert(byteArray,4,00) it would insert two bits at bit offset 4 making 11100001 11011011 01000000 (225,219,24). It would be ok even ...