Archive for March, 2008

Mar 31 2008

April Fools 2008 Around The Net

Published by David Jeffries under Internet

Well, it's April fools time again. Most of these are pretty funny, some are lame - but anyways here is my list of the main April fools jokes from around the internet:

  • YouTube - All front page videos redirecting to rickrolls.
  • TechCrunch - Suing Facebook for $25 Million
  • CenterNetworks - Robert Scoble starts Ice Cream Library TV
  • JohnChow - John gets his own soft drink. "The official blogger drink"
  • Google Austrailia - Searching internet content before it is created, or "future search" (I found this one to be *too* unbelievable)
  • Gmail - Gmail custom time. Send emails to the past. (Google LOVES time-based jokes)
  • Google & Virgin - A collaborative effort to establish a human colony on Mars.
  • The Pirate Bay - Copyright law changes force servers to be moved to the Egyptian desert
  • ProBlogger - A pay-per-twitter service.
  • CollegeHumor - Purchased by a MySpace teens parents, redirects to "her" profile.
  • ShoeMoney - Make 1,000.00 in 1 hour
  • Aviary - Photo editing time machine - magically transform photos to the past or future! (YouTube vid)

I think the TechCrunch one had me going for the longest, it was pretty well done. Aviary also gets mad props for putting so much time into a pretty funny YouTube video, plus almost every major blogging outlet wrote about it (even though they all knew it was a joke, it definitely got major free press).

If you know of anymore that aren't on this list let me know in the comments.

6 responses so far

Mar 31 2008

This USB Thumb Drive May Self Destruct

Published by David Jeffries under Hardware

This is easily the coolest USB thumb drive ever created. The Ironkey was developed for the US military so their soldiers able to have secure file storage. It comes in 1, 2, and 4GB for $79, $109, and $149, respectively.

Amazing Security

All the drives data are encrypted and 100% unreadable without the correct password. The password is nearly impossible to get too - from the description:

First locally encrypted with 256-bit AES, using randomly generated keys encrypted with a SHA-256 hash of your device password. All of this data is then doubly encrypted with 128-bit AES hardware encryption.

Good luck breaking into that. By the way, you can't even brute force attack it. 10 incorrect password attempts and the encryption chip self-destructs making all data unrecoverable. Facing a physical attack? no way. You cant open the thing without epoxy going everywhere inside the thing wrecking the entire thumb drive again, making everything unrecoverable. Even if the attacker has an scanning electron microscope they will not be able to get in. The thumb drive is electron shielded, so it's pretty much secure.

Secure Firefox

Not only does it have crazy advanced 007 style security, it has what every person needs to hide their tracks effectively, a secure copy of Firefox. Firefox is a very popular web browser, and with good reason - it's amazing. The Firefox on the thumb drive creates a secure VPN tunnel to Ironkey's secure sessions service which all your traffic will go through. By going through this encrypted tunnel, it would be impossible to retrieve any information from the browsing session making it probably the best way to keep your secrets hidden.

Good Enough For War

The sales page says that the Ironkey has seen active duty in Afghanistan. If it's good enough for war, I guess it's good enough for me. Even though I don't do anything important enough to hide... I think I'm going to pick up a 1GB.

No responses yet

Mar 31 2008

Using DoFollow to Increase Blog Comments

Published by David Jeffries under Misc

DoFollow, if you haven't heard of it, is a WordPress plugin that removes the rel="nofollow" from comments on your blog. The rel="nofollow" is placed there because with it, Google does not give any weight to the link. Before nofollow was introduced, spammers would go around to blogs and post comments with their name as the keyword they want to rank for, and the website they run. So with nofollow enabled on most popular blog platforms by default, the incentive to spam comments is not there.

Some people, however, choose to remove the nofollow from comment links, and this is why dofollow was created - to reward people for commenting. My personal feelings are that if your good enough to have a backlink then I will write about you in a post. I don't want to have to fend off all the spammers and people just posting for a measly backlink.

DoFollow Blog Lists

And yes, spamming and DoFollow go hand in hand. There are many DoFollow blog lists out there that highlight the blogs subject for people to get targeted links back to their sites. In fact, even after posting this blog post with the words "DoFollow" in the title my blog will be flagged and there will be an increase in blog comments.

So basically, if you want increased comments just blog about DoFollow - you don't actually need to enable the plugin, the comments will still come.

One response so far

Mar 30 2008

Firefox textbox blinking problem

Published by David Jeffries under Programming

Today I encountered a weird bug in Firefox where the cursor was not showing up and blinking in a text box that I had on the web page I was working on. This was really annoying because it was hard to tell which text box was focused on and which one was being typed into.

It turns out that the problem was with a text box inside a div that had its position style attribute set to absolute. After playing around I found out that wrapping the text box in a div and setting the overflow: auto, fixed the problem. Actually searching for and reading the official Firefox bug report also confirmed that this was the way to fix it.

FireFox bug:

<div style="position:absolute;">
  <input type="text">
</div>
<!-- this will cause the cursor to not show up and blink-->

Fixing the bug:

<div style="position:absolute;">
  <div style="overflow:auto;">
    <input type="text">
  </div>
</div>
<!-- this will show the cursor blinking in the textbox -->

Hope that saves you some time!

2 responses so far

Mar 30 2008

How To View Experts Exchange Solutions Without A Subscription

Published by David Jeffries under Internet

Experts exchange is a great resource with a couple annoying traits.

  1. It always ranks high when I'm googling my latest programming problem
  2. $99.95 / year subscription
  3. The solutions are always blurred out, despite the fact they the real solutions are indexed by google

This pissed me off. What they are doing is called cloaking, which is against Google's rules. Cloaking is serving one page to Google, and then different content to regular users. Google removes websites from their index that do this, as Matt Cutts states in his blog.

There are 2 solutions for this problem.

The first solution takes advantage of EE's attempts to not get banned from Google. They actually show the answers on the page only really, really far down. If you find a question and all the answers are blurred out, just scroll past all the blurred out answers, and then past the big "Experts Exchange Zones" block, to see the un-blurred answers. Try it out here. Remember to keep scrolling! The only problem with this is the page usually throws a cookie onto your machine that will hide the solutions on other EE pages. This leads us to solution 2.

Solution 2 fights fire with fire. By making EE think that we are the googlebot going in and looking at the pages, all the solutions will be fully shown to us. First, we start by changing the user-agent (the thing that identifies our browser). In Firefox, type about:config in the address bar.

You wil be presented with a bunch of preferences, their status, types, and values. In this window, right click and select new -> string and enter "general.useragent.override" with no quotesnew preference

Click ok, and you will get another textbox. In this textbox enter "Googlebot/2.1 (+http://www.googlebot.com/bot.html)" and click ok.

Congrats, you are now Googlebot! One final thing to do is to either turn off cookies (tools -> options -> privacy) and uncheck "accept cookies from sites" or click exceptions and deny all cookies from "experts-exchange.com" This will not allow EE to place a cookie on your computer so you can always view the solutions. You will now have unrestricted access to Experts-Exchange and all the solutions.

3 responses so far

Mar 29 2008

22″ LG L226WTX Widescreen LCD Monitor Review

Published by David Jeffries under Hardware

The other day I purchased a 22" LG L22WTX Widescreen LCD from NCIX. I decided to go with LG as my father has one (19"), and the university I go to uses nothing but LG LCD's monitors. My dad was happy with his, I like what I use at school, so LG was my choice. The price was fairly good, it was $289.99CAD before tax so I decided to go with it.

The Features

  • 1680x1050 Native Resolution
  • 3000:1 Dynamic Contrast Ratio
  • 5ms Ultra-Fast Response Time
  • F-Engine
  • DVI Input with HDCP
  • Intelligent Auto Resolution
  • eZ Zooming

This monitor has everything I wanted. The things I were looking for were specifically, 3000:1 contrast, DVI, and 5ms response time. A feature that is not really advertised about this monitor is the swivel bottom. I really like this as it allows me to easily turn my monitor to show the person beside me some code or whatever I'm working on. F-Engine? Don't know what that is, but having it can't hurt.

Why This One

In addition to the features and reasons I mentioned above, this monitor just worked out to be the best. A 20" LCD doesn't have the same price:size ratio. That is, it is something like a $30 difference to gain 2" - well worth it. A 24" LCD on the other hand, is ~$740, which makes it a $430 difference to gain 2 more inches. I would much rather have two 22" monitors for less than one 24"... who wouldn't? 44 inches of monitor for $620 vs. 24 inches of monitor for $740? The answer is simple, two 22" monitors is the most intelligent choice.

LG L226WTX from the front

My Setup

The only problem with this monitor is it does not come with a DVI cable. It has a DVI port, but no cable so it's off to eBay for me. For now, I have it connected via VGA. Because I use my MacBook Pro primarily, I switch this monitor back and forth between it and my desktop as needed. To do this, I have to convert the DVI output on my laptop to VGA with the supplied Apple adapter.

Productivity

If you are not using at least a 19" widescreen monitor, you are not maximizing your productivity on your computer. With this LCD I can work longer, have more windows, and keep my computer organized while I do my thing. The next big thing that I buy, you guessed it - another 22" monitor. My personal throughput when programming, surfing the web, or even blogging must go up by at least 33% with a big monitor, and I'm sure that there is already research on this subject.

22" monitor compared to 15" MacBook Pro

No responses yet

Mar 09 2008

The Singleton is My Favourite Design Pattern

Published by David Jeffries under Programming

I find it amazing the number of people that have studied computer science who do not know what the singleton design pattern is. It's so important when designing software I don't think I could create efficient code without it.

What it is

A singleton is a design pattern that forces the creation of only one instance of a class. That is, once a class has been instantiated, the running instance is referenced, not a new one.

How it works

The singleton is one of the rare times a private constructor is used. The reason for this is mentioned above, we only want one instance of the object so we don't allow access to the constructor. Instead, we will use a public static method to get the instance. I'll give the code here in PHP, it's actually quite simple.

Implementation

<?php
class MyClass {
 
  private static $instance;
 
  private function __construct(){
  }
 
  public static function getInstance(){
    if(self::$instance == null){
      self::$instance = new self;
    }
    return self::$instance;
  }
 
  public function method1(){
    //do some stuff
  }
 
  public function method2(){
    //do some more stuff
  }
}
?>

That is a full singleton implementation in PHP. Now, when you want to get the current object, it would look something like this:

<?php
$obj = MyClass::getInstance();
 
$obj->method1();
?>

The whole thing is very simple. All getInstance() does is creates a new instance of its own class if the variable $instance is null (meaning the class has not been instantiated yet), and if $instance is not null, it is just returned (we do not want to create another one!).

Why I love it

I've seen PHP scripts that totally do not know how to deal with database classes. Either they open and close connections as needed, or open connections when they're not needed and leave them open throughout the pages execution. Both are, in my opinion, not correct.

A database class should never have more than one instance of itself open. Only one instance (one connection) to the database should be made which ensures a minimal number of connections. You can see how implementing a singleton design pattern into a database class can be very beneficial.

You can see an example at the projects area that demonstrates the singleton with a database.

No responses yet