The Wayback Machine - https://web.archive.org/web/20061207224206/http://frinring.wordpress.com:80/

Attracted by virtual constructs

November 16, 2006

Input to be abstracted…

Filed under: KDE — by frinring @ 4:47 pm

Work on Okteta continued a little. Yesterday I added a Find toolet, by doing also massive hacking in the program framework - not. All code that had to be done there was:

#include [kbytearraysearchtoolet.h]
...
Toolets.append( new KByteArraySearchToolet(this) );

Clean code, isn’ it?
And here the obligatory proof (as in fake^Wscreenshot) that it works:

Where is that byte string?

At the moment toolets are hardcoded, as seen above. Later they should be loadable as plugins, on demand and/or profile. I also had a look at the frameworks of Kate, KDevelop, KOffice/Flake and Ligature. Oh, don’t they all do the same with regard to managed model/view based programs, at least a little? I have the idea there is a way to merge all their frameworks into the one Okteta is based on. And I will try to come up with something of that kind, yeah :P It seems to be just a question of doing enough abstraction. And time.

Abstraction seems to be a key. When reading about parsing and operational semantics of languages it finally struck me: What else is the series of inputs by mouse/keyboard? It also is just a language of a certain grammar, and the input event handler just does the tokenizing/parsing/attributing and translates it into control commands like place cursor, select, drag etc. Now, this point of view gives me a new approach how to design the controller/toolets. And I think a promising one, once more. Did I already tell I like to design?

November 10, 2006

It’s “onBar” or “foo”, not “slotFoo”.

Filed under: KDE — by frinring @ 12:11 am

What would you think if you find somebody naming a function “publicDoSomething”? Or “voidDoSomething”? Or even “protectedVoidDoSomethingConst”?

It may be well what I think if these days I see somebody naming a function “slotDoSomething”. Although when I started with Qt programming you could see me giving similar names here and there. But this was just because I was following the great principle of Doing New Things By Example ™. And obviously some people had started before to apply some kind of partitial verbose hungarian notation to method names. And a funny thing about pattern based learning systems, like I and surely others are/were, is that they take correlating variations as hints to rules. And start to overdo: We see some methods that are slots being prefixed with “slot”, well, so we prefix them all. No idea, who started when and why, but now it’s there.

And I consider it to make the resulting code dirty. Being a slot is just a property of a method. Like “const”, the visibility, the return type or the types and number of parameters. All the latter properties is not referred to in the naming of the method, at least in the code I know. So why the being-a-slot property? I see no advantages, only disadvantages.

Methods that are given the property “slot” can be divided into two groups:

  • methods with a semantic to others
  • methods with a semantic to only the object itself

The first ones are functions which have a defined operational semantic, reflected in the method name, like “doFoo”. So other objects can call this method to achieve something. They are also set as slots because the operations done by the method make sense to be synchronized to certain events, by signals. Still the name is only based on the operational semantic. These functions are to be called by others (if only subclasses), so they are visible public or protected, e.g.:

class FooBar {
public Q_SLOTS:
void doFoo();
protected Q_SLOTS:
void doMoreFoo() const;
};

If one wants to synchronize an operation of the object to an event of another object, it writes:
connect( anotherObject, SIGNAL(bar()), object, SLOT(doFoo()) );

The latter ones differ in that they are methods whose only purpose is to catch dedicated signals. Signals with a given semantic. As reflected in the signal name, like “Done”. No other object will ever call these method, perhaps even not the object itself. It is only connected to the signal and called on it’s emission. So the semantic of the method is react-on-signal-x. In other languages like Javascript or Delphi those methods have a naming pattern: “onSomething” for the signal “something”. Makes much sense to me. Why should Qt programming be done differently?
Because these method can be only sensefully used by the class itself they are visible private, e.g.:

class FooBar {
private Q_SLOTS:
void onBar() const;
};

So connecting is done within the object by:

connect( anotherObject, SIGNAL(bar()), SLOT(onBar()) );
How beautiful is this code?

Think about it. A slot is just a property. Name your functions after the semantic, if is available to others, or the signal. Omit the property.
Well, or just disagree :P

Hm, not yet convinced? Than take your final push:
“on” is two letters less to type. And two characters less to compare on function lookup, so results in faster linking. A little, at least. ;) And without “slot” it is even four letters less.

Now you are convinced, right? Then go and improve your KDE code. Now! :)

Updated:
From your comments I guess I was not too clear, hope the added text now helps to understand better what I mean. Some things should simply get some more days to be written, sigh.

November 8, 2006

Exclusive first picture of Okteta!

Filed under: KDE — by frinring @ 7:15 pm

Those who looked into kdeutils/khexedit the last two years might have wondered:
Why does it include a byte editor library, but does not use it for the program KHexEdit itself? Read for an answer.

I spend some hours again with Okteta. And got it into a state where I can show at least pictures to the world. Well, looks similar to the old program KHexEdit. But the picture does not show what is interesting:
The core of the program does not have a clue about byte editor and byte array model. It just deals with document, views and so-called toolets. Toolets are the central part of this project. They operate on certain interfaces and plug their actions and monitor/control views into the window framework. E.g. a zoom toolet would automatically support all views with the zoom interface. But more on this at another time.

Prealpha run of Okteta

November 4, 2006

SUSE, oh SUSE, what shall I do?

Filed under: KDE — by frinring @ 3:13 pm

Novell (HQ) throws themselves into Microsoft’s arms, marries into the business of logic patents. That sucks so much. As a member of the FLOSS community I feel betrayed.

I came into the world of FLOSS with a SuSE 5.3 (or so). Since then (by accident in the beginning) I never tried another distro, was always pleased with the SUSEs (after some minor tweaking now and then), spend even some money on some boxes, was amazed how smooth the updates usually went, promoted the use of it. And learned to use and like Yast ;)

Now this. I still am not sure I understood the published contract correctly, but I feel very bad about it. It smells. Very badly. I don’t care if Novell make a contract with Microsoft. But I do care that this contract is supportive of the principle of patents on logic/software. And even more proposes Microsoft to go after non-Novell FLOSS providers on this. Novell HQ, you did not get it. Patents on logic are dumb and a smack into the face of every software engineer/mathematician. And a smack into every company concentrating to deliver well supported, high quality software system to their customers, instead of cleaning and destroying the market by state-supported solution space mining. They are turning four-year contract managers and jurists into highwaymen and parasites of the brave working men and women. Novell HQ, go and help the US patent system to get rid of logic and primitive patents instead of complying to this evil. You now only suck. Big times. Betraying your fellow players by becoming a renegade and switching to the foul playing team. It can only be hoped Novell soon changes it mind/heads again and returns to saneness (well, when was Novell last sane? :( ).

By having been a verbose user of the SUSE distri to my neighbourhood I feel now a need to switch to something else. Very fast. Should I? I guess. What to? Fedora? Debian? KUbuntu? Kanotix? Mandriva? Any suggestions? What can live up to SUSE or is better?

Another, lesser smartness of yesterday which at least could give me a little ironic smile at:
At Spiegel online (big german news site) an article described the reaction to the movie “Borat” by some students from Kazakhstan, who are everything but pleased that people are making fun out of talking nasty bullshit about the country. And express their sorry that real facts about the world’s 9th largest country are so unknown. What was to be proved: The editors of the article had to correct themself on the name of the current capital of Kazakhstan after publishing.

I like human beings. They are so… funny. Haha.

October 14, 2006

Alles Gute, KDE!

Filed under: KDE — by frinring @ 9:30 pm

Cake for Konqui?

Returned from hiking and just had a look for emails, when I noticed the cake on Konqui’s symbol. Oh, wasn’t this the symbol of the birthday notifier plugin of the contacts framework?

So it’s party time!

Of course, it is ;-)

So happy birthday to you, KDE!

And even more happy and exciting times to come!

October 9, 2006

PHP for local applications, C++ for web ones…

Filed under: KDE — by frinring @ 9:00 am

Yesterday was a perfect day to go for some hiking or doing a bike tour, as the sun was shining in a pretty cloudless sky the whole day, other than the rainy, grey days before. And many people did, instead of visiting us at the Linux-Info-Tag Dresden.

Still at the KDE booth Alexander Neundorf and me were busy all the time, answering rather educated questions (no “I have a problem with my Linux 10 and the modem”, puh). Most asked though: When will KDE 4 be there…

We were helped by Bernhard Schiffner, a local KDE API user, who also showed how to do real time and really synchronized sound generation and mixing using jack and ALSA. Hey, so it can work…

Tobias König and Josef Spillner, your favourite developers from Dresden, instead were pretty occupied by running the whole event, so they never had a chance to show up at the booth. But that did Thomas Mönicke, who is developing… yes, PHP bindings for Qt/KDE. Well, why not. At the same time others like Tommi Maekitalo present Tntnet, a web application server for C++. Things are mixing.

October 6, 2006

Join us at Linux-Info-Tag Dresden on Oct. 8th

Filed under: KDE — by frinring @ 10:00 am

So aKademy is over, thanks once more to Marcus, Tink, and everybody else who organized it! Well done. :) (The only thing I hope for 2007 is a better hostel and a 24/7 hacking area.) The aKademy cold is still with me, but may now get it’s final struck thanks to another application of Korean tea (thanks Cho Sung-Jae?).

Now it’s promotion time again. On Sunday, Oct. 8th, the population of Dresden and whole Saxony is again targetted by the Linux-Info-Tag Dresden. Alexander Neundorf, on his quest to change the world of buildsystems, will give a talk about Cmake and then help me at the KDE booth.

If you are around, come over and join us there!

Linux-Info-Tag Dresden

September 28, 2006

Fake addressbook

Filed under: KDE — by frinring @ 12:53 pm

So far my amount of code/day @ aKademy is pretty lame. Too many interesting talks and BoFs and ideas, no way to concentrate. A lot of knowledgeable people to listen to. The cold I got did not improve my mental situation.

But finally I managed to stay with the keyboard and got in hacking mode again. Started my first steps with the model/view variant of Qt4 and did my first own model, cool me ;)

Of course one around a list of persons/contacts:
First screenie of an organs manager

The nice thing is that the view on the right is the one reused from that organs framework, so I got the display and all the services for free. Just some
CardView = new OrganCardView( Splitter );
and
CardView->setOrgan( Model->organ(ProxyModel->mapToSource( Index )) );
and I was done.

Now back at thinking about the addressbook API of Akonadi…

September 10, 2006

Want easy lunch at aKademy?

Filed under: KDE — by frinring @ 6:51 pm

Autumn is coming: meadow saffron are starting to bloom, first Xmas cookies are available in supermarkets, aKademy is less than two weeks away.

If you are at aKademy and want lunch to be a nobrainer for you, then please register yourself in the Food wiki. Now!

If enough are interested Marcus offered to see if he can prearrange something, so lunch would just be an easy pickup & eat and one can return quickly to the keyboard. No guaranty, but spend one minute now and perhaps get a lot of quarters back.

Thanks :)

August 20, 2006

Get in contact with KDE 4, now…

Filed under: KDE — by frinring @ 10:23 pm

KDE 4 is bringing a lot of new or improved frameworks with it, on all levels. CMake, Qt4, Phonon, Solid, all the other one in kdelibs and kdepimlibs… Although the first developer snapshot was already released a few days ago, some new frameworks have yet to settle out of the vapour. :)

Just make use of this fact. Everyone has a chance to adapt her code to all the new things in smaller steps instead of one giant one. I do so these days by porting the vapour framework of mine, previously called contacts framework. I took some hours this weekend to continue, spread the old code over all places that looked suiting, did some porting efforts and finally reached this far:
Former contactcards are already working a little.

Oh, what luck there is in seeing your baby live and grow. Even if it mostly cries currently. But this should improve :)

This code is only on my harddisk for now. I hope I will soon be able to expand the framework down the stack to meet the successor of KABC and Akonadi, so it makes sense to import it into kdepimlibs. Will discuss this at least at Akademy, if not earlier.

Next Page »

Powered by WordPress.com