Strict Standards: Redefining already defined constructor for class wpdb in /www/htdocs/w006f36b/wp-includes/wp-db.php on line 49

Deprecated: Assigning the return value of new by reference is deprecated in /www/htdocs/w006f36b/wp-includes/cache.php on line 35

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /www/htdocs/w006f36b/wp-includes/cache.php on line 400

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl($output) in /www/htdocs/w006f36b/wp-includes/classes.php on line 534

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl($output) in /www/htdocs/w006f36b/wp-includes/classes.php on line 534

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el($output) in /www/htdocs/w006f36b/wp-includes/classes.php on line 534

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el($output) in /www/htdocs/w006f36b/wp-includes/classes.php on line 534

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el($output) in /www/htdocs/w006f36b/wp-includes/classes.php on line 553

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl($output) in /www/htdocs/w006f36b/wp-includes/classes.php on line 649

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl($output) in /www/htdocs/w006f36b/wp-includes/classes.php on line 649

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el($output) in /www/htdocs/w006f36b/wp-includes/classes.php on line 649

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el($output) in /www/htdocs/w006f36b/wp-includes/classes.php on line 649

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el($output) in /www/htdocs/w006f36b/wp-includes/classes.php on line 674

Deprecated: Assigning the return value of new by reference is deprecated in /www/htdocs/w006f36b/wp-includes/query.php on line 15

Deprecated: Assigning the return value of new by reference is deprecated in /www/htdocs/w006f36b/wp-includes/theme.php on line 505
MauriceK, caught between dev and drums » Development

September 25, 2009

Skrooge on Windows…

Category: Spare Time, Development — kaldor @ 12:33 am

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w006f36b/wp-includes/formatting.php on line 76

Now, that is a different topic this time, ay? ;)

The obligatory screenshot first:

Skrooge startup screen on Win7

Does it do anything? No currently not. Clicking on new causes it to crash inside some SQL code. But the port has been fun so far and basically is a perfect example of getting stuff to another platform (which I did before more than once, though I seldomly ported something to Windows yet). Usually you need to take care of dependencies and try to get those running first. It even gets more complicated, when you use a different compiler.

Above version is done with the Microsoft compiler, but unfortunately libofx is designed for MinGW in best case. Both have different ways, when it comes to exporting symbols. GCC usually exports everything, while msvc demands specification on this topic. Using static linking helped for now. Never the less, libofx needed some patches and it depends on OpenSP again, which needed to get some care as well. Well, not the lib itself, the included Windows makefiles are for Visual Studio 6 currently and they include some weird configuration like author names as namespaces and such.

What needs to be done next

  • Get the emerge stuff cleaned up and committed
  • Get the patches upstream
  • Get Skrooge actually do something :P

Thanks to Patrick for his IRC-assistance and Guillaume for his pointers and help so far.

June 18, 2009

And now for something completely different…

Category: Spare Time, Development — kaldor @ 10:20 pm

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w006f36b/wp-includes/formatting.php on line 76

After all these musical entries, time to blog about some development…

Finally managed to have a little bit of time to check on KDE/Windows again. After lots of work done by the people on the project it is now possible to compile it on Windows 7, which gives me the oportunity to start coding.

Here and here you can see rather small commits, but hey it is a start at all, right? ;)

What else to tell… I have a new notebook. Well, new… it’s a few weeks old by now, which with todays technology steps makes it old already…

January 26, 2009

Ouch, that late?

Category: General, Music, Spare Time, Development, Haiku — kaldor @ 8:39 am

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w006f36b/wp-includes/formatting.php on line 76

Wow, more than half a year again, between two posts. I won’t start apologizing, things like this loose their impact, when you say them too often.

So, what am I up to currently?

Spare Time:

  • Searching for a band to play drums in Berlin, anyone who wants to play something between Opeth, Arch Enemy and Strapping Young Lad?
  • Still doing my piano lessons
  • Still expanding my DVD collection

Anything coding related?

  • More accidently I kind of contributed here, among other commits and joined the KDE on Windows project. This is mostly work related, but as I am searching for a new audio player on Windows, I have to admit, that amarok2 on windows is really cool. Using Qt 4.5 is still breaking some stuff, this is what I’ll try to investigate on during the coming weeks.
  • Haiku related? Hm… nothing serious to talk about, see this screenshot and try to remember, from where you might know this application:

yay a clock

I think that was basically it. I won’t start telling that I’ll write more often, you know that this won’t happen :D

July 24, 2008

Building Haiku on Windows, Step by Step

Category: Development, Haiku — kaldor @ 12:23 am

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w006f36b/wp-includes/formatting.php on line 76

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w006f36b/wp-includes/formatting.php on line 83

Uhm… this topic sounds familiar, right? But wait, Windows? Yup, so far it was only possible to build Haiku from R5, Linux, FreeBSD, MacOS and sometimes (though these times seem to increase lately) Haiku itself. Karsten and I put some effort in the buildsystem and some other parts of the repository to get Haiku compiling from a Cygwin environment on Windows.

First some notes of what you need to take care about, before you start:

  • You need lots of packages from the Cygwin installer to have Haiku successfully build. Unfortunately I was too lazy and installed a complete package. Thus I suggest you to do the same.
  • On Windows Vista be sure to have the command prompt open as Administrator. Otherwise many operations will fail, you cannot even call ‘ping’ without needing admin rights.
  • Be sure to not have any special characters in your PATH environment like ‘(’ or such. Also spaces inside the path names are invalid on cygwin. Change your environment accordingly.
  • This will only create images for you, you cannot use it to create/update real partitions on your hard-drive.

Ok, after you have taken care of all above points, let us start.

1. Before you are able to checkout the source code, you will need a managed drive. Read here for further details, basically it is to have a case sensitive filesystem on Cygwin. Otherwise the compiler will horribly fail eg. Including string.h and String.h.

mkdir /managed-dir
mount -o managed c:/cygwin/managed-dir /managed-dir
cd /managed-dir/

2. Create the Haiku development directories and get the Haiku built tools source:

mkdir develop
cd develop
mkdir haiku
cd haiku
svn checkout svn://svn.berlios.de/haiku/buildtools/trunk buildtools

3. We will need to patch fileunix.c of jam inside the buildtools directory:

cd buildtools/jam

Index: fileunix.c
===================================================================
--- fileunix.c  (revision 26383)
+++ fileunix.c  (working copy)
@@ -57,6 +57,7 @@
 # include 
 # define STRUCT_DIRENT struct dirent
 # endif
+#include < unistd.h >

 # ifdef OS_COHERENT
 # include 

Note: Some might have seen that the jam Makefile/Jambase have a Cygwin option. Do not use these! The problem is that jam passes -D__cygwin__ to each target. This will break latest, when some 3rd party libraries are supposed to be build, which actually have Cygwin checks included.

4. Now build jam

make
./jam0 install
cd ../..

5. Get the Haiku source (this will take a while): For anonymous check-out:

svn checkout http://svn.berlios.de/svnroot/repos/haiku/haiku/trunk trunk

For an existing Haiku developer:

svn checkout https://developername@svn.berlios.de/svnroot/repos/haiku/haiku/trunk trunk

If there are any errors when checking out above, just cd into the trunk directory and type “svn up” to get any missed files. This also applies when updating the code in the future.

6. Build the cross compiler tool (GCC 4.x):

cd /managed-dir/develop/haiku/trunk
./configure  --build-cross-tools-gcc4 x86 ../buildtools/

Note: This only works with the GCC4 compiler. The GCC2 cross-compiler is generated in a wrong way and the build is broken for this version. Hybrid systems are untested so far.

7. Build the Haiku image:

jam haiku-image

To build for testing in VMWare:

jam haiku-vmware-image

As you can see, most of the steps are identical to the Ubuntu tutorial. The changes needed were more or less minimal, mostly related to minor things not working properly for the host tools. Finally, I’d like to mention that building Haiku takes much longer compared to Linux. My guess is that this is related to gcc being slower and also forking processes takes much longer on the Windows platform. But this is just a personal impression. By the way, you can also use multiple jobs to create the image with the -jx option, where x describes the amount of parallel jobs to run.

Update 1: Changed environment suggestions. You must not have spaces or special characters in your PATH variable

Update 2: Updated note that gcc2 is not supported.

March 29, 2008

Media back in the days…

Category: Spare Time, Development, Haiku — kaldor @ 3:04 am

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w006f36b/wp-includes/formatting.php on line 76

Developing in your spare time is something weird. On the one hand you want to keep your social life ongoing (and we all know how fast you can forget about time while staring at code. Just look at the time I write this article), on the other it helps you so much when you are searching for different challenges than your work can give you.

Next week I’m going to be in Cologne again for a big birthday party, and as I have no children on my own (congratulations to Paradoxon again), I decided to play a little bit around with Cortex again.

Cortex is kind of *the* application when it comes to Multimedia on Haiku. It allows you to display all the things going on in your system regarding media nodes. While we already recognized that it also tends to manipulate the system itself, it still is a great peace of software, horribly to read and get into, but does the user care :)

Today I added some of the additional addons to the build, and well what can I say. The following screenshot starts reminding me where BeOS once was and that possibly Haiku will be there at some point. No I am not talking about opening Chapter 11 :P

Cortex on Haiku

I’d really like to investigate on so much more stuff, Haiku is still missing encoding support. Also all latest hardware technology is currently bypassed. All these are areas I am interested in and have absolute no to some clue about, but then again…

Let’s get social and go to bed.

January 28, 2008

Taking care of other networks…

Category: Development, Haiku — kaldor @ 11:04 pm

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w006f36b/wp-includes/formatting.php on line 76

I couldn’t hesitate to use this topic name, though this is a little bit unrelated to the content of this post…

So, during the last days, I’ve already mentioned that my interest in Haiku is rising. Furthermore there had been a lot of discussions about ProjectConceptor on #beos.de at that time. Project Conceptor is a very promising piece of software, which is at a very early stage of development. Though my interest in actively developing for it is limited, the developers put their latest effort in backporting it from ZETA to BeOS R5.

Using R5 felt completely wrong to me, so I considered making it work for Haiku directly from my linux box, especially my preferred gcc4 version.

Some of you might already know, that I am not one of the biggest fans of Jam. Addtionally I am one kind of developers, who feel extremly annoyed by trying to port something and needing to take care of the build engine in first place. So the logical decision for me was to design a makefile engine, which is capable of building applications crosscompiled for Haiku. Stressing the point of making it easier for developers who are already in the BeOS world, the design of the makefiles have been adopted from what has been there for R5 and ZETA.

So, a classical (helloworld) makefile just looks like this:

NAME = myapp

SRCS = main.cpp

include $(HAIKU_DIR)/makefile-engine
$(HAIKU_DIR) describes the head directory of your checkout of haiku. That one usually will contain the generated directory for your haiku build. The only dependency is to set this variable in your environment and you should be ready to go.

In addition to compiling and linking it appends resources and sets the mimetype. Obviously, these rules have been adopted by the haiku engine and therefore should be compatible.

Oh, and before I forget, in case you want to use it for a gcc2 build, just set the COMPILER_VERSION variable in makefile-vars to 2 and you’re done.

So if you want to try it out, just click here for a download. Feedback is welcomed.

To clarify one thing in the end: This is no intention to replace the jam setup done for the haiku project. It is much superior than what is available here and I guess there has been a lot of research and discussions previously to the core team decided to go for jam. If you are considering to make your projects haiku only, use haiku_jam. If you start a new project for haiku, use haiku_jam. But, if you are just trying to port over an existing R5/ZETA project and want to prioritize the source work over the build engine, then this might be something of your interest.

August 20, 2007

Meep meep… midi midi… meep meep

Category: Development — kaldor @ 10:23 pm

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w006f36b/wp-includes/formatting.php on line 76

Some of you already know that since some time I try to learn how to play the piano. Although I bought the Cubase application from Steinberg, I was very unhappy with the startup time. It took around one minute just to be able to start playing. In case you want to rehearse a little bit, that is very inconvenient.

As a developer only one solution comes to your mind: “Write your own stuff”. As I am more into developing the background and engines, I investigated on the MIDI C++ support on Windows and I was fairly surprised how easy it is to get reasonable results. These have been integrated into a little Qt library which handles all native MIDI events for you. Since the GPL exception added by Trolltech with the Qt 4.3.2 release I am now also able to publish this code under BSD license, so feel free to do with it, whatever you like to.

Ok, that explains one thirth of the topic, but why Meep? It has multiple backgrounds. First is, I wanted to quote a friend of mine, as we had some long discussions about libmidi3.so :) But mostly it was because of the reason that this is the first thing coming to your mind when you think of MIDI. MIDI? Isn’t that this crap, which only does meep, meep? It always takes some effort to get usable results out of your MIDI device and/or application. Finally I wanted to get rid of the “Kald-” prefixes like in Kaldience and Kaldile.

For code and examples continue reading…

(more…)

May 1, 2007

Make it perfect…

Category: Development — kaldor @ 9:31 pm

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w006f36b/wp-includes/formatting.php on line 76

That is what Ziltoid asks for to get the ultimate cup of coffee. But no, this is no post about rock music, neither about one of the most awaited album for me since some time. This time I want to go further on talking about profiling, especially announcing that version 0.01 (wow impressive number :P ) of my profiling application is available.

Some of you already might have recognized, that there is a new section on this page called Software. Its main target is, well of course, hosting some of the stuff I develop in my spare time. More will come, but it is a start at least.

If you want to recall my previous post about this topic, take a look here , here and here. Because most of the theory is already said there, I will not go that deep again. Additionally I will not talk about UI design because at first the Kaldile UI is not the most intuitive (I simply love this word) one, and second I guess you all know how to make an interface, most of the readers far better than me.

So, in theory all stayed the same like with the previous attempt. The difference for now is, that the kprofile.lib does nothing else than simply sending messages to a listener application about what is going on. Before it was trying to resolve the function name itself. This has the big advantage, that the profiler takes only a few clocks and your profiled application can continue doing its work. For this attempt I am using now SendMessage(). If you compile the lib with the ASYNCHRONOUS_SEND define set, it will use PostMessage() instead. PostMessage is an asynchronous message sending way, which might cause a lot of problems. For instance take an application which has many functions being called, kprofile will send a message for each enter and leave event. The message queue of the listening application will get full very very fast. Unfortunately kprofile does not know that, neither does the listener know what is going on and the messages get discarded. Because of that the logic in the listening app screws up and fails from that point on. But nonetheless I kept the define in for one reason: If you want to analyze some heavy stuff happening in a few functions, PostMessage is the much faster attempt. Additionally if you use UI it will stay much more responsible as kprofile does not need to wait for delivery of the message. One last note on the function amount being called. Always remember that inlined functions get profiled also. This is just a hint to give you an impression how fast the function stack might increase in a profiling scenario.

The listening application itself (kaldile) is not spectacular at all. In its eventmanager it checks for messages been arrived about profiling, sorts them and analyzes the results. You can turn on on-the-fly parsing, which is something I did during all the time. For statistics there are currently two result views, a treeview showing you the path your profiled project went along and a call statistics, which highlights how many times a function has been called and how long it took in average.

Finally I want to say something about the issues with the code. I still use the DbgHlp SDK available in the platform SDK done by Microsoft. It works very fine for me, I simply load the symbol table into the listening application and check for matching function names to be written into the result views. But they have more than one issue. The biggest concern about it is that you might get into trouble as soon as the profiled application quits and the symbol table loaded gets invalid. This only happened one or two times here, but you cannot profile something which closes in faster than a few clocks. A simply HelloWorld application will most probably fail to be profiled. How do other profiling application resolve this, you might ask. My guess is (well, I am pretty sure about this), that they parse the pdb file being generated, when you compile your project in debug mode. You can get some tutorials on how to parse these files, for instance here. In this article you are able to see, that the file is structured as a file system with lots of internal logics. To be honest, I could not be bothered to write an implementation on my own. Unfortunately none of the implementations I found in the internet did work here on my machine. But if you are willing to write one or you already did, it is very easy to apply it to Kaldile. Simply take a look at the symbolparser.cpp file and replace the few locations by your implementation. This would fix above issues in a very polished way.

I hope that the application will help you, when you need something like this. In theory the TODO list is very long and might get published at one point. I guess most people want to save the results or print them, so this is one of the first things, I should take care of… :)

February 26, 2007

I want to have my messages for my own…

Category: Development — kaldor @ 11:13 pm

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w006f36b/wp-includes/formatting.php on line 76

During the last days I was heavily debugging my profiler listening application and wondered what could go wrong.

The current attempt is easy: I use PostMessage() to send the profiling information to the listening application. Of course, when you are doing lots of stuff, there is some heavy throughput, but nothing that should influence any of the applications. Neither the profiled application, nor the profiler itself. But the profiler user interface was almost dead when it came to lots of messages to be parsed.

It tried everything, handling multiple messages at one time, to get rid of some update() calls, use more stepping while processing the data, I even disabled updating the processed amount of data itself.

During one of these frustrating debugging sessions to figure out what is going on, I nearly wanted to kill the application. So I called the Task Manager of Windows XP, and what did I see there? Visual Studio EE took around 90% of CPU usage. So I called the profiler from console itself and guess! It ran like hell, without any problems, without any blocking.

The result of all this is, that Visual Studio seems to filter each message being send to your application while you are debugging it. There might be a reason for it, but currently I do not see a point in doing so. If your application crashes in the event handler, you will get a valid stack crawl anyway.

So finally I can continue work on the profiling application itself…

February 20, 2007

scaring surprises…

Category: Development — kaldor @ 8:36 pm

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w006f36b/wp-includes/formatting.php on line 76

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w006f36b/wp-includes/formatting.php on line 83

While I was continuing work on the function profiler I talked about earlier, I started coding a small application, which should visualize some results. I thought I encountered a bug in the profiler itself, so trying to isolate the problem directed me to a container issue.

The app is written in Qt, and it uses QMap quiet heavily to store data and have fast access to some elements. I thought there might be some problems with templates then, because the output repeated itself again and again, so I wrote a small testapp like this:

int main(int, char**)
{
    printf("App:mainn");
    QMap map;
    map[12] = 4;
    map.clear();
    return 0;
}

Very short app, isn’t it? ;) It inserts one element and clears the map afterwards. So what is your guess on how many functions are getting called? 3? Of course not. 10? Still more. It is 40 function calls including the main itself.

I was heavily shocked and thought that QMap is much too overheaded. But after a short talk to a friend, he suggested that I should try out the STL being included in the Platform SDK. So simply changing the app to

int main(int, char**)
{
    printf("App:mainn");
    std::map map2;
    map2[12] = 4;
    map2.clear();
    return 0;
}

resulted in 249 function calls. This is even more scary and now I am happy that I decided to use Qt for data storage :)

For the ones of you, who are interested in the exact functions, I attached two text files, which show the calls made during that 5 lines of code.

My guess is, that the actual function call count gets much reduced in non-profiling mode, as inline functions are not inlined in this situation, but still it is impressive and it gives you a good hint, that you should be careful which functions you call or which data types you want to use blindly.

Qt Call History

STL Call History