Inspirated

 
 

May 11, 2010

Summer of Code Progress: Ubuntu Community Bonding

Filed under: Blog — krkhan @ 8:53 pm

Over the past few days, I have been preparing myself for GSoC work in various ways. Officially, these few weeks are defined as “Community Bonding Period” for Summer of Code participants. Meaning, selected students are expected to spend time for getting everything set for the real development which starts on May 26th.

The first thing on my priority list was to find a way for fail-safe IRC communication. The end solution was documented in my previous post. In a nutshell, now I have this IRC client running all the time to which I can connect occasionally and go-through the activity since my last visit.

Next up was discussing with Bryce the list of things that should be ready before the next stage. Setting up Launchpad locally was pinpointed as the real PITA for beginning the development. He advised me on a few other aspects as well, including why I should aim to complete the major coding portions of my work before the mid-term evaluation. Bryce has been the X.org maintainer for Ubuntu so he’s also new to Launchpad development like me. However, unlike me he has been able to set up a Launchpad instance on Lucid Lynx. I have been trying a bit unsuccessfully to do the same with Karmic Koala for a few days now. The rocketfuel-setup quits on me after complaining about download-cache directory not being available in the devel tree. I’m hoping to look more into that tonight.

As for the miscellaneous things, Google gifted all the participants an year of ACM Student Membership. Without sarcasm, ACM has one of the most confusing user-management system I have ever used. I already had a web-account on ACM and hence my username was not available for using this membership. Doesn’t make sense? Exactly. With that said, on the brighter side of things was the fact that ACM’s help-desk was prompt and solved my registration problems within a few emails of correspondence. The ACM email address still isn’t forwarding emails properly but I guess that’ll take a few days to resolve.

On the community side of things, I thought it would be convenient to have important information about my organization’s projects in one place. On that account, here’s a list of my fellow Ubuntu participants for this year’s Summer of Code:

Student Project Mentor
Sarah Strong The Great Clipboard Fixing Galore Project Ted Gould
Michal Karnicki Android U1: Ubuntu One client for Android Stuart Langridge
Jacob Peddicord services-admin configuration and Upstart-ification David Bensimon
Dylan McCall Harvest user interface improvements Daniel Holbach
Urban Skudnik Home user backup solution/Deja Dup improvements Michael Terry
Dmitrijs Ledkovs USB-creator Improvements Evan Dandrea
Kamran Khan Bug Triaging Improvements for Launchpad/Arsenal Bryce Harrington
Harald Sitter Ubuntu One for the KDE workspace Jonathan Riddell
Peter Gardenier Software Center Improvements Matthew Thomas
Andres Rodriguez Lazo Testdrive Front End Dustin Kirkland

Good luck to everyone on board!

Tags: , , , , , , ,

April 27, 2010

Finally there — Google Summer of Code 2010

Filed under: Blog — krkhan @ 1:02 am

GSoC 2010 Logo

Fate has a curious sense of humor. After having 8 of my proposals rejected in past 3 years for Google Summer of Code, I had 2 of them selected in the same year. In GSoC terminology, I became a “duplicate” student. Now, the standard practice for such cases is that the administrators of both organizations interested in the student get together in a “deduplication” meeting and resolve the conflict. However, Maria Randazzo (the program administrator from the Ubuntu organization) was kind enough to ask my preference regarding the project I’d like to work upon.

This put me in a rather uneasy position as mentors from both organizations (Bryce Harrington from Ubuntu & Alexey Khoroshilov from The Linux Foundation) had been really helpful during the application process. In the end however, I chose Ubuntu since its proposal focused on Arsenal and Python which I found relatively more familiar than Alien and Perl. I had also already collaborated with Bryce for some Arsenal patches before so it was easier for me to get up-to-speed with the Ubuntu proposal.

The proposal itself is in fact publicly viewable at this link. Summarizing my feelings, I’ve never looked forward to a summer as much as this one.

“If a June night could talk, it would probably boast it invented romance code.” —Bern Williams

Tags: , , , , , , , , ,

November 27, 2009

Webhost migration — Part 2/3: Google Apps

Filed under: Blog — krkhan @ 5:15 pm

After migrating my webhost to Go Daddy a month ago, I found out that their hosting packages offer as much emailing features as insight provided by a third grader’s homework on quantum mechanics. Namely, none. Only a hundred MB of email storage for all email accounts that I would create on my domain. Plus, no IMAP or POP support. When I contacted their support over the issue of IMAP, I got the classic response of you-need-to-upgrade-your-package. What baffled me is that even free web hosts offer much better email, so I had no idea as to what Go Daddy was thinking when it decided on those features. Perhaps those WWE divas from the ads were the ones who came up with the hosting plans, which would explain a lot.

Anyways, my only affordable option was to migrate the emailing infrastructure to Google Apps. Quite surprisingly, the process took only about 10 minutes as I had to change a few CNAME and MX records on my domain. After that, I had a sexy new Gmail login at mail.inspirated.com:

Inspirated on Google Apps

7+ GB of email per account and the best spam filter on planet. You can’t ask for more than that. It is also possible to link a Google Apps account with a Google Account, but that messes up the Gmail account associated with your Google Account. Didn’t understand that? Good. The general suggestion is to keep a Google Apps and Google Accounts at a safe distance. Didn’t understand the distinction either? Better. The more general suggestion is to never think about it.

I’ve heard horror stories about Google Apps going horribly wrong when Google decides that something illegal has been done through your accounts but for the time being, I’m happy with the experience. Email just isn’t fun until it hits that G-[spot].

Tags: , , , , ,

September 11, 2008

Thanks, but I don’t want to try out Google Chrome (yet)

Filed under: Blog — krkhan @ 4:36 am

Alright, Google finally releases the Chrome browser, along with a certain comic detailing features of their product. I check out the comic and the feature-list, I decide that there isn’t any compelling reason for me to switch to Windows and run the beta. I also decide never to blog about it unless I deem it important enough for a try out. So far, so good.

But hey, I have violated the unimpeachable moral obligation of going along with the current buzzword by declining to be a part of the Chromosphere. In the past week, at least seven different people have tried to persuade me to believe Chrome is going to take over the world. In fact, that is the inherent problem with Google and Apple fanboys. They equate anything remotely new from their favorite corporation with the second coming of Christ, and then try to convince other people over it. I do happen to be a fan of both as well, but I still don’t see why products like 3G iPhone or Google Chrome deserve the applauds lauded by these people. Here’s a list of arguments Chrome fans presented to me:

  • Chrome is Google’s attempt to blur the line between desktop and web, and it is the future Operating System
    Bullocks. The line between desktop and web shall never be blurred. Are you trying to tell me that you’ll be installing your printer or screen drivers to web one day? Will a browser ever be capable of doing even half of the stuff that operating systems do, e.g., implement the POSIX specification or host other processes?
    No? I didn’t think so either. Yes? You do not have any idea what an operating system is.
  • Chrome isn’t a memory hog like Firefox
    Firefox’s memory-usage has steadily improved over the released and I have yet to encounter someone who had any serious memory troubles with the former that were solved by the latter.
  • Chrome’s Javascript runs faster
    The only worthwhile feature of Chrome is its Javascript engine. Nevertheless, milliseconds of speed improvement won’t even be noticeable by me. The AJAXed Facebook or Gmail run on my Firefox extremely well and I don’t think my productivity with either would increase by switching to Chrome.
  • Chrome’s rendering engine (WebKit) is new whereas Firefox’s rendering engine (Gecko) is outdated
    Wrong. Totally wrong. Gecko might be bloated, but Mozilla does a more than reasonable job of making it perform well. Gecko is huge — WebKit comparatively isn’t — but it is still frequently updated and properly maintained. The huge codebase is an issue for the developers rather than the users and as long as developers are delivering stable final products using that codebase, it’s certainly not an issue for me. WebKit is great for new applications like Chrome, but Mozilla has already settled with Gecko so it isn’t a bother for them.
  • Chrome uses separate processes for each tab
    And this was the only “visible” feature Google was able to highlight in their comics. This is nifty behavior, but with frequency of my browser crashes reduced to almost once a month, this isn’t enough to convert me over.

On the other hand, consider the mammoth developer base Mozilla already has for its Firefox extensions. Google isn’t going to replicate that as well as bundle Chrome with killer feature(s) anytime soon, if ever. What Google perhaps aimed to do was to get other browsers to adopt Javascript enhancements that they’re going to introduce with Chrome. More than that, I don’t think Chrome shall ever compete in user share against Safari, let alone against the big guns.

Tags: , , , , , , , ,

July 27, 2008

At least I wasn’t even close

Filed under: Blog — krkhan @ 4:35 pm

“I think I have a problem with that silver medal.
I think, if I was an Olympic athlete, I would rather come in last then win the silver.
If you think about it… if you win the gold, you feel good.
If you win in the bronze, you think: “Well, at least I got something.”
But if you win that silver, it’s like:
“Congratulations! You… almost won.”
“Of all the losers, you came in first of that group.”
“You’re the number one… loser.”
“No one lost… ahead of you.”” — Jerry Seinfeld

I had two chances for progressing in Code Jam by qualifying in one of the two sub-rounds assigned to me. Both sub-rounds had three problems A, B & C ordered in increasing difficulty level. Here’s a quick summary of both:

  • For the first sub-round (1A), I did solve problem A and got 15 points. However, I didn’t solve it quick enough. Problem B was left untouched by me. Problem C’s small input contained only 29 cases and could have very well been solved using only a scientific calculator. However, that just didn’t seem the right way of progressing (30 points would have been enough to qualify, but I’d definitely have failed at the subsequent rounds).
  • For the second sub-round (1C), apart from connectivity issues, I couldn’t provide correct output for any of the problems. I did solve problem B but as my solution was recursive, it was taking too much time for calculating the output. I’m not that good with refactoring recursive solutions for yielding iterative ones, so my chances got blown right away.

Overall, Code Jam was pretty fun and having fun was the sole aim of participating this year. Now I’ve got to start reading the Introduction to Algorithms book and get myself formally acquainted with algorithmic problem solving. Good luck to all the gurus who did progress (seeing some of them solve all 3 problems within half the time was amazing). They thoroughly deserve it and I’ll keep monitoring later rounds as a spectator — just reading through their ingenuous solutions is nothing short of a delightful experience.

Tags: , , , , ,

July 18, 2008

Jam and Geometry

Filed under: Blog — krkhan @ 5:24 am

The scores for Google Code Jam qualification round are out. It lasted 24-hours, and the participants were allowed to enter any time and try to solve any of the three given problems. Each problem had one small and one large input set. Participants were able to check during the qualification whether their programs produced correct results on the small input sets but had to wait for the round to finish to know whether correct outputs were produced on large ones.

Correct solutions for small and large input sets were worth 5 and 20 points respectively. To progress to Online Round 1, each participant needed to score at least 25 points. Participants based on the times of their correct submissions and their wrong submissions. And, what I actually did not know was that the timer started ticking with the qualification kick-off. Which means that if someone slept through the earlier hours (or watched the final scenes of One Flew Over the Cuckoo’s Nest again, like me), he’d be ranked lower even though he may solve the problem within half an hour of viewing it.

Anyways, since points were what mattered the most and not the rankings, I actually started off with the problem set 2-3 hours after the qualification had started. Participants were provided with the following three problems:

  1. Saving the Universe

    The urban legend goes that if you go to the Google homepage and search for “Google”, the universe will implode. We have a secret to share… It is true! Please don’t try it, or tell anyone. All right, maybe not. We are just kidding.

    The same is not true for a universe far far away. In that universe, if you search on any search engine for that search engine’s name, the universe does implode!

    To combat this, people came up with an interesting solution. All queries are pooled together. They are passed to a central system that decides which query goes to which search engine. The central system sends a series of queries to one search engine, and can switch to another at any time. Queries must be processed in the order they’re received. The central system must never send a query to a search engine whose name matches the query. In order to reduce costs, the number of switches should be minimized.

    Your task is to tell us how many times the central system will have to switch between search engines, assuming that we program it optimally.

    I solved the problem using a vector of strings in STL. It took me around 35-40 minutes. My entry for the small input set was judged to be correct on my first attempt.

  2. Train Timetable

    A train line has two stations on it, A and B. Trains can take trips from A to B or from B to A multiple times during a day. When a train arrives at B from A (or arrives at A from B), it needs a certain amount of time before it is ready to take the return journey – this is the turnaround time. For example, if a train arrives at 12:00 and the turnaround time is 0 minutes, it can leave immediately, at 12:00.

    A train timetable specifies departure and arrival time of all trips between A and B. The train company needs to know how many trains have to start the day at A and B in order to make the timetable work: whenever a train is supposed to leave A or B, there must actually be one there ready to go. There are passing sections on the track, so trains don’t necessarily arrive in the same order that they leave. Trains may not travel on trips that do not appear on the schedule.

    This was actually easier than problem A. As I only had to use a simple multimap and a vector to hold the departure/arrival times in minutes and then loop throughout the day and manage the trains. I had 2 wrong attempts on the smaller input set though, which were caused by the fact that I started solving the problem initially with a map instead of multimap; which was imposing the limit of only one train’s departure from a station at a given instant.

  3. Fly Swatter

    What are your chances of hitting a fly with a tennis racquet?

    To start with, ignore the racquet’s handle. Assume the racquet is a perfect ring, of outer radius R and thickness t (so the inner radius of the ring is R−t).

    The ring is covered with horizontal and vertical strings. Each string is a cylinder of radius r. Each string is a chord of the ring (a straight line connecting two points of the circle). There is a gap of length g between neighbouring strings. The strings are symmetric with respect to the center of the racquet i.e. there is a pair of strings whose centers meet at the center of the ring.

    The fly is a sphere of radius f. Assume that the racquet is moving in a straight line perpendicular to the plane of the ring. Assume also that the fly’s center is inside the outer radius of the racquet and is equally likely to be anywhere within that radius. Any overlap between the fly and the racquet (the ring or a string) counts as a hit.

    This is where I got stuck, and stuck bad. This problem had more to do with Euclidean Geometry than with data structures, STL or structured programming, and I know this much about Euclidean Geometry: chapter 6 from my higher-secondary school Mathematics book was titled “Conic Sections”. Naturally, my first resort was to try and find some library which would issue my particular problems (using free library code is allowed in Code Jam). More specifically, I wanted a library that would allow me to calculate the area of intersection between a circle and a rectangle (so that I’d gradually subtract out the racket strings’ area in calculations). The result wasn’t much different from my Euclidean Geometry knowledge, as now I know this too: there’s a GPL library called GLAC which does geometry stuff. To summarize, I was unsuccessful in solving this problem. Maybe I’ll need to familiarize myself with GLAC before next round to have a good shot at progressing.

One of the advantages of using STL is that if your program is correct on small inputs, i.e., the logic is applied correctly, there’s little chance that things shall take the unfortunate route for the large ones as larger data structures are accommodated dynamically. Consequently, my solutions for A and B were later on judged as correct for the large input sets too. This gave me 50 points, and 1319th rank among the 7154 participants (I wish I had known that wasting time earlier on means a drop in my ranks, but all’s well that ends well).

The Online Round 1 takes place in another week or so. I started solving algorithmic problems only a fortnight ago so I think I’ll need some more practice to be able to compete properly. To be fair though, I didn’t have high hopes for even the qualification round, as I had entered just for fun and some experience so that I’d be able to contend properly next year — after I’ve had some proper and extensive practice with this kind of problem-solving.

Tags: , , , , , , , , , , , , , ,
« Previous Page