Archive

Archive for the ‘Kubuntu’ Category

Create a GTK+ application on Linux with Objective-C

December 8th, 2010 8 comments

As sort of follow-up-in-spirit to my older post I decided to share a really straight forward way to use Objective-C to build GTK+ applications.

Objective-what?

Objective-C is an improvement to the iconic C programming language that remains backwards compatible while adding many new and interesting features. Chief among these additions is syntax for real objects (and thus object-oriented programming). Popularized by NeXT and eventually Apple, Objective-C is most commonly seen in development for Apple OSX and iOS based platforms. It ships with or without a large standard library (sometimes referred to as the Foundation Kit library) that makes it very easy for developers to quickly create fast and efficient programs. The result is a language that compiles down to binary, requires no virtual machines (just a runtime library), and achieves performance comparable to C and C++.

Marrying Objective-C with GTK+

Normally when writing a GTK+ application the language (or a library) will supply you with bindings that let you create GUIs in a way native to that language. So for instance in C++ you would create GTK+ objects, whereas in C you would create structures or ask functions for pointers back to the objects. Unfortunately while there used to exist a couple of different Objective-C bindings for GTK+, all of them are quite out of date. So instead we are going to rely on the fact that Objective-C is backwards compatible with C to get our program to work.

What you need to start

I’m going to assume that Ubuntu will be our operating system for development. To ensure that we have what we need to compile the programs, just install the following packages:

  1. gnustep-core-devel
  2. libgtk2.0-dev

As you can see from the list above we will be using GNUstep as our Objective-C library of choice.

Setting it all up

In order to make this work we will be creating two Objective-C classes, one that will house our GTK+ window and another that will actually start our program. I’m going to call my GTK+ object MainWindow and create the two necessary files: MainWindow.h and MainWindow.m. Finally I will create a main.m that will start the program and clean it up after it is done.

Let me apologize here for the poor code formatting; apparently WordPress likes to destroy whatever I try and do to make it better. If you want properly indented code please see the download link below.

MainWindow.h

In the MainWindow.h file put the following code:

#import <gtk/gtk.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>

//A pointer to this object (set on init) so C functions can call
//Objective-C functions
id myMainWindow;

/*
* This class is responsible for initializing the GTK render loop
* as well as setting up the GUI for the user. It also handles all GTK
* callbacks for the winMain GtkWindow.
*/
@interface MainWindow : NSObject
{
//The main GtkWindow
GtkWidget *winMain;
GtkWidget *button;
}

/*
* Constructs the object and initializes GTK and the GUI for the
* application.
*
* *********************************************************************
* Input
* *********************************************************************
* argc (int *): A pointer to the arg count variable that was passed
* in at the application start. It will be returned
* with the count of the modified argv array.
* argv (char *[]): A pointer to the argument array that was passed in
* at the application start. It will be returned with
* the GTK arguments removed.
*
* *********************************************************************
* Returns
* *********************************************************************
* MainWindow (id): The constructed object or nil
* arc (int *): The modified input int as described above
* argv (char *[]): The modified input array modified as described above
*/
-(id)initWithArgCount:(int *)argc andArgVals:(char *[])argv;

/*
* Frees the Gtk widgets that we have control over
*/
-(void)destroyWidget;

/*
* Starts and hands off execution to the GTK main loop
*/
-(void)startGtkMainLoop;

/*
* Example Objective-C function that prints some output
*/
-(void)printSomething;

/*
********************************************************
* C callback functions
********************************************************
*/

/*
* Called when the user closes the window
*/
void on_MainWindow_destroy(GtkObject *object, gpointer user_data);

/*
* Called when the user presses the button
*/
void on_btnPushMe_clicked(GtkObject *object, gpointer user_data);

@end

MainWindow.m

For the class’ actual code file fill it in as show below. This class will create a GTK+ window with a single button and will react to both the user pressing the button, and closing the window.

#import “MainWindow.h”

/*
* For documentation see MainWindow.h
*/

@implementation MainWindow

-(id)initWithArgCount:(int *)argc andArgVals:(char *[])argv
{
//call parent class’ init
if (self = [super init]) {

//setup the window
winMain = gtk_window_new (GTK_WINDOW_TOPLEVEL);

gtk_window_set_title (GTK_WINDOW (winMain), “Hello World”);
gtk_window_set_default_size(GTK_WINDOW(winMain), 230, 150);

//setup the button
button = gtk_button_new_with_label (“Push me!”);

gtk_container_add (GTK_CONTAINER (winMain), button);

//connect the signals
g_signal_connect (winMain, “destroy”, G_CALLBACK (on_MainWindow_destroy), NULL);
g_signal_connect (button, “clicked”, G_CALLBACK (on_btnPushMe_clicked), NULL);

//force show all
gtk_widget_show_all(winMain);
}

//assign C-compatible pointer
myMainWindow = self;

//return pointer to this object
return self;
}

-(void)startGtkMainLoop
{
//start gtk loop
gtk_main();
}

-(void)printSomething{
NSLog(@”Printed from Objective-C’s NSLog function.”);
printf(“Also printed from standard printf function.\n”);
}

-(void)destroyWidget{

myMainWindow = NULL;

if(GTK_IS_WIDGET (button))
{
//clean up the button
gtk_widget_destroy(button);
}

if(GTK_IS_WIDGET (winMain))
{
//clean up the main window
gtk_widget_destroy(winMain);
}
}

-(void)dealloc{
[self destroyWidget];

[super dealloc];
}

void on_MainWindow_destroy(GtkObject *object, gpointer user_data)
{
//exit the main loop
gtk_main_quit();
}

void on_btnPushMe_clicked(GtkObject *object, gpointer user_data)
{
printf(“Button was clicked\n”);

//call Objective-C function from C function using global object pointer
[myMainWindow printSomething];
}

@end

main.m

To finish I will write a main file and function that creates the MainWindow object and eventually cleans it up. Objective-C (1.0) does not support automatic garbage collection so it is important that we don’t forget to clean up after ourselves.

#import “MainWindow.h”
#import <Foundation/NSAutoreleasePool.h>

int main(int argc, char *argv[]) {

//create an AutoreleasePool
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

//init gtk engine
gtk_init(&argc, &argv);

//set up GUI
MainWindow *mainWindow = [[MainWindow alloc] initWithArgCount:&argc andArgVals:argv];

//begin the GTK loop
[mainWindow startGtkMainLoop];

//free the GUI
[mainWindow release];

//drain the pool
[pool release];

//exit application
return 0;
}

Compiling it all together

Use the following command to compile the program. This will automatically include all .m files in the current directory so be careful when and where you run this.

gcc `pkg-config –cflags –libs gtk+-2.0` -lgnustep-base -fconstant-string-class=NSConstantString -o “./myprogram” $(find . -name ‘*.m’) -I /usr/include/GNUstep/ -L /usr/lib/GNUstep/ -std=c99 -O3

Once complete you will notice a new executable in the directory called myprogram. Start this program and you will see our GTK+ window in action.

If you run it from the command line you can see the output that we coded when the button is pushed.

Wrapping it up

There you have it. We now have a program that is written in Objective-C, using C’s native GTK+ ‘bindings’ for the GUI, that can call both regular C and Objective-C functions and code. In addition, thanks to the porting of both GTK+ and GNUstep to Windows, this same code will also produce a cross-platform application that works on both Mac OSX and Windows.

Source Code Downloads

Source Only Package
File name: objective_c_gtk_source.zip
File hashes: Download Here
File size: 2.4KB
File download: Download Here

Originally posted on my personal website here.




I am currently running a variety of distributions, primarily Linux Mint 17.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.

One week, three distributions (Day 7: Conclusions)

October 24th, 2010 No comments

Well it’s been an interesting week. I’ve gotten to try out three new distributions and share my thoughts with everyone here. My original goal was to see which one of these distributions offered the best first impression and declare that one as the ‘winner’. However in actually working my way through these great releases I have changed my mind somewhat.

What makes a great distribution great?

This is a very interesting question that I’m sure would generate a wide array of unique and passionate responses. Some prefer ease of use, while others demand nothing less than complete control over what they can tweak. There are people who swear by using nothing but open source solutions, while others are happy to add proprietary code into the mix as well. This is the great thing about Linux, we get so many choices which means we get to decided what we want.

Unfortunately this has also resulted in a bit of distribution zealotry; like choosing Ubuntu over Fedora, or Arch over OpenSUSE is somehow taking a side in some giant war. Instead of all of the infighting we should be celebrating the fact that when Ubuntu comes out with a new piece of user-friendly software, or Fedora introduces a new awesome technology, we can share and integrate it right into all distributions.

So what makes a great distribution great? A distribution is great because it works for you, it suites your needs, fits your personality and lets you do what you want to do. At the end of the day isn’t that what open source is about?

Final thoughts

OK enough of the preachy writing. I think that all of the distributions I have tested this week were very good. They each embody the spirit of open source in their own little ways.

Kubuntu 10.10

Awards: The most improved release. Most likely to recover lost KDE fans.

I was extremely impressed with this release. The folks over at the Kubuntu project deserve a huge round of applause for their continued work on this often forgotten Ubuntu sibling. This release is unlike any other that I’ve tried from Kubuntu, and I hope it marks a turning point in the distribution’s history. If the next release sees anywhere close to the improvement that this release did it may even unseat Ubuntu as the go to Linux release. If you haven’t tried out this release I urge you to give it a shot.

Ubuntu 10.0

Awards: The most refined. Most likely to be installed on a new Linux user’s computer.

Ubuntu makes a return from its last long-term support (LTS) release with this stellar offering. For a release that is meant to experiment with changes, which might eventually be incorporated into a future LTS release, this version feels as polished as ever. The new theme, font, store and integration features make this an absolutely solid release. If you’re an Ubuntu user I’m sure you have already upgraded. If you develop for a different distribution, this might still be worth looking into if only to steal the good parts for your release of choice. Either way I think this release of Ubuntu marks a whole new level of application integration on the Linux desktop and I am excited to see where they go next with it.

Linux Mint Debian Edition

Awards: The most advanced. Most likely to see the fastest improvement.

For people who have been using Debian for a while now this release will feel right at home. It combines the best parts of Debian testing, modern software, stability and thousands of packages, with the Linux Mint team’s renown ability to iron out the kinks in any Linux distribution. I think that this release will see so much improvement in the next couple of months that it has the potential to steal users away from other rolling release distributions with its easy to use desktop. While this current iteration does have some issues I hardly think that they are anything to run away from. For technical users looking for the newest stuff, while hoping avoiding the vast majority of headaches other distributions can cause, this one is for you.

My Choice

For me personally I have been very happy with Linux Mint 9 and look forward to version 10 when it ships later this year. Until then however I think I will be sticking with the one that most closely resembles my current set up. No not Linux Mint Debian Edition, but Ubuntu 10.10. That being said I do look forward to giving Fedora 14 and Linux Mint 10 a ride soon.




I am currently running a variety of distributions, primarily Linux Mint 17.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.

One week, three distributions (Day 2: Kubuntu 10.10)

October 17th, 2010 3 comments

As noted in my previous post I have decided to try out a mini experiment wherein I test out three recently released distributions (Kubuntu 10.10, Ubuntu 10.10 and Linux Mint Debian Edition) giving each 48 hours to leave me with either a brilliant or terrible first impression. First on the docket was Kubuntu 10.10.

Install

Kubuntu’s installer is absolutely beautiful. It is simple, sleek and gorgeous. As you work your way through the very simple wizard system it begins to copy files in the background which makes the whole install process much faster than in previous iterations. I’m not exaggerating in the least when I say that this is perhaps the best Linux installer I have ever used.

‘New’ Desktop

When I first booted into the desktop I was very pleasantly surprised. I haven’t used KDE since version 4.3 when I had given up on it because, while beautiful and functional, there were just too many rough edges. It seems to be an Internet cliché at this point but I am going to throw it out there anyway: KDE 4.5 is the KDE release you have been waiting for. Most, if not all, of the rough edges that have plagued the 4.x series in the past have been ironed out and replaced with extremely user friendly, soft and presentable windows and options that just make sense.

For instance the new network connection interface is stupidly simple. If you can’t figure out how to connect to a network (hint: you just click on it) perhaps you shouldn’t be using a computer in the first place.

All of these refinements are accented by the new notification system that not only provides a universal area for all program events, but also fixes almost all of my complaints about the previous versions. You can now scroll through the notifications, instead of watching them grow off-screen, and you can even filter by the individual applications that are generating said notifications. Think of it like a unified e-mail inbox versus individual account inboxes.

Along similar lines the new, subtle, system tray notifications are simply awesome. Take a look at this screen-shot of the animated file copy indicator.

Its a bit hard to see in the screen-shot but the white pie in the upper right is actually the progress indicator. Unlike in GNOME where you get either a file copy dialog, or a motionless tray icon, I now have no clutter and yet full functionality. You couldn’t make a better system for displaying the information needed. “But what if I want to see more information?” Like everything else, this indicator is fully integrated into the notification system and a single click brings up the progress bar and file copy information. I suppose the point that I’m trying to get across is that this KDE release has done a lot of work in doing away with the clutter that you don’t really care to see 9 times out of 10.

Driver installation is once again handled by jockey, just like in Ubuntu. This time however I had absolutely no issues with it crashing or just not working unexpectedly.

‘New’ Software

I also decided to try out the default software selection to see what had changed. Plus I figured this would be a non-bias way to get a real first impression/feel of the distribution.

Software Management

KPackageKit has always been a sore part of (EDIT: the KDE SC) Kubuntu for me. It ‘worked’ but it was far from intuitive, helpful and, sometimes, even useful. The new KPackageKit is an entirely different story. It is far more like a mix between Synaptic and the Ubuntu Software Center and it pulls it off beautifully.

You can now browse by category or search by application (not just package) name. In addition it now also features a list of installed software which is something so painfully obvious that it is hard to believe that this functionality hadn’t existed previously. These three changes alone have completely reinvented KPackageKit in my opinion. I now almost look forward to opening it up to find new software, whereas in previous releases I would go straight to the command line just to avoid it.

Browser

The browser that ships with Kubuntu 10.10 is rekonq 0.6.1, which is essentially a re-spin of Konqueror but instead of using the KHTML rendering engine it uses the faster and more compatible WebKit. While there is nothing overly special about this browser it does feel very Chrome-like and was good enough that I never even bothered to switch to anything else.

One nice thing about it is that it integrates seamlessly into the KWalletManager password store. It also did an excellent job of prompting me to install all of the proprietary codecs so that I could watch YouTube or whatever. The only low point was a lack of a Moonlight plugin but I assume that is probably forthcoming.

Instant Messaging

The default instant messenger is Kopete 1.0.80 which is a fine instant messenger that integrates nicely into the notification system. The real problem with Kopete however is that it simply hasn’t seen nearly as much improvement as the rest of the distribution’s software. If you showed me the Kopete that shipped with KDE 4.3 and the one in KDE 4.5 I couldn’t tell you the difference. From my tests (using the Windows Live Messenger service) I didn’t see anything new. Oddly enough, just like the last time I used Kopete, this version recognizes my laptop’s webcam but there is no option to use it anywhere inside of a chat. Don’t get me wrong, I’m sure a lot of work has been put into Kopete since 4.3 but the problem is I would never know it.

KMail

KMail, now at version 1.13.5, once again takes the e-mail duties for KDE and once again I find it to be far too complicated, cluttered and messy. Sure it is very function and has a boat load of options but at the end of the day I just want to read my e-mail. A good e-mail client should be invisible to the user and KMail is certainly not.

KTorrent

I’ve always liked KTorrent and this release (version 4.0.3) is no different. If you don’t feel like messing around and just want things to work then default settings are perfect. But if you like to tweak your settings at all KTorrent offers every major feature that you’re looking for.

Amarok

I’ll be honest, I don’t really like Amarok and never have. That being said I was determined to give it a fair try and I found it to be a very functional media player. I still do think that it is a bit too complicated for the average person though. What do I mean by this? Well for example why do I have to right click and then choose a menu option to listen to my music? Why doesn’t double click just do it?

One area where Amarok does excel is in its music importing wizard. It is very simple and full of sensible defaults that makes ripping tracks from a CD super simple. Kubuntu ships with Amarok version 2.3.2.

Dragon Player

Like GNOME’s Totem, KDE’s Dragon Player (version 2.0) is a no fuss video playback application. There really isn’t much to say about this as it is a very feature lean and purpose focused player. I do however have to give it a special mention; I never had a single vsync issue while using Dragon Player (even with my troublesome ATI graphics card). Not even VLC can say the same without some fiddling around in the options menu.

Kontact

Kontact 4.4.6 is KDE’s answer to Microsoft Outlook. It provides e-mail, calendar, tasks, RSS and more by basically displaying a single user interface that joins together KMail, Akregator, KOrganizer and more in a single window. While this is an excellent way to achieve the end result it does unfortunately mean that the user experience suffers a bit when each application chooses to do things slightly different from one another. Again this is one area that I didn’t notice much difference from the last time I used it.

Conclusion (Konclusion?)

This Kubuntu release is so much improved its hard to believe it was done by the same people who have worked on the previous iterations (I mean that as a compliment… somehow ;)). If you’ve been put off by KDE in the past or even if you’re just looking for a modern KDE distribution then I highly recommend checking this release out.

Pros:

  • A huge improvement over previous releases
  • Lots of refinements that make using it a pleasure

Cons:

  • Some of the KDE software (not the desktop) could still use some work
  • Plasmas are cool and all but I don’t think they are quite as amazing as the KDE team keeps pushing them to be



I am currently running a variety of distributions, primarily Linux Mint 17.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.
Categories: KDE, Kubuntu, Tyler B Tags: ,

One week, three distributions (Day 0)

October 15th, 2010 No comments

With the recent releases of Linux Mint Debian Edition, Ubuntu and Kubuntu 10.10 I am once again starting to feel that need to hop around and try something new out. That’s not to say that my current distribution of choice (Linux Mint 9) is a bad one, quite the opposite in fact. I am however curious to see what these new releases do, well, new. That being said I’ve set myself up a little experiment of sorts: try each distribution for two days each and on the 7th day choose the best from among the three. Now obviously this isn’t a very fair test, 48 hours is hardly enough to definitely test which of these distributions is truly the best. What it will, hopefully, show though is which distribution gives off the best first impression.

So buckle up and stay tuned, this week should hopefully be an interesting one.




I am currently running a variety of distributions, primarily Linux Mint 17.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.

Fixing gnustep-devel in Ubuntu 10.04

May 17th, 2010 No comments

When Ubuntu 10.04 was released it represented the most modern incarnation of Canonical’s premier Linux desktop distribution. However not all things were better in this release. For myself I immediately noticed a problem while trying to install the gnustep-devel development libraries for GNUstep and Objective-C. I was greeted with this oh so lovely error message:

Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.
The following information may help resolve the situation:

The following packages have unmet dependencies:
gnustep-devel: Depends: gorm.app but it is not installable
E: Broken packages

So essentially I was left with the following choice: install the missing Gorm.app package from the repository (which wasn’t there) or don’t install gnustep-devel. Thankfully it was pointed out to me that I could perhaps see if the package still existed in the Debian repository instead. So off to http://www.debian.org/distrib/packages I went and after a quick search I found what I was looking for! I recalled reading somewhere that Ubuntu synchronizes with Debian testing (A.K.A. squeeze) at the start of every round of development, so I figured that would be the best package to grab. A short download and install later Gorm.app was finally on my system. With the dependencies now met it was a breeze to install the rest of the development files using a simple

sudo apt-get install gnustep-devel

And there you have it. By installing a single package from the Debian repository you too can get around the problem. For reference I have also filed a bug report with Ubuntu at Launchpad here.

Originally posted on my personal website here.




I am currently running a variety of distributions, primarily Linux Mint 17.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.

Installing Apache on Ubuntu 9.10

March 9th, 2010 2 comments

Tonight I decided that I’d like to be able to do some web development from home. The basic suite is called LAMP, which stands for Linux, Apache, MySQL, and PHP; the standard web developers toolkit. After a little bit of googling, I found this great guide from Tux Tweaks that walked me through the entire process. Once installed, my system hosted any files in the /var/www/ directory, and had MySQL and phpMyAdmin installed for database access.

Enjoy!




On my Laptop, I am running Linux Mint 12.
On my home media server, I am running Ubuntu 12.04
Check out my profile for more information.

The Great Linux Browser War (Well… sort of)

February 13th, 2010 1 comment

Recently while browsing the Internet I noticed that Mozilla Firefox was taking up an awfully large amount of RAM. In fact it’s RAM use continued to grow even though I had not navigated to any new website or even touched it at all! Being a KDE user I decided to try the same website within Konqueror, the KDE web browser that everyone seems to toss to the side right after install. To my amazement Konqueror seemed to render the same website, using much less RAM, and better yet it’s RAM use remained static. Perhaps there was something more to this ‘throw-away’ browser than I had first thought. And thus began my idea for a series of comparisons of four of the most popular Linux web browsers: Firefox, Chromium, Konqueror and Epiphany.

Note: The numbers you are going to see below are purely anecdotal and are based on my own personal experiences, which might not represent your own.  For the record I am running Kubuntu 9.10 with the 2.6.31-19 kernel.

Packages I had to install

This is simply a list of packages I installed for each browsers to sort of give you an idea of what to expect.

Firefox Konqueror Chromium Epiphany
firefox-3.5, firefox-3.5-branding konqueror chromium-browser ephiphany-browser, epiphany-browser-data

Startup speed (from a cold start – i.e. from reboot)

To test this I rebooted the computer and then opened the browsers for the first time.

Firefox Konqueror Chromium Epiphany
~4.5 seconds ~2.1 seconds ~3.7 seconds ~2.8 seconds

Startup speed (from a cached start – i.e. after opening and closing the program)

To test this I rebooted the computer, then opened the browsers for the first time and closed them. Then I opened them a second time and recorded the time.

Firefox Konqueror Chromium Epiphany
~1.5 seconds ~1.2 seconds ~1.1 seconds ~1.2 seconds

Memory usage (about:blank)

This is how much memory the browser took to display the web page in brackets. The memory inside of the brackets is the amount of shared memory each browser uses. This of course could change depending on your system and setup. Where there are multiple numbers separated by plus signs it means that the browser spawns multiple processes which each take up memory.

Firefox Konqueror Chromium Epiphany
24.6MiB (22.7MiB) 10.8MiB (20.8MiB) 6.6MiB (21.5MiB) + 1.6MiB (1.6MiB) + 2.3MiB (6.4MiB) + 1.5MiB (7.6MiB) 9.4MiB (20.5MiB)

Memory usage (about:blank -> kubuntu.org)

For this test I first loaded the browser to the homepage, in this case about:blank, and then navigated to the website www.kubuntu.org. In Konqueror’s case it spawned a few small KIO processes which I assume did the actually downloading of the webpage. I have averaged their values below.

Firefox Konqueror Chromium Epiphany
35.7MiB (24.1MiB) 22.6MiB (23.3MiB) + 4 x kio_http: 5.05MiB (6.2MiB) 7.9MiB (18.2MiB) + 13.6MiB (11.3MiB) + 1.6MiB (1.7MiB) + 1.5MiB (7.6MiB) 18.3MiB (23.1MiB)

Memory usage (about:blank -> kubuntu.org | google.com | bing.com)

For this test I once again started with the about:blank homepage and then opened the websites in different tabs.

Firefox Konqueror Chromium Epiphany
41.7MiB (24.6MiB) 30.5MiB (24.0MiB) + 4 x kio_http: 5.3MiB (6.4MiB) 9.0MiB (28.8MiB) + 11.4MiB (11.3MiB) + 1.6MiB (1.7MiB) + 6.8MiB (11.0MiB) + 9.3MiB (11.5MiB) + 1.5MiB (7.6MiB) 21.8MiB (24.8MiB)

Memory usage (about:blank -> kubuntu.org | google.com | bing.com) 2 minutes later

For this test I started with the above test and then waited two minutes and re-recorded the memory usage. This was to see if the browsers suffer from any sort of memory leaks, something Firefox has been famous for over the years.

Firefox Konqueror Chromium Epiphany
38.45MiB (24.6MiB) – a decline of about 0.03MiB. 30.7MiB (24.0MiB) – a growth of about 0.002MiB/second. The kio_http’s stayed the same. 13.2MiB + (20.8MiB) + 11.4MiB (11.3MiB) + 1.6MiB (1.7MiB) + 6.8MiB (11.0MiB) + 9.3MiB (11.5MiB) + 1.5MiB (7.6MiB) – a growth of about 0.04MiB/second. 21.8MiB (24.8MiB) – no change

Memory usage (about:blank -> kubuntu.org | google.com | bing.com | ubuntu.com)

Same as above but with one more tab.

Firefox Konqueror Chromium Epiphany
46.0MiB (24.9MiB) 45.1MiB (24.0MiB) + 6 x kio_http: 5.22MiB (6.4MiB) 9.3MiB (24.4MiB) + 14.2MiB (16.2MiB) + 9.3MiB (11.4MiB) + 13.5MiB (11.2MiB) + 11.6MiB (10.8MiB) + 1.6 (1.7MiB) + 1.5MiB (7.6MiB) 29.0MiB (24.9MiB)

Memory usage (about:blank -> kubuntu.org | google.com | bing.com | ubuntu.com) 2 minutes later

Same as above but with one more tab.

Firefox Konqueror Chromium Epiphany
77.8MiB (24.9MiB) – a growth of about 0.27MiB/second 50.2MiB (24.0MiB) – a growth of about 0.04MiB/second. The kio_http’s stayed the same. 9.3MiB (24.4MiB) + 23.7MiB (16.2MiB) + 9.3MiB (11.4MiB) + 13.5MiB (11.2MiB) + 11.6MiB (10.8MiB) + 1.6MiB (1.7MiB) + 1.5MiB (7.6MiB) – a growth of about 0.08MiB/second 33.2MiB (24.9MiB) – a growth of about 0.04MiB/second

Noticeable rendering glitches in pages viewed

None of the browsers had rendering glitches except for Konqueror. In Konqueror Bing’s search bar was offset from where it should be and on Kubuntu’s website the header image was overlapping text that it shouldn’t have.

Acid 2 test (http://www.webstandards.org/files/acid2/test.html)

The (now old) Acid 2 test.

Firefox Konqueror Chromium Epiphany
100% 100% 100% 100%

Acid 3 test (http://acid3.acidtests.org/)

How well did the browsers handle the Acid 3 test?

Firefox Konqueror Chromium Epiphany
93% 89% (linktest failed) 100% 100%

SunSpider JavaScript Benchmark (http://www2.webkit.org/perf/sunspider-0.9/sunspider.html)

The classic JavaScript benchmark test!

Firefox Konqueror Chromium Epiphany
Total: 2380.2ms
Click here to see full results.
Total: 2940.2ms
Click here to see full results.
Total: 445.2ms
Click here to see full results.
Total: 794.8ms
Click here to see full results.

Conclusion

Well there you have it. Rather than ‘rate’ each browser I’m going to leave it up to you to weigh the merits of each given the above information. Even though Firefox might not be the most technically superior browser it does have the advantage of being very popular and having an excellent add-on system. Then again Epiphany can use most of those add-ons as well. Chromium, based off of Google’s Chrome browser, is also a new favourite for a lot of people and is obviously the fastest in terms of JavaScript. Being a KDE user, Konqueror might be the best browser for you thanks to its infinite customization and uniform look.

Linux is all about personalization and I think everyone should extend that to the browser they use. Who knows you might just find one you like even more.




I am currently running a variety of distributions, primarily Linux Mint 17.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.

Enabling Video Thumbnail Previews in Dolphin

January 31st, 2010 3 comments

Just a quickie here – if you keep video of any kind on your Kubuntu 9.10 system, you may have noticed that the Dolphin file manager doesn’t show thumbnail previews of video files by default.  Turns out that it’s a very easy (if non-obvious) feature to enable. Simply follow these steps:

  1. Open up kPackageKit
  2. Search for and install the package mplayerthumbs – it has three dependencies, which include mplayer itself (I use VLC, but to each his own)
  3. Back in Dolphin, navigate to Settings > Configure Dolphin > General > Previews Tab
  4. Scroll down in the list, and you should be able to see an option called Video Files (MPlayerThumbs) – Check that box
  5. Drag the Maximum file size slider all the way to the right, and hit apply

Navigate to a folder that contains video files, and watch as they slowly begin to populate. Be patient though, it can take a few minutes if you have a lot of media. You should also note that it doesn’t work with all WMV files.

Thanks to youTube user gotbletu for the following informative video that I ripped these instructions off from:




On my Laptop, I am running Linux Mint 12.
On my home media server, I am running Ubuntu 12.04
Check out my profile for more information.

Eclipse in Ubuntu-based distributions missing update site list

January 17th, 2010 2 comments

If any of you are using a Ubuntu-based distribution (Ubuntu, Kubuntu, Xubuntu, Linux Mint) and do any sort of Eclipse development, the current 3.5.1 package available with the distribution (3.5.1+repack~1-0ubuntu3) is missing the standard Galileo and 3.5 update sites in the Available Software Sites list:

This bug has already been reported to Launchpad, but here are the relevant sites you can add to enable Galileo updates and install new plugins:

Name: The Eclipse Project Updates
Location: http://download.eclipse.org/eclipse/updates/3.5

Name: Galileo
Location: http://download.eclipse.org/releases/galileo

(This has also been cross-posted to my personal site, “Bus error”.)




I am currently running Ubuntu 14.04 LTS for a home server, with a mix of Windows, OS X and Linux clients for both work and personal use.
I prefer Ubuntu LTS releases without Unity - XFCE is much more my style of desktop interface.
Check out my profile for more information.

Pulse Audio Nonsense

January 4th, 2010 3 comments

Just a heads up: This isn’t the kind of post that contains answers to your problems. It is, unfortunately, the kind of post that contains a lot of the steps that I took to fix a problem, without much information about the order in which I performed them, why I performed them, or what they did. All that I can tell you is that after doing some or all of these things in an arbitrary order, stuff seemed to work better than it did before.

It’s funny how these posts often seem to come about when trying to get hardware related things working. I distinctly remember writing one of these about getting hardware compositing working on Debian. This one is about getting reliable audio on Kubuntu 9.10.

You see, I have recently been experiencing some odd behaviour from my audio stack in Kubuntu. My machine almost always plays the startup/shutdown noises, Banshee usually provides audio by way of GStreamer, videos playing in VLC are sometimes accompanied by audio, and Flash videos almost never have working sound. Generally speaking, restarting the machine will change one or all of these items, and sometimes none. The system is usuable, but frustrating (although I might be forgiven for saying that having no audio in Flash prevents me from wasting so much time watching youtube videos when I ought to be working).

Tonight, after some time on the #kubuntu IRC channel and the #pulseaudio channel on freenode, I managed to fix all of that, and my system now supports full 5.1 surround audio, at all times, and from all applications. Cool, no? Basically, the fix was to install some PulseAudio apps:

sudo apt-get install pulseaudio pavucontrol padevchooser

Next, go to System Settings > Multimedia, and set PulseAudio as the preferred audio device in each of the categories on the left. Finally, restart the machine a couple of times. If you’re lucky, once you restart and run pavucontrol from the terminal, you’ll see a dialog box called Volume Control. Head over to the Configuration tab, and start choosing different profiles until you can hear some audio from your system. Also, I found that most of these profiles were muted by default – you can change that on the Output Devices tab. If one of the profiles works for  you, congratulations! If not, well, I guess you’re no worse off than you were before. I warned you that this was that kind of post.

Also, while attempting to fix my audio problems, I found some neat sites:

  • Colin Guthrie – I spoke to this guy on IRC, and he was really helpful. He also seems to write a lot of stuff for the PulseAudio/Phonon stack in KDE. His site is a wealth of information about the stack that I really don’t understand, but makes for good reading.
  • Musings on Maintaining Ubuntu – Some guy named Dan who seems to be a lead audio developer for the Ubuntu project. Also a very interesting read, and full of interesting information about audio support in Karmic.
  • A Script that Profiles your Audio Setup – This bash script compiles a readout of what your machine thinks is going on with your audio hardware, and automatically hosts it on the web so that you can share it with people trying to help you out.
  • A Handy Diagram of the Linux Audio Stack – This really explains a lot about what the hell is going on when an application tries to play audio in the Linux.
  • What the Linux Audio Stack Seems Like – This diagram reflects my level of understanding of Linux audio. It also reminds me of XKCD.
  • Ardour – The Digital Audio Workstation – In the classic tradition of running before walking, I just have to try this app out.



On my Laptop, I am running Linux Mint 12.
On my home media server, I am running Ubuntu 12.04
Check out my profile for more information.