Category Archives: Computers and Internet

Posts on computer science and the web, rants about OS:es, Window Managers, Platforms for almost publishing content on the web, and the like.

Automatic software or app updates not working on your iPhone? Fix it!

“Automatic software and app updates are most likely to start working when your iPhone is plugged in for long periods while remaining connected to Wi-Fi.”

Source: Automatic software or app updates not working on your iPhone? Fix it!

I’m wondering… how does their general personality affect the decision to update or not? Does their mood affect the decision as well? Hmmm…

Or is it just that Apple wishes to be mysterious about their update rules? The people writing about Apple products?

Seems to me, unless they hooked the update decision to a neural network there should be a pretty clear cut rule…

Unless the bastard is bugging out… I mean is having a bad day…

The Digital Direct Democrazy System

The Digital Direct Democrazy System: Welcome to the Digital Direct Democrazy System. We will now ask a number of questions that will be used to determine your political profile.

The user answers the questions.

The Digital Direct Democrazy System: Thank you! We have determined that you are a raving Nazi and will immediately start building the concentration camps…

The User: Hey? Wait! Those were just my personal opinions!

The Digital Direct Democrazy System: Please be patient. This could take a little while…

The User: Hello?! WTF?!

The Digital Direct Democrazy System: Please be patient. This could take a little while…

The User: Whatever…

Java 8 – A Filter By Any Other Name Would Probably Smell Sweeter

I’m thinking the choice of name for the filter function in Java 8 steams was a really poor one.

I mean, what is a filter? Something that keeps things out, or something that catches the things we want?

Yes.

Dictionary.com has several definitions, from “any of various analogous devices, as for removing dust from air or impurities from tobacco smoke, or for eliminating certain kinds of light rays” to “to remove by the action of a filter”.

An air filter, we hope, will keep harmful airborne particles away. We also hope a filter in a sanitation plant will do similar work. (We should all know that the filter on a cigarette is only there for the sales pitch…)

I’m thinking gold-digging would use filters with the opposite purpose, but you pan for gold, don’t usually filter… I guess…

The guy that came up with the name “filter” might be a physicist and using this dictionary.com definition of filter: “Electronics, Physics. a circuit or device that passes certain frequencies and blocks others.”

But thankfully that’s not how the Streams-documentation suggests the filter-function should work…

Or the name was inspired by coffee filters? … no, wait, that’s very wrong!

Regardless…

Using the name “filter” for the function that will decide, like the gold diggers filter (that doesn’t really exist… ok, a physicist’s “circuit or device”… 😐 ) what to keep, seems very unintuitive to me, and I suspect it requires that you learn that in Javaspeak, “filter” means only one of the two possible definitions of filter (of which the “wrong” one seems über quasi… or like you take your coffee the very caffeinated way… with a spoon…)

I suggest adding “include” and “exclude” instead and then one of them (or both) can redirect to filter behind the scenes. (I’m inspired by Rsync…)

I’m thinking it should be quite hard to misunderstand those two. (And very hard to think using “filter” is a better choice)…

Writing programs in programming languages is, just as when you write in any other language, definitely communication with computers, other programmers and yourself in six months when you’ve forgotten what the hell the program code you’re staring at was supposed to do… And poor communication is the root of all evil and the end of all marriages… or so I’ve heard… 😀

I’m certain there are bugs out there right at this moment because of this language choice. (I’ll let you know how many of them are mine as I find them…)

(And by the way, the thing that catches the things you want is called a net, not a filter… maybe filter should be renamed to “net”? Since “catch” already is a keyword… :P)

Java Lambda Humor

I was experimenting with Lambdas in Java on IntelliJ IDEA… they have a sense of humor.

I was wondering how simple a lambda could get so…

final Supplier<Double> supplier = () -> 1d;
double value = supplier.get();

A lambda (supplier) that produces a number (1) from no input. Pretty simple. What will happen to the code if I refactor supplier to make it an inline expression?

double value = ((Supplier<Double>) () -> 1d).get();

Well… that’s kind of in line with casting and such. Not that nice looking… However, now the IDE tells me I can make a simplification… “Replace method call on lambda with lambda body…” let’s try that:

double value = 1d;

Yeah… hmmm… that’s a pretty simple “lambda” indeed… hah!

Forty-Two

7.5 million years ago.

“Let’s build a giant computer that can give the ultimate answer to the meaning of life, the universe, and everything!”

“Let’s do it!”

One year later.

“We’ve built a giant computer that can give the ultimate answer to the meaning of life, the universe, and everything!”

“Let’s test it!”

“Ok. It’s just a beta so let’s start with something simple like ‘seven times six’.”

One minute later.

“…It’s slow.”

“Yeah, let’s get some lunch…”

One hour later.

“It’s really extremely slow, isn’t it?”

“Let’s wait and see…”

One day later.

“Still computing? Is it even working?”

“Yes!”

“OK. Let me know when you have the answer…”

Today.

“The giant computer that was built to give the ultimate answer to the meaning of life, the universe, and everything has produced an answer!”

“Yay! Let’s hear it!”

“It’s … forty-two.”

“What was the question?”

“It doesn’t seem to have been programmed to remember, but I can only assume it was along the line of ‘What is the meaning of Life, the Universe, and Everything.’ Don’t you think?”

“And the answer is ‘forty-two…’ fascinating…”