cross site maddness

August 12th, 2010

After adding the new fad of like/addthis widgetry (collectively social widgets) to citytree, there is now a bug with the jquery using image display – so whenever you press any zoomable image you get a pretty popup dialog that everyone likes with this message (courtesy of the amazing firebug):


Permission denied for (document.domain has not been set) to get property Window.nodeType from (document.domain=).

Passer by, I crowd source you! do you know how to fix this??

thx bye

life is technical

May 25th, 2010

just a few thoughts I wanted to get to paper, funny that this is what I think of as paper. Here goes:

bpython is the new ipython – well, not quite, actually bpython has a much more modest scope, but it is available on the major linux distributions and is nicer looking then ipython (and that’s saying something). Basically it’s a better console then the default python, gives you syntax highlighting, F2 to view source of current function you are typing, intellisense like completion (based on dynamic introspection and not static analysis of course), and the author’s favorite is pastebin at your fingertips, haven’t tried that yet.

Back to learning haskell, bit by bit, every train ride I progress a little thanks to 3G connection of my N900 (which I have not installed ghci on yet though it is available), and my small PC-Z1 is now used as a haskell learning environment. All thanks to the Real World Haskell book which is an awesome idea, book with inline comments (I think I saw it first done on django project docs?). Plan on buying it once I finish (or getting someone to buy it for me :)

Back to learning RRLP I hope, as part of the OpenBTS project, maybe as a joint effort with OpenBSC – will update gnuradio wiki eventually with the current stuff (which is available in the latest git repo from sourceforge for OpenBTS).

Haiku’s strace

May 12th, 2010

Haiku is out, 9 years in the making by copyright, and all I can say is sweet strace.

running in qemu

Deferred based Tasks

April 9th, 2010

I’m not sure how to call this, but this is basically the method of doing multiple things “simultaneously” or more accurately having outstanding operations with a single thread that we used last year in robocup 2009. The example uses predetermined wait actions but imagine these actions are actually “turn head”, “walk forward 1 meter” etc. Last night a conversation led me to write this almost self contained example.

from twisted.internet.defer import Deferred

class Scheduler:
    def __init__(self):
        self.activities = []
        self.clock = 0

    def wait(self, t):
        """ example action - a real world action would start an actual
        action, here we simply record a time when this action should end
        and the deferred we give to the user """
        d = Deferred()
        self.activities.append((self.clock + t, d))
        return d

    def print_activities(self):
        print "%.2f: %s" % (self.clock, ','.join(
            '%.2f, %s' % (et, d2str(d)) for et, d in self.activities))

    def loop(self):
        """ main loop for test. The real loop (burst) actually checks
        for deferred completion, but here we record the time it will
        complete in activities and simply skip to this time directly
        """
        while self.clock < 20:
            deleted = []
            #print_activities()
            self.clock = min(et for et, d in self.activities) # progress time
            for i in xrange(len(self.activities)):
                endt, d = self.activities[i]
                if endt >= self.clock:
                    #print "calling %s" % (d2str(d))
                    d.callback(None)
                    deleted.append(i)
            for i in reversed(deleted):
                del self.activities[i]

sched = Scheduler()

def d2str(d):
    f = d.callbacks[1][0][0]
    return '%s.%s' % (f.im_class.__name__, f.im_func.func_name)

class Task:
    _name = 'unnamed'
    def __init__(self):
        self._active = False
        self._done_tasks = []
        self._act_count = 0
    def onDone(self, task):
        self._done_tasks.append(task)
    def fire(self, _ignored_=None):
        """ do the action if we are not already doing it """
        if self._active: return
        self._active = True
        d = self.act()
        d.addCallback(self._resetActive)
        for t in self._done_tasks:
            d.addCallback(t.fire)
    def act(self):
        self._act_count += 1
        print "%s: %s start" % (self._name, self._act_count)
        return self._act()
    def _act(self):
        raise NotImplementedError
    def _resetActive(self, _ignored_):
        print "%s: %s done" % (self._name, self._act_count)
        self._active = False

class Task1(Task):
    _name = 'task1'
    def _act(self):
        return sched.wait(1.0)

class Task2(Task):
    _name = 'task2'
    def _act(self):
        return sched.wait(1.0)

class Task3(Task):
    _name = 'task3'
    def _act(self):
        return sched.wait(1.0)

def test():
    t1 = Task1()
    t2 = Task2()
    t3 = Task3()
    t1.onDone(t2)
    t2.onDone(t3)
    t2.onDone(t1)
    t3.onDone(t2)
    t1.fire()

if __name__ == '__main__':
    test()
    sched.loop()

* To be self contained it would need to define Deferred itself, which is not hard since I’m using very few features, but just apt-get install python-twisted or yum install python-twisted-core would get you twisted which is a very capable library to know.

Evil Pigeons

January 31st, 2010

My group’s game in globalgamejam 2010 is Evil Pigeons. Simon Reisman was the Producer, Game Designer and did Sounds, Ori Peleg did the Small Assets,  Omer Nainudel did the Background, and I did the Programming. Really cool work and experience, writing a game in 48 hours (even less), except when you are looking for a bug like pygame.mixer loading sounds from non existent files without complaining. But shit happens, which is what the game is about; Get it from Global Game Jam, from saymoo, or get the sources at github.

Screenshot from our game, a two player non symmetric game; as the pigeon master, you try to send the pigeons to do their business over the car, you can use shift+num to distract the shooter. As the shooter, it's your standard shooting game, except you can't hit the sitting pigeons.

Happy new year!

January 2nd, 2010

After the last post I had a few nice things going. Visited tokyohackerspace, where I played with the chibi and got one for my “”troubles”". I’m now planning on getting another one and addon adxl345 boards to develop two things: an anti bicycle theft device and juggling balls that teach juggling. Not sure about the order, since the later is way cooler, but the former is very usable considering the rate of stolen bicycle in my personal history.
Also did a three day tour going west of tokyo, didn’t reach all the way to the tip but visited Himeji-jo (jo means castle), great karateka flashback, Kobe, including the earthquake museum, Osaka, half a day spent in den-den and got me a hhk which is my bday present from my brother and his wife, and also saw Osaka-jo and read the long history of this country that keeps reminding me of the mote in gods eye. Well, just the fighting part and fast development part. I guess they still have two arms. Finally visited Kyoto, but it was already the 29th of december so most museums and the castle were closed, to my disappointment. Returned to Tokyo, spent 21$ to see a avatar in 3d (3d is awesome), the next day found out I couldn’t take out money using my visa, some interneting revealed I hit the monthly limit of 19000 nis. Personal record! Which brings us to the What’s next department.
What’s next? I still have a few more days here. I’m not going to ski because it would be idiotic considering my funds and besides I’m not enthused.. strike that, well I am, but next time. So I have 4 days of unlimited train travel over JP and I intend to use them, at least to see nikko (a must), and probably see how far north I can go on local/rapid trains in one day. I do love to use my gps.
Then I’m going back to Oakland and then back home. That raises two issues, that of where to stay and what to do. .. . You don’t think I know, do you?

Thanks for reaching the end of my travel blog. I enjoyed writing some of the posts, and reading all of your comments, but this blog will be going back to it’s original purpose, that of writing obscure technical monologues. Have a wonderful linux-on-the-desktop year!

Miss Home

December 22nd, 2009

Tokyo is cool, but I want to go home. Ok, the language barrier is very annoying. I spent 5 days trying to get better in it – of course that’s childish, also cost me 600$ , for 15 hours of private lessons. Wakarimasen. The lessons were taken in MLC, recommended, but highly priced, and tacky 90′s style website – but you don’t pay them for web know how.

Only been around Tokyo (東京) so far – Asakusa, Imperial gardens walls (tip: don’t go on Monday, the gardens are closed. another tip:  RTFM), Ginza, Ueno, Harajuku, Shinjuku, Meguru (for MLC) and of course electric town Akihabara, been there like 4 times by now, and actually bought something (sharp’s relatively new pc-z1). That’s about 8 out of 23 wards, or ku’s, which make up the huge monstrosity known as Tokyo.

Went to a temple during the 47 ronin memorial day, people sure burn a lot of incense around here. But above all, I’ve been spending time in my room watching movies (Avatar is recommended, Afro samurai resurrection is not) and trying to decide what to do. It’s bloody cold – that’s what I hate most. Going to try and find some place to ice skate. There are excellent places to ski, so I’ve read, but I think if I’m cold now I should probably do this some other time when I’m better equipped. Also, it will probably cost a bundle (I’ll have to rent everything). I really have no idea why I came here. Pictures? go google tokyo. I have no pictures with me in them anyhow, so it won’t make much difference. Oh, I have one guy who I met in the 47 ronin temple, really cool marine living in tokyo since may, of course I lost the notebook I wrote down his facebook contact on the same day, so except for first name Christopher I have no clue how to find him (born on the year of the dragon I think – still not enough to find in facebook). So I give you the back of Christopher, if I meet him again I promise a face will be documented (or I’ll get a tatoo of his facebook / email address – I remember it’s @yahoo.com, big help), and some incense for background, and finally another nice picture I found:

For the next weeks until I leave I have some guidelines, but I think I’ll try to spend some time in a local hackerspace (called tokyohackerspace weirdly enough) and work on some stuff I want to get done. Konnichiwa y’all.

3-Tatami

December 7th, 2009

Hello from Tokyo!

I am staying in a 3-tatami room right now. To illustrate what that means, see the following video:

For 3000yen (~33$) you get this room with ac, electricity, coat hangers, mattress (comfortable), tv, really big window (ok, compared to the room), and free wireless or provided computer internet. Download speed of 1.3MB/sec for ubuntu updates (jp.archive.ubuntu.com) – I like! and this is over a wireless link in some hotel, so I expect it’s the norm rather then the exception.

Went to a restaurant yesterday, got oden, miso soup and a bowl of rice, total 270+380=650yen. And a free beer from the nice patron. After spending the flight reading about kata and how the Japanese are fucked up pursuing roles for doing everything, they call these roles/recipes for behavior/dictates kata, I’ve come to expect such behavior, but it is still exceptional.

Plans are a few, but really I don’t expect that much. I want to see tokyo, see kyoto and ride the shinkensen (bullet train). I want to see the markets, the temples, the fish market specifically, even if it requires waking up before 5am. Actually, if I take advantage of the jet lag that should be easy (woke up 3am today). And learn more japanese in the process.

You can see "O-de-n" written in large letters on the sign with pink neon. Too bad I didn't notice this when I came in, but the proprietor was very accomodating, gave me a menu (I think itsu?) with pictures and text that actually said "from wikipedia" :) some pointing and I got fed.

You can see "O-de-n" written in large letters on the sign with pink neon. Too bad I didn't notice this when I came in, but the proprietor was very accomodating, gave me a menu (I think itsu?) with pictures and text that actually said "from wikipedia" :) some pointing and I got fed.

First day Restaurant

Upper east coast, Queensland

November 24th, 2009

I’m back in Brisbane, tried writing this in Cairns but got stuck in the picture sorting phase. Too many pictures (we pooled all the pictures from 11 people on fraser island..). My solution – start with very few pictures for now. Later I’ll try sorting them out. Despite a picture being worth a thousand words, sorting a thousand pictures takes more time then writing a thousand words summarizing those pictures (or something like that, and this is 768 words).

So what have I been up to? strangely enough, I basically followed my plan. I started at Fraser island, from which I have the rabi picture below, that was pretty cool, of course I ended up with a german speaking car, at least I can count in german now (and for the next week probably, until I forget it). Also, I have several pictures of me semi drunk attempting to look happy (no, they will not be revealed!). I did have some fun there, it is a beautiful place, and in my taste not too touristed. It was a self drive, which means 11 people with negligble experience on a 4×4 vehicle get to drive it for 3 days, free excercise included, i.e. car pushing. I got the nickname “mother” (I was the oldest guy there, but not by far), since I tended to wake everyone up early and try to get on with the day.

After that I discovered I couldn’t find my laptop charger! my world collapsed in seconds. I blacked out. After recovering in the hospital.. well no, I actually survived that, but carrying a 3 kg non working laptop is got to be a new form of torture. I managed to buy a universal transformer for it in Cairns, but I’m getting ahead. After Fraser I continued to Hervey bay, and from there to Airlie beach.

Airlie is the launching point for the Whitsundays, which is the common but not formal name for a group of islands in the south of the great barrier reef that Captain Hook believed he discovered on a Sunday, but apparently he had a calendarial error, so they are actually the whitmondays! I sailed aboard the British Defender for two days, it is an awesome yacht that tilts on the side by design when it is under full sail (single mast, two sails, front and rear, rear bigger and easier to change the heading of). The boat is 20 years old, built for racing around the world. Fun crew, great people. After that I stayed in Airlie two days more then I intended, waiting for what was supposed to be the computer’s charger (too bad video phones are not common yet – it is very hard to describe a laptop charger by phone to people who don’t use computers often), and turned out to be my *other* (touchbook) computer’s charger).

So I continued laptop-power-less, and had to go directly to Cairns, to the jewel of the trip, a most amazing three day 11 dives trip, with a chef on board – I never ate so good. Of course it cost accordingly, but well worth it. I only had 3 days remaining before my flight back to Brisbane (which was this morning), those consisted of: randomly going around cairns (1 day), going to Kuranda via sky-rail and back via train (1-day, met the first Japanese person! strangely, instead of email she offered a skype username, maybe that is more common in japan?) and lastely yesterday did a tour with a 4×4 car, that was a little mellow but pretty cool, across the Atherton tablelands. So I didn’t go to cooktown/port douglas/daintree/cape tribulation, but I’m pretty confident the rain forest in the tablelands (the area between the great dividing range and the coast mountain ranges) has the same rain forest. It is beyond my current capacity as a photographer to take good pictures of the rainforest, one interesting fact – rainforest is generally an area with at least 4.5m of rain, and a very small amount of sunlight for vegetation. There is a type of tree that requires more sunlight but likes the rain just as much, a type of pine I forget the name of, which as a result lingers and thus marks the fringes of the rainforest – a sort of edge detector.

About the pictures: The first three are from Fraser island, the next two are from the British Defender taken around the Whitsunday islands, and the next are from the pro dive trip in the Great Barrier Reef (specifically it was Flynn reef and another one near it).

Plans ahoy

November 5th, 2009

The future as planned: departing tomorrow by greyhound to Rainbow beach, going to Fraser island the day after that for a self drive tour of two days, after that greyhound again airlee beach, yacht of two days in Whitsunday Islands, then north by greyhound to mission beach, 1 day there, then north further to Cairns, Pro Dive sail with diving in the reef, then a few undefined days hopefully in Daintree Rain Forest and Cape Tribulation, followed by a return by plane to Brisbane, few days there, return by plane to Sydney, final days there, and return to San Francisco on the 1st of december, and after a few days of rest and unpayed for internet I’ll be leaving for Tokyo, only to return to SF at the end of the first week of January and then to israel a few days later.