23 Aug 2005

dragonflies mating?

prof. farnsworth posted this picture of dragonflies mating (or so he claims.) but if you look closely, the dragonfly is mating with his head. so, i'm not insect sex specialist, but does that mean he has a .. woohoo .. on his head?

... Read More

18 Aug 2005

use hello kitty for good, not for evil.

surely we can think of something else other than hello kitty headlights. if there are any closet hello kitty fans, i could pick one of these up for you from japan when i go there next month.

i suppose marketing people will be on to this like vultures and figure out how to give people coca-cola or yahoo headlights for free.

... Read More

18 Aug 2005

who says mac hardware is expensive?

surely ibook stampede will make it into apple's next batch of switch ads?

[update: crap, i spelt ibook as imac. shows how out of it i am :( ]

... Read More

16 Aug 2005

nakata moving to premier league

i think i need to become a bolton supporter (btw, where is bolton?) because nakata is moving to the premiership! who is nakata? well, he's of course the first japanese footballer to break into the european league. he also won the italian serie a league with roma.

ok, when i figure out where bolton is, i'll maybe think about getting tickets to watch a live game, before all the japanese fan girls come!

... Read More

14 Aug 2005

next generation news aggregators

on saturday i had a lazy day and poked around with podcasts/vidcasts on itunes. its actually quite funny watching geek vidcasts, especially systm and diggnation.

which is very interesting, because diggnation is a vidcast about a website called digg.com. its very funny because its basically two guys talking about what the top news is as rated by users of the next generation news aggregator site, digg.com. digg.com is a very well executed news ranking site that allows you to catch up with tech/geek news as rated by geeks themselves. you can "digg" articles that people have posted, mark articles as dupes, and post your own articles which are basically one link plus a headline.

in a flickr-eqsue/fark-esque style, each post becomes a discussion point where many comments start to flow in. i'm not too keen on the discussion, because without proper moderation like slashdot (and sometimes even with moderation) it degenerates into just rambling by people who know nothing.

the cool thing is you can maintain a list of news articles that you find interesting (its very easy to add to the list -- all ajax-y), and if you're an interesting person, then maybe the idea is that other people can subscribe to what you find cool. think of it as a collaborative filter/tagging system. when enough people "digg" news from this site, you could sort of trust them to tag the news that is hot and relevant to you.

there must be a whole bunch of cool ideas that can stem from this. the only downside is that the news is very geek orientated, so think of it as a souped up slashdot. now they should expand it to cover more than geek stuff. think of it as hot-or-not but for geek news.

digg.com is going to be right up there on my top 5 visited sites along with bbc news, slashdot, boingboing and hotlinks.

... Read More

14 Aug 2005

omg! kick ass design website!

i just came across shaun inman's website, and it kicks ass. if you have a decent modern browser (which means firefox, mozilla-compat or safari-compat) you should check it out. i especially enjoy the nav bar at the top. his designologues site is also very nicely done.

after various hardcore javascript and css hacking over the weekend, i really respect people who can present a decent and clean site with unobtrusive css and javascript that just works!

oh yeah, and my safari fixed position google map hack kills the dragging/interaction on safari! damn it. now i have to figure out another way to force safari to redraw without damaging their event listeners in javascript. and i was all excited when i finally got it working that i never actually tried using the map. the fact it stayed on the screen without moving was enough to make me euphoric.

... Read More

13 Aug 2005

how to make google maps fixed on a page (and working in safari)

[update: changed to include better workaround for safari google map redraw bug. ]

i've spent the whole morning (ok, i woke up at 12pm) trying to do something that is relatively simple. i've got an embedded google map which i want to embed in a page in a fixed position. that means when you scroll around the map stays in the same place. in CSS terms, this is called position:fixed. it turns out it isn't so simple. so maybe this page will help some people figure out what is going on (plus get around a safari redrawing bug):

so originally, our page is like this. you are able to scroll the map off the visible window. look at the source, even though the object is set to position:fixed, it doesn't stick. so something inside google's voodoo is changing the property.

1. let's change the visible property manually via javascript

after looking at the obfuscated google maps javascript, you'll find that the property you want is easily accessible as:

/* instantiate the google map */
var map = new GMap(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.centerAndZoom(new GPoint(-122.1419, 37.4419), 4);
/* change that to fixed */
map.div.style.position = 'fixed';

ah, that sort of works. the google map stays put when you scroll, but all the overlays on the map still scroll off, and the map is huge. this is actually a quite in interesting artifact. because you can see how google maps determines when to load in a new jpeg and how much extra images you are downloading when you set up a small window to view the map.

Gmaps Attempt1

to prevent all the extra stuff, you could add:

map.div.style.overflow = 'hidden';

2. so lets just put it in another container

so we just put the map into another container, easy!

<div id="mapholder">
<div id="map"></div>

so this is the solution, but if you try it under safari, you'll find a weird artifact when you scroll, the box itself stays put, but the images themselves seem to get scrolled off. after puzzling over this effect and trying all sorts of hacks, i figured out that it was a safari rendering bug.

Gmaps Attempt2

it seems that it is forgetting to redraw the contents of the map object. so we have to employ another hack. note that this works fine in firefox. not so good in opera, but i have no clue about how broken the opera css model is.

3. enter safari hack

the hack that we employ is the forced property update on scrolling to force safari to redraw everytime something is scrolled. so here is the javascript to do it:

window.onscroll = function() {
var fake = document.createElement("div");

i learnt this trick from looking at the ruby on rails source after googling for an mention of this bug. the ruby on rails code has a way to workaround the refresh problem, but it turns out you have to force a change to the dom to make safari reload everything inside the dom. so once that is done, you can be sure to have a google map in a fixed position for firefox and safari.

now we have to get it working under internet explorer .. grr ..

... Read More

13 Aug 2005

too far away from zen to know

my good friend calvin blogged about patience, how we seem to be more patient with friends than we are with good friends and family. i think that is really true. i know that my tolerance level with strangers is much higher than with my friends. but the reason is because:

1. i'm too shy to make my feelings known to a stranger on the street, or what not.
2. you have higher expectations of your friends/family.
3. why should you waste time and energy on someone who you don't really care about?

the last 3-4 weeks have been pretty tough on me, and i've lost patience more than once. and i'm partly to blame. i've been both stressed out by work and by personal events. many of the issues are still not resolved, and maybe they never will. things is, friends are pretty fickle. sometimes people who you assume are your friends turn out to be .. emm ... yet, sometimes when you least expect it, some people turn out to actually care about you.

i've calmed down a bit from last week's events. possibly because i've realised why some things have happened in a way that i cannot save. and the only way to vent my frustration is to go on a ranting spree. i'm quite disappointed at how i handled things. i may have been able to handle things more tactfully, but what is done is done. there's no going back. this is probably the first time since i graduated from primary school where i've actually had to resort to this sort of behaviour to get my point across.

previously, i've had friends who were strong minded and wouldn't budge with their distorted view of reality, but at least those friends knew they had an unconventional view of reality, and understood that there is humour about it. when someone is strong minded and not able to find any humour in the situation, then its pretty dire. if they are not able to let go of things and figure out that they make people extremely uncomfortable, then there is no point trying to rescue the situation. if they never realise the amount of hurt they cause people by their disappointingly petty behaviour, then how is patience supposed to win over the ridiculous?

for those who know me from aust, this reminds me of the lap churng photoshop incident way back in high school. the situation was quite different, but the commonality is that they both couldn't laugh it off, couldn't find humour in the situation and chill out.

... Read More

10 Aug 2005

daniel powter, podcasts and album art

current favourite song on my itunes and ipod is "Bad Day" by Daniel Powter (itms) (amazon). it represents alot of what i feel about things in general. it was the free itunes music download for last week. i only heard of this guy from a podcast from the most popular radio station in sydney, triple m. the show shebang had an interview. there was an interview and a fab live performance of the song. here's a direct link to the podcast.

Daniel Powter
cool thing is that you can then get itunes to just play a portion of the podcast rather than the whole thing by setting the start and stop time -- like so:

Picture 4

finally, i've committed some sample code into EyeTunes.framework that converts artwork in itunes to a jpeg file you can put on your blog.

of course, you could also do the same by opening up the info page for the track (cmd+i), selecting the "artwork" tab and then copy (cmd+c). then open preview and press (cmd+n) for new from clipboard and then (cmd+s) to save!

maybe i'll polish it up and make it so that you can make album art posters using artwork in your itunes.

... Read More

10 Aug 2005

cool use of google maps

been doing alot of google maps api hacking recently, and i'm on the verge of being able to show a sample of it to the public for testing. meanwhile, i've come across a number of cool uses of google maps. most interestingly is this one from google themselves by plotting all the people who have bought a google mini server and london congestion web cams (except this doesn't work in safari.)


... Read More