How To Replace Lexus RX 300 140A (or other inline) Fuse

Having managed to blow the 140A fuse in my Lexus RX 300 by hooking up the wrong battery (thanks Kragen!), I wrestled with how to replace it for quite a while. It’s complicated and I didn’t find any good explanations on the web, so I’m writing it up here:

The 140A fuse is bolted into the fuse box, so no matter how hard you try to pull it from the top it won’t come off. You’ll need to disassemble the fuse box, remove the bolts, and then replace it.

First disconnect your battery to prevent any accidental shorts or sparks.

The fuse box is attached to the body of the car with 2 bolts, and there are multiple latches connecting the top portion of the fuse box to the bottom portion. Remove the bolts, then insert a flat screw driver head into each latch, pushing it apart to let the latch release. The top of the fuse box lifts up, so you’ll see each latch get free and be able to move up. There are 4 or 5 latches all around, including one semi-hidden one where the fuse box lays against the body of the car. You’ll only be able to see it when you remove the bolts.

Once the latches are open, pull the top half of fuse box up and move it around to give yourself some room to maneuver. You’ll see lots of wires connected to it. You may want to open up the air filter to open up more.

Now you need to remove the top panel in the top half of the fuse box. This is where I wasted a lot of time – it just didn’t seem to want to come out.

The trick is to push it down and get it out from the bottom of the top part of the fuse box, not to try to pull it up. Look for the latches around the top of the panel where the 140A fuse is – there’ll be little openings that a flat screw driver head can fit through. Put the screw driver in and free up the latch so the top panel can slide down towards the bottom of the fuse box. Once you have all the latches freed the top panel comes out fairly easily.

Now all you have to do is to remove the blots that hold the fuse in place. Replace the fuse and put everything back as you found it. The trickiest part is getting the hidden latch back in place, but once you have that you’ll be set.

Good luck. It’s tricky, so hang in there. I spoke with several mechanics, including a couple of mechanics from the dealership, and none of them could give a good explanation – in particular, 2 of them told me the top piece of the panel would come out from the top, and that the housing would probably break when removing it. Not true – it comes out from the bottom, and there’s no need to break anything.

Please Join: Let’s Ban All But One Framework For Web Development

At first I thought the arguments justifying Apple’s ban of non objective-c development by claiming that resulting apps would be lower quality were absolutely moronic (and hence the people making the arguments either blinded by religion or morons). After all, it’s not like there isn’t a review process already in place. But the more I think about it the more I see where they’re coming from.

I think we should apply the same model to the Web . Imagine if we all had to use the same development environment and tools, and that there was a single entity who could decide, arbitrarily, if the thing we just spent months building should see the light of day or not. Wouldn’t that be awesome?

If the internet has proved anything, it is that a closed, tightly controlled environment based on uniformity of tools and development environment, and a benevolent master overseeing everything is the right way to go.

Effective Remote Collaboration with Wave and iChat

I’d tried to use Google Wave on several occasions as a tool for remote collaboration. All attempts had ended in various degrees of disaster, so I didn’t have high hopes for this round. In fact we tried Google Docs, Zoho Docs, and even Etherpad as alternatives first, with Etherpad being the most effective solution. That is, until we tried Wave again.

It turns out effective remote collaboration for document authoring requires two distinct things:

  • A shared document with:
    • near real-time updates for everyone
    • an indicator of who’s editing what and what’s recently changed
    • the ability to view and restore earlier versions
  • A separate communications side channel

Wave provides strong shared document capabilities, as well as very nice communication capabilities via chat.

The problem, however, is that the “chat” can and often does take place within the document. The “chat” quickly becomes graffiti all over your nicely formatted document, and you have expend serious effort cleaning it up .

The solution is to separate out the discussion or chat mechanism from the document completely. In this case we used iChat with voice and video for all participants. I’m no fan of video conferencing, but I have to admit even the video was useful – particularly to gauge the level of engagement of each person at any point in time.

It is also very useful, by the way, to have multiple screens available. The document can live on one screen while the talking heads occupy the other.

I was surprised at how effective the setup was. We will definitely be using this again in lieu of travel.

To Win, We Have To Do A Really Good Job

Quote from Steve Jobs, via Miguel de Icaza:

We have to let go of this notion that for [us] to win, [our purported competitor] has to lose. We have to embrace the notion that for [us] to win, [we] have to do a really good job. And if others are going to help us, that’s great. Because we need all the help we can get. And if we screw up and do not do a good job, it is not somebody else’s fault, it is our fault.

A Request for Android, Tim Bray, and Google

Mr. Bray has joined the empire of no evil, the Android group no less, and has been writing useful things about Android and Nexus One. He also has deep roots in the world of scripting, has been an advocate, and has been fearless in his experiments with languages new fangled and old.

So I’d like to make a request of Tim, one that I think would make a tremendous impact. Tim: please help bring scripting to Android development.

I know that a lot of people like Java and find the current development environment just dandy. Which is great. But many other reasonable people would prefer to keep their hands clean of Java and feel a greater degree of productivity using higher level languages.

Imagine a scenario where you could write a Python, Ruby, or Javascript script, get it onto the phone using a simple interface (eg. just upload it to a url), and have a native app. Imagine how many more people would be developing apps, and how much more quickly.

I’m looking for something like this: supported and documented as a standard part of the Android SDK, all reasonable APIs needed to develop native apps exposed as Javascript (and/or Python or Ruby, but Javascript is likely the widest reaching bet). And a reasonable packaging process that is only slight more complex than tar.

There is absolutely no reason this can’t be achieved. In fact projects like Appcelerator and PhoneGap have already made tremendous strides in this direction. All it takes is a believer to take the initiative and make it happen.

I feel Tim is that believer. And so I humbly submit, Mr. Bray, that the most important impact you could have on Android is to embed a love and support of scripting languages into the SDK. Pretty please.

How To Use curl To Upload a File While Limiting Bandwidth

For future reference:

I needed to simulate a slow connection for testing an HTTP file upload, time the results, and see how reliable it was. Turns out it’s all doable with curl using the right set of incantations. Here they are:


curl -F file=@/tmp/sample-large-image.jpg -F some_parameter=1027504 \
    -u myusername:mypassword -w "\nTIME: %{time_total}\n" \
    --limit-rate 10k http://somewebsite.com/api/upload/

What this is saying is:

  • Upload the file /tmp/sample-large-image.jpg . Note the “@” symbol – that’s what tells curl this his a file upload.
  • Set the parameter some_parameter to 1027504
  • Use HTTP basic auth to login, with user “myusername” and password “mypassword”
  • Include the word “TIME” followed by how long the upload took in the output
  • Limit the upload bandwidth to 10k bytes per second

curl continues to amaze with its flexibility.

12 Surefire Ways To Get Retweeted And Increase Traffic

Excuse the bullshit title, I’m just a little bit sad right now that my RSS feed is filled with “19 ways to do this” and “7 tricks of the other”. Are we ever going to move beyond this tripe or is this the confirmed future of the web?

Anyway, the point of this post, if there is any, is to reveal to you the secret of getting traffic to your blog and of adding twitter followers. Ready? Here it is:

You should write blog posts. And tweet.

There is no further secret that I’ve been able to figure out.

Take, for example, my recent post on How To Be A Good Participant On A Panel. It’s brilliant. Go read it. I’ll wait.

That post got tweeted a number of times, including by Dave McClure, one of the most interesting guys in the startup world, and it got a link from Simon Willison, whose link blog is the single best resource for finding all things of interest in the web/tech world.

I am pleased.

Now let me tell you about that blog post. It took about 45 seconds to write, and I came very close to not publishing it. It is, after all, just a little puff of air.

I have at other times written important, interesting, thought provoking masterpieces and even made some effort to get them noticed. Yet, as often as not, they fail to garner any interest.

My Become an Assassin post, however, still gets quite a bit of traffic (from people who actually want to become assassins).

Go figure.

Which is to say, there is no figuring it. When it comes to blogging or tweeting, the best policy is to not worry about it and just write whatever interests you, no matter how earth shattering or inconsequential it is. Resist the urge to censor yourself; just push publish.

How To Be A Good Participant On A Panel: Disagree

Mark Suster and Fred Wilson have both posted on the topic of being a good panelist. I’ll throw in the best advice I ever got on the topic (from Alex, who got it from someone else):

Disagree with other panelists.

A panel of people agreeing with each other is generally tremendously boring, and any topic that’s interesting enough to be brought up as a question to panel must have at least two sides that can be argued.

So argue the other side. Find someone else on the panel willing to go toe to toe with you, and disagree with what they say. The point is not to start a fight, but to create an engaging discussion. It’ll force you to think on your feet and it’ll entertain the audience.

Django: Using The Permission System

I was surprised at how little information I found on making use of Django’s permission system. Here are some quick notes on one way to use it:

Groups are groups of users. For example, you could define a group of users who have premium accounts, or have been verified in some way, or are somehow special:


from django.contrib.auth.models import Group, Permission
special_users = Group(name='Special Users')
special_users.save()
really_special_users = Group(name='Super Special Users')
really_special_users.save()

Now you have two groups defined and can define permissions for them. Django associates permissions with models (note: not model instances, but models). You’ll need to select a model to apply the permissions to, and do a small dance with “ContentType” to find that model’s content type:


from django.contrib.contenttypes.models import ContentType
somemodel_ct = ContentType.objects.get(app_label='myapp', model='somemodel')

can_view = Permission(name='Can View', codename='can_view_something',
                       content_type=somemodel_ct)
can_view.save()

can_modify = Permission(name='Can Modify', codename='can_modify_something',
                       content_type=somemodel_ct)
can_modify.save()

You’ve now defined two permissions and can associate them with your Groups:


special_users.permissions.add(can_view)
really_special_users.permissions = [can_view, can_modify]

Our groups and their associated permissions are ready to go. Now we just have to associate these permissions with users:


jack=User.objects.get(email='[email protected]')
jack.groups.add(special_users)

jill=User.objects.get(email='[email protected]')
jill.groups.add(really_special_users)

We’re all done. Now we can check the users’ permissions:


>>> jack.has_perm('myapp.can_view_something')
True
>>> jack.has_perm('myapp.can_modify_something')
False

>>> jill.has_perm('myapp.can_view_something')
True
>>> jill.has_perm('myapp.can_modify_something')
True

And to use it in your templates:


{% if perms.myapp.can_view_something %}
Here is something for you to see.
{% else %}
Can't show you!
{% endif %}

Hyper Competitive Sleep Losing Entrepreneurs?

I remarked to a friend that Mark Suster’s entrepreneurial roots show in his approach to being a VC – he’s come out of nowhere and in short order aggressively pushed himself into being one of the most relevant voices out there. He seems to be working a lot harder than the others guys, exactly as you’d expect an entrepreneur to be. Not exactly what you’d expect of a VC.

His blog is fantastic, and I quite often agree with his advice.

That’s why I found it odd that his The Best Entrepreneurs Are Hyper Competitive & Hate Losing struck such a dissonant chord with me.

Shuffling through the successful business people I know and trying to gauge whether they would be the type of people who are obsessed with winning, even in a family game of scrabble, I don’t come to a clear conclusion. I know hyper competitive people, but I also know plenty of people who are able to separate their business behavior from their personal behavior. And not obsess with beating the competition.

Maybe that’s what’s not sitting well with me – Mark’s definition of winning seems to be beating the competition.

Some of the best entrepreneurs I know don’t obsess with the competition. They obsess with their own behavior.

Here’s a contrived example – look at Apple. Do you see Jobs competing with the others in the industries he enters, or do you see him trying create the best possible product, distinctly separate from what his competitors are doing?

Frankly I have a hard time picturing a lot of these guys stressing out over scrabble or Guitar Hero.

Mark’s a very successful guy and his approach has certainly worked for him, but I disagree that you need to be obsessed with winning in the way that Mark describes it.

Look at this way: you could destroy all your competitors and still not win. You could also win without destroying any of your competitors.

First, pick the right game. Then, pay attention to playing that game as best it can be played. Competing may be an important tactical part of playing the game, but it’s probably not the part to obsess over.

Django-mptt: Tree Storage in Django: A Brief Overview

django-mptt is a library for storing tree oriented data using the Django ORM. It allows you to place your model instances into a tree structure and efficiently query for ancestors and children.

Here’s a brief tutorial on how to use it:

After installing, you’ll need to modify your model to include a “parent” field, and register it with mptt:

class Person(models.Model):
    contact   = models.ForeignKey( Contact, db_index=True )
    role      = models.CharField(max_length=20, blank=True)
    parent    = models.ForeignKey('self', null=True, blank=True, related_name='children')

    def __unicode__(self):
        return "Person: <%s>" % (self.contact.email, )

mptt.register(Person)

mptt dynamically adds fields to your model, so you’ll need to syncdb after you’ve added the parent attribute and the mptt.register call to your model.

The basics are fairly easy to use:

To move a node to the root of the tree, use move_to with a targe of None:

person1.move_to(None)
person1.save()

To make a node the child of another, set its parent:

person2.parent = person1
person2.save()

To find the children of a node, use the children field:

>>>person1.children.all()
[<Person: Person: <[email protected]>>, <Person: Person: <[email protected]>>]

Here’s a little snippet of code to setup a 15 node tree where each node has two child nodes:

[UPDATE] The code in this snippet is not correct – you have to save each node as you update it, then look it up again. You can’t modify a node, save it, then use the reference you already have for it. I’ll update the code when I get a chance

contacts = []
people = []
for n in range(15):
    c = mod.Contact(email="test" + str(n) + "@testing.com")
    c.save()
    contacts.append(c)
    p = mod.Person(contact=c)
    p.save()
    people.append(p)

people[0].move_to(None)  # Root
people[0].save()
for n in range(1,15):
    people[n].parent = people[(n-1)/2]
    people[n].save()

Now let’s take a look around:

>>>people[7].parent
<Person: Person: <[email protected]>>

>>>people[3].children.all()
[<Person: Person: <[email protected]>>, <Person: Person: <[email protected]>>]

Now let’s move things around a bit; we’ll take person3, which is 2 levels down from the root, and make it a direct child of the root:

>>>people[3].parent = people[0]
>>>people[3].save()

>>>people[0].children.all()
[<Person: Person: <[email protected]>> <Person: Person: <[email protected]>>, <Person: Person: <[email protected]>>]

And we can look at the ancestors of a given node:

people[14].get_ancestors()

Fantastic Mr. Fox: See It

I’m a big fan of Fantastic Mr. Fox. We just watched it again and it was a hit with everyone from the 2 year old to grandma.

The dialog an voice acting are excellent, and the animation is really refreshing. The story is smart and is different enough from your typical Disney fare to be a welcome change.

I recommend it, go see it.

Feels Like A New Stage Of The Web

I was doing some log analysis this morning and was struck by the variety of user agents accessing Xpenser. Quite a bit of mobile access with quite a variety of different browsers, as well as some more exotic items (various tablet PCs I don’t recognize, etc).

Then there’s the API access that’s been picking up quite significantly – in fact, I wouldn’t be surprised if it overtakes regular web access in a little while.

For quite a while the web we had a fairly uniform set of entry points – IE and FireFox for the most part, with a smattering of others thrown in. There is so much more variety now, and the variety is significant – for example, the difference between a mobile device and a desktop browser is much more significant than between IE and FF.

I’m hoping other modes of access become commonplace as well – boxee, tablet PCs, etc.

It feels like we’re at a transition point from uniformity to diversity again. This will mean pain the short term as we adjust, but a richer and more encompassing experience once we make it to the other side.

I’m looking forward to it.

Move Files Older Than X Days To Another Directory

Here’s a little script for finding files modified more than 7 days ago and moving them to another directory:


find . -type f -mtime +7 -print > /tmp/old_files.txt
cat /tmp/old_files.txt | while read line; do mv "$line" ../old_files ; done

Why Google Launched Google Public DNS

I’ve seen a bit of uninformed chatter on this, so let me add my own uninformed 2 cents:

First, I think Google actually does want the web to be faster and better. They recognize that the web is their platform and any improvement to it has an eventual benefit for them.

But Google DNS also provides other benefits. It’s true that there is an advertising opportunity in hijacking mis-typed domains and displaying ads against them, as OpenDNS does. This is potentially a large market – domain squatters, for example, make a tidy living doing something similar. I don’t think Google will actually do this. At least not anytime soon – it’d just be too creepy coming from Google.

What Google is really after is data. In particular, traffic and usage data.

By using Google DNS you effectively tell Google exactly what sites you’re visiting, when. Google gets access to your browsing patterns without having to install a toolbar or spyware on your computer.

How valuable would usage data be to Google? Knowing exactly what sites you visited, when, and how frequently?

Extremely valuable. They could use this information to develop refined models of your interests and behavior, and use it to better target ads to you. Nice.

However, their privacy policy states that they won’t do this.

What they will do is use the data to form a better model of the web.  They’ll know, for example, how popular sites really are and how much traffic they get. They’ll also be able to build user and browsing pattern models – eg. people who use facebook are also likely to use sites X, Y, and Z. They’ll use this data to improve search and advertising.

Look for Google to start offering its DNS services for free to internet provides, corporations, or anybody else with large amounts of users. Instead of paying ISPs for access to their usage logs, now they can get their own, and it’ll only cost them the overhead of running a large scale DNS service.

Peter Norvig’s message has been that more data trumps better algorithms. Google DNS is a beautiful way for Google to get a tremendous amount of data with very little intrusion while looking (and behaving) like saints.

How To List Files In A Package in Ubuntu

dpkg -L package-name

How To Enable Vi Syntax Highlighting In Ubuntu

Note to self, as I seem to need to do this on every new install:

Ubuntu ships with vim-tiny, which doesn’t support syntax highlighting. Do this:

sudo apt-get remove vim-tiny
sudo apt-get install vim
sudo vi /etc/vim/vimrc
( Remove the quote mark from the "syntax on" line, uncommenting it)

The Power of Stories In Shaping Views of Cultures

Impressive Ted Talk by Chimamanda Adichie on how stories, and in particular “single stories”, shape our views of cultures. Many parallels with how people typically see Iran.

A great quote from the talk: “The problem with stereotypes is not that they are untrue – it is that they are incomplete“.

On Niche News And Self Administered Blinders

I used to read the local newspaper. It was a fairly poor quality view of world events.

As news sources moved to the web I started to read a wider variety of sources – BBC, Le Monde, Haaretz, NY Times, Google News, various Iranian publications, and so forth. I had a better view.

As RSS took over I started to spend more time in Google Reader, with a larger number of sources. The sources, however, were hand-picked by me and the topics they covered were much more niche.

Sure, I had the feed from the NY Times, BBC, etc, but they just couldn’t compete with the blogs. I would only read them occasionally, and finally I gave up and removed them from my feed.

Nowadays I hang out on Twitter, to the detriment of Google Reader.

My sources of news are even more niche, even more hand-picked, and the news itself is headline-only.

It strikes me that I’ve lost something valuable here. I went from being exposed to a world view, much of which I didn’t agree with, to a series of very short, niche, hand-picked news sources.

I have unwittingly self-applied blinders.

An odd and disturbing trend. Nothing is stopping me from regaining the world view, other than my own choices. Yet I remain mostly blind.

How Interviewing Job Applicants Has Changed

I’m noticing how much the practice of finding a candidate and interviewing them has changed over the years.

First step is to look up the person on the web. Since I’m looking for a technical person I’m expecting a blog, contributions to open source projects, a twitter presence, etc. If I don’t find them, the candidate becomes less attractive.

If I do find a blog or twitter feed, I take some time to read them. You can tell a lot about a person with just a short overview – for example, even a delicious feed can give you a very good feel for how good someone is technically.

Hopefully the person has an open source project or two they’ve contributed. If so you can dive right into the code and get a good sense of their skills at work. I love this – you can see great coders almost immediately. And of course bad ones.

If the person is still looking good it’s time for a review of the resume and their linkedin profile.

By the time I followup with the person I have a very good sense of who this person is, what they’ve done in the past, and what their real-world coding looks like. The people who make it to the interview are so well filtered you almost can’t go wrong.

It’s very time consuming, but if you’re as fanatical about hiring good people as I am it’s worth it.

Contrast this with the old pile-o-resumes approach, or the recruiter-filter-by-keyword approach, and I think we’re in a much better place.

Now if I could only find a recruiter I could trust to do the technical deep dive I’ve described here and be ingenious enough to find diamonds in the rough I’d be a very happy man.

« Previous PageNext Page »