lauantai 17. marraskuuta 2012

Humble Bundle for Android 4

There's six more days left to get six Android (and PC, and Linux, and Mac) games for whatever price you want to pay! Pay above the average and you'll even get five bonus games!


maanantai 12. marraskuuta 2012

Setting up custom Gmail notification sounds in Android

I recently found out a way to customize the email notification sounds of the Android Gmail app based on the Gmail labels. For example, I have set my Gmail account to apply a label "Geocaching" to those email messages from Geocaching.com that inform me about new geocaches. There's a semi-serious "competition" going on between geocachers on who's the first one to find new caches (FTF, First to Find), so I wanted to distinguish those geocaching emails from other messages that don't require you to urgently rush outside. ;) So, here's how you do it (at least on Android 2.2.2 -- there are instructions for Android 4.1 as images later in this post as well):
  1. Open your Gmail application, then press the menu button of your device, and then find "Settings" from the menu that opens.
  2. You should now see a dull screen with just "General preferences", your email address, and an "Add account" option. Click on your email address.
  3. Click "Sync inboxes and labels", then find the label for which you want to select a special notification tone and click on it, then select "Sync last 4 days".
  4. Now return back by one menu, locate the "Labels to notify" option and click on it.
  5. The label you just selected to sync should appear there, with notifications set "Off". Click on the label.
  6. A new window opens. Check the "Email notifications" checkbox and the option to choose a ringtone becomes available! Now choose a tone that you wish would play when you receive an email that matches the label. You may also untick the "Notify once" checkbox to get a separate notification for every email instead of just the first one since the last time you read your mail. Then click OK and then return to the app or exit it.
  7. The next time you receive email that matches the given label, your phone will emit the sound you just chose. :)
Finally, I managed to take screenshots of the process on my new Nexus 7 tablet, which runs Android 4.1 and thus has a bit (but not too much) different menus:

First, locate the settings of the Gmail app:


Then click on your account (blurred in this picture): 

 Now click Manage labels:

You'll get to this view where your labels are on the left and the settings on the right. Click the label for which you wish to set a custom tone -- here I've just picked "Starred". Set Sync messages to "Last 30 days", then make sure Email notifications is checked. You'll probably want to uncheck "Notify once":


Now click Ringtone and you can select the notification tone for these kind of email messages:

Voilà!

maanantai 3. syyskuuta 2012

Geocaching

In the right hand side bar of my blog there has always been a little image telling the number of geocaches I have found. Also, in the very first post of this blog I mentioned that you might see an occasional post about geocaching, but that hasn't really been true -- until now.

A particularly clever cache, drilled into a tree stump and openable with a key. (The code that identifies the cache has been blurred.)
I think geocaching is a pretty well known hobby already, but still not all people have heard about it yet. It's basically a modern game of treasure hunt: someone hides a container, a geocache, somewhere and posts the coordinates on the Internet, and then other people go and find it. You usually use a GPS device to find the cache, but often just a map is enough. Most if not all smartphones already have a GPS receiver built-in, so basically you probably don't even need to buy any new equipment to start the hobby. I've been caching just fine with my phones for some three years now. :)

Okay, so what's a geocache like, you may ask? Well. Probably the only common denominator with all caches is that they all contain a log book. It's either a real book or a dedicated piece of paper where you sign your nickname. Afterwards you go online to geocaching.com and log your find to the cache's own page as well.

OK, but what's a geocache really like, then? One of the most common appearances is a plastic box of a couple of deciliters. Film canisters are also popular. The tiniest caches I have found are nano-caches that measure less than 2 by 2 by 2 cm, such as this one, and the largest has been a plastic container of about 40 liters. Needless to say, the first one can be hidden in the busiest place of a city center, whereas the latter definitely needs a remote place in the woods.
One of the weird things I've seen while caching: a tree had grown up right through a fence.

Right, so where are these geocaches hidden? I already touched this subject in my previous sentence, and the answer is that they can be hidden basically anywhere: in the cities or in the woods, in parks, mountains, bus stops, train stations, light poles, stone walls. In cities you can often find micro-caches under, behind and inside various pipes, bars and railings. They may be under staircases or in a bush. They may be hanging from trees or they may be hidden in the roots of a tree, behind some stones.

OK, but what's so interesting about finding a plastic box from the woods? Well, usually the cache page contains a description of the place: why does the cache owner want to show you the place? There are, of course, those boring boxes with no purpose as well, but you don't need to get those. :) Geocaching is a great way to get to know a new city, for example. Geocaching takes you outside the normal tourist areas and attractions and shows you less-known and quaint places. For example here in Helsinki, Finland there are many World War I era fortifications in the forests and many caches have been placed in them. In London there was a cache in front of two houses – which are actually fake, designed to hide a railroad. Normally you'd just pass this kind of a place without noticing anything, but with geocaching you become familiar with the local history.

Traditional cache
Besides the location, the cache itself might be interesting and worth seeing in its own. Some cache owners put a lot of time and effort to construct contraptions where you have to, for example, open some lid with a key or winch a container down from a tree. I have seen a cache camouflaged as a beehive, and some of the funniest caches are the ones that are hidden in plain sight, disguised as electric boxes or some such ordinary objects that just belong to the landscape.

Multi-cache
Besides the traditional caches where someone just posts the coordinates on the Internet and you go find it, there are other kinds of caches as well. The most popular other types are multi-caches and unknown caches, also known as puzzle or mystery caches. Multi-caches contain one or more intermediate points before the final location where the cache with the log book is. In the intermediate locations you might find cache boxes with coordinates, or you might have to calculate, say, the number of windows in a building and apply that number to a formula given in the cache description to get the next coordinates. Multi-caches may be of any length: 20 meters, 2 kilometers or 200 kilometers. The basic rule with all caches, though, is that there must be at least 161 meters, or 0.1 miles, between them.

Mystery cache
Finally, mystery caches can be pretty much like anything. There might be a simple jigsaw puzzle that you must build in order to see the coordinates in the picture that forms, or the puzzle might require deep knowledge of some sports league, programming language or historical event or person.

A screenshot from Geocaching.com, showing you the strategic information of the Oslo Concert Hall cache: D/T 2/1.5, small.
Oh, and how do you know which caches would be easy and which ones would be difficult? All the caches have two ratings assigned to them by the author: the difficulty rating (D) and the terrain rating (T). You seldom see traditional caches with difficulty values over D3 or D3.5, and those are often used by cleverly camouflaged caches or caches in places with many possible hiding places. A cache with a difficulty rating of D1 should be quite trivial to find, whereas a mystery cache with a difficulty rating of D5 might stay unsolved for weeks or months. Difficulty ratings are, however, quite subjective. In the end terrain ratings are also subjective, but I think they are less subjective than difficulty ratings anyway. A T1 cache can usually be retrieved even from a wheelchair, whereas a T5 cache basically requires you to have some special equipment, such as climbing gear, or you will risk serious injury or even death. Of course one of the fun parts of the hobby is that there's something for everyone and you can only go find those caches that suit your tastes and skills. :)

So, what are you waiting for? Go check out the map of geocaches in your area, register to the site, get the coordinates and go out with your smartphone. :)

torstai 23. elokuuta 2012

Enabling Windows 7 hibernation mode

The hibernation setting in the shut down menu
It always seems to be a bit of a pain for me to figure out how to enable the hibernation mode in Windows 7 desktops. Hibernation is a mode where the current computer status is saved to the hard disk and the computer is then basically turned off. Waking up from hibernation takes far less time than waking up when the computer has been shut down completely, so I use hibernation almost exclusively. There's a TLDR tutorial on how to enable it (if it's not already available in the shut down menu), but I'll just write the short steps here:
  1. In Start Menu, type powercfg.cpl and hit enter
  2. With your selected power plan, click "Change plan settings" and then "Change advanced power plan settings"
  3. Set SleepAllow hybrid sleepOff
  4. Close the prompts you opened by clicking OK and Save changes
  5. From the Start Menu, find All Programs → AccessoriesCommand Prompt and right-click it, then select "Run as administrator"
  6. Now type powercfg -h on and hit enter. The hibernate option should now be available!

lauantai 16. kesäkuuta 2012

Frozen Synapse

Frozen Synapse is a cool game where you control a squad of soldiers by giving them orders and then watching them execute the orders for five seconds at a time. Your opponent does the same, and if you anticipated their moves correctly, you should see your soldiers take down theirs. The orders are given as waypoints and they can be arbitrarily complex, such as "back away from the door keeping your sights towards it, then wait for 0.2 seconds before turning and running across the hallway ignoring any possible enemies in there, and then duck behind the cover while taking a particular enemy to your sights". You can finish a turn in five minutes or you can grind it for an hour.

The game has several different modes and a "Dark" and "Light" variant of each. In the Light versions you always see where the enemies are, whereas in the Dark versions you only see the enemies that are currently in the field of vision of your troops. Once you lose a sight to an enemy in a Dark game a "shadow" of the enemy stays at their last known location along with an info text like "Last seen 2.8 seconds ago".

A maneuver assigned to a machine gunner.
The most popular modes are probably Extermination and Disputed. In Extermination both teams try to exterminate the other, plain and simple. In Disputed, the teams also try to kill each other again, but they also try to hold as much ground as possible in order to extract boxes that appear on the map after the fourth turn. Then there's also a Hostage mode where the other player plays as a hostage taker and the other tries to free the hostages. The hostages need to get to the edges of the playing area and they are controlled by the rescuer, but they can only be given instructions once. The hostage taker then tries to prevent the hostages from getting away.

In all game modes you can simulate the end result of a turn in the planning phase. This means that you can also assign commands to the enemy troops and move them around when you try to anticipate what the enemy will actually do. Simulating is crucial. The game is deterministic, so if in your simulation a soldier gets shot, he will get shot the same way in the actual outcome -- provided that everything stayed the same compared to the simulation. A slightly differently placed unit may yield a completely different result.

Let's watch a game of Dark Disputed I just finished. (Unfortunately the replay doesn't show the actual fields of vision for the troops.) The replay doesn't include the planning phases, just the action, so it lasts only 30 seconds. Remember that there was a planning phase every five seconds. I was controlling the green team and my enemy was controlling the red team. I recommend opening the video in a separate window and watching it with the HD quality:

Initially, both players can see the starting positions of each other's troops. I determine that no contact is likely during the first turn and just make my troops spread around and advance. At the end of the first turn, at 00:05, the enemy sniper at the left sees my machine gunner at the bottom and vice versa. The turn ends there and a subsequent simulation reveals that my gunner has no chance against the enemy sniper, so I order him to proceed, ignoring the sniper. On the other hand I turn the guy with the shotgun around, as sniper rifles have a way longer range than shotguns and at this point it doesn't look like it's going to be a close combat situation.

At 00:06 my sniper at the right gets an enemy gunner to his sights and takes him down a couple of seconds later; that's the first casualty of the game. The turn ends a second later when my gunner and an enemy gunner have just opened fire at each other. The simulation reveals that the bullet that's on its way already is going to kill the enemy, so he cannot dodge it and gets shot right at the beginning of turn three. During turn two my other gunner also ran up across the enemy sniper's line of fire because the simulation revealed that the enemy wouldn't have the time to take the shot. From his new position my gunner also opens fire against an enemy gunner trying to run down across the map at 00:10.

Again when I simulate the situation in the planning phase it appears that the enemy running down may be able to escape from my gunner who just opened a fire against him, so I turn the gunner in the middle to face the doorway in case the enemy would try to flank him. Luckily he takes the enemy down himself at 00:14, so there are only two enemies left now. My gunner at the bottom was ready to greet the enemy had he ran downwards instead of just stupidly staying put in the middle.

At the start of turn three my soldiers had caught a glimpse of an enemy gunner going into the room at the upper left corner. Since shotguns are very powerful at close range I decide to have my shotgunner clean the room and make an elaborate plan on how he would enter the room from the top door. I test my plan with the enemy soldier in every corner of the room until my shotgunner comes across as a winner in every scenario. The machine gunner and the sniper are his backup, and indeed the machine gunner engages in a firefight with the enemy right before the shotgunner enters the room and kills him at 00:19.

At 00:20 the fourth turn ends and the red boxes appear. My sniper is on the other side of the playing area and I decide that the three machine gunners are enough to take the final enemy sniper down, so the sniper goes to collect a couple of boxes. The shotgunner stays at the room he just cleaned and guards the windows in case the enemy sniper would run past them. Finally, it's the machine gunner that's ducked in the bottom room who kills the enemy at 00:23. The replay then plays for one more turn that I didn't actually play and you see my sniper exiting the area with the two boxes he had collected.

So, this hopefully gives you a fairly good picture of the game. Besides the multiplayer mode there's also a single player campaign and a possibility to play quick skirmish matches against the AI, but multiplayer is clearly the most interesting part of this game. The game is cross-platform so Windows, Linux & Mac versions exist. The game can also be bought from Steam, and there's an unofficial Frozen Synapse Wiki for you to use as a reference. Finally, it takes a little patience to really get into the game, but if you intend to play it you should probably also read this blog entry called How Not to Be Shot in Frozen Synapse. :)

torstai 17. toukokuuta 2012

Windows PowerShell

The Windows PowerShell
One advantage that Linux (and other Unix-like systems) has always had over Windows is the powerful command line interface. Linux systems provide the user with dozens of little programs that can be combined, or piped, together to do more complex things. For example, the ls ("list") command lists the files in the current directory. The wc ("word count") command counts the number of lines, words and/or bytes in the given input. Pipe these together, and you can get the number of files in the current directory: "ls | wc -l".

With the Windows Command Prompt these kind of operations have traditionally been way more difficult. Of course, I guess most people never use the Command Prompt, but those who do miss these powerful features from Unix-like systems. Nowadays, however, we have the Windows PowerShell.

The Windows PowerShell has been around for a few years already and I've been vaguely aware of its existence, but never really looked into it until now. It seems to be readily available on all Windows 7 installations, and most likely on Windows Vista as well. You can find it from the Start Menu.

Basics

When you start the PowerShell, you might want to see what commands are available. You can use the Get-Command command or its alias gcm for that. You'll see many lines of text that end with "...", i.e. they are truncated. Use Get-Command | Format-List  or the short form gcm | fl to see everything, or gcm Some-Specific-Command | fl to get info on some specific command only. And since the PowerShell commands aren't that short, you might only want to see the list of short commands, or aliases, available Get-Alias. The PowerShell commands are case-insensitive, so that would be the same as get-alias. And by the way, the default alias for get-alias is gal.

When you are accustomed to Unix shells the weird part in PowerShell is that it is object oriented. The pipes actually pass around typed objects rather than character streams. So when you "print out a list of files", you are actually rendering a collection object consisting of file objects. I won't go into this in detail but it is good to know this.

Replacements for Unix commands

So, what commands replace the most used Unix commands? Here are some of the most important ones in the format of Unix-command: Windows-command (alias):
grep: Select-String
cat: Get-Content (cat)
ls: Get-ChildItem (ls)
mv: Move-Item (mv)
cp: Copy-Item (cp)
wc: Measure-Object -line -word -character (measure)
cd: Set-Location (cd)
tail -n 15 : cat | select -last 15
tail -f cat -path -wait

Aliases

OK, so the PowerShell can do pretty much anything a Linux shell could, and often with the same command. However, there aren't ready made aliases for all the commands. Luckily, you can define more of these aliases by yourself. Let's create that grep alias: Set-Alias grep Select-String. There! However, there's still a problem: if you now exit the PowerShell, your brand new alias is deleted. Luckily, you can save these into your profile file. First, type $profile to see the location of your profile file. Chances are it doesn't exist so you need to create it. After you have done that you can add your set-alias commands into it. You can then easily edit the file by typing notepad $profile.

However, when PowerShell starts the next time it will give you a warning that "the execution of scripts is disabled on this system". The command get-help about_signing explains in detail what you can do about this, but the easiest way is to restart PowerShell with the administrator rights and to enter the command set-executionpolicy remotesigned. You can now close the admin shell and open it up again with your normal rights and presto, your aliases are available to you right from the start!

Functions

Unluckily, aliases can only be created for plain commands, not for commands with parameters or pipes. However, these cases can be dealt with by creating functions. Let's create a function called tail. Open your profile file and add these lines to it:
function tail($1, $2) {
    cat $2 | select -last $1
}
Then, in your PowerShell, reload your profile script: . $profile (notice the dot). Now, when you want to see the last 15 lines in the given file, you can just enter this command: tail 15 [filename]. Voilà!

Further resources

I read quite a few web pages when learning the basics of PowerShell and you will probably find them useful as well. First, Microsoft, of course, has an Owner's manual as well as a large collection of useful PowerShell tips. Second, Stack Overflow has thousands of questions about PowerShell answered. Third, a Windows PowerShell blog has a more detailed list of those Unix equivalents in PowerShell. Finally, as usual, Google is your friend!

perjantai 11. toukokuuta 2012

More good Android apps

It's been a few months since my previous post on good Android apps and since then I've discovered more great apps.

First, WhatsApp. WhatsApp is an instant messenger that feels just like sending free SMS messages. It's a cross-platform software, so you can communicate with your friends even if they are using iPhones or Windows Phones. You register to WhatsApp using your phone number, and the software finds everyone else who is using WhatsApp based on the numbers in your phone book. In addition to text messages you can also send images and videos. WhatsApp is free for the first year, then it's $0.99 per year.

Then, Pocket -- formerly known as Read It Later. The former title actually tells you what this app is about: it's about saving articles from the web to be read later. Sounds simple, and it is, but Pocket does it really well. Once you register to the service, you can start adding articles (or videos, or anything else) to your Pocket. There are bookmarklets you can install to your browser for saving any page with just one click. In Android, Pocket registers itself as something that shows up when you select "Share" from any application. Pocket strips ads, menus and side bars from the web pages and only shows you the article main content in a really clean way. Pocket even handles seamlessly those multi-page articles where you'd normally need to click "Next" every few paragraphs. You can also adjust the text size, screen brightness and such features easily when reading the text.

Finally, BaconReader for Reddit. Reddit is a "social news site" to where users submit links and the best links get voted up and show up at the main page. By default, the main page consists of links that mark the lowest common denominator between all Internet users, i.e. 75% of the links direct to funny images. But Reddit contains hundreds of sub categories, or subreddits, for every imaginable topic. Whether it's astrology, programming, bicycling or cooking, there's a subreddit for it. The TrueReddit subreddit contains long, serious articles, whereas the lolcats subreddit contains cute pictures of cats. With BaconReader you can choose which subreddits to follow and always get the newest links to your Android device easily.

tiistai 10. huhtikuuta 2012

Instagram

The popular photography app Instagram was recently released for Android. Previously it had only been available for iPhone, so I decided to give it a try.

Instagram is similar to another highly popular app called Hipstamatic. The idea is that you take a photo, crop it into square format and apply a filter that makes the photo look "vintage" or "retro". The analog-world counterpart of these apps is often called Lomography, after the cheap Soviet Russian camera Lomo LC-A. Why would anyone want to have their photos artificially aged? Others have discussed this elsewhere, so see, for example, this study or this essay.

Instagram is very intuitive to use: snap a photo, select a filter, write a caption, upload. You apparently cannot save any photos to your device: if you want to keep a photo you must upload it into the service. So Instagram is not only an app but also a service that hosts your photos. You can also find you friends there and subscribe to their feeds to get their latest photos on the main screen of the app. Or you can just browse the most interesting photos from all users.

There's something in Instagram that appeals to me. It sort of fills a need that I didn't know was there. To Flickr, I only try to upload my best and technically flawless photos. To Facebook I upload photos of events with my friends. But to Instagram I can upload any random photos. It couldn't be easier and you always have the camera (your smartphone) with you. Some people are into taking a photo every day, and I think Instagram is quite perfect for this kind of a project. In fact, I'm going to try it! Instagram doesn't have its own web interface for browsing the photos but an external service called Webstagram fills that void; see my photostream here.

Coincidentally, about five hours ago (as of writing this post) Facebook announced that it is going to buy Instagram for 1 billion USD. The figure is ridiculously large and I believe Facebook is never going to get their money back from that purchase, but hey, if they happened to have an extra billion lying around then why not buy Instagram with it. Molly Wood from CNET also questions the price tag, and some people believe that Facebook will now ruin Instagram, although Mashable's Chris Taylor says Facebook could actually improve Instagram. What happens, remains to be seen, but I'm not too concerned.

tiistai 3. huhtikuuta 2012

URL shorteners

Have you ever had to share a long link to some website with someone? Perhaps something like this: http://maps.google.com/?ll=60.169145,24.952417&spn=95.287566,270.527344&vector=1&hnear=Helsinki,+Suomi&t=w&z=3&layer=c&panoid=-fKxq5ulDCh5MjWvf2lsqw&cbll=60.169145,24.952417&cbp=13,-9.198922634831321,,0,-3.4772653749464837&source=gplus-ogsb? You can be sure that if you send a link like that over the email it gets cut at some point and breaks. So, what to do? Enter URL shorteners.

URL shorteners take a long URL and create a short alias for it. One of the oldest ones, if not the oldest, is TinyURL. The user interface is simple: you take your long link, paste it into the box on the site and click the button. The long link above then becomes a much more manageable "http://tinyurl.com/cs92l4u". On the site you can, in theory, also choose a custom name for your URL, instead of the randomly assigned string "cs92l4u". However, TinyURL is so old and popular that most good short names are already taken. If you want to know where a TinyURL link leads to, you need to add "preview." in front of the domain name like this: http://preview.tinyurl.com/cs92l4u.

TinyURL links are short and good for email and newsgroups, but they could be shorter. bitly is a good alternative for many reasons. First, the domain name they use by default is "bit.ly", i.e. just six characters instead of the 11 in "tinyurl.com". If you create an account to bit.ly you also get an access to the shortest possible short domain address "j.mp", which is just four characters. Second, bitly provides extensive tracking for the links shortened with it. Shortening the long link above gets me this: http://j.mp/H5Go2J. Now, when I want to see the statistics of any bitly or j.mp link I'll just add a "+" sign at the end of the URL: http://j.mp/H5Go2J+. Tadah! On that page you can also see a QR code for the URL, to be read with the camera of your smartphone. Unfortunately, bitly does not allow you to choose the name for your link: it's always a random string of characters. bitly does, however, allow you to create collections of links, i.e. bookmark lists. See, for example, my list of the most interesting TED talks.

Yet another URL shortener is is.gd, pronounced "is good". You can choose to have it log statistics and it also creates a QR code for your URL, but there's no registration or login required. The example link shortened to http://is.gd/yitefe with the "lower case pronounceable" option selected. The preview page is the URL with a minus sign added, and from that page you can also access the statistics (if you chose them to be logged) and the QR code: http://is.gd/yitefe-. is.gd is also newer and less popular than TinyURL so you actually have a chance of getting some meaningful short name assigned to your link -- for example, the http://is.gd/bookofjobs address now leads to my post about the biography of Steve Jobs.

The next URL shortener is called Tiny Arrows. The URLs created with it look really special: they actually have tiny arrows in them! Tiny Arrows never assigns a random string to your URL so you are forced to think of a name for your link, which is not bad. I shortened the example URL to this: http://➡.ws/senatesquare. What's also special about this shortener is that it doesn't take you to the target right away but actually shows a short countdown during which you see the actual URL of the page you are about to enter. You can also bypass this countdown by clicking a link or disable it altogether from ever appearing to you again.

Next, t.co. It's not a link here because it doesn't really have an user interface: it is integrated to Twitter. So when you post any link to Twitter, it gets shortened using t.co. They rolled this service out in 2010 when they decided that they want to track the links and that their users shouldn't need to use third-party services for posting long links to Twitter. Not much to say about this one besides that, but it's good to know about it. It doesn't give the tracking information to you, so if you want to track the clicks, you still need to use, say, bitly.

So, is that all? Nope, there are still some services worth mentioning, like the mcaf.ee shortener by the computer security company McAfee. Because they are a reputable computer security company, they have a pretty good idea on which web sites are safe and which ones may try to infect you with viruses. So, the mcaf.ee links are safe to click. They also display a frame at the top of the page telling you security information about it. The example URL to Google Maps that I've been using in this post is a bad example in this case because it breaks out of the frame, but take the Steve Jobs post again: http://mcaf.ee/mgj7b. You'll see the "This site is Safe" text at the top of the page, along with a link to a detailed site report (which, in the case of this blog, tells you almost nothing, but anyway..).

ShadyURL is the opposite of mcaf.ee: it creates links that look really, really suspicious: something along the lines of http://5z8.info/best-russian-sites-for-bootleg-everything_r7c1lr_b00bs for example. It's more of a satire of an URL shortener than an actual URL shortener. :) And finally, if all those links were too short for you, then HugeURL is your service: it expands any URL into a ridiculously long one!

OK, we are almost in the end. There are many utility services also built around the concept of URL shorteners. For example, there are various browser plugins. For Chrome, the bitly plugin creates and copies short URLs to clipboard with one click. There are also services that show you the expanded links, possibly as tooltips over the shortened URLs. For Chrome, there's View Thru for that. For Firefox there are URL Shrink Easy and Long URL Please for the same purposes.

Finally, a word of warning: like any other website, a URL shortener site may stop working. At that point all of your short links will also stop working. This is called link rot. So keep your important links in the full form and only use shorteners if you figure that no damage will be done in case the link would stop working in a week or in a year. You can lower the risk of your links rotting by only using reputable shorteners, such as TinyURL and bitly, even though there are actually dozens of URL shorteners available.

maanantai 26. maaliskuuta 2012

The Humble Bundle for Android #2

Again, it's time for yet another Humble Bundle. That's five or six games that work on Windows, Linux, Mac and Android, for whatever price you want to pay! There are just seven days left of this offer, so go to humblebundle.com and act now!

sunnuntai 25. maaliskuuta 2012

Walter Isaacson: Steve Jobs

I just finished reading Walter Isaacson's 600 pages long book Steve Jobs, the biography of Steve Jobs (February 24, 1955 – October 5, 2011). This is my attempt at summarizing the parts of the book that I found the most interesting.

According to the book, in Jobs's mind everything -- including ideas, people and products -- was either the best or utter crap. Not many shades of grey there. He also voiced his opinions loudly and shamelessly in front of other people. At some point some of his colleagues and employees understood that when Jobs called their idea/concept/product/model total bullshit, he actually meant "Please explain to me why this is absolutely the best way of doing this". If you then managed to do that, Jobs would respect you. He might not necessarily admit it at first, but he would come back in a few days and then present you your idea as his own.

This has to do with another concept that was discussed a lot in the book: Jobs's ability to distort the reality. Jobs could easily hurt people, but he was just as skilled in flattering them or persuading them to do something -- even if that something was thought to be impossible. When Jobs told his team that they could do something, they believed him and actually pulled it through. For example, in January 1984, when there was a week left before the deadline for the software of the new Macintosh, the engineers concluded that they just couldn't do it: they needed two more weeks to finish it. Jobs explained to them that they were a great team and had been working on the project for months so a couple of extra weeks would not make a difference and the original deadline would stay. So the team bought a huge bag of coffee beans, pulled a few all-nighters and actually shipped the product in time.

Jobs's skill of persuading almost anyone of almost anything was the product of a couple of factors. First, Jobs could also deceive himself to believe in anything he decided was the truth. Some would say he was lying, but it seems he truly and fully believed in whatever he had decided was the reality. He could effortlessly ignore any fact he didn't like (such as the birth of his first daughter Lisa, for the first couple of years), or he could just twist those facts to suit his own mind. Second, Jobs could direct his attention sharply to anyone or anything, ignoring anything else around. He could focus on something "like a laser beam". He had even learned to stare at people without blinking.

Jobs was a special kind of a person who could as easily focus on the big picture as the smallest details. He could spend a morning in a board meeting and then in the afternoon give his unfiltered opinions on the coating or curvature of the screw heads in their newest physical product. He was passionate about the details of the products of his companies and worked closely with the designers. He actually forced everyone in his companies to work closely together: in other organizations, such as Sony, different divisions practically competed with each other. That is one reason why Sony failed to create a solution that would integrate an online music store with an MP3 player: they were afraid that the online store would eat a share of their traditional CD sales. Jobs managed to do this with the iPod and iTunes and was never afraid to have one product cannibalize another's market: "If you don't cannibalize yourself, someone else will".

Jobs considered himself and Apple as being in the intersection of humanities and sciences, or creativity and technology. He was a good engineer but Steve Wozniak, with whom he founded Apple in 1976, was the best one. Whenever Wozniak came up with a new invention, Jobs found a way to make money with it, so they completed each other in that sense. Wozniak was more of a hacker and was happy when soldering parts on a circuit board, but Jobs always insisted that everything should be intuitive and easy to use for an average person.

During his youth Jobs tried LSD, marijuana and other drugs. He later said that taking LSD was one of the most important things in his life as that -- and his Zen studies -- made him "more enlightened". He was rebellious and lived with fruit and vegetable diets, and also traveled to India to find his guru. He liked to walk barefoot and also thought that because of his vegetarian diet he wouldn't need to shower or use deodorant, which wasn't too nice for the people around him. Later on when he got the cancer in the 2000s he still tried to distort reality into overcoming the cancer with various fruit-based diets only, which delayed the proper medical care for several months and actually worsened his condition badly.

Finally, here's Jobs's speech to the graduates of the Stanford University in 2005. All the themes of the speech and the speech itself are also discussed in the book, but I figured I'd rather not repeat them and just let Steve speak for himself:

keskiviikko 7. maaliskuuta 2012

Battlefield 3 newbie tutorial

Last March I wrote a couple of posts about the Battlefield: Bad Company 2 game. They were aimed for newbies, documenting pieces of information that I wish I knew right from the beginning. The newest installment of the series, Battlefield 3, was released last October and I've already played it for perhaps even a bit too much. I cannot consider myself a newbie to the series anymore but I figured I'd still try to help those who are just getting into the game, so here goes. Note that I focus solely on the PC multiplayer aspect of the game. I'd like this to be some kind of a "everything you ever wanted to know about Battlefield 3 but were afraid to ask" -list. Comments and further questions both from newbies and experienced players would also be much appreciated. Experienced players, what tricks do you wish you knew right from the beginning?

Game modes


The most popular game modes are Rush and Conquest. The other ones are Team Deathmatch and Squad Deathmatch, but I'll focus on the first two modes.

Rush


Arming an MCOM
In Rush one team, the attackers, tries to arm bombs to MCOM stations, marked on the minimap with squares. The other team, defenders, tries to prevent the attackers from arming the bombs. You arm a bomb by holding down the E-key when next to the station (on any side of it). After the bomb is armed, it takes perhaps some 30 seconds before it explodes, during which time the defenders will try to disarm the bomb. You disarm the bomb exactly as you would arm one, by holding down the E-key. Arming and destroying MCOMs earns you a lot of points, so you should try to do that. Surprisingly often no-one wants to make the final move towards the station, everyone just expects "somebody else" to do that, and that's no way of winning matches.
MCOM armed

After destroying two MCOMs the map is expanded, the attackers advance and the defenders fall back to defend the next pair of MCOMs. There are usually 3 or 4 pairs of MCOMs. The game ends if the attackers destroy all the MCOMs or if the defenders kill all the attackers. The number of attackers is visible at the lower left corner above your minimap. That number is called the number of tickets. Defenders have an unlimited number of tickets.

A destroyed MCOM
When you have armed an MCOM station you should do whatever it takes to defend it from being disarmed. Get into a corner and take a doorway into your sights (you bring up your weapon's sights by holding down the right mouse button). If there's a teammate in the same room or area with you, see which entrance point he picks and pick the other one yourself. If the enemies try to advance, kill them. If it looks like you are going to die, you might, as the last resort, want to throw a grenade towards the MCOM. I recommend binding the grenades to the F-key, I seem to recall they are bound to G by default. F, I think, is, by default, the key for your knife -- you'll want to bind this to a mouse key if your mouse has more than the basic two keys and a scroll wheel. More on the knife later.

Also, once one of your teammates has armed the MCOM station you should prevent the enemies from getting there. At this point the enemies are usually running quite blindly towards it, so this may even give you chance to go for the other MCOM station when the enemies are busy with the first one!

Conquest
Capturing a flag in an infantry fighting vehicle (IFV)

In Conquest the teams try to conquer flags that are scattered around the map. The flags are initially neutral and are converted by hanging out near them, without any enemies in the vicinity. Once you get close enough to the  flag you'll see and hear a counter ticking in the middle of the screen. Capturing flags earns you a lot of points, just like arming MCOMs in the Rush mode. The Back to Karkand expansion pack also added a slightly different variation, Conquest Assault, where one team, the defenders, starts with all the flags and the other team must conquer them to deplete the defenders from spawning points. The Conquest games end when one of the teams runs out of tickets. One important thing to know about the Conquest mode is that once one team controls more than half of the flags, the other team bleeds tickets. This means that they lose reinforcements even if no one is actually killed, so this gives you even more reason to try to capture flags from enemies.

Squads, character kits and their equipment

Squad selection screen
There are four character classes -- or kits -- in the game: Assault, Engineer, Support and Recon. They all have different strengths and weaknesses. One thing I'd like to stress at this point: always join a squad! Most servers seem not to assign you into a squad automatically, so unless you do that by yourself, you will miss a lot of points, as working with your squad mates always gives you some extra points compared to working with any other team members. (Not that you shouldn't help them also; of course you should!)

So, to join a squad check the squad menu from the spawn screen to see which squads have vacant places. A squad holds four soldiers, so to get a maximum amount of support from friends -- and to help a maximum amount of friends -- try to join a squad that has three players. In addition to the attacked/defender starting point or a flag, a server may allow you to spawn to your squad leader or to any of your squad member. Before blindly spawning, inspect the situation at least for a couple of seconds. You do that by clicking on the desired spawn location which moves the camera there. If your squad mate is in some good position, such as flanking an enemy, you'll want to join him. But also if he's under fire, you might want to join him as an Assault soldier in order to give him a medkit and to revive him if needed. In general I always drop a medkit or an ammo kit right away when I spawn next to a squad mate.

Assault

The assault soldier carries an assault rifle and medkits by default. Use the medkits! What I generally do when I spawn next to a squad member, I immediately throw them a medkit. Hanging next to a medkit heals you quickly and earns points for whoever deployed that kit. Assault soldiers can make good points without even killing anyone by deploying medkits and reviving fallen team mates (once you have unlocked the paddles). You use the paddles by aiming at your dead friend and firing -- there's no indication on when you are at the right position and sometimes the paddles seem to be buggy and won't have an effect (on the first try), but that's how you do it anyway.

The assault class also has an unlockable grenade launcher, but using that one uses up the slot where you'd normally keep the medkit. Once you kill 20 enemies with the grenade launcher, you earn smoke grenades for it. These are very useful especially for the attackers in the Rush mode as they help you to advance in the cover of a smoke cloud without the enemy seeing where exactly are you.

Engineer

Engineers are good at repairing and destroying vehicles. By default they carry a basic rocket launcher and a repair torch or anti-tank mines. The main weapon of an engineer is a carbine. In terms of stopping power and accuracy carbines are basically as good as assault rifles; my favorite carbine is the SCAR-H which is the third or fourth unlock of the Engineer class, depending on how you count it, after 14000 points.

Engineers are similar to assault soldiers in that they, too, can earn lots of points just by helping the other members of the team. With this I'm referring to repairing their vehicles, of course. Choosing whether to use AT mines or the repair torch should be decided on a case by case basis. If you can get into a tank or some other vehicle the repair torch is always a good choice, but if there are no seats left for you then you might want to make sure that the enemies don't use their vehicles either. ;) However, when attacking in a Rush game you will usually want to equip the repair torch.

Applying the repair torch to an enemy vehicle causes damage to it, so it's entirely possible to kill enemies by destroying their tank with a torch. You should, however, be aware of a few points. One: many people use proximity scanners in their vehicles so you won't be able to approach the vehicle without being noticed. Two: you can be ran over by a vehicle if you are in front of it or behind it. Three: one member of the vehicle crew will probably jump out and kill you even if the vehicle's weapons cannot shoot you when you are right next to the vehicle. So mines are a lot safer for you if you keep clear from them when they detonate.

Notice that while unarmored vehicles will be destroyed by one mine, tanks usually won't. Instead they become disabled, which means that their turret can still turn and they can shoot, they just cannot drive away anymore, or only in crawling speed. The vehicle also catches a fire and will start losing health, but if there's no one to finish the vehicle off with an RPG then there's a good chance that a member of the crew will just repair the vehicle. I realize that it's boring and risky to wait for someone to drive to your mine and no one actually does that, but at least the defenders of a Rush round should be aware of this issue.

At 82000 points the Engineer class unlocks the Javelin missile. It locks on to a target and is then guided into it. That's at least in theory. In practice the locking time feels like an eternity and you seldom have the chance to shoot enemy vehicles from a distance where Javelin would be better than a regular RPG. You also cannot shoot Javelin without it locking into a vehicle first, so you cannot use it in quick situations or against infantry, nor can you, by default, shoot aerial vehicles with a Javelin. Finally, the basic RPGs are slightly more powerful than the Javelin if they hit their target anywhere but on the top. However, Javelin excels if one of your team mates is using a laser designator, more on which later under the Recon header.
Stinger ready to be fired

There are also anti-air missiles in the Engineer kit: the IGLA for Russians and the Stinger for the US troops. These need a lock-on just like the Javelin and they only lock on to aerial vehicles. The air vehicles then have a chance to defend themselves with IR flares, so it's still not a guaranteed hit.

Support

Support soldiers are armed with a light machine gun and can deal ammo for their team mates. As with the Assault medkits, do deal ammo out too! Light machine guns are pretty effective if used correctly, but horribly ineffective if used incorrectly. A correct way to use a light machine gun is to deploy a bipod for it. If you have selected one as an accessory for your gun, the bipod is deployed automatically when you bring up your sights when you are laying down or close to a suitable obstacle on which to place the bipod.

The bipod makes the gun very stable so it is often quite feasible to just go for a long burst of automatic fire. However, when using a machine gun without a bipod, that's not a good idea. The recoil will throw your aim off and there's a great chance that you only get yourself killed by an enemy five meters away after spraying 50 bullets at him. So go for short bursts and in between correct your aim.

As a Support soldier you will quickly earn the C4 plastic explosives. Later on the Support class will also earn Claymore mines and a 60 mm mortar. The C4 can be used -- you guessed it -- to destroy stuff. You deploy an explosive with the right mouse button and detonate it with the left one. You can remember this from the fact that every other weapon is fired with the left button as well. You can have several explosives deployed at any given time, and when you run out, you can just drop an ammo box and collect new ones. Deploying "too many" C4s (or anti-tank mines or Claymore mines) will, however, make the oldest explosives disappear.

If you are brave, you can destroy enemy tanks with the C4. Just go to the tank, attach an explosive with the right mouse button, preferably back off and then detonate. The same cautions apply as with the Engineer and his repair torch, so you are likely to get noticed and killed, but hey, it's still worth a try especially if the tank in question is busy with shooting at your team mates in the other direction. I have also found the C4 useful as a Rush defender when you can attach the explosives to the MCOMs or right next to them and then easily kill the first one trying to arm a bomb.

The Claymore mines are anti-personnel explosives. Use them to protect the MCOMs and routes that you cannot guard the whole time. Be careful to set the mine so that the direction of the explosion is the direction from which an enemy is likely to approach. I also sometimes disguise the Claymores by dropping an ammo box right on top of it.

You can also destroy enemy explosives with the mortar
The 60 mm mortar is a weapon that can provide indirect fire afar. The basic shells are high explosive (HE), but you can also use them to shoot smoke shells. It's a bit difficult because there's no indicator on the screen on whether you have the HE or the smoke shells selected: you just have to know it. You select the smoke shells with button "2" and the HE shells with "1". They have independent reloading times so you can shoot two shells in a very quick succession before a short loading period. Smoke shells are especially useful for attackers in the Rush mode. Naturally they can be used to cover your own troops but they can also be used to blind the defenders. If an enemy sniper is fortified somewhere so that you cannot kill them with the HE shells, you can often blind them with the smoke shells, which is enough to force them to find another position. The possible problem with the mortar is that as you cannot see the target area directly, you only rely on your team mates spotting the enemies so that you can see them on your minimap that you use for targeting. So this is yet another good reason for you to spot every enemy you see.

Recon

The Recon class is often regarded as the "sniper" class as they get the sniper rifles. This seems like a tempting class for many new players. However, a sniper's worst enemy is often another sniper, and unfortunately for you the truth is that most enemy snipers on the field are much more experienced and better equipped than you. Thus it might not be a good idea for a new player to camp somewhere with a sniper rifle when they could be in the frontline using some other kit.

In addition to the sniper rifles the Recon class also gets some nice gadgets such as the T-UGS. If you wish to use these but killing enemies with sniper rifles doesn't seem to work out, I recommend you to play some Team Deathmatch games as a Recon soldier using some all-kit weapon, such as the UMP-45 submachine gun. You can earn this gun using any other character kit and then use the gun to get some points with the Recon kit.

So, the Recon class gets these gadgets. The first one is the Radio Beacon. This is basically a spawn point for you and your squad. Depending on the map you might spawn next to the beacon or you might spawn into the air with a parachute! In some maps you can take advantage of this to attack the MCOMs by moving your parachute towards one. Using Radio Beacons is a good idea, especially since you have nothing to lose. Or, well, they do beep so they might give your position away, but in general the ability to spawn to a critical point greatly overweights this drawback.

The second gadget is the cryptically named T-UGS. It's short for Tactical Unattended Ground Sensor. It is basically a motion sensor. You deploy it anywhere and it will then spot enemies that come nearby. Again, you might want to put these near MCOMs or somewhere behind you to prevent enemies from sneaking up to you. These do, however, get destroyed pretty easily and the enemy will also seek to do just that.

SOFLAM and its remote controller 
SOFLAM tracking a target
The next gadget is the SOFLAM. It is a sensor that is used to laser designate vehicles. Laser designation causes Javelin rockets and certain other guided weapons to home to the target and also to cause more damage than they would without the laser designation. The nice thing about SOFLAMs is that you don't need to be anywhere near it to use it. You deploy it (left click), exit it (E), move to a safe place and bring up its remote controller again (select it and left click). With the right mouse button you can also change the zoom level of the gadget. It is useful even if there are no enemy vehicles as you still use it to spot enemies. Also you can just forget about the device, it will automatically lock on to targets and help your team on its own (until it gets destroyed).

A view from the MAV
Finally, there's the MAV. It's a small flying spying machine with a motion sensor. You can guide it from a safe location, and if you exit it, it will gently float down to ground (or a roof if that's what was below it). Like the SOFLAM, you can then forget about the gadget and just let it act as a static motion sensor, or you can get back to it later. The MAV operator can also ram the machine against an enemy soldier to kill them! This requires some skill as the gadget is quite tricky to control that precisely, but this can prove useful for, say, killing a well fortified sniper.

General tips & tricks

More on the knife, as promised. The knife does some damage to the enemy if you just swing it at them, but the real way knifes are used is the takedown, which is instantly fatal. You perform a takedown by approaching the enemy from behind and then holding down the knife button when close to them. This wasn't told anywhere clear enough for me so at first I missed a couple of takedown chances when I didn't know I need to hold the button down. When you perform a takedown the game goes out of your control for a couple of seconds to show an animation of you cutting the victim's throat. When performing a takedown you also get the victim's dogtags. Not that there's any value in them in the game, but they are valued as "trophies" outside the game.

Next, the helicopters. I'll be the first one to admit I'm still a bad helicopter pilot. However, I found them easier to control once I changed the default keys so that mouse controls the pitch and yaw and the keyboard controls the roll. That basically allows you to aim with the mouse, as usual.

4x scope on a PKP Pecheneg machine gun
Then about weapon accessories. When you use a weapon you unlock new accessories to it. You may, for example, unlock holographic sights or scopes. Choose your sights wisely: in a tightly packed map a 4x scope is usually too much when the enemy may appear right in front of you. Also, if your weapon is not suited for longer distances, like shotguns or submachine guns, a 4x scope is not that useful and you should instead go for  the holographic or red dot sights. Sights with magnification may also be slightly slower to deploy than the sights without magnification. The sights with the highest degrees of magnification have scope sway. This means that the sights are moving around a bit and it is more difficult to properly acquire a target. You can hold your breath and thus temporarily get rid of the scope sway by holding down the sprint button (left shift by default).

Another thing you should know about the weapons is that many of them, especially assault rifles, have a firing selector. This means that you can choose between single shot fire, burst fire and fully automatic fire. Not every weapon has all of the options available to it, but anyway. The default key for the selector is "V" and you'll see a firing mode indicator at the bottom right corner next to your ammo count: *** means full auto, ** burst fire and * single shot fire. Full auto may be the best in close quarters but single shot has its use with long range shots.

Well, that concludes this post. I hope you learned something. Again, comments and questions both from new and experienced players would be much appreciated. Finally, here are a couple of nice links: The Battlefield Wiki and the BF3Stats.com site for tracking your statistics. Also, the software I used to capture those screenshots is called FRAPS.