if(date == "09/13/2007") Engadget.Write("Happy Programmer's Day");
Quick: what's two to the eighth power? 256, of course, and if you knew the answer before you even had a chance to read it, we can say with some confidence that you're a
Quick: what's two to the eighth power? 256, of course, and if you knew the answer before you even had a chance to read it, we can say with some confidence that you're a
A look back on popular stories from today in a specific year.

Now that we've thrown 'em off the trail, use the form below to get in touch with the people at Engadget. Please fill in all of the required fields because they're required.
It doesn't matter what succeed is set to, or what try() returns. You could have any of the following:
while(!(succeed=try()));
while(!(succeed=FALSE));
while(!(succeed=TRUE));
while(!(succeed=0));
They will all result in the same logic:
while(!(TRUE));
which is then:
while(FALSE)
All clear now? :)
No, assignment does not always return true. If you said while(a = 1); you would always be setting a = 1, but the loop will continue to run because 1 evaluates to true. If you set a = 2 the same would occur. If you set a = 0 then the loop would not even run as it would be false. C and C++ will both return the value of succeed which was set to the return of try(). You are not saying while succeed is equal to try(). This is where your logic fails. You are saying succeed is equal to try(). If try() is false, the loop will end, otherwise it will continue to run try().
Like I said, if the OP had used == instead of =, you would be right.
In your examples:
while(!(succeed=FALSE));
// This is setting succeed = false then evaluating succeed as false. It is not evaluating is succeed is equal to false. This would be an infinite loop.
while(!(succeed=TRUE));
// This is setting succeed = true then evaluating succeed as true. This loop would never run.
while(!(succeed=0));
// This loop would also be infinite as 0 is false.
Again, you are not checking to see if succeed is equal to try() or if setting succeed equal to try was successful. You are setting succeed = try() and evaluating whatever they are both equal to.
Let's look at it this way in order of precedence (the order which the program runs):
[if try() returns true]
while(!(succeed = try())); // try() returns true
while(!(succeed = true)); // set succeed = true
while(!(true)); // remove parenthesis
while(!true); // negate true
while(false); // evaluate false
[if try() returns false]
while(!(succeed = try())); // try() returns false
while(!(succeed = false)); // set succeed = false
while(!(false)); // remove parenthesis
while(!false); // negate false
while(true); // evaluate true
I copypasta stuff off of a Thinkgeek product description and this is what happens?
you're right. my bad. thanks for taking the time to explain everything. :)
*feels kinda stupid right now...*
"Have you heard about the object-oriented way to become wealthy?"
"No..."
"Inheritance."
haha
Ah, didn't know this one. I've been programming in LUA since 2 years ago and recently started C++
TRUNCATE TABLE WorkTasks
TRUNCATE TABLE BugsAndIssues
--ahhh screw it!
DROP DATABASE master
DROP DATABASE msdb
--peace im out!
/*Thank you all for making life enjoyable and easily accessable all 365.242199 days of the year*/
Doh! Forgot to format! Ekk... Format error... boot error... oh geez...
102145163164040124150162145141144040143157155155145156164163040105126105122041
131157165040147165171163057147141154163040162157143153041
And I mean it :)!
Isn't day of the year base zero normally? So isn't it 255?
Depends on the language, but this is still the 256th day of the year. Zero would be January 1st.
Depends on the language, but this is still the 256th day of the year. Zero would be January 1st.
Make the day-of-year base depend on whether it's a leap year or not, and that's another bug swept under the carpet.
Well, 255 is the highest value an unsigned char (byte) can hold, so it's still a special day even if you're right.
As for what number to start at, I'm a bit annoying with the C struct tm, which starts at 0 for the month (0 = January) but 1 for the day of the month (1 = the 1st). I thought consistency was part of the whole point of making standards??
Awesome.
I do, however, perceive a double standard: were I to, say, make the statement 'If you're a secretary, grab another Lipton and sit down, hot stuff; we've got a list of memos about a mile long, and they aren't dictating themselves.', I would probably be fired. And perhaps lynched on my way out the door.
I hate fixing bugs. Writing new ones is fun. Err. New code. Implementing new functionality. yeah.
unccl cebtenzzref qnl!
*reads Angela's comment about existance of female programmers (hopefully cutes ones) in the word, jumps off of chair and rejoices knowing won't die as a virgin*
But your still dead.
I am a girl, and I am pretty, I understood none of this. lol
Happy programmers day to you all.
And if I didn't have you guys I wouldn't have the good juice for my gadget addiction. so thanks for being there.. ;-)
Emanuel
goto HappyProgrammersDay
"...get back to work playBOY..." ?? Uh, there ARE a lot of programmer Grrls, too!
There's a mistake on the title, because the day 09/13/2007 is not always the # 256 lets remember that frepruary might have 28 or 29 Days.... :P
oooooooooooohhhhhhh programmers' day! woohoooo
Happy Programer's Day, Programers ;)
Thanks for all your hard work
:D
:LabelASDF
0001: wait 60000 ms
00BF: get_current_time $1 $2
00D6: if 1
0038: $1 == 09
0038: $2 == 13
004D: jump_if_false ££Labelbbq
033E: text_draw 100.0 195.0 'PROGDAY' // Happy Programmer's Day!
0002: jump ££LabelASDF
:Labelbbq
0000: nop
Yeah, bet not many of you have seen this language before. It's SCM; it's the language Grand Theft Auto III, Vice City, and San Andreas uses for missions and basically everything.
hah, nice.
while (hours < 24)
{
programmer.Party();
beer++;
}
if (nextDay == true)
{
String status = "Hangover";
}
Todays my birthday! I didn't know about this.
Wahoo!
Happy Coding Guys! :P
Programmer Day's Unofficial Home: http://ProgrammerDay.info
That's it !!! I will not work on the 13th September of every year from now on. I'll send a message to the government ask them to decalre it a public holiday.
Happy coding everyone.. - from Thailand with love..