News for hackers. Stuff that matters.
Re:Ask HN: Anyone know any funny programming jokes? by lb1lf on Thursday January 21, 2021 @04:37AM (#25857120)
A Soviet engineer needs some plumbing done in his apartment, and calls for a plumber. The plumber arrives, does his thing, and hands over the bill.

The engineer is shocked. -'What, this is like a quarter of what I make in a month - for half an hour's work???'

Plumber shrugs. -'Well, why don't you come join us? Easy work, well paid, no responsibility - just remember to keep mum about your degree, as we're not supposed to hire academics.'

Our engineer contemplates this for a while, applies for a job as a plumber - and gets it.

All is well, good money, no responsibilites - until management requires that they take evening school classes to gain new skills and thus better build socialism. So, grudgingly, our engineer enrolls in a math class and, upon arriving, finds that the teacher wants to establish what the plumbers already know.

-'You over there - could you please come to the blackboard and show us the formula for the area of a circle?' he asks our engineer.

Standing at the blackboard, he suddenly realizes he can't for the life of him remember the formula; while a bit rusty, he soon figures out how to reason it out - furiously writing out integrals on the blackboard, only to find the area of a circle is -(pi)*r^2.

Minus? How did a negative enter into it, he thinks, going over his calculations once again. No, still gets the same result. Sweat building, he turns away from the blackboard for a moment, turning to the other plumbers watching.

As in one voice, they all whisper -'Comrade, you must switch the limits to the integral!'

Re:Ask HN: Anyone know any funny programming jokes? by benibela on Thursday January 21, 2021 @05:24PM (#25865304)
American version from below:

The "you learn limits in like, 9th grade" comment reminds me of this one:

Two mathematicians are in a bar. The first one says to the second that the average person knows very little about basic mathematics. The second one disagrees, and claims that most people can cope with a reasonable amount of math. The first mathematician goes off to the washroom, and in his absence the second calls over the waitress. He tells her that in a few minutes, after his friend has returned, he will call her over and ask her a question. All she has to do is answer one third x cubed.

She repeats "one thir -- dex cue"?

He repeats "one third x cubed".

She says, "one thir dex cuebd"?

Yes, that's right, he says. So she agrees, and goes off mumbling to herself, "one thir dex cuebd...".

The first guy returns and the second proposes a bet to prove his point, that most people do know something about basic math. He says he will ask the blonde waitress an integral, and the first laughingly agrees. The second man calls over the waitress and asks "what is the integral of x squared?".

The waitress says "one third x cubed" and while walking away, turns back and says over her shoulder "plus a constant!"

Re:Ask HN: Anyone know any funny programming jokes? by chrisbennet on Thursday January 21, 2021 @07:00PM (#25866442)
I've heard a variation of that were the professor is at a bar with a couple of visiting professors. He tells them, in this town pretty much everyone is smart and he proves it by asking the waitress. (The rest of the joke is the same.)
Re:Ask HN: Anyone know any funny programming jokes? by smlckz on Thursday January 21, 2021 @05:08AM (#25857310)
I think the integral is

        4 * integrate sqrt(r^2 - x^2) w.r.t. x from x=0 to x=r
which is from the equation of circle with radius r centered at the origin:

        x^2 + y^2 = r^2
        => y = sqrt(r^2 - x^2)
any other way achieve the same using integration?
Re:Ask HN: Anyone know any funny programming jokes? by ChrisLomont on Friday January 22, 2021 @08:43AM (#25871562)
You can arrive at the same by slicing in nearly any manner you wish: vertical dx strips, horizontal dy strips, radial dtheta strips, concentric rings treated as rectangles, diagonal strips, literally anything you wish.

If you've never set up and worked a few, try the dx version and the dy version, then maybe fiddle with a few others. They all work.

The concentric rings one is trivial to work out. Integrate over r from 0 to R. Each ring at radius r has thickness dr, and has length 2 pi r, treated simply as a rectangle, which is "close enough" since each is arbitrarily thin. Then the integral is

int_0^R 2 pi r dr = 2pi r^2/2 from 0 to R = pi R^2.

A really pretty one cuts the circle into wedges, then rearranges them by alternating direction to make a "rectangle" approx r high, approx pi * r wide, with bumpy top and bottom. In the limit this has area pi * r * r, and can be shown to kids without needing calculus.

And it's not magic or circular, since pi is defined (in this case...) as the ratio of circumference to diameter.

Re:Ask HN: Anyone know any funny programming jokes? by sriku on Thursday January 21, 2021 @05:34AM (#25857486)
\int_0^2π{(1/2)r^2dθ}

Value inside the integral is area of thin triangle of height r and base rdθ.

Re:Ask HN: Anyone know any funny programming jokes? by stevage on Thursday January 21, 2021 @04:55AM (#25857219)
I don't quite get the punchline. I understand how if you integrate in the wrong direction you get a negative area, but is there a double meaning here?
Re:Ask HN: Anyone know any funny programming jokes? by shard on Thursday January 21, 2021 @05:00AM (#25857250)
I believe the implication is that all the plumbers are advanced degree holders, not just the engineer.
Re:Ask HN: Anyone know any funny programming jokes? by lb1lf on Thursday January 21, 2021 @05:05AM (#25857291)
-The idea is that all the plumbers are academics looking for the easy life. :)
Re:Ask HN: Anyone know any funny programming jokes? by stavros on Thursday January 21, 2021 @07:06AM (#25858040)
The limits are the shackles of oppression, the integral is the proletariat and switching is disavowing capitalism and seizing the means of production.
Re:Ask HN: Anyone know any funny programming jokes? by mst on Thursday January 21, 2021 @08:05AM (#25858402)
That was completely unhelpful but also hilarious.

As such, a perfect russian joke.

Re:Ask HN: Anyone know any funny programming jokes? by StavrosK on Thursday January 21, 2021 @08:24AM (#25858536)
Thank you, that's what I was going for!
Re:Ask HN: Anyone know any funny programming jokes? by gmfawcett on Thursday January 21, 2021 @09:07AM (#25858907)
I shall never look at calculus the same way again. :) Thank you, comrade!
Re:Ask HN: Anyone know any funny programming jokes? by zoom6628 on Thursday January 21, 2021 @08:25AM (#25858546)
Brilliant !
Re:Ask HN: Anyone know any funny programming jokes? by nvader on Thursday January 21, 2021 @06:46PM (#25866309)
Too many levels of indirection.
Re:Ask HN: Anyone know any funny programming jokes? by nvader on Thursday January 21, 2021 @06:55PM (#25866403)
Re:Ask HN: Anyone know any funny programming jokes? by ayepif on Thursday January 21, 2021 @05:05AM (#25857293)
They're all former academics/mathematicians!
Re:Ask HN: Anyone know any funny programming jokes? by infomax on Thursday January 21, 2021 @05:11AM (#25857335)
They are all engineers in disguise.
Re:Ask HN: Anyone know any funny programming jokes? by baud147258 on Thursday January 21, 2021 @01:13PM (#25862050)
I think I had already heard that one from a math teacher
Re:Ask HN: Anyone know any funny programming jokes? by the_gipsy on Thursday January 21, 2021 @06:17AM (#25857735)
Caught me off-guard :D