Archive for the ‘Raydo’ Category

‘Databased’ Unit Tests

Friday, 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

Monday, 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

Thursday, 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

Tuesday, 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.

Three reasons Sun Sucks at OpenSolaris

Monday, 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

Thursday, 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

CMake

Thursday, January 24th, 2008

I am testing out changing the build system to CMake. I want to make building Raydo as simple as possible. Right now I use make, which is not the friendliest way to build things. By using CMake, I can supply , for example, Visual C project file.

So to summarize:
Open Source
  Supports basically every UNIX, MS Windows (MSVC, Borland, cygwin, mingw) and Mac OS X
  Can generate Makefiles and *projects* for KDevelop3, MSVC 6,7, XCode
  Has no other dependencies except for a C++ compiler

So I will be able to supply Windows guys with project files.

Raydo.ORG

Saturday, January 19th, 2008

Ok, so I have Raydo.org now. This will be the mailing list site eventully. I don’t know when I will get it up and running , so for now, keep sending emails directly to my email account.

French & Chinese support in Raydo

Friday, January 11th, 2008

    Well, support for the GUI anyway. Command line stuff is still going to be command line stuff. For that you want it to be english. ( Have you ever tried Chinese on the command line ? )

    I am supporting French and Traditional Chinese first, because those are two of the languages that I can read/write. ( Besides English of course. )

    I originally tried using .po files for translation. That was OK, but not great. It is the supported method for wxWidgets, but that does not mean it is a great method. .po files are based on gettext, and gettext is “sub optimal”. Feel free to translate “sub optimal” as ’sucks’.

    So today, I went with a dynamic translation engine. The translations are defined at runtime using a C++ class. What is special about defining translations at runtime ?

               Plugins.

    When you define plugins, without a run time engine, you cannot add translations without editing the translation file for the entire app. So here is an example, say you write a plugin to pull the 13 week range on an equity. In chinese (HK) , that would be 13週波幅. How many people would want to edit a .po file that would get overwritten by the next update of the software? No one of course.

    By moving the plugin translations to the plugin definition file, we can get UTF8 translations that will not get overwritten by new updates. Coolness.

Plugin’s & Threadsafe functions

Wednesday, January 9th, 2008

    So on to plugin’s in Raydo. The computation functions I am trying to make it easier to add computation, almost like ‘plugin’s. I say ‘plugin’, and when I say plugin, I mean compiled into the code. Doing binary ‘plugins’ is just crazy. The only reason to do that is closed source code. If you have the source like Raydo, it makes much more sense to compile it in.

    So when you write a plugin, you have to worry about threads. The computations are done out in the threads, so you have to be careful to use thread safe functions.

    Certain C++ Standard Library functions from C are particular problems because they hold internal state between calls.

  • asctime
  • ctime
  • gmtime
  • localtime
  • rand
  • strtok
  • rand & strtok will probably not be a problem. The time functions (asctime, ctime, gmtime, localtime) you may end up trying to use but you shouldn’t.

        Some vendors ( like HP ) have thread-safe replacements for these functions, with different names and arguments, but you should realize that these are not portable. You can write thread-safe implementations using thread-specific storage, if you want to.

        If you really want something portable & thread safe, I suggest you use the Boost replacements for the problem functions. I will go into why I am not including Boost in the build at a later time.