L.A. and San Diego

Fourth of September was Labor Day, so we (Pablo, Katja, Rossana, me) decided to use the long weekend and go to Los Angeles and San Diego. No trains in the U.S., so we took a flight to Long Beach and rented a car there. Spent some time at Venice Beach, where a lot of funny people do all sorts of funny things. Cruised around in Beverly Hills to finally reach our domicile for the night, the Budget Inn—it’s name says pretty much all about how it looked from outside. The room was okay though.

We didn’t stay long there, anyway. L.A. nightlife, here we come! I still don’t know whether the cab driver brought us to the club we actually wanted to go to, but it seemed he knew a lot about party, so we trusted him. The music there was better than I had expected. At one point, they forced people off the stage and did some photo and video shooting. No idea what exactly was going on or whom the fuzz was all about, but it must’ve been some sort of celebrity.

Oh, did I say “nightlife”? In fact, all bars, clubs, etc have to close at 2:00, so there’s no risk of having fun the whole night. Supermarkets and copy shops are still open at that time though.

After a yummy and way too big breakfast on Sunday, we made a short stop in Hollywood and continued driving to San Diego. This might seem surprising, but the Bristol was a little nicer than the Budget Inn.

Is it a sign of getting older when shopping Banana Republic (what a great name!) while others go to Forever 21? I hope not. At least I found a nice shirt there.

We went to Balboa Park and Coronado Island. Had the first few minutes of rain since I don’t know when. Nevertheless, had a great, relaxed time.

On Tuesday, we slowly made our way back to Los Angeles Airport, stopping at a few beaches to enjoy the sun. Eventually we returned the car and flew back. Nice trip.

Extreme Geeky Tidying Up: Sorting image colors with Python and Hilbert curves

There are levels of tidiness.

Tidy.
Very Tidy.
Totally Deranged Tidy.

Geeky Tidy.

After sharing these awesome pictures by the Swiss “artist” Ursus Wehrli with the world, Martin N. pointed out that there is still a severe issue with the Badewiese: People are not even sorted by the colors of their swimsuits! Adding to that, trees are placed in total chaos, not to speak of their leaves; clearly, there are tiny waves on the water; and one can almost see blades of grass not being sorted by size. Obviously, this picture needed further tidying up.


© Ursus Wehrli

Python to the rescue! 5 minutes, 10 lines, and half a beer later I had a program that would load the image, re-arrange its pixels, and save it again:

from PIL import Image

old = Image.open("tidy.jpg")
colors = old.getcolors(old.size[0] * old.size[1])
data = []
for count, color in colors:
    data.extend(count * [color])
data.sort()
new = Image.new('RGB', old.size)
new.putdata(data)
new.save("naive_tidy.png")

This yields the following picture:

So how was this “re-arrangement” performed? In a naïve approach, I just sorted the RGB values of the pixels, which is why there are many consecutive lines (of equal reds) with abrupt changes. Ordered, but far from being tidy.

Let’s try another color space and sort by HSV values—a smooth hue should look better, after all. So by adding

import colorsys

and changing one line to

data.sort(key=lambda rgb: colorsys.rgb_to_hsv(*rgb))

we get the following image:

More beautiful, but the red and white noise in the end doesn’t look tidy at all. We want a smooth transition through all given colors. Hilbert curves to the rescue! Found a ready-to-be-used Hilbert walk implementation, added

import hilbert

and changed the sorting once again to

data.sort(key=hilbert.Hilbert_to_int)

to get this image:

Mathematical computer science just made the world a little tidier.

To the North

After renting an awesome car—a black Hyundai Santa Fe—that would be big enough to let us sleep in it, Johanna and I continued our trip to the north. Again, we spent one night at one of Rick’s friends. This time it was Betsy in Chico, where we had actually already been two years ago. Still remember the huge steaks we got from the huge grill back then.

After that, we spent one night in Lassen Volcanic National Park. After a winter with over seven meters of snow at some places, they still have quite a lot of snow in the middle of summer! We hiked up above 3000 meters towards Lassen Peak, and we saw Bumpass Hell, a stinking but beautiful collection of mud pots and volcanic hot pools.

We continued our trip to the nice campground in McArthur-Burney Falls Memorial State Park and finally reached Lava Beds National Monument. Ages ago, huge streams of lava had created tube caves, when their top cooled and crusted while the inner part kept flowing.

Our companions on the road, among others: Johnny Cash (US), Pink Floyd, Muse (UK), Kruder & Dorfmeister (AT). And the Lowrider, of course.

Endless roads through forests. Desert. Lakes. Campfires. Togetherness. Happiness! :)

To the South

In the second week that Johanna was here, we took Rick’s car and went south. We made a quick stop in Monterey to stay at his friend Seth for one night. Love the uncomplicated way they arrange a place to sleep.

Seth is a really nice guy from the east coast, and he never “slowed down” to the Californian way of speaking—or maybe even living? We had great seafood right at the bay, and he introduced me to his collection of bluegrass music. Will eventually be handy when I maybe go to the big bluegrass festival at the end of September. Oh, and Seth’s house is pretty awesome as well!

We continued our trip on Highway 1 along the beautiful Pacific coast of California to finally reach San Luis Obispo, where Sandy, another friend of Rick, awaited us. Had a great time there, going to Santa Barbara, to the beach, and to the world-famous weekly San Luis Obispo Farmers Market. That tri-tip there was definitely worth the 30-minute queue!

And if you ever happen to be in San Luis Obispo, check out Novo—their tapas are simply great. If you don’t appreciate very spicy food though (Johanna rather doesn’t), just don’t try the chili peppers that come along, they are red and hot! (By the way, did I already mention I recently got tickets for this concert?)

I’ll probably not soon forget being locked in the bathroom for about an hour until the locksmith came to release me. :)

After very nice days with very nice people we returned back to Palo Alto to rent a car, pick up Rick and Heli from the airport, and continue our trip northwards. But more on that later.

If you want to know the details, here is our exact route.