- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
One of my favorite define tricks is an incredibly simple one but fun none the less:
#define EVER ;;
for(EVER) { ... }
:)
Admin
Actually, you just have to replace &HC0000000 with &HC0000000UI.
Admin
The Texas Instruments TMS320C80 is bit addressable. Boy does that make for some fun addressing code.
Jeez, these youngsters, thinking the least significant bit of an address always maps to a byte (wanders off mumbling...)
Admin
in fact in the united states (and i imagine many european countries) it is illegal to make religion a selection basis*
*[unless you're a religious institution such as a church]
Admin
[quote user="Kermos"][quote user="Pim"] Avoid // comments?
Ugh, I can't even say how much I hate it when people do /* blah */ as it prevents simply commenting out a block of code. Yes, I know, I can just wrap it in a preprocessor #if instead.
But seriously, I've yet to come across a C compiler that doesn't support //
[/quote] In my place we have a couple of them, all of them are compilers for (some of them fairly obscure) embedded/realtime OSes though (for example, OS9, NRK, etc).
Admin
The only WTF I see is that it wasn't commented what the code does.
It's not too different from the if ((x&(x-1)) == 0) trick for testing for powers of two.
Admin
I see you've played Knifey-WTFy before.
Admin
hi, isn't it possible that the way he did this is the best way? it seems that it does not need to assume a given format for the date used (that is the only reason i can think of for using CVDate). this way that C programmer, like all good C programmers, does not have to assume that his input is formatted in a given format. i mean, you don't assume that your code will never leave your culture, right?
his way, he adds one to the date, then checks the resulting year. this is a better way, i think.
then again, i am a C programmer at heart.
Admin
Admin
I'm pretty sure that the Zune uses that code exactly.
Admin
Which book? You seem to have left that important point out of your incoherent rant.
Admin
Due to moon-earth interactions, it's the daily earth rotation that is getting slower. But (almost) nothing is slowing down the rotation of the earth around the sun. Thus, it's a mistake to think there will be a day when December will have 32 days. It's the opposite actually, in a (very) distant future, December will have only 30 days left.
But the magic is that the sample code exposed here is also covering this situation. What an insight indeed.
Admin
Not a WTF.
These "The WTF is that someone thinks it's a WTF" are getting more common. This site seems to be more and more frequently turning into a dumping ground for mediocre programmers to ridicule stuff they don't understand, and is teaching more and more programmers that the proper response to anything they don't understand is to ridicule. It used to be actually providing useful insights into how not to program.
Admin
in Rexx, forever is built in
do forever /* whatever */ end
Admin
Admin
Where is the year end date set, and how/why is a year defined in this system / context? What is the nature of the check that is being disabled.
In Australia, the tax-year runs July 1 to June 30. Companies have different "reporting year"s. My employer's accounting year starts on March 1.
Everyone thinks gregorian calendar year, but what about Chinese or Jewish?
Years aint years...
Admin
I presume because of people like this poster.
I haven't seen the ad, but my guess is that this is a church or some other Christian organization. (Likely contributing factor to that theory: If they're not a religious organization, posting a want ad that specifies religion is generally illegal.) They don't want to hire someone who is totally opposed to the goals of their organization and thinks that anyone who holds their beliefs are a bunch of idiots, no matter how good he is at the job. If Fred got a job as a programmer for a religious organization, surely they would be justified in worrying that at best he would be unethusiastic, and at worst that he might deliberately sabotague them. Not necessarily, of course. He might view his job purely as a set of technical challenges. But it would make me nervous if I was the boss.
Likewise I would expect the American Atheist Association to be wary of hiring a born-again type. I would expect the National Republican Committee to be reluctant to hire an ardent Democrat and vice versa, or PETA to hire someone who showed up for the interview wearing a genuine fur coat, etc.
Admin
Admin
ding ding ding ding ding! i had to defend against a code analysis by people who have been drinking at the koolaid bowl of the (fr)Agile Methodology yesterday...
captcha: conventio
Admin
On the PDP-10, byte size was variable. The machine language instructions that worked with bytes included a field that specified how big a byte was for the duration of the execution of this instruction.
That said, the world seems to have settled on 8-bit bytes. Sure, that could change. And tomorrow the IT world might decide to abandon HTML in favor of some new markup language. Are you going to code all your web sites to allow for that possibility?
Admin
(Default compiler settings on OS X.5 are 32 bit)
Admin
Not really worth wasting any of you good people's time, except that it seems that the words "incoherent" -- hey, I'm deficient in duct-tape, but what the heck; they all stick to other sticky things -- and "rant" are the new Godwin.
Admin
(For those of our brethren who are not religious, feel free to substitute "Talking Heads" for "God" there.)
Admin
Possibly you should learn the difference between "is" and "are" and which one it is appropriate to use in situations before you go apopleticly bitchy at Dawkins.
Admin
Admin
Programmers assuming that sizeof(int) < sizeof(long). whereas in the definition of C, sizeof(int) <= sizeof(long).
So instead of agreeing with Buddy, as you could have done, you went out of your way to insult him. To try to make a fool of him. Well you didn't succeed. Quite the contrary.
Edit: awr, I typed too slow. Darn.
Admin
Reading Comprehension -101:
'the words "incoherent" -- hey, I'm deficient in duct-tape, but what the heck; they all stick to other sticky things -- and "rant" are the new Godwin.' What's the matter? You only read sentences that are shorter than your penis length in inches?
Once more: (a) I see your troll, and raise you a dwarf.
Which is unfair. Many of my best friends are dwarves. None of them, to the best of my knowledge, are blithering morons.
And now .. back to our non-ignorant sponsor.
Admin
Even better, make sure that person is of the opposite sex, recreate with them, then infect the child. TRIPLE word score!
Admin
Yup, my grade school (Catholic) fired a teacher for getting re-married (outside the church) before getting an annulment from the Catholic church.
Admin
Dim x As Long if x <= &HC0000000 then ... End If
In VB:do ... loop
Admin
Ok, wrong. Next try:
Dim x As Long if (x >= &HC0000000) And (x < 0) then ... End If
Or
Dim x As Long if x And &HC0000000 = &HC0000000 then ... End If
Admin
This is almost certainly the case as the variable in question is datYrEnd_Dt. I don't know why so many stupid people are commenting here.
Admin
Yeah, and then I go ahead and forget to quote the original reply I am replying. Nice one, guy.
Admin
Yeah, and Christmas isn't Halloween.
Admin
Yes.
http://thedailywtf.com/Articles/Where-the-Wild-Web-Things-Are.aspx
Admin
So what you are saying is that checking the day and month is more efficient (faster uses less resources etc) than checking the year as in the original code?
(Can't remember the exact VB code structure but you get the point)
Admin
When I was an undergrad, I briefly considered applying to an IT consulting firm in my hometown for the summer. It probably wasn't hiring anyway, but never mind that. The owner of the firm was a deacon at my church, and was such an overbearing fundamentalist that he had been rather significant in my decision to quit the church, although I hadn't told him that. I thought maybe we would be able to get along by focusing on work. My mother said that just wasn't possible. I never applied.
Admin
FISCAl calendars can end on a different day every year.
Admin
Fixed? Like C would be fixed by fixing the operator precedence? Like HTML would be fixed by making it strict?
No, I see, you mean fixed like discarding the language and keeping the trademark.
But you're right: that works for wannabees who think that their knowledge of one popular language qualifies them as programmers.
Admin
End line comments are from any line oriented language (BASIC, ASM...) that preceded block languages (PASCAL, C, ...)
End line comments were retrofitted to C at about the same time that C++ was introduced, but they did come from C++.
I agree that it is primarily an issue with embedded development.
No old C compiler understands end-line comments except as a compiler extension. Equally important, no old C syntax checker (no old version of LINT or better) understands end-line comments.
Admin
The function [Year] is a standard library function, an although it could be over-ridden, that would be a real WTF.
On the other hand, the expression is a standard idiom for end-of-month calculations, so it shouldn't have confused anybody.
Admin
Unfortunately, when the sun goes red, it also get VERY big, and way too close to the third rock from the sun for comfort, even at reduced temperature.
Admin
When does he celebrate his birthday? And does he get a lot of hassle when he applies for things like a driver's licence or a passport?
Count the booksAdmin
Thats gunna bugger up the seasons quite a bit, don't ya think?
Admin
Admin
There are two solutions. The first is 'printf ("%d comment%s", n, (n == 1) ? "" : "s");', the second is to autopost a 'FIRST' and 'SECOND' comment whenever an article is created.
Admin
AND HIS CODE WILL STILL WORK!
Admin
Oh man, that is a blast from the past. I developed an MS-DOS application back in the early 90's, and I used QuickC as a program editor.
Admin
Admin