Perl Practice

In learning a new programming language, I will often make a one-off program to explore the language and get real-life experience in using it. With Perl, I created a programmatic version of a game I play with my kids as I am tucking them in at night. It’s called, “Thinking of an Animal”, and it’s designed to get them thinking about animals and what they look like and how they are all different. There are many versions of the game such as Thinking of a Safety and Thinking of an Airplane.I used the idea to write a Perl script that interacted with the console and provided positive feed back to the player. It was interesting to anticipate what the user would do and to conceive of the data structures to make the program more elegant. I still need to redesign certain subroutines so that they can be reused and ultimately, I will integrate it with a data base so the animals can be easily added to and expanded upon.

This game will also be useful when the kids start learning to read and can make better use of their computer time. You can download and mess with the program if you like, it’s completely open source and ready to be hacked.

Thinking of an Animal

6 Meter Mobile

My friend Dave (K1ZH) came over today and helped me fix up my 6 meter FM Genave radio to work with a tone generator on the local repeater. We studied the schematics and suffered through a power supply failure but managed to get it going. The radio was designed by my father, Gerry McConnell back in the mid 1970’s. It has ten crystal channels one of which allows for repeater use.

A good friend of mine secretly purchased the crystals for me from the original supplier to Genave. So finally the radio will hit the repeater. A quarter wave mag mount antenna on my Honda and now I’m on my way.

The tone generator is a little black box that sits on top of the Genave with electrical tape straps. I’ll have to devise a proper mount for it next.

Hardware

Many geeks take pride in their hardware and will boast about it without prompting. Some of us are less boastful and are hard pressed to say exactly what we are running. I’m definitely in the later category. The only time I get concerned about my hardware is when my Widows machine starts lagging because the latest OS version can’t run on my ancient hardware.

Despite my lack of concern for hardware I find it interesting to know what my peers are running. So I’ve started a My Hardware page on my blog site that lets the curious reader know what I’m running as far as hardware and to some extent the software I use most often. It would be great if this were a regular area on Tech blogs.

(I just had to add blog to my AbiWord dictionary. AbiWord itself is not in it’s own dictionary. But that’s a subject for another column.)

It’s just a start, and I did not list the graphics cards because they are all nondescript cheap things that any Gamer would scoff at. Only one machine – Renoke has a Sound Blaster audio card that is slightly more than what’s on-board most systems. I don’t game, sorry.

The next time I take a machine down, (don’t hold your breath) I will try and catalog what’s inside of it in more detail.

The Lama Book

I’m getting back into Perl again, for a web site rewrite at work using Apache’s mod-perl. Many folks have learned Perl from the O’Reilly book, Learning Perl by Schwartz and Phoenix. About all I remember from it was that it had a great sense of humor. Now that I’m ramping up on Perl again, I’ve been rereading the book and enjoying the humor. A language like Perl takes a good sense of humor to learn.Once you get over the Camel’s hump, Perl can be a very fast and expressive scripting language. It shines when allowed to parse text files and manipulate regular expressions on them. It falters when poor programming habits are allowed to take over and can easily be very tough to read by anyone including the author.

If you are looking for a good scripting language to use, Perl can certainly fit the bill. The fact that it’s so ubiquitous makes it more valuable to know than easier languages like Python. I love to write Python but I have never found the opportunity to use it at work in the same manner as Perl. Everyone, it seems, knows Perl and that alone can make it valuable to know.

If you are learning Perl, there is no finer book than the one with the Lama on the cover. Get it and follow along with tong firmly planted in cheek.

So bare with me as I walk with the Lama and and let it chomp grass at my feet. ;)

Shell Game

I downloaded the preview of Microsoft Shell, aka Monad. One of the reasons I use Linux as my primary OS has always been the functionality of the shell. I won’t bore you with all the details, suffice it to say, it’s always been the most direct and easiest way to communicate with the kernel. Even a moderately skilled System Administrator can do impressive feats with the shell. If you put some time into it, you can quickly do things a GUI can only dream about.

A few years back, Microsoft declared the death of the DOS terminal and the command line in general. They figured that everyone had surrendered to their GUI interfaces and typing obscure commands into a shell was ancient history. Well, they were wrong. The success of Linux in the server room gave newbie Sys Admins a taste of the power of the shell. Before long, they were demanding that Microsoft bring back the shell and to make it more like the Linux shell. Microsoft has never been slow to answer the calls of their administrator and developer users. So we have Monad.

The first thing I typed into the MSH was the UNIX command – “ls

Hand Coding

There is a really interesting article here – Does Visual Studio Rot The Mind? by a long time Windows programmer named Charles Petzoid, the author of Programming Windows.

In the article he questions the reliance of Windows programmers on the use of Visual Studio and it’s “code for you and hide the details”, way of programming. He feels that VS encourages poor programming skills and he frets that modern coders have become too reliant on the eye-candy of the GUI builder.

I have to agree with him on that. It’s interesting to see how reliant Windows programmers are on VS. Many of them have no idea that .Net allows them to grab a real text editor and code everything for them selves. You don’t have to use Visual Studio, in fact you actually learn more about how to program by doing things for yourself. I’m not saying that you should never use VS, it can be a real time-saver for quick, one-off tools, but for serious, very large projects involving many coders, it’s almost always better to do everything yourselves. That way there are no secrets in your code and everything works the way you intend it to work.

The whole XAML thing that Microsoft claims to have invented is not new at all. Linux programmers have been using Glade’s XML based interfaces for years. It’s just astounding to me that Windows programmers are so ignorant of how other platforms work. If you are a Windows Programmer I highly recommend that you get yourself a Linux box and do a little programming on it. Read a few Linux programming books and see how other programmers have lived for years without VS. It’s a real eye opener. I’m not saying you will like it better, but it will make you a more critical Windows developer for having taken the time to learn something different.

Who knows, you may actually find yourself loading Vi on your XP box and compiling your C# from the terminal.

73,

W0PHT

Back to the future – rockets.

NASA has released an overview of their next space ship. How We’ll Get Back to the Moon Looks like they are using Shuttle solid rocket boosters and shuttle main engines to design two rockets, a heavy lift cargo rocket and a Apollo-era style crew rocket.

Has NASA finally waked up from the Shuttle era deep sleep and realized that the best technology to get things into space is the rocket? Think of where we would have been had they chosen this design instead of the shuttle. I grew up watching shuttle launches in Florida and I always thought they were cool. But please, it’s a mini-van. We need a semi-truck to get things up into orbit and on their way to the Moon or Mars.

I just hope they can get this new set up built and tested before the Shuttle Program falls apart completely. I somehow feel that Burt Rutan will be finishing the ISS instead of NASA.

73,

W0PHT

Tools of the trade

Programmers are just like any tradesman. We have several tools in our tool box that we use to make our lives easier. Over the next few blog entires, I will be exploring some of the tools programmers have in their tool boxes. As a tradesman you are expected to know how to use your tools to their fullest and to be able to pick which tool is the best one for the job.

Some of the tools a programmer will need include: In depth knowledge of your chosen platform – Operating System, understanding of your primary object oriented language, a passing knowlege of one procedural language and one scripting or text manipulation language, mastery of your chosen editor and IDE, knowledge of your chosen shell, the ability to debug, knowledge of web programming including HTML, a library of technical books that you can readily refer too, humility.

My primary OS is Linux, but I also use Windows XP Pro. So knowing as much as possible about both OS’s is not as easy as knowing all about only one. My primary OOP language is C# and my scripting language is Python. My editor is Gvim the Gtk port of ViM. My shell is BASH, on Windows, I use Cygwin. I use PHP for web work and sometimes Zope, My library of technical books is too large to list. Many books on Linux, Python and C#.

I will also be reccomending books on coding and anything else the least bit related to the art of programming. These will include essays and blogs by established hackers who should be known to all coders. Just like in any profession, you should know who is at the top of your field and what they did to get there. A fair amount of programmng history is also required to understand the jargan and the reason certain things are done the way they are.

If you think you might want to learn to program, get a Linux box, open a terminal and type “python”. Then get yourself a copy of Learning Python by Lutz and Ascher. Then code and code and code until you start to dream in code. Take a breaks occasionally, to watch a movie or learn about Linux. But nobody ever learned how to program by reading a book. You must do and do it often.

Diversion Tactics

I’m a parent of pre-school age children. I know all about diversions. I can redirect the attentions of my children at the drop of a hat to discourage deviant behavior. It beats yelling at them and it goes unnoticed by them.

When the current administration railroaded the country into invading Iraq, I saw it for what it was – a diversion. Why else would we put all our military efforts into removing a dictator that we had been perfectly willing to contain for over ten years, while the people responsible for planning 911, go largely untouched into the night?

It’s well know that the Bush family and the Bin-Laden family have connections that are at best dubious. It’s far easier to go after a dictator then to flush out a terrorist. I just have trouble believing that the US Military, the greatest military in History, can not find one man on this planet. If all of our military assets were brought to bear on finding Bin-Laddden and in the process eliminating his cells, I have to believe it can be done. Instead of fighting a war of attrition in Iraq, we should be on a man-hunt for the real criminal.

The only one’s that should be in Iraq are the Iraqi people. Freedom does not mean anything if you have not volunteered to fight for it yourself. We gave them back their country, now let them sort out the details. They may not decide that our kind of democracy is for them. They might have a civil war. We did. You didn’t see any other country come into the US and say we should not fight ourselves?

It’s time to get back on target.

Follow

Get every new post on this blog delivered to your Inbox.

Join other followers: