Thursday, 29 September 2011

Accessing Library Folder in Mac OS X 10.7 (Lion)

By default you can't see your Library folder in Finder in Mac OS X 10.7, also known as Lion. Fortunately there are several ways to access it sill. My favourite is this one:

Holding down the Option key will show the “Library” directory as an option in the Finders Go menu. The other nice thing about the Go menu is that after you have accessed ~/Library on multiple occasions, it will start to appear in the “Recent Folders” submenu for easy repeat access.

Access library lion

Read more ways here.

Wednesday, 28 September 2011

Mac + Chrome + Facebook + Writing a Message = Crash

For the last couple of weeks, I couldn't write multi-line messages in Facebook on Google Chrome on Mac OS X. Some other web sites also had this problem. If I persisted in trying too much, then the browser tab would crash.

I solved this by deleting my Google Chrome Profile. I did it as follows:

1) I closed Google Chrome

2) I opened Terminal, by typing Terminal into Spotlight, and opening the "Top Hit".

3) In Terminal I typed the following (use copy + paste):

rm -rf ~/Library/Application\ Support/Google/Chrome/

4) I pressed the enter key

It took several seconds to complete. Once it finished, I opened Google Chrome, and it acted like it was opened for the first time. Facebook now lets me enter multi-line messages without crashing.

 

Tuesday, 20 September 2011

The McGurk Effect

It sounds like the name of a bad teen comedy. Actually it is the name of a phenomenon whereby what you see can affect what you hear.

It's rather cool.

 

Joke of the Day

Stick through to the end. You won't regret it.

http://www.youtube.com/watch?v=3GWJC7tlYck

 

Monday, 19 September 2011

Bad JavaScript Bug and typing

Johan thinks I was unfairly bashing untyped languages in general in this post.

Here's how I think JavaScript (or an alternative) language should best handle the following code:

var s = '7';
var num = s * 5;

The virtual machine should now know that s is of type String. The virtual machine should now halt and report an error. You shouldn't be able to multiple a String by 5. Unfortunately JavaScript automatically tries to turn the string into a number, thereby giving us 35.

The following code should be necessary:

var s = '7';
var num = parseInt(s)*5;

I suggest this not because of one JavaScript problem. I suggest it because I've seen JavaScript continue to negatively surprise programmers for 12 years.

Here's my favourite example of the mysterious workings of JavaScript:

var s = '7' + 0; // s is a string containing '70'
var t = '7' - 0; // t is a  number containing 7

The rumour is that Google will shortly be announcing a new language that runs in the browser as a replacement for JavaScript. AND runs on the server as a replacement for Java, C#, PHP, etc. In light of typing, it promises optional typing. I look forward to it.

 

 

Ebay…addictive, anarchic, and archaic

I'm caught up in the fun of selling stuff on eBay. But really, some of the people who use it…I advertised a bookshelf with the measurements and colour listed clearly in the product title. Someone asks, "how wide is it? what colour is it? how high is it?"

And the user interface…it is like the last decade of web application user interface improvements never happened!

I just hit a limit on how much I could sell. AFTER I spent 15 minutes creating a detailed listing for my iMac, eBay informs me I can't sell it for another 90 days because I've sold too many things in certain restricted categories.

So I'm going to have to sell my iMac the old-fashioned way. Even more old-fashioned, that is, than eBay.

 

Tuesday, 13 September 2011

Bad JavaScript Bug

Here's a great StackOverflow question that demonstrates how easy it is to create bizarre bugs in JavaScript.

Give me strongly-typed languages any day.

 

Tuesday, 6 September 2011

Java Newsletter

As a side-project, I started The Java Newsletter some time ago. The Java Newsletter is an email newsletter. Subscribers receive weekly tips on the Java programming language.

Sign up for the Java Newsletter here.

I read sometime ago that the world of blog-followers and RSS feed readers is somewhat a minority of Internet users. Most people - including developers - are best served via newsletters, directly in their email inbox. This got me thinking. Java is something I know well. There are millions of Java developers. I could write on enough Java topics to keep a weekly email list going for at least a year. It takes about an hour per week to create an article, test the code, proof-read it, and to send it. Why not give it a go?

I used Wufoo to create a simple sign-up form, for free.

I used MailChimp to manage the list of subscribers and to send the weekly email.

Topics come from Effective Java, StackOverflow, and my head.

I bought the javanewsletter.com domain for about $10 from GoDaddy.

I'm using an existing under-utilised "slice" I have at SliceHost to host the single-page website.

To promote the list, I've done little so far. I put a link on the Poker Copilot blog, on my Hacker News profile, and on my StackOverflow profile.

Currently I have 56 subscribers. I hope to see this list grow to thousands of subscribers within a year or so. I'm pretty sure I can achieve this if I'm diligent, persistent, and patient. I'm also keenly reading various articles on how to best run an email newsletter.

 

Monday, 5 September 2011

Throbbin' 84

Throbbin '84. That was the first album I got.

Throbbin84.jpg

For my 12th birthday, to go with my brand new Walkman.

2bb81cd4_sony-walkman-cassette-1.jpg

Friday, 2 September 2011

No TV. Not missing it. Yet.

I sold my television on Monday. It sat there unused except occasionally being hooked up to a computer when I had guests, in order to brutally subject them to a excruciating, long session of the best of my travel photos, going way back to 2004. Digital cameras have bequeathed us new types of suffering.

It's now Friday. I don't miss the television at all. Which makes me wonder why I bothered having one for so long. A living room with a television does look somewhat empty, as if to inform visitors that I live a deprived half-life. I think I need to put a plant where the television was. My plants, however, are all unpleasant to look at, suffering from extended bouts of low-water life, in soil that probably lost all nutrients long ago.

 

Selling on the eBay for the first time

So…for the first time ever I tried creating an auction on eBay. I'm surprised how cumbersome the process is…and buggy. I would have thought after all these years, eBay would have an excellent process. Is this what happens in a natural monopoly?

Here's what I'm selling.