Great article for learning JavaScript for existing programmers

Posted on June 4th, 2010 in JavaScript | 1 Comment »

I’ve been teaching JavaScript to a person with no programming experience and one with lots of programming experience in other languages. Both situations can be tough as one has to learn certain programing concepts (as well as how the web generally works) and the other must unlearn some that don’t apply here (like getting out of the strongly-typed world and appreciating the benefits of duck-typing).

Explaining various concepts in JS such as prototypes, closures, and even “literal” shorthand is interesting. I find the questions from both ends great—sometimes even challenging to explain which actually strengthens me as a JS developer. Still some concepts are hard to explain and the JavaScript Rhino book is too large and boring to dish out as homework. Then I stumbled across this page by Simon Willison which was written as a re-introduction to JavaScript but also makes a perfect condensed overview of what JS is for existing programmers: https://developer.mozilla.org/en/A_re-introduction_to_JavaScript. It even goes over a little history of the language and how to avoid nasty memory leaks in IE (circular references). Saves us a lot of time and explaining so that we can continue with more complex topics.

TeamViewer constantly crashing?

Posted on January 8th, 2010 in Uncategorized | No Comments »

If you suddendly find your TeamViewer crashing every time you open it simply delete it’s plist file and you’re good to go:

/Users/<YourName>/Library/Preferences/com.TeamViewer.settings.plist

Thanks to Christian Hägele (of TeamViewer) for the fix.

Bash argument unpacking

Posted on September 10th, 2009 in bash | No Comments »

I’m not a bash expert but my .bash_profile is packed with shortcut goodness to do all kinds of things on the quick. Most recently, I wondered how to fix up some of my function shortcuts to take any number of arguments (similar to this argument unpacking entry on how to do it in JavaScript and Ruby).

With a little Googling and IM’ing around to friends (thanks Bryan), my limited argument functions:

function sc {
        svn commit $1 $2 $3 $4 $5 $6               
}

now take an unlimited number of arguments:

function sc {
        svn commit $@               
}

Google Voice, Skype, the unrelenting phone industry, and a cool iPhone tip

Posted on July 31st, 2009 in iPhone | 3 Comments »

A new toy

Yesterday I finally got my free Google Voice account and honestly, I didn’t know much about it until I finally started using it except the fact that you get one phone number to rule them all™ (also known as one number that rings all your phones.)

Turns out there’s a smorgasbord of features including, automatic voicemail transcription, call recording, conferencing, per person / group personalized greetings, call blocking, and lastly, cheap international calling – all of which (besides the last feature) comes completely free. It’s such a future-thinking product that straps itself on our current outdated telephony architecture – with similar ideas having shifted whole industries in the past – that no wonder AT&T and Apple blocked it’s existence in the iPhone store – a greedy decision that reflects both the industry’s avarice and unwillingness to get with the times. I mean, how long can $.10 text messages really last?

But I digress. I have some friends and relatives in South Korea that I like to call and have been using Skype to be able to place international calls on the cheap. For $12.95 a month they offer unlimited calling to most of the world – unfortunately this doesn’t include mobiles (who uses land line these days, honestly?) Calling mobiles however, is still pretty cheap at $0.07 a minute (check your rates here) and using the handy dandy Skype iPhone app I can still place calls using my phone instead of being tied to a computer.

The downside (again because of contractual obligation probably forced on Apple by AT&T): you can only use Skype on the iPhone while connected to a wireless point, making it’s use limited to home, work, and the occasional wifi hotspot. Real big bummer. Additionally, you may deal with other annoyances such as a real call, text message, alert, or other process knocking you off the Skype app, and people sending you skype IM’s because they think you’re “online” when actually you just want to make a call.

A new solution

I’ve settled with these drawbacks and limitations for now (the proximity limitations being the biggest), hoping something will give eventually (and you know it has to because it’s 2009). Today for me it just did. Out comes Google Voice with so many new-fangled features you’ll feel like a VIP – the most important one for me: to place international calls on the cheap (0.6 cents for South Korean mobiles, check your rates.)

A slight problem

It’s interesting with all of Google’s technology and Google Voice’s ability to automatically transcribe your voicemails that there’s no audible method for dialing your friends. For example you can’t ring up your GV number and say “Dial Maria’s mobile” – you have to manually key in the 15+ digit international number and, considering most people’s short term memory capacity of seven, plus or minus two, you probably won’t know it either without referencing it. Now I’m almost 100% sure that this feature is coming and in the meantime you might be able to do the phone-app-to-contacts-app-switcheroony a couple times to key it in, but I propose an easier solution.

While the process isn’t as easy as two-clicks on an iPhone app, I’ve streamlined it so you might even say it’s easier than Skype app (at least more natural) after setting it up (providing you have a Google Voice account – you did request an invite didn’t you?) and you get the benefit of using it everywhere, not just when you’re connected to a wifi point.

Easy cheesy one click calling!

One click international calling with Google Voice on the iPhone

At work, I occasionally have to call in meetings which involves dialing a conference number and a long pin number to enter the “room”. I instantly wanted to automate this process so I only had to click one button to call the number, wait, and enter the pin. What’s more is that these meetings can go on for long amounts of time and considering I don’t have an unlimited phone plan, I wanted to use Skype, my laptop, and a very nice headset. After various attempts and endless minutes of online searching I found that this just wasn’t possible. Really. There is no pause option in Skype (some think it’s intentional.) Lucky for us the iPhone can. So some tinkering and a new address book entry later I have one click conferencing, my AT&T bill be damned:

1 (555) 555-5555 , 1234567#
(Note: the comma creates a two second delay.)

To place a call using your Google Voice account you call your Google Voice number via your phone. From there, after entering your four digit pin, you can access the menu where you can access Google information (GOOG411), check voicemail, place a call, or change your settings. After messing around with the timing I came up with this which works great.

The master equation:

(aaa) aaa-aaaa , pppp, 2, 011 bb cccccccccc#

Where:
a = your Google Voice number
p = your Google Voice pin number

b = country code of the number you’re dialing
c = local number of the number you’re dialing

Create a new entry under your contacts, save it under your favorites, and prepare to burn money at pennies a minute from anywhere (in the US at least).

Sure beats ATT&T’s $2.29 a minute.

Additional benefits:

  • It’s a regular phone call but you gain all the benefits of GV! Press *4 for example to start recording your conversation and *4 to stop. Your recording will be in your Google Voice web account.
  • If you have a 3Gs, the numbers you save can be dialed via Voice Control. I created custom phone labels “goog mobile” and “goog home”. To dial a person via Voice Control I say “Call Sara google mobile” (even though I say the extra ‘le’ it’s still a close enough match and works everytime.)
  • Because you’re making a real phone call you can use third party devices such as a bluetooth headset (something you can’t currently do with the Skype app) and you won’t be knocked off of your call by other processes.
  • I believe the sound quality is better than Skype and a fellow friend who uses GV agrees.

Drawbacks:

  • Even though it’s automated the whole dialing and connecting process takes about 30 seconds.
  • Because you’re making a real local call you’re using your regular minutes compared to Skype where you’re using none. If you’re like me though you have a ton including a dwindling number of roll over minutes that drop off after 12 months. Us’em before you lose’em!
  • Since you’re essentially storing your GV pin in your address book there are some security issues around that (don’t worry, no one you call can see your pin when you call them). In order for someone to actually access your voicemail they would need to be using your phone (or know how to spoof it’s number.) No one can access your GV homepage without knowing your Google password even if they knew your pin. I auto-lock my phone so it’s slightly less of an issue but just be sure not to use the same PIN for your phone, ATM, or other passwords. You’ve been warned!

Additional notes:

  • If you don’t know the country code check here.
  • Remember that you can always sync over changes from your computer’s address book if you don’t want to type so much on your phone or have a lot of new numbers to input.
  • There’s no easy way to add a space in a phone number field on the iPhone (except maybe through copy / paste) so if you want pretty numbers use your computer’s address book.

So that’s it, I hope it helps someone out!

Git: Ignore changes in a working tree file

Posted on May 21st, 2009 in git | 3 Comments »

Lately, I’ve transferred all my repos over from Subversion to Git and have become familiar enough with the Git SVN bindings to even work on my work projects in Git while still being able to check-in as a regular SVN user.

I’ve found that some usual stuff Subversion would ignore in projects Git doesn’t. The Git exclude file doesn’t work here since these are files being tracked in the working tree that are just specific to your instance. After digging around, I found the proper command to ignore these files:

# ignore changes in a working tree file
git update-index --assume-unchanged .classpath