- 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
"We can modify the database procedure more easily than the code."
That right there is a WTF.
Admin
Doing this is not TRWTF. Releasing a framework, where this is actually necessary, even "the best practice" (as it seems to be in this case) is TRWTF, and so is such a framework having non-insignificant market share.
Now excuse me while I go to vulputate.
Admin
Admin
ok, all the smart people here:
http://stackoverflow.com/questions/951021/what-do-i-do-if-i-want-a-javascript-version-of-sleep
I dare someone to submit the solution here as an answer and risk all the downvotes it might get...
Admin
Another solution;
http://stackoverflow.com/questions/758688/sleep-in-javascript
Incidentally I have adopted the "timeout" way of sleeping in C++ too in the past of waiting for an event you don't expect to happen, for a process that is intended to "heartbeat". The point is that most of the time your event will time-out so you have essentially "slept". However the event does sometimes get signalled - an event to terminate. Thus your heart-beat thread goes on forever, performing its action exactly when it should, and terminating when you want it no more, just by setting its event...
Admin
Isn't that Access database engine syntax i.e. not a client/server architecture, so are you sure you are getting "server time"?
Admin
Close. That's part of the reason MANHOLE covers are round (You can also roll them out of the way.)
However, square peg/round hole does make sense from the days of wooden post/beam construction.
A) it's easy to DRILL a round hole. Much harder to drill a square one. B) square pegs are easier to make than round pegs and waste less wood.
But C) the kicker is, a round peg in a round hole, will quickly force the peg out as the wood expands/contracts due to humidity (since the force is equal all the way around).
A SQUARE peg in a round hole will stay since the corners (where all the pressure is) will simply deform as the pressure changes and not work their way out.)
Therefore... since the above is true... and this code is being compared to the above, it is clear that this is simply the ideal solution given the materials.
Or something like that.
Captcha; nulla - what one should do with this post
Admin
It's surprisingly easy. You turn the Phillips driver on its side and use one of the 'vanes' to engage the slot of the screw.
source: lots of times lacking proper tool for the job
Admin
You don't do this much do you? That is a "slot screwdriver" or a "flat-blade screwdriver"
the reason being, flat-top refers to a type of screw, in addition to the potential name for this tool. I hope for your sake you never have to work on anything remotely mechanical, because you will never be able to describe the replacement screws you need to purchase.
Or, you could look up the wikipedia article on List_Of_Screw_Drives ....
Admin
There should never be a reason to pause code-execution for a fixed period of time. If it needs to wait for some disconnected process to reach a certain stage, a routine/process [the one currently "sleeping"] should exit and use some callback/event mechanism to continue its thing.
Timeout-driven waits do not qualify for this rule, as they do not relate to fixed duration (they relate to waiting "up to" some time period).
When I see sleep in the code, I know it's written [by then] amateur and that it can be refactored somehow.
Admin
You're ignoring a factor of size. Small round-lid can be pushed through a large round-hole, just like a slightly larger square-lid can be pushed through a slightly smaller square-hole (diagonally).
Admin
Doing sleep in SQL is definitely a WTF... Should've used SQL to execute a DLL with a sleep function.
Admin
Admin
Getting the current time of the server I can understand (we do the same thing for the same reasons you mention). But doing a 'pause' using server-side code? I find it unlikely the user is going to do something on the PC while the program is paused that would affect the length of the pause (especially since we already know that code only works for delays less than 1 minute!)
Of course the server could be much closer or further away from a strong gravitional influence, such as a black hole. In which case 59 seconds for the server would of course be very different from 59 seconds on the local PC...
Admin
WAITFOR the SQL backend to change, and the whole thing fails on non-standard SQL.
Admin
You're forgetting relativistic time dilation. What about the SQL server that's on a rocket ship at 1/3c?
Admin
favouritism again. If I had posted this it would not have been featured.
Admin
There's always a simple solution. :-)
Admin
MsBuild commandline version:
Admin
You can drop a lid of a smaller size through a manhole cover but you can't drop the properly sized manhole cover through the hole. However if they were square, it would be possible to drop the actual manhole cover through across a diagonal, which is of course sqrt(2) times as long as the edge and therefore even bringing in the thickness factor which will make it slightly narrower than that, it is still most likely big enough.
Admin
Admin
this is an "unregistered" some jerk comment. How do you know it wasn't me posting it?
I may try that out sometime...
Admin
All these are classic examples of software developers over engineering. Here's the solution:
Function DelayProcess(nSeconds) { MsgBox "Please click OK after " & nSeconds & " seconds. Thank You." }
Admin
There's one thing in this story that just completely boggles my mind. What idiot decided that there should be a "WAITFOR" statement in SQL?
Given some of the problems with doing expressions in SQL, and then this, all I can say is: I really wish they would get people for SQL product designers and for the standards committee who are not BASIC programmers!
Admin
Admin
Admin
This is why you don't let soft-heads work on hardware.
\ / | | | | Flat head counter sunk
|| || || Pan head screw (flat head)
and who ever heard of a 'fladhead' screw? And quit being so cheap, You can buy a 10 piece screwdriver set for 10 bucks, it has phillips and stotted screwdrivers.
(Software) Engineers are so cheap and such a bunch of hacks.
Admin
That is incorrect according to wikipedia: http://en.wikipedia.org/wiki/Screw#Screw_head_shapes Fladhead is a screw head type, not a driver type. What you rever to as flathead seems to be a slot drive. http://en.wikipedia.org/wiki/List_of_screw_drives#Slot
So, I still think I would be able to use a philips drive for a flat head screw. ;) And I'd also be capable of using a philips drive for a slot screw. :D Either you use a hammer and pound the drive into the head of the screw or you do it the way previously mentioned.
Admin
Reminds me of the story about when the netblock containing 1.1.1.1 and 1.2.3.4 was finally assigned. If I recall correctly, they had to announce separate BGP routes for the two /16 nets that contained these two addresses because the traffic to them (mostly http and sip and ping) was overwhelmingly high... (I'm sure Google could find that story again if I was motivated enough to search it).
Admin
I've done that. The trick is to put the screwdriver sideways, so one of the four "points" of the Philips head goes in the slot, then spin it around. It's not pretty, but it works.
Admin
To infinity and beyond!
Admin
I was motivated.... http://packetlife.net/blog/2010/feb/5/ripe-plays-with-1-0-0-0-network-apnic-allocation/
Admin
Fully possible, BTDT. You need to hold the screwdriver in a perfect angle to slip one of the four "wings" of the phillips heads to the slot of the screw.
I don't want to do it again.
Admin
Using SQL to perform system functions. What could possibly go wrong?
Admin
Admin
Is this initially an ideal solution? No. But it is abstracted behind a method, so it could be easily changed to something better without much risk to the rest of the system.
Orthogonality is your friend.
Admin
Admin
You're exactly right. The Response.Write calls give it away.
Classic ASP has no analog to Sleep in VB. None of the options in the "tools" link in the post are viable in classic ASP. I encountered the same problem 4 years ago working on our legacy CRM. Needed the web page to wait until a backend process had finished, and display the log to the user. I found this same answer after an hour of Googling (I was determined to find a less... ridiculous approach). Classic ASP just doesn't have this functionality. Gotta outsource. =p
Admin
-Harrow.
Admin
Yep...had a gig where several boxes had serious clock drift, to the point that NTP would just commit suicide. Reset the clock through cron (or whatnot) every 30 minutes, by the time the cronjob logged "perceived" time versus "real" time an half an hour later, the damned thing was already days off.
HP, I'm looking at you (of course, it could've been Compaq....)
Admin
Pricy. In India the maximum fine for blowing up a nuclear plant is only 500 rupees (9 US$).
http://timesofindia.indiatimes.com/india/Now-CAG-focuses-on-lax-nuclear-safety/articleshow/15608239.cms
But still TRWTF is Akismet.
Admin
Not sure what Einstein would have to say about the whole thing, though....
Admin
Seriously guys? No one heard about a win32 api called Sleep:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Admin
Admin
Shuddering to think of all the Windows customers who bought a spec, only received half of it, and never knew the difference, I returned the box. Store wanted me to exchange it for another. Sorry, not interested. Every computer with the same chipset will have the same problem.
And that, kids, is you never buy a computer you can't return if it proves to be crap.
Also, why you never buy an HP. But I repeat myself.
Admin
The "Can't drop it in the hole" is only one (small) factor....others include:
Admin
Admin
You don't need to use a philips head in a slotted screw - this is why God invented butter knives. Why damage a Philips head screwdriver when chances are you've got plenty of old butter knives in need of damaging?
Admin
Admin