Documents

Archives

Search

BLOGical Thoughts Archive

August 2010

Tuesday, 31 August 2010

The reason I had to work the weekend is a section of the code that would not support searching over an extended time period with lots of data. Basically, since I was told not to use JOINs or UNIONs, as they were very slow with our tables. I was querying one table, getting a list of records for the main table, then generating SQL statements to query the main table for only those records. That works fine for a somewhat small set of results, but it is painfully slow and eats enormous amounts of memory for larger sets. It could even crash the program.

We ended up re-doing the lookup table so it could be easily and fairly quickly be used with the main table using JOINs and UNIONS. That puts the memory usage burden on the database server, which is better able to handle it. It also ups the complexity of the SQL statements I have to generate by a factor of at least three.

So since Saturday, I have been pair programming with a co-worker and we have managed to turn out some code that will produce the correct complex SQL statements. We still have some debugging to do, but that should be fairly straightforward, compared with the actual programming task. And we are only one day late on this.



I have also done some work on the soccer program at home. I have finished up the initialize practice sessions dialog, except that it is fed by another dialog that I have not yet done. I have had to modify the database table for this dialog a couple of times to take care of some error conditions. Specifically, it's easier for the database server to set default values in the creation of a new record than it is for the program to go through and initialize those controls that are tied to that table. When I finish up the practice sessions dialog, then I can finish up the coding for the initialize practice sessions dialog.



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, 30 August 2010

I did not go to the North Idaho Fair, attend the Dutch oven contest or go to the technical meeting of the North Idaho Linux Users Group over the weekend. I worked. Both days, all day.



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, 27 August 2010

I worked on the soccer program again last night. I added a new table to the database, which will hold practice scheduling information. I also started added the dialog to populate that table. I should be able to finish that up over the weekend, if the North Idaho Fair and the North Idaho Linux Users Group don't get in the way too much.

There is a Dutch oven contest at the North Idaho Fair tomorrow. It goes from about 10 in the morning until 3 in the afternoon. I did not enter the contest, but I will be talking to the participants. I'm always on the lookout for new recipes.



In order to test a TV tuner card I have, I installed Mythbuntu on an old computer that was hanging around here. Only problem is, the computer won't boot from the hard disk, so I could not re-boot into the newly installed operating system. I will have to look into that, but I suspect the computer would be better off in a junk pile at F1 For Help.



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, 26 August 2010

At work, it took me all day yesterday to write the code to sort the data and remove extraneous entries, but it works really well and I am very happy with it. I just hope they don't come up with another zinger like that one, though. The file that contains that code is now well over twice as large as it was a couple of weeks ago. I hope I will have some time to refactor the code, so it isn't as complex or as arcane as it is now.

This month I am celebrating my third year at this job. I am also celebrating my 26th year as a resident of the state of Idaho. I have no intention of changing either status, as I like both conditions.



I installed Mythbuntu 10.04 on my DVR computer last night. The install was a complete wipe out of the old 9.04 version, since I am not a big fan of upgrades. They usually cause more problems than they solve.

The installation went very smoothly, especially since I am familiar with the MythTV configuration. I have had a couple of problems, though. The sound was off when I finished the installation. I had to un-install and reinstall the sound driver to get it work. That is one problem I did not have with the older software.

I also had the same problem with 10.04 as I had with 9.04 when it came to playing DVDs and videos in the internal player. That player can't seem to keep up with the data stream. I will have to point MythTV at the VLC player instead of using the internal player. No big deal - I like VLC.



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, 25 August 2010

The testers at work came up with a good bug for me to work on, so I had another late work night last night. They want me to sort the data I send to the front-end, so it only gets the amount of data it has requested. I can do that and have fleshed out an approach which I will implement completely this morning. It isn't as hard to fix as some they've thrown my way, so I suppose I should be grateful.



I burned a Mythbuntu 10.04 CD last night and tested it on my DVR computer. It boots fine and it looks like it will be a nice upgrade for me. I will install it on the DVR tonight, if they don't spring any more surprises on me at work. While it is installing, I hope to get some more work done on the soccer program.



Silly sign of the day:


Free/Open Source Software

Tuesday, 24 August 2010

I have completely cleaned up all the bugs in my software at work. Until someone finds another bug, that is. There is always one more bug in any piece of software. I will be helping out others with their tasks as they need the help.



I have downloaded the latest version of Mythbuntu and I intend to do a fresh install on my DVR computer. to that end, I have also backed up all the videos I have on the box. There were 41 of them, and they take up about 200GB+. So it wasn't a fast, easy task to back them up.

I hope the new version of MythTV has support for Hulu and that the internal video viewer has better support for encrypted DVDs. There are a few other things I would like to see cleaned up, but for now, they are just on my local wish list.



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, 23 August 2010

Once again, I worked over the weekend. I fixed a fairly nasty bug in my code that was introduced by my misunderstanding of what the front-end people told me they wanted. Either that, or they changed their minds sometime in the last few weeks and neglected to tell me at that time. Nice of them to tell me now.



I went to the Coeur d'Alene Wooden Boat Show on Saturday. I took lots of pictures and I will post them here when I get a chance. There were three hydroplanes at the show, too - the Miss Bardahl, Miss Treadway and Miss Wahoo. They were there for a demo on the lake. I didn't stick around for the demo, as I had plenty to do at home.

I worked more on the soccer program. I finished up the Game Schedule dialog and the Available Positions dialog. I completed the layout of the Reset database dialog, but haven't finished up the actually coding behind the dialog. I have to figure out how to empty a database table so I can finish that dialog. I also started to lay out the Practice Schedule dialog, but I have decided that the database table need to be redesigned so this dialog will be more efficient. My work at this point will return no tangible results until I finish it.



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, 20 August 2010

At work, I have been fixing a few small bugs and have been testing searching the database using wildcard search parameters. I have found a few things that need fixing and have bugged them so I can officially fix them.

Since I went to the North Idaho Mineral Club meeting last night, I didn't do any work on the soccer program. That doesn't mean I'm not thinking about it, though. I keep a document on Google that is a To Do list for the program. When I think of something that needs doing, I put it in that document. When I finish something in the program, I highlight that object and strike through it. That way it's still there for documentation and I know I have completed it.



Silly sign of the day:


Free/Open Source Software

Thursday, 19 August 2010

I managed to duck those major changes at work I mentioned yesterday. Luckily, one of the architects said that doing things the way the front-end folks wanted would break the data model. So, instead of having the back-end code do all the work, they will just ask the back-end for data that is sorted in descending order and will sort it themselves into ascending order. That makes a whole lot of sense to me.

I have run out of bugs to fix in my code, so I am now working on some in other people's code. It's certainly keeping me busy.



I worked more on the soccer program last night. I am going through each of the dialogs I have created so far and am cleaning up and fixing things that don't work quite right. I should be finished with that by the weekend, and will move on to the next dialog, which is the games schedule dialog. The work on this seems to be going extremely well.



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, 18 August 2010

Have you ever played a game where when you approach the end of the game, someone tells you that you have interpreted one of the game rules wrong and you have to go back and do it over? That's exactly what happened to me at work yesterday.

I had just finished fixing the last documented bug when I got yet another bug. It said that I was getting the proper data when they requested it be in descending sort order, but not when ascending sort order is requested. How can that be hard? When nnn records in descending order is requested, I put 'ORDER BY xxx DESC LIMIT nnn' in the SQL statement. When ascending order is requested, I put 'ORDER BY xxx ASC LIMIT nnn' in the SQL statement. Easy, right? Nope.

What they really meant for ascending data was "get the nnn number of data records from the database in descending order. When you get the result set, sort that into ascending order." Which is perfectly understandable, but why did no one say that in the first place? Now I have major changes to make to support this.



Despite all the work at work, I also did some work on the soccer program. In order to finish up the team information dialog, I needed league information. As usual, that was stored in the INI file in the old program. I created a league information database table and converted the old league information dialog over to support the table. This dialog and the team information dialog are almost complete. There are still a few setup items to do, but pretty soon I will be working on the actual guts of the program.

My real question is this: if they used an INI file for so much, why did they have a database? My current inclination is to put everything in a database table.



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, 17 August 2010

At work, I spent the whole day yesterday fixing four bugs. Two of them were tough to fix and two were very easy. I have one more very difficult one to fix.

I finished the player information dialog for the soccer program last night. I moved on to the the team information dialog. The old version of the program stored this information in the INI file, so I created a database table to hold the information. I changed out all the normal controls with ones that connect to the database table. Several of these are combo boxes that allow you to select items from another database table. I will finish hooking up everything in the new dialog tonight. At any rate, the program is now capable of holding as many teams as the user wishes, instead of the limit of three that was imposed in the old program.

By the way, that limit of three teams was definitely artificial. If the INI file had been designed correctly, an unlimited number of teams could have been stored in it.



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, 16 August 2010

I spent a lot of the weekend working on my work project and some of it working on the soccer program. For the work project, I am down to two bugs to fix. I know how to fix them, but the logic in those areas is 'dense', to say the least. I may have to re-factor at least one method, so it will return a string list instead of populating a global string list. That will be fun. 8-(

For the soccer program, I am hooking up controls that use two database tables instead of just one. I am not having much luck with that. I think I will have to go on the Internet and find an example of that, because I must be doing something wrong.



I have installed Debian Linux on an old machine, and it works very well. There are a lot of things incorporated into Ubuntu that I miss in Debian, though. I tried to install Lazarus from DEB packages and was not successful. I will look into installing some other items, too, if I ever get a bit of time to do that.



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, 13 August 2010

For the soccer program, I have moved on to the player information dialog. It has been fairly easy to get the dialog into the new program. I copied the dialog code from the old program into the new program, then deleted all the old support code. I renamed all the controls to agree with my naming conventions, then proceeded to hook the controls up to the database. That is where I ran into a bit of trouble.

The player information dialog uses two database tables. One holds the actual player information and the other has player position and formation information. It's that support table that is the problem. Whoever designed that table did it as a horizontal table instead of a vertical. That makes it impossible to just hook up to a control and use the data. No wonder there was a lot of support code for this.

I intend to redesign the table so I can use one column of it to feed one control and another column to feed another. There will then be virtually no support code to write to get it all to work.



Delphi/Lazarus Programming Tips and Tricks

If you have an edit box where you only want to accept certain specific characters, you can easily implement that. For instance, suppose the edit box was for a phone number. You would only want numbers, dashes and possibly open and close parenthesis in the box. One other character would also be useful - backspace, so you do some editing. Here is how you do that:

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if not (Key in ['0'..'9','-','(',')',#8]) then
  begin
    Key := #0;
    Beep;
  end;
end;

The OnKeyPress event allows you to do what is required. It provides the keyboard key just pressed and allows you to modify that if necessary. The code looks for numbers, dashes, open and close parentheses or backspace. If the key pressed is not any of those, we change it to a #0 so it will not be used, then issue an audible beep to the user.



Silly sign of the day:


Free/Open Source Software

Thursday, 12 August 2010

It took a bit more time than I anticipated, but I have finished the coach information dialog in the soccer program. I made a list of things to do to it, then went through the list and marked off items as I finished them. The list included things like 'Only allow alphabetic characters in the State edit box, and make them upper case' and 'In the Done button click event, check to see if an edit is in progress. If one is, ask to leave'. As you can see, it's the little details that have to be taken care of that take up a lot of programming time.

I also added an About dialog to the program and will make up a to do list for that, too. Then I will move on to the player information dialog.



 

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, 11 August 2010

Since the soccer program will be used only by a coach, I created the coach information dialog for it as my next task. The original program stored information for a single coach only, and it was stored in an INI file. The new version of the program uses a database table called coach and very minimal programming is required to actually use it.

The coach information now includes a user name and a password, to allow the coach to log in to the program. It also includes table navigation buttons to allow the user to add, modify, remove and navigate through the various coaches. Since it only took me last night to complete, I think that the program may be easier to write than I originally thought.

I do have several things to do to this dialog. I will put all the editing and navigation in a panel, so they are separated from the Done and Help buttons. When the Done button is clicked, I will look to see if an edit is in progress. If it is, I will ask if the user really wants to exit. Finally, I will encrypt the password, so when it is stored in the database table, it will still be unreadable.

The next dialog to be done is the player information dialog. That one should be as easy as the coach dialog.



 

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, 10 August 2010

I can't count the number of times I have started a rewrite of the Windows soccer program, but I have started again. I have the main window and the user logon/logoff dialog finished and have verified that the database connection works correctly.

Next up is the dialog that allows a user to enter player names, addresses and other information. A lot of this work will go quickly, as I can use the dialog layouts from the old program and just rewrite the underlying code.



 

Open Source Tip:

If you are using OpenOffice.org Word and you need a paragraph of text whose contents does not matter to you, type 'dt', then press the F3 key on your keyboard. You will get an instant paragraph of words.



 

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, 9 August 2010

The communication fix I did at work may cause another problem. So I spent part of the weekend fixing the fix. I have another problem in the code that needs to be fixed today. The bugs are keeping me busy, so I'm not certain how much I will be able to do at home.



 

We had a celebration dinner on Friday at the Coeur d'Alene Resort Golf Course, to celebrate the completion of the software I am working to get the bugs out of. The dinner was held in the semi-permanent big blue tent that is fairly close to the floating golf green. While we were eating, a helicopter landed next to the tent. It turns out that Duane Hagadone (the owner of North Idaho - practically) was giving helicopter rides to some of his associates and the floating golf green is on the tour. Interesting, but very noisy.



 

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, 6 August 2010

I had another long work day yesterday. I fixed a nasty bug in our product - if you ever lose the database connection, you could only get it back by re-starting the program. That is no longer true.

I hope they don't give me another one like that. I knew nothing of how the communication worked, and had to learn about it in order to fix it. Now I know a little about it, and if the past is any clue, I will be given more to fix in that area. I guess I can't complain - I still love this job.



 

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, 5 August 2010

At work, we have a real code freeze Sunday night. That means everything new must be wrapped up and working by then. I don't have anything new that needs to be added, so I will be working on fixing any bugs that pop up.

The new work was demonstrated yesterday for the sales and support staff. They were universal in their acclaim for the new features. Most of the questions consisted of "When can we roll this out?" instead of asking about missing capabilities. That's a good thing - we tried to include as many capabilities as possible in these new features, so people would not ask for more. Apparently, we succeeded.



 

I ran out of Snowqualmie Sauce yesterday. That's the hot sauce that got me started on the make you own hot sauce jag. The Snowqualmie Sauce is produced by a farmer who lives about a half mile down the road from where we have our 4th of July teardrop gathering. He grows his own chili peppers and garlic, and the sauce consists of those two ingredients and a bit of vinegar. It is truly delicious sauce.

So I will be making some more of my green sauce tonight. If I can find a source of red chili peppers, I may try to make his sauce, too. In the meantime, I will use Tapatío.



 

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, 4 August 2010

I had a very long work day yesterday. It started at 7:00am and finished up at 8:30pm. Needless to say I did not have much time to do anything at home, including items for this web log.

I did get a chance to fix four more bugs in the backend code. I suspect the frontend folks will still find ways to send me requests that I can't convert into valid SQL statements, but it will be a lot tougher for them to do that. Now if they send a request for a field that the code knows nothing about, it ignores the request. That's the only thing it can do, as I did not program mind reading capabilities into the code. Of course, I also write an error message to the manager log indicating that the field was ignored.



 

The fan on this workstation is still acting up. I guess it moves from the 'I will get to it when I get to it' category to the 'I will look at it on Saturday' category. In the meantime, I will have to set up my quad-processor machine as a backup for the functions that this one does.



 

Silly sign of the day:


 

Free/Open Source Software

 

Tuesday, 3 August 2010

A fan is going out on this workstation. I could handle a constant grinding sound, but this one goes "grind..grind....grind...grind.....". It is very annoying. I will have to move the box out from where it is to determine which fan is actually causing the problem (there are three of them). Yet another emergency to intrude into my list of things to do.



 

I have been thinking about the Windows Delphi program I am trying to convert over to a different database. I am having some trouble trying to accomplish the same actions in the program as were done in the original. Since the program wasn't very well written in the first place, I have come to the conclusion that maybe I should just start from scratch. The problem will be to find the time to do that.



 

Here's another picture from June of 1973 in Santa Maria, CA. I am prepping the plane before starting the engine. You can see the transmitter on the bottom edge of the picture. These pix were taken with a Canon AE-1 SLR, which I still have.



 

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, 2 August 2010

I dug up another tray of 100 slides and converted them to digital format with my handy dandy slide converter. The slides were all from June of 1973. Here's one of me in Santa Maria, CA trying out another R/C plane (elevator and aileron control only - no engine or rudder control. What a blast!). I was a sergeant in the Air Force at the time. By the way, I still have the plane.

This particular slide had too much color (it didn't help that it was taken in bright sunlight). The lab apparently pushed it right to the edge, and it looked terrible as a photo. I ran it through the GIMP and adjusted the hue and saturation. It looks a whole lot better, as you can see.



 

I did some work stuff from home this weekend. I hope the frontend folks have finished making changes, as I am tired of making changes to the backend to compensate for their modifications. That should not happen - we are using a cast-in-concrete transport class so they can make changes to their code without affecting us, and vice-versa. The transport class works, but its contents are what they are playing with, and what we are using. So the advantage to using that class is none.



 

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