Softcore software development
It's all about the cycles
  • Home
  • About

Posts Tagged ‘sleep’

Uncovering the underlying metadata

Web, hugs No Comments »

A few weeks ago, I wanted to do some C++ Mozilla coding to make sure I wasn’t going soft. But I didn’t really know what to do. I left it for a bit until I found something weird about the HTML5 spec – there was a method of testing whether metadata has been loaded, but no way to expose the metadata (eg. song title, artist, album, etc) to the user such as through page info.

I think this will be useful. As media starts being embedded into the web browser, it would make sense to start exposing this to the user. I know there have been a few instances where I was listening to something on the radio, but there was little hint of what the song was called (I usually tried to remember a few lyrics and did a Google search. Mixed success).

I brought this up in the whatwg irc channel, and apparently this is being considered for the next version of the spec. Which is understandable, because the server can always display the metadata. But often, media may not be central to the website. For example, background music.

I started look at the Audio/Video backend stuff that moz uses. It got confusing real quick (it doesn’t help that the audio code itself is completely empty). Plus I was in a hurry. So I decided to implement it as an extension.

It was a lovely experience. I had a few problems, including finding out that audio/video wasn’t actually being saved to the cache (bug 469446). It was checked-in like 2 days after I found it out. Also, I hate string very much. The string guide helped, but it is still awful. And I made firefox crash a few times because I’m a nsCOMPtr n00b.

Right now, this extension is working only with ogg vorbis files. Which is stupid because <audio /> is rarely used anywhere, and if it is used, only with certain conditions (wikimedia commons uses the audio tag, but not really. Apparently, the video/audio tags start automatically downloading the media even if it isn’t under autoplay. This is a mess if you have dozens of audio tags in one page. bug 464272). It is so rarely used, that I had to create a audio demo page for testing purposes.

Using it is very simple. Right-clicking on a audio tag brings up the context menu. I decided to use the context menu over Page Info because the media tab of the Page info dialog is very much geared towards images, and that code has to be changed in the firefox source (it’s not easy/pretty to overlay).

audio context menu

Which brings up the audio’s metadata

audio properties

While a lot of metadata is displayed, some isn’t. For example, iTunes has support for cover art as a COVERART header. While you can put that in vorbis, it should be noted that it isn’t widely supported. So I decided to put in only the standard headers for now.

This is dealing with C++ code. Which is much more dangerous than javascript code because NS_ERROR_OMGWTF doesn’t appear in your error console when I try to free an uninitialized pointer. I made basic checks so hopefully nothing bad will happen. But I didn’t do extensive checking in case we have a bad ogg file or something.

Well, to be fair to me, I always save the function’s return value. I just didn’t check whether it passed nor did anything about it. And this won’t just crash at any time. It’ll crash if you try to load the metadata (I’m very nice like that).

The name of the extension is saraswati, named after the hindu God of music and knowledge (really, a Google search helped out a lot here). Please enjoy! (Linux x86, x86-64 and Windows x86 only right now)


January 22nd, 2009 |

Tags: audio, bug, extension, html5, seneca, sleep




Nuit Blanche

hugs 2 Comments »

Toronto was transformed at night on Saturday October 5th for some art thing called nuit blanche. Basically, it’s an event open all night with gallery’s across the city open for the public. Tom, Lucy and I spent all Saturday night and Sunday morning making trips to these exhibits, and had breakfast at 6-7am with Mike.

I was also surprised by meeting Armen there, and his brothers. It makes sense now.

While loads of fun (I didn’t know what we were doing when we met up. And I didn’t know how much I would enjoy it when I found out. But it turned out to be a great way to spend a Saturday night), I didn’t get home until later in the morning, where I crashed in my bed and didn’t wake up until 16:00 today. I didn’t manage to get any pictures because I didn’t bring my camera, but I did get a video of blinkenlights on my cell. They took over City Hall, and it was an entertaining light show. They also had it rigged up to play pong and tetris, but it was not well executed.

You can view the video directly in the browser if you had a browser that supports the video tag. You’re stuck with downloading it :)


October 5th, 2008 |

Tags: seneca, sleep, toronto




ohai

hugs 2 Comments »

One internet phenomena that seems to be popular at Mozilla (at least, for some people) is rediculously cute animals and broken english in both in spelling and grammar known as lolspeak. So much so that Paul O’Shannessy (zpao if the name doesn’t ring a bell) created the bookmarklet that takes flickr images and turns them into canvas drawing overlaying text to it (called LOLify). The bookmarklet was based off of flolcatr, which brings more lols (well, some of the time anyways. The true lols come of the pics of middle-aged women).

Using that as inspiration, I worked on turning into a Firefox extension. Particularly because I wanted more flexibility out of it. For example, right now the bookmarklet takes random stuff out of the flickr comment and puts them into the image. But I wanted to add in my own stuff to either the top, middle, or bottom of the image and be able to align it left, centre, or right.

After spending all night doing it (I was afraid I would lose interest or get lazy if it took more than one day to complete), I uploaded what I had to addons.mozilla.org. After a good nap, I went back and fixed some pretty ugly errors and uploaded a much better version. I ended up with the name of kyoote (cutie), because it’s one of the words used to describe a fennec. And fennecs are extremely unrepresented as cute animals, even though they are adorable. And from today forward, let friday also be known as fen[nec]day.

lolfennec
Original image taken from deadstardro

So sit back this fenday and enjoy a meowtini :)

Update: Clarification based on comment


October 1st, 2008 |

Tags: extension, fennec, sleep




Sleeping

personal 1 Comment »

I have been falling back into unhealthy sleep patterns again. Lately, I’ve been going to bed at 4 and waking up at around 13-14. I haven’t quite found the reason why. When in MV on weekends, I liked waking up earlier (ok, maybe 10 early ;) ) because I have the rest of the day to do stuff. And during the weekdays, 8:20 wake-up times are the norm.

My mom thinks it is because I’m not working, and hence I don’t have a a reason to wake up earlier. I don’t think that is the reason. Mainly because I’ve been struggling with this even when I was in college/high school. I think the real reason is the unfortunate location of my room, and the amount of light that is getting in.

My room has a large window that lets you look out into the street. Which actually kinda sucks for privacy reasons, so I tend to have it closed (blinds + curtains). Unfortunately, the amount of natural light coming in is negligible. So even mid-day, if the lights were off you couldn’t tell if it was 10 or 14. The nice thing about the apartments is that I was on the 3rd floor, and the blinds were open enough that you could tell it was morning or afternoon. At the very least, the bright sun would wake you up if the alarm clock didn’t.

Something that actually did help when I was in college was when the lights to my room where on while I was still sleeping. I would usually get up an hour after they were on. (how do I know? My mom would call me and turn on the lights at 8, and I was usually up at 9). I wonder if I should invest in a new alarm clock or get a room where the sun can wake me up.


September 14th, 2008 |

Tags: personal, sleep




  • Categories

    • addons
    • hugs
    • Living
    • personal
    • programming
    • Uncategorized
    • Web
  • Recent Posts

    • Update
    • AES and CBC
    • Freshly Baked Bread
    • Minimizing the damage of malware
    • Destination Regina
  • Tags

    "open source" activism audio browser compatibility bug chrome editor extension fennec google chrome house html5 hugs ie intern jquery json konqueror lazy microblog microsoft mozilla music nsid opera personal prism python regina ria safari safe security seneca shaving shoes sleep stats svg tinderbox tip toronto Web wildon windows error
  • Archives

    • February 2010
    • December 2009
    • November 2009
    • October 2009
    • August 2009
    • July 2009
    • February 2009
    • January 2009
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
RSS XHTML CSS Log in
Copyright © 2010 Softcore software development All Rights Reserved
Wp Theme by i Software Reviews
Proudly Powered by Wordpress