GSoC Milestones – Vala Build using AutoTools

I’m using a RTM List to track my milestones for this my GSoC this year. I’ll be making a blog post for each item ticked off that list, to share what I’ve learnt in my journey from n00b to someone whose code is good enough to be included in GNOME. This is part 1 in the series, where I tell you about autotools

My GSoC project involves, moving major parts (UI) of Cheese to a new language – Vala. Vala is more an extremely glorious C preprocessor than a language of its own – it just translates down to GObject based C code, rather than bytecode/objectcode. The syntax is very C#ish – I was using csharp-mode in emacs to code vala till I got bored enough to download vala-mode. It’s got closures – haven’t used them yet, here is to hoping they’re real closures. It has tons of libraries – it takes a few (minutes|hours) to write a binding for any C library, so many bindings already exist. You don’t lose speed – Vala is compiled down to C code. It also has one of Java’s suckiest features – Checked Exceptions. The documentation is non existent – you’ve to pretty much read through the bindings, or the original C library’s documentation to get anything done. And not many people know such a language exists (Kausik for example – but he also didn’t know you could output pdf from latex, so I don’t think his opinion counts :D)

Cheese uses autotools for building. I had to tweak their script to make it build my Vala code as well. I’ve never worked with any of the autotools stuff before – I didn’t even know .ac stood for autoconf and .am stood for automake. No big deal – Google knows it all and will tell you for free. I JFGI and found a bunch of articles about using autotools to successfully build vala projects. After reading this monstrous (180+ slides, but ~500 pages) Autotools presentation (which is actually very, very good, btw), I had a working build script. It built my single cheese.vala file that did nothing but run a loop and wait to be terminated. It had a place where I could add more .vala files and they should (should) be included in the build. It was hackish, but like most hacks, it worked. On My Machine(tm).

Nowhere else. Turned out my script wasn’t working at all – just faking it to me. I had initially tested out valac (the vala compiler), which had produced a .c file. Since make was supposed to produce the same file, and it wasn’t stale (I hadn’t touched my cheese.vala), it just proceeded to compiling the .c files with gcc. The Vala part of the build script wasn’t being executed at all. Removing the .c file told me that my hackish script hadn’t worked at all.

After banging my head for a while to figure out why it wasn’t working, I finally landed up on the official autotools docs. Autotools had added native vala support. The hack I found was not necessary.

facepalm

Moral of the Story: RTFM comes first, not JFGI.

Anyway, I rewrote the build script to be much more cleaner in a couple of minutes. And it worked.

Build systems are actually a lot of fun once you get the hang of it. A black screen with fast scrolling green text cryptic to everyone else but totally sensible to you is incredibly attractive, no? :)

GSoC Milestone 0 – What does my project do?

I’m using a RTM List to track my milestones for this my GSoC this year. I’ll be making a blog post for each item ticked off that list, to share what I’ve learnt in my journey from n00b to someone whose code is good enough to be included in GNOME. This is part 0 in the series, where I tell you what my project is all about and how Cheese is going to become awesomer.

So, what exactly does my proposal mean for Cheese?

  1. Moving the UI to Vala (from C)
  2. Move display bits from GTK+ to clutter
  3. Implement Live Preview to show people how applying an effect will look before applying it
  4. Implement loadable effects so you aren’t stuck with just 12 preloaded effects.

I’m told that the scope is kinda too big for 3 months – but I’m sure that with careful planning (hah!), around 40 hours of work a week (haha!), lots of time away from college (hahaha!) I can do this stuff :)

I’m keeping my code in a github repo, so watch that for code updates. And will be updating this blog at the completion of every milestone, so subscribe if you haven’t :)

Note: My exams are still going on. Won’t be coding much till they end (May 19th).

My First Accepted Patch!

As part of my GSoC preparations, I wrote a few patches for Cheese. One of them (a one liner to fix a crash) has made it to GNOME 2.30.1 – the other two (1 and 2) are slightly more significant and involve UI changes, and so will be integrated later.

Free beer to everyone who can catch me in a bar! Free Pepsi/Sprite/Egg Puff to anyone who can catch me in the College Stores ;)

P.S. Obligatory thanks to _ke and fargiolas for guiding me through the difficult bits :)

GSoC 2010 – The Beginning

I mentioned this in passing in my earlier post, and was tweeting about it quite furiously – I’ve been selected to work on Cheese for this year’s Google Summer of Code :D

Link to my, uhm, cheesy proposal

What Now?

Getting accepted doesn’t mean shit. Actually finishing whatever I was supposed to within 3 months does mean something – especially since I’ve taken on quite a bit of stuff to do (Move to new language + 2 new features). I’m quite the n00b – first time I’ll be doing just one thing over 3 months. Will be setting up a way of monitoring progress (probably via set milestones) soon enough. Will keep this place posted :)

Also, say Hi to my mentor daniel siegel. Him and fellow cheese-dev Flippio Argiolas, who were extremely helpful in getting my proposal whipped into shape (It’s a gist, so you can see how it eveolved over time).

The Oscar acceptance style blog post will be turned in once the three months are over and the newer, improved Cheese is accepted as good enough :D

Hacking more!

Quoting from Steven Levy‘s Hackers:

[..] a project undertaken or a product built not solely to fulfill

some constructive goal, but with some wild pleasure taken in mere

involvement, was called a “hack.”

Building things for the fun of building them is hacking. And hacking is not illegally breaking into computers.

I like hacking. I want to be a real hacker. I can’t call myself one yet.

I’m putting this up as a reminder to myself – about what is important and what isn’t. Here is to hoping I remember to say No more often. Here is to hoping that the next time I’m bored, I write something rather than idle on IRC. GSoC (a bigger post about it coming up) is helping – a lot.

I’ll do a monthly ‘things I’ve hacked on’ post, and see how many things turn up on that :)

How I spent the Day today

Wake up at 10. Roll around bed for half an hour. Chase brother away from your computer (on which he was playing GTA (or NFS)). Check mail. Find something to code on, code. Check mail. Check proggit. Check HN. Waste some time on Twitter. Waste some more time on IRC. Check mail. Check proggit. Check HN. Tab around, really fast. Tab around, really fast. Go have breakfast. Or lunch – doesn’t matter what you call it.

Finish eating, watch TV a bit. Bitch about how nothing on TV is worth watching. Come back to room, chase away brother playin games again. Start codin something. Tab to Firefox to read some docs. Check mail. Check proggit. Check HN. Check Twitter. Check IRC. Check mail. Read the documentation I really opened Firefox for. Edit a bit more code. Check mail. Check proggit. Check HN. Check Twitter. Check IRC.

Go upstairs. Bitch about how there was nothing to eat. Grab biscuits and water. Look at the time. Look at the date. Feel Ghosh! My exams are nearing! Maybe I should start studying?!. Go back to computer. Check mail. Check proggit. Check HN. Check Twitter. Check IRC. Bitch about exams on IRC. Feel Fuck exams! Fuck marks! I don’t need none of that shit!. Feel good about yorself. Check mail. Check proggit. Check twitter. Congratulate yourself on skipping HN. Go back to IRC.

Get on Facebook. Reply to comments. Post vague sounding status messages. Comment on pictures, randomly varying between variants of Cute! and lol rofl look at that haha!. Brag on Facebook. Check proggit. Check HN. Check Twitter. Congratulate self on skipping IRC.

Go back to code. Read documentation. Check mail. IM people and have philosophical discussions. Flirt around. Feel tired. Think about wasted day. Resolve to make next day better. Think about studying. Decide it is too late. Go to sleep.

Repeat :D

PyCon India 2009

Warning: Rambling, unedited, 7 month old recollection ahead. Proceed at your own risk.

Ah, PyCon India 2009. My first solo bit of travel outside Chennai. What fun it was :) Though it was almost 7 months ago, most of the memories are still fresh. Compare that to college, where I struggle to remember what happened last week…

Anyway, it was fun. I went off by bus with the rather interesting Anirudh – a profitable startupeer and someone I met when working with Busroutes.in. He has a finances related degree and his startup deals with (rather cool) car electronics. He was also a KDE contributor, and is a very interesting travel partner for reasons too numerous to mention here.

I spent some time at Lalbagh, roaming around by myself (and texting classmates with my legs hanging off a cliff-type place). Was fun! I’d definitely do that again – the place was extremely peaceful.

I stayed at Sudar‘s place. Staying at a bachelor’s place was fun – guess that was how my room would look like if I was left all to myself. It was, however, definitely too organized for my tastes – you could actually walk without accidentally stepping on stuff ;) He’s grown up too fast – he actually dragged me to a food place and forced me to have breakfast!

Hung around mostly with mech-yet-wannabe-geek Kausik (who once famously said that he ‘doesn’t want to use LaTeX for resumes because most people ask for docx or pdf’), Anirudh and Sudar (who was there only for Day 1). Had a longish talk with Kenneth, who I later found out was quite a celebrity on IRC/Mailing Lists. Meeting people you knew onlyine online IRL is unsettling at first.

The event itself went well. I was inside only for a couple of major talks – the one about waffle by cnu is the only thing I could remember. I was mostly out in the corridors, typing out code in (one of the many) laptops that Sudar has. The lightning talks were way more fun – because they were only 15 mins or so long and packed a lot of tech (I particularly remember the one about Python internals by artagnon and one about a GAE app by ideamonk. I gave one too – the last one, so I had no projector, no working laptop, no mic, oh and Kausik who was supposed to present with me ditched me in the last minute :P It still went exceedingly well – it was my first time ever talking on a stage of any stage outside college and the practice I had from giving them in college (Thanks to Dorai and the iCell) helped a ton. I even cracked quite a few jokes that was recieved well. Fun times – and I guess it finally killed the last remaining bits of my ‘shit, you aren’t really expecting me to go up there and talk, are you?’ feelings developed from school days :)

Before I left, I visited planemad at NID. Awesome place. Someday, I hope someone established a National Institude of Programming at such a scenic place, where people can come together and learn about programming rather than engineering (which is just college-management-speak for IT Industry Zombie Production Factory)

There you go! That’s a rambling account of my PyCon India 2009 experiences. Next one is probably going to be in Chennai – looking forward to that!

Webfaction Review

I’ve been running yuvi.in and busroutes.in on my [Webfaction][3] account for a while. I got the account for free – after Remi Delon from Webfaction noticed one of my tweets.

Review: I’m going to save that when my free one year plan expires, I can upgrade to one of their better plans. It is so good :)

Highly Reccomended!

Samsung N210 Review

I bought a brand new Samsung N210 Netbook about two weeks back – and have been using it almost non-stop since. I’ve been taking it to college every day, using it at every oportunity I get – on the college bus, on MTC buses, on the train, while waiting for the train, hell even during a rather very boring class!

The Great

  • The Screen! The matte screen is totally awesome. Viewable under all conditions – full on sunlight during a train commute or at a weird angle snuggled under the desk during class. It is sharp, and IMO has enough resolution (1024×600). The bezel is small and not very distracting.
  • The Keyboard. 94% of a full size keyboard, I’m told. It is extremely comfortable, and I don’t miss too many keys. I do find the right shift absolutely useless though. The chicklet keys look great too
  • The Looks. One guy asked me if I was carrying a white MacBook.

The Good

  • The Touchpad. It is large and the mouse buttons are not bad. I don’t know if it supports two button finger scroll on Linux – but it does work on Windows. My hands do accidentally touch it often while typing, moving my cursor unexpectedly – but I have been able to stop that by using my right thumb for space instead of my left.
  • The Battery. I seem to get around 8 hours of usage under varying circumstances and conditions – while nothing to laugh at, I was expecting more. Might be because I haven’t been able to figure out a way to turn off the wifi chip from Linux.

The Bad

  • The Heat. The fan isn’t very noisy, but the heat buildup is appreciable. I can’t really work with it directly on my lap.
  • The inbuilt webcam. 0.3 Megapixels. Bleh!
  • WiFi. Drops very often, and not very sensitive. Ubuntu Autodetected it though.
  • The SD Card Slot. It has a cover that comes right off, and I guarentee I’ll lose it in a while.
  • Many of the Function Key functions aren’t supported on Linux. Was able to make the Brightness keys work after a hack though.

The Awful

  • The ugly black sticker ad for “Phoenix Hyperspace(tm) Instant-on”. Ewww! Atleast there is only one big sticker spoiling this white beauty

Was it worth the 20k bucks I paid for it? I’m typing out this blog post while waiting at my Doctor’s, so I’d say it is well worth the 20k bucks paid :)