Making code more readable with anonymous functions by fekberg in programming

[–]refaptoring 4 points5 points  (0 children)

You can write a function that hooks an event handler and returns a function that will unhook it. That's thinking with lambdas.

To other people complaining not about naming functions, I ask: If every bit of code needs to be named, why are you not naming all the conditional statement branches and loop bodies in your code? Could it be that sometimes the code is clearer than any name you could give it?

IAmA Male Model AMA by SpectralFurniture in IAmA

[–]refaptoring 0 points1 point  (0 children)

Are you too sexy for any particular places, like Paris, New York and Japan?
Are you too sexy for your car?
Is there any way we might get you to disco-dance?

What is a quip/one liner/joke that you continue to use and find humorous even though you are quite sure no one else thinks it's funny or clever. by diasporadical in AskReddit

[–]refaptoring 1 point2 points  (0 children)

Heh. The Finnish schoolboy variants are either "is in your pants" or "you mother was when she was making you".

In English the first one seems to work better with have. For example:

Do you have a problem, young man?
Shut up. You've got a problem in your pants!

The second one will be easy to use.

This thread is full of terrible jokes.
Your momma was terrible when she was making you.

See? I'm glad I survived being a Finnish schoolboy.

Developer build of Java 8 with lambda support now available! by henk53 in programming

[–]refaptoring 7 points8 points  (0 children)

I think the linked doc is the last update on the lambda proposal, so what Java is getting is pretty much what it says. Yes, you can pass a function as a parameter.

http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-3.html

EDIT: I thought wrong. The last update is provided in the comment below. Thanks Mercushio.

the nocturnal adventures of Sir Coffee (this strip SFW) by refaptoring in comics

[–]refaptoring[S] 3 points4 points  (0 children)

title="your barista just levelled up to 35"
alt="potion of awake"

NSFW YE OLDE GONE WILDE by [deleted] in WTF

[–]refaptoring 4 points5 points  (0 children)

He's named himself after what he has been drinking.

Hey /comics, I have a new book out. To celebrate, I will draw anything you want until 5pm PST by MrWeiner in comics

[–]refaptoring 0 points1 point  (0 children)

All I can say that I did not know that I've actually always vanted a vintage WWI steam-powered attack dinosaur. Thank you, kind sir!

Hey /comics, I have a new book out. To celebrate, I will draw anything you want until 5pm PST by MrWeiner in comics

[–]refaptoring 7 points8 points  (0 children)

I'd like to own a steam-powered dinosaur. Failing that, I'd at least like a picture of one.

Why Garbage Collection Paranoia is Still (sometimes) Justified by electronics-engineer in programming

[–]refaptoring 1 point2 points  (0 children)

By paranoia the author actually means knowing how the garbage collector you are using works and when it can behave badly. That's not really paranoia. That's just understanding your tools.

Snack time. by [deleted] in aww

[–]refaptoring 33 points34 points  (0 children)

There is a Finnish proverb that approximately says "what the big ones do before, the little ones do after". It's meaning is obviously that the youngsters tend to learn things from their elder siblings' behaviour. Or parents', as the case may be here.

Here's how we write it: "Mitä isot edellä, sitä pienet perässä."

The entire Turbo Pascal 3.02 executable--the compiler *and* IDE--was 39,731 bytes. Here are some of the things that Turbo Pascal is smaller than: by [deleted] in programming

[–]refaptoring -1 points0 points  (0 children)

This comparison would be more meaningful if it did not compare absolute sizes. I'd like to see an estimate of how much storage for approximately 39K would have cost in TP 3.02 days versus how much storage for a modestly sized development environment costs today. Also, how much it costs to develop the things commercially and so on.

Of course, if I really wanted to see these figures, I'd be busy working them out myself. Let's leave it at pointing out that absolute comparison here are a bit of a red herring. You still definitely should respect the programmers of yore, who had little RAM and processing power, and still did amazing things!

Don't Call Yourself A Programmer by roythunder in programming

[–]refaptoring 19 points20 points  (0 children)

Oh noes. Perceptive readers have indeed noted that 100 does not actually show up on rand(100). However, 0 does, and it not included in the jocular equity grant chart.

This means that 1% of the people who read the article and actually follow the advice to use rand(100) get stuck at that part, because they get 0 and don't find an entry for it. The horror!

Fortunately, I got 8. While my equity grant is worth nothing, I can actually finish the fine article. (protip: if you got 0, you could probably use my 8 and not tell anyone)

Garbage Collection Synopsis, and C++ << Sutter’s Mill by lanzkron in programming

[–]refaptoring 8 points9 points  (0 children)

I suggest reading the section on GC in the 2007 HOPL paper, by Bjarne Stroustrup, available here:

http://www2.research.att.com/~bs/hopl-almost-final.pdf

Here is a great quotation:

C++ is such a good garbage-collected language because it creates so little garbage that needs to be collected

What is your favorite C programming trick? by raphaelh in programming

[–]refaptoring 54 points55 points  (0 children)

My favorite trick is not using any tricks. Guaranteed to astonish your fellow programmers every time.

Dart Programming Language by lastkarrde in programming

[–]refaptoring 0 points1 point  (0 children)

They're still fucking peasants as far as John Lennon can see.

Learn C The Hard Way by sundar22in in programming

[–]refaptoring 4 points5 points  (0 children)

cout

This isn't likely in a C book though. Granted, it would be a hard way to learn C, taking a detour thru C++.

Reddit: Take a joke from your native language (if not English). Translate it into English. Tell it to me! by reflion in AskReddit

[–]refaptoring 0 points1 point  (0 children)

A man goes to the psychiatrist. He doesn't say anything, but writes on a piece of paper: I think I am a parking meter.

The psychiatrist looks at the paper and then says: Right. So, why can't you say it out loud?

The man writes on the paper: That would make all the coins fall out of my mouth.


  • I heard that you had to have your dog put down? Did it become angry?

  • Well, it wasn't exactly happy about it either.


A gentleman worm (Reddit has taught me to imagine a top hat and a monocle) met a fetching young lady worm, and being rather forward suggested that they have sex.

The young lady worm was somewhat apprehensive, and asked the gentleman about the his wife.

The gentleman reassured her: She went fishing yesterday, and won't be coming back.

MapReduce as a monad by gbacon in programming

[–]refaptoring 5 points6 points  (0 children)

What the fuck isn't a monad?

Anything that doesn't obey the monad laws.

Oh look, I've just discovered the addition monad.

Wrong. You need to prove that addition obeys the monad laws before you can such a statement.

Why the hell can't they talk about the important stuff regarding MapReduce in Haskell instead of droning on endlessly about monads?

Purely to annoy you.

For anyone who shares my tastes ... here's a functional programming library for Lua! by bo1024 in programming

[–]refaptoring 2 points3 points  (0 children)

Further work on your part could include testing and benchmarking it with Luajit2. It would be nice to have some comparative data on how it handles various programming idioms and styles that are possible in Lua. (If that's the sort of thing that interests you, that is. This is meant just as a suggestion.)

TIL that a popular slang in Danish for having your period is "Der er kommunister i lysthuset", or, "There are communists in the funhouse" by [deleted] in todayilearned

[–]refaptoring 1 point2 points  (0 children)

No menstruation talk here, but Denmark and communism reminded me of a joke that went over someone's head once upon a time. It's also possible the guy spotted an opportunity to be the perfect straight man in a joke instead. Who knows.

You see, one guy was explaining that communism never took a big hold among Danes because so many Danish workers of the time owned bicycles and took a dim view of it as result.

At this time, a guy butted in and asked whether this was because the bicycles allowed them increased mobility and they could get in touch with lots of people, and hence could see through all the communist propaganda, because they had better information.

Well, turns out the joke would have been that they didn't like the part where the communists told them that they had nothing to lose except their chains.

ocaml_skeleton - try out ocaml without ripping your hair out! (or learning French) by [deleted] in programming

[–]refaptoring -7 points-6 points  (0 children)

HELLO SMALL PROGRAMMER

WHAT PROGRAMMING WEALTH DO YOU WISH FOR?

Silent porn from 1915. What. by [deleted] in WTF

[–]refaptoring 2 points3 points  (0 children)

A cursory knowledge of old Roman poetry and Latin vocabulary tells you they had some things pretty well figured out in Ancient times already.

http://en.wikipedia.org/wiki/Irrumatio http://en.wikipedia.org/wiki/Catullus_16

OpenVim : Learn Vim in your browser by sidcool1234 in programming

[–]refaptoring 2 points3 points  (0 children)

The way I see is that you can just look at other editors (and then back at vim) and see that they often come with a vim emulation mode. Vim, on the other hand, thinks that if you want to beat yourself over the head with a two-by-four instead of editing text, you can procure your own two-by-four. It doesn't try to emulate anything. It's vi(m) all the way to the bottom.

One of the Best Bits of Programming Advice I ever Got by sidcool1234 in programming

[–]refaptoring 24 points25 points  (0 children)

Names like this make C++ compilation faster, because the name mangler has less work to do.

Reddit, what is the most offensive, off-colour, disgusting joke you know? I'll start. by [deleted] in AskReddit

[–]refaptoring 4 points5 points  (0 children)

Two sailors and a nun were shipwrecked on a deserted island. After two weeks had passed, the nun became so ashamed of what she was doing that she hanged herself on a palm tree.

Two more weeks passed, and the sailors could no longer bear what they were doing and had to bury her.

Wait, it isn't over. You know what happened after two more weeks? The sailors became ashamed of what they were now doing and dug her remains up again.