Näytetään tekstit, joissa on tunniste tip. Näytä kaikki tekstit
Näytetään tekstit, joissa on tunniste tip. Näytä kaikki tekstit

torstai 28. helmikuuta 2013

iPad Mini for dummies

The Home Screen
I recently became an owner of an iPad Mini. Having never used any Apple products (despite reading the biography of Steve Jobs) it took some time to get the logic of the system. For those in the same situation, here are some random pieces of information that I personally found useful.

Enabling the Safari bookmarks bar

First, I tried the Safari browser. It's quite minimalistic, and by default you don't even see a bookmark bar. The weird thing compared to, say, Android or Windows is that you cannot control the settings of Safari from the app itself! This seems to be true with many other apps as well. Instead, you need to go to the Home Screen with all the icons and navigate to the Settings app. In there, select Safari and then toggle on the Always Show Bookmarks Bar setting.

Adding a bookmark
Now, how to add links to that bar? Navigate to the site you want to bookmark and click the rectangle-with-an-arrow -icon next to the address bar. You normally associate this icon with sharing content through email/Facebook/Twitter/whatever, but in Safari you also find the Bookmark option in the menu that opens. The dialog is simple: there's the name of the site, then the address, and finally a category, where you should obviously choose Bookmarks Bar.

Muting the keyboard sounds and using the Side Switch

The physical volume buttons of the device don't affect the keyboard sounds. By default you can mute those too with the little switch above the volume controls, but since muting the other sounds of the device is just a matter of briefly holding the 'volume down' button, it seems like a waste to use the switch only to mute the keyboard sounds.

Settings
To get completely rid of the keyboard sounds for good, navigate to Settings again, then Sounds, and then toggle off Keyboard Clicks. Now you can change the Side Switch function from Mute to Lock Rotation, which I find to be more useful. You can do that in the General panel of the Settings.

Multitasking Gestures

Multitasking Gestures are a way of quickly switching between apps. They are enabled from the same General panel where the Side Switch function is changed. The gestures are done with four or five fingers:
you can pinch to show the Home Screen, swipe left or right to switch between apps, or swipe up to reveal the multitasking bar.

Volume controls in the
multitasking bar
The multitasking bar shows you the most recent apps you have used. There's one very useful, non-obvious feature there too: swipe the bar right to bring up volume and brightness controls! Tapping the speaker symbol mutes the device, just like the Side Switch used to do before you switched it to rotation lock. ;) So if you'd prefer to hear the keyboard clicks at least sometimes, this might be a better option than to remove them altogether.

Disabling Auto-Correction

In theory, Auto-Correction fixes your spelling mistakes. In practice, however, it usually just makes you write things horribly wrong. To disable Auto-Correction, go to Settings -> General -> Keyboard and just toggle Auto-Correction off.

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à!

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!

lauantai 30. tammikuuta 2010

Windows + P

Windows 7 introduces some new shortcuts compared to the earlier versions of Windows. My absolute favorite of the new shortcuts is Windows key + P. This allows you to choose the presentation mode, i.e. attach or detach an external display, such as a projector, a TV or a regular computer display. In the previous versions of Windows there was no simple way to do it (well, according to my definition of simple -- of course I know how to do it, but anyway). Windows 7 makes it extremely simple.