Progress User Conference 2009 – Day 1

The first day of the Progress User Conference 2009 is behind me, and there were some interesting, some not so interesting sessions I attended.

The Opening Session went largely past me: I had to switch around windows a bit which caused me to restart the session a few times, and then a production issue took me away from my desk for a while. I intend to go back and look at it some time next week.

The first break-out session looked interesting: “Transparent Data Encryption”. This session described an add-on product to encrypt the whole or parts of the database. I can see some problems with the implementation, mainly that data is stored in memory unencrypted, which was a recent security issue I heard (can’t remember what the product was – I think it was Acrobat?). For the rest it looks interesting, albeit not very flashy.

After that came “Introducing OpenEdge Explorer”. It allows the same functionalities as Progress Explorer, but can be run from a web browser – thereby allowing multiple platforms. Similar to Progress Explorer, OpenEdge Explorer allows you to manage multiple machines and multiple products from one interface. OpenEdge explorer adds a few extras, like a log file viewer in the browser. The interface is similar to OpenEdge Management.

The last session before the break I followed was “Optimizing OpenEdge Performance in VMware ESX”. John Harlow from BravePoint described what VMWare is, and in what situations OpenEdge could be virtualized. He went into some detail on what memory settings are best, what are the adventages and disadvantages of more memory and CPUs, and what disk system should be used. Very informative.

After the break I switched channels and went to the UI flexibility track. “Serializing ProDataSets to JSON” describes the new features in OpenEdge 10.2B to convert to and from JSON objects with one or two statements. This makes Progress a more flexible server for WebServices.

“RIA in Perspective” describes the various Rich Internet Application interfaces, and which interface is most appropriate in what situations. Distinctions made are in user knowledge level, user interface and footprint. The options are combined in a RIA User Interface Decision Tree, available in the Progress Community website.

The last session for the day was “Implementing RIA and OpenEdge”. Dustin Grau from BravePoint describes what tools he uses to create RIAs, and showed several components. Unfortunately at that point I had the presentation slide maximized (the interface for the online conference contains a video screen which most of the time shows the presenter’s face, and a second area that displays the slide show), and missed most of the live demo. Another one on the list of presentations to view later.

All in all an interesting day, with some research subjects. I want to go back to two sessions to see them in their entirety, and two sessions I wasn’t able to attend (“Introducing OpenEdge GUI for .NET” and “Tales from The Trenches: Using the OpenEdge GUI for .NET”). I’m looking forward to Day 2, where I’ll be attending some sessions on productive development and distributed development.

Progress User Conference 2009 – online!

I’m currently attending my first Progress User Conference without being on location. Progress decided to go with an on-line conference this year in honor(?) of the economic recession.

The on-line format has some advantages and some disadvantages. Advantages are that I don’t need to get on a plane, check into a hotel, run all over the place to find the right room. I can actually keep an eye on my email, and look up things online, while listening to the presentations (although I could do that with a laptop). Disadvantages are the audience responses, human interaction, and the fact that I’m still at my desk and my co-workers look at me sideways wondering why I have these headphones on…

I’ll post a short update at the end of each day (which now ends around 1:15PM, as opposed to around 4PM for regular conferences) to let you know what I’ve taken away from that day.

SQL Challenge vs. Progress 4GL

One of the newsletters I subscribe to is the SQLCentral solutions. A couple of weeks ago they issued the Summer SQL Stumpers 2009, asking for the fastest way to calculate all the primes 1000 or lower. The fastest solution they came up with runs in about 7 seconds, which I thought was terribly slow for the algorithm used (Sieve of Atkins and Aristophanes), and I thought I’d give Progress a try. I came up with the following:

DEFINE TEMP-TABLE ttPrime
FIELD prime AS INTEGER
INDEX prime prime.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE test-val AS INTEGER NO-UNDO.

ETIME(TRUE).

DO i = 1 TO 1000:
CREATE ttPrime.
ASSIGN
ttPrime.prime = i.
END.

DO i = 2 TO 499:
ASSIGN test-val = i * 2.
REPEAT WHILE test-val < = 1000:
FOR FIRST ttPrime
WHERE ttPrime.prime = test-val
EXCLUSIVE-LOCK:
DELETE ttPrime.
END.
ASSIGN test-val = test-val + i.
END.
END.

MESSAGE "Etime" ETIME
VIEW-AS ALERT-BOX INFO.

FOR EACH ttPrime
NO-LOCK:
DISPLAY ttPrime.
END.

On my machine the procedure runs in about 93 milliseconds, and as far as I can see the results are accurate. Progress 4GL FTW!

ICVerify: encrypt request and answer files using EncryptionManager

To increase the security when dealing with credit card processing via ICVerify’s request/answer methodology, it is possible to encrypt and decrypt this information. However, the documentation is fairly sketchy on this subject, especially when you’re not working in one of the languages used in the examples in the SDK.

After some hair-pulling on why it doesn’t work, I think I’ve got it figured out now. Here are the steps I used to get it working:

  1. EncryptionManager.DLL is not a normal DLL, it is a .NET assembly. Trying to register it with regsrv32 will result in an error message, saying that it doesn’t have a DLLRegisterServer entry point. The trick is to use either the .NET gacutl.exe or the icvgacutil.exe supplied on the ICVerify SDK CD.
    UPDATE:You also have to use regasm to register the assembly!
  2. Once registered at the Global Assembly Cache (GAC), the name of the DLL is not EncryptionManager. To make things more interesting, I had to link to the name FirstData.Encryption.Facade.EncryptionManager. The only way to figure this out is to dig through the registry after registering the DLL, or to use the option on the GAC utility to write out a registry modification file.
  3. In Progress, you can use the COM viewer to access EncryptionManager.tlb, and see the different methods defined in the DLL. You’re only going to be using 2 of them most likely: EncryptThirdPartyMessage and DecryptThirdPartyMessage. Both use the creation date of the file you’re working with, so be careful not to copy this file or move it across file systems.
The Progress code I used to encrypt a request file is as follows:

DEFINE VARIABLE vhEncryption AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE vcPrepFilename AS CHARACTER NO-UNDO

INITIAL “C:TEMPicver001.prep”.

DEFINE VARIABLE vcReqFilename AS CHARACTER NO-UNDO

INITIAL “C:TEMPicver001.req”.

DEFINE VARIABLE vcEncrypted AS CHARACTER NO-UNDO.
DEFINE VARIABLE vcRequest AS CHARACTER NO-UNDO.
DEFINE STREAM sOutput.

UPDATE vcRequest FORMAT “x(60)”.
CREATE “FirstData.Encryption.Facade.EncryptionManager” vhEncryption.
OUTPUT STREAM sOutput TO VALUE(vcPrepFilename).
vcEncrypted = vhEncryption:EncryptThirdPartyMessage(vcPrepFilename,vcRequest).
PUT STREAM sOutput UNFORMATTED vcEncrypted.
OUTPUT STREAM sOutput CLOSE.
OS-RENAME VALUE(vcPrepFilename) VALUE(vcReqFilename).

The decryption routine is somewhat simpler, since we don’t have to move files around so much:

DEFINE VARIABLE vhEncryption     AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE vcAnswerFilename AS CHARACTER NO-UNDO

INITIAL “C:TEMPicver001.ans”.

DEFINE VARIABLE vcEncrypted AS CHARACTER NO-UNDO.
DEFINE VARIABLE vcDecrypted AS CHARACTER NO-UNDO.
DEFINE STREAM sInput.

CREATE “FirstData.Encryption.Facade.EncryptionManager” vhEncryption.
INPUT STREAM sInput FROM VALUE(vcAnswerFilename).
IMPORT STREAM sInput UNFORMATTED vcEncrypted.
vcDecrypted = vhEncryption:DecryptThirdPartyMessage(vcAnswerFilename,vcEncrypted).
INPUT STREAM sInput CLOSE.

These code snippets should have some more error checking. Also, the request can be more than one line, depending on the version of ICVerify and the answer file settings in the configuration.

“Hello, World” in 366 programming languages

I came across this interesting page, that shows the ubiquitous “Hello, World!” program in 366 different more or less well known programming languages.

It clearly shows the difference in the two database language that we use at my place of work, Cobol and Progress.

Cobol:

* Hello World in Cobol

*****************************
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
MAIN SECTION.
DISPLAY “Hello World!”
STOP RUN.
****************************

Progress:

/* Hello World in Progress */

message “Hello World” view-as alert-box.

Check it out, there are some weird languages listed, like LOLCODE and Argh!

Setting up MXP to run under Linux

Recently our systems administrator asked me if it was possible to run MXP under Linux. “I don’t think there is a client of Progress for Linux, at least not graphical”, was my first response. But I got intrigued, and started digging (or rather, googling) around. And it is possible.

I’ll describe what I did under Ubuntu 7.10 with Progress 10.0B, and MXP 8.1E. The steps should be very similar for other Linux flavors, or later versions of Progress and MXP.

Step 1: Install Wine

The first step is the easiest: install wine.

sudo apt-get install wine

This should install wine (if it wasn’t already installed), and any dependencies.

Step 2: Configure wine with IEs4Linux

The next step is to configure wine. You can do all of it manually, but by far the easiest is to use IEs4Linux. You don’t have to use the latest beta (which includes support for IE7), since we’re only interested in the underlying framework, not the support of IE.

The best place to look is the IEs4Linux website, but in case the steps aren’t available:

  1. Open a terminal
  2. Open /etc/apt/sources.list
        sudo gedit /etc/apt/sources.list
  3. Uncomment or add the following lines
        deb http://us.archive.ubuntu.com/ubuntu gutsy universe
  4. Add this line:
        deb http://wine.budgetdedicated.com/apt gutsy main
  5. Close gedit, update apt-get package list and install cabextract:
        sudo apt-get update
        sudo apt-get install cabextract
    You might get an error about an untrusted site (wine.budgetdedicated.com), but you can ignore that.
  6. Download IEs4Linux and install
        wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
        tar zxvf ies4linux-latest.tar.gz
        cd ies4linux-*
        ./ies4linux

Step 3: Install Progress 10.0B

To install Progress, you have to have your license code handy. Also, in my case I had the installation CD copied to the hard drive. In any case, it’s as easy as typing

wine setup.exe

and following the prompts.

Note: the standard installation of wine treats everything as Windows 2000. I ran the setup under Windows 2000, then switched to Windows XP as standard. I don’t think there is a difference for Progress.

Step 4: Installing MXP

I’m assuming that you already have an installation of MXP on your network somewhere. If not, install it from a regular Windows machine, and copy your settings over.
The installation of MXP hinges on a couple of things:

  1. The startup icon. Copy this from a Windows machine already running MXP
  2. The services file. This is used to connect to the proper databases. Add the services needed to /etc/services.
  3. Most installations have a shared drive that contains sources or compiled programs. So that will be our next step.

Step 5: Creating a mount to a Windows Share

We have all the compiled programs installed on a share on our Windows server, which is mapped to the Q drive. The first step is to make this Windows share visible on our Linux box:

  1. Make sure you have the Samba filesystem installed:
        sudo apt-get install smbfs
  2. Add a line to /etc/fstab like this:
        //admin/progress.mxp /mnt/progress.mxp smbfs credentials=/home/ronald/.smbpassword,user,defaults 0 0
    This will allow the system to automatically mount the Windows share (//admin/progress.mxp) on a mounting point on Linux (/mnt/progress.mxp) as Samba (smbfs) with the credentials from a hidden file .smbpassword
  3. Create the .smbpassword file:
        gedit .smbpassword
        username=DOMAINronald
        password=TopSecret
You can get fancy by not automatically mounting the share during system startup, but adding an entry to your login script that mounts the drive properly. Let me know how that turns out… 🙂

Step 6: Linking a drive letter to a Windows Share

Wine has a nice little solution to map shares to drive letters:

  1. Select Applications->Wine->Configure Wine
  2. Select the Drives tab
  3. Add a drive mapping
The drive mapping will be the next available drive letter. If you’re not happy with that, open a terminal, navigate to .wine/dosdevices, and create a symbolic link to the desired mounting point:

ln -s /mnt/progress.mxp q:

Step 7: Install the foresight.fon font

At this point you should be able to start MXP with the icon, and be OK until you actually enter a username and password. After that, all hell breaks lose because the foresight font is not installed properly. I muddled around for a while, and finally came across this:

  1. Make sure you have the microsoft core fonts installed.
        sudo apt-get install msttcorefonts
  2. Install fontforge
        sudo apt-get install fontforge
  3. Use fontforge to convert foresight.fon to a BCF file.
    1. Open foresight.fon in fontforge.
    2. Go to the “Element” menu, and choose “Font Info…”
    3. Go to the Encoding tab
    4. Click the box next to Encoding (probably reads Windows Latin (“ANSI”)
    5. Choose “ISO 8859-1 (Latin1)”
    6. Click “OK”
    7. Go to the File menu, choose “Generate Fonts…”
    8. The right hand box should be set to BDF, if not, change it to BDF
    9. Click “Save”
    10. 96 dpi is sufficient, click OK
    11. Go to where you saved the font, and rename it to how you want it to show up, i.e. foresight.bdf
  4. Convert it from BDF to PCF format:
        bdftopcf -o foresight.pcf foresight.bdf
  5. Create a bitmapped fonts directory
        sudo mkdir /usr/share/fonts/bitmaps
  6. Copy and install the font
    1. sudo cp foresight.pcf /usr/share/fonts/bitmaps
    2. sudo mkfontdir /usr/share/fonts/bitmaps
  7. Make the new directory available as a font directory
        xset fp+ /usr/share/fonts/bitmaps
  8. Refresh the font server
        sudo xset fp rehash
The font should now be available, and MXP shouldn’t complain about weird geometry anymore.