|
A happy client...
Greetings from sunny South Africa!
|
|
|
|
|
It makes me happy to see what I consider to be a simple
elegant snippet of code. For example, I wanted to generate
morse code for a microcontroller and found a simple 26 byte
array indexed by character with each byte describing the
dots and dashes of morse for that character.
73
|
|
|
|
|
...when I get in at least 2 hours without hearing: "I don't mean to disturb you, but...."
|
|
|
|
|
The tools to do a job and the authority to do what needs to be done.
A job that is challenging and when done makes them better at their craft.
Clear goals and a job that matters.
I highly recommend "Drive" by Daniel Pink.
Or, if you're in a hurry check out the video from RSA Animate.
http://www.youtube.com/watch?v=u6XAPnuFjJc[^]http://www.danpink.com/drive[^]
-JimR
|
|
|
|
|
Hey man that's awesome . I like it. It explains exactly why we are subscribed on code project .
Thank you. my 5!
|
|
|
|
|
- Bacon
- Coffee
- 24" dual screen
- SSD
- A tactile-feedback keyboard
- lots o' bandwidth
- lots of time to abuse abovementioned
Bastard Programmer from Hell
|
|
|
|
|
A happy programmer is the one that does not need to program anymore.
The happy programmer programs for fun on his own pace.
"To alcohol! The cause of, and solution to, all of life's problems" - Homer Simpson
|
|
|
|
|
|
So here's the code for an appointment management WebPart a previous programmer did:
DateTime primer = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
DateTime ultimo = new DateTime(DateTime.Today.Year, DateTime.Today.Month + 1, 1);
So obviously the thingy stopped working exactly today, as Schmarz is not yet recognized as a month...
Sigh.
|
|
|
|
|
DateTime ultimo = primer.AddMonths(1);
ftfy.
|
|
|
|
|
I know, that's exactly what I did. Still, it threw the organization into chaos since such WebPart was at their intranet's home page...
|
|
|
|
|
threw not throwed
FTFY!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
Methinks me just threwed up a little bit.
|
|
|
|
|
Second bug in a row... today I wrote "escribido" rather than "escrito" on a SLA proposal... I really need to get some sleep...
|
|
|
|
|
Damn, sorry! I knowed that!
|
|
|
|
|
Why give "useful" info to someone who obviously doesn't need it? (Someone slammed by someone else's non-thinking moment, not, "What did I do wrong?".)
|
|
|
|
|
Yes, it is bad but understandable. The equivalent of that code works just fine in Excel, for example. Try "=Date(2011,Month(Today())+1,1)" and you get 1/1/2012 which seems sensible to me. It's a coding style I have used for years.
No excuses, I'm just saying.
|
|
|
|
|
Depends on the language. I know that in Java it was explicitly decided that you just can't set a date to a 'wrong value' and let it auto correct. You have to use the methods to add days or months.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Mmm, then it surely is valid in SharePoint, when dealing with lists and calculated columns. Since the WebPart is used in a SharePoint installation, perhaps the developer got his idea from that...
|
|
|
|
|
I don't think it's "understandable" when an ASP.Net programmer makes a mistake like this. Presumably they weren't hired for their Excel skills?
|
|
|
|
|
That's pretty funny...
|
|
|
|
|
the real WTF is, that this may fail in the very rare case, when the year switches between the evaluation of DateTime.Today.Year and DateTime.Today.Month, leading to a primer one year back in the past... but this may not be an issue if the code will not be executed during new years eve
|
|
|
|
|
LOL.
*points and laughs loudly at incompetance*
No excuses for this one.
|
|
|
|
|
You need to convince your employer that their calendars are wrong.
Admitting mistakes in code cannot end well.
|
|
|
|
|
Hehehe, actually, aside from me being called at 4 A.M., it turned out pretty well for us: the other software company got their asses kicked off of the project, and we already got another project with this customer... So, all in all, it worked for us!
|
|
|
|