Tuesday, August 09, 2011

Fluent notation in PL/SQL

I am a big fan of the Fluent notation that has been gaining popularity in the .NET world. I decided to do an experiment to see if I can get PL/SQL to have something similar.

I managed to make this work:

declare
  ftp fluent_ftp := fluent_ftp();
begin
  ftp.run(
    ftp.for_country('UG',
      ftp.for_period('2011', '01', '01', ftp)
    )
  );
end;

To enable this type of syntax I had to create a custom type in PL/SQL first.

CREATE OR REPLACE TYPE schema.fluent_ftp AS OBJECT
(
    country_cd   VARCHAR2(2),
    fin_year_cd  VARCHAR2(4),
    fin_month_cd VARCHAR2(4),
    fin_day_cd   VARCHAR2(4),
    CONSTRUCTOR FUNCTION fluent_ftp RETURN SELF AS RESULT,
    CONSTRUCTOR FUNCTION fluent_ftp
    (
        a_fin_year_cd  VARCHAR2,
        a_fin_month_cd VARCHAR2,
        a_fin_day_cd   VARCHAR2,
        a_country_cd   VARCHAR2
    ) RETURN SELF AS RESULT,

Internally the new type just calls the existing API so no changes are needed on the underlying API at all.

MEMBER PROCEDURE run(a_fluent_ftp fluent_ftp) IS
    BEGIN
        schema.calculate_ftp.run(a_country_cd   => a_fluent_ftp.country_cd,
                                         a_system_code  => '',
                                         a_fin_year_cd  => a_fluent_ftp.fin_year_cd,
                                         a_fin_month_cd => a_fluent_ftp.fin_month_cd,
                                         a_fin_day_cd   => a_fluent_ftp.fin_day_cd);
    EXCEPTION
        WHEN OTHERS THEN
            RAISE;
        
    END run;

So that is how you can mimic the Fluent notation that the .NET community is enjoying currently on products like Fluent NHibernate and others.

Monday, April 11, 2011

Belkin N150







I finally found a wireless router. I was actually looking for a wireless access point only, but it seems the stores only stock the wireless router / ADSL modem types.

I read some reviews on the Belkin and the general feeling was that it isn't a very good device. I was sceptical but it was cheap and it was the only one that was close to what I needed, the other combos where over the top industrial things at an over the top price.

I installed it and it works very well. Here in my area the ADSL lines are very noisy and the Belkin manages to sync @ 4096 mbps, so that is very good.

My Apple iPad is also quite happy with the router, which was the main reason I replaced my old wireless router. The iPad didn't work at all with the old wireless.

So the Belkin N150 is a very nice cheap wireless router / modem, just don't expect industrial performance from it, but for home use it is very good.

Saturday, April 02, 2011

Nintendo 3DS




So the new Nintendo 3DS is out in South Africa and I had a peek at the photos and marketing material. I still need to see it in action but I am tempted to get one.

The marketing material says it can play DS games and the original GameBoy and GameBoy Color games. I am guessing it can play GameBoy Advance games too. I would probably need to rebuy them online but it should be cheap.

The 3DS games look brilliant though, so that already will make it worth the money. I should probably first finish all my PSP games before buying a new hand held console, but it is very tempting.

Official 3DS page.

Wednesday, March 30, 2011

Oracle 11gR2 on Solaris


Oracle just ran some benchmarks on their new integrated enterprise platform. Since Oracle bought Sun, they now own some of the best hardware around.

According to this article the new Oracle Solaris (RIP Sun Solaris) together with Oracle 11g R2 is lightning fast. Oracle Benchmark


Sunday, March 27, 2011

MacBook Air




We (my wife and I) went to have look at the MacBook Air and were very impressed. It only has a 64gb SSD, but since my wife will use it most of the time for her work, it shouldn't be a problem.

I don't have a working knowledge of OSX so it will be a new experience to figure out how the Apple OS works. I will probable get a copy of Microsoft Office for Mac to do all my usual work on. DropBox will keep my documents in sync.

So the plan is to get the MacBook Air end of April.

Saturday, March 26, 2011

First blog entry from the iPad













I bought an iPad a few days ago. It is the iPad 1, not the iPad 2. Since I bought it, I don't use my PC at home anymore, except for development work. The normal stuff like reading email, browsing the web, reading comics etc. I now use my iPad for.

I also bought BlogPress to blog from the iPad now, so this is the first post on the iPad.

My Android is still my primary mobile device, but the iPad's size makes it easier to use around the house. One thing I don't like about the Apple AppStore is many apps I need to buy before I can try them, on Android Market there is always a free version and a paid version, so I can try before I buy. On the positive side I can buy apps from the Apple AppStore and not from the Android Market. This relates to South Africa being a behind the times 3rd world country and not Google.

Seems the BlogPress app is also very nice, so it seems the $2.99 was not wasted on something I didn't want.



Monday, February 28, 2011

Bye bye, Argility

So today is my last day at Argility. I've been with the company for 5 years, it is the longest I have been with any company in my career.

So we had fun times and work was always great. As with any software project there were some difficulties but that happens on any big project, software, mining, electrical etc. If the project is big, the project will be difficult.

So here's to 5 great years at Argility.

Saturday, January 15, 2011

Playstation 2 Emulation

Recently I started playing all my old NES games on my PSP using emulation. Replaying all the old games I bought over the years is great fun.

I own a PS2 and a few PS2 games but with my new HD LCD TV the PS2 games just look bad. So eventually I decided to ask the Googler if there was something I could do about it and that is how I found PCSX2.

PCSX2 basically emulates a PS2 console, but I can now make use of the nice goodies in DirectX 10, so my old PS2 games really look much better.

Paired with my XBox360 wireless controller these games play just like in the old days, but with better graphics.

Wednesday, January 05, 2011

USB Safely Remove

I eventually bought USB Safely Remove. If you make use of USB devices, especially USB drives and flash drives, then this tool is essential.

I find that sometimes when I want to remove a USB device from my PC that it won't detach. Sometimes it is something obvious like I am still copying a file to it, but sometimes you have no idea why it won't detach.

USB Safely Remove fixes that. It will force detach the device if you are certain that everything is finished. It will also tell you which process is preventing you from detaching the device.

Saturday, January 01, 2011

Cape Town 2010

We had a brilliant time in Cape Town this year.

Some nice photos from the trip is available to Facebook
Allee Bleue
Franschhoek
Butterfly World
Blaauw Klippen
Picking Strawberries