Thursday, December 23, 2004

Lazy Sir and C#

I remember when I first REALLY started programming in C#. There is nothing like learning a new language and feeling like you get it. I mean you really get it. Instead of trying to figure out how to make "Hello World" appear, you are doing useful projects and are able to figure out how things work.

Normally when in this state you are on guard against the Evil Lazy Bug. You are using the correct and exacting naming standards. You comment everything. You might even generate JavaDoc type documentation for your project. Eventually, usually, familiarity breads contempt and you get a little lax. Well I decided to tighten up again and in doing so I started reviewing the C# programming standards. I found a great article from Lance on Microsoft.Net outlining what the standards are. I am not going to bore you with the details, but go ahead and download the PDF. It is VERY comprehensive and probably deals with ALOT of things you will not hit every day. However having said that it is very good and brings together alot of different information Microsoft makes available in a hundred different locations.
Hope you enjoy it!


Wednesday, December 22, 2004

Firefox 101

So to prove to all you doubters out there that I am not just a MicroSerf I decided to make my first post about the most excellent browser Firefox. Of course I have never used it before so I had to get cranking. So where do I get this wonderful product? That part was easy. Type FireFox into the Google bar and you get a direct link to Fire Fox. Well so far so good.

The download and install on my MicroSerf windows machine was quick and easy. It even offered to import my Microsoft Explorer items. How nice. The browser came right up. It seems pretty fast too. I would not hesitate to say it is several times faster than Explorer. So I decide to go for a real test: Will it just play a Macromedia file? Nope. It failed that test. Not one to give up I decide to give it another chance. I go to the Macromedia Flash Download page, download and install the Firefox version, restart Firefox, and it all works out. Not too shabby.

Now I did not download Firefox just to play with a new browser. I wanted to figure out how there plug-ins worked. The real fun of Firefox is writing add-on’s. In this area Firefox is no help at all. I had to find a third party site called Roachfiend to help me out.

So what does every programmer do first? HELLO WORLD! Yeah baby! Roachfiend has a nice starter demo to show you what you can do. Please go to his site and download the XPI file so you can follow along. The first thing I learned was an XPI file was just a zip file with a different name. Ok. We have all seen this. EAR.WAR.JAR. Should I go on?

Apparently every extension consists of three items.

install.js: provided for backwards compatibility with version 0.9 and earlier.
install.rdf: descriptor file
helloworld.jar: actual program

In the install.rfd there are several items. The majority of them are self explanatory. The tag is a GUID that uniquely identifies your application. There are plenty of tools to generate a unique GUID for you.

The iconURL and aboutURL tags are optional and you can leave them out if you want. They provide the “About” functionality for your extension. The package tag points to your application files and the skin tag is optional if you want to skin your application.

Now on to the application. It must be packaged up as a .jar file. Apparently the jar file has to have a directory called crome and all of your source files go under there. If you look at the helloworld.jar file you will notice that the package directory has the following files:

about.xul: contains code for the about box.
contents.rdf: location of all the files
helloWorldOverlay.js: application code
helloWorldOverlay.xul: application look

The about.xul and helloWorldOverlay.xul files are XML files that define the forms that we are working with. The GUI if you will. You should learn XUL if you are going to be working with Firefox extensions. I would start with Mozilla’s programming guide. I sure will!

The helloWorldOverlay.js is the code to show the “Hello World” popup. It is a simple javascript alert box. The contents.rdf file just tells the browser the location of your extension files.

The skins directory provides a way for you to use custom images, etc, in your plugin. I am not going to go into too much detail. It is setup basically the same way as the code section.

Once you have created your files, and packed them into the .jar file, and .xpi file all that is left is to install the extension. It is very easy. Just choose File->Open in the browser, and choose to install it. It also appears as if these extensions are turned of in safe mode. So just make sure you run Firefox in the normal mode.

This was an intro to Firefox and many thanks to the Roach Fiend. In the future I will update you with any interesting projects I do with Firefox.

Qualifications

I decided to start a new Blog on programming in general. I intend to put code snippits, articles about the industry, and other useful tidbits in here. Also if anyone should need any contract work done I would be more than happy to assist. I do not claim to be the best programmer in the world but I do alright and should be able to explain things to you.

I started out programming as a wee lad. I was 14 years old and had a TI-994A with a basic cartridge. Eventually I would graduate to a C-64 and write my first game called Farmer's Daughter. It used sprite manipulation and was really cool for a young kid. I kept playing with computers all of my teen years. I mostly liked the games, and in those days if you wanted a game to work you needed to understand the machines inside and out. I graduated to an Atari 130XE. It took alot of K-Mart money for that puppy. I did alot of chatting online and even ran my own BBS. I wrote a few modules for it too. I beleive it was programmed in some Basic derivitive. I stayed with Atari until they died out, having a 1040-ST at one point in time.

After High School I decided that I needed to get a job that was a little better than McDonalds or Caldors. So I went to a Tech School for 9-months and have never looked back. I had a great time at school. Rewriting the DEC-VAX OS for the fun of it. Getting straight A's. Correcting the teachers mistakes. Really good stuff. Once I graduated I got hired as a consultant for a EIS/DSS system. It was a 4-GL language something like basic and was great. I was making the HUGE sum of 24K a year! WOW! It was amazing. I got to travel around the country working at places like IBM, Ocean Spray, and National Sea Food. I got a nice red Mustang (never again) and life was good.

Over the years since then I have gotten into jobs leveraging skills from my past Jobs. I taught myself RPG on an AS/400 and Visual Basic to get a job at a Hospital. I leveraged my Visual Basic and SQL Server/Oracle skills to get a job consulting. I saw the folly of becoming too specialized if the market slowed so jumped into Web Development, Handheld, and Java technologies. I basically enjoyed learning and growing and discovering new commands and powers. It really is alot like being a magician.

The recent developments in my career have dampened my enthusiasm for programming a little. The downturn of the 90's was hard. I never was un-employed as so many others have been but I have had to take a little pay cut. I traded in the Mustang for the mini-van and mortgage and the exciting startup type jobs for more stable work. I am still contracting and enjoying it. Just not as much. The threat of offshore development is also looming. Someday I might have to retool and become something else. Possibly a professional poker player? Go see my other Blog Online Poker Thoughts for the state of that.

I get most of my enjoyment in programming these days either doing projects for myself or freelance stuff on Elance. I do alot of C# and .NET work these days and really like the language. I hope to share some fun projects with people, get feedback, exchange idea's, and basically just enjoy. If you have any suggestions for posts let me know. I will be doing a mix of linking to other sites and putting my own content up.