mina86.com

Bose QuietComfort 15 vs. JH Audio 13

Get back to “Jump to”

A few years back I bought Bose QuietComfort 15 headphones. It was around the time I discovered just how noisy things can get at the altitude of around 10 km. QC15s turned out to be a life saver making an unbearable flights slightly more bearable.

A few months ago I decided to risk substantial amount of money and got custom-made JH Audio in-ear monitors (or IEMs), model JH13 Pro — the risk was especially big since, for obvious reasons, they couldn't be resold. Was it worth it?

Map-reduce explained

Get back to “Jump to”

Outside of functional programming context, map-reduce refers to a technique for processing data. Thanks to properties of map and reduce operations, computations which can be expressed using them can be highly parallelised, which allows for faster processing of high volumes of data.

If you've ever wondered how tools such as Apache Hadoop work, you're at the right page. In this article I'll explain what map and reduce are and later also introduce a shuffle phase.

Progress in Games

Get back to “Jump to”

“…and this pun with savegames in GTA.” my friend said laughing.

“What pun? What savegames?” I asked with a blank stare.

“You know, ‘Jesus saves’.” he explained looking at me like I'm crazy.

“Wait, you could save game in GTA?” I raised my brow in disbelief.

That's how I found out about savegames in GTA. This was years after I finished the game, twice, completing each city in one go. But as fun as GTA was, it wasn't the game I spent most time playing. That title goes to Doom 2. To this day, I put it at the top of all FPS games ever.

Why do I mention those old, long forgotten titles? Let's fast forward a little.

Apocalypse

I don't usually buy games on a tangible medium. Doom 3, however, is one of the few that sits on my shelve. When I played it though, I had this uneasy feeling… Something wasn't right. Almost as if I didn't get what I had hoped for. The game was dark, and slow. Encounters with monsters jumping out from the darkness, were separated by journeys through dark corridors. Dim lights showed you the way in the darkness as you slowly progressed in each level, but did not reveal the danger, as that was hidden in dark corners.

I'm not a great writer, so that's probably why I overused “dark” in the above paragraph. To my defence, so did id Software. In some respects, Doom 3 felt like a technical demo of their shiny rendering engine. The team went overboard with all the new features, and instead of creating a successor of a game I love so much, they've created a poor attempt at duplicating System Shock 2 (a game which even with its “outdated” graphics is much more enjoyable and immersive then Doom 3)… or something… I don't know what exactly to be honest.

Fortunately, there's also Classic Doom 3. A mod created by Flaming Sheep Software. It is a remake of shareware levels of the original Doom, and it is wonderful. It's fast paced, with energetic music, no unneeded interruptions, no cut-scenes, and as far as I'm concerned, that's the game I wanted id Software to make. It's a pity they didn't.

The Internship

Get back to “Jump to”

Due to my current position, I've been asked by several friends about The Internship. Having very low expectations about that title, I'd actually been avoiding it, and thus were unable to comment. I have a very special place for watching films that I don't expect to be good though — a plane. So here I am, flying to Pittsburgh, and those are some of my thoughts.

Most importantly, apart from being filmed at Google Mountain View campus and with some of the Google employees starring in it, the film has very little to do with Google. This should not be a surprise though. In particular, it does not show how Google internships work. I should know, I host an intern. In no particular order:

  • It's perfectly fine to go for a beer with your boss. I do it all the time. In fact, a customary way of saying goodbye to an intern is going out with the team.
  • It's perfectly fine to date a fellow Googler or be married to one for that matter. The usual caveats apply, like you shouldn't date your manager or report. If in doubt, ask HR and they'll figure something out.
  • Yes, food in cafeterias and µkitchens is free. Working at Google you may in fact get so used to it, that you'll end up taking a “free” fruit in Starbucks.
  • You actually can take food home but be reasonable about it. Some offices offers plastic containers during dinner so one can take a hot meal home. Moreover, no one will mind if you take a snack every now and then. Mountain View campus also serves lunch on weekends.
  • Googlers are not such introverts so as to being unable to talk.
  • I may be stating the obvious, but there's no “winner team” and each intern is evaluated individually. It wouldn't make sense any other way. In fact, interns are not teamed up together nor given tasks to work on their own (i.e. without Googler's help).
  • This again may be obvious, but for the sake of completeness, interns never work on such broad variety of subjects. Writing an app, tech support and finding clients? No one would be able to all of do that. Interns are given a specific task in a scope of the team they are in.
  • You don't take a full big GBus to take a few people to a restaurant. But yes, something like GBus does exists, and it's a shuttle service taking Googlers to and from offices in Bay Area. And they are awesome — convenient and even have WiFi.
  • Yes, the terms Noogler and Googly, as well as, Noogler's hats and TGIFs are all real. Even though the last one does not take place on Fridays in all offices. There are also other terms. The two I can recall from the top of my head are: Zoogler — Googler working at the Zürich office — and Spoogler — spouse of a Googler.

Other then that, the film wasn't really funny, but the story had a few highlights, like that fact that you won't get a job at Google if you are a jerk.

A.I.

Get back to “Jump to”

While cleaning Tiny Applications Collection a little I've dropped both artificial intelligence scripts. However, not wanting to let them disappear, I've decided to post them here for posterity.

The first one is an eight line of code version that might just be what Sid wrote as his first program ever:

#!/usr/bin/perl -wWtT
while (<>) {
	if (/[aeiouyAEIOUY][^a-zA-Z]*$/) {
		print("Yes.\n");
	} elsif (!/^\s*$/) {
		print("No.\n");
	}
}

The second one is an improved six-line version akin to Pitr's code:

#!/usr/bin/perl -wWtTn
if (/[aeiouyAEIOUY][^a-zA-Z]*$/) {
	print("No!\n");
} elsif (!/^\s*$/) {
	print("Yes.\n");
}

Standard-agnostic HTML code

Get back to “Jump to”

HTML has gone quite a long way since its inception. This means a lot of new features but also some small incompatibilities which may pose issues in certain situations. For instance, when posting a code snippet for others to include on their websites, it's best if it works correctly on as many sites as possible which implies being compatible with as many versions of HTML as possible. But how to create a snippet that works both in HTML and XHTML? Here are a few tips:

CSS sprites as background

Get back to “Jump to”

CSS sprites aren't anything new. They have been around for years now, and are one of the methods to optimise website load time. The idea is to incorporate several images into a single bigger one and in this way decrease number of round trips between HTTP server and a browser.

In its traditional use, CSS sprites work as a replacement for images and cannot be used as a background. But background is exactly how I'd implemented quote image left of long quotes and flags indicating language paragraph was written in, e.g.:

A few of the entries on my blog have text both in English and Polish. On those, I use some simple icons to indicate which is which:

Polish flag on the left indicates paragraph is written in Polish.

Union Jack on the left indicates paragraph is written in English.

After a bit of playing around I finally figured out how to get this working, and even though there are some caveats, sprites can be used as a top-left no-repeat background image as well.

The fifth generation

Get back to “Jump to”

This day must have come sooner or later. Even more so since I love squeezing every byte out of the data being sent over the network, which is why source of this website is so unreadable (don't worry though, readable sources are available in a git repository).

So yeah, I've switched this website to HTML5 with some of it's new elements and optional tags removed. After years of using XHTML 1.1 it feels a bit weird not closing tags, but I guess a few saved bytes are worth it, aren't they? ;)

I've even got my electric slash working in Emacs's html-mode (ie. if I press slash after < sign, inner most element is closed automatically).

Unfortunately, not all is so shiny. For some reason, automatic pagination on entries list page and “load content” link stopped working under Opera. The way those work is by making an XMLHttpRequest and injecting portion of the fetched document in appropriate place. For some reason, Opera ends up with a DOMException: INVALID_STATE_ERR.

SSL and dropping “www.” with mod_rewrite

Get back to “Jump to”

Surprisingly I couldn't find on the Internet any HTTPS-aware example how to drop the www. prefix from web hosts in Apache, so I had to come up with one myself. Firstly, the following lines need to find their way to the end of Apache configuration file (/etc/httpd/conf/httpd.conf or something):

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ http://%1$1 [L,R=301]

Secondly, analogous lines need to be added inside of the <VirtualHost _default_:443> directive of mod_ssl configuration file (/etc/httpd/conf.d/ssl.conf or similar), like so:

<VirtualHost _default_:443>
	# … various directives …

	# Here's what needs to be added:
	RewriteEngine on
	RewriteCond %{HTTP_HOST} ^www\.(.*)$
	RewriteRule ^(.*)$ https://%1$1 [L,R=301]
</VirtualHost>

Now, after a restart, Apache will drop the www. prefix for both secure and insecure connections.

End of the page, get back to “Jump to”.

Google+