Reset Prius Maintenance Light

June 23rd, 2013

It’s probably in the manual somewhere but Google is so much faster. The Prius Chat forum had the answer:

  1. Press start (ignition) button
  2. Make sure your odometer displays “ODO” and not “TRIP”
  3. Press and hold the ODO trip reset button
  4. Press start button to turn car off
  5. Press start button (again) to start car
  6. Hold the ODO button in until all the flashing lines on the odometer go away and the mileage returns and the “maintenance” light stops flashing

 

Sync Google and iCloud contacts

October 6th, 2012

I was trying to get FaceTime on my macbook to load up all the contacts from my iPhone via iCloud. I enabled iCloud contact sync on my phone and logged in on the macbook but only a dozen-ish contacts appeared on laptop.

The problem was that  I sync all contacts via Google (Exchange) and my phone.

The fix:

“Synchronize your Gmail contacts to your Mac by enabling the “Synchronize with Google” option within your Mac Address Book using the ‘On My Mac’ database. This will create a local copy on your Mac of all of your Gmail contact”

Of course, I found this on the Google forums and not on the Apple ones. Read into that what you will.

iPhone 4S Storing Numbers in Wrong Format

October 26th, 2011

My new Verizon iPhone 4S was showing incoming SMS messages with different numbers than incoming calls. I save my contacts with +1 (NNN) NNN-NNNN format so that I can call when roaming abroad without adding the US country code prefix. But SMS messages were coming in (NNN) NNN-NNNN which the phone didn’t match to the +1 version I’ve stored and I noticed that when I stored new numbers they were an odd NNNNNNNNNN form.

Anyway, I found a post that explained how to force an update from Verizon on the Apple Forum. It says:

  1. Open the Phone and dial *228. This is a Verizon over-the-air programming number.
  2. When the system answer press 1 for “Program or activate your phone”
  3. Wait for the call to disconnect. You should get a prompt stating something like, “Settings updated.”
  4. Open the Task Manager and kill the Phone, Message, and Contacts Applications
  5. Wait a few minutes (I waited 3 just to be extra safe)
  6. Open the Message App to verify the fix.

This fixed it.

My old iPhone was AT&T and I set up my new 4S by restoring from the old data. I’m not sure if that caused this problem but I’m glad it went away.

Scumbag Windows 7 where is my disk space?

September 12th, 2011

I dual boot my laptop between Ubuntu and Win7. The Win7 partition began at 25GB whereas Ubuntu is 15GB. Win7 used up all its space so I increased the partition size. Then again and again. Now it has 40GB and just filled it up again.

I tried using disk cleanup and deleting all temporary files. That freed up about 15MB. Then I found an article explaining that hibernate in Win7 stores off a file called hiberfil.sys that can grow and grow in size. Here is how to get rid of it:

  1. run command prompt as Administrator (right-click on its icon)
  2. type in powercfg.exe -h off
  3. reboot
  4. boom! Have 7 GB back

My next laptop will be a Mac.

Easy jailbreak your iPhone

September 8th, 2010

With www.jailbreakme.com jail breaking an iPhone suddenly became too easy not to do. I’ve jail broken iPhones before with ultrasn0w but this is too simple. Just go to that site on your pre-4.0.1 iPhone, slide your finger across the screen and you’re done.

Simple! But what next?

Your new app installer is called “Cydia”. It’ll be on your home screen. Go play with Cydia and install some apps. Not all are free and none of them are approved by Apple. Now that you can install anything on your iPhone you need to be a little more cautious. It is no different from downloading apps from the web and installing them on your computer — the code is not vetted by any single governing body and you need to be thoughtful as to what you’re installing.

First thing is to fix the root password. iPhones have a default root password of alpine. So install “mobile terminal”, open it and type “passwd” to change your password. Alternatively, connect to your home wifi network, install openssh on your iPhone then go to Settings  -> WiFi and take note of your IP address. Then from your laptop ssh into your iPhone and change your password with the passwd command. Also change the “mobile” account password with “passwd mobile”.

Next install the PDF Patch fix (since that security vulnerability let you jailbreak your iPhone via jailbreakme.com in the first place).

Now follow these simple steps to unlock your iPhone so you can use it on different networks.

Finally, go have fun. Change themes, message alert tones and customize to your heart’s content. When new versions of IOS come out be sure to download and jailbreak before you install them to your device. Don’t just click “install” in iTunes.

Shuffles & randoms

January 20th, 2010

I was asked a question about shuffling yesterday which got me thinking. How do you write an algorithm to truly shuffle a deck of cards without any bias?

There are a couple of well-known algorithms to do this, both popularized by Donald Knuth. At a very abstract high-level they are:

  1. generate a random number for each card in the deck then sort the cards by number. If two cards are assigned the same number then try again;
  2. go through the deck, taking each card in turn and swap it with some random position in the deck.

Clearly #1 could take a longer time to run since you’ve got to sort cards and deal with clashes. Although with only 52 cards in a deck you are probably not too worried about algorithmic complexity.

#2 looks good on the surface but there are a few gotchas to be aware of. With a deeper mathematical analysis you can see why. The first is that if you swap cards with any position in the pack you will not get an even distribution with shuffles. This is because you’ve written an algorithm that has n^n execution paths and there are only n! permutations. Using the wikipedia example consider just 3 cards: your algorithm can produce 3^3 = 27 outcomes but there are only 6 permutations for shuffling. You cannot fit 27 into 6 so there must be some outcomes from your algorithm that are more likely (see pigeonhole principal).

The solution is to swap with the portion of the pack that has not yet been swapped with.

Wikipedia has a clear article on shuffling and implementations with further details on the impact of using the mod operator with random numbers (again, the space of randoms being generated then having mod applied is not an even distribution). A final note is that you need to seed your random number generator or it’ll be pseudo-random. Or better yet use random.org

Location based services for mobiles

January 8th, 2010

Location based services have been around for a number of years in the research community. They were always fun to build and excellent research vehicles but needed something to change before hitting the streets. Well, now we’re beginning to carry GPS enabled devices these services have hit the mainstream. I regularly use Yelp and Around Me on the iPhone to find local restaurants, gas stations, and coffee shops. The integration with the maps application is a fantastic coupling. Now Google have released their search services with the “Near me now” service (iPhone and Andriod in US only).

Location data for these applications is usually derived from GPS readings but it is not limited to that. You can use wifi spotting, video capture, parse user calendars or discover location by inference (I am near Alice and Alice knows where she is so I can find where I am). But in practice are these other inputs really required? Or are they all part of a larger model of the real world?

Location based services are a manifestation of pervasive computing in the real world. Next will come more complex context aware services with social aspects and recommendations. I’ve oft heard the question “who will pay for the infrastructure for pervasive computing?”. I think the answer is still “we will” but now you can add “and already are”.

Installing dd-wrt on a Linksys WRT160N-RM v.3

December 8th, 2009

So I cheaped out and bought a refurbished Linksys WRT160N from Amazon for $28. Great price for a 802.11n enabled router (most are in the $100 range) but it kept dropping wifi connections, slowing up and refusing to respond. Wired connections were fine so I suspected a dodgy radio. Linksys support couldn’t fix the wifi issues so I was about to send it back when I decided to wipe the Linksys firmware and flash dd-wrt to it. The router wasn’t doing much anyhow.

The latest version of dd-wrt supports the WRT160N v.3 router. It is easy to install via the router’s web admin interface and rather than repeat myself here I’ve updated the dd-wrt community wiki page with the step-by-step instructions.

Note: when you search the dd-wrt router database it’ll give you back three different bin files to choose from. You only need one of those to kick off: dd-wrt.v24-13309_NEWD-2_K2.6_mini_wrt160nv3.bin AKA “mini” is the basic dd-wrt firmware that I used. It has more than enough features to keep most users happy.

My router has been up and running with dd-wrt for the last 4h29m without any problems and it feels faster (not sure if that is psychological). The best part is that the nerd in me is now super excited to have a working, fully featured, Linux-based router in the office.

Construct at University of Colorado at Boulder

December 7th, 2009

I’ve been talking with faculty staff at CU CSCI about the kind of work they’re doing and to see if there is any projects that we might collaborate on. After a chat with Katie Siek we decided that the most efficient way to introduce my research from UCD and Glasgow was to drop by and give a presentation.

For the opening I talked a little about the data binding technologies we developed at Strathclyde. These “type projection” systems provide a safe and extremely efficient mechanism for computing over semistructured data sources (if you’ve ever used JAXB from Sun they’re kind of similar). I skipped pretty quickly over that, hopefully didn’t loose too many listeners, and jumped into Construct.

Construct is our open-source community platform for Pervasive Computing. It is a middleware that provides the plumbing for developers of Pervasive or Ubiquitous systems. Rather than spend time writing code for management of services and data flow across the network developers can concentrate on the problem domain for their specific project.

I was invited back to talk with Ric Han‘s group early January.

[slides]

Tiddlywiki

November 2nd, 2009

I’m a note writer.

I’ve got Google docs full of notes, dropbox notes, iPhone notes, plain text files for GTD, and inked back-of-envelopes everywhere. Or at least, I did.

After a pointer from a friend and colleague I decided to consolidate and digitize my notes using TiddlyWiki. TiddlyWiki is a personal wiki wrapped up in a single web page. Because key text automatically hyperlinks (these are called wikiwords) a TiddlyWiki can be thought of as a “non-linear notepad”. You don’t write or read from top to bottom but rather jump from “tiddler” to tiddler.

A tiddler is a block of text or a given topic. Collectively they form your TiddlyWiki. Let me try explain better with my Getting Things Done Tiddler. I’ve got a GTD note (a tiddler) in my TiddlyWiki that links to three other notes: ToDo, Done, and Waiting. Clicking on any of these three opens a new note with a list of either “todos”, “done stuff” or “waiting on something”. Within each of these are further links to notes on tasks in my every day life.

TiddlyWiki is immediately useful to anyone with a modicum of HTML knowledge. If you know what <a href means then you can easily learn how to create your own TIddlyWiki in about an hour. It is well worth the effort.