Wednesday, March 31, 2010

Big Bang Theory

So I was watching Big Bang Theory the other day, and a recurring thought I had had, came back to me. Am I totally crazy, or does somebody else see this?




Tuesday, December 29, 2009

Amarok Bugfix and Documentation

Documentation is important/useful. I don't mean just comments in the code, I'm talking UML and perhaps written-English documentation walking through a large amount of classes. I've started to, in my free time, document things related to the Media Device Framework of Amarok, with the double purpose of helping to ease in new device developers, as well as to spark discussion about the framework to make it better. I'm well aware of many of its flaws, but the more eyes the better of course, especially when I have nearly no time to work on it.

One helpful thing the UML has helped to do, in particular sequence diagrams, is to spot where bottlenecks occur (where things can lock up the GUI) and thread them. One such big one with parsing device metadata has become threaded, so some of you with rather large collections on your devices may notice that the GUI no longer locks up during the parse. This applies to iPods, MTP, and UMS devices. So yay.

Hopefully as I do more diagramming, this will make it easier for me to work on Amarok when my brain/body are otherwise quite occupied with other things.

--------

Off-topic: to the KDE person I ran into in downtown Mountain View coffee shop, please leave a comment so that I may remember your name.

Thursday, November 19, 2009

Open Source Coding Hiatus


Where have you been?

So lately I've been occupied by a few things:
  • Family issues
  • Working for a startup company
  • University bureaucracy
  • Jobhunting
Which is not to say I've been without free time. What have I been using my free time for?
  • Studying natural languages more in-depth
  • Reading technical books, and inspiring books
  • Being with friends, having fun and discussing the near and long-term future
So where does this leave open-source coding, for which I've even been given the honor of being listed as author for a great project like Amarok? After all, I have a vested interest in continuing to improve something I spent so much time on. I'll explain a few factors of the times that I've tried to get back into coding for it.

Have you been coding in secret?

The nice thing about using git for development is that I can continue to work on a feature or large fix on the side, and then deploy it when ready. That said, this is the cycle I usually go through when I feel I'm going to have enough time and effort to code on Amarok:

  1. git pull
  2. make install
  3. Check out new stuff
  4. Figure out what I want to fix/add/work on
  5. Start working on it in a git branch
  6. Realize after a few hours, that this is going to take 1-2 weeks of dedicated coding, and stop.
I then may come back in a week or two, delete the old branch because I feel I was going about things the wrong way, and repeat this cycle. This is by no means productive, but is something I end up getting caught in lately.

Clearly this doesn't work, so what now?

So this time around I'm trying something new. I'm fully-documenting the issues I want fixed and how to go about them, and sitting on them a bit to see if I can mature them before coding. Also I'm trying to break them up into doable smaller pieces, so I can at least get checkpoints in progress, otherwise this isn't going to work at all.

And in the immediate future?

I am now entering my last two trimesters of undergraduate studies before graduation. Between work, school and family, I highly doubt I'll have the motivation to work on open source on the side. I'm aware there are others who can do this, and have that motivation, and I look up to and respect them, but I lack that. I hope that this next summer, I'll find myself more motivated and free.

Sunday, November 15, 2009

Go Qt Bindings Worth It?

So there's this language called Go from Google now, whose first impression to a programmer is "this is some odd-looking C" code. I do notice that the compile and link time is blazing fast, but let's take a look at the binary size of a simple hello world program, compared to C and C++ equivalents.

---------------------------------
C:

#include

int main( void )
{
printf("Hello World\n");
return 0;
}

C++:

#include

int main( void )
{
std::cout << "Hello World!" <<>}

Go:

package main

import "fmt"

func main() {
fmt.Printf("Hello World\n")
}
---------------------------------


.... and the output sizes?

628K 6.out
16K helloc
16K hellocpp


Hmmm... speedy compile, strange-looking code, obscenely fat 39.25 times as large binary for a hello world file. Maybe as the programs grow larger, the overhead gets less and less, I'd need to test that or read an article about it, but from my first impression? Yikes... maybe not yet ready for Qt. But I'll definitely have fun playing with it anyway! =D

Monday, November 9, 2009

Yakuake For Clipboard

Yakuake is a great drop-down terminal, but often I find the need to store several things on my clipboard, and was thinking a yakuake-like program that has tabbed sessions of kate/kwrite would be really useful as well.

I'm not sure if there exists an application that already does this, but would anybody be interested in this kind of program?

Wednesday, September 30, 2009

Nokia Browntooth enabled…(Engrish.com Repost)


"Let me call you back, we’ve got a crappy connection…"

I wonder that this isn't what Nokia means by Qt everywhere...

Wednesday, September 2, 2009

Qt for S60 Still Bogged Down By Symbian

Qt for S60 has brought the simplicity and power of Qt to Symbian phones, but there are still a few corner cases which are hurting, and one of those is the camera, whose code is still heavily tied to old Symbian cruft.

Symbian's code for cameras returns captured images as CFbsBitmaps. Don't even begin to guess what CFbs stands for, you'll just end up crying "why, why!?" Luckily Qt for S60 provides a function which converts CFbsBitmaps to QPixmaps, but it seems that the image capture is faulty, even though if at any point you take an image from the viewfinder and convert it it turns out fine.

So I decided to debug to see if the CFbsBitmap returned from the camera's viewfinder on capture was the source of the problems, and not Qt's conversion function.

After an hour or so of Googling (tm) and messing around in the Nokia forums in dead ends, I've found this wonderful snippet of code to save the CFbsBitmap to a file to see if that's the case (http://discussion.forum.nokia.com/forum/showthread.php?p=636992). (Note: CFbsBitmap's Save() function merely saves the binary CFbsBitmap to a file, unopenable by anybody other than Symbian, and thus useless):

------------------------------------------------

_LIT(KFileName, "c:\\1.bmp");
_LIT8(KMime, "image/bmp");
RFs& fs = CEikonEnv::Static()->FsSession();
CImageEncoder* encoder = CImageEncoder::FileNewL(fs, KFileName(), KMime(), CImageEncoder::EOptionAlwaysThread);
TRequestStatus status = KRequestPending;
encoder->Convert(&status, *bitmap);
User::WaitForRequest(status);
delete encoder;
User::LeaveIfError(status.Int());

------------------------------------------------

Let's break this monster down:
· _LIT8 is one of Symbian's ass-backwards ways of declaring a "string" for example a string called KMimeType with value "image/bmp"
· RFs is a file session, which is basically a guy that manages accesses to files, and here we pull out the manager for the application using CEikonEnv (again, don't ask)
· Then we create an encoder to change the CFbsBitmap into a real bitmap and save it to a file with the rest of this wonderful piece of code

The Qt equivalent of this is:

QPixmap *pix:
pix.save( "somewhere.format" );

Why was this so hard to program into Symbian!? If you're going to put a function to save the raw binary of a CFbsBitmap to a file, why not a truly encoded one?

Every day I code in Symbian, I feel a piece of my logical mind get torn to pieces.