Archive for February, 2011

How I improved my Handwriting

During high school, my term exams (quizzes) required handwritten answers spanning multiple pages.

My handwriting was barely readable.

Based on some observations I started to write the letters with,

1) consistent shapes
2) same size
3) equal spaces between the letters and words.

This made my handwriting very readable but not necessarily pretty.

A few years back when I took an interest in typography I realized why this technique worked.

A printed page mostly uses a single font (letters of the same “shape”), same font size (same size) and consistent spacing between the characters (equal spaces). This among other things makes the page very readable.

I hope this technique helps someone improve their handwriting skills.

Playing music on the LG Optimus V

I finally bought a smartphone. Its an LG Optimus V with Android 2.2 OS.

It’s my first smartphone ever. I was excited to transfer and play some music from my mp3 collection on the Mac using the pre-installed Music application on the smartphone.

I did not find any easy and quick instructions to transfer music files to the LG Optimus V.

Here is how I loaded music files from my Mac to my new LG Optimus V smartphone:

  • Connect the smartphone to your Mac using the supplied USB cable.
  • The “Turn USB Storage On” button should pop up on your smartphone. Press this button.
  • The smartphone should now appear as a folder on your Mac Finder.
  • Using Mac Finder, create a new folder on the smartphone and name it Music
  • Copy music files from your Mac into the new Music folder on the smartphone.
  • Wait for the copying to complete.
  • Press the eject button on the Mac Finder to safely remove the smartphone from your Mac.
  • A “Turn USB Storage Off” button should appear on the smartphone. Press this button.
  • Start the Music app on the smartphone and you should be able to see/play the music files
    on your smartphone.

This is the quick and dirty method to play music on your smartphone.

Syncing your music files between the Mac and your smartphone is an obvious problem with this approach. If you know of any good applications for the Mac or PC that syncs music files for Android phones, please leave a comment.

I am discovering new apps for the LG Optimus V every day and will share them as I discover interesting apps.

[Update 02/15/2011]

Bluetooth is another option to transfer your music files from your Mac to your LG Optimus V smartphone.

You have to pair your smartphone with the Mac to transfer files.

Once your smartphone and your Mac are paired, just right click on the album folder or an individual music file and send to the “paired” phone.

Python modules, packages and code organization tips

I am learning Python programming.

Having programmed in Java and C# (CSharp) for a while, one of my first questions was how do I structure code in Python.

Java has namespaces and a class per file construct to organize code. C# (CSharp) has namespaces to organize code. I was looking for something similar in Python.

It seems the answer is Python code can be organized into modules and module namespaces can be organized using packages.

Packages translate to a folder in the file system.

main.py
music/
songs.py

A class called Song in songs.py can be imported into another module using the statement

from music.songs import Song

I was getting a python module not found or class not found error even though I had the right package folder structure.

On reading the python manual closely I realized that you need to create a __init__.py file in the package folder.

The folder now looks like,

main.py
music/
__init__.py
songs.py

After creating an empty __init__.py file in the package folder, I was able to import the Song class from music.songs module without any errors.

Some more tips on Python code organization.