Connie's Blabber

Friday, August 8, 2008

Multiple Wi-Fi Routers

When I moved back to Toronto in 2003, the first thing I did was to set up a wireless network at home. It was out of necessity: the house is too big; we have too many computers; it would be an ugly mess to pull wires across hallways and down the stairs. Wi-Fi was the perfect solution.

Since then, more devices have been added to the network without any problems. That was until the arrival of the Nintendo Wii. It appears that when the Wii has been in use for a while, it takes over the wireless router, and will not allow any new device to join the network, at which point the only solution is to reboot the wireless router. This, to me, is unacceptable.

A quick search on-line shows that other people are having similar problems, and Nintendo has not provided a fix. I could get a new wireless router and hope that it can handle the Wii, but I then remembered that I had a spare wireless router sitting in storage doing nothing. It was replaced a couple of years back by a more powerful one, but there is nothing wrong with it otherwise. I could make this second Wi-Fi router a dedicated one for the Wii. This way, the Wii's bully behaviour will not affect the other devices.

Our house, like most homes, has one high-speed service. How do I create two (or more) wireless networks? I looked around on-line, but couldn't find any useful help. So I closed my eyes and thought about it. Well, it really isn't that complicated. Here's what I did:



Using the same daisy-chain setup, one can easily insert a third wireless router, a fourth, etc. The only constraint is that all the routers must be within close proximity to each other.

In theory, this new setup should fix the problem caused by the Nintendo Wii.

One last note of interest is I need to connect a computer to each wireless router to configure it. There are a number of ways to establish the connection. In the above diagram, I already have a device connected to Router #1 via an Ethernet cable, so I used that device to configure the router. For Router #2, I took an Ethernet cable, plugged one end into one of the router's LAN ports, and the other end into my laptop, and configured the router using the laptop. Alternately, as I know the default factory-set Wi-Fi SSID of Router #2, I can also connect my laptop wirelessly to Router #2. Once a connection to the router is established, I can configure the router from the web browser of the device, and set up the usual functions (e.g. SSID, encryption methods, firewall, passwords, etc.).

Labels:

Thursday, August 7, 2008

Free iPhone Ringtones

One very cool thing I figured out recently is a way to make free ringtones for my iPhone from any song I own.

Currently, to get a ringtone for the iPhone, you need to first check if the song of your choice exists in Apple's iTunes Store in the ringtone format. Most songs don't, so that's problem number one. Also, even if the song you want is there, you don't get to choose which part of the song you'd like to have as your ringtone. Finally, if the song is indeed available as a ringtone, you must purchase the song for 99 cents, and then, pay another 99 cents for the ringtone.

I know some of you may say, Gee, she's really counting pennies. Jeff couldn't stop laughing when he heard I worked hard for a couple of hours just to save $1.98 plus taxes. It's not the money, people; it's the principle involved. Why should I pay for a song I already own legally, and then pay extra just to make a segment of it into a ringtone? This is robbery.

So here's how it's done on Mac OS X Leopard, using iTunes Version 7.7.1 (11), for iPhone G3.

Part I: Splice Your MP3 File

First of all, you need to splice your legally obtained song so that you will have ready the segment you want as your ringtone. If you already know how to do this, skip ahead to Part II.

There are sound file editor programs out there that do splicing, e.g. cdparanoia on Linux. Because applications on the Mac are not nearly as abundant and free as on Linux, we're better off using existing programs. iTunes can accomplish the goal. Go ahead and start iTunes. Go to Preferences / Advanced / Importing, and change format to AAC.

Outside of iTunes, using Finder, locate your song file in the iTunes Music Library. Ctrl-click on the file and choose Duplicate. A new file is created in the same directory.

Back in iTunes, you'll see a duplicate of your chosen song in the iTunes Library. Ctrl-click on the duplicate and choose Get Info. In the new window, under Options, change the Start Time and Stop Time values so as to retain the segment you want to use as your ringtone. Make sure the segment is less than 40 seconds in length. Close the window. Next, ctrl-click on the MP3 file again, and choose Convert into AAC this time. As only the segment from Start Time to Stop Time will be converted, your duplicate copy of the song will become a segment in AAC format.

Part II: Rename File to m4r

The newly created AAC file has extension m4a. You need to change it to m4r.

Go back to the Finder program where you're already inside the directory where the new AAC file is. Ctrl-click on the AAC file and choose Get Info. In the new window, under the section Name & extension, change the extension to m4r. Close the window. A dialog box will pop up, asking you if that's what you really want to do. Choose "Use m4r".

Part III: Import File into iTunes

Go back to your iTunes program. Ctrl-click on the segment song, and choose Delete. When the dialogue box pops up, choose "Keep the file". This is very important because, while you want to delete the song from iTunes Library, you do not want to delete the physical file. Next, go to File / Import... and select the m4r file for importing. You'll notice in Finder that the physical file is removed, but in iTunes, the song appears under Library / Ringtones.

When you next sync your iPhone, you'll see that inside the sync page Ringtones, the new ringtone is listed there, ready to be synced. Unfortunately, the iPhone holds only one custom ringtone at a time. Nevertheless, now you've got your ringtone made out of your favourite song for free!

Labels:

Saturday, July 19, 2008

iPhone 3G

When Apple released the original iPhone last June, I was disappointed to hear that we wouldn't be getting one in Canada. Since then, rumours had it that we'd get it at Christmas time, then spring time, but all turned out to be false. Some of the more hardcore Canadian geeks, like my friend Mel, went over to Buffalo to buy the iPhone, and then have the phone unlocked, therefrom losing the warranty. Being a conservative kind of person, I wasn't about to do that.

Now I'm rather glad at the delay because the new iPhone 3G is better and cheaper. Friday, July 11 was the release date. Some geeks camped outside Rogers and Fido stores at 2 a.m. the night before. Well, I wasn't about to do that, either. So I waited out the weekend, and ordered my 16GB White iPhone on Monday, the 14th. The Fido salesperson said that, due to high demand, the iPhone wouldn't be delivered "until August 1" -- a two-and-half-week wait. Oh well.

So imagine my surprise when a UPS guy knocked on the door yesterday (Friday, the 19th), with my shiny new iPhone. It took only four days. I'm wondering whether all this "out of stock", "high demand" talk is just hype.

I carefully unpacked My Precious and spent the next few hours setting it up. It was straightforward. I took out the SIM card from my cellphone, and inserted it into the iPhone. Syncing is done through iTunes, which is fine. I had to first export my addresses and date book from the Palm OS Desktop, and then import them into the corresponding Mac OS X programs, which are Contacts and iCal. There was a small glitch when iCal entries were synced to the iPhone Calendar due to the fact that the factory default timezone is set to US West. Once I changed my timezone to East, everything was good. Getting Wi-Fi to work was a breeze. One other crucial program I needed was SplashID, which I purchased from Apple Apps Store, installed on the iPhone and on the iMac, and synced without any problems.

Today when we were out, I tried out the iPhone Maps program which uses GPS, Wi-Fi Hotspots and cell towers to locate the current position. It worked very well. The initial triangulation process is much faster than my Garmin GPS, and the graphics much better too.

So far, the iPhone has lived up to my high expectations. I do, however, have a few small complaints.

One is that the soft-keyboard is rather small for typing with thumbs. Maybe I'll get more used to it down the road.

A more serious problem has to do with the Notes program on the iPhone -- it does not offer the sync functionality. What is the point of a PIM program that doesn't sync? Also, a todo program is missing on the iPhone. These tools are not mere bells and whistles. They are the heart and soul of a PDA. I noticed in the Apple Apps Store a slew of Todo- and Notes- clones are out there. I suppose I can always write my own.

Finally, a major grievance: where is the string search tool, like the one offered by every Palm Pilot, which allows one to search for a calendar entry or a contact by supplying a string? Without this functionality, the Calendar program is next to useless, and the Contact program a pain to use.

Labels:

Wednesday, July 2, 2008

Android SDK

Having just installed Apple's iPhone SDK, I thought I'd get Google's Android, which is "an Open Handset Alliance project" and branded to be "the first complete, open, and free mobile platform." Here is a log of what I had to do to install the Android SDK version m5-rc15 on Linux (kernel 2.6.24-19, Ubuntu Hardy 8.04).

I used the installation instructions at http://code.google.com/android/intro/installing.html as my main reference. Downloading the SDK from the Google site was a breeze. I unzipped the ZIP file into /opt, and added /opt/$AndroidDir/tools to my PATH environment variable.

First, I tried to run the Android Emulator on its own, and got a nasty error about the program not being able to read some file. It turned out that two files in /opt/$AndroidDir/tools/lib/images, system.img & userdata.img, needed to have read-access-for-others added. After that, the emulator program started successfully. (What an ugly-looking device though. Oh well, not the most important thing...)

Although an IDE is not necessary, and I personally prefer the terminal window and the command line, it's not a bad idea to have an IDE around for GUI programming. Google recommends Eclipse. Why not? I went to Ubuntu's Synaptic Package Manager, and installed Eclipse 3.2 from there. Afterwards, with some difficulty, I installed the Android Development Tools plugin in Eclipse.

Next, I created a test program by following the instructions at http://code.google.com/android/intro/hello-android.html. No problem with the files, etc., but when I tried to run the test program, I got an error in Eclipse: "Could not find /bin/HelloAndroid.apk!".

After much digging on the Net, I learnt that I must (1) install Sun's Java JDK first; and (2) install Eclipse from www.eclipse.org because the one from Ubuntu is no good. There is a nice little Howto at http://flurdy.com/docs/eclipse/install.html. Note that the part about installing Apache Tomcat can be ignored. I ended up installing Sun's Java JDK 6, and the latest version of Eclipse, Ganymede 3.4. As an aside, for some strange reason, the Eclipse installation package does not contain an icon file, so I found one on Google Images, and used it during the Ubuntu application menu setup.

After all this, I tried to run my test program HelloAndroid, again. This time, everything worked!

Labels:

Tuesday, July 1, 2008

iPhone SDK

The iPhone will be released on July 11 in Canada. I'm getting one, of course. In the meantime, I thought I'd get the iPhone SDK first.

Downloading the latest iPhone SDK beta was straightforward. Installing the package appeared to be easy too, except that the installation program would not allow me to install the iPhone components, without which nothing works. This is because the SDK ostensibly only supports Intel-based Macs whereas mine runs on a PowerPC processor. There is no reason for the restriction from the technical angle. My only guess is that Apple wants to force people to buy new Macs.

Fortunately, clever people on the Net have discovered ways to get around this evil hurdle. Thanks to tips by Mike Rundle at http://3by9.com/85/, I was able to install the iPhone-related tools manually from the installation package. Now, all the useful things: header files, lib files, compiler, linker, the iPhone Emulator, etc., are all in place for Xcode.

Next, when I tried to compile a test program, I got this error: "No architectures to compile for (ARCHS=ppc, VALID_ARCHS=i386)." To fix this nasty bit -- another hurdle thrown at PowerPC-based Macs, I must do the following (thanks to Tom Bradford's instructions at http://www.tbradford.org/2008/03/iphone-sdk-beta-2-possible-ppc-fix.html):

- Go to /Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications/.

- Find a file called "iPhone Simulator Architectures.xcspec"; make a backup of it and open the original.

- Notice in this file that the 'RealArchitectures' variable only defines i386 as a valid architecture; change that to "(i386, ppc)".

- Add the following just before the Intel section:

// G3
{ Type = Architecture;
Identifier = ppc;
Name = "Minimal (32-bit PowerPC only)";
Description = "32-bit PowerPC";
PerArchBuildSettingName = "PowerPC";
ByteOrder= big;
ListInEnum = No;
SortNumber = 201;
},

// G4
{ Type = Architecture;
Identifier = ppc7400;
Name = "PowerPC G4";
Description = "32-bit PowerPC for G4 processor";
ByteOrder= big;
ListInEnum = NO;
SortNumber = 202;
},

// G5 32-bit
{ Type = Architecture;
Identifier = ppc970;
Name = "PowerPC G5 32-bit";
Description = "32-bit PowerPC for G5 processor";
ByteOrder= big;
ListInEnum = NO;
SortNumber = 203;
},

- Restart Xcode.

Now I've got Xcode on my iMac to compile programs to run on the iPhone SDK. All I need next is an actual program that does something useful or fun!

Labels:

Sunday, June 15, 2008

Gödel, Escher, Bach: an Eternal Golden Braid, by Douglas R. Hofstadter

Gödel, Escher, Bach: an Eternal Golden Braid by Douglas R. Hofstadter

On the surface, this book contains all the topics in which I have a strong interest: mathematical logic, theories of computation, artificial intelligence, programming, music, art, etc. As an undergraduate student, some of my favourite courses were in those fields. Strangely, I found this Pulitzer Prize-winning book hard to take. I am so used to reading theorems and proofs in the form of a technical paper that I found metaphors tedious. Why not state facts in the plain and concise language of mathematics, instead of using characters and stories?

The discussions on artificial intelligence seem rather dated. The sad fact is, the whole field of AI has made very little progress in terms of algorithm design; whatever advances we have seen in the last few decades are a result of improvements in hardware. The concept of a Turing Test, which once seemed so reasonable to me, now appears so inadequate. In fact, what is the point, even, of building machines that imitate humans? What kind of humans do we try to imitate?

It turned out that my mistake was in making the assumption that Hofstadter was a computer scientist. But he's not. His interest has always been in cognitive science. Coming from that angle, one does not look at the biological or mechanical functioning of the brain, or attempt to create algorithms to imitate human thinking patterns. One studies how humans think purely in a theoretical way. No wonder nothing comes out of it -- the whole point about being human is that each one of us is utterly impossible to predict!

Labels: ,

Wednesday, May 21, 2008

iMac Memory Upgrade

We run all three of the major operating systems at home: Mac OS X on the iMac, Windows (XP) on the laptop, and Linux on my computer. There was another PC running Windows, but I recently took that one apart, so it's no longer in service. Someday I'd like to get another Mac desktop and a Macbook. In the meantime, these machines keep me busy enough.

A little while back, I upgraded the memory on my Linux box. The improvement on performance was astounding. When Jeff started whining about the iMac being slow, I thought I'd try the same trick.

I ordered the memory cards on-line late yesterday afternoon. The stuff was shipped yesterday evening and delivered this morning! It took all of five minutes to put the new memory cards into the iMac, including the two minutes I used to admire the inner workings of this impossibly slim machine. Jeff was distraught at the sight of his precious computer upside down, opened up and inert, but breathed a sign of relief when the computer booted up successfully after the mistreatment. I verified system information, and performed a few tasks. There was no discernable change. Maybe I'll notice the benefits later.

Labels:

Sunday, May 18, 2008

Sony Clié on Mac

I've had a Palm Pilot since 2001, and can't live without it. However, the two devices I've owned are both Sony Cliés, rather than actual products by Palm, from where the name Palm Pilot came. The Sony devices always felt much more refined to me, and I've never regretted choosing them over other similar choices. My first Clié, a PEG-S320, was running strong when it "retired" to make room for a better model, a PEG-TJ37. I still use my little TJ37 everyday. It will be replaced for sure, as soon as the Apple iPhone becomes available in Canada. In the meantime, it's served me well.

To perform the most important function of a Palm Pilot, HotSync, one needs to install the Palm Desktop on one's computer. Sony provides their clone of a Palm Desktop, which works fine, except that it is only for Windows. Sony has never been keen on Mac or Linux, and, as the Clié line was discontinued a few years ago, never will be.

On Linux, there exist a few clones of the Palm Desktop, with my favourite being J-Pilot. It isn't quite powerful enough, and used to require tinkering and additional kernel modules before it would work with a Sony Clié. Nevertheless, it is always fun playing with programs on Linux. Even though I could only do a HotSync via USB, not Wi-Fi, for years, I relied on J-Pilot to back up my Clié.

A few days ago, when I upgraded to Ubuntu 8.04 Hardy, I discovered, to my consternation, that J-Pilot stopped working because of a kernel bug. While I can still back up the Clié on my Win XP-based laptop, I was annoyed.

It then occurred to me, Why hadn't I thought about HotSyncing on our iMac? A little research on-line (mainly from the Wiki entry on Clié) shows that it is entirely possible. There is a product out there by Mark/Space called "The Missing Sync" which offers a desktop HotSync tool between Palm OS and Mac OS X. However, I could save myself the $40 charged by The Missing Sync by using the free Palm Desktop if I'm willing to do some delicate work. The only negative is that HotSync via Wi-Fi is not supported in Palm Desktop for Mac. This is an inconvenience, but not one worth spending $40 on, especially considering that my Clié's days are numbered.

I downloaded Palm Desktop for Mac and installed it on the iMac. After carefully following the instructions described by lensovet, I successfully performed the first HotSync between the Clié and the iMac.

An added advantage of HotSyncing on the Mac is that many applications, such as SplashID, offer a version for Mac OS X, but not one for Linux. Now I can backup not only the basic PIM data but also application data, something that I couldn't do on Linux before.

Labels:

Friday, May 9, 2008

Ubuntu 8.04 Again

Today when I booted up the PC, my wireless connection established successfully on the first try. I'll keep my fingers crossed that it will remain the case.

A new bug has popped up. When I hooked up my Sony Clie Palm Pilot to the USB port, and tried to do a HotSync using J-Pilot, the USB connection could not be made. The following message showed up in the system log file:

kernel: [37147.023105] visor: probe of 2-1:1.0 failed with error -5

It turns out that this is a bug (#10118) introduced in kernel 2.6.24 and fixed in kernel 2.6.25. Luckily, so far, it appears to affect only the "visor" module. Ubuntu 8.10 "Intrepid Ibex," scheduled for release in Oct, 2008, will include the new kernel. As there isn't a kernel patch available (I would have liked the opportunity to compile the kernel, something that I haven't done in a few years), I'll wait for Intrepid. In the meantime, I'll HotSync using my laptop while trying to see if there is another way to HotSync on Linux.

Labels:

Thursday, May 8, 2008

Ubuntu 8.04

I've been running Ubuntu (version 7.10 "Gutsy Gibbon") since the start of the year. As I've mentioned before, I'm extremely satisfied with the Ubuntu distribution. It's getting closer in appearance and usability to Windows and Mac OS X, while someone like me still gets to enjoy the flexibility that comes with a Linux system. Best of all, everything is free!

The beta version of a new release of Ubuntu, version 8.04 LTS "Hardy Heron," came out last month. Yesterday, after hesitating for a few minutes, I decided to go ahead and upgrade. The downloading took over four hours -- ouch! The upgrading another hour or so. The good news is afterwards, my system rebooted successfully, and at least superficially, everything looked to be in order. An immediate improvement showed up when I issued the command to shut down the system: my PC turned off automatically. You may ask, What's so special about that? Well, this power management feature is taken for granted by Windows and Mac users. Once upon a time, it also worked on my PC with an older distribution of Linux. Unfortunately, since Fedora Core 2, my computer would go through all the steps of the shut-down process except the very last one, which is turning off the power; I had to manually push the power button. It was not a big deal, just a minor pain. With this new Ubuntu distribution, I no longer need to push the button. Hooray!

My happiness was short-lived. Today, I tried to take advantage of the newly functional power management feature by configuring the computer to enter power saver mode after a certain idle period. The machine did go into the saver mode, however, it would not wake up no matter how much I screamed and yelled, and I was forced to do a hard reboot. Dreadful. I had to disable the power saver function.

Two other problems surfaced also.

One involved swapping the Ctrl and Caps Lock keys. Being a UNIX devotee, every time I come upon a new environment, I swap the left Ctrl key and the Caps Lock key. It was easily accomplished in Ubuntu Gutsy by going through the Gnome system configuration. In Hardy, the same steps swap the functionality of the keys, but every time the Caps Lock key is pressed, the Caps Lock LED light on the keyboard is turned on even though the Caps Lock key now acts as the Ctrl key. Some may say this is not a big deal, but it is. Aside from the annoyance of sensing the light going on from the corner of my eye each time I press Ctrl, I don't want to be confused by the LED light into thinking that I've got my caps locked. A search on the web shows many angry users in the same boat as me. A few workarounds were proposed. My own solution came from Ubuntu bug173350: I must combine the suggestions of MountainX and Jay Finger, but ignore those offered by Taylor Venable and Robert Lange.

The second problem is more serious; I've yet to figure out the condition under which it occurs. Yesterday, after my initial upgrade to Hardy and a reboot, my wireless connection was established automatically without a hitch. This morning, after turning on my computer, the wireless connection couldn't be established by NetworkManager. I know my wireless modem firmware is up-to-date, so I rebooted the system. This time, the wireless connection came up without a problem. Later, when my machine entered power saver mode, but had to be unplugged and restarted, the wireless connection failed to establish yet again. Once more, a reboot led to success. What does this mean? That I have to boot up twice each time? Nobody else seems to have run into this problem yet. I'll have to try a few more times to see exactly when this behaviour occurs.

Labels:

Sunday, April 27, 2008

IM on Linux

I've been playing with MSN Messenger clones the last little while. In the old days when I was an undergrad, the "talk" program on UNIX was popular among CS students. Since leaving university, I stopped using "talk". Sure, I know that lots of people use IM, and text-messaging is all the rage in certain parts of the world, but the phone has always been much more convenient.

Recently, after re-establishing contact with old high school friends back in China, I found out that many of them are enthusiastic IM users. All methods considered, it's a neat way of chatting with people in faraway places. I decided to join the rest of the world. First, I started with MSN Messenger on my Windows-based laptop -- no problem. Next, I downloaded Microsoft's Mac version, and installed it on the iMac -- not as good as the Windows version, but it works. Finally, Linux. I'm now using Ubuntu (it's the best Linux distribution I've ever had). A little on-line research suggested AMSN, an MSN clone. No troubles with installing it, and it appeared to work well until I tried to input Chinese characters: some characters won't show up. Turns out AMSN doesn't offer Asian languages support. All right, let's try the other MSN clone mentioned by Linux users, Pidgin. Well, this one is great, even better than MSN. It can combine several IM accounts (e.g. MSN, GoogleTalk, Yahoo), and it displays Chinese characters without a glitch. Excellent!

Another thing I did on my Linux box was to add Input Method support so I can switch easily between English and Chinese. It took some work, but I got it going. Later, I got the same working on the iMac and the laptop.

Labels:

Wednesday, January 9, 2008

Ubuntu

I've been using UNIX since 1990. A few years later, I joined the Red Hat Linux world. Over time, I've played with other Linux distributions: SuSE, Mandrake, etc., but Red Hat, which later morphed into Fedora, was my distro of choice.

A few days ago, in the process of upgrading my existing Fedora set, I ran into some problems, and decided to give Ubuntu a try. Am I glad I did. Everything is nicer about Ubuntu. The Wireless Network Manager is a particularly useful addition. All went well, and I had myself a spanking new Linux OS all set up -- except for the display. For some reason, even though my monitor is capable of up to 1280x1024, I was stuck with the painfully low resolution of 800x600.

After much poking around on the Net looking for answers, and trying nVidia's own driver for Linux (which didn't work at all as the driver causes the whole system to freeze), I noticed some entries in /var/log/Xorg.0.log:

(II) NV(0): VG800-2: Using default hsync range of 31.50-37.90 kHz
(II) NV(0): VG800-2: Using default vrefresh range of 50.00-70.00 Hz
(II) NV(0): Clock range: 12.00 to 350.00 MHz
[...]
(II) NV(0): Not using default mode "640x350" (vrefresh out of range)
[...]
(II) NV(0): Not using default mode "1024x768" (bad mode
clock/interlace/doublescan)
[...]
(II) NV(0): Not using default mode "1024x768" (hsync out of range)
[...]
(**) NV(0): *Default mode "800x600": 40.0 MHz, 37.9 kHz, 60.3 Hz

I know my monitor supports an hsync range of 30-82 kHz, and a vrefresh range of 50-75 Hz. It turns out that sometimes, the built-in driver for the video card has trouble obtaining these hardware values. One solution is to feed the values to the driver by adding in Xorg.conf these lines:

Option "HorizSync" "30-82"
Option "VertRefresh" "50-75"

A Ctrl-Alt-Backspace to restart X, but still, I got the 800x600 low resolution. This time, Xorg.0.log contained:

(WW) NV(0): Option "HorizSync" is not used
(WW) NV(0): Option "VertRefresh" is not used

Why not?! More searching on the web pointed out that in xorg.conf, I must use:

HorizSync 30-82
VertRefresh 50-75

I.e. without "Option" and the quotes. Now I did a Ctrl-Alt-Backspace to restart X, and voila! high resolution!!

Labels: