Categories
Linux / Gentoo Linux

Fixing XML-RPC’s in KDE4

After posting that Bilbo worked out of the box, I was bound to run into a world of trouble – and so I did

You see, when I was trying out KBlogger, I ran into the “Invalid request payload xmlrpc element STRING cannot be child of DATA” error you find in some KBlogger related posts. After playing around a little I realised that the error prevented me from posting anything and I ditched KBlogger as being buggy as hell (which it actually still is).

But when I installed Bilbo, I ran into the same problem! Only this time I knew that it should work as I posted before using Bilbo. After investigating a bit I found the culprit: KBlog. This backend library handles the communication with the server over the XML-RPC protocol. The error is produced on the server side and to be exact it is PHP XML-RPC that generates the error.

Because the XML-RPC library on the server is very strict (and probably error free), I turned to see what Bilbo actually sent to the server. The problem appears to be in the category structure that is generated. In my first posting, I did not select a category to post to. But when you select one or more categories, a QStringList object is populated with the category names. This is converted into XML somewhere in KDE (I haven’t figured out where yet).

After talking to the Bilbo devs for a bit they pointed me to the WordPress API in KBlog. For some reason, that one generates a string holding the XML for the server. And in that class, the metaWeblog.newPost function is called using a properly constructed category array.

Alas, switching to the WordPress API did not help: “STRUCT cannot be child of PARAM” and whether I used categories or not, the error remained. A quick inspection showed where that error comes from: the ‘struct’ element should not be directly put inside a ‘param’ element. The XML-RPC specifications state that the ‘struct’ should be placed in a ‘value’ element first. After fixing this and recompiling Bilbo, everything is working now!

Well, not everything as the metaWeblog API is still broken. I have filed a bug report with KDE upstream so they can add my fixes to the WordPress API and hopefully someone with more KDE programming experience can fix the metaWeblog API. Or rather, fix the conversion from a QStringList to proper XML-RPC compatible XML.

On a side note: while debugging the XML-RPC protocol I discovered that the Joomler XML-RPC plugin for Joomla! did not apply the categories that are sent along. I’ve modified my (already heavely patched) version of Joomler and once I’ve tested it a bit more, I’ll send the patches to the Joomler devs. Hooray for open source I guess ^^.

Categories
General blog entries

KBlogger moved to KDE 4.3

And yet another epic fail for KBlogger, the new blogging tool that was supposed to be in KDE 4.0. After KDE-PIM was not ready for the 4.0 launch, it was postponed to KDE 4.1 – understandable but as anyone running a blog and a PC using KDE4 knows, we don’t have any decent blogging tool on linux.

After an early alpha (which was a step in the right direction) is became very quiet around KBlogger. So when KDE 4.1 was released I was surprised to see the lack of info about the new blogging tool.

When I found KBlogger on the KDE 4.2 release schedule I sighed – another half year to wait on a decent replacement for Windows Live Writer (which is still – in my opinion – one of the best blogging tool out there, even when used in VirtualBox).

Now, at the dawn of 2009 and the coming of KDE 4.2 I found it weird that the beta of 4.2 lacked a preview of KBlogger.

I just found these mail conversations on the KDE mailing list pushing KBlogger to KDE 4.3…. which is supposed to come out end 2009. Once again a huge let down for the KDE fans.

Despite the statements that KDE 4 is feature complete it keeps lacking vital programs: KDE PIM has a screwed up Kitchsync support (which in itself is half broken if you ask me), power management just arrived in 4.2 (Powerdevil) and KBlogger is still not here (even though its core component KBlog – a WYSIWYG editor – is working pretty well for some time now). I am still using KDE 4.x but so far the thrill has become quiet the waiting game. Yay for open source I suppose…

Categories
Programming

Matlab and C++

Wouldn’t it be cool to use native code in Matlab? You can ^-^.

I started out by writing a small hello world program to test C++ but every time I ran it against GCC I got funky errors. After a while I found out why: g++ is the C++ compiler, GCC only does old-skool C. D0h!

This is the crap you would see:

# gcc test.cpp
/tmp/ccrnZKfr.o: In function `__static_initialization_and_destruction_0(int, int)':
test.cpp:(.text+0x23): undefined reference to `std::ios_base::Init::Init()'
/tmp/ccrnZKfr.o: In function `__tcf_0':
test.cpp:(.text+0x66): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccrnZKfr.o: In function `main': test.cpp:(.text+0x76):
undefined reference to `std::cout' test.cpp:(.text+0x7b):
undefined reference to `std::basic_ostream<char, char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccrnZKfr.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

 

The guide I found even explains how to make a small Makefile to speed up the process of compiling (and testing). The (short) guide is here.

Right now I’m waiting for Matlab to finish installing and then I’ll try to test my Hello World from within Matlab. More info how that works can be found here.

Technorati:

Categories
Programming

I Hate Grammar

I hate grammar. I learned the English language when I was 9 years old (as it is not my native language) while trying to read the manual of QuickBasic under DOS. By the time we actually got English lessons in school I was years ahead of most people in my class and even up to the end of high school I never had to read the books we used in school. Instead I read a lot of English books which provided enough sence for the language to stay clear of any official grammar.

But I am drifting here. The problem in computer land is that we use grammar. Every programming language uses a grammar to allow a human to tell the computer what it should do.

Right now I am working on a project where we want to compile Matlab code into C or C++, feed it to GCC and finally upload it into a Virtex IV FPGA. The FPGA has a Sparc V8 compatible CPU (the Leon 2 to be exact) and has a number of auxiliary processorswhich are dedicated for mathematical calculations. For those who care: we are using Montium cores for the calculations.

Even though we pretty much have solved how to drive the whole thing in theory (not in real life as we are just starting), putting it all together is a bit harder.

It starts with the Matlab interpreter and the grammar needed for the interpreter. I’ve been working with ANTLR in the past to generate a compiler for my own toy language. It supported pretty much everything the old QuickBasic language did except the syntax was much more like Java.

I installed ANTLRWorks to use the shiny new GUI to speed up stuff and immediately ran into a wall: Matlab uses a syntax which sometimes end a statement with a semi-colon (‘;’) and sometimes not, depending if the programmer wants to see intermediate results. I am trying to base my grammar on Java here as it is nice and strict – but stuff like this is rapidly making the adaption a pain in the …

Another hair puller is the syntax of the ‘if’ statement: no block structure… Another one lacking the block structure is the function definition. As we are targeting mathematical speedup here and our Virtex board has no display, I will probably sacrifice some stuff to simplify the compiler.

Right now I’m keeping integers and booleans, logic structures like ‘if’-‘else’ and ‘for’ loops. Floating points, bit operators, function definitions and calls – all have to go. Perhaps I will re-add them later on when needed but right now I don’t see any reason to keep them around.

As soon as I got my sub-set grammar complete I will put it up on my site as nobody on the internet seems to have done this before (I found posts from 1992 with no solutions…).

Categories
Japan Blog Study Tour

Freestyle

Three weeks have passed and today (Saturday) was the last day that was semi-part of the study tour. After spending 2 hours of getting all my clothes folded up and packed again for transport I went to bed at 4 and got up at half past 7 (who needs sleep anyway in Japan?). I grabbed my suitcase, jumped into my clothes and headed for the elevator while some of my roommates wished me good luck (all three of them were headed back to Holland that day). I grabbed some coffee and white bread with strawberry jam for the last time (after one and half week eating strawberry jam its getting annoying) and after 25 minutes after my alarm went off I strolled into Tokyo.

Categories
Japan Blog Study Tour

Sharp and style

IMG_3505 On the last day of the study tour we visited Sharp. We started the day a half hour earlier than planned because Sharp has told us the move the program forward. After hours of traveling by train we finally got off at Chiba – a suburb of Tokyo with enormous skyscrapers. It was obviously some luxury business park. After a 15 minute walk we finally found the Sharp building where we first got a tour of Sharp technologies. This included LCD TV’s, how LCD works, solar panels and Sharp’s view of the future. Although nice to see, its not all that shocking for us: all of the things we got to see are available on the market. One of the cool things was the 3D LCD (also on a mobile phone) and the dual view LCD (the driver of the car sees the navigation chart while the passenger can watch a movie – on the same screen).

Categories
Japan Blog Study Tour

Ambient systems and voices

IMG_3383 Today we went to Ginza to test a new system. Ginza is a region in Tokyo with all kinds of fancy stores (read: expensive) with all the big names next to each other, from Chanel to Louis Vuiton. We started out in the underground passage next to the A3 exit where the experiment would begin. Everyone got a PDA with some ridiculous name and a wristband with an RFID reader inside of it. Next, you put on the headphones and the system would guide you to the surface. It immediately went wrong: we walk a lot faster than Japanese people so we ended up in situations like: "Pass left of the termi…" – "Go straight by…" – "Walk up the stairs on the…" – "Turn around and go back to the crossing with the red booth on your right, this time walk up the stairs on the left". Great…

Categories
Japan Blog Study Tour

Universities and cool labs

IMG_3313 This morning we checked out of the Tsukuba Daily Inn after having a mixed style breakfast: it was not really Japanese because they had bread and it wasn’t really Western style because it had Japanese cabbage as well. We hopped on a bus back to Tsukuba Center and then on a bus to the Tsukuba University. Because of some miscommunication and some idiots we got off way too early and walked for 35 minutes until we finally found the right building (a campus for 17,000 students is huge, whoever came up with the idea that we should walk should be shot).

Categories
Japan Blog Study Tour

Eternal concrete and rockets

TsukubaToday we are leaving Tokyo for a while to head out to Tsukuba. Tsukuba is a good 2 hours from Jimbocho and so our day started early with me giving a briefing to the group about JAXA. The latter was because all of us reviewed a company to write a report about and mine was about JAXA. So after we left the hotel with provisions to survive the coming night, we set out for Tsukuba.

Categories
Japan Blog Study Tour

IBM and Xerox

IMG_3208Another day of company visits, another day of sore feet and knees. Luckily for me they walking pace was not too high and we didn’t cross too many stairs. We had a presentation about IBM’s background and vision of the future (the standard layout for almost all our visits) and after the standard introduction we finally got to see some technology.