- 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
No big deal, it should just throw a NullPointerException and then shut the program down with extreme prejudice, reformatting the C and D drives while it's about it. Where's the problem?
Admin
Sometimes life is like that. On TDWTF, it is frequently like that. And we appreciate it.
I don't know any APEX, lucky me, but shouldn't
CreateDate.GetTime()
fail if it'snull
?Admin
The five-second rule is not a "myth":
http://www.aston.ac.uk/news/releases/2014/march/five-second-food-rule-does-exist/
Admin
I want to be able to like the frist comment here but :
Yesterday it worked Today it is not working TDWTF is like that
Admin
Love the ERV on this one, Remy.
Admin
Note the added WTF of seconds becoming milliseconds.
Admin
Or he could have just written update & create triggers on the object and know for sure.
Admin
The 'f' in Salesforce should not be capitalized. I always have to correct my pointy haired boss on that too. Source: Every spelling of Salesforce on salesforce.com.
Admin
'The “Five Second Rule” is, of course, a myth.' Actually, it has some basis in fact. A scientific study of dropped food found that, in institutional cafeterias and the like, the floor is cleaned so often, and with such harsh chemicals, that there's simply no detectable bacteria on the floor. Drop it, pick it up, eat it, no worries.
(There are, of course, obvious caveats, which further comments will no doubt enumerate.)
Admin
Amazingly, (part of) your immune system does work like this. New immune cells are born with random "identifiers." If they match anything within the first month or so of their life, they assume it should be there and they die. After that, if they match something, it must be "new" and they tell the rest of the immune system to attack.
Dogs also work like this: Something new? Bark at it!
Admin
Mythbusters also tested the 5 second rule, and found that it wasn't entirely without merit.
Admin
Humans also work like this we pay attention to new things. A university near here just made many of the speed limits on the campus '29 MPH' just for that reason. You see something different you react.
Admin
The Fisher Price radar guns only go to 30MPH, so they had to set the signs to 29MPH. ;)
Admin
What if they're going 29.1 MPH? Does the display read "Er"?
Admin
TRWTF is that they didn't use Salesforce's built-in "System.Trigger.isInsert", which would have solved the problem all by itself.
But if every developer could be bothered to read the API, we wouldn't have TDWTF. :)
Admin
5 second rule works only if the dropped food has something that will be left on the floor, e.g. butter. If you pick it up, it will leave a thin layer of butter on the floor that is thick enough that bacteria can't "climb" it in 5 seconds. In any other cases, the dropped food will pick up everything from the floor.
I can imagine, that the record is inserted by one thread (or the same thread in a separate transaction) then an other one will do some work on it so they really needed a way to determine which case it is, but the solution is terrible (or it couldn't make it up here). They should have added a pink pony to the new record and removed it when all the new-item-processes finished their jobs.
Admin
The easiest solution here is just to check if the creation date is null. There is no need for triggers or anything complicated like that.
Admin
Try writing a FileMonitor to detect New vs Updated files using Microsoft's FileSystemWatcher/Events method. Then Google up how to make it actually work. Countless examples of Timer Event work arounds. This is because the that act of creating a file actually returns one or more "Create" events and several "Change" events with no practical way to tell the difference other than time proximity. Start timer when first "Create" hits (a timer for each and every file of course). When timer expires afte x milliseconds with no activity, the New file is presumably there with all it's attributes and your File Monitor can do what it wanted to do with a new file.
Admin
That's redundant. Everything written in Nadir is terrible.