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.

Sunday, August 16, 2009

Amarok 2: Universal Mass Storage Device Support Here


Ok, so you can now do the usual with UMS devices that you can with other devices. Due to some issues with Solid detection in Amarok, to make sure your device is found you must:

- create a file ".is_audio_player" at the root of your device
- start Amarok
- the device should show up next to the local collection
- right-click it and click "read device"

Then it should parse, and you're ready to go. You can copy and delete files from outside of Amarok, and Amarok should update accordingly. Copying and deleting from within Amarok, and editing track details also works.

OPTIONAL:
If you want to set a music folder on your device, then put this in your ".is_audio_player" file:

audio_folder=musicfolder

... where "musicfolder" is a relative path from the mountpoint of the device, so this would set the folder to: /media/yourdevicemountpoint/musicfolder

NOTES:
- reading of the device is not done automatically right now since we don't want unpleasant surprises for people with huge external hard drives that happen to be mounted
- yes, the ability to set custom device paths and mountpoints will be coming, but not just yet
- yes, support for multiple music folders on the device is planned
- no, artwork isn't yet supported
- no, saving playlists isn't yet supported

And... bug reports are now welcome, so test away!

Thursday, August 6, 2009

Coming Soon to Amarok 2...