Morning Cup of Valgrind

April 9th, 2008

Valgrird logoValgrind is a memory checker and dynamic analysis program, named after a Norse myth. So the obvious question is how to pronounce “Valgrind”?  The “grind” is pronounced with a short ‘i’ like “grinned” (rhymes with “tinned”) rather than “grined” (rhymes with “find”). One of the big bonuses is Helgrind, a tool for checking race conditions in multithreaded code. It is still ‘experimental, but you now how ‘experimental’ is when it comes to open source codes.

    I am trying to integrate Valgrind with my unit testing framework, but I haven’t had the time. For Raydo, I develop on OSX, and run the Valgrind & unit tests on Linux, since Valgrind only works on Linux. This will catch Linux memory leaks and memory leaks from my code, but not any memory leaks that are specific to the Window platform or the GUI kit that you are using. Those leaks are the platform’s problem anyway. You will see a lot of memory leaks from other parts of you software , including wxWidgets, when you run Valgrind on Raydo. Such is life.

    Valgrind supports Linux on x86, x86-64 and PowerPC. There are ports to other the *BSD Unixes. There is no port for Microsoft Windows nor are there any plans for one. Valgrind works much better with C++/STL than with straight C. Valgrind does not check ranges in arrays, such as strings in C, which can be a problem.

So if you code C++/C on Linux, I highly recommend Valgrind.

WikiOverlords
Valgrind home page

Eating one’s own dog food

April 1st, 2008

    Stupid phrase, but a good one. According to Wikipedia, the term came from inside Microsoft. Despite the origin of the word, I still think it is quite descriptive.

    For the last few weeks, as my home grown code has been rolled into Raydo, I am using complete Raydo applications daily, instead of the piecemeal applications I was using before. You know what I mean, first you write an application, then you find another use and you extend it, and on and on and on.

According to our Wiki overlords, eating one’s own dog food has four benefits.

Using one’s own products has four primary benefits:

1. The product’s developers are familiar with using the products they develop.
2. The company’s members have direct knowledge and experience with its products.
3. Users see that the company has confidence in its own products.
4. Technically savvy users in the company, with perhaps a very wide set of business requirements and deployments, are able to discover and report bugs in the products before they are released to the general public.

    I say, sure. Whatever. But I think I have found a fifth benefit. You realize what is annoying to the end user using your product everyday and you want to change whatever feature. People say that writing open source software is like scratching an itch. Well, fixing an annoying GUI is drinking a Old Milwaukee. You deal with it, but you would really rather have a Heineken.

    So you use the application , and the same thing keeps buggin you so you end up tweaking the GUI. Does it a something to the bottom line, not but doing a GUI right is soooooooooo much better than just slapping any old GUI on an application. I guess my time spent at a company that really cares about user interfaces has permanently warped me. User interfaces should be all about the user. Not how the person designing it THINKS the user would use it. I think I am unique, because I wear both hats, I write software for trading , I trade everyday, and I love designing GUI’s. Well, that is more like 2.5 hats, but you get my meaning.

    If you are an engineer designing a GUI, please take a look at this book. Designing bad user interfaces is no way to go through life.

Pthreads and Windows again

March 25th, 2008

    Well, the build process is going well. On the mac, I have made a shell script that creates the applications for you. For those of who who have not developed on a mac yet, mac applications are actually disguised folders that hold the application along with other information on running the app. Sure, it looks like just an app if you are looking at it in the finder, but it is really folder. Before, we had to build with X-Code ( the free gcc development kit from Apple Computer ) using project files and such. I really did not like going from the command line and make files to xcode JUST to make the application I could click and run. So now there is a new command in the makefile to build all the apps, or you can build the apps by doing a make in the application name and adding ‘.app.

Now onto windows … again.

    Compiling with pthreads-win32 has tons of gotcha’s. Really read the faq on the website. Some of the things I really need to stress is that if you are using an old version of MingW to develop on windows, please get the latest version. Older versions have ‘weirdness’ when it comes to pthreads. And by weirdness, I mean crashes.

    I have to hand it to the developers for putting pthreads ( POSIX 1003.1-2001 ) on Windows. They had to build it on top of the Win32 event model which is not the best. Windows NT, 2000, and XP models are different from Windows Me and the Windows 9X series. Do I think Microsoft will ever put a stake into this things and release a nice built in POSIX pthreads library that runs on all the above platforms? Not likely. Windows Me and the Windows 9X series are pretty close to dead anyway, so just do the NT kernel.

    Now Microsoft does have a pthreads implementation in Microsoft Windows Services for UNIX Version 3.5 from Interix. That runs on NT based systems, and is basically UNIX running inside of a Windows NT based box. Supposedly they have support in SUA 5.2 that I could use to build against. But I won’t. Feel free to try it yourself, but I am going to stay away from the kool-aid. If you are going to install Microsoft Windows Services for UNIX , which is basically a UNIX box, why not just install Fedora or Ubuntu and call it a day?

‘Databased’ Unit Tests

March 14th, 2008

I know ‘Databased’ is not a word. But it was the best word I could come up with. What I am doing now is connecting my unit test output to a MySql database.

By putting the unit tests, I can look back and see when things failed, which help when I pull old files out of svn. So I can sort by pass/fail test ( which is the most common method ) , the test performed and the class.




This image above is RUnit.php . I will include this file in the php/ subdirectory. It only has three parameters to modify at the top of the file and that is about it.

I use a simple homegrown unit test framework. Yet another C++ unit test framework, like we need another one. I needed a much less specific framework. But a very simple framework.

I use cron to do automated tests. I pull the latest copy out of svn, compile run the unit tests, and store the results in the database. It is pretty sweet, but I do not have the failed compiles feeding into the database yet.

Symbology and the big change

March 3rd, 2008

About three years ago , the guys from the OCC got togethter and decided to make changes to the way options are quoted by the market. For an example, The Mar 08 120.00 Puts have the symbol QAAOD while the Mar 08 125.00 puts have the symbol APVOE. So after a few years of work, they came up with this :


Mar 08 120.00 Puts
QAAOD -> AAPL080322P00120000
( AAPL 08 03 22 P 00120 000 )

Not really too difficult to figure out the coding on this system. There are a lot of details concerning things like FLEX options and stocks splits/mergers etc. The big change is due for July 2009, so a about a year and a half we will have to move over. The old symbols will be suppressed after that date.

What does this have to do with the price of tea in China? Not much ( but you can check the tea futures contract ) and not much to do with Raydo.

Internally, we already use the new structure. Just an input filter to change the old symbols into the new symbols. After the big change, we will just drop the filter.

Cross Compilation So Far

February 14th, 2008

    Arrgh. Cross compilation. Never an easy task. Well, it is not that bad except for Windows. Everything compiled the underlying Raydo library and almost every platform compiled the GUI. The only holdout was Solaris 10.

    I was a little negative in my last review of Solaris 10. I do like Solaris, I just think they do not have their stuff together. Solaris has always been geeky, and that influence shows. Sun is trying to make Solaris much more user friendly, but they are letting the geeks do it. Sure, they have the designers and such on the team, but the GUI does not feel ‘finished’. Oh, and they still include CDE ! Crazy stuff.

Platform GUI Raydo Lib
Solaris 10 No* Yes
Windows 2000 Chinese Yes Yes
Windows XP Yes Yes
OSX 10.5.1 Yes Yes
Fedora 8 Yes Yes
Ubuntu 7.10 “Gutsy Gibbon” Yes Yes

    The GUI on Solaris was a no go because wxWidgets would not compile out of the box. I have not spent that much time on it, but the underlying Raydo Lib does work, which means Solaris can work as a server for the system. When I get some time, I will go back and try to get the GUI to run with the Sun compiler.

    One thing about cross compilation is that on every platform except Sun, I compile with gcc.

Interface Ergonomics

February 12th, 2008

    I am a big believer in interface ergonomics. Let me define what I mean by ergonomics in an interface. An ergonomic interface is one where the user feels comfortable using the application. Where using the interface feels intuitive. Clean, consistent and productive interfaces get the GUI out of the way so the user can spend his time using the software. I think my time at Apple ( Macbook Air…drool…. ) years ago has forever changed my perception of how user interfaces should work.

I would like to share three of my favorite links.

    The first one, Ten Ways to Make More Humane Open Source Software has a big of a misleading title. Is should be something like “10 ways to not mess up your GUI”. It is a great article, and well worth taking a look.

    The second article The Rise of Interface Elegance in Open Source Software. This article is more about creeping featuritis and learning to say no.

    The last article The Luxury of Ignorance: An Open-Source Horror Story, is a bonus. Just a rant on how difficult some interfaces are and mentions “Aunt Tillie”.

Here is a great rule from Joel on Software on UI design.

A user interface is well-designed when the program behaves exactly how the user thought it would.

Happy Year of the Rat 4706 !

February 6th, 2008

2008 (or 4706 in the Chinese calendar) is the Year of the Rat using the Chinese calendar.


Three reasons Sun Sucks at OpenSolaris

February 4th, 2008

    They really do suck at marketing OpenSolaris. I don’t know how much they want to be in the Ubuntu / Fedora space. OpenSolaris has live disk ( finally ), so you can try it out.

    I spent a lot of time last week trying to get my application up and running. I did not spend time debugging or anything productive like that. I spent most of the time doing other things waiting for downloads.

    So, here is my first reason. The line between OpenSolaris and Sun seems to be as distinct as mud. You are bouncing back and forth between the two sites. One site for this, one sie for that.

    The second reason is the Sun Java Downloader is just evil. I never could get a complete download. My favorite error message was that I had completed too many successful downloads and would not let me download anymore. I guess for Sun, successful is zero. I finally downloaded the Indiana Developers Preview using bittorrent which is light years ahead of that Java thing.

    Finally , what is happening with Sun studio ? I download a copy of OpenSolaris and I have to go to Sun to get Sun Studio? Can’t you just admit that gcc is a good compiler and included it on the live CD.

    All that said, I really do wish to get my stuff running on OpenSolaris. Then again, I was really frustrated with Fedora a few years back. Redhat turned that around, and I think Sun will also.

    I added a link to Lawrence Scott’s blog. Not much there now, but I think he will start writing more.

Raydo-Announce Mailing List

January 31st, 2008

    I have set up a mailing list for announcements. A low volume list, so it won’t clog you mailbox. I think MAYBE once a month. Drop me an email and I will put you on the list. info @ raydo.com