I wrote PHP code to export blog entries from a MySQL database to RSS. It was developed for a previous version of this site, and reuses existing classes. You can view that code here.
Monthly Archive for February, 2005
I passed my third certification exam this morning. This means I’m now an IBM Certified Application Developer- Lotus Notes and Domino 6/6.5. I’m proud that I’ve finally gotten some certification. It’s a really major step, professionally.
Another course I took in college was Operating Systems. For the class project I worked with Ken Schulz. Every team in the class contributed a few “programs” and a giant file of all the contributions was distributed. Our OS simulations had to take in the batch jobs, handle job scheduling and memory allocation, and print out results. Here’s a snippet from the input file
$JOB001400300010
GD20LR20GD30DR80BE12GD40LR40GD50CR50BE14
H000PD30BE02PD50BE02H000
$DTA
CMSC 0417
CMSC 0101
CMSC 0140
CMSC 0406
HIST 0101
HIST 0135
PHIL 0001
HIST 0123
HIST 0400
FASH 0101
FASH 0102
PHYS 0121
$EOJ0014
$JOB001901000010
GD50GD60GD70LR70CR60BE09PD50PD70H GD70
LR70CR60BE16PD50PD70H GD70LR70CR60BE23
PD50PD70H GD70LR70CR60BE30PD50PD70H
GD70LR70CR60BE37PD50PD70H GD70LR70CR60
BE44PD50PD70H GD70PD70H
$DTA
THIS DATA DOES NOT CONFORM
EQUAL
EQUAL
EQUAL
EQUAL
NOT SO EQUAL
EQUAL
EQUAL
SUCCESSFUL DATA CHECK
$EOJ19
$JOB002000020020
$REM "Abnormal termination.."
$REM "Prints too many lines"
GD10GD20GD30PD10PD20PD30
$DTA
Testing
123
Extra line
$EOJ0020
$JOB000101000010
$REM Correct: compares the 1st two cards
$REM Try to require swapping
GD61LR60GD72CR70GD83GD95PD67PD70BE11PD84
H LR61CR71BE14PD80H LR62CR72BE21PD80
H LR63CR73BE24PD80H LR64CR74BE31PD80
H LR65CR75BE34PD80H LR66CR76BE41PD80
H LR67CR77BE44PD80H LR68CR78BE51PD80
H LR69CR79BE54PD89H PD98H
$DTA
This is a very cool Operating System!
This is a very cool Operating System!2
No, the first two cards are different ![]()
Yes, the first two cards are the same
$EOJ0001
Here’s a snippet from the printer file
JOB_ID# 0013: JOB0013 had an operation error.
IC20 IRH000 RCMSC C1 TT17 LL0
CMSC 0101
CMSC 0406
CMSC 0417
CMSC 0101
CMSC 0140
CMSC 0406
JOB_ID# 0014: JOB0014 had an operation error.
IC4 IRDR80 RCMSC C0 TT4 LL0
JOB_ID# 0019: JOB0019 has terminated normally.
IC30 IRH RNOT C0 TT21 LL0
THIS DATA DOES NOT CONFORM
NOT SO EQUAL
JOB_ID# 0020: JOB0020 ran out of time.
IC2 IRGD20 R0000 C0 TT2 LL0
The entire project is available here.
Way back in college I took a compiler design course which was one of my favorites. I dug up the code for that and have made it available here.
The idea was to take a program (which looked a bit like Pascal or Eiffel) and compile it into something that could be executed. And, of course, it had to behave correctly. A program might look like
program prog7 is var a, b, c :integer; begin a := 19; b := -36; c := (2 * a + b mod 7) div 3; write(a); write(b); write(c); writeln; end prog7.
or
program prog16 is var a, b :integer; function func1():integer is var res :integer; begin if a = 0 then res := 10; else res := 20; end; return res; end func1; begin read(a); b := func1(); write(b); write(func1()); end prog16.
I was pretty proud of this. There were some 20 problems/programs, which got harder to handle as you went, and if I remember correctly mine got to 19.
I passed my first certification exam this morning. The home team was pleased. Two more tests and I get the next level of certification.
I took some practice tests for Lotus Notes R6 Certification. I got 87% on Notes Domino 6 Application Development Foundation Skills and 71% on Notes Domino 6 Application Development Intermediate Skills. Clearly, there are areas I need to work on. Encryption, workflow, security and apparently application architecture.
A while ago I put together a genetic algorithm with Ruby that does some cool stuff. I was disappointed with my previous GAs- you provide it the phrase and it evolves it. That’s really boring. And useless. I wanted to produce a GA that would tell you something you didn’t already know.
So I wrote this pathfinder. You have a map, which has points/nodes like A, B, C and so on. And there are paths between some of the points, and paths have lengths. A-B has a length of 2, B-C has a length of 7. And so on. I wrote a GA that generates random “routes” and calculates the fitness based on the length of the route and whether or not it begins where the user asks it to and ends where the user asks it to.
The real key here was the mutation function. It wasn’t enough to change existing genes. It also had to insert random genes/nodes at the beginning, end, or in the middle. Now that I’m thinking about it, it probably should’ve been able to delete a gene, too, but I didn’t think of that at the time. Having a very flexible mutation function allowed for more random routes to be generated.
Previous GAs that I have written stop running when the best fitness is 0. Here, there won’t ever be a fitness of 0. The GA can only do the best it can, which may or may not be the best answer. Which is, I think, a much more accurate simulation.
Here is the map file that I used, which is kinda hard to understand so I’ll explain it here. Each line has a from node, a to node, and a length of the path between them. I put things like “A B 2″ and “B A 2″ because I wanted the path between A and B to be two-way. You could make this path one way by removing one of these lines. Of course, all of this would make more sense if I had a pretty picture to show you the map, but I don’t. Running the program
looks like this:
From: a
To: g
Population size: 128
How many generations: 250
@ 0: Best path is AD (10002)
@ 25: Best path is ABEG (6)
And here is the source if you’re interested in seeing/running that.