Testing Web Performance by Throttling Bandwidth

In the past, I often found myself wondering how some of my websites would perform when accessed from a low bandwidth connection. Unfortunately, I had no convenient way to test such a scenario, so I usually just forgot about the idea. I recently found myself in a similar scenario at work, and my searches returned a useful tool, Speed Simulator, by Vikas Patial:

Speed simulator is a simple throttling proxy which allows you to see how your site behaves under different connection speeds. It was written by me to test AJAX/Flash loaders and see how much my time took to load. You can simulate various speeds like that of a modem or a ADSL. A pre delay function is also there to help simulate delays due to DNS, connection establishment etc.

Here’s what it looks like:

Screenshot of the Speed Simulator user interface

It simply acts as a proxy, so all you need to do is point your browsers to access the web through Speed Simulator. You’ll then be transported back to the good ol’ days where most people had to wait for websites to load.

To do this:

  1. Click Start, and search for “Internet Options”. Launch it.
  2. Click on the “Connections” tab.
  3. Click the “LAN Settings” button, found within the “Local Area Network (LAN) Settings” section.
  4. Once the “Local Area Network (LAN) Settings” dialog appears, locate the “Proxy Server” section.
  5. Enable the “Use a proxy server for your LAN” checkbox, and enter the following:
  • Address: localhost
  • Port: 8080 (reflect the port listed in Speed Simulator)

Local Area Network (LAN) Settings dialog in Windows, with a proxy server configured.

Press OK to save your changes, and then simply click “Start” in the Speed Simulator window.

That’s it – all you need to do next is launch a browser, the bandwidth should be throttled. I’ve seen it work with Google Chrome and Internet Explorer. Configuring a proxy in Firefox requires different steps, but should work just as well, once configured.

I can see myself using this tool in the future, and not only for simple performance tests. For example, I can use it to test for possible timing-related flaws in JavaScript code. Definitely a welcome addition to my web development tool set.

Introducing All Due Credit

When I write for this blog, I don’t always write a post from start to finish, and publish it immediately. Usually, I have to review it multiple times myself, and in certain cases, I decide I want someone else to take a look at it too. In these cases, I typically send the post to one of my friends first, and I await their feedback. At the end of the day, their input allows me to ensure that my content meets a certain standard of quality. Given the significance of their aid, I felt I needed a way to publically thank them, per post. Faced with that idea, I did what any WordPress user would do – I looked for a suitable plugin within WordPress’s fantastic plugin directory. Normally I find what I need there, but in this particular instance, I couldn’t. So, being a developer, I decided to go ahead and create a plugin to suit my needs.

Meet All Due Credit, the result of this effort. Released with a GPL2 license, All Due Credit allows bloggers to include a list of names along with any post. Each name is accompanied by a text label that reveals what the person’s role was. Additionally, a Gravatar (globally recognized avatar) can be associated along with every name.

Here’s an example that includes all labels:

All Due Credit

In my case, I only really needed “Reviewed by” and “Thanks to”, but I figured I’d take it a little further while I was at it.  Since releasing it, I’ve been actively using it on my blog, so you may notice it appear under certain posts. It is still pretty early in its implementation, but since I was already pleased that it met my requirements, I thought I’d give others the chance to use it as well. To reflect the work ahead, I originally released it as version 0.3, whereas I’m now up to 0.3.6. Once I consider it feature complete and stable, I’ll mark it as 1.0.0… but until then, I’ll be working on adding features and improving whatever it already does.

If you want more information about the plugin, make sure to check the project page on my website. To download it, or see how my work on it has been progressing, see the All Due Credit page in the plugin directory.

How to Restore Underlined Shortcuts in Menus

In a post titled New Folder Shortcut in Windows, I explained how accelerator keys could speed up the process of creating new folders. The key combination that needs to be pressed depends on which letters are underlined in the Windows menu; however, starting with Vista, Microsoft decided to hide these hints, by default. You can still use the key combinations if you know them, but if you don’t, here’s how to make to the underlined letters always visible in Windows 7:

  1. Click Start, and launch the Control Panel.
  2. Click Ease of Access.
  3. Click Change how your keyboard works.
  4. Locate the Make it easier to use keyboard shortcuts section.
  5. Enable the Underline keyboard shortcuts and access keys checkbox.
  6. Click OK.

That’s it. After that change, menus will reveal which characters are accelerator keys by underlining them, just like in older versions of Windows.

The "Underline keyboard shortcuts and access keys" feature in action.

Not Just Another First Person Shooter

In my youth, I took to video games like most adolescent males did – the habit continued into my adult life. As I aged, the time investment gradually decreased, but never disappeared. I played all sorts of games, but seemed to prefer first person shooters and strategy games, above all. Despite my gaming experience, there is one first person shooter that I prefer over all the others. As it turns out, I’m not referring to a video game, but instead… the sport known as Paintball:

Paintball is a sport first played in 1981 in the U.S. state of New Hampshire, in which players compete, in teams or individually, to eliminate opponents by hitting them with capsules containing paint (referred to as paintballs) propelled from a device called a paintball marker. While oil-based paint was originally used, paintballs are actually made of a special non-toxic, biodegradable, water soluble mineral-oil. The game is regularly played at a sporting level with organized competition involving worldwide leagues, tournaments, professional teams, and players. Paintball technology is also used by armies to supplement military training, riot response, and non lethal suppression of dangerous suspects.

Games are played on indoor or outdoor fields of varying sizes. A game field is scattered with natural or artificial terrain, which players use for strategic play. Rules for playing paintball vary, but can include capture the flag, elimination, defending or attacking a particular point or area, or capturing objects of interest hidden in the playing area. Depending on the variant played, games can last from seconds to hours, or even days in scenario play.

I’ve played Paintball a few times in my life, and each time has resulted in valuable memories. You see, there’s nothing quite like experiencing the action in person. Our bodies are fantastic instruments, and this was certainly apparent to me when playing Paintball. Once the round starts, all my senses fired up, my adrenaline began pumping, and everything suddenly slid into focus. The dangers of the battlefield are made pretty obvious, pretty fast, as it does hurt to get shot. Paintball markers fire paintballs at a speed of approximately 200 miles per hour, so you generally do everything you can to avoid being shot. Not only will a popped Paintball eliminate you from the match, but it will hurt too. Not agonizing pain by any means, but bruising is fairly common.

Beyond the bruising, Paintball is a pretty safe sport… and that is key. When I play, it is usually with a group of friends… and while I do enjoy eliminating enemy players from the game, I wouldn’t want them to get seriously hurt from it.  The safety precautions are pretty well designed. To give you an idea: foreign markers are all examined to ensure they meet safety requirements, foreign paintballs are usually rejected in favor of the field’s, and protective gear is worn at all times.

The people working these Paintball fields are very insistent that the safety rules are followed. Sometimes, they even come up with creative punishments for players that disrespect the rules. For example, one place I went to was very strict about players keeping their masks on at all times. There were designated places, called graveyards (where you go when you’re eliminated), where masks could be removed. Graveyards had protective netting all around to ensure no stray paintballs could be fired in. To help govern this rule, they said the third person to take off their mask in an unauthorized location would be “executed”. By that, they meant the entire paintball group would line up, and each would fire one paintball upon the offending individual, at one time. Since paintballs hurt, no one wants to be shot so many times. It was an amusing rule, and I know this for a fact – because I was the third person to violate it.

You see, certain paintball masks have serious issues with fogging. That is, your visibility drops significantly because of breathing, and your overall body heat. This was always an issue for me in the past, so I was usually eager to take off my mask. It would allow the fog to clear, and give me greater visibility for a few minutes. Unfortunately for me, at one point, as we were all gathered with the referee, I really wanted to take off my mask. I looked ahead of me, and saw that another player already took off his mask. Because of this, and my overall lack of visibility at that moment, I thought we must have been at a Graveyard. I took off my mask… and because the referee was looking in my general direction, he noticed me, and announced I was the third. I only knew about one prior violation, so the fact that I was third was a surprise. I laughed at my luck, and quickly gave up my efforts to describe why I took off my mask. I was told to stand at a distance, and every other player lined up and took aim at me. The referee made it clear that only one shot must be taken by all players. Should a player violate this rule, they would executed in turn. Now, given that paintballs bruise, the last place you want to be shot is in the groin. So, naturally, I had the habit of wearing a jockstrap when playing Paintball… and on this day, I was very, very glad. When asked if I was ready, I slid my ammo cannisters to the front of my belt, further protecting my family jewels, and gave my executors a thumbs up. Three seconds later, I was hit with approximately 20 paintballs at one time.  To my surprise, it really wasn’t very painful… it just stung for a moment, and then it passed. I had a friend among the executors, and he assured me afterwards that he did not fire along with the others. I appreciated the gesture, but as I had just discovered, it really wasn’t that bad. Still, definitely an interesting life experience.

Though the the mask penalty was unique, additional rules exist that are far less controversial.  A good example of this would be the “Freeze” rule. It goes like this: if you’re very close to an enemy player, you have the option of telling him to “Freeze”, instead of shooting him point-blank. Given the speed at which paintballs are fired, point blank range would likely hurt more than from a distance (lack of deceleration time). In my case, however, I don’t mind being shot up close – I seem to have a pretty good tolerance to bruising. Still, I respect the Freeze rule when it is active – it offers some strategic benefits as well. Consider the following scenario: if you run out of ammo on the battlefield, you’re normally pretty much finished. You have to leave the field, and wait for the next round. Yet, with the Freeze rule active, you can simply keep playing, and essentially bluff. With or without paintballs, a marker, when fired, will make the usual CO2 firing sound, and smoke will leave the barrel as it normally does. In the chaos of battle, this trick can be helpful in keeping enemy players hidden behind cover. While they’re too afraid to emerge from cover, all you have to do is run up to them, and scream “FREEZE!”. They’ll likely surrender, and thus, you will have managed to eliminate other players without ammunition. I’ve seen this strategy used by many players, though I’m not sure it is legal in professional leagues. I personally really enjoy it, as it represents a realistic challenge, rather than an instant forfeit on your part. It makes me feel like I’m unarmed, and with proper strategy, I can still contribute to the team beyond the usual limits.

I always like tough challenges, both physically, and mentally, and that’s another reason why I’m fond of Paintball. Unlike most first person shooters, Paintball can keep me fit physically, as well as mentally. It represents, to me, the ideal gaming experience… not to mention the best graphics I have ever seen. In the spirit of challenge, I once decided to use a handgun marker for one round. Handgun markers generally have limited ammo, and they use tiny, swappable CO2 tanks. The marker I used supported only 8 paintballs at a time, and the CO2 tank could only power roughly 20 shots. This meant that reloading had to be performed on the field, whenever necessary. Rather than worry about this, I saw my challenge – how far could I get with only 8 paintballs?

My handgun round turned out to be the last of the day, where my team was attacking a building that was fortified by enemy players. Since it was the last round, upon being eliminated, players from both teams could exit the battlefield, and immediately re-enter. The building was therefore a very significant threat; even if you eliminated the occupants, they’d be back in a couple minutes. Armed with a single handgun, I spent most of my time slowly approaching the building, without ever firing a shot. This required a significant amount of  time and strategy, and due to running in between cover, it was very tiring. However, I eventually reached the outer wall of the building. I placed my back to it, and slowly approached the door. I could hear the players inside communicating with each other, aware that an enemy was close. After trying to get a few shots at the occupants, I decided to do something unexpected. I slowly backed away from the building, and bolted through the front door as fast as I could. Immediately in front of me was an enemy player, who screamed at me, “FREEZE!”. Unfortunately for him, my adrenaline-enhanced reaction involved shooting him in the chest immediately, before my brain registered the “Freeze” completely. The enemy player, who was a friend of mine, was rightfully angry that he had been shot. A Freeze is a courtesy, and it essentially equates to a valid shot. Alas, he had been bluffing, and confided in me afterwards that he would have shot me point blank in revenge, but had no ammo left. I assured him that my elimination soon followed, and boy, did it ever. After my initial entrance and subsequent “kill”, I entered another room in the building, where two shocked enemy players blasted me with an excess of paintballs. Despite the fact that I ultimately was destroyed, I had more fun than I’ve had in a while. The fact that I was there in person, experiencing the situation with all my senses, made a world of difference. No longer could a video game satisfy the sensory overload that was Paintball.

Experiencing the game first-hand brings about new possibilities as well. While you could be limited by game world architecture, in Paintball, the boundaries are much more broad. This is perfectly natural, given that games aim to re-created real-world mechanics, whereas Earth already has some clearly-defined.  In both video games and the actual sport, I like that creativity goes unhindered. Here’s an example: at one point, while defending a castle-type structure, I had a significant amount of difficulty seeing through my mask, so much that I stopped caring about the round. If I couldn’t see, what was the point? So, instead of firing at the attackers, I would get them to shoot at me while running back and forth on the castle walls. I would occasionally stop to do a little dance, at which point I noticed more paintballs were being fired. I didn’t do this solely for amusement, though. I had warned nearby teammates to exploit the opportunity to take out the enemies, knowing very well that their attention would be on me.

All that said, I personally feel that Paintball is the best first person shooter… the only problem I see is the price. I usually pay around 125$ every time I go, so it’s not something I’m willing to do on a monthly basis, at least not yet. Buying my own gear could alleviate the costs by removing the rental fees, which are significant. Cost aside, in my mind, the sport simply cannot be defeated by video games. Until, of course, virtual reality is released, with neural connection a la Avatar.

When Gaming Handles Invade Real Life

Having been a gamer since my teenage years, I’m pretty familiar with representing myself in a virtual world. While some games offers customization of an avatar, the most common element is usually a username, also known as a gaming handle. When other players encounter you in this online world, they know you by your handle, not your real-life name. Over the years, I came to realize that my online personna could sometimes find its way into the real world, with undesirable results.

Job interview

The first situation I’m going to describe revolves around the handle. When creating gaming handles, I now know to exercise caution, as the name may be seen in a context that isn’t… appropriate. I have personally experienced this before, and it is both and amusing and troubling tale. At one point in my life, I went in for an internship interview, and when the interviewer arrived, he pulled up the electronic version of my resume on his laptop. I couldn’t see his screen, but after a few moments, he looked up, and said: “ToadLurker?” It took me a couple seconds to realize that yes, I heard correctly. ToadLurker was my gaming handle, but I didn’t understand how it had anything to do with my resume. I confirmed the name as my own, and asked him where he saw it. It seems the file’s properties actually contained the author name, which, by default, seemed to be related to the Windows logon name. This is where I learned a very valuable lesson – despite the gaming, your Windows account should always be based on your real name. Also, the handle should be something that you can show to an employer without being embarrassed. Certainly not something that you’ll want to do, but I feel it to be a good rule of thumb.

Similarly, it is important to resist the temptation of using gaming handles as usernames for non-gaming websites. Recently, as I was using a finance-related website, I realized that I could not remember my username. I had to call their support line, and the agent eventually told me my username: ToadLurker. Registering with that username was obviously a mistake (rarely use it -hence why I couldn’t remember), but it was pretty awkward to hear that on the phone, and have to acknowledge that it was, in fact, your username. You’re also probably wondering what ToadLurker is, and to me, that’s the amusing part. To a random person, it doesn’t sound very good – it almost sounds like ToadLicker, suggesting I like to lick psychoactive toads to get high. Even if they don’t think this, the word “lurker” doesn’t really inspire trust in anyone.

Along the same line, by the way, don’t register on websites using an e-mail address that is too embarrassing to show to a potential employer. I used to live with a guy that had an e-mail called operationpimp@providerhere.com. Just keeping that e-mail address around is a risk to his reputation… what if it accidentally was seen by an employer? I used to have a good laugh imagining what would happen if he actually sent his resumes using that address.

Finally, to put an end to your wondering, I’ll explain how I came to adopt ToadLurker as my gaming handle. It goes back to my earlier gaming years, where I played Starcraft, a real-time strategy game, most of all. I really liked one particular unit, called a Lurker. Lurkers burrowed into the ground, and stayed there, awaiting enemy units. When enemies would walk near burrowed Lurkers, they would be immediately attacked by spines that pierced through the ground. The Lurkers themselves remain burrowed, making them great ambushers. I always liked that concept, so it found a way into my gaming handle.

LAN Party

The Toad portion actually started at SOAD, which is an acronym for System of a Down, a band I listened to at the time. SoadLurker was therefore my first draft, and I kept it for a while. A few years later, I began playing Battlefield 1942 with a clan, regularly. During one of our league matches, a shoutcaster decided to broadcast our match. He was essentially watching the match, and behaving as a regular sports commentator would. After the match, the team got together on an audio chat program, and listened to the shoutcast together. At one point during the match, the shoutcaster noticed me doing something in the game world, and tried to pronounce SoadLurker a few times, with little success. He decided it was too hard to read, so he asked his wife what she thought. Her suggestion was to just call me “Toad”, as it was simpler. Upon hearing that, the team had a good laugh, and I decided that yeah, why not call myself Toad?

That was, of course, a very long time ago. At this point in my life, I’m very supportive of the idea of using real names as gaming handles. They’re much less likely to lead to awkward situations like the ones I have experienced.

Photo credit

First photo by bpsusf.

Second photo by Umberto Salvagnin.

Third photo by Chase N.

A Close Encounter With Accidental Theft

On one particular work day, I decided to go shopping for some groceries with a coworker. It is something we actually do fairly regularly, as we work in the heart of downtown Montreal, where stores are abundant and easily accessible. After visiting a mainstream grocery store, we decided to visit an organic produce shop. Not a random one, mind you – as my mother just-so-happens to work there during the day. Given that the store is so close to where I work, I have a tendency to drop by fairly often. As such, I know the owners and other employees to a degree, and we get along pretty well. They even started giving me a 15% discount on everything I buy, which is essentially the same rebate my mother gets.

Organic grocery store

They’ve always had problems with theft, especially since stores started selling re-usable grocery bags. To counter theft, they have cameras installed throughout the store, and they also ask that customers leave their bags at the front desk when they come in. Usually, when I visit, I don’t bother taking off my backpack. I don’t like having to worry about my belongings, and, naturally, I know I would never steal. It seems they agree with the latter, as they never asked me to leave my bag with them.

So, as I walked into the store on this particular day, I was carrying a re-usable grocery bag, one filled with groceries from another store. Without really thinking about it, I walked in as I usually did, and walked towards the refrigerators, seeking a particular product: Slow Cow. Slow Cow is pretty much the opposite of Red Bull, both in function and in name. It is a product that will help you relax, rather than help you stay active.

Slow Cow

So, once I saw the can, I took it off the shelf, and dropped it into my bag. It took about three seconds for me to realize what I had done. I placed the drink in my bag, amongst other products from another store. It could certainly be interpreted as an attempt at theft. Upon realizing this, I immediately retrieved the can from my bag, and at that precise moment, the owner turned the corner, and greeted me. While still holding the can, I greeted him with enthusiasm, all the while thinking how bad the situation must look. I’m still holding the can, and he appeared at a perfect moment to see me remove it from my bag. It took most of my mental strength to suppress the smile that was forming on my face. It was something I would have expected to see on Seinfeld. Thankfully, the owner seemed to assume nothing was odd, which was exactly the case. Had it been shown on Seinfeld, I suspect a different outcome would have been written. It just all seems so illogical, so ridiculous… why would anyone target such a friendly store, one that is also close to his work and his family? It just suggests a significant lack of analysis and thought, to the point where one would suspect mental instability. Seems like a perfect scene for George

Locating Old Versions of Software Packages

Ever wished you could go back to an old version of a particular application? Often times, as software companies release new versions, they remove the ability to download older versions. They may also choose to drop support for such versions, in the long run. Usually, upgrading software is a good idea: more bugs are fixed, new features are introduced, all of that fun stuff. In some cases, however, features are unexpectedly removed, or there are performance problems that result from the update. In these scenarios, I consider it valid to seek out older versions. Whenever I found myself in these situations in the past, I would search for websites that offered the old version. I didn’t always succeed, particularly because my freestyle approach depended on luck.

About a year ago, I discovered a site that solved the issue, most of the time. Meet FileHippo, a mammal so obsessed with software that it consistently stores away older versions, and keeps them available for download. Here’s the page for Firefox, as an example. The old versions are listed on the right side of the page.

FileHippo page for Firefox. Numerous old versions are listed.

Despite being able to see the old versions on the first page, don’t be deceived. There are actually many more available if you click the “view more” link. In fact, I can even go so far back that I can get Firefox 1.0, or any of the minor releases that followed it. As if that wasn’t enough, they also seem to store technical information, as well as the change logs for most old versions they keep.

Identifying a Font from an Image

Ever looked at a logo, and wondered what font the designer used? From an image alone, identifying the specific font can be difficult, particularly if it isn’t among those commonly seen on the web. Thankfully, a web service titled “WhatTheFont” facilitates this very scenario, while also allowing users to buy the font, once identified.

The WhatTheFont web service allows users to identify the font used in an image.

Below are screenshots revealing how to use the service, with the Google logo uploaded as an example.

The Google logo as seen within WhatTheFont.

As the above image illustrates, the service is pretty good at identifying characters, but it isn’t perfect. It asks the user to identify specific letters, eliminating the risk of false assumptions. Once the user validation step is done, the search results are shown.

Google logo search results within WhatTheFont.

Clicking on any of the search results will bring up  a page dedicated to the font, where purchasing options are available. So, much like my previous post about reverse image lookups , this is an impressive website, both visually, and functionally. I recommend you try it out, especially if you’re into web development.

Searching With Images

All over the web, countless images can be seen. For the longest time, I took the presence of images for granted. That is, until I found an image I really liked, to the point where I wanted to know where it originated. My intention was to seek out additional images from the same photographer. Alas, I soon discovered that finding an image based solely on the visual content isn’t very straightforward. Back then, I was unable to find the source.

To simulate the problem I had, consider this image:

If I didn’t link to the photographer’s page, or even mention his name, how would you know where the image came from? Sure, the filename can be a hint, but it may have been modified. After all, the image you’re seeing is hosted on my server, not by a third party. So, aside from the filename, you could try searching for the image by describing it with words. Hopefully someone added proper keywords somewhere, and you may be able to find it with that. While those two methods could work, they really aren’t reliable.

Thankfully, I found something that will greatly complement the above two techniques: A reverse image lookup search engine. That’s right, give it a photo, and it tells you where it is being used. The service is called TinEye, created by Idée Inc.

In their own words:

TinEye is a reverse image search engine. You can submit an image to TinEye to find out where it came from, how it is being used, if modified versions of the image exist, or to find higher resolution versions.

TinEye is the first image search engine on the web to use image identification technology rather than keywords, metadata or watermarks. It is free to use for non-commercial searching.

source: their About page.

As a demonstration, here’s what the first search results look like when I search for the above image.

Search results when searching with the above image.

As you can see, it already pointed me to a few domains… and there are more where that came from: 37 total. As it turns out, the first result points exactly to where I got the image, from the photographer’s Flickr page. Nice.

With the Flickr page in hand, an idea struck me. What if I fed TinEye the Flickr page URL, would it know how to find the image?

The answer is yes. It actually presented me with thumbnails of images it found on the page, and asked me to choose which I wanted to search with. No need to give it a direct path to an image, it’s smarter than that. I have to say, I’m impressed. Clean interface, simple controls, and flexible input – and all I did was try their most basic functionality. Definitely a company to keep my eye on.

The Polite Upgrade Notice

When I went to use Google Chrome yesterday, I noticed the following AdBlock plugin notice:

AdBlock is getting an upgrade

After reading it, I realized it was one of the most polite notices I’d ever read. It also had a sense a humor that I usually only expected to see in Google-authored pages and applications. Good job, Michael, and everyone else at AdBlock.

NOTE: As a web developer, I am very hesitant to use ad blockers, as ads are an important source of income for website owners. I usually only enable them when I reach a site that I feel is completely obnoxious with their placement and overall use of ads.