Documents

Archives

Search

BLOGical Thoughts Archive

May 2010

Thursday, 27 May 2010

I spent all day yesterday tracking down and fixing a problem with the code I wrote at work for translating data into SQL statements. While I was tracking down the actual problem, I found some places where the code could be cleaned up, so I did that, too. I think we are in pretty good shape for a demo of the program to outside interests on Friday. I hope it goes well.

Unless someone runs into another problem, I will spend today adding debugging statements to the code and adding more comments to it. I have found that you can never has enough comments. They help when you look at the code after 6 months and you have completely forgotten what it does and how it does it. That also applies to anyone else that goes in a looks at the code or fixes bugs in it.


Next Monday is Memorial Day. Since we have a long weekend, there will be no further posts here until Tuesday. I hope you all enjoy whatever activity you have planned for the weekend.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Wednesday, 26 May 2010

One nice thing about DVRs is when you schedule to record a show, the DVR decides how long to record. The broadcast of 'Chuck' on Monday night was the season finale and was 2 hours long instead of the normal one hour. If I had set up a normal VHS recorder to record the show, I would have missed the entire last half of the show. As it is, my DVR got the whole thing.


I am still cleaning up the code I wrote at work to convert data requests to SQL statements. The normal requests work fine, but the program also has a capability of adding further restrictions on the data requests, to refine them. Some of those further requests have problems. To begin with, I will have to convert requests for specific fields to lower case. They are listed in camel case (e.g., CamelCase) in the application and they are sent on to my code that way. Those database fields are case-sensitive and are all lower case, so I will fix that problem by the conversion.

Another problem I am having is in the analyzing portion of the code. A co-worker added some code to unfold some requests, and I think there is a problem there, as fields are showing up as terms instead of fields. I will fix that today, I hope.

I have to get all this working before Friday, as we are giving a demo to outside parties then. I will not be at work on Friday, so I have to have all this finished in the next two days.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Tuesday, 25 May 2010

I have posted on the NILUG web site that I will be giving a talk on how to write programs rapidly in Lazarus on Linux, so I need to start an outline of what I'm going to say. I thought I would take about 45 minutes and create a basic text editor application. It will be a challenge to give it enough capability in the alloted time, but I should be able to do that.

The application will have a main menu, a toolbar and a text editing area. I can easily hook up dialogs to open, load and save files. I will use the SynEdit components to add an editing area, since that edit component supports all kinds of add-ons such as a gutter for line numbering and bookmarking, and a highlighting capability. By the time I have finished, it should be a capable text editor without any bells and whistles.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Monday, 24 May 2010

I got quite a bit done on the weekend. On Saturday at the NILUG technical session, I installed Ubuntu 10.04 on my netbook computer. I also helped a couple of the other members installing Linux on their machines.

On Sunday, I worked on the Delphi program I have been updating. I am fixing errors introduced when I converted it over to using SQLite. That is going to take quite a while, as there are many modules to work through and I have to clean up the original source code so I can actually read it. I have done four or five modules, but I have a lot more to go through.

I got an indoor Dutch oven at an auction a while back. I have now identified it as an Iron Mountain oven, which was manufactured by Griswold in the 30's and 40's and was sold in farmer's co-ops and other stores like that. It had no lid when I got it, so I ordered one. I received a Lodge Logic 10 1/4" lid, which is just a bit too large to fit. So one of the other things I was doing on Sunday was grinding off some of the lip on the lid to make it fit. I'm not finished, but I'm getting close and the lid still looks fine. Now all I need is a ring for my Lodge Waffle iron.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Friday, 21 May 2010

At work, I tried to dump the 5 SQL statements into a temporary table, so I could get back a unified record set. Sounds like a fairly easy thing, right? Not if you don't have creation rights on the database server. I could not create the temporary table in the first place.

I finally went to the third and final option: I sent each SQL statement to the database server separately. When I received each record set result from the server, I accumulated them so I could send them on as a single set of data. And that is how I spent all of yesterday.

Even though I am working on a non-visual section of this program, it is gratifying to see the results of my work displayed in a histogram, three kinds of charts and as a list of data records. That is what we are seeing now, so we are very close to being finished for the demo we will be giving this afternoon.


Silly sign of the day:


Free/Open Source Software

Thursday, 20 May 2010

Yesterday at work, I worked the whole day at adding code to our project that would create a complex SQL statement (5 UNIONs) to get a single field's worth of data. I finished debugging it about five minutes before I was due to go home, so I ran the statement. The database server choked on it. It turns out that UNION operations are very expensive in terms of computer memory and the server didn't have enough memory to do the job. By about a gigabyte.

So today I will modify the thing to not use unions. I will dump the data from the five separate SELECT statements into a temporary table, then select all the columns and rows of that table. Simple, eh? I hope so. We will see if that works.


Here's a fun little bash script. Highlight the code and copy it to your clipboard then paste it into your editor. Save it in your home directory as revolver.sh.

#!/bin/bash

if [ $[$RANDOM % 6] -eq 0 ]; then
 echo "*BANG!* You are dead..."
else
 echo "*Click*"
fi

Once you have saved the script, bring up a terminal. Do the following one time:

chmod +x revolver.sh

You will now be able to run the script from the command line by typing

./revolver.sh

To run it again, press the up arrow and then Enter.


During a conversation about the demise of pay phones:

Editor: "Where would Superman change nowadays?"

Reporter: "Change? Where would he work?"


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Wednesday, 19 May 2010

Fixing the errors in the Delphi program I modified will be a larger task than I thought it would. To fix some of them, I will have to first figure out what the programmer meant to do, then find a way to do it with the new database controls. There are 44 of these, so it's going to take a while.

This program was written over 10 years ago. I can't remember if I wrote it and another programmer modified it, or if he wrote it, using my original program as a template. The original was written in C for Windows 3.1. At any rate, whoever wrote it had little knowledge of how databases and Delphi database components work. If I started from scratch, I probably could put together a much better version in a couple of months, but I don't have the time. So I will get this one working again using SQLite, which is a truly portable database.


 

Silly sign of the day:


 

Free/Open Source Software

 

Tuesday, 18 May 2010

At work, I have completed the first phase of the coding for creating SQL statements. The GUI front end sends me a data request, I translate it to SQL and send it along. It eventually ends in a dataset being returned from the database and being displayed in the form of graphs, a histogram, a tag cloud and count lists (facets). I am pleased with how well it works.

Now I have to start phase two, though. There is one request for data that I had to initially ignore until I could figure out how to handle it. It called for counts of a generic item called 'User Name'. I have figured out how to do that and it will result in the creation of an insanely large SQL statement with at least 5 'SELECT' statements joined together with 'UNION ALL'. It will return two colums of data as a result set, which is easy to handle by the front end. I may have to refactor the SELECT field processing so I can do this in a tidy and easy to understand manner.


 

Silly sign of the day:

Don't you just love Windows?


 

Free/Open Source Software

 

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

 

Local and Other News

Monday, 17 May 2010

I have been working on the Delphi program again. I created the database for it using SQLite and populated the database with the default values. I found that the names of some of the old Paradox database fields needed to be changed to use with the new database, as the names conflict with SQL keywords. That was easily done in the database, but then I had to go through the various program files and change references in them, too. I then changed the database table components for new ones that use SQLite.

After all the changes, I attempted to recompile the program and ended up with 44 errors. I will now have to go through and fix all those errors. Many of them will be the use of methods that do not exist with the new database components, so I will have to find alternatives.


 

Most of the weekend was kind of a bust. On Saturday, the Dutch oven workshop that had been canceled from two weeks ago turned in to a Dutch oven demo, since we didn't get any students. I actually had leftovers for my Dutch oven potatoes, as there weren't enough people to eat the food. Major bad news. I spent all day Saturday on something that ended up being just a cookout for about 6 people, instead of going up to Lost in the 50's in Sandpoint.

I did go up to Lost in the 50's on Sunday, only to discover that they were lost. It seems that on the last day, everyone leaves early. It was a good thing I also went up there to look at the Cast Iron guy's pots in the Sagle Flea Market. I was looking for the ring for my waffle iron and for a lid for a ten inch indoor oven. It turns out that the Cast Iron guy wasn't there, so that was a bust, too.


 

Silly sign of the day:


 

Free/Open Source Software

 

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

 

Local and Other News

Friday, 14 May 2010

I found the database program I used to extract information from the Delphi program's database. It was on a hard drive that was mounted on one of my systems, but was not mounted in the VM I was using to look for the program. Both of those items are Windows 2000, and I thought I had set up so that disk would be mounted. Obviously, it wasn't.

Now all I have to do is create some SQL statements that will create the tables. For that, I need to examine the structure of the old database and create that structure in the new one. That should not be too hard. The hard part will be finding the time this weekend to do this.


 

This will be a busy weekend. The Rathdrum Dutch oven workshop will happen on Saturday and will basically be an all-day affair. Lost in the 50's up in Sandpoint starts today and continues through Sunday. I plan to go up there on Sunday. So that pretty much takes care of the weekend.


 

Silly sign of the day:


 

Free/Open Source Software

 

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

 

Local and Other News

Thursday, 13 May 2010

I now need a tool to help me transfer the data in a Paradox database, preferably to SQL statements. I also need one to do the same thing with the Paradox table schemas. The intent is to completely recreate the database in SQLite. I am sure I did the former before with a tool I created, but I can't remember which computer I did it on and what the name of the tool was. I don't think I needed the table schema that time, so I didn't do that.

Once the data is transfered to the new database, I will hook up the SQLite controls in place of the normal Delphi database controls. I am hoping I won't have to make any code changes after doing this, but that's probably a vain hope.


 

I'm still having problems with the code I did at work, but now it isn't problems with my code - it's problems with other people's code. Not so much that there are errors in the code, but the two pieces just don't meld well. My current problem can be fixed by adding a couple of fields to the incoming data, but I'm not sure I will be successful in convincing the Keeper of the Data to do that. I don't have any other ways to fix my problem, but I'm sure someone else can come up with one involving water buffaloes, pig fat and Brylcream.


 

Silly sign of the day:


 

Free/Open Source Software

 

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

 

Local and Other News

Wednesday, 12 May 2010

I am still working on the Delphi program I talked about yesterday. I have made all the various windows (forms) uniform. This means that the buttons are always in the same place and each window acts the same as every other one. This is important for user comfort.

I have found a component set to allow me to use SQLite in Delphi, and I may install them tonight if I get any time.


 

At work, I've been fighting problems with the code I wrote to analyze and translate requests for database data. It turns out the problems are not mine, but the code that hands the requests to me. Now that we know who the culprit is, we can work on getting it to stop.


 

We are going to try the Dutch oven workshop again this Saturday. It will coincide with the (delayed) grand opening of the Rathdrum farmer's market, so Rathdrum City Park will be quite crowded on that day. I will bring along the cast iron items I got at the auction to let the experts can take a gander. I'm hoping someone can give me a lead on where I can get the proper-sized ring for the waffle iron.


 

Silly sign of the day:


 

Free/Open Source Software

 

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

 

Local and Other News

Tuesday, 11 May 2010

I tried to convert a Delphi program over to Lazarus, so it could be compiled on both Windows and Linux. I was unsuccessful in this, as there was too much Windows-specific stuff in the program. So I continued to work on it in Delphi.

The guy who originally wrote the program had database table references spread all over 20 different files. I created a data module and consolidated the table components in that module, so I had only one reference to each table. I then had to compile, then fix, several hundred references to the tables, so they now refer to the data module instead of a local reference. The program now compiles cleanly, but there is more to do.

Originally, the program used the Borland Database Engine, which requires installation on every machine where the program is installed. The BDE also uses dBase as its database. Both of these things are unacceptable, so I plan to install SQLite and use new components to access a new SQLite database. I have the original database schema in a series of SQL statements, so I can recreate it in SQLite. All that should keep me out of trouble.


 

Silly sign of the day:


 

Free/Open Source Software

 

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

 

Local and Other News

Monday, 10 May 2010

I finally figured out how to store videos on my MythTV DVR and play them back. There were actually two problems. The first is trying to get the DVD to show up in the list. That was simply a case of doing the following:

 

The other problem was more subtle. Once I had a list of movies in the Watch Videos menu, when I selected one, I could not play it. This turns out to be a a bug in MythDVD. It seems that if you rip your DVDs to ISO images and you put them in a storage group, the ISOs will not play. Since MythTV came with storage groups preconfigured, this was a problem for me.

To fix it, I shut down the MythTV front end and started the MythTV Setup program to configure the back end, then did the following:

 

The final step is to go back in to the front end and do the following:

 

These changes will allow the ISO videos to play in the front end.


 

It's been a few years since I've had lunch at Burger King. If the food I got on Sunday is representative of their menu, it will be quite a few years until I go there again. I ordered a Whopper with cheese, onion rings and a diet Coke. The only thing that actually tasted the way it should was the Coke. Somewhere in the stale cooking oil and breading of the onion rings, I suppose there may have been some bits of onion, but I can't tell you for sure there was. As for the burger, it was pretty sad, too. I think I'll stick to Caruso's deli sandwiches from now on.


 

Silly sign of the day:


 

Free/Open Source Software

 

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

 

Local and Other News

Friday, 7 May 2010

Last night I took a crack at converting a Delphi project over to Lazarus. First thing I did was bring up my creaky old Windows 2000 Professional VM. I then cranked up Delphi 5 and loaded the project, then loaded all the units of the project into the IDE, right-clicked on each form and selected 'Save DFM as text'. I then saved each unit.

Once I had everything saved in text, I closed down Delphi, zipped up the project directory and copied it from the VM to my workstation. I then brought Lazarus online and selected 'Convert from Delphi project'. That worked for the project file, but nothing else was converted. I will have to read some more to see what I have to do to get the DFM files converted.


 

I need to create at least 4 copies of the Ubuntu 10.04 disk I downloaded last Friday. There have been several requests for a copy from NILUG members and I would like to be ready to hand them out tomorrow at the NILUG meeting.


 

Silly sign of the day:

Never underestimate the stupidity of a Windows programmer


 

Free/Open Source Software

 

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

 

Local and Other News

Thursday, 6 May 2010

The code I am working on at work still has some holes in it, but that's because the entire program still has areas that are undefined. While testing the program, the front end throws six data objects at my bit of code. I handle three of them okay. Two others are not handled, bit I think that's because I have had to throw out parts of their requests, since those parts are undefined. The sixth request throws an exception, but that should be easy to track down.

Of the six requests, only one matters at this time. The second request is for data to populate a histogram. I handle that correctly and my other code produces a correct SQL statement to send to the database server, but I am not getting any data back. I think that is a problem with someone else's code. I will be working on that today. The goal is to query the database and get visual results we can show to the boss on Friday (tomorrow).


 

The general session of the North Idaho Linux Users Group takes place this Saturday. We don't have a topic for this meeting, so it's pretty much a Q and A session. The public is welcome to attend.


 

Silly sign of the day:


 

Free/Open Source Software

 

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

 

Local and Other News

Wednesday, 5 May 2010

At work, it seems that the source file I am working on debugging is holding up the whole show, when it comes to getting data from our database. I will try to finish with it today, but other problems may pop up that will prevent that. I don't like being the focus of attention like this, but I did take that code over from another programmer and I had to learn what he had done before I could complete it.

It turns out I did not learn enough. The code can process two kinds of data: raw from log files and database. The raw portion is the part the other programmer did and it seems to be mostly complete. I had to do the database part, and I missed a couple of subtle things when I did it.

This code processes data objects, and it doesn't help any that they still haven't exactly decided what some of the data objects properties actually contain.

I think I could use a small programming break, but that won't happen until the end of the month.


 

Silly sign of the day:


 

Free/Open Source Software

 

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

 

Local and Other News

Tuesday, 4 May 2010

I picked up a lapidary slab saw and a faceting machine yesterday. I had to go back again because the seller is too ill to go to the bank, so he only accepts cash. I ended up with a 14" saw instead of an 18" one, as that one is way too heavy. 14" should be fine for what I want to do. I will set it up and test it on the weekend. It is a chop saw - it works the same as a miter saw, with lubricant pumped to the top and dripping on the blade. A bit messy, but we are talking about cutting rocks, not lumber.


 

I spent last night using my gdvdslides program to create 7 video tracks of the last 7 years of the Northwest Teardrop Spring Fling. I then created a DVD ISO image using DeVeDe, then burned the DVD. I also created a nice label for the DVD and a cover for the DVD case. I plan to present this to the organizers of the event at the next Spring Fling, this Memorial Day weekend.


 

Silly sign of the day:


 

Free/Open Source Software

 

Monday, 3 May 2010

On Saturday, I put all my Dutch oven equipment in the truck and drove through all the nasty rain over to Rathdrum, only to discover that the Dutch oven workshop had been canceled due to rain. The Rathdrum Farmer's Market was also rained out, so I suppose I shouldn't complain too much. The workshop will be rescheduled for the 15th.

It turns out that the organizer of the Dutch oven events can no longer send email to me at this address. He uses Yahoo for his email and they keep bouncing his messages. I gave him my gmail address so he can still contact. I have no idea what the problem is, because other email messages get through okay.


 

I took advantage of the unexpected free day on Saturday to get a lot of chores done around here. I even made a Costco run to get bacon and a couple of DVDs. One thing I found out is that shopping for groceries at any time later than about 10am is a royal pain. There are way too many people in the store and they all insist on driving their shopping carts down the middle of the aisle. I will stick to my 7am shopping in the future.


 

Michael's Words of Wisdom

Insanity is doing the same thing over and over, and expecting different results. This must be why the unwashed masses keep electing a Republican or Democratic President.


 

Silly sign of the day:


 

Free/Open Source Software

 

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

 

Local and Other News