Ruby :symbols understood - "A symbol is an object with a name"


Back in August
, I blogged about Ruby's symbols as I tried to get my head around what they really were. Jim Weirich made a post yesterday entitled 'Symbols Are Not Immutable Strings' which really helped solidify my understanding, his main two points being:

* Symbols are not immutable strings
* A symbol is an object with a name

Thanks Jim!

Technorati Tags: , ,

Support the new blog/RSS feed icon


Based on the Firefox RSS feed icon, (and adopted by Microsoft) is the transmitting symbol that with a big push from Feed Icons is trying to become the standard symbol that means "this is an RSS feed". I've added it to my blog today to support the effort.

Let's make RSS feeds simple enough for anyone to recognise - none of this orange XML this or RSS that...

Technorati Tags: , , , ,

Migration to Ruby for Java developers

As an experienced Java developer converting to a Ruby newbie I found the following posts from Sam Newman rather helpful in making the switch:

* Ruby For Java (and C#) Programmers, Part 1 - Conventions, methods, modules, and classes
* Ruby For Java (and C#) Programmers, Part 2 - Operators, methods, and more on classes
* Ruby For Java (and C#) Programmers, Part 3 - Introducing Arrays, Hashes and the typing system

If your anything like me having a good book by your side can really help when picking up a new language. There is one Ruby book that everyone seems to have, Programming Ruby: The Pragmatic Programmer's Guide. It really is an excellent book, I liked the first edition so much that I bought the second as well!

Let me know if you find any other resources that would be helpful to anyone else making the switch.

Another useful resource for people interested in see what Ruby is all about is Try Ruby! - an online interactive Ruby terminal that runs in a browser, created by the rather insane why the lucky stiff. Try it, you might like it!

Technorati Tags: , , , , ,

Missed your bookmarks when del.icio.us was down? Not if you've got Foxylicious!

If you are a regular del.icio.us user you will most probably know that they have had some server & database troubles over the past couple of days that caused the whole system to be unavailable for a considerable number of hours.

What you might not know is that you could have had access to them (if you are a Firefox user) if you had the Foxylicious extension installed. It maintains a copy of your del.icio.us links as normal Firefox bookmarks and I blogged about it back in April.

I find the del.icio.us Firefox extension better for posting to del.icio.us, but nothing beats Foxylicious for ensuring that you have fast local access to all your bookmarks should del.icio.us every have problems in the future.

Technorati Tags: , , , ,

DevBoi - the Ruby on Rails & web development quick reference sidebar for Firefox

If you use Firefox and develop either websites in HTML/XHTML, CSS & JavaScript or web applications in Ruby on Rails (or PHP) then the DevBoi sidebar written by Martin Cohen is a pretty handy extension to have.
A great Ruby on Rails book
Rob Sanheim has a great post introducing the new features and the offline version comes highly recommended if you ever want to develop whilst not connected to the net.

Technorati Tags: , , , , , , , ,

Increasing your USB gaming mouse polling rate with USB Mouserate Switcher 1.1 (usbmrs11.exe)

In my last post I talked about how to check your gaming mouse polling rate with a Windows utility called mouserate. You may have noticed that my polling rate was way above the standard 100Hz - in this post I'll tell you how I did it. This obviously only works with USB mice but there are not that many PS/2 gaming mice sold these days.

Important Disclaimer: Although I have not had any problems since running this patch, there have been reports on various gaming forums that people's mice or other USB devices have stopped working as a result of applying this patch. For some people it was fixed by choosing a slower patch rate but I wanted to mention this, as if you follow my instructions below and something goes wrong with your setup - your on your own... (it might be best to have a PS/2 mouse handy or know the keyboard shortcuts to revert the patch).

Ok with that disclaimer out the way, let's get stuck in and really ramp the polling speed up. First download USB Mouserate Switcher 1.1 by Anir. I had problems using the "Softpedia Mirror (US)" link but the "Softpedia Mirror (RO)" one worked fine. When you double-click usbmrs11.exe you are presented with a screen explaining what the tool can do. Clicking the "patch" button moves you to the screens that let you choose what speed you want to try. With each page it asks you if you want to change to that speed. It starts with 250 Hz/4 ms (slow), then 500 Hz/2 ms (medium), and then the fastest setting 1000 Hz/1 ms (the next page asks if you want to revert to the very slow Windows standard of 125Hz/8 ms).

If you answer "yes" to a question it patches the usbport.sys USB driver and asks you to reboot for the change to take effect. When you reboot is when you will find out if the patch has worked or if it has caused some or all of your devices to stop working.

If you have problems with any of your USB devices then try choosing a sightly slower setting first, if that doesn't work you will have to use the tool to restore the original Windows version - remember your USB mouse might not be working at this time, hence the reference to the PS/2 mouse above.

Once you've patched and rebooted, rerun mouserate to see what your new average polling rate is. Please leave me a comment below to let me know if it works (or not), and what average rate you are able to get. Also let me know if you think it makes your aiming and gaming any better.

Technorati Tags: , , ,

Check your gaming mouse polling rate with mouserate.exe

I'm not a big PC gamer but I do enjoy the odd hour online playing ET (Wolfenstein - Enemy Territory). Recently I've been disappointed with my accuracy and aiming, I just seem to always miss when in the middle of a frantic firefight.

I had read on an ET forum that a good way to improve your aim was to download and consume 'Aiming by RaZiel'. After reading some of the documentation and watching a couple of the movies in this pack I wanted to try and 'tweak' my mouse configuration.

One tip was to increase the mouse polling rate within Windows so that it would be read faster and therefore give a more accurate reading on the mouse's position. One way that you can check your mouse polling rate is with the rather handy 'mouserate' by Oliver Andreas Tscherwitschke.

It's a tiny download that contains a simple executable file that pops up a window which gives you an area in which to move your mouse around, and a list of the polled rate on the right-hand side (along with an overall average).

screenshot of mouserate window

When I first ran this program with my Microsoft optical Intellimouse plugged into the PS/2 port (via the green USB adapter) I got an average reading of just less than 100Hz. I then tried plugging the mouse directly into a free USB port and got pretty much the same readings so at least I know that the talk of PS/2 mice giving a steadier polling rate must only apply to 'true' PS/2 mice, not USB mice with PS/2 adapters.

Try it out and see what polling rate you get, I would be interested to hear what you have to say.

P.S. Have you noticed in the picture above that my polling rate is a fair bit higher than the 100Hz that I've talked about? More in a future post... ;-)

Technorati Tags: , , ,

Creating a Trac instance on Debian Linux

In a post back in October (has it really been that long?) I walked through how to install Trac on Debian Linux. This post will cover the configuration of Trac so that at the end you will have a running Trac system that you can use as a wiki, ticket manager and Subversion repository browser.

First you need to decide where you want your Trac instance to live, I wanted mine to be accessible via a sub-section of a website, but I wanted the instance to live outside of that website's directory structure. I decided on /var/www/Trac which I would link to from within my other website.

To create the instance run the trac-admin command as the root user like so:
trac-admin /var/www/Trac initenv

It will now ask you a number of questions about your environment and project:
* Project Name - enter a human-readable name for your project, this will appear on emails, webpages, etc.
* Database connection string - just hit return to use the default SQLite
* Path to repository - the directory path to your Subversion repository, note: it cannot be a remote repository with the current version of Trac.
* Templates directory - just hit return to use the default templates directory.

If all went well it should report that the environment was created successfully and will give you instructions on how to quickly test that it's working.

Now that we have created the Trac instance, we need to configure Apache to make the site available to the outside world (or intranet if that's more relevant to you). I've set it up to be accessed via a www.somedomain.com/trac so I added the following stanza to that site's virtual host entry within the /etc/apache2/sites-available directory:

# trac
ScriptAlias /trac "/usr/share/trac/cgi-bin/trac.cgi"
<Location "/trac">
SetEnv TRAC_ENV "/var/www/Trac"
</Location>

# edit trac.ini to change /trac to /trac-static
Alias /trac-static "/usr/share/trac/htdocs"

<Location "/trac">
AuthType Basic
AuthName "Trac"
AuthUserFile /some/path/htpasswd
Require valid-user
</Location>

This sets up /trac to point to the Trac master CGI script, and tells the script that the instance lives in /var/www/Trac. The htpasswd file protects the whole site from unauthorised people, (make sure that the htpasswd file exists and has some users in it otherwise you won't be able to access your Trac instance).

Before you restart Apache to see your new Trac instance you need to ensure that the Trac directory structure is owned by the same user as Apache, in my case www-data. Simply run chown -R www-data:www-data /var/www/Trac to sort this out.

Now restart Apache, (/etc/init.d/apache2 reload) and then goto http://www.yourdomain.com/trac to see Trac in all it's glory.

There are loads of things that you can configure with Trac and general usage instructions are all available within your instance, just click 'Help/Guide' link in the top-right menu bar.

I hope this has been informative, if you have any questions or comments then please don't forget to leave a comment or trackback below!

Technorati Tags: , , , ,