Runcible Blog

removing dupes

I came across a post about the quickest way to remove duplicates from a python list. This particular problem seems to crop up often, and I've noticed a huge slow down when doing something like:

new_list = []
for i in old_list:
    if i not in new_list:
        new_list.append(i)
I never took the time to benchmark different techniques like Peter did, though. It's interesting to see that:
{}.fromkeys(seq).keys()
is the fastest method, but only a hair faster than the conceptually simpler:
list(set(seq))

Most of the time, I use list(set(seq)) or just leave the sequence as a set without turning it back into a list. Also, the results present a strong argument against preserving order: even the fastest order-preserving method took 2.5 times as long as the quickest non-order-preserving method.

good to know.


wonderful los lobos tune

I just heard this one today. You'd have to hear it to appreciate it, though:


Take My Hand
Girl you know, you can't go on this way
Night after night, day after every day
Whisper to me, what's in your aching heart
This love you need is not very far
Baby dry the tears from your eyes
And take my hand as we walk into the night

A soul on fire and a touch that's cold
Seems to me that's all you've ever known
Desperately looking for something that's real
Hard to find is the love that can heal
Baby dry the tears from your eyes
And take my hand as we walk into the night
Tender are the dreams
That we try so hard to hide, so deep inside

I don't know why you go on this way
Night after night, and about every day
Tell to me, the secrets only a girl could know
How much to feel and just how much to show
Baby dry the tears from your eyes
And take my hand as we walk into the night


New Spam

Hot off the presses:

From: jvwmjteewxuh@affv.nu
Subject: spending time with you
Date: August 3, 2006 9:39:27 PM EDT
Reply-To: jvwmjteewxuh@affv.nu

Dear friend,
I found your picture on one of the websites, can we talk to 
each other? I maight be coming to your place in few weeks.
This would beb a great opportunity to meet each other.
Btw, I am a woman. I am 25. Drop me a aline at pd@summerdayzz.com


Siting

This is the second day in a row that I walked past girl-with-no-eyebrows. I should take a picture next time.