Thursday, January 15, 2009

German translation of Firebird security article

There's an article on the Firebird Documentation web-page about Firebird File and Metadata Security. Since this is an interesting topic to our customers, I took the time to translate it to German.


The article describes the fundamental problems in securing network connections. One of the biggest problem is key management. Since the Firebird server is usually controlled by and installed at the client's site, you don't have any control over it. So, theoretically, someone could always build his own Firebird server to spy on the password. But that's only one of the problems discussed.


Many thanks to Geoff Worboys, the author of the original article, and Paul Vinkenoog for publishing it on the official web-site.

Wednesday, December 3, 2008

Embedding Qt Widgets into QtWebKit

Qt has it's awesome built-in WebKit support which makes it extremely easy to have full-featured browser/html-viewer capabilities in your application (including JavaScript!).


It is possible to embedd any Qt Widget into your QWebPage. The necessary steps for that are quite simple. You have to derive from QWebPage and overload the createPlugin() function, make sure that PluginsEnabled is set for the QWebPage's settings and assign that WebPage to any QWebView.


It is now possible to embed widgets that are known to Qt's runtime MetaType-system into a WebView. You can make a widget accessible using both, the Q_DECLARE_METATYPE macro and the qRegisterMetaType function.


To show the widget, you have to add an HTML object-Tag to your page, like this:


<object type="application/x-qt-plugin"; classid="YourClass" name="myObject" />
It's now visible and can even be manipulated through JavaScript. You can access it's properties and it's public slots.


I've create a small demo that shows you how to do it and what is possible. It consists of a QMake-project (.pro-file), two pairs of header and implementation files for the MyWebKit/MyWebPage and MyWidget classes and a demo HTML page. It should compile and run on any supported platform (Windows, Linux, Mac). Of course only when QtWebKit is enabled in the Qt installation.


Step 1


First, we should derive from the necessary QtWebKit-classes to create our own MyWebView class that always has Qt plug-ins enabled.


MyWebKit.h



#ifndef MY_WEBKIT_H
#define MY_WEBKIT_H
#include
#include

// Derive from QWebPage, because a WebPage handles
// plugin creation
class MyWebPage: public QWebPage
{
Q_OBJECT
protected:
QObject *createPlugin(
const QString &classid,
const QUrl &url,
const QStringList ¶mNames,
const QStringList & paramValues);
public:
MyWebPage(QObject *parent = 0);
};

// Derive a new class from QWebView for convenience.
// Otherwise you'd always have to create a QWebView
// and a MyWebPage and assign the MyWebPage object
// to the QWebView. This class does that for you
// automatically.
class MyWebView: public QWebView
{
Q_OBJECT
private:
MyWebPage m_page;
public:
MyWebView(QWidget *parent = 0);
};

#endif


MyWebKit.cpp



#include "MyWebKit.h"

#include

MyWebPage::MyWebPage(QObject *parent):
QWebPage(parent)
{
// Enable plugin support
settings()->setAttribute(QWebSettings::PluginsEnabled, true);
}

QObject *MyWebPage::createPlugin(
const QString &classid,
const QUrl &url,
const QStringList ¶mNames,
const QStringList & paramValues)
{
// Create the widget using QUiLoader.
// This means that the widgets don't need to be registered
// with the meta object system.
// On the other hand, non-gui objects can't be created this
// way. When we'd like to create non-visual objects in
// Html to use them via JavaScript, we'd use a different
// mechanism than this.
QUiLoader loader;
return loader.createWidget(classid, view());
}

MyWebView::MyWebView(QWidget *parent):
QWebView(parent),
m_page(this)
{
// Set the page of our own PageView class, MyPageView,
// because only objects of this class will handle
// object-tags correctly.
setPage(&m_page);
}

It's now possible to use Qt classes using the above-mentioned object tags.


Step 2


The second step is to create a class that's known by the Qt runtime meta type system. We can't directly use Qt widgets in this way, because runtime meta types need copy-
constructors. So we derive from a Qt widget and add a kinda dull copy-constructor to it.

MyWidget.h



#ifndef MY_WIDGET_H
#define MY_WIDGET_H

#include
#include

class MyCalendarWidget: public QCalendarWidget
{
Q_OBJECT
public:
MyCalendarWidget(QWidget *parent = 0);
// Q_DECLARE_METATYPE requires a copy-constructor
MyCalendarWidget(const MyCalendarWidget ©);
};
Q_DECLARE_METATYPE(MyCalendarWidget)


#endif

We use a calendar widget because it's something that doesn't already exist in HTML and could be quite useful. Additionally, it has some few properties that we'd want to access from JavaScript.


Step 3


The final step is to build the HTML page that embeds the widget and executes some JavaScript on it. Here's my example:

Test.html



<html>
<head>
<title>QtWebKit Plug-in Test</title>
</head>
<body>
<object type="application/x-qt-plugin" classid="MyCalendarWidget" name="calendar" height=300 width=500></object>
<script>
calendar.setGridVisible(true);
calendar.setCurrentPage(1985, 5);
</script>
</body>
</html>

The example set the gridVisible property to true and shows the month that I am born in. Of course, the possibilities seem endless! :-)


Conclusion


The only thing that I am still missing is connecting signals to JavaScript functions, similar to what you do with AJAX. It's possible to export non-visual objects and use them from within JavaScript, too (think of a database connection, for example).


You can download the complete project, which should work out-of-the-box when you have Qt with WebKit support installed, here

Friday, September 12, 2008

Nekthuth - Making Vim Love Lisp

My friend DieMumiee pointed me to a project call Nekthuth that is supposed to be a mini-version of slime, just for my beloved Vim. The web-site looks promising, there are even screenshots and short, but good documentation. Using it it's quite easy to get Nekthuth installed and getting started.


However, my current SBCL is kinda broken. Dunno what I did to it, but after an apt-get update it segfaulted while compiling some scripts and just seems defective. I tried Nekthuth anyways, just to experience a broken pipe. Ouch. :-(


So you're invited to test it out and send reports to me and the original author. I'm quite interested in whether this project could become at least a partial slime-replacement and drive more Lispers to use Vim, and make Lisp available to Vimmers.

Monday, September 1, 2008

Google's own browser: Chrome

I usualy don't like blogging about a blog-post, but I'll make an exception for this one:


Philipp Lenssen writes in his blog that he received a comic-book from Google that describes a new, upcoming browser called Chrome. You can read about everything announced in his blog-post. IMHO there's nothing special mentioned in the list, nothing that hasn't been done before. Probably the most "exciting" thing about Chrome is that the tabs are above the address-bar, which basically makes no difference, but looks different to all the other browsers.


My guess about some technical details about Chrome is that it is built using WebKit as it's back-end. More specifically, using QtWebKit from the new Qt 4.4 release. As Google has been a customer of Trolltech for Google Earth and maybe other tools before, QtWebKit is just the best tool to build a browser from-scratch.


Because usually Google-tools are high-quality and sometimes even revolutionary, we probably can expect more than has been mentioned in the comic from the browser. Nobody will give away his secrets before launch, anyways.


Update:There is coverage of this on heise, too: Google Chrome: Google greift Microsoft mit eigenem Browser an, but it's a bit too focused on Internet Explorer, imho. Some more interesting things about the relation of Google to the Mozilla Foundation, how it evolved and how Google Chrome might change it, can be found here. In this article I've been proven right that they use WebKit as their rendering engine. No word on Qt, though. The probably most interesting thing about Chrome is separating browser tabs in individual processes.

Thursday, August 28, 2008

BeagleBoard - mini-PC at mini-Price

The guys over at BeagleBoard created an integrated chipset including CPU and graphics processing for as little as $149. With this small thingie you could do gorgeous stuff while using very little room. It'd be perfect for a Car-PC, for example. And for only $23 you even get a transparent housing for that little fella. And there's effort to port and maintain ffmpeg for this platform, making it quite multi-media-enabled.


This is probably as cool as Bug Labs wants to be. At least hardware-wise... a raw chipset is not quite as cool as a BUG, is it?

Wednesday, July 23, 2008

New watercooling setup

I've expanded my watercooling-cycle by one graphics card, namely my new (and second) GeForce 8800 GTS 640MB. My modified Thermaltake Orchestra now cools my CPU, the RAM (OCZ-RAM with factory watercooling support) and two GPUs. The only piece that is missing is the motherboard's chipset. I think I will not add watercooling to my current motherboard, but wait till I buy a new one.
Here are a few pics that show how beautiful it looks now.









Thursday, June 19, 2008

Evangelion 1.01: You are (not) alone

Since anime and computer-enthusiasm are strangely connected together, here's some anime-news.

You are (not) alone is a new movie that re-tells the first few episodes of the original Neon Genesis Evangelion anime (and manga) and is the first of a series of four movies. We all know that Neon Genesis Evangelion is one of the best animes ever created and trying to remake it is a very delicate task.


I think, however, that the studios have done a great job with this first movie! The first fifteen to twenty minutes are nearly identical to the original, with a few scenes left out and short cg-scenes added (which I think look a bit misplaced and don't fit in that well). But the later the movie progresses the more scenes are replaced, and as the story develops (which has changed a little bit, too), the movie features quite much new, high-quality content. I don't know whether it was a sound problem on my system, but there's a high pitch sound in the background every time someone talks. I imagined that it could be caused by filtering out background sounds from the original material, but I hope this is not the case. I'll try the DVD on a normal DVD-player when I get the chance for it.


Overall, I am very satisfied with this movie. As I don't have subtitles for it, yet, I didn't understand a few scenes so I couldn't follow the story 100% (my japanese is still bad). I'll watch it with subtitles again as soon as I get the hands on some and find the time, and will post an update.