• (cs) in reply to Michael
    Michael:
    Why circles? Why not an equilateral Triangle?

    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,

  • ScrewIt (unregistered)

    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.

  • Megamanic (unregistered) in reply to asdf

    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.

  • Mike Alford (unregistered) in reply to R

    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.)

  • (cs)

    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!

  • (cs) in reply to satoshi
    satoshi:
    TRWTF is *replacing* the battery on a talking doll.

    Seriously. WTF!!!

    +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."

  • (cs)

    ... and the real WTF is an adult human being not having access to a cross-head screwdriver.

  • (cs) in reply to Buffoon
    Buffoon:
    Ben Jammin:
    Swedish tard:
    R:
    Unscrewing a Philips screw with a flathead screwdriver is no problem.

    Trying to unscrew a flathead screw with a Philips screwdriver - now I'd like to so somebody do THAT.

    Given that I am not a native english speaker I went about and checked what a flathead screw is, and apparently, flathead only refers to the shape of the head of a screw, not the tool needed to interact with said screw, so a fladhead screw can be of the phillips variety, so I'd have no issue what so ever with that...

    • = flat head
    • = phillips

    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.

    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.

  • AdT (unregistered) in reply to Coyne
    Coyne:
    I really wish they would get people for SQL product designers and for the standards committee who are not BASIC programmers!

    (emphasis mine)

    Sorry to interrupt your wild rant, but WAITFOR is not standard SQL, it's T-SQL (MS SQL Server) only.

  • Captcha:decet (unregistered) in reply to Ralph
    Ralph:
    Cbuttius:
    what-do-i-do-if-i-want-a-javascript-version-of-sleep
    Easy. Kill yourself. You already failed when you assumed I'd let you control my browser. Now you want to waste my time?
    Stop writing. Why are you assuming that I (and every other person on this site!) am letting you control my visual cortex?
  • rackandboneman (unregistered) in reply to nisl

    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.

  • rackandboneman (unregistered)

    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.

  • Ben (unregistered) in reply to Michael

    I love that you came up with that list without noticing that most manholes in the UK are rectangular!

  • Ben (unregistered) in reply to Megamanic
    Megamanic:
    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.

    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.

  • (cs) in reply to Ralph
    Ralph:
    Cbuttius:
    what-do-i-do-if-i-want-a-javascript-version-of-sleep
    Easy. Kill yourself. You already failed when you assumed I'd let you control my browser. Now you want to waste my time?

    No, you failed when you thought we provide all these services for free.

    You want it faster, you give us the $$$$ first...

  • Re: Square Peg Meets Round Hole (unregistered) in reply to Coyne
    What idiot decided that there should be a "WAITFOR" statement in SQL?

    I think this is T-SQL specific, which would more than answer your question.

  • Don (unregistered) in reply to gramie
    gramie:
    Ben Jammin:
    - = flat head + = phillips

    And ☐ for Robertson heads, the only ones used by sane people (http://en.wikipedia.org/wiki/List_of_screw_drives#Robertson)

    Lived in around 30 countries (thus far), never knew there was such a thing as square screws...

  • (cs) in reply to Don
    Don:
    gramie:
    Ben Jammin:
    - = flat head + = phillips

    And ☐ for Robertson heads, the only ones used by sane people (http://en.wikipedia.org/wiki/List_of_screw_drives#Robertson)

    Lived in around 30 countries (thus far), never knew there was such a thing as square screws...

    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.

  • Dave (unregistered) in reply to Coyne

    If you need to wait for a concurrent stored procedure to complete ... (yay, go debug threading in stored procedures!) </sarcasm>

  • Steven (unregistered) in reply to Coyne

    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...

  • huh? (unregistered) in reply to asdf

    Wow... just wow

  • Alexandros Katechis (unregistered)

    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.

  • Flatface (unregistered) in reply to R

    I just use my fingernail for flathead screws. It works! I promise!

  • Andrew (unregistered)

    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.

  • OccupyWallStreet (unregistered) in reply to Don
    Don:
    gramie:
    Ben Jammin:
    - = flat head + = phillips

    And ☐ for Robertson heads, the only ones used by sane people (http://en.wikipedia.org/wiki/List_of_screw_drives#Robertson)

    Lived in around 30 countries (thus far), never knew there was such a thing as square screws...

    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).

  • JJ (unregistered) in reply to Ido Samuelson
    Ido Samuelson:
    Seriously guys? No one heard about a win32 api called Sleep:

    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

    Seriously dude? You're actually unaware that VBScript cannot call Win32 API functions directly?

    (I kind of hope I fell for a troll, in a way.)

  • JJ (unregistered) in reply to QJo
    QJo:
    [...] 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.
    Out of curiosity, who here uses the term "Allen wrench" more often than "Allen key"? Just curious. (I do....)
  • Ders (unregistered)

    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.

  • Marbux (unregistered)

    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.

  • thatguy (unregistered) in reply to Megamanic

    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...

  • TheKhan (unregistered) in reply to R

    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.

  • Another jerk (unregistered) in reply to some jerk

    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

  • oldfart (unregistered)

    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?

  • Derekwaisy (unregistered)
    Comment held for moderation.
  • Jimmyanten (unregistered)
    Comment held for moderation.

Leave a comment on “Square Peg Meets Round Hole”

Log In or post as a guest

Replying to comment #:

« Return to Article