More on bad webservices

More on bad webservices

I am using postfix on my server and it has the nice feature that it can move mails with +something at the end into a folder I want. This allows me to see who is selling my email address to which company and such. Now the downside is that many forms of webapps claim that my email address is not valid.

So today I was over at finanzen.net to try to register a new account and instead of telling me that they do not like my valid email address, they say the user name was already taken. I tried with many usernames (coming from pwgen) and all the same, it just started to work when removing the ‘+’ from the username…
Now I tried to use their contact form to tell them that I would like to use their service but they have hired a company that has no clue about web programming… well it is ofcourse broken too…
It is 2010, there are so many good web frameworks around, why are proprietary webapps still so bad? Who is writing all that crap?
Tips and Tricks for QML

Tips and Tricks for QML

I would like to share some more information about how I resolve my QML issues. In my last post I got a friendly reply of hiding states and such information of a Component inside an Item of that component. This was a very good hint.

My application is making heavy use of delegates for the ListView, PathView, Repeater and sometimes qmlviewer stops displaying content with a warning: “QDeclarativeComponent: Component is not ready”. In contrast to the many other places this error message is not very helpful. In all of my cases this error came from a syntax error (unbalanced {}), using a duplicate property or having fun with lists. So check your model (if it is static) and your delegate file for syntax errors, e.g. load them in the qmlviewer and see if the error message is changing.
IIRC writing something like Rectangle { Item {} Item{} } is just a short form for writing Rectangle { data: [ Item {}, Item {} ] }. Now with the shortened way one does not need to use “,” at all, with the real list way, one may not have a “,” after the last item. It is good that the syntax checker is so strong, it just happens to conflict with my C99 usage.
The application requires some kind of table display and in general ListView/PathView do not allow such models. My not so unique idea was to have a ListModel and then another ListModel hanging off as an property. So the first approach might look like the one below.
import Qt 4.7
ListModel {
ListElement {
moreData: ListModel {}
}
}
But it is not supported by QML and you will get a nice error telling you that this is not possible. The workaround is to use the simple [] way to create a model that is working on the views.
import Qt 4.7
ListModel {
ListElement {
moreData: [
ListElement {}
]
}
}
With the above I can use a Repeater/ListView inside a Component/Delegate with a model of this row and I have a small table view. With my current approach I have to use a Flickable and two Repeaters increasing my memory usage but that is acceptable for now.
QML and dealing with states

QML and dealing with states

In the last days I have resumed my QML work (I had a small break to work on the MGCP GW code of OpenBSC to fix some real world issues) and there is one kind of issue I tend to run in and I wonder how others are solving it. Let us imagine we have a QML Component for a Button. The Button itself can hold a text (property alias text: buttonLabel.text) and the button has three states (enabled, focused, pressed) that depend on the MouseArea that inside the button as well. Actually this approach is directly coming from the many nice examples and demos provided by Nokia.

Now the problem is… I’m using the Button in many places and depending on some other external state the label of the Button should change and I keep writing things like this:
UI.Button {
id: text_button
text: ‘My Text’
MouseArea {
anchors.fill: parent
onClicked: { console.log(‘clicked’); }
}
states: [
State {
name: ‘some-state’
PropertyChanges {
target: text_button;
text: ‘Other text’; }
}
/* more states… */
]
}
And then I am going to wonder why things don’t work. The first issue is that my own MouseArea will receive the mouse click and the button will not work… but that is easily fixed. Do not add a custom MouseArea and have a clicked signal inside the button component. The second issue is with the states.. the above code is breaking the focus/pressed logic.

The way I am dealing with this kind of problem is to move the state into a parent and control the text from there. What is the proper way of solving this problem? Creating multiple buttons and control the visibility/opacity from outside? Duplicate the component states inside the custom states (cross product of my states and the component states)?
I know that talking about errors is bad as this will make people remember the wrong solution but I hope that other people stepping into these kind of problems will remember this as a possible problem..
Coscup2010/GNOME.Asia with strong web focus

Coscup2010/GNOME.Asia with strong web focus

On the following weekend the Coscup 2010/GNOME.Asia is taking place in Taipei. The organizers have decided to have a strong focus on the Web as can be seen in the program.

On saturday there are is a keynote and various talks about HTML5, node.js. The Sunday will see three talks touching WebKit/GTK+. There is one about building a tablet OS with WebKit/GTK+, one by Xan Lopez on how to build hybrid applications (a topic I have devoted moiji-mobile.com to) and a talk by me using gdb to explain how WebKit/GTK+ is working and how the porting layer interacts with the rest of the code.
I hope the audience will enjoy the presentations and I am looking forward to attend the conference, there is also a strong presence of the ex-Openmoko Taiwan Engineering team. See you on Saturday/Sunday and drop me an email if you want to talk about WebKit or GSM…
MGCP Road to Stability

MGCP Road to Stability

I have spend the last week differently than I had planned. I have been to Iceland, the Hotel still didn’t restart their DVB-S receivers or renewed their smartcards. So 13/16 Channels are stuck in different set-top box messages and only RTLII of Switzerland, BBC and Eurosport are fully functional. The sad part is thet one could receive China’s CCTV program here…

I have spend the last week working on the MGCP Gateway of OpenBSC to allocate the network and the BSC/BTS port separately, to add a feature to forward the RTP stream from the BTS IN/OUT, NET IN/OUT to another system. On this different system one can use something like GStreamer to decode the stream and listen to it. This can be useful to debug when the voice doesn’t arrive where it should.
In a network simulation with Linux’s netem we have tried to simulate a bad vsat link and wanted to see how big the latency/jitter can be to still have an acceptable voice call and now I will play a bit with RTP jitterbuffers… This allows me to look at GStreamer once again to see if their jitter buffer is finally working.
Progress in OpenBSC

Progress in OpenBSC

This is just a small list of things that have happened in OpenBSC:
  • Introduce a GSM 08.08 BSC API to separate channel management from the MSC Code. This has also killed reference counting of our logical channels and we release channels a lot faster.
  • Toying with USSD. I started to play with ASN.1 and generate USSD messages, right now we can send a unstructuredSS-Notify down to the Cellphone and play with the alerting types, sending a notifySS as part of the Setup message is not liked by phones yet.
  • Splitting out the SCCP code into a new libosmo-sccp library, I have also put my MTP-Level3 code in there, so maybe we should call that library libosmo-ss7.
  • I was writing my first C Node in Erlang to parse SCCP messages in C and return the result to erlang to Erlang code.
  • The mgcp code can now dynamically loop/unloop the stream, patching the SSRC, seqno and timestamp.
In the next couple of days/weeks I want to continue working on the BSC API and then completly nuke the current on-waves/bsc-master branch as everything is merged back to master in a way better structure than it was in the branch. But today I am trying to make my code and the nanoBTS crash…. and figure out why it is doing that.
HTC Desire/Android GSM Protocol Issue

HTC Desire/Android GSM Protocol Issue

I was playing with ASN1 and Supplementary Services over the Weekend. My goal was to provide extended user information during a call setup. So the first step was searching for information of how it could look like, this involved going through the GSM Spec, the 2nd part was wrestling with asn1c to generate some dummy data (as I couldn’t find a trace doing that), the 3rd part was being able to generate that from OpenBSC and send it to the phone.

Well, long story short. It doesn’t work, the better phones ignore the data I am sending, all the others refuse to show incoming calls, the Phone failing the most is a HTC Desire with Android. First of all OpenBSC has a pretty simple USSD implementation and it doesn’t like that, now when you place a phone call (while Android decides to do a USSD request in the background), OpenBSC will close the channel, not do any Call-Control and on the Android one screen shows the call is terminated, in the decoration it is still active, then the wakeup/sleep logic gets confused, you can not hang-up and then the phone is restarting.
The executive summary: Not implementing USSD in your network (we send an error and such) can make Android phones reboot if someone is placing a call at the time android retries to send the USSD query.
Debugging hints I

Debugging hints I

Being an Engineer one need to resolve problems and sending a mail to a mailinglist and asking for help is most of the time not the problem solving skill you should use. So here is a list of some easy hints…

  • Finding a build error (using make) in a log file. You might use a tool like OpenEmbedded that keeps the log file around and you have a build failure. First of all check the end of the file, but one might have compiled with -j X and the failure was a bit earlier. The best way to find the error is to search for ‘***’. E.g. inside or less or vi type (/***) and it will bring you to the first compile error… GNU make is kind enough to flag the error.
  • The compiler is bitching about something that might not make any sense. With C languages a program called CPP, the C PreProcessor, is ran over your code and it might include funny headers changing your code. What I normally do is to use the compile line as seen in the terminal and replace the -c with a -E as this will only preprocess and then look at the code. The pre processed code is long, search for includes from places you don’t expect and such…
  • If a program points you to a log file, read it. In the case of autoconf (configure) a config.log is written, now the bad news is that the error is not at the bottom of the file. What I do is to look at the text of the last test and search for that inside the config.log, it brings me to the failing test…
  • Dealing with remote crashes. You have a segfault but don’t know when/where it is happen and it is hard to reproduce? Just use ulimit -c unlimited in a shell and run your script/applications, the kernel will place a core dump in the directory and you can use gdb and your binary to inspect it.
  • Running a libtool based binary/lib from inside the build directory. You can use libtool –mode=execute gdb tests/sms/sms_test and then libtool will setup the environment and invoke your command..

more hints at a later time…
Anti-Pattern 23 – Make sure to not get feedback

Anti-Pattern 23 – Make sure to not get feedback

  1. Create a website to compete with an established one.
  2. Make something bad like handling cursor/space keys in the side and alienating people using keys to navigate.
  3. Create the impression one can give input, place a feedback button.
  4. Use a form, allow the user to enter text.
  5. Make sure the submit is not just a simple submit but make it go through javascript so you can reference variables that do not exist
If you follow these steps, you are guranteed to burn money, lose busines and you will not get feedback from your customers.
Hybrid Application Example with QtWebKit

Hybrid Application Example with QtWebKit

In general one of the fascinating aspects of WebKit is the focus on just being a Web Content Engine as it can be seen in the Project Goals. One of the results is that one can easily build a Web Browser around it, or embed it into a Mail Client, a Chat Client, or into your application to handle payment in amazon, display Wikipedia or similiar things.
On the other hand it is possible to embed native widgets into the Web Content using WebKit/GTK+ and QtWebKit, or use the JavaScript Engine API to bind native objects into the JavaScript world. I have started using the moiji-mobile.com name to push WebKit usage for these kind of hybrid applications. I am going to create examples showing how to create applications using QtWebKit, how to deploy them on real hardware, howto handle content development on mobile devices and more.
The first part of this series is a simple example of what could be a SIP based desk telephone using QtWebKit and native technology. In this example I am embedding QObjects to provide information normally not available in the Web, I embed a QWebView inside the content to provide a browser and I am painting on top of the HTML content from the QWebView to provide touch feedback and the code can be found in my git repository.

shot0002