|
At least... does its job!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I would love to see the specs for that particular case.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
It's part of a real-time application with tasks that are interdependent with tasks performed by many other apps running over several networks. 9:32 was the start time for a group of tasks it needed to do. It's actually an upgrade from the now deprecated function IsBefore928()
We know the maximum time each task takes to complete, so we can use cutoff times as a simple way to coordinate tasks between different machines on different networks without them having to know anything about each other. A settings file for the task start/stop times would be better.
But to be fair, as a couple of guys have pointed out here, it does what it is supposed to!
|
|
|
|
|
If it's stupid but it works, it isn't stupid.
Then again...
Peter the small turnip
(1) It Has To Work. --RFC 1925[^]
|
|
|
|
|
I think they call that method every morning.
I'd been called 'ugly', 'pug ugly', 'fugly', 'pug fugly' but never 'ugly ugly'. - Moe Szyslak
|
|
|
|
|
Yea, alot of unneccesary code there.
|
|
|
|
|
I hope you have unit tests with 100% code coverage for each one of those methods.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Previously in the code both flag and fval were malloc'd
flag = NULL;
free(flag);
fval = NULL;
free(fval);
this thing looks like it was written by an epileptic ferret
Dave Kreskowiak
|
|
|
|
|
What is NULL #define d as?
|
|
|
|
|
What's the problem?
1. Remove all references
2. Invoke the GC
|
|
|
|
|
Aaaah, yeah... NULL could be a collection of references to be freed.
|
|
|
|
|
But wouldn't that free NULL twice?
|
|
|
|
|
In an effort to gain more memory by showing negative used space!
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
flag = NULL sets it to point to nothing. This makes the memory location lost.
flag = (data_type*)malloc(sizeof(data_type)); This returns address of the memory allocated by malloc and assignes the address value to flag - something like flag = 0x2345cf. This is a valid address it is pointing to. When you say flag = NULL, flag points to nothing, then you cannot free flag because you cannot free something that does not exist.
So first free(flag); then set flag = NULL;
i.e. just change the sequence to-
free(flag);
flag = NULL;
free(fval);
fval = NULL;
|
|
|
|
|
You didn't take your coffee this morning ? Did you forget to read the title of the forum ?
|
|
|
|
|
I wasn't so sure if I should tell him that
|
|
|
|
|
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
reminds me of the NRA and gun advocacy... it's the shooter not the gun
it's the programmer not the language
David
|
|
|
|
|
"Ray guns don't vaporize Zorbonians. Zorbonians vaporize Zorbonians."
Gary Larson
You know, every time I tried to win a bar-bet about being able to count to 1000 using my fingers I always got punched out when I reached 4....
-- El Corazon
|
|
|
|
|
Oh, great, now I have an opening for something I was thinking yesterday:
A song that was playing used the phrase, "the wrong end of a gun".
Does the anti-gun crew consider both ends of a gun to be "wrong"?
|
|
|
|
|
Too bad 'free()' wasn't defined as returning a (void *). In that case, the code could have been written as:
flag = free(flag);
In case of any error other than a null pointer being passed in, free() could return the passed-in pointer.
Similar behavior could have been used with fclose() [return a (FILE*)] and other such functions that destroy the object whose pointer is passed to them. Oh well, only a few decades too late now.... Where's my time machine?
|
|
|
|
|
Discovered this gem in our code base (C#, but I guess that won't make much difference)...
if (transparent)
pdfDoc.HtmlOptions.HideBackground = true;
pdfDoc.HtmlOptions.HideBackground = true;
Rob
|
|
|
|
|
Well, if opaque then it's true, on the other hand, if transparent then it's so true.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I remember having to do something like that; repainting a dynamic form I think. It was easier to do the repaint twice based on a simple condition then to code a nasty, recursive, snaking, 683 if level method.
But I put a comment in to explain why.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
No, nothing like that. Fortunately, we have a great Refactoring policy here that allowed me to simply fix the code. All is working fine, so I guess it was... well actually I've no idea.
|
|
|
|