The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

2006 and we still can't solve the sleep problem...

Last post 03-17-2008 7:59 PM by dlikhten. 106 replies.
Page 1 of 3 (107 items) 1 2 3 Next >
Sort Posts: Previous Next
  • 03-11-2008 4:35 PM

    • dlikhten
    • Top 25 Contributor
    • Joined on 09-27-2007
    • New York Citeyah
    • Posts 670

    2006 and we still can't solve the sleep problem...

    http://www.devhardware.com/forums/programming-82/dos-sleep-command-86596.html

     

    Ok so this guy's 2006 solution to SLEEP is the following:

    PSUEDO CODE!

    Sleep for X seconds:

    1) Calculate exit time

    2) check if current time is our exit time, and we go granular to the milliseconds...

    3) goto step 2 if not match

     

    Wow and here I thought we could solve world hunger, apparently we still can't figure out how to sleep!

    I didn't know there were any idiots left doing thist... I guess i was wrong, insomniacly(new word) wrong!

     

    Code is like a box of chocolates. You never know who stuck a turd in there and why.
    The Stupidest Man On Earth
    SSDS Bug: Program should not start up
    Filed under:
  • 03-11-2008 4:54 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    Sleep for X seconds:

    ping -n X -w 1000 ADDRESS_THAT_IS_ROUTABLE_BUT_WILL_NOT_RESPOND_TO_ICMP > NUL

    < pstorer> Bans don't mean shit on the forum. It's like being on the Sex Offender List. You can still entice kids into your van with candy.

    Want more? Go the IRC channel #TDWTFMafia on irc.slashnet.org.

    Farmer Brown is MasterPlanSoftware. He created a new forum account because he is obsessed with me after I scorned him. Ignoring his trolling is the best way to deal with the crybaby.
  • 03-11-2008 4:55 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    Wow.. the batch file version of what most VB programmers do.

    Join us at #TDWTF on irc.slashnet.org !

  • 03-11-2008 5:08 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    In Win32 API terms if no sleep is available.

    WaitForSingleObject(hObject, xMilliseconds);

    or

     if(GetTickCount() - lastTickCount > xMilliseconds)  // make thread loop

  • 03-11-2008 5:16 PM In reply to

    • dlikhten
    • Top 25 Contributor
    • Joined on 09-27-2007
    • New York Citeyah
    • Posts 670

    Re: 2006 and we still can't solve the sleep problem...

    morbiuswilters:

    Sleep for X seconds:

    ping -n X -w 1000 ADDRESS_THAT_IS_ROUTABLE_BUT_WILL_NOT_RESPOND_TO_ICMP > NUL

     

    Yes I found that... Unfortunately a BIG WTF is that windows has no sleep in command line... WHO THE HECK CAME UP WITH THAT STANDARD??? Anything thats remotely useful in windows costs at least... 5 dollars! But the ping trick works for me :)

     

    Whats better is that someone was SO happy with this, that he decided to endorse it, and even sugested that he compiles it into a binary.

    Code is like a box of chocolates. You never know who stuck a turd in there and why.
    The Stupidest Man On Earth
    SSDS Bug: Program should not start up
  • 03-11-2008 5:52 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

     

    dlikhten:
    Yes I found that... Unfortunately a BIG WTF is that windows has no sleep in command line... WHO THE HECK CAME UP WITH THAT STANDARD??? Anything thats remotely useful in windows costs at least... 5 dollars! But the ping trick works for me :)

    Actually...

    http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&DisplayLang=en

    All you need is the resource kit... And it is free. A simple google search would have told you this.

    Stop being stupid.

    http://www.google.com/search?q=windows+xp+sleep&btnG=Search

  • 03-11-2008 6:11 PM In reply to

    • dlikhten
    • Top 25 Contributor
    • Joined on 09-27-2007
    • New York Citeyah
    • Posts 670

    Re: 2006 and we still can't solve the sleep problem...

    MasterPlanSoftware:

    Stop being stupid.

    Oh my god, god forbid you pick up one southpark joke vs taking everything like an invasion into your manliness!

    In any case, ip trick makes me happier without having to install extra packages. And there are no necessary instructions for anyone using my script who does not have this package from ms... speaking of which... WHY is sleep not part of the default command line utilities? I would think that useful scripts might need a sleep, specially if polling resources... Reminds me of the similar workaroudn i saw in pl/sql since oracle only provides a SYS package for doing wait...


    Code is like a box of chocolates. You never know who stuck a turd in there and why.
    The Stupidest Man On Earth
    SSDS Bug: Program should not start up
  • 03-11-2008 6:24 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    dlikhten:
    WHY is sleep not part of the default command line utilities? I would think that useful scripts might need a sleep, specially if polling resources...
     

    Why don't you stop and consider the users Windows is meant for.

    I cannot think of any reason a DESKTOP USER would need a sleep command. Perhaps you should share and educate us all.

  • 03-11-2008 6:56 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    MasterPlanSoftware:
    I cannot think of any reason a DESKTOP USER would need a sleep command. Perhaps you should share and educate us all.
    I thought they tried to make a server and workstation OS too. Generally the people who run server boxes make scripts to automate stuff. But thanks for the link (below) anyways.
    irc://irc.slashnet.org/#TDWTF
    "You acquaint the SURLY THUGS with your brand of diplomacy."


  • 03-11-2008 7:01 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    Lingerance:
    MasterPlanSoftware:
    I cannot think of any reason a DESKTOP USER would need a sleep command. Perhaps you should share and educate us all.
    I thought they tried to make a server and workstation OS too. Generally the people who run server boxes make scripts to automate stuff. But thanks for the link (below) anyways.
     

    And the RK is for those server users. What is your point?

  • 03-11-2008 7:04 PM In reply to

    • gutch
    • Not Ranked
    • Joined on 02-28-2008
    • Australia
    • Posts 30

    Re: 2006 and we still can't solve the sleep problem...

    TRWTF is the comment on that page from Nilpo that this batch file should be compiled into an executable:

    Nilpo:

    No nasty insults. Very nice. Try using bat2exe to create a compiled executable from your batch file.

     


    Filed under:
  • 03-11-2008 7:07 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    MasterPlanSoftware:
    And the RK is for those server users. What is your point?
    You argued against a point that wasn't made (why the desktop OS doesn't have `sleep`).
    irc://irc.slashnet.org/#TDWTF
    "You acquaint the SURLY THUGS with your brand of diplomacy."


    Filed under:
  • 03-11-2008 7:17 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    Lingerance:
    MasterPlanSoftware:
    And the RK is for those server users. What is your point?
    You argued against a point that wasn't made (why the desktop OS doesn't have `sleep`).
     

    Riiiiight... The server OS has the command in question, and the desktop does not. It can be downloaded for free though.

    But me arguing that dlikhten saying it doesn't exist/ would cost money if it did is wrong.

     

    I see....

  • 03-11-2008 7:30 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    MasterPlanSoftware:
    Riiiiight... The server OS has the command in question, and the desktop does not. It can be downloaded for free though.
    Probably a misunderstanding on my part then; as I don't have immediate access to a Server 2003 box I can't confirm or deny whether or not `sleep` exists out of box.
    irc://irc.slashnet.org/#TDWTF
    "You acquaint the SURLY THUGS with your brand of diplomacy."


  • 03-11-2008 7:33 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    Lingerance:
    I don't have immediate access to a Server 2003 box I can't confirm or deny whether or not `sleep` exists out of box.

    I don't think it does. That is the reason for the resource kit. 

    That is why it is called: Windows Server 2003 Resource Kit Tools.

     

  • 03-11-2008 8:30 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    MasterPlanSoftware:
    I don't think it does. That is the reason for the resource kit. 
    Which again begs the question why it isn't included, or at least easily accessible (why not add it to the "Windows Components" thingy?) Their website is not exactly what I'd call friendly, to install Monad I recall having to go through and download the installer (which wasn't hard to find as I had a direct link from Wikipedia), but it refused to let me download it as for some reason it needed active X, so I switched to IE which was crashing every ten seconds (kid you not) at the time, so I windows updated to IE 7 and after ~four attempts to get it installed it finally installed itself. So I go on with IE 7, complains about an add on not-working but it doesn't crash, possibly the add-on was at fault, so back to the Monad download page, it again won't let me install because I need .NET 2.0 which wouldn't come though Window Update and they didn't provide a link so I actually had to search for it, which wasn't fun as I recall encountering several pages that seemed to be .NET 2.0 download but were not. At that point I gave up as I already spend three hours on it. Although I did try it again at school on Sever 2003, took me about 10 minutes as I knew exactly where to go for .NET 2.0.

    </off-topic>

    At least most distros (Everyone I've tried) their Package Manager will get anything that is on their site, which IMO is a much saner alternative to having a website that doesn't let you install until the dependencies are met. I also like how Exchange requires the user to do all this crazy stuff (manually, when a wizard will do just fine) just install it, some of which require you to remove the Exchange CD and put in the Windows Server 2003 disk (unless you remember what is required before install).
    irc://irc.slashnet.org/#TDWTF
    "You acquaint the SURLY THUGS with your brand of diplomacy."


  • 03-11-2008 8:59 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    Lingerance:
    MasterPlanSoftware:
    I don't think it does. That is the reason for the resource kit. 
    dlikhten "I can't use Windows" style whining
     

    I would rather they don't install tons of more crap in my server OS. Keep it simple. I hardly call a quick google search and a 11mb download complex. I would rather have the option of installing my tools where I want them, rather than having them installed by default in every install I do. Ubuntu server didn't come with everything I needed (or that even Windows Server comes by default with) but you don't hear me whining. I googled what I needed and installed it. Apt-get is cool, but if you don't know exactly what you need, it doesn't help you anymore than anything in Windows. As always, google is your friend.

    Really, stop whining there is nothing complex here.

  • 03-11-2008 9:39 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    I don't know about the Server versions, but XP still comes with some pretty obscure command line tools like edit and ftp. I wouldn't consider a sleep command to be bloat.

    I agree that it sounds like Lingerance is having some serious computer problems, though. I would definitely reinstall if IE was crashing and Windows Update was failing.
  • 03-11-2008 9:43 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    Cap'n Steve:
    I wouldn't consider a sleep command to be bloat.
     

    I doesn't change my argument that it is easily added to the system. Windows != Linux and that is what Lingerance and dlikhten are comparing it against. 

    Decent points though, I definitely agree with her computer issues. Both Lingerance and dlikhten seem to have trouble with trivial computer tasks. But they just blame it on MS or whoever else is easily blamed.

  • 03-11-2008 10:03 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    MasterPlanSoftware:
    I doesn't
     

    *It doesn't 

     

     

    Bahhhhh

  • 03-11-2008 10:20 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    MasterPlanSoftware:
    Both Lingerance and dlikhten seem to have trouble with trivial computer tasks. But they just blame it on MS or whoever else is easily blamed.
    IE craping itself on install due to a glitch in a add-on which causes the previous version to crash == (somehow) "trouble with trivial computer tasks"? My case was: to install Monad I had to jump through hoops that I needn't have to (worsened by an exploding internet explorer); which re-enforced my previous bias against getting software from windows.com.
    Anyways, I went to www.windows.com and found the Windows Server 2003 Resource kit quickly, so I will concede my point about getting software from microsoft.com being painful.
    irc://irc.slashnet.org/#TDWTF
    "You acquaint the SURLY THUGS with your brand of diplomacy."


    Filed under:
  • 03-11-2008 10:24 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    I've seen programs where in the sleep sub, it proceeds to busy the CPU to 100% for the time it requires to "wait", especially on these "Are we done now" loops.

  • 03-11-2008 10:29 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    MasterPlanSoftware:
    Both Lingerance and dlikhten seem to have trouble with trivial computer tasks. But they just blame it on MS or whoever else is easily blamed.

    You're acting like you're surprised that people actually complain about their problems. Expecting something to meet ... uh, expectations, and then venting when it doesn't is hardly "having trouble with trivial computer tasks". Sure, it's easily solved, but that wasn't the point in the first place.

    But if you're trolling for negative comments, then you're obviously on the right track...

    Filed under:
  • 03-11-2008 11:37 PM In reply to

    Re: 2006 and we still can't solve the sleep problem...

    Lingerance:
    IE craping itself on install due to a glitch in a add-on which causes the previous version to crash == (somehow) "trouble with trivial computer tasks"?
     

    Yes. It warned you about the add-on. The add-on is your responsibility, not Microsoft's.

    Lingerance:
    Anyways, I went to www.windows.com and found the Windows Server 2003 Resource kit quickly

    Really? I typed in 'dos sleep' in google and it was the first hit... Why would you bother looking around any further?