Thursday, April 30, 2009

I stayed with Perl today and developed a bit more of my little data-table access program. I call it 'dbase' in tribute to the old dBase II package that ran in CP/M and later MS-DOS.

I thought a bit about web sites, and realized that there are only a few pieces and few technology sets needed. The pieces are: web server, static content (includes text, graphics, and photos), dynamic content, and database. I guess one could add things like scripts and active things for the client side, but those are the main pieces. For technology, the choices are pretty limited (but perhaps not simple): Apache or IIS for web server; HTML, GIF, PNG, and JPEG files for static content; ASP, JSP, or PHP for dynamic content scripts; and MySQL, Microsoft SQL Server, or other database. Client-side active things can be Javascript, Flash, or Silverlight.

While the number of pieces is small, generating content is not trivial. I played with the Quanta and Kompozer HTML editors today. Quanta is very much like Allaire/Macromedia/Adobe Homesite, and I was comfortable with it. But it has a few bugs (such as the "add an image tag" dialog collects the information but then adds no tag). Kompozer was worse -- it crashed several times. I can make it crash by running it and displaying the "File / Recent Files" list. It also crashes for other reasons.

I used GIMP to create some graphics for my phony web site. GIMP worked fairly well, and I need to learn more about its editing capabilities. I used the images it created and I have the beginnings of a web page. Now to learn how to have two sections under the navigation bar. I want one with text and another one with an image. I think this calls for frames.

Lunch was spent with former co-workers and a recruiter. It was a good lunch with some interesting discussions. I'm going to revise my resume, to indicate that I want to move out of C++ and C# development and into web development.

Wednesday, April 29, 2009

For want of a nail

I've been making good progress with PHP these past few days. I did some work with cookies and then moved on to session variables, only to find... that my copy of PHP doesn't support session variables. It's an option that must be selected when you build PHP.

I'm using PHP as installed by the SuSE 9.2 Linux distro. That version, out of the box, does not support session variables. Apparently, an update changed PHP and enabled the session variables. But SuSE stopped supporting version 9.2 a while ago, and the updates are not available.

I *could* re-build PHP myself. That's work that takes me away from my goal (learning to build applications in PHP).

Another option is to upgrade the SuSE Linux distro on //grendel, the computer hosting Apache and PHP. When SuSE/Novell don't offer online updates for version 9.2, I have the CDs for later versions (10.0, 10.1, and 11.0). But that update is not so easy; it requires more memory than //grendel currently has. (The PC has 128MB RAM, and SuSE 10.0 wants 256MB.)

Adding memory is possible: Memory is available and //grendel has two open RAM slots. All I have to do is buy the memory stick.

But I promised myself that I would refrain from spending money on my home PCs until I can fund the expenditure, that is, until I have some income. Not just as a way of conserving resources, but as an incentive to secure income. I'm not sure that I want to break that promise.

So I put PHP aside today and went back to Perl and my 'dbase' utility, which performs simple data table operations. One version of 'dbase' uses plain text files; another version will use Perl's DBI module to talk to MySQL databases. I have completed about a third of the text-only version, with simple script processing and the ability to append a complete record to a table. The 'update' and 'select' functions are next.

The dbase program will give me experience with Perl's DBI module, MySQL, and simple SQL. It is also a useful program; I will track program size with it. I want to measure the size of programs that I write, and see how they grow over their life. The dbase program will be a convenient way to store lines of code counts.

Monday, April 27, 2009

Am I an architect?

I had lunch with friends today. I mentioned was my enjoyment of system administration tasks, and my difficulties in listing them on my resume. For example, I managed a small virtualization environment (ten hosts and twenty virtual machines). As virtual machines grew I moved them from one host to another, keeping certain virtual machines on separate hosts for performance or recovery reasons. Virtual machines grew due to growth in the source code size (they built the system and updated their copy of source code daily), compiler updates, Microsoft security updates, and new general-release software like the .NET 3.5 framework.

Moving the virtual machines was a lot like playing 'Tetris' - I could see the open slots, and I could tell when virtual machines were outgrowing their hosts. (I had constructed early-warning systems.) But listing "played Tetris with virtual machines" is not really feasible on a resume, nor is explaining the details.

My friend Larry suggested I use the phrase "managed virtualization environment" which makes sense.

He also suggested that I list the phrase "architect for virtualization environment", since I was the architect for that environment. It was a non-trivial environment and I did pull it together.

It is clear that I had three different roles: developer, system administrator, and architect. Here's what I did for each:

- Developer: I wrote and tested code. Some of this was on the large (2,000,000 LOC) Worldship system but most of it was utilities in the Unix style: small and connectable, useful in shell scripts or DOS batch files.

- System administrator: I installed Windows and Linux, monitored and estimated disk space on servers, managed VMware, installed network equipment, configured Windows and Linux for network access, audited server/directory access, granted and revoked rights for PVCS Version Manager access

- Architect: I designed and implemented the VMware environment. I designed and implemented the job control system which let me run jobs overnight and coordinate dependent jobs across multiple PCs.

The notion of architect is one that I had not thought of. But it makes sense.

It's good to have friends.

Friday, April 24, 2009

Reviewing experience

I just spoke (well, e-mailed) with a recruiter who asked for more details about my experience with .NET. She needed information to present to a client. I had to provide the details to her. To do that, I had to have the details, which are not on my resume. Nor were they written down anywhere.

The exercise forced me to think, to remember the projects that I had worked on. I wrote a short list, and my immediate thought was "Oh this is not enough". My second thought was "Didn't I work on more than this?". Well, I had worked on more, but I did not have the list immediately available.

Writing the list was a good start. As I wrote the list, I remembered additional items and details. Then I typed the list into an e-mail. This also helped me remember.

In the end, I came up with a good (as in accurate) list. I don't know that it will be enough to impress the client, but it has given me a good list of my accomplishments (in .NET -- I should do the same exercise for Perl and system administration tasks).

Wednesday, April 22, 2009

Apache, PHP, and MySQL

I have the trio of Apache, PHP, and MySQL working. My problem was my SQL query. (Amazing what the right syntax will do!) Once corrected the web page came up as expected.

I also set up PHP to run in stand-alone mode (that is, without a web server) on my development computer. An interesting arrangement that gave me insight into the design of PHP and the interface from Apache. PHP is just another scripting language, like Perl or Ruby, and uses the same (or a very similar) object model as Perl and Ruby. That view gives me a better understanding of the workings of PHP, which builds my confidence.

Using PHP in stand-alone mode allows for easier debugging of scripts, too. If one is careful in designing the PHP scripts and puts the major functions in common modules, one should be able to test a majority of an application before installing it on a web server. Testing web applications in the browser is possible, but more work.

In other areas, I found a major grammatical goof in my latest resume. I fixed it immediately, but I had sent that revision to a few prospects. If they notice the goof they will probably think poorly of me. Well, so be it. I'm not perfect; I try to recover with grace.

Tuesday, April 21, 2009

PHP and MySQL (part 1)

I have PHP and MySQL talking. It took a bit more than I expected; most of the work was in the installation and set-up of files for PHP. I had to install the DB and PEAR packages and then modify the PHP.ini file to specify an include path. I also modified some web pages to use PHP commands to access a database and created a MySQL database with some tables and some test data. Not quite as easy as MS-Access, but not too hard either.

I was assisted by the detailed error messages from PHP. (And also from MySQL, for earlier configuration problems.) The designers of both packages followed the rule "complain early and noisily", and it helped me solve the problems.

Most Windows programs, in my experience, do not follow this rule. They write errors to logs in obscure places and the messages are detailed but not useful. A typical log entry might be "call to SqlProcessor(...) returned code 0x800503ad" or some such jargon. I'm guessing that the message is useful to a Microsoft developer, one who is familiar with the internals of the components, but it is quite opaque to me. I have no idea what 0x800503ad means, and Google searches usually reveal a multitude of causes.

My experiments with PHP and MySQL are not completely successful. The example I used from the book Programming PHP fails with the message "undefined fonction 'fetchinto' ". I'm not sure if this is a PHP version problem (I'm using version 4, the older version) or something else. But all is not lost, as I can look inside the DB.php module and see the code. That's a task for tomorrow.

In other work today, I turned on my resume on monster.com. I have been somewhat reluctant to do this; the last time I made a resume public I was flooded with lots of requests that were only remotely connected to my objective. Most recruiters saw "C++" on my resume and immediately offered a position with C++. They made the assumption that since I had C++ experience I desired another position with C++. This is not the case, as I want to move to web technologies (PHP, JSP, and possibly ASP.NET) and other new technologies (Ruby, Ruby on Rails). Well, my resume is public. Let's see what happens.

I also spent some time out in the sun, reading in the local park. The reading was all non-PHP and non-MySQL. I read some chapters in Language by Bloomfield, Sagan's The Dragons of Eden, and a short story by Lester del Rey. I think the sun and the reading were both theraputic.

One step at a time

I continue to work with Linux, Apache, MySQL, and PHP. Yesterday Apache and PHP played nicely. I didn't make any change to the configuration, things started working "by themselves". The true reason may be that I had shut down Linux over the week-end and started everything up again yesterday morning. Why that would cause the change and not the shut-down and re-start of the Apache server (which I did on Friday) is beyond me.

Now Apache recognizes PHP. I've tested it with a simple PHP page. (Very simple. It is HTML with a single PHP ECHO command in it.)

My next goal is to query a database and retrieve data from MySQL while inside of PHP. To do that I will need a database, and for that I need MySQL running. I set up MySQL yesterday. The installation went smoothly, with a few problems that were easily solved. (Mostly file owner/group settings.)

Today's plans are: add a user to MySQL for the PHP processor, create a database with some data (probably users, user profiles, and favorite music), and change the static content HTML pages to use PHP and retreive data from the database. If I am really ambitious I may try storing photographs in the database.