Documents

Archives

Search

BLOGical Thoughts Archive

September 2010

Thursday, 30 September 2010

I can't seem to get the soccer program to work on any machine except the machine I developed it on. I have tried everything I can think of to fix this, but it just isn't working. I really needed to demo it today, but it seems that isn't going to happen.

When I get some time, I will have to google the components I am using to see if there is anything special I have to do to get them to work on a target machine. I know I need the SqLite DLL, but other than that, I'm not sure if anything else is required. This is starting to be more frustrating than installing the Borland BDE.



Silly sign of the day:


Free/Open Source Software

Wednesday, 29 September 2010

I copied the soccer program I've been working on over to my memory stick, so I could have it handy when I talked to Ken, the guy who had the idea for the program in the first place. I tried to run it at work to ensure it would actually run. It did not run - it complained about the fact that it could not connect to the database.

When I run across a problem like this, I usually let the problem stew in my brain for a while before I decide what to do about it. By the time I got home last night, I had a definite cause and a solution for this problem. The component I am using requires a path to the database file. When I filled that in, I used an absolute path to the file, and that path did not exist on my work machine. Hence, the 'could not connect' message.

I fixed this problem for good in the program's OnShow event. There I pick up the actual location of where the program is running, add the name of the database to it, then use that to connect to the database. I also go through and connect each of the 12 table components, so there is no excuse for any dialog to have a table connection issue. This should take care of the database problem and I will test it again today.

I also attempted to skin the program. I was less than satisfied with the results of this, so I removed it. One of the problems with the skinning is component location. The skinning component assumes that all components are anchored relative to the upper left corner of the dialog. Most of my dialog buttons are actually anchored to the lower right corner of the dialog, so they are re-placed improperly by the skinning component. I could fix this, but I just don't know if it is worth the effort. I will talk to Ken about that, too. We are having lunch tomorrow in Liberty Lake, and I will show him this stuff then.



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, 28 September 2010

I did more work on the soccer program again last night. Here is the dialog I've been working on:

I have hooked up the three buttons in the center, which are used to move exercises back and forth between the two list boxes or reset to the start. I hooked up the Practice Time edit box so it accurately displays the total exercise time of the selected exercises. Finally, I implemented drag and drop for the two list boxes, so you can drag an exercise from one box to another, or change the exercise order in one list box by dragging an exercise to a different position.

Next, I need to hook up this dialog to actually store the selected exercises into the exhist table. I may do that tonight. It is not a straightforward action, though. First, records in the exhist table for this team and this practice date must be removed. The new selections are then stored in the table.

My final work on this table is to ensure that all the dialogs are populated correctly when we change either the team or the practice date.



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

I spent last week in San Francisco, attending the JavaOne Conference. Since Oracle acquired Sun Microsystems, they decided they would hold both JavaOne and Oracle Develop at the same time in the same place. Please believe me when I say bigger is not better.

The JavaOne conferences I have attended have been held at the Moscone Convention Center. That's where I went to get my registration materials. At that time, I discovered that the entire JavaOne Conference had been exiled to several big hotels 4 or 5 blocks away from Moscone Center. I also discovered they were no longer giving us breakfast, and we were not welcome at any Oracle Develop events, including the Keynote addresses. We were invited to attend those via a live stream at the hotels. Apparently Java attendees were considered persona non grata at Oracle.

The whole conference was as bad as it started. Several of the talks were fine, but the logistics for the conference stunk. I was receiving up to a dozen emails informing me of session changes that were shown right on the email I got for the sessions first thing in the morning. James Gosling seems to have been right about Oracle's attitude towards Java - they act like it's theirs instead of an open source project. I don't plan on attending another JavaOne.



I spent long hours this weekend partially hooking up one of the main dialogs for the soccer program. The schedule practice sessions dialog allows the coach to select exercises and provides a list of those that can be used when the practice session is held. It makes use of four database tables, so it is not exactly straightforward to hook up.

After I got the various pieces working, I found that text for each exercise was being displayed as just text, instead of with highlighting and other text decorations. I fixed that by using a Rich Edit component instead of a Memo component, then I changed the text files to RTF files. I spent half of Sunday modifying the text files into RTF files. They now display very nicely. There is still more to do on the dialog, but my brain isn't up to it right now so I am taking Sunday evening off.



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

Last night I worked until 6pm, then went to the North Idaho Mineral Club meeting. That didn't leave much time to work on home projects or do any chores.



Delphi Programming Tip

{********************************************************************
Function    : Tabs2Spaces
Description : convert tabs to spaces
Inputs      : sLine: The string to be converted
         iTabSize: The size of a tab in spaces
Outputs     : The converted string
********************************************************************}
function Tabs2Spaces(Const sLine: string; iTabSize: integer): string;
var
  i: integer;
begin
  if Pos(#9, sLine) <> 0 then
  begin
    Result := '';
    for i := 1 to Length(sLine) do
      if sLine[i] = #9 then
        Result := Result + StringofChar(' ', iTabSize - ((i-1) mod iTabSize))
      else
        Result := Result + sLine[i];
  end else
    Result := sLine;
end;



Next week I will be very busy, so I will have no time to make any posts here.



Silly sign of the day:


Free/Open Source Software

Thursday, 16 September 2010

I have completed the interface code for the project at work. I can't test it without the GUI piece, though, so I will be doing that today. It looks like this may be another breakout part of our software package.



 

I have gone through all the dialogs of the soccer program and have verified that the date fields are all working correctly, now that they have been changed to strings in the database. I almost made another change to the database to take care of a date sorting problem I saw last night, but I decided to store the dates with leading zeros on all the date pieces, which takes care of the sorting problem.

I also hooked up the initialize schedule dialog so when the schedule template is complete, it will now generate records in the practice database table for each day during the season that will be a practice day. There are a couple of small things to do in that dialog and then I can move along to yet another 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, 15 September 2010

This week at work is FedEx week. It is the week when the new version of our software is mailed out to our customers. For the development team, that means we don't work on the product at all this week. Instead, we are encouraged to work on ideas of our own. The results will be shown to everyone on Friday and some will be given official sanction.

I was working on an idea for the report program when I was approached by one of the front end people and asked to help her with her project. Since it is much more high profile and stands a better chance of approval than my own, I agreed. So now I have to learn even more about the back end so I can communicate with the piece she is working on. I guess life is like that: just one big learning experience.



 

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, 14 September 2010

I worked on the soccer program last night. I changed all the references to date in the database to a string. I then had to go through each of the modules I have created so far and make changes to account for the database changes. I think I'm back to where I was before I started the change, but I'm not sure. There is still a lot to do on the program.



 

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

My talk on Saturday about how to install and configure Drupal went fairly well. I'm afraid there was too much in the talk about file permissions and ownership, but that was a consequence of doing an install on a local web server.

The talk and its results prompted me to look into doing the actual install to replace the North Idaho Mineral Club web site. I installed it, set up a database and ran the install script. It was then I discovered that the web host, 1 And 1, had everything so locked down that I was not really allowed to install a content management system. I will talk to the powers that be and try to persuade them to change web hosts to one that doesn't act like the KGB.



 

I also got more chores done over the weekend. I had to replace a head lamp in my Stealth, and that was a real voyage of discovery. That kind of thing is easy to do on my pickup, but the Stealth replacement meant practically taking apart the whole headlight assembly. Some fun.

I also finished replacing a running light on my teardrop trailer with an LED lamp. I found a much easier way to do that than with the first light I replaced. I have 2 more to replace, then I will look at replacing the tail lights.

I worked on the soccer program, but I discovered several things about it. First, I think I will have to save dates as strings in the database. The date components I have do not play well with the 21st century, for some reason. Second, I will have to find a way to iterate through a range of dates, so I can populate the practice sessions table. That may very well be a big challenge for me, as the version of Delphi I am using doesn't have functions 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, 10 September 2010

I downloaded episodes of Crusader Rabbit versus The Pirates last night, and created a DVD of those episodes. Crusader Rabbit was the first animated cartoon produced for television. The first story was produced in 1949 and the last was done in the late 50's. I used to watch an episode of it every day after I got home from school. This was not a great deal of TV exposure for me, as each episode is 4 minutes long.

The animation is primitive by any standards. The animators had a very limited budget, so they used a limited animation approach. Still, the stories are entertaining - I suspect Jay Ward had some input into the story lines. Jay Ward went on to produce Rocky and Bullwinkle, which shows a lot of the same humor, only more outrageous.



 

I have a lot to do today. I will be helping a co-worker create a DVR and also need to finish up my preparation for the talk I will give tomorrow on installing and configuring Drupal. And there is some regular work in there someplace, too.



 

Silly sign of the day:


 

Free/Open Source Software

 

Thursday, 9 September 2010

I started getting ready for my Saturday talk about Drupal. I installed Apache, MySql and PHP on my 64-bit workstation last night. The tricky bit is getting them to work together. PHP and MySql work just fine as standalone applications, but you have to do a bit extra to get them to talk to Apache. With a little web help, I managed to get them working with one another.

I then installed Drupal. It has been quite a while, so I had some false starts. The important thing is to read the INSTALL.txt file before proceeding. Drupal is not a straightforward easy install like WordPress, but it gives you a lot more power over your web site configuration than WordPress.

I can see I will have to write up some notes on the install, as I will never remember all the stuff that must be done. I will continue looking at this tonight, putting the soccer program on hold for a bit.



 

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, 8 September 2010

The monthly general session of the North Idaho Linux Users Group is this Saturday. I will be giving a talk on how to install and configure Drupal, one of the many Content Management Systems (CMS) for creating and maintaining web sites.

My Rimrock Software web site already runs with Drupal, and I intend to move the North Idaho Mineral Club web site over to using Drupal. It is currently a static web site, so it could benefit a lot from that change.

This means I will have to prepare for the talk, as I haven't done anything with Drupal in a while. I was thinking of doing the Mineral Club changeover as the demo at the NILUG meeting, but I may just install it locally on my computer instead. That would be less disastrous if I made a big mistake. I will have to decide soon, though.



 

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, 7 September 2010

I hope everyone had a good Labor Day weekend. I know I did.

I finished many of the items on my chores list, but there is more to do. Instead of letting them pile up for the weekend, I will have to do at least one each weeknight.



 

I spent a lot of time on the soccer program. Some of the harder tasks remain to be done, though. I finished the team statistics dialog, but I am still working on the initialize schedule dialog. I did fix the reset database dialog so it now actually removes everything from the database and repopulates the tables that need that.

I looked at the code for the old team statistics dialog and it was long and involved looping through every record in the team statistics table. I did the same thing with a single SQL statement and extracted the results to put them in the display dialogs. There were 21 values to display, so it wasn't the shortest SQL statement I have ever written, but considering what I have done at work, it is not the longest by far. Just so you can see the power of a database, here is the statement (note that the team name is just an example):

SELECT COUNT(*) AS "gamesplayed", SUM(tsOurgoals) AS "ourtotgoals", 
  SUM(tsOurshots) AS "ourtotshots", SUM(tsOurassists) AS "ourtotassists",
  SUM(tsOursaves) AS "ourtotsaves", SUM(tsOurcornerkicks) AS "ourtotcorner",
  AVG(tsOurgoals) AS "ouravggoals", AVG(tsOurshots) AS "ouravgshots",
  AVG(tsOurassists) AS "ouravgassists", AVG(tsOursaves) AS "ouravgsaves",
  AVG(tsOurcornerkicks) AS "ouravgcorner", SUM(tsTheirgoals) AS "theirtotgoals",
  SUM(tsTheirshots) AS "theirtotshots", SUM(tsTheirassists) AS "theirtotassists",
  SUM(tsTheirsaves) AS "theirtotsaves", SUM(tsTheircornerkicks) AS "theirtotcorner",
  AVG(tsTheirgoals) AS "theiravggoals", AVG(tsTheirshots) AS "theiravgshots",
  AVG(tsTheirassists) AS "theiravgassists", AVG(tsTheirsaves) AS "theiravgsaves",
  AVG(tsTheircornerkicks) AS "theiravgcorner" FROM teamstat WHERE tsTeam = 'Raptors';



 

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, 3 September 2010

I have gotten back to work on the soccer program. I am doing the practice session dialog, but it is tough. The database table it uses has cryptic fields in it, like key1, key2, key3, etc. I think I will redesign that table, too. I will also have to talk to the other participant in this project, they guy who came up with the soccer coach project in the first place. I need to update him on the status of the new program.



 

We have a three day weekend and I intend to take advantage of it. All the chores that haven't been done since the big push at work will be on my agenda. I hope to make a big dent in that list, but we shall see. At the next North Idaho Linux Users Group meeting, I will be giving a talk on installing and configuring Drupal, so I also need to start preparing for that. It looks like a busy weekend for me.



 

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

I only spent 10 hours at work yesterday, but when I got home, I worked another hour remotely. All this bug fixing was supposed to have been done last week, but we are over our schedule by a couple of weeks. I have one more bug to fix and then I can take a bit of a rest.



 

I have been using gPodder to gather up podcasts during the week. I copy the files to a flash drive and take them to work. The only problem with this is that the way that gPodder collects podcasts ends up with you having a bunch of directories with md5sums as directory names and when the files are downloaded, they also have md5sums as names. I would like to know what the name of the file really is.

I have come up with a simple solution for this. I add an empty file to each directory. The file is named 'podcastname.txt', where podcastname changes for each podcast. I can then instantly identify the podcast and rename the MP3 file before I move it to the flash drive.



 

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, 1 September 2010

I had a 13 1/2 hour work day yesterday, so when I got home, I went to bed. Nothing to report on home projects, then.

We finished up the debugging of all the code we created on Saturday, Sunday and Monday. I then spent the rest of the day fixing bugs we had accidentally introduced into the rest of the code by incorporating the new piece.

I thought I had one final bug to fix this morning. Every time I sleep with a programming problem, though, I either wake up with a solution or I figure out there are more bugs. In this case, it was both. That incredibly complex piece of code we spent so long on isn't going to work in two very specific cases. Of course, since my unconscious mind came up with the new problems, it also supplied a possible solution. I will investigate that this morning, too.



 

Silly sign of the day:


 

Free/Open Source Software