Mar 31 2008

This USB Thumb Drive May Self Destruct

by David Jeffries under Hardware at 9:24 pm

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

by David Jeffries under Misc at 9:08 pm

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

by David Jeffries under Programming at 9:23 pm

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

by David Jeffries under Internet at 12:28 pm

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

by David Jeffries under Hardware at 9:22 pm

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

by David Jeffries under Programming at 3:33 pm

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

Feb 18 2008

Commenting on Google Reader Shared Items

by David Jeffries under Internet at 3:13 am

There needs to be a way to do this, and I'm sure that Google is working on something right now - at least I hope so. It's really annoying not being able to add some commentary to an item that I'm sharing so that people reading it actually understand the reason I shared it.

The same thing happens when I'm reading one of my friends shared items... I always want a way to tell them how I feel about what I just read. Why not just blog about it? I just want a little blurb, like a twitter, where I can quickly say what I'm thinking after I just read it.

If I could think of a feasible way to accomplish this I would write some software to let me do it. The only way I can see just quickly thinking is having a 3rd party site that takes your shared items and adds the abilities I want... Maybe this already exists? Time to do some research.

Update: This is what happens when you don't do pre-post research. From the Google Reader blog:

In the next updates, Google Reader should let you comment on shared items or chat with your online friends about certain posts, separate your shared items with tags and recommend shared items from people that have similar interests with you.

One response so far

Feb 08 2008

Google Geocode Request Limits

by David Jeffries under Programming at 12:22 am

Google maps API is pretty cool, well written piece of software. Everything is pretty much perfect except for one thing. Geocoding. According to the signup page, you can geocode 15,000 addresses per day per API key. Here's the exact text:

There is a limit of 15,000 geocode requests per day per Maps API key. If you go over this 24-hour limit, the Maps API geocoder may stop working for you temporarily. If you continue to abuse this limit, your access to the Maps API geocoder may be blocked permanently.

So anyways, after designing my software to die at 14,500 requests, and then farm it out to a different server with a different API key, I found out that they made a change, and the limit is now 15,000 requests per IP. Well that's nice, but that means that most of the geocoding should be done on the client side. This is great because there's no way a client will ever hit 15 thousand, (at least not in this current project), but bad because it requires a pretty big rewrite of code.

After rewriting my code to do most of the geocoding on the client side I found out that the 15,000 requests per day per API key isn't actually 15k/day. It's more like 625 requests per hour - 10.4 per minute - or 1.7 requests per second. Make any more than that and you get throttled.

From some testing I did I found that you can make about 12 requests in a row before you start to get throttled. More than that and there will be a ~4-5 second delay until you can make another ~12 requests. It's not really nice to do this - so here is my resulting code:

var i=0;
//geoSave holds n addresses that need geocoding
while(i < geoSave.length){
  setTimeout("findAddress('"+geoSave[i]+"',2000*i);
  i++
}
 
function findAddress(address){
  geocoder.getLocations(address, function(response){
    //do stuff with the response
  });
}

So there it is, a simple 2 second delay and the client is able to make unlimited geocode requests.

One response so far

Jan 15 2008

Facebook Advertising Works Fast

by David Jeffries under Internet at 5:30 pm

I decided to finally pursue some other advertising mediums for some of my websites and Facebook immediately came to mind. Facebook just recently allowed anyone to place ads on their site, and target them heavily. You can literally target any interest, demographic, network, anything. I figured I may as well give it a shot, and the nice targeting features should help with the conversions.

FB Works Fast

I created a simple ad in about 2 minutes, and it started running. Within no more than 3 minutes, (I'm not exadurating), I saw the following:
Facebook Advertising

10,000 impressions! I was amazed, this was 3 minutes of advertising and I already had 5 clicks. Within about 10 minutes I had 20 clicks and over 30,000 impressions. Sure, it's not the best CTR, but this was just a quick little test ad. I'm sure with some ad optimization that will get better.

Another thing that makes this even crazier - this was a targeted ad. If I just unleashed it upon all of Facebook, who knows how many impressions/clicks I would get in the first 5 minutes. Crazy.

No responses yet

Jan 13 2008

Not All iPods Full of Illegal Music

by David Jeffries under Hardware at 5:22 pm

iPod CanadaApparently the Canadian courts think so as well. The unofficial apple weblog reports that the levy proposed against iPods - the so called "iPod tax," has been defeated. It's a good thing too, with a $5 to $75 tax on iPods depending on their size, wow, no wonder retailers were pissed.

It wouldn't have worked

If iPods are suddenly $75 more expensive people are just going to turn to one of the many easier and lazier places than a physical store. You've heard of it - the internet. I'm sure Amazon, eBay, and any other online store that sells iPods would be pretty pleases if this tax went though. This is also the reason that the Retail Council of Canada was the biggest opponent of this levy. Retail stores would have lost major revenue.

Even the grandparents who are scared to buy off the internet when buying iPods for their grandkids would be affected. The elderly know when they're not getting a deal - they have a lot of time on their hands. Why buy in Canada when you could take a trip down to the U.S. and get the same thing for much cheaper, without even considering the weak U.S. dollar giving up extra savings.

Bottom line - iPods aren't chock full o' pirated music, and it's a good thing the courts recognize that.

No responses yet

« Prev - Next »