Archive for the 'Programming' Category

Crazy Egg - Learn Your Visitor’s Habits

A recent post by Stundbl today got me pointed towards CrazyEgg.com. CrazyEgg.com provides a service by which you can track how many visitors, and clicks you get to your site, as well as the location of the clicks and more - a really cool service. If you want a better idea of what they do, or to see that stats they can and will produce, check out their demo.

The tracking is really easy to set up; merely place a single line of javascript onto the page you wish to track. The only complaint I have is that their free version is somewhat limited; of course, that *is* the nature of business. As it is, the free version still hold a lot of promise for helping you to optimize your content based on information concerning user behaviour on your site.
According to the latest post on the CrazyEgg blog, the initial problems they were experiencing after the launch have somewhat cleared up, and they are stabilizing. I would recommend signing up, and seeing what they can do for your site!

Spiceworks Thoughts II: How to Remove the Ads from Spiceworks

Now, before I go any further, let me make a few things clear:

  • Spiceworks is an ad-supported program. By removing the ads, you are depriving the development team of their funding. In essence you are stealing the software from them.
  • Spiceworks is not open source software. This means that you are not allowed to modify the code for your own uses.
  • Removing the ads is probably illegal.

So, why am I posting this? Well, for a few reasons:

  • I was having issues with the ads loading - they were timing out, making each page take 30+ seconds to load, and making the software somewhat unuseable.
  • Many tech people have adblocker software that is blocking the ads already.
  • This is to illustrate a point that I plan to make in an upcoming post.

That said - here is a quick way to remove the ads in Spiceworks. What tools do you need? Nothing. You need notepad, and the Windows Explorer.

An immediate observation I made when first looking at Spiceworks is that it is written in Ruby on Rails. All other things inside, that immediately indicated that somewhere, there was an .rhtml file which contained the layout code to include the ad block.

So, immediately, I performed a serach of the program directory, and found all the .rhtml files.

The two which you need to edit are:

  • C:\Program Files\Spiceworks\ruby\lib\ruby\gems\1.8\gems\spiceworks-0.8.3616\app\views\layouts\common\_ads.rhtml
  • C:\Program Files\Spiceworks\ruby\lib\ruby\gems\1.8\gems\spiceworks-0.8.3616\app\views\layouts\common\_sidebar.rhtml

To remove the ads, simply open both the above files in notepad. Remove all the contents from _ads.rhtml, leaving it completely empty. Remove everything within the “adbox” div tag.

If you would rather place your own ads in the sidebar, or the other content of your choice, perhaps links, or other content, you can also edit

C:\Program Files\Spiceworks\ruby\lib\ruby\gems\1.8\gems\spiceworks-0.8.3616\app\views\ads\adiframe.rhtml

replacing the contents within the tage with whatever you want to appear there. You could even place your own ads into the spiceworks install if you wanted.

Spiceworks Thoughts I: Spicy Thoughts

Now the point of this post is not to rant and rave about how good Spiceworks is like some cheap PR release, or paid post. Rather, in implementing Spiceworks, and seeing their architecture, and the unique way that they market themselves, it got me thinking about a few issues in Software development and marketing that I will flesh out a bit in my next few posts. But, I figured an introduction to the rpogram, and what it does is probably good background material…

At the beginning of the summer, my employer was thinking about setting up a type of network/system monitoring solution to keep track of the 50+ systems we ahve in our office and shop. We looked into a couple of options at the time, and started to set up IRM. IRM (Information Resource Manager) was a great program for what we needed, or so it looked. Of course, the setup was monstrous, with hours spent handbombing in information and data, copying CD-keys, tons and tons of work. We stuck with it for a few days, and finally put that project on hold due to other deadlines coming up etc. etc. etc.

Fast forward to yesterday. A friend of mine on an IRC channel a frequent sent me a link to Spiceworks.com. I looked at Spiceworks, and it is really slick - just need to download it and install it, and it automatically scans your network, picks up systems, determines which OS and software is installed, which services are running, etc. It alerts you to any problems in your network, monitors drives for space, or out-of-date antivirus information and more. Best of all, it’s free!

Actually, not true - the best thing is the Spiceworks is written in Ruby on Rails

SEO Black Hats Find Major Exploit in Moveable Type

From a Digg post:

“SEO Black Hats have found a major loophole in the comment preview of the Moveable Type blogging platform. This exploit let’s them insert active links into any post, avoiding the “nofollow” penalty usually associated. This allows them to artificially inflate the importance of spam websites, leading to less accurate search engine results!”

This is really too bad, seeing as their are hundreds, if not thousands, of high-ranking blogs out there based on the Moveable Type platform…

read more | digg story

Ruby, Rails and RJS

So, today I learned about RJS for Rails… RJS, or Remote Javascript, is a method which allows you to write complex AJAX scripts using Ruby syntax etc. Using RJS templates, it is possible to create extensive effects.

Now Rails has for a long time naturally includes some built-in functionality for AJAX, via the PrototypeHelper and ScriptaculousHelper libraries. Unfortunately, these two helpers would only allow one element in the DOM to be updated in an AJAX operation. That did not suit for what I wanted to do. Luckily, since Rails 1.0, RJS has been including. In addition to providing a simpler way to write AJAX functionality into your project, it also allows you to modify as many parts of the DOM as you wish per AJAX operation.

Of course, there doesn’t seem to be any good tutorials concerning RJS on the Internet. After looking for a while, RyanB from the Rails Forum suggested purchasing RJS Templates for Rails from O’Reilly. This is a great book - it comes as a PDF, and is only 60 pages or so, but is jam-packed with information on RJS, with code examples, and everything.

Because of this, I have been able to start implementing some AJAX functionality on a project for my employer. The visual effects from script.aculo.us are pretty cool, but the real benefits come from the increase of useability for the end-user. No longer does a user have to wait for page reloads etc. everytime he changes a vaue on the page. Plus, it is simple to link the AJAX pieces into your database, yielding an extremely ‘live’ page.
So, the moral of the story is, if you utilize Rails together with AJAX in any way, look into RJS - it can and will save you tons of time and energy, while vastly improcing your site design and useability!

Answers from the Great Programmers

I was just recently reading an article on the Sztywny Blog where the author sent a number a questions to a variety of today’s famous and great programmers. While he did not get replies from all the people he asked, he did get responses from

  • Linus Torvalds - Linux Kernel
  • Dave Thomas - Author of Pragmattic Programming, other great books
  • David Heinemeier Hansson - creator of Rails
  • Steve Yegge - Author of Wyvern, has a great programming blog
  • Peter Norvig - Research Director at Google
  • Guido Van Rossum - Creator of Python
  • James Gosling - Java language creator
  • Tim Bray - author of the Atom and XML specifications, as well as a blogger.

Many questions are asked, including where these guys learned programming, important skills, the value of math and physics with regards to programming, the future of programming, their favourite technology, their favourite tools, books and much more - a great read!

One thing that does come across while reading the article is that David Heinemeier Hansson is a very different breed of programmer from the rest of the people interviewed. At least, it seems to me that his answers stand out from the rest. He seems to be less of an academic, as a practicing programmer. That may not be the most accurate way to state the difference, but it is the best I can do.

Regardless, these are some of the top minds in the business, and there is a lot of interesting points they make. Very good reading for any programmer or Computer Science student. If nothing else, read the section where they describe their favourite tools - You may find a better environment than what you currently use!

MVC: Why Everybody Should Code with Rails at Least Once

First, before you read this article, I would suggest you read my first post on the subject, and this article.

So now you know what MVC is. You know why it is important when designing web apps, and why is is considered essential in Rails coding.

Rails disciplines you into using MVC. I have been programming with Rails for about 2 weeks. Through the process, and being forced into using MVC, I have also begun to think in MVC terms. In fact, the Model-View-Controller design pattern has become almost second nature to me. I can’t think of a clearer way to design a web application.

This is amazing to me, because I used to be, and in many ways still am, a sloppy programmer. I ran by the seat of my pants, without much over-arching architecture, and little true design. My code always worked, and well too, but was a nightmare of a tangle to read and maintain. I am amazed at the clarity and simplicity that is presented when using Ruby on Rails. I can actually make sensible UML diagrams of my work, without it looking like Medusa’s hair.

That is why I would push for every programmer to build at least one project in Ruby on Rails. Not only will you find that your coding time is cut down, due to the quick nature of Ruby on Rails, but you will also be forced into using good style. Well, maybe not, but you will be forced into using design patterns. That is a great advantage in the long run.

« Previous PageNext Page »