Friday, February 27, 2009

Learning Ruby

After a short distraction with the "new" Gateway PC, I am settling down and doing some serious work with Ruby. Or I should say "serious learning".

I'm building an emulator for the Heathkit H-89 computer, a relic from the pre-PC era. The H-89 used a Z-80 processor and had, at most, 64K of RAM. It also had serial ports, floppy disks, and a few other goodies. By today's standards, it is completely unusable - cell phones have more computing power. Yet for my purposes, the H-89 is a good target: it is simple enough to shoot for, it is complex enough to give me a challenge, and I am familiar with it. (The H-89 was my first real computer.)

My goal is not to build an H-89 emulator but to learn Ruby. The H-89 adds a bit of fun, which is a good thing.

I've set up a rather simple development environment. A few directories, the Ruby interpreter, and Subversion. I have no IDE, no debugger (although there is a Ruby debugger and I will get to it later), and no elaborate requirements documents. I *do* have scripts to run tests.

My configuration allows me to work on a number of things, all at the same time. I have picked a few items from the "smorgasbord" of technologies that I want to learn. With my H-89 project, I can learn:

 - Ruby (the language and its library) and eventually the Ruby debugger

 - Subversion

 - Test-driven development

 - A little bit of bash scripting

 - Object-oriented programming (easy, since I am comfortable with C++, Java, and C#)

 - Refactoring (something I tend to enjoy with other languages)

I am refactoring some code today. I had built a number of modules, with some duplication of code. (Yes, the evil "copy-and-paste" type of re-use.) I an refactoring the code to eliminate the redundant code, and placing the code into classes (it currently lives in global functions). I have identified a number of classes, and as I build each one I start with the test cases for it. My initial analysis was incomplete, though; as I build some classes I identify the need for more classes. I'm OK with finding better designs as I go along -- I don't expect to get the design perfect by simply thinking hard.

Thursday, February 26, 2009

Distraction

My previous post listed the technologies of my interest. After downloading files and configuring environments, I could work with any of them.

And for the past two days, I have been working on... none of them!

Instead, I have been working on a new PC. I should say a new old PC, since the PC is used and a hand-me-down. My goal is to install Linux on this PC. That goal is more elusive than one might think. While the PC is fairly standard (a Gateway E3200 from 1999 with a Pentium II processor, 128 MB RAM, 8 GB disk, CD-ROM, VGA, floppy disk, two serial ports, one parallel port, and a built-in NIC), it won't boot a CD-ROM. The built-in NIC from 3Com has something called "TriROM" which lets the PC boot from the network. Apparently this was a spiffy new feature back then.

The 3Com TriROM injects itself into the power-up routine, and allows for booting from the network or the local hard drive, but notfrom a CD-ROM.

Sometimes I learn good things by following my nose. This is one of those cases.

This challenge has let me learn about boot manager programs and open-source projects. I found the "Smart Boot Manager" program, which lets you insert a floppy and boot anything. (Oddly, it fails with error code "AA".) I downloaded the source code for SBM and poked around. This is my first foray into the open source world. I may try builind the project later, after I configure my hardware a bit more. (The Gateway E3200 has no monitor or keyboard, and I have no way to share my current equipment.)

So I don't think distractions are always bad. They can lead us to new knowledge.

Monday, February 23, 2009

Smorgasbord

At my previous job, I used a number of technologies: C++, C#, and Perl. There were other things such as PVCS, MS Office (Word, Excel, Powerpoint, Sharepoint), and a little bit of ActiveDirectory and NTFS rights.

When I took this leap, part of my motivation was to move to other technologies. I felt that open source tech had a bright future and I wanted to be prepared to use it. (And I still feel that way.)

At home, I've been working with a number of technologies, learning how they work. They include:

 - Ruby

 - Ruby on Rails

 - MySQL

 - Java

 - Eclipse

 - Apache

I have been bouncing from one to another. I have not had the time (nor the inclination) to sit down with one technology and slog through it, day after day. (I've also used part of my time for networking and job searches.) Bouncing from one technology to another is a new concept for me -- the job had very specific goals and deadlines, so focus was important.

As I look back, I'm thinking that focus was not that important in the past few weeks. Instead, I needed to verify that I was capable of exploring these different technologies. That verification meant running small experiments and sometimes downloading things.

I set out with a bunch of ideas for new tech. I think I have demonstrated to myself that I have the tools to learn them. While there is more tech (iPod development, Twitter) that could be fun, I think I have a good set to work with. I think I can start to focus on some specific tech. (Not that I want to slog.)

Thursday, February 19, 2009

While contemplating my future, I keep up with networking activities and searches for local opportunities.

A placement/head-hunter/recruiter provided some possible situation for me. One of the companies has a questionnaire for applicants. It is an interesting set of questions, with a good mix of essays and technical questions. The list includes questions like:

"How did you learn programming and why did you stick with it?"

"Describe one of your projects that was enjoyable."

"Make improvements to the following code:", with a simple but improvement-rich set of code.

This was not a simple, five-minute test. I had to think about the essay questions, and then I wrote several draft answers before committing to a final response. For the coding exercises, I dusted off the C and C++ compilers and set up some development environments. The hiring company wanted me to generate some test cases, to demonstrate familiarity with test-driven development. For me, that was simple, since I used test-driven development techniques on projects back at UPS. (And I like test-driven development, because I can work faster and with greater confidence.)

I've also had lunch meetings with friends and former co-workers.  In friend is using Google Jobs, his woodworking hobby, and his photography hobby to supplement his income.

And when I can, I've been reading Breaking Windows, an expose on Microsoft and their ability to transition to Internet technologies. It's fairly fast reading, and it fills in the gaps of my schedule nicely.

Thursday, February 12, 2009

Contemplation

I had lunch with Tom, a former co-worker today. It was a good lunch with discussions about my thoughts on starting this venture and the culture of the company. We had a little bit of "things are not the way they used to be" in the conversation, but most of our talk was looking to the future.

One question that I have been contemplating is: What do I want to do?

My usual tongue-in-cheek answer is: "Sit on the beach, watch the palm trees sway in the breeze, and get paid a fabulous amount of money for it".

Going beyond the humorous answer, the question is a good one, and deserves an answer.

What do I want to do? Or, what role do I see myself playing? Do I want to work at a large company? A small one? As an employee? As a contractor?

After my tenure as a full-time employee, the idea of being a contractor has its appeal. I'm sure that there are good and bad things about it, but right now, that grass seems much greener.

I know that I want to work with open source tools. I know that I am interested in source code metrics, analytics, and visualization. Finding specific opportunities in those areas is hard: the typical search sites, when they have hits for those terms, use them differently.

I am not going to answer these questions immediately. I need to think about them and discuss them with others. (Which is what I have started to do.) As I identify ideas I note them. I have taken to carrying a notepad (the paper variety) with me, for just such a purpose. A bit twentieth-century perhaps, but still effective.

Wednesday, February 11, 2009

Scoping RGH

I spent a few days and visited the parental units, which also gave me the opportunity to scope the RGH area. RGH itself is a smallish city (smaller than BAL) and the tech companies are not in RGH but in the nearby Research Triangle Park (RTP). It is a very nice area, but requires driving. RGH and RTP have no public transit to speak of (RGH has a small bus system so there is *something*) and the areas surrounding RGH are all suburbs -- cars required.

I'm not sure that I would be happy in the area. I really enjoy the non-drive commute to the office. Good to know.

Thursday, February 5, 2009

Subversion success

I have Subversion working and tracking changes I am making. It was easier that I expected; I guess I am used to the big systems like PVCS and SourceSafe. Or maybe my experience with those systems made this one easier to learn.

I don't know that I have the directories quite right. I have to specify the 'nocomment' directory in my svn commands. (I have to say 'svn status nocomment' and I want to say 'svn status'.) Maybe this is a result of my initial import. Fortunately, this repository is a complete throw-away and I can remove the entire repository and set if up again.

I met with a local recruiter this afternoon, one recommended by my friend Larry from UPS. She had a number of good ideas and quite a few good comments about my resume. I can make several changes that will organize information and present it in a better format.

For my 'nocomment' project, written in Ruby, I got some sample C and C++ code from SourceForge and ran it through my program. I set up data files and expected results for each file, and my program passed all tests. So I think I know enough Ruby to write a small filter program. I'm using a bash script to run the tests, and it is now big enough that I may want to break that into multiple scripts, or maybe condense common code into a subscript. Or maybe write a program in Ruby to handle the testing. I wrote a similar program in Perl back at UPS, and it was very helpful in developing programs.

Tuesday, February 3, 2009

Modest success with Ruby on Rails

I have solved the problem with Ruby on Rails. As I suspected, it was a rights issue with the database. I'm using the administrator account for database access right now. It isn't the solution that I want, but it is sufficient for my needs.

I took competency tests for C++ and C# today, for one of the contracting firms. My, this was a humbling experience. The C++ was heavily weighted towards templates, STL, and exceptions which are all areas that I know slightly. The C# test wanted to know about exceptions, delegates, and conversions, which are all tricky areas. Each question has a three-minute timer on it, which means you either know the topic well or you don't. I'm afraid I don't know the topics that well. (I am familiar with the topics, but I don't know them that well. My answers would require research and perhaps some experiments.)

I started setting up Subversion for tracking changes to my local projects, and I started a local project in Ruby. I'm working on the 'uncomment' program, which may turn into several programs. The semantics for C comments are different enough from Visual Basic, and those are different enough from Perl, to possibly warrant individual programs.

Monday, February 2, 2009

Progress with printing

I have solved the problem with printing. While focussed on firewall rules, I forget to share the printer. I fixed the problem after disabling the firewall on both computers (//mylene and //desdemona). The two computers are already behind a firewall; they do not need individual firewalls. Once I had removed the firewalls and found that printing was *still* not working, I started thinking along other lines. And then the problem was obvious.

This morning I started using Ruby on Rails. It starts OK but cannot create the database. This may be an access problem. Back to the books!