"...took some time to run."



  • Ah, supporting legacy crap.  Today was the glorious day when I got introduced to yet another orphaned piece of terrifying software.  They hide these from me until they break, you see, although perhaps that's meant for my sanity.  In any case, it's yet another inscrutible ASP Classic debacle.  Before even touching the code, I try to diagnose the problem by speaking with its user.

    "It isn't working."  Well, yes, I knew that, or else I would've been spared knowledge of it.  Anything more helpful, perhaps?  An error message?  Any output at all, really?  Of course you don't know.  Can you show me what it does? "Well, it doesn't seem to do anything anymore, but you're welcome to sit around and watch.  Even when it did work, this report always took some time to run."

    Oh, that sounds bad.  So I go put on the mental Hazmat suit and take a look at what might be wrong. This is not the first line I wanted to see:

    Server.ScriptTimeout = 10000

    I may be at this one awhile.



  • @Serpentes said:

    So I go put on the mental Hazmat suit <snip>

    *Where* did you get one of those?!



  • @Serpentes said:

    Server.ScriptTimeout = 10000000

    There, fixed.



  • You're worried about a script that takes 10s to run? Meh.



  • From w3schools.com:

    Syntax

    Server.ScriptTimeout[=NumSeconds]



  • Seconds?! Who uses seconds?!

     

    Oh alright, I retract my previous post.  That is a wtf.



  • @Whoa314 said:

    From w3schools.com:

    Syntax

    Server.ScriptTimeout[=NumSeconds]

    So the timeout would be what?  2:46:40?  Looks reasonable to me.



  • @Sutherlands said:

    Seconds?! Who uses seconds?!
     

    void set_time_limit ( int $seconds )

    from php.net

     

    alarm 30; # SIGALRM delivered to this process after 30 secs

    perl cgi

    (couldn't find the equivalent funcion for more server-scripting languages, but i think this is enough to assume that most of them?)

     

    it's just to prevent the code to lock itself in infinite loop and take up server resources forever, no need to have millisecond precision. usually, there's no need to change it at all, unless you've got a very good reason, or you're doing something (very) wrong.



  • @locallunatic said:

    @Whoa314 said:

    From w3schools.com:

    Syntax

    Server.ScriptTimeout[=NumSeconds]

    So the timeout would be what?  2:46:40?  Looks reasonable to me.

    Yes, 2h 46min 40s.

    We need further context to decided whether this is a RWTF or not.

    What kind of report was it?

     



  • @Zecc said:

    We need further context to decided whether this is a RWTF or not.
     

    Anything that takes a long time to run should Flush a message every now and then, or display a progress bar, even if it progresses Windows Explorer style. There is no excuse for a blank screen and a spinner.

    Primarily, everything that takes a long time to run should be inspected for optimizations. Sometimes you can't, but you should at least have a look.

    Things that require a two hour timeout probably have a really bad inefficiency, such as massive string concatenations.

    'Long' is defined as 10 or more seconds. This is a webpage, after all.

     



  • @dhromed said:

    Anything that takes a long time to run should Flush a message every now and then, or display a progress bar, even if it progresses Windows Explorer style. There is no excuse for a blank screen and a spinner.

    Primarily, everything that takes a long time to run should be inspected for optimizations. Sometimes you can't, but you should at least have a look.

    Things that require a two hour timeout probably have a really bad inefficiency, such as massive string concatenations.

    'Long' is defined as 10 or more seconds. This is a webpage, after all.

    That is true. I standsit corrected.

     



  • @dhromed said:

    'Long' is defined as 10 or more seconds. This is a webpage, after all.



    I recently started implementing long reports by asking for an e-mail adress, generating the report on the server and sending the notification with a link to the generated document when the thread has finished.




  • @dhromed said:

    @Zecc said:

    We need further context to decided whether this is a RWTF or not.
     

    Anything that takes a long time to run should Flush a message every now and then, or display a progress bar, even if it progresses Windows Explorer style. There is no excuse for a blank screen and a spinner.

    Primarily, everything that takes a long time to run should be inspected for optimizations. Sometimes you can't, but you should at least have a look.

    Things that require a two hour timeout probably have a really bad inefficiency, such as massive string concatenations.

    'Long' is defined as 10 or more seconds. This is a webpage, after all.

     Seems to me that number could very well be different for different applications. Some might say 5 seconds is long, some might say 15 seconds. These guys apparently consider long 2h 47min. Anything above that needs a progress bar.



  • @Nelle said:

    @dhromed said:
    'Long' is defined as 10 or more seconds. This is a webpage, after all.

    I recently started implementing long reports by asking for an e-mail adress, generating the report on the server and sending the notification with a link to the generated document when the thread has finished.

    Creative, but I'm not sure if that's good from a UI perspective. Maybe it works fine and people  are happy — in which case I completely retract my objections — but it seems that not even showing a webpage trying to load is even worse: you're literally showing absolutely nothing at all. The app's basically saying "It'll be done when it's done. Don't call us. We'll call you. Now shoo."

    If you can offload the rendering to a seperate process, surely you can output progress to the page in some way. Bandcamp commonly takes a long time to compress a FLAC album, and gets it almost right: the page is loading normally with a message "preparing your download", and... a spinner. Welp.



  • @cdosrun said:

    Some might say 5 seconds is long, some might say 15 seconds. These guys apparently consider long 2h 47min. Anything above that needs a progress bar.
     

    I'd like to note that your examples are still in seconds. :)

    It's a ballpark thing, and not an exact science (if you measure user patience, you'll end up with a typical bell curve), but it's still on the order of seconds.

    Two hours without a progress indicator is ridiculous by any standard.



  • @dhromed said:

    if you measure user patience, you'll end up with a typical bell curve

    Actually, I suspect you'll find a skew towards "lots of patience". The impatient ones couldn't be bothered waiting for the survey to load. ;)



  • Of course it was probably just that the script took longer than the default timeout (30 seconds?) to run, and when the original coder discovered this, he decided to just set it to a ridiculously large value so it'd never bother him again. There's no indication that the script actually needs over 2 hours.



    (There may well be a way to turn it off completely, probably by setting it to zero, but people who write WTFy code tend not to do things the "proper" way.)



    Also agreed that any long-running task should show some indication of its progress, even if it doesn't know how much work it has to do, just so we know it's getting somewhere. (e.g. even just showing "processed n lines so far" if you don't know how many lines there are.) A spinner isn't really useful, because it's entirely possible (and fairly common) that it gets into a "high-level" loop, where it's not making any progress but still managing to update the UI. (Say because it just keeps processing the same line over and over or something.)



  • @lolwtf said:

    (There may well be a way to turn it off completely, probably by setting it to zero, but people who write WTFy code tend not to do things the "proper" way.)
     

    it seems more proper to me to set a high value reasonably above the "it can't take more than this, even in the worst case scenario", to retain the possibility that the script will be killed if it really takes absurd amount of time to finish (or locks up), instead of setting it to "no limit".

     @lolwtf said:

    A spinner isn't really useful, because it's entirely possible (and fairly common) that it gets into a "high-level" loop, where it's not making any progress but still managing to update the UI.

    "oh, look, your browser still manages to spin the spinner.gif, so the server is definitely making progress!"
    i love those

     



  • @Ibix said:

    @dhromed said:

    if you measure user patience, you'll end up with a typical bell curve

    Actually, I suspect you'll find a skew towards "lots of patience". The impatient ones couldn't be bothered waiting for the survey to load. ;)

    I know you were just joking, but... you'd still get a bell-curve.


  • @dhromed said:

    @cdosrun said:

    Some might say 5 seconds is long, some might say 15 seconds. These guys apparently consider long 2h 47min. Anything above that needs a progress bar.
     

    I'd like to note that your examples are still in seconds. :)

    It's a ballpark thing, and not an exact science (if you measure user patience, you'll end up with a typical bell curve), but it's still on the order of seconds.

    Two hours without a progress indicator is ridiculous by any standard.

     I wasn't entirely serious there. It amuses me to think about the Standards Commitee meeting 8 hours a day for a week straight, debating back and forth, getting stakeholder buy in, drafting and redrafting documents, performing usability studies, and coming out with the rule "Any Process which takes longer thatn 2 hours, 46 minutes, and 41 Seconds absolutely must display a progress bar or other notification to the End User that processing is occuring, or give indication that processing has failed. No exceptions!"

     I'm sure real life was much different. Given the very little we have to go on, I'd guess it's running reports against an equally wtf database. When it was originally released, it ran in a reasonable amount of time. I'm sure everyone knows the rest of this story.

     

     


  • ♿ (Parody)

    @dhromed said:

    Things that require a two hour timeout probably have a really bad inefficiency, such as massive string concatenations.

    IME, it's usually something like a cartesian join plus DISTINCT. Or a missing index (report / query wise, anyways). Another common WTF is making lots of round trips to the DB instead of using a single query to fetch multiple rows.



  • @intertravel said:

    @Ibix said:
    @dhromed said:

    if you measure user patience, you'll end up with a typical bell curve

    Actually, I suspect you'll find a skew towards "lots of patience". The impatient ones couldn't be bothered waiting for the survey to load. ;)

    I know you were just joking, but... you'd still get a bell-curve.

    That's not possible - negative wait time values wouldn't exist in the domain space since it's not measurable (and therefore not verifiable that such a desired wait time truly exists despite your user's insistence they wanted it yesterday); You'd get a Poisson curve*. </PedanticMode>

    *Yes, I know that for sufficiently large first central moment values (like 8 or larger, in this case), Poisson curves can be well approximated by Gaussian curves.



  • @rad131304 said:

    @intertravel said:
    @Ibix said:
    @dhromed said:

    if you measure user patience, you'll end up with a typical bell curve

    Actually, I suspect you'll find a skew towards "lots of patience". The impatient ones couldn't be bothered waiting for the survey to load. ;)

    I know you were just joking, but... you'd still get a bell-curve.

    That's not possible - negative wait time values wouldn't exist in the domain space since it's not measurable (and therefore not verifiable that such a desired wait time truly exists despite your user's insistence they wanted it yesterday); You'd get a Poisson curve*. </PedanticMode>

    *Yes, I know that for sufficiently large first central moment values (like 8 or larger, in this case), Poisson curves can be well approximated by Gaussian curves.

    This is starting to reach the limits of what I remember from school, but, are you sure? I really don't think that's right - or you couldn't have a bell-curve of, say, heights in a population.

  • ♿ (Parody)

    @intertravel said:

    This is starting to reach the limits of what I remember from school, but, are you sure? I really don't think that's right - or you couldn't have a bell-curve of, say, heights in a population.

    "Bell curve" isn't exactly a precise statistical term. A "normal," or Gaussian curve is defined from negative to positive infinity. Once you get a few standard deviations away from the mean, however, the values are so small that it's usually safe to ignore, and it's probably close enough to whatever more accurate distribution (poisson, etc) would be better, such that any gain in accuracy is probably swamped by other stuff like measurement error or sampling error or whatever.



  • @boomzilla said:

    "Bell curve" isn't exactly a precise statistical term.
    Yeah, I know. I was hoping that would give me more leeway to be right :)

    @boomzilla said:

    A "normal," or Gaussian curve is defined from negative to positive infinity.
    So the heights of a population don't follow a normal distribution, but the variance from the mean does? I'm fairly sure that when I was at school the heights of a population was the standard example.


  • ♿ (Parody)

    @intertravel said:

    @boomzilla said:
    A "normal," or Gaussian curve is defined from negative to positive infinity.

    So the heights of a population don't follow a normal distribution, but the variance from the mean does? I'm fairly sure that when I was at school the heights of a population was the standard example.

    No, they probably do fit pretty well to the curve itself, where you have data. However, if you use a normal curve as your statistical model, it will give you a nonzero probability of a -30 foot person and a 50 foot woman. Clearly, this is not correct, but the probabilities are so small that it doesn't really matter.



  • @intertravel said:

    @boomzilla said:
    "Bell curve" isn't exactly a precise statistical term.
    Yeah, I know. I was hoping that would give me more leeway to be right :)

    @boomzilla said:

    A "normal," or Gaussian curve is defined from negative to positive infinity.
    So the heights of a population don't follow a normal distribution, but the variance from the mean does? I'm fairly sure that when I was at school the heights of a population was the standard example.
    I've always understood "Bell Curve" to be synonymous with Gaussian Distributions.

    IIRC (trying to remember college stat definitions), while "mean" (first central moment) and "variance" (second central moment) exist; they are not meaningful in the sense that they are not values that help describe the probability mass function. If the domain space is not unbounded, then a true gaussian distribution cannot occur - this doesn't mean that certain sets of statistics can't be approximated with a Gaussian. Poisson statistics, when the first central moment is sufficiently far from zero, are not significantly different in the least-squares sense from Gaussian statistics using classic first and second central moments.

    A classic example in Physics is the emission of radiation from a source for small time frames relative to half life. When the timeframe is sufficiently small (the mean emission count during the timeframe is <10 ) the deviation from gaussian statistics can be observed, but when the timeframes are larger, say 15-20 counts per bin, both Poisson and Gaussian statistics can approximate the result well.

    edit - 

    tl;dr version: Pedantically, no, heights do not fit Gaussian statistics because of what boomzilla said relating to negative heights. Practically, the deviation in correct probability distribution is so insignificant that the difference in the predicted heights of the two statistical models is insignificant with respect to the measurement.



  • @boomzilla said:

    However, if you use a normal curve as your statistical model, it will give you a nonzero probability of a -30 foot person and a 50 foot woman. Clearly, this is not correct, but the probabilities are so small that it doesn't really matter.
    But isn't one standard deviation about an inch? Your fifty foot woman is hundreds of standard deviations from the norm - the probability is infinitesimally tiny, even if technically non-zero. I was never much cop at this stuff, but I understood that it's all about approximations anyway? Surely that's the whole point of stats? It doesn't give you an exact answer, but simply the probability of an event occurring.

    I should go away and read some more, right? :)



  • Is there some kind of scientific study on what factors cause a thread to get so boring? So we can identify and remove the causes?



  • @blakeyrat said:

    Is there some kind of scientific study on what factors cause a thread to get so boring? So we can identify and remove the causes?

    I believe it is a dual-factor syndrome caused by what's known as "a lack of interest" and "a lack of humor". However, recent studies have suggested that it is not in fact the thread which exhibits these properties, but in fact the reader. Therefore, if that turns out to be true, the best way to remove the cause is to remove the reader with the listed conditions.



  • @blakeyrat said:

    Is there some kind of scientific study on what factors cause a thread to get so boring? So we can identify and remove the causes?

    The average user of this forum aka pedantic dickweed.

    The only problem is that if we remove them, it will greatly reduce our numbers.

    That would make dhromed ass so lonely



  • @intertravel said:

    @boomzilla said:
    However, if you use a normal curve as your statistical model, it will give you a nonzero probability of a -30 foot person and a 50 foot woman. Clearly, this is not correct, but the probabilities are so small that it doesn't really matter.
    But isn't one standard deviation about an inch? Your fifty foot woman is hundreds of standard deviations from the norm - the probability is infinitesimally tiny, even if technically non-zero. I was never much cop at this stuff, but I understood that it's all about approximations anyway? Surely that's the whole point of stats? It doesn't give you an exact answer, but simply the probability of an event occurring.

    I should go away and read some more, right? :)

    The 50' woman should have a non-zero probability; the -30 foot person should not - one value is technically possible, despite the fact that it may be impractical. I'm not sure I want to argue the "point" of statistics, but that's what they often get used for. In the case of heights, Gaussian statistics do a decent enough job of predicting height that there is no point in using more complex statistical models. That doesn't make them right, but it does make them a useful substitute to reduce computational complexity in this class of problems.

    @blakeyrat said:

    Is there some kind of scientific study on what factors cause a thread to get so boring? So we can identify and remove the causes?
    Nobody's making you read this ....


  • ♿ (Parody)

    @blakeyrat said:

    Is there some kind of scientific study on what factors cause a thread to get so boring? So we can identify and remove the causes?

    Good point. We need more flaming, you asshole.



  • @boomzilla said:

    @blakeyrat said:
    Is there some kind of scientific study on what factors cause a thread to get so boring? So we can identify and remove the causes?

    Good point. We need more flaming, you asshole.

    At least flaming and trolling is funny. You diseased cumbucket.

    Statistics lectures? Not funny.



  • @serguey123 said:

    That would make dhromed ass so lonely

    I'm hoping this is some kind of language barrier thing?



  • @C-Octothorpe said:

    @serguey123 said:

    That would make dhromed ass so lonely

    I'm hoping this is some kind of language barrier thing?

    Why, don't asses need caring where you live? They toil all day long transporting cargo, the least you could do is keep them company.

    dhromed's ass is no different, ask him/her/it



  • @blakeyrat said:

    @boomzilla said:
    @blakeyrat said:
    Is there some kind of scientific study on what factors cause a thread to get so boring? So we can identify and remove the causes?

    Good point. We need more flaming, you asshole.

    At least flaming and trolling is funny. You diseased cumbucket.

    Statistics lectures? Not funny.

    But interesting to some. Not you, but others. And that's okay.

  • ♿ (Parody)

    @Xyro said:

    @blakeyrat said:
    Statistics lectures? Not funny.

    But interesting to some. Not you, but others. And that's okay.

    NO! You must entertain him! Don't you know that his job is TRWTF?



  • @Xyro said:

    @blakeyrat said:
    @boomzilla said:
    @blakeyrat said:
    Is there some kind of scientific study on what factors cause a thread to get so boring? So we can identify and remove the causes?
    Good point. We need more flaming, you asshole.
    At least flaming and trolling is funny. You diseased cumbucket.

    Statistics lectures? Not funny.

    But interesting to some. Not you, but others. And that's okay.

    The above statement is unproven, please provide us with convincing evidence because the conversation was really boring, at least dhromed's ass is a looker


  • ♿ (Parody)

    @serguey123 said:

    at least dhromed's ass is a looker

    Pics or it didn't happen...



  • @boomzilla said:

    NO! You must entertain him! Don't you know that his job is TRWTF?
    Did you mean TDWTF or were you really expressing what you feel about the quality of his job?


  • ♿ (Parody)

    @Zecc said:

    @boomzilla said:
    NO! You must entertain him! Don't you know that his job is TRWTF?

    Did you mean TDWTF or were you really expressing what you feel about the quality of his job?

    <a href="http://forums.thedailywtf.com/forums/p/24514/256833.aspx#256833>blakey said it, not me.



  • @boomzilla said:

    @serguey123 said:
    at least dhromed's ass is a looker
    Pics or it didn't happen...

     

    I promised him not to distribute the pics, all some are unsavory and nsfw.  Ask him.



  • @serguey123 said:

    @boomzilla said:

    @serguey123 said:
    at least dhromed's ass is a looker
    Pics or it didn't happen...

    I promised him not to distribute the pics, all some are unsavory and nsfw.  Ask him.

    Oh man, has this thread hit rock-bottom.  Also, unless dhromed is a really hot chick (very likely not), then these pics can remain unshared, thanks.



  • @C-Octothorpe said:

    @serguey123 said:

    @boomzilla said:

    @serguey123 said:
    at least dhromed's ass is a looker
    Pics or it didn't happen...

    I promised him not to distribute the pics, all some are unsavory and nsfw.  Ask him.

    Oh man, has this thread hit rock-bottom.  Also, unless dhromed is a really hot chick (very likely not), then these pics can remain unshared, thanks.

    1. If you think this is rock-botton you have not been here long enough.
    2. Real women in nerdy places are a rarity, dhromed is all you are going to get here, (if you don't know this, you haven't been online for long)
    3. If you read my tags and my comment you will see that dhromed is dhromed, also why won't you want pictures of a cargo animal?


  • @serguey123 said:

    1. If you think this is rock-botton you have not been here long enough.
    2. Real women in nerdy places are a rarity, dhromed is all you are going to get here, (if you don't know this, you haven't been online for long)
    3. If you read my tags and my comment you will see that dhromed is dhromed, also why won't you want pictures of a cargo animal?

    1. So I have seen...
    2. dhromed shares nude pictures of himself all the time here?  You're right, it *hasn't* hit rock bottom yet.
    3. Didn't notice the tags until now (scary, thanks again).  Also, if you have nsfw pictures of a cargo animal, I *definitely* don't want to see them, although I'm sure the SPCA would like to have a word with you.


  • @C-Octothorpe said:

    @serguey123 said:

    That would make dhromed ass so lonely

    I'm hoping this is some kind of language barrier thing?

     

    it hungers....

     



  • @blakeyrat said:

    Statistics lectures?
     

    I thought it was alright.



  • @dhromed said:

    @blakeyrat said:

    Statistics lectures?
     

    I thought it was alright.

    Compared to the ass talk, I'd much rather have the statistics. I didn't realize that was the trade-off...



  • @blakeyrat said:

    @dhromed said:

    @blakeyrat said:

    Statistics lectures?
     

    I thought it was alright.

    Compared to the ass talk, I'd much rather have the statistics. I didn't realize that was the trade-off...

    The grass isn't that much greener, is it?


Log in to reply