Reverse functional programming



  • @Ben L. said:

    My point was that any interesting program that uses threads would be longer than the attention span of the average TDWTFer would allow.

    This is the first time you've deigned to explain what your point was.


  • ♿ (Parody)

    @morbiuswilters said:

    @Ben L. said:
    That includes abstractions of threads, like goroutines...

    Soo.. you're basically admitting that nothing you've posted in this thread is interesting and that Blakey is correct?

    I think I believe you now that you're one of blakey's alts. This leap of "logic" is truly worthy of his talents.


  • Discourse touched me in a no-no place

    @morbiuswilters said:

    @Ben L. said:
    My point was that any interesting program that uses threads would be longer than the attention span of the average TDWTFer would allow.

    I don't think there's any interesting program that fits into 100 lines.

    For some definition of "interesting," all kinds of IOCCC programs fit into 100 lines.



  • @morbiuswilters said:

    @Ben L. said:
    My point was that any interesting program that uses threads would be longer than the attention span of the average TDWTFer would allow.

    I don't think there's any interesting program that fits into 100 lines.

    I'm sure the IOCCC would have something to say about that.

    @morbiuswilters said:

    @Ben L. said:
    That includes abstractions of threads, like goroutines...

    Soo.. you're basically admitting that nothing you've posted in this thread is interesting and that Blakey is correct?

    I'll answer this in two parts:

    @morbiuswilters said:

    Soo.. you're basically admitting that nothing you've posted in this thread is interesting

    Yes.

    @morbiuswilters said:

    and that Blakey is correct?

    I just re-read all the posts in this thread, and I'm struggling to find anything blakeyrat said that hasn't already been disproven (by people other than me). Did you mean this one:
    @blakeyrat said:
    Blakey doesn't have alts.



  • @blakeyrat said:

    @Ben L. said:
    My point was that any interesting program that uses threads would be longer than the attention span of the average TDWTFer would allow.

    This is the first time you've deigned to explain what your point was.


    @Ben L. said:
    Okay, let me break this down:

    First, it allocates 800MB of memory and fills it with random floating point numbers.

    Then, it spawns a thread for each CPU, ignoring your environment variables and settings.

    Then it runs this little thing on each one:

    // Computes the element-wise squared distance between two
    // slices. Returns a slice where the value at element i is
    // equal to (input[i] - output[i])^2
    func ElemSqDist(input, output, ans []float64) {
    	for i, val := range input {
    		ans[i] += math.Pow(val-output[i], 2)
    	}
    }
    
    That's right, it takes three slices (similar to what Java calls "arrays") as input and has no return value.

    That runtimes[:5] near the bottom means "give me the first 5 values of runtimes". In this context, it is basically "crash if nRuns is less than 5".

    		answers[i] = totalSqDist[0]
    Right here, it's taking the first element of totalSqDist (a 500-element slice) and just forgetting the rest of it existed. Because all those calculations needed to produce the other 499 useless numbers would go to waste if they were used anywhere.

    Right near the end, it calls this function:

    func CloseWorkers(inputCh, resultCh chan *DataSet, quitCh chan bool) {
    	close(quitCh)
    }
    
    It takes three arguments and calls another function on one of them and ignores the fact that the other ones were even passed in.

    And then it sleeps for 1 second. Because everyone knows you should allow at least 1 second for your processors to cool down before exiting. By the way, omitting the last two lines of main would make no difference in what the useless program does.



  • @Ben L. said:

    I'm sure the IOCCC would have something to say about that.

    So this is what it's come to. While I grant that IOCCC programs may be interesting due to their novelty, that's not what we're talking about here.



  • @boomzilla said:

    @morbiuswilters said:
    @Ben L. said:
    That includes abstractions of threads, like goroutines...

    Soo.. you're basically admitting that nothing you've posted in this thread is interesting and that Blakey is correct?

    I think I believe you now that you're one of blakey's alts. This leap of "logic" is truly worthy of his talents.

    Ignore the "Blakey is correct" part. He said that no program less than 100 lines is going to really do anything interesting, and that's all he's posted. He even admits as much in his next comment.



  • Bottom-line it for me.



  • @dhromed said:

    Bottom-line it for me.

    I won.. I think. I don't have the priapismic erection I normally get win I when a forum argument, though.



  • So quoting the OP is some kind of "strategy"...?

    You've completely lost me, Ben L.



  • @blakeyrat said:

    So quoting the OP is some kind of "strategy"...?

    Especially since this is a sidebar thread after 4 pages, shouldn't the discussion be about the Office Ribbon or Git or anything besides the OP's topic?



  • @MiffTheFox said:

    Especially since this is a sidebar thread after 4 pages, shouldn't the discussion be about the Office Ribbon or Git or anything besides the OP's topic?

    Hmm.. good point..

    consults forum manual

    Says here by page 4 we should be arguing about dinosaur porn or gun control. Here, I'll get us started:



    I question the masculinity of any nation with gun control stricter than the OK Corral.


  • ♿ (Parody)

    @dhromed said:

    Bottom-line it for me.

    Much flaming of Go, some deserved, some trolling. I wouldn't judge Go based on this thread, though I think everyone will agree that its pros and cons are less well known than more popular languages.


  • Discourse touched me in a no-no place

    @morbiuswilters said:

    Here, I'll get us started:

    Nah. Not realistic enough. (Though looking at the source of that picture, I'm not surprised.)



  • @PJH said:

    @morbiuswilters said:
    Here, I'll get us started:

    Nah. Not realistic enough. (Though looking at the source of that picture, I'm not surprised.)

    Yours lacks the emotion and tenderness of my dinosaur erotica. Look at how they stare into each other's eyes.

    Yours is simply vulgar smut.



  • @MiffTheFox said:

    @blakeyrat said:
    So quoting the OP is some kind of "strategy"...?

    Especially since this is a sidebar thread after 4 pages, shouldn't the discussion be about the Office Ribbon or Git or anything besides the OP's topic?

    How about how Excel clears the undo stack upon save? God I hate that.


  • Discourse touched me in a no-no place

    @Nexzus said:

    @MiffTheFox said:
    @blakeyrat said:
    So quoting the OP is some kind of "strategy"...?

    Especially since this is a sidebar thread after 4 pages, shouldn't the discussion be about the Office Ribbon or Git or anything besides the OP's topic?

    How about how Excel clears the undo stack upon save? God I hate that.
    Especially when it posts an xkcd cartoon. I appear to have an example of the latter here:




  • @Nexzus said:

    How about how Excel clears the undo stack upon save? God I hate that.



  • @morbiuswilters said:

    @Nexzus said:
    How about how Excel clears the undo stack upon save? God I hate that.


    Is this thread really still going? Or, have I come unstuck in time again?



  •  This thread is an illusion.


  • Considered Harmful

    Goodness me, the clock has struck— Alackday, and fuck my luck.


  • Discourse touched me in a no-no place

    @morbiuswilters said:

    @Ben L. said:
    I'm sure the IOCCC would have something to say about that.

    So this is what it's come to. While I grant that IOCCC programs may be interesting due to their novelty, that's not what we're talking about here.

    Partial nonsense. Invoking IOCC is certainly a fair counter to the bald-faced assertion that "any interesting program that uses threads would be longer than [100 lines]."

    Unless you think that, for example, a 1500-byte LISP interpreter is not interesting.



  • @FrostCat said:

    @morbiuswilters said:
    @Ben L. said:
    I'm sure the IOCCC would have something to say about that.

    So this is what it's come to. While I grant that IOCCC programs may be interesting due to their novelty, that's not what we're talking about here.

    Partial nonsense. Invoking IOCC is certainly a fair counter to the bald-faced assertion that "any interesting program that uses threads would be longer than [100 lines]."

    Unless you think that, for example, a 1500-byte LISP interpreter is not interesting.

    #     include                              <math.h>
    #     include                              <stdio.h>
    #     define                               d double
    d     a,s;int     n;p(d t                  ,d M,d x)
    {     return      x>0?x>1     &&!fork(     )?p(t,s+=
    a     ,x-1):0     :scanf(     "%lf",&x     )-1?a=(M-
    t     )/22,s=     pow(10,     (int)(       log10(a))                /*It is
    a     simple      tool to     quickly      analyze                  data. */
    -     2),s=t-     (a =s*(     int)(a/s     ))/2,p(t,                s,(int)(
    (     a+M-t)/     a)):p(t     >M|x<t?x     :t,t>M|x     >M?x:M      ,--n)+(x
    >     s&&x <=     s+a); }     main(j){     j==1?j=p     (1,0,0)     ,printf(
    "%+12g %4d",s+a/2,j,wait(NULL)),main(j*400/n):putchar(35-25*!j)&' '&&main(j+1);}


  • @FrostCat said:

    @morbiuswilters said:
    @Ben L. said:
    I'm sure the IOCCC would have something to say about that.

    So this is what it's come to. While I grant that IOCCC programs may be interesting due to their novelty, that's not what we're talking about here.

    Partial nonsense. Invoking IOCC is certainly a fair counter to the bald-faced assertion that "any interesting program that uses threads would be longer than [100 lines]."

    Unless you think that, for example, a 1500-byte LISP interpreter is not interesting.

    If we're going to play that game, you could have just jumped to the chase and strip the Apache source of comments and newlines.


  • Considered Harmful

    @morbiuswilters said:

    If we're going to play that game, you could have just jumped to the chase and strip the Apache source of comments and newlines.

    I've mentioned this before, but at my former company we were contractually obligated to provide our client with full source code to our app, before they'd paid. My then-boss had a strong suspicion they were planning to take the code and run, so he tasked me with providing the source code to the client, in the most unusable form possible. So we gave them hard copy printouts of the source code (several thousand files) with all comments removed.



  • @Ben L. said:

    # include <math.h> # include <stdio.h> # define d double d a,s;int n;p(d t ,d M,d x) { return x>0?x>1 &&!fork( )?p(t,s+= a ,x-1):0 :scanf( "%lf",&x )-1?a=(M- t )/22,s= pow(10, (int)( log10(a)) /*It is a simple tool to quickly analyze data. */ - 2),s=t- (a =s*( int)(a/s ))/2,p(t, s,(int)( ( a+M-t)/ a)):p(t >M|x<t?x :t,t>M|x >M?x:M ,--n)+(x > s&&x <= s+a); } main(j){ j==1?j=p (1,0,0) ,printf( "%+12g %4d",s+a/2,j,wait(NULL)),main(j*400/n):putchar(35-25*!j)&' '&&main(j+1);}
     

    I am simultaneously intrigued and horrified.


  • Discourse touched me in a no-no place

    @dhromed said:

    @Ben L. said:

    #     include                              <math.h>

    include <stdio.h>

    define d double

    d a,s;int n;p(d t ,d M,d x)
    { return x>0?x>1 &&!fork( )?p(t,s+=
    a ,x-1):0 :scanf( "%lf",&x )-1?a=(M-
    t )/22,s= pow(10, (int)( log10(a)) /*It is
    a simple tool to quickly analyze data. */

    • 2),s=t-     (a =s*(     int)(a/s     ))/2,p(t,                s,(int)(
      

    ( a+M-t)/ a)):p(t >M|x<t?x :t,t>M|x >M?x:M ,--n)+(x
    > s&&x <= s+a); } main(j){ j==1?j=p (1,0,0) ,printf(
    "%+12g %4d",s+a/2,j,wait(NULL)),main(j400/n):putchar(35-25!j)&' '&&main(j+1);}

     

    I am simultaneously intrigued and horrified.

    Just a shame it segfaults when you pass the source code as data to the binary. (Or it did here.)


  • Discourse touched me in a no-no place

    @morbiuswilters said:

    If we're going to play that game, you could have just jumped to the chase and strip the Apache source of comments and newlines.
    <lawyer type="language">Nope.</lawyer>



  • @joe.edwards said:

    @morbiuswilters said:
    If we're going to play that game, you could have just jumped to the chase and strip the Apache source of comments and newlines.

    I've mentioned this before, but at my former company we were contractually obligated to provide our client with full source code to our app, before they'd paid. My then-boss had a strong suspicion they were planning to take the code and run, so he tasked me with providing the source code to the client, in the most unusable form possible. So we gave them hard copy printouts of the source code (several thousand files) with all comments removed.

    As funny as that is, I wonder how a court would see it.


  • Discourse touched me in a no-no place

    @joe.edwards said:

    I've mentioned this before,
    Got a link handy? I don't recall it
    but at my former company we were contractually obligated to provide our client with full source code to our app, before they'd paid.
    WTF? Why? And who agreed to it?


  • Considered Harmful

    Back when my username was my email address, and the domain name of that email address was my employer. Actually, I could probably fill a few front page articles with stories from that place. They had some serious WTFs with their HR department as well as their tech stuff.

    For example, it was not uncommon for developers to patch code in Notepad over RDP on a production web server. Oh, and source control, what's that?

    I personally was given a 30 page proposal to look over, and I discovered the last two pages were actually an emailed agenda matter-of-factly discussing which of 3 Indian developer candidates were going to replace me (spoiler: they decided to replace my boss instead of me). Then, when they did fire my boss, they did so by accidentally handing him his severance check while distributing paychecks. He was blind-sided.

    That little incident did send me job-hunting, though. I left a few months later for a non-WTF company who doubled my salary.



  • @joe.edwards said:

    Then, when they did fire my boss, they did so by accidentally handing him his severance check while distributing paychecks.

    This is the best way to fire someone.


  • Discourse touched me in a no-no place

    At-will notice periods (was Re: reverse functional programming)

    @morbiuswilters said:

    @joe.edwards said:
    Then, when they did fire my boss, they did so by accidentally handing him his severance check while distributing paychecks.

    This is the best way to fire someone.

    Out of interest, where "at-will employment" applies, how common is it for notice periods to be included in the contract?


  • Considered Harmful

    It was mostly an issue of tact, this was a company consisting in its entirety of about 25 people who were all on a first-name basis with each other.

    They had an issue of very high turnover (big surprise!) When I left, not a single person who worked there when I started - with the exclusion of the three partners who own the company - still worked there.

    We had a fun morale-building all-hands meeting one time where the operations manager built a wall with boxes of business cards of people who had been fired, with the heartwarming narration of "nobody here has job security." The wall had about 12 bricks.



  • @PJH said:

    @morbiuswilters said:
    @joe.edwards said:
    Then, when they did fire my boss, they did so by accidentally handing him his severance check while distributing paychecks.

    This is the best way to fire someone.

    Out of interest, where "at-will employment" applies, how common is it for notice periods to be included in the contract?

    At-will employment has no contract. Everyone I've ever fired (or seen fired) has been terminated immediately. Someone in HR talks to them while I revoke their access. Then they come back, gather their things, and leave.

    It's traditional for employees to give at least 2 weeks when they quit. In my experience, this is merely a formality as nothing useful ever gets done in those 2 weeks. If it's on good terms, I usually let the company know they are free to contact me if they have any questions or need access to something, which I would provide gratis, assuming it doesn't become burdensome. (I did once have a sysadmin call me after I had been at a new job 2 months. He asked me if I had ever installed Sendmail. I told him we never used Sendmail and he was like "Yeah, I know, but I'm trying to install it now and can't figure it out." I politely informed him this was beyond supporting my previous work.)

    I've only not given notice once. The company was a disaster and of the 4 technical people, the 3 competent ones ended up leaving. I was the only person who understood how the spaghetti mess worked, which left them pretty far up a creek without a paddle. I don't know if the company has gone under yet, or is still hanging on by a thread. I do know the software that we had a 1-year head start on everyone else with has already been surpassed by new entries into the marketplace, so they're dead in the water at this point.



  • @morbiuswilters said:

    At-will employment has no contract.

    I'm at-will and I have a contract.



  • @blakeyrat said:

    @morbiuswilters said:
    At-will employment has no contract.

    I'm at-will and I have a contract.

    What kind of contract? Obviously there are things like NDAs and employee agreements, but I was referring to employment contracts (i.e. one which provides some agreement between employer and employee regarding the duration of employment, required deliverables from either party, conditions for terminating the relationship.) Unless the rules of your jurisdiction are out-of-the-ordinary, such an agreement would preclude at-will employment.



  • @morbiuswilters said:

    What kind of contract? Obviously there are things like NDAs and employee agreements, but I was referring to employment contracts (i.e. one which provides some agreement between employer and employee regarding the duration of employment, required deliverables from either party, conditions for terminating the relationship.) Unless the rules of your jurisdiction are out-of-the-ordinary, such an agreement would preclude at-will employment.

    Either you or I badly misunderstand "at-will".

    I have a contract with my employer that spells out things like how much I get paid, how often I get evaluated for raises/adjustments, how many vacation days I have, the company dispute resolution, etc. I dunno if it says anything about how long notice should be given before a party quits/fires the other party.

    The State I'm in is an "at-will" State, meaning there's no requirement that I have that contract. But I have it because being an at-will State doesn't magically make normal contract law disappear and I'm free as an individual to agree to a contract (as long as nothing in it violates State Law) and my employer is free to give me a contract to sign, and refuse employment if I don't. (Now if the contract says I must give 2 weeks' notice and I don't, in theory the company could come after me in a Civil Court for breaking the contract-- the reality is the odds they'd bother are extremely low. Similarly, if the contract says *they* must give notice and they don't, then I could bring them up in a Civil Court for breaking the contract but, again, I'd probably not bother.)

    From my understanding, States that are not "at-will" are the same way, except State Law provides a minimum notice period for employment termination. Since my State doesn't have that, it may or may not be in my contract. (I'd have to check and I don't have it handy.) But if you lived in a state without "at-will" you could/would still sign a contract, the only difference is your contract couldn't override the State Law and say for example, "employer may terminate employee at any time." Because that would be illegal. But it *could* say "employer must give 8 weeks' notice" because that would go above and beyond what the existing State Law required.



  • @Ben L. said:

    I'm sure the IOCCC would have something to say about that.
     



  • Discourse touched me in a no-no place

    @morbiuswilters said:

    @PJH said:
    @morbiuswilters said:
    @joe.edwards said:
    Then, when they did fire my boss, they did so by accidentally handing him his severance check while distributing paychecks.

    This is the best way to fire someone.

    Out of interest, where "at-will employment" applies, how common is it for notice periods to be included in the contract?

    At-will employment has no contract.

    Ignore me - I misread the PikiWeedia article - it referred to fixed term contracts, not notice periods.



  • @blakeyrat said:

    Either you or I badly misunderstand "at-will".

    I have a contract with my employer that spells out things like how much I get paid, how often I get evaluated for raises/adjustments, how many vacation days I have, the company dispute resolution, etc. I dunno if it says anything about how long notice should be given before a party quits/fires the other party.

    The State I'm in is an "at-will" State, meaning there's no requirement that I have that contract. But I have it because being an at-will State doesn't magically make normal contract law disappear and I'm free as an individual to agree to a contract (as long as nothing in it violates State Law) and my employer is free to give me a contract to sign, and refuse employment if I don't. (Now if the contract says I must give 2 weeks' notice and I don't, in theory the company could come after me in a Civil Court for breaking the contract-- the reality is the odds they'd bother are extremely low. Similarly, if the contract says *they* must give notice and they don't, then I could bring them up in a Civil Court for breaking the contract but, again, I'd probably not bother.)

    From my understanding, States that are not "at-will" are the same way, except State Law provides a minimum notice period for employment termination. Since my State doesn't have that, it may or may not be in my contract. (I'd have to check and I don't have it handy.) But if you lived in a state without "at-will" you could/would still sign a contract, the only difference is your contract couldn't override the State Law and say for example, "employer may terminate employee at any time." Because that would be illegal. But it *could* say "employer must give 8 weeks' notice" because that would go above and beyond what the existing State Law required.

    There are at-will states and at-will employment. So you can work in an at-will state but still have a contract, which would not make you an at-will employee. Basic at-will employment means that either employer or employee can terminate the relationship at any time, for any reason (or even for no reason). There are numerous exceptions to this, though; for example, an employer cannot terminate an employee simply for being in a legally-protected group (i.e. discrimination; what counts as protected and where the burden-of-proof lie vary by state and circumstance); nor they an employee be terminated for refusing to commit an unlawful or immoral act.

    A handful of states also have "good faith" provisions for terminating at-will employment. This means that an employer cannot terminate employment in bad faith (basically, they must have "just cause") and marks the broadest statutory departure from normal at-will employment.

    Any contractual modification to this removes the at-will status. So if employer and employee agree to 2 weeks notice before terminating the relationship, that is no longer at-will employment, since there are now contractual obligations that tie each to continuing the relationship.



  • @joe.edwards said:

    When I left, not a single person who worked there when I started - with the exclusion of the three partners who own the company - still worked there.
     

    I'm sure you're not that hard to work alongside.


  • Discourse touched me in a no-no place

    @Cassidy said:

    @Ben L. said:

    I'm sure the IOCCC would have something to say about that.
     


    You're missing a C[1].



    (Incidentally why is Google appending so much unreadable crap to their (probably not just) image search URLs that take ages to figure out the unnecessary/user-identifiable stuff?)


  • Considered Harmful

    @Cassidy said:

    @joe.edwards said:

    When I left, not a single person who worked there when I started - with the exclusion of the three partners who own the company - still worked there.
     

    I'm sure you're not that hard to work alongside.

    I've begun bathing, since my new salary affords me the luxury of my own personal shower.



  • @joe.edwards said:

    I've begun bathing, since my new salary affords me the luxury of my own personal shower.
     

    Damn, going up in the world. I'm still racing the neighbours to the stream with soap bars in the morning. At least I can boast of having running water.


  • Discourse touched me in a no-no place

    @morbiuswilters said:

    @joe.edwards said:
    @morbiuswilters said:
    If we're going to play that game, you could have just jumped to the chase and strip the Apache source of comments and newlines.

    I've mentioned this before, but at my former company we were contractually obligated to provide our client with full source code to our app, before they'd paid. My then-boss had a strong suspicion they were planning to take the code and run, so he tasked me with providing the source code to the client, in the most unusable form possible. So we gave them hard copy printouts of the source code (several thousand files) with all comments removed.

    As funny as that is, I wonder how a court would see it.

    During the SCO lawsuits, IBM did exactly that. Then again, consider the other party was SCO.

    Having said that, if doing so seemed to meet the letter of the contract (oops, next time specify "on magnetic media" or "in machine-readable form," and joe's company had better lawyers, it would probably work.


  • Discourse touched me in a no-no place

    @joe.edwards said:

    I personally was given a 30 page proposal to look over, and I discovered the last two pages were actually an emailed agenda matter-of-factly discussing which of 3 Indian developer candidates were going to replace me (spoiler: they decided to replace my boss instead of me). Then, when they did fire my boss, they did so by accidentally handing him his severance check while distributing paychecks. He was blind-sided.

    I'm assuming you didn't like your boss, or you would have told him.

    I actually interviewed at a place, and spent a day or two there, where I was intended to be an existing guy's replacement. It didn't work out, and when I left, I called him to let him know they were planning on getting rid of him. (He may have had an inkling of it, because he asked me for my recruiter's contact information.)


  • Considered Harmful

    @FrostCat said:

    "on magnetic media"

    *hands over magnetized microfiche*

    @FrostCat said:
    "in machine-readable form"

    I'd like to see you read it without a machine!



  • @FrostCat said:

    Having said that, if doing so seemed to meet the letter of the contract (oops, next time specify "on magnetic media" or "in machine-readable form," and joe's company had better lawyers, it would probably work.

    Maybe. Tech people seem to assume the law is a lot more literal than it really is. In common law jurisdictions, the court has a lot of leeway in interpreting contracts and statutes, and will look at things like the intent of the contract and will consider things like whether actions were undertaken in good faith. For example, if you are obligated to pay a bill of $10,000, courts will usually frown on you trying to do it with pennies, because it's clearly in bad faith. And if you try some argument like "Well, the contract didn't specify that it had to be in a reasonable denominations!" then you're going to have a fun time explaining to the judge why you thought it was acceptable to waste his time and the time of your opponent with this nonsense.

    Stripping comments from source would arguably be intentionally damaging the property and depriving the contractee of what they paid for. Delivering it on printed paper would be a pretty clear sign of bad faith (especially considering it involved extra expense and effort on the part of the contractor, all to send a "fuck you" to the contractee) that I'm not sure many courts would stand for.

    As for the SCO thing, I'm just spitballin' here because I don't know the specifics, but maybe IBM filed all of the source on paper with the court? In other words, they provided it as an exhibit for the trial and that's why it was printed out? If they were obligated to turn over some source to SCO and they did it entirely in dead tree form, I think the court would have a problem with that.



  • @Cassidy said:

    Damn, going up in the world. I'm still racing the neighbours to the stream with soap bars in the morning. At least I can boast of having running water.
     

    You fight for the right to go upstream.


Log in to reply