- 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
because let's say the triangle has a side of length 30 so half its length is 15 and the distance from one vertex to the middle of sqrt(675) which is approximately 26.
Thus if I hold it with a vertex at the left and an edge on the right, close to an edge, it will have length about 26 against an edge of close to 30 and will thus fall through.
If you don't believe me, cut an equilateral triangle out of some cardboard, thus leaving the cardboard with a hole the size of what you cut out, and see how easily you can slot that trhough,
Admin
TRWTF here is all the posts here about flat head screws.
A screw and a screwdriver are 2 different things.
The WTF used the term "flat head screwdriver".
If you Google that phrase, it should be obvious what was being referred to. You can buy a flat head screwdriver. You can see pictures of them on Google. You can get a Wiki definition of what one is. And if you live in the US, you probably already know what one is without a Google.
Finding a flat head screwdriver is significantly easier than finding a Sleep function in ASP.Classic.
Admin
No it's not - You cannot hammer the database server in a timing loop like that without "consequences" - imaging 300 users all doing that. No "real" queries would stand a chance. This does not scale. Use Sleep(2000) or whatever your language provides.
Admin
Sorry, done that. If the dremel tool with the cutoff wheel is much closer than a flat blade screwdriver you might just put a cross slot on the top of the screw. It's not great but it'll work if you hit it a couple times to get it to fit. (I hate to admit that.) If your only tools are a dremel and a philips screwdriver, all your problems start to look like something that needs grinding. (Or whatever that quote is.)
Admin
I don't know about 'sleep' in whatever database language you desire, but it seems that when you do phone calls that access things, they go to great lengths to have nice sounds (bleep squak beep beep) after they say in the machine voice "Let me look that up for you". They must play the '.wav' file to do the two or three second delay.
So, let me look that up for you!
Admin
+1!!!
"Your dollie has stopped talking to you because you've been bad. You didn't tidy your room and left her on the floor. Maybe one day, if you keep your room nice and tidy for her, yes, maybe some day, some day, she maybe forgive you enough to talk to you again. Until that time, and unless you keep your room spotlessly clean, your dollie will never talk to you again."
Admin
... and the real WTF is an adult human being not having access to a cross-head screwdriver.
Admin
Come to that, why not just use a hammer and bash the screw in by brute force rather than all that panty-waist twiddly twisting? You probably need to put a drop of supaglue 3 in on top of it to hold it in place when you're done, but no worries.
Admin
(emphasis mine)
Sorry to interrupt your wild rant, but WAITFOR is not standard SQL, it's T-SQL (MS SQL Server) only.
Admin
Admin
The major exception consists of repeating tasks you want loosely scheduled (regular monitoring of services, flushing volatile data out to a backing store, real world events external to the computer, consolidating/compressing data, garbage collection, network heartbeats, loose replication...) without the overhead of using some kind of timer callback or even repeated process instantiation - which also needs extra locking mechanisms in case such a scheduled event takes longer than the allotted time between two tasks and can not safely be run concurrently. The same applies if the tasks have to be loosely scheduled but alternating in a certain order.
Admin
Addendum: The cases I described usually will not fail catastrophically if the sleep is interruped occasionally. Two examples where it could:
-Requesting something from a network resource not under your control (external website, rss feed...) that will incur additional resource usage, cost additional money or even complain/refuse service if too many requests are received in a given time frame.
-Hardware level programming. Some here might know HD44780 based LCD displays, which need a certain time to process certain commands - there are defined modes of driving these with feedback of command completion or with waiting for a defined time (such times are specified in the documentation), and there can be good reasons for using the waiting method (you can save on physical wiring - OR with some devices the wait time is so short that querying the busy state will take LONGER/is more error prone than a short busy loop; not typical with HD44780...). ADCs sometimes fall into the same category.
The hardware will crash if the timings are not adhered to.
Admin
I love that you came up with that list without noticing that most manholes in the UK are rectangular!
Admin
Dude, that's not a busy wait loop. The database just calls Sleep() and returns. It doesn't take any locks or anything. The worst consequence is that it occupies a connection from the pool, so you don't want to do this if you have a limited number of connection licences.
In any case the language (classic ASP with VBScript) doesn't provide one. You would have to use an external component.
Admin
No, you failed when you thought we provide all these services for free.
You want it faster, you give us the $$$$ first...
Admin
I think this is T-SQL specific, which would more than answer your question.
Admin
Admin
Self-assembly furniture (no, I don't mean furniture that assembles itself, I mean furniture supplied in flat packs designed for the recipient to assemble) frequently comes with Robertson screws or hex-socket screws. The latter used to be common in the electronics hardware industry when I worked as a service engineer, where they were referred to as Allen keys.
Anyone serious about keeping up to date with DIY really needs to invest in at least Philips, Pozidriv, Robertsons and Allen keys.
Admin
If you need to wait for a concurrent stored procedure to complete ... (yay, go debug threading in stored procedures!) </sarcasm>
Admin
Actually, it's intended to be used as a time-out mechanism. You invoke it with a query that may take a long while and have it time out if it doesn't complete on time, so you can display e.g. an error rather than blocking the process and just having the connection time out on you eventually. Of course, where there are possibilities there will be abuse...
Admin
Wow... just wow
Admin
TRWTF is that this piece of code is not configurable via XML.
Captcha: "validus" The Harry Potter spell that validates the aforementioned XML file versus its schema.
Admin
I just use my fingernail for flathead screws. It works! I promise!
Admin
Any solution(s) are stupid if it blocks a thread. Of course, you are also stupid if you are choosing a platform that does not allow you to do that.
The code posted is double stupid (it blocks the web server's thread and possibility the threa don the DB server).
That leave you the last possibility - you have to do that and you have no choice of platform, that congratulations, you are permitted to be stupid.
Admin
Though it looks square-headed, a Robertson is not square. It's actually tapered so you can stick the screw on a screwdriver [b]and it stays on there[b], regardless of orientation.
Used for carpentry, it means the carpenter sticks a screw onto their powered screwdriver, then can single-handedly screw it in while their other hand reaches for another screw. Screwing stuff in is much faster that way when you only need one hand on the screw driver and the other is grabbing another screw.
Anyone who's used it can attest to its superiority. Alas, for some reason or other, it's not terribly popular in the US, probably because it's a Canadian invention. Until they try it of course (it happened a few times during the rebuilding after Katrina - the Canadian aid workers brought down carpentry supplies, including boxes of Robertson screws. The US volunteers were skeptical of the "strange" screw head, but once they got going, they were surprised at their efficiency).
Admin
(I kind of hope I fell for a troll, in a way.)
Admin
Admin
the point of this WTF is that there's already a sleep function in VBScript (wscript.sleep()), They failed to realize the tool already existed.
Admin
There's a failure here to recognize the root problem: screwdrivers travel in packs; but neither flat-head nor Phillips' screwdrivers will travel with each other.
From there, it is a simple application of Murphy's Law: whichever type of screwdriver you want will never be available; that pack will be traveling.
Admin
Uhh... that will not hammer the server. sleep is a better choice however. Also wait is needed once and awhile. You can kick off external processes from sql. You will wont to wait for them to finish. Or do an insert then wait 2 days to do the next one. Or load testing and simulating real input patterns...
Admin
That actually doesn't work too bad; I've done it in a pinch. holding the Phillips screwdriver almost flat to the screw, rotate it around, almost like a wrench.
Admin
duh! I can do better!
for (i = 0; i < huge_number; i++) for (j = 0; j < huge_number; j++)
DONE! Just need a few tests to determine the value of huge_number that will delay the execution for long enough.
PS.: I don't waste my time thinking of stupid things that can interfere with the processing time, such as system load, task priority, etc. :D
Admin
OK that's made my day. There is a at least some consensus that this is OK for some legacy code asp.net situations. I wonder if they ever showed this to a dba responsible for managing their production databases?