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.

Calling 935 975 949 dollars

Hey Apple! I tried to call 935 975 949 dollars to ask them if they wanted to come and stay with me, but instead, this grumpy old guy answered. I have to turn my iPhone in for service, right? I marked the dollars in my Safari and it said I could call them using my iPhone… I want my dollars! You said I could call them! That was a lie!

Header image (pallets of bills, possibly millions, even billions): By Creator:Michael Marcovici – Own work, CC BY 3.0, https://commons.wikimedia.org/w/index.php?curid=12173330

Facebook Conversations

There are those people on Facebook with whom you have conversations that seem to go along this line:

A: Since most bananas are yellow and bent…

B: They are red.

A: No bananas are mostly yellow and bent… some are green… and they can turn dark brown and can be almost straight… but most are yellow and bent…

B: Apples are red.

A: I’m discussing bananas. And they are mostly yellow and bent.

B: No they are not. They are apples and they are red.

A: …

Pointless Arithmetic or Incompetent Communicator?

@SuppressWarnings("PointlessArithmeticExpression")

You don’t say? Well, let me counter that with an…

@SuppressFeature("IncompetentCommunicatorErrors")

Let me explain. I’m creating a unit test where I need to do some calculations in order to create an expected value (i.e. do the same computation as the function I’m testing but differently… or usually more manually…)

So this is my test (high lighted was marked as “pointless”):

final MinMaxAverage mma = new MinMaxAverage();
		
mma.add(1d, 1d);
mma.add(2d, 2d);
mma.add(4d, 4d);
		
final double min = mma.min();
final double max = mma.max();
final double sum = mma.sum();
final double average = mma.average();
final int count = mma.count();
		
assertEquals(1d, min);
assertEquals(4d, max);
assertEquals(1d*1d + 2d*2d + 4d*4d, sum);
assertEquals((1d*1d + 2d*2d + 4d*4d) / (1d + 2d + 4d), average);
assertEquals(3, count);

Sure, this test could have used another weight, but I wanted to test with a weight of 1. And regardless… is this pointless arithmetic in a test? Or for that matter in a complex program that might actually benefit from more simple code?

Programming isn’t just coding and numbers… it’s also communicating with other programmers and yourself in a year. Some IDE simplifications aren’t necessarily simplifications at all. Sure, you can make the code look lean and nice, but you probably should think twice about that if it’s a fringe case, something you use very seldom, or in this case the attempt to make the inner workings of a function in a test more transparent.

Ah well, regardless… I fear I’m expecting the IDE to understand my thoughts and feelings… I guess our relationship is in choppy waters then? 😀

Giraffes don’t have fins

Why mankind is going to hell via internet:

A: This is a picture of a fish, it clearly have fins!
B: Giraffes don’t have fins!
A: It’s a picture of a fish!
B: What’s fishes got to do with anything?
A: They have fins.
B: Giraffes don’t.
A: We’re talking about fish.
B: Giraffes don’t have fins!
A: Right Giraffes don’t have fins.
B: See, I’m right…
A: Yes with regards to giraffes…
B: …fishes don’t have fins.
A: I give up.
B: I’m so cool! I’m so right! I’m so hot! I’m so bright! I’m so yeah oh yeah!