SwiftFox Debian Repositories

Since Debian is a distribution of Linux that tries to stay as "free" as possible, some of the software it is released with is not exactly useful all the time. Case in point: a site I recently visited complained that I didn't have an acceptable web browser. It said that I could use Firefox, but Debian packages "Iceweasel" instead of Firefox. They are basically the same program, only with different names (as far as I'm concerned). However, there is another program called "SwiftFox," which is a custom build of Firefox that is optimized for various CPU's. This browser is still accepted as Firefox, so this article will explain how to set your Debian system up to be capable of automatically installing and updating SwiftFox.

  1. The SwiftFox website does not currently offer a keyring, so you don't have to worry about that right now. Skipping this step will often give you warnings or error messages when you go to update your repositories or install something from the untrusted repository.

  2. Install the repositories using the following line:

    deb http://getswiftfox.com/builds/debian unstable non-free

    This line typically goes in the /etc/apt/sources.list file. Just put it on its own line. Some newer Debian systems prefer that you put this line in /etc/apt/sources.list.d/[repository].list (where [repository] would likely be swiftfox in this case).

  3. Run apt-get update as root to make sure the repositories are working properly. If they are, you should see no errors or warnings pertaining to swiftfox.com. If you see any such messages, try updating again.

  4. Install SwiftFox Since the builds are all optimized for various processors, check this list and this other list to figure out which package you should install. Since I'm running a 32-bit operating system on a Turion 64, I would run the following command as root:

    apt-get install swiftfox-athlon64-32bit

    You'll likely have to explicitly say "yes" when it asks if you really want to install the package.

Once that completes, you should be able to launch SwiftFox without a hitch!

Opera Debian Repositories

Being a web developer, I have an obligation to ensure that the sites I build work on the wides range of popular web browsers as possible. Because of this, I often find myself installing the wonderful Opera web browser on my Linux systems. Now, I could just download it directly from http://www.opera.com/ each time there's an upgrade, but it is much easier to handle when running a Debian-based distribution thanks to the apt-get infrastructure. This article will explain how to set your Debian system up to be capable of automatically updating Opera any time there is a new release.

  1. Install the keyring. A keyring is simply a way to verify the identity of the repository. It kinda makes sure that you are installing from the server you want to be installing from, instead of a different server that has unauthorized packages. To install the keyring, run the following command as root (or with root privileges using sudo):

    wget -O - http://deb.opera.com/archive.key | apt-key add -

    Note: Copying and pasting the above command does not seem to play well. The dash immediately before the http://... is translated improperly on this webpage. It should just be a regular dash.

  2. Install the repositories. This part usually depends upon your particular flavor of Debian. I am running Debian Sid, so I install the Opera repository using the following line:

    deb http://deb.opera.com/opera/ sid non-free

    or if I am feeling brave, I can install the "unstable" testing version of opera with

    deb http://deb.opera.com/opera-beta/ sid non-free

    If you are running Debian “etch”, you would change sid to etch and likewise for other flavors of Debian. This line typically goes in the /etc/apt/sources.list file. Just put it on its own line. Some newer Debian systems prefer that you put this line in /etc/apt/sources.list.d/[repository].list (where [repository] would likely be opera in this case).

  3. Run apt-get update as root to make sure the repositories are working properly. If they are, you should see no errors or warnings pertaining to opera.com. If you see any such messages, try updating again.

  4. Install Opera. Run the following command as root:

    apt-get install opera

Once that completes, you should be able to launch Opera without a hitch!

Debian Multimedia Repositories

For those who enjoy watching movies and listening to various audio files in Debian-based Linux distributions, there is an awesome project out there called Debian Multimedia. It offers many codecs and other useful applications and libraries that are required to work with a lot of different multimedia formats. This is how you may setup your computer to use Debian Multimedia as a repository. This allows you to quickly and easily install the things you need to get up and running.

Note: Some of these packages contain things that are protected by copyright, and you need to be aware of the laws and implications of installing them on your system wherever you may live. It may or may not be against the law.

  1. Download the keyring from http://www.debian-multimedia.org/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2007.02.14_all.deb. The keyring is simply a package that includes an authorization key to ensure the server is who it says it is.

  2. Install the keyring. Downloading the keyring is not enough. Now you have to tell your system to use it. One way of doing that is to run the following command as root (or with root privileges) in the directory where you downloaded the keyring:

    dpkg -i debian-multimedia-keyring_2007.02.14_all.deb

    This will copy the keyring to the appropriate place on your computer so apt-get won't complain when it tries to access debian-multimedia.org

  3. Install the repositories. This part usually depends upon your particular flavor of Debian. I am running Debian Sid, so I install the Debian Multimedia repository using the following line:

    deb http://www.debian-multimedia.org sid main

    If you are running Debian "etch", you would change sid to etch and likewise for other flavors of Debian. This line typically goes in the /etc/apt/sources.list file. Just put it on its own line. Some newer Debian systems prefer that you put this line in /etc/apt/sources.list.d/[repository].list (where [repository] would likely be debian-multimedia in this case).

  4. Run apt-get update as root to make sure the repositories are working properly. If they are, you should see no errors or warnings pertaining to debian-multimedia.org. If you see any such messages, try updating again.

And that should get you rolling! Good luck.

Finally!

So this semester is finally over and done with. I only have two more courses to take before I am done with my major, but I still have quite a few classes before I complete my minor (I chose one very late). I will still be in school for another year or so.

This has been a particularly frustrating and busy semester for me, so I think it will be nice to only take one class over the summer and work/play the rest of the time. I have a lot of really fun projects that I want to work on this summer, so hopefully my site will be a bit more active that it has been for the past month. We'll see how that goes.

Rude Awakening

So I woke up yesterday morning with what I thought was plenty of time before I had to get ready for church. I woke up, looking at the alarm clock, thinking that I had at least 4 hours to spare. Mindy was sound asleep, so I just pulled out my laptop and checked my email and surfed the web for a bit.

Before I knew it, my alarm clock said "10:22" and I figured it was about time to get ready for the day. That same moment, I looked at the clock on my laptop. It said "11:24". I had an appointment at noon. I was very confused... I looked at my alarm clock. I looked at the clock on my laptop. I looked at my alarm clock. I looked at the clock on my laptop. I looked outside. I looked at Mindy. I looked at the alarm clock and scratched my head. Then I checked my cell phone. It agreed with my laptop. What the... Did Mindy intentionally set the clock to be an hour behind so she could get more sleep? I was soooo confused.

I called the bloke I had an appointment with. He enlightened me by telling me that daylight savings time had taken effect. What the heck. Isn't that normally in April?

I have a big problem with daylight savings time. Those folks in Arizona have it right. There's absolutely no logical reason in my mind for jumping ahead of falling back an hour. If people are so concerned about having more daylight, why not just jump ahead 30 minutes or fall back 30 minutes and call it good for the rest of eternity??? That way we wouldn't be losing or gaining (as much as I do like that part) an hour just when we get used to the schedule. We'd always have a balance, because we'd be right in the middle. Bunch of crackheads.

Give me back my hour (or at least half hour) of sleep!!!

Why I Like Python

For the past 8 years or so, I've been very much involved with programming using the PHP scripting language. It is a powerful scripting language that suits building websites very well. PHP has a huge set of useful built-in functions, and more recent versions support object-oriented programming. I first started teaching myself PHP when I got tired of having to build each and every web page on my site manually. I hated having to change dozens of web pages just because I added a new link to my navigation. All sort of reasons like this prompted me to investigate PHP. Little did I know then that this language would occupy so much of my time in the future.

I rapidly learned that PHP offered much more than just allowing me to update one part of my website to change all pages. I started tinkering with all aspects of what PHP offered, and I'm still learning about it. After many years of searching, I finally found a programming language that was easy, fast, and efficient for my needs.

Through the years, I continued to develop various applications using PHP. I attempted to write my own forum/bulletin board software while I was still in high school. If I may say so myself, the forum really had some awesome concepts behind it. But my problem was that I lost interest too fast. I also built a very large application that reduced a 1.2GB MS Access database down to less than 15MB using PHP and MySQL. The new application offered many enhancements over the previous system. For one thing, it was much faster. Second, it allowed multiple simultaneous users to modify the database. Three, so far it has lasted more than 3 years, compared to the 1 year maximum that the MS Access solution always seemed to hit before it crashed.

Using PHP, I helped revolutionize the way one of the companies I work for developed websites. I built a simple in-house web framework that supposedly reduced development time by allowing us to forget about the mundane details involved in virtually every website and just get to the developing. In a matter of two weeks (with a full class load and another job), I managed to write an e-commerce solution for the same company using PHP.

Basically, PHP has treated me well over the years. But this post is not supposed to be about PHP. If that's the case, why have I rambled about PHP this whole time, you ask? Well, it's mostly to demonstrate that I have a lot of experience with the language. I have a pretty good feel for what it's capable of and how I can accomplish most anything I need.

With all of that in mind, I've encountered my frustrations with PHP. They may seem petty and moot to most people, but they have turned out to be the determining factor in what scripting language I prefer. Here is a short list of things I now despise about PHP:

  • dollar signs ($) to signify variables -- while this is a useful feature, it becomes quite bothersome when you're programming all day long (at least it does for me). I'll get to why later.
  • using an actual arrow (->) to access attributes -- most other modern programming languages simply use a period (.) for this functionality. I'll comment more on this and why it frustrates me later as well.
  • lack of true object-oriented constructs -- in other object-oriented languages, like Java, if you have a string and you want to determine its length, you call the length() method of that string. In PHP, you call a function such as strlen($var). This sort of behavior plagues the language.
  • too many unnecessary keystrokes -- as I mentioned before, all mutable variables are preceded by a dollar sign ($). That is 2 keystrokes (shift and 4) every time you want to refer to a variable, wheres most languages nowadays have none). Likewise, accessing attributes of objects in PHP uses an arrow (->), which is three keystrokes (minus, shift, and .). Most other object-oriented languages only require a period (one keystroke) for such functionality. The main reason I make such a big deal out of the number of keystrokes is simple. The more keystrokes a program requires, the more likely you are to have bugs. The fewer keystrokes a program requires, the less likely it is that your program will be broken. It boils down to maintainability. Also associated with the number of keystrokes is the pure laziness within me and most other programmers.

These frustrations have been bothering me for several years now. I continued using PHP mostly because it's so widely supported, but also because I could not find a suitable replacement for it. I investigated a few others, but they apparently didn't have a great influence on me right now because I don't remember any names.

When the whole Ruby on Rails bandwagon was rolling through town, I decided to hop on to see what all of the hubbub was about. I started studying the Ruby script language, and I found that it had some really neat things about it. It uses a more solid approach to object-oriented programming, which I really liked. I also noticed that it employs some intriguing structures for accomplishing things in ways I've never seen before. Despite these things, Ruby still didn't seem like a viable replacement for my PHP. It didn't come up to snuff in performance in many cases, so I essentially abandoned it.

For at least a year now, I've been interested in learning Python. I've heard a lot about it over the years, but I just never seemed to make the time to actually sit down and study it. That is, not until about the beginning of August of 2007. After I made my decision that Ruby and Ruby on Rails weren't quite up to par for my needs, I stumbled upon the Django Project, which is a web framework similar to Ruby on Rails, only built using Python.

I decided this was my chance to actually sit down and learn a little about this "Python" so I could see what it had to offer. I mostly used Django as my portal to Python. As I started learning Django, I became more and more familiar with the way Python works and how I work with Python.

At some point in time, I decided that I actually liked Python, and my wife let me buy some really cool books to help me learn it. By the beginning of October 2007, I had convinced my supervisor at work to let me start building websites using Django instead of our home-grown PHP framework.

And here comes a story. This is the main reason I blabbered about my experience with PHP so much at the start of this article. Again, after all these years, I feel very confident that I can do just about anything I want efficiently and elegantly with PHP.

Back in October of 2006 (after using PHP for some 7 years), I was asked to write a PHP script to parse some log files and output various bits of information in a certain format. After maybe a week, I had a script that did the job fairly well. Most of the time it worked, but there were occasions when it didn't and I had to fix it. The script turned out to be 365 lines of code with very few comments scattered throughout. It's also a maintenance nightmare, even for me.

In October of 2007, I rewrote that same script in Python. After only a couple days, the script seemed to be perfect. It did its job, and it did it well. With comments for just about every single line of code, the Python version of the script took up a mere 118 lines of code. Take out the comments and it is 56 lines of code. The script is several times more understandable and maintainable than its PHP counterpart. I also believe that it is much more efficient at doing its task. Keep in mind that I had only been using Python for about 2 months at this point in time.

It's been through various experiences like the log parser that I have decided I prefer Python over PHP. Obviously, I'm not quite as comfortable with it as I am with PHP, but I don't feel too far behind. Now, less than 6 months after deciding that we'd use Django at work, I don't think my supervisor could be happier. Building a typical website with our PHP framework takes between 1 week and a couple months. Thanks to Python and Django, most of our websites can be "ready" within just a few hours. That time assumes that the website's design itself is ready for content to be put into it and also that the client does not require custom-designed applications.

Python and Django have helped revolutionize the way we do things at work, and I can hardly stop thinking about it. Python fixes nearly all of the frustrations I had with PHP. The frustrations it doesn't take care of are worth the sacrifice. Python is capable of object-oriented programming. It uses a period (.) to access object attributes. Variables are not preceded by some arbitrary symbol.

Also, the fact that Python code can be compiled to bytecode (like Java) is enormously beneficial. Each and every time a PHP script is executed, the PHP interpreter must parse the code. With Python, the first time a script is executed after an edit, the program is compiled to bytecode and subsequent executions are faster. That is because the bytecode is processed directly by the Python Virtual Machine (as opposed to being compiled to bytecode _each_ time and then executed). Python also offers a vast amount of standard library functions that I would really appreciate having in PHP. But from now on (at least for the foreseeable future), I will try to do all of my scripting in Python and leave PHP for the special cases.

Valentine's Day

I'm not one to celebrate very many of the "lesser" holidays. These include things like St. Patrick's Day, Columbus Day, and Valentine's Day. I've always just found these holidays to be an excuse for people to be weird and get drunk. I am weird just about every day of the year, so I don't require holidays to provide an excuse for me. Valentines always seemed like one of the most cheesy holidays to me. Today I decided to have a different opinion of it.

I woke up this morning, and my beautiful wife had gotten out of bed early to strategically place all sorts of little goodies all around the apartment. I'll spare you the juicy details, but suffice it to say that it really helped me appreciate what others see in this holiday. My wife took the time and effort to do something just to make me feel special and loved (which is by no means a new thing). If only I could make her as happy as she makes me....

Perhaps I just had too many bitter experiences as a kid growing up. Maybe I didn't get as many Valentine's Day cards. I don't know what it was that prompted me to dislike Valentine's Day. Whatever it was, my perfect wife just changed my perspective forever.

I love you Mindy!!!

Perpetual Motion System May Become A Reality

Today I was browsing Slashdot and came across a story about a Canadian college drop-out named Thane Heins who has possibly unlocked the secret to perpetual motion systems. I don't fully understand everything about it, but it seems to be a pretty solid deal to me. He has demonstrated the device at several universities and it seems that most professionals in the industry are speechless afterwards. No one seems to be able to explain what is happening using conventional physics laws. Even Markus Zahn from MIT, the foremost expert in electromagnetic and electronic systems, has yet to come up with an explanation for what happens within the device.

Considering that this man is a college dropout, do you suppose that no college graduates who go on to study these things could make this breakthrough because educational programs lock you into long-accepted ideas instead of embracing "thinking outside the box?" Why couldn't Zahn or any other leading expert in the industry construct a perpetual motion device with all of their resources? Heins has reletively nothing in terms of resources in comparison to university programs.

That train of thought makes you think at least twice about enrolling in classes at a university (if you have the enthusiasm to do something on your own).

Anyway, the story is here and you can watch the first two parts of a seven-part video demonstration on YouTube.

Big Day in My Career

To prefix this post, I would just like to make sure that you are aware of just how big a nerd I really am. I've probably got 7 computers laying around my apartment. I dream about programming (in fact, I've solved some frustrating programming problems in my sleep). The other day I had a conversation with a good friend of mine about how much faster and more efficient it is to use the keyboard for various things as opposed to moving a mouse around and clicking on things. That's just a taste.

Anyway, for several years, I've wanted to contribute something--a fix, a new feature, etc--to at least one open source project. The problem is that I've never really found anywhere to contribute amongst the programs I actually use. Either I didn't know how to accomplish something or I just didn't see that anything could be improved. It was quite frustrating.

Yesterday I was going along, doing my regular work, when I encountered a problem in an e-commerce framework called Satchmo. This problem made the website I was working on blow up. I couldn't successfully complete an order. At first I had no idea where the problem was. Eventually, I figured out a way to find what part of the framework was causing problems. I took a peek at the code and saw what seemed to be a solution. I made the change and all of the sudden I could complete orders on the website!

I was so stoked! I created a patch from the change that I made to the code. Then I opened a ticket on Satchmo's issue tracking system, described the problem briefly, attached my patch, and went on working. A few hours later, I got an email from the issue tracking system, saying that my patch has been accepted and has been applied to the codebase!

Finally!!! After all these years! I am an official contributor to an open source project. It feels good. Hopefully this is the first of many contributions to come.