11 Oct 2005

tagencoder beta 2

in case anyone cares, i've got a new version of tagencoder that fixes some bugs that cropped up under tiger and also with some poorly encoded mp3s. grab it on the tagencoder page.

for those who don't know, its just a simple cocoa app that attempts to use the python decoding framework to convert non-unicode mp3s to unicode mp3s so they can be imported into itunes. great if you are working with chinese, japanese, korean mp3s that were encoded on a native character set windows platform.

... Read More

09 Oct 2005

web 2.0 == bubble 2.0

the register and various other people have been critising the rise of web services. calling this rise which has been dubbed web 2.0 as bubble 2.0.

my view is that it is true. the bubble is starting, but we haven't realised how big it is going to be yet. we've already gotten a whiff of it with the 2.7-4.3 billion buyout of skype by ebay, and then various acquisitions being made that don't seem to make any sense.

now is the time to come up with an idea and a shoddy business plan and make it rich. if you missed bubble 1.0, make sure you get on bubble 2.0. only this time, don't buy so many ferraris or invest in the stock market. just buy lots of gold and oil futures.

... Read More

06 Oct 2005

sneak peak at spotstamp

here's a sneak peak at a little app i've been building for the last couple of days. i've finally cracked the UI and the core functionality. its main goal is to easily access/edit all the metadata in the mac os x file system.

i'm especially interested in tagging files with keywords and adding additional information on the mountains of pdf files i have to generate bibtex based solely on the metadata i keep in the filesystem.

nice thing about storing the data in the filesystem is that it follows where the file is, no matter how you move it. other thing is that the format is wide open, once the files are tagged, you can get at it through any other application, even apple's own finder and spotlight. no need to get pissed that all your meticulous annotation is stored in some crazy xml file (yes i'm looking at you, iphoto!)

to give you a flavour of what it is, here are some screenshots:

spotstamp on the top right

spotstamp (a working codename) is on the top left. the interface is simple, just two tabs and an invitation for you to drag any files to it.

spotstamp displaying metadata

here i've dragged the bluetooth 1.2 specifications to spotstamp, and you can see all the metadata that has been extracted by apple preview from the PDF file. this is one of the better encoded PDFs that has the correct title, creation data and authors. notice that the first field are the comma separated list of keywords, just like flickr.

spotstamp and multiple files

drag a bunch of files, spotstamp allows you to edit all the files at once. metadata that doesn't exist or aren't in common are hidden.

spotstamp close up

here's a close up of what is happening. btw, that search button works too, but its not quite pretty yet!

so i'm getting quite close to having a beta for people to try out and see if they find it useful. haven't figured out a proper name for it yet, if you have a good idea for a name thats related to spotlight and implies tagging/keywording/annotating, i'm all ears :)

... Read More

02 Oct 2005

lpcode vs qrcode vs magicode

seems like qrcodes will be getting some competition from china's lpcode? and another code called magicode from taiwan.

 Lpimage Code1

here's a chinese blog post about the emergence of lpcodes and also taiwanese article about how visual codes are being used in taiwan. seems like these 2d barcodes are getting some hype now. maybe in a couple of years asia will be covered in visual tags, or maybe not?

maybe if i have some time i might have a go at translating it, to see what it says about these codes.

... Read More

02 Oct 2005

robo sumo

i just found out that there is robo-sumo in japan. kinda like robocup where you have robots playing soccer, and a touch of robot wars. very cool. they actually do it in the same arena as the real sumos play in ryogoku.

 Sumo 3Kg All Images All Top

... Read More

02 Oct 2005

winter worm summer grass

one of my housemates was given a box of chinese herbal .. emm .. food apparently from the cupboards of a previous tenant of her friend. apparently a lot of chinese food was left, including this box of "winter worm summer grass" (冬蟲夏草).


so what is "winter worm summer grass"? when i was a kid, my mum tried to feed this to me in soup form. here is a better picture of the winter worm summer grass and its benefits and usage in chinese. there is also a chinese page summarising what the hell this is.

in winter, these worms bury themselves into the ground and eat these grass, then they somehow attach themselves to the grass and then in the summer the grass grows into a worm shape. sounds pretty gross doesn't it.

the last time i had this was when i was around 8 or 10 years old, and i'm definitely not going to have some of this stuff again. the idea just grosses me out. but apparently this stuff is really expensive. good stuff goes for around US$2.54 per "worm." my housemate found a whole box full of it, so there could be up to US$100 worth of dried worms in there.

... Read More

30 Sep 2005

adding arbitrary metadata through spotlight: now possible

last night i spent some time disassembling bits and pieces to find out how Finder actually is able to edit the Spotlight Comment Field in the Get Info pane because that must be the ticket in to editing arbitrary metadata. if Finder can do it, we should be able to.

Picture 3

so going from /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder, you can see that it links to a bunch of different libraries, one of which is named DesktopServicesPriv.

McBook:/System/Library/CoreServices/Finder.app/Contents/MacOS liquidx$ otool -L Finder | awk '{print $1}' | grep -v "/Framework"

and in there it links to a symbol somewhere called MDItemSetAttribute, our ticket into the metadata system.

McBook:/System/Library/PrivateFrameworks/DesktopServicesPriv.framework liquidx$ nm -g DesktopServicesPriv | fgrep MDItem
U _MDItemCopyAttribute
U _MDItemCopyAttributes
U _MDItemCreate
U _MDItemSetAttribute
927e0834 T _NodeCopyMDItemIdentity
U __kMDItemSortIdentityAttr
U _kMDItemContentType
U _kMDItemContentTypeTree
U _kMDItemDisplayName
U _kMDItemFinderComment
U _kMDItemPath

so, where is this MDItemSetAttribute? the logical place would be in the CoreServices.framework, along with all the other MDItem functions, so looking in there ..

cBook:/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework liquidx$ nm -g Metadata | grep SetAttribute
9103d1ac T _MDItemSetAttribute
9103547c T _MDItemSetAttributes
9103d890 T __MDCopyLastSetAttributesStats
910305ec T __MDSetAttributeSchema
91042010 T ___MDItemSetAttributesEllipsis1

bingo! we've found it. so we need to check out what the parameters are and what it returns. that isn't too bad, we just use otool -tV to dissassemble the text section and find the symbol:

9103d1ac mfspr r0,lr
9103d1b0 stmw r28,0xfff0(r1)
9103d1b4 bcl 20,31,0x9103d1b8
9103d1b8 stw r0,0x8(r1)

after all that i sort of guessed that MDItemSetAttribute's prototype should be something like:

int MDItemSetAttribute(MDItemRef item, CFStringRef attribute, CFTypeRef value);

from both the MDItem Reference plus seeing where r3, r4 and r5 goes inside the function both in Metadata.framework and DesktopServicesPriv.framework.

turns out though, i didn't need to do so much guessing, and plus, my guesses were nearly spot on. hetima, of safaristand fame, has a blog entry about exactly this only a month ago. except he went a step further and looked at MDItemSetAttributes too. that would make sense since he's been hacking multi window spotlight recently from his photostream.

... Read More

29 Sep 2005

adding arbitrary metadata through spotlight: impossible

last night i was poking around spotlight trying to find a way to modify the "keywords" part of arbitrary files so that i could inject my own keywords. turns out after a fruitless search, there is no way to arbitrarily add metadata to files.

the only way is the write an mdimporter to synchronise separate database with the keywords. the supposed reasoning for why apple doesn't allow people to do this is because that would allow metadata to become out of sync with the content, so it is better to regenerate the metadata everytime. so much for making the filesystem the database.

... Read More

28 Sep 2005

ppstream - p2p tv streaming that rocks!

it's liverpool vs chelsea tonight playing in the uefa champions league. last year, the champions league was on ITV or BBC, i forgot which. but this year its been moved to sky sports, so i can't watch it on free to air, which sucks.

after discussing my dilemma with a friend in hong kong, he pointed me to ppstream, a peer to peer video streaming application for windows. he told me alot of chinese tv channels are streamed on this service and probably some of them might have the champions league playing.

so i broke out patricia's samsung windows laptop and installed it. and my gosh, does it rock! not only does it totally work, but it was extremely simple to use and i managed to watch the whole second half of the game. actually, i'm writing this as i'm watching on a 15" full screen. turns out also that there are streams from china, hongkong, taiwan and singapore. and even homebrew streams run by movie buffs and music buffs showing only mtvs and movies of a particular movie star or singer.

here's a video on just how good it is.

Picture 2

just thought i might write a bit of an adhoc review of this program, for those people who either don't have the platform to try it or don't understand chinese. the application is written by some mainland chinese people, so the interface and menus are all in simplified chinese. the first thing to do is to change your windows interface to simplified chinese for non-unicode encoded applications.

the second thing that you need to do is to tweak the maximum tcp connection rate for windows xp sp2. i didn't know this at all, but the tcpip.sys in windows xp sp2 has been disabled so that you can only make 10 simultaneous tcp connections at once. i suppose this is to stop the spread of viruses and worms, but what a pointless restriction! luckily there's a tool that helps you get rid of this limit. if you leave the limit intact, you'll have trouble getting a good number of streams to these video sources.

once you've got that fixed up, and rebooted, you're ready to go. open up the app and you'll see three panes, the one on the left is the list of channels. this is particular impressive, because you have many sports channels. when i tried it, i could connect to all but the most viewed channel which had apparently 15000 viewers, the next ones down had about 300-5000 viewers each. because it was champions league night and plus it was 3-4am in the morning in east asia, the most loaded channels were the ones showing football. in all there were 3 channels that i could connect to that were playing football. they were various channels of espn star/star sports.

there were other channels such as TVB and ATV from hong kong, those channels were listed by their chinese name, so if you don't know chinese, you'll have a bit of a problem finding them :) hovering over the channel will tell you some statistics about the channel and some metadata about the contents such as what program is on and a URL. the URL always lead so some forum or some portal page, which seems to suggest that the feed has been provided by a single source (reward being advertising or kudos) and then mirrored in a p2p fashion. that sounds very similar to how peercast works.


on the right most pane is a cool recommendation and tv schedule link. tells you whats hot that is on. also for some tv channels you can see the schedule and actually "program" your application to switch to a particular channel at a particular time.

the central pane is where the video is. the video seems to be using windows media player to do the encoding. nothing much special about that. the video size is about 320x240 streaming at around 372kbps. you can switch to fullscreen mode which is the best way to watch it.

so i watched the stream from Star Sports for the liverpool vs chelsea game. initially it took around a minute to fully buffer a stream, but once it buffered the stream, it never got cut, occassionally it stuttered a little once in every 5 minutes or so. the audio quality was excellent. also, like skype or bittorrent, even if you're not watching, your connection still seems to forward packets for the network.

i have to say i'm extremely impressed with how this works. i hope this catches on more and more. i guess the single breaking point in this thing is the source, but as long as there's 100Mbps internet spreading through out east asia, you don't have to worry about it. also the fact that there is only chinese content and not open source might mean it will continue to be only used in asia rather than in US and other parts of the world.

[UPDATE: (15/07/07) this blog post is slightly out of date now. (1) You cannot watch TVB over any P2P TV service I have found, and (2) SOPCast is now my preferred P2P TV streaming service which also works under linux as well.]

... Read More

26 Sep 2005

podcasts i'm listening to

ok, maybe i'm boring everyone with posts about japan. there's still heaps to talk about though, like the sumo, qrcodes and japanese tv. but i'll save it for later in the week when i have more time.

anyway, lately i've been hooked on to four new podcasts that i've found:

podcast.talkonly.net -- a cantonese podcast by geeks in hk talking about all things from gadgets, to (illegal) downloading of hkpop music to political geeks.

itconversations -- i've been following this, haven't been listening to everything, but there a few some real gems in there

josh in japan -- this guy's a us navy marine (?) in japan who answers people's emails asking him questions about japan. i'm hella jealous of his work location.

boundcast -- review of geeky books, and even an interview with andy hertzfeld, one of the programmers on the original macintosh.

as usual though, i ask try to find time to listen/watch diggnation, engadget and triplem.

btw, i'm still using itunes and my ipod to listen to podcasts. it still sucks. why isn't there a better podcast player. firstly, why does it not automatically skip to another podcast after one finishes. the triplem podcast split their things into 3 minute segments. so its really annoying that every time i need to press "forward" and "play" to play the next podcast.

even worse on the ipod as well, you have to press "menu" then scroll to the next one and press play! i hope they fix this soon because it is really annoying.

... Read More