Google Refresh? Whiny SEO Geeks Say Yes.

According to Web Analytics World, Search Engine Roundtable, and WebmasterWorld, Google is going through another data refresh.

Yes, this means that all of the SEO geeks will start whining as Google finally catches up to them and starts dropping the rankings for their mostly worthless sites.

I’m of the firm belief that all of these SEO tactics are a waste of time. Everybody thinks that they can make a quick dollar by using the latest tactics and methods to gain search engine position. What ever happened to quality? What happens when Google catches up to you and deranks your site?

We’ll use Tech-Recipes for an example - The site has been around for over 3 years now, and has over 1800 recipes. Because of the dedication to useful, quality content, now the site has grown to the point where it’s one of the premier tech help websites on the net.

Quality content over time is the only answer. Fame and fortune follow success, not the other way around.

Expand Those Tiny Comment Boxes!

If you are a lifehacker reader, you’ve probably already seen this, but it’s one of those most useful things I’ve found online in a very long time.

Essentially, you make a special bookmarklet that lets you resize any textbox with a single click. 

Here’s a typical textbox on a comments form. They are never big enough… what’s up with that?

Just click the icon, and resize the textbox:

You can get the bookmarklet here.

Use Google Reader to Keep Track of Comments

I just came up with a new idea for using the wonderful tagging feature in Google Reader: Use it to keep track of blog posts I’ve left comments on.

I try to leave comments on any blog post that I think is worthwhile, mostly to give feedback to the author, and also because I sometimes have an honest question. The problem is with 250 feeds and leaving tons of comments every day, I can never remember which blog post I left a comment that I wanted to follow up on.

This is where the tagging support in Google Reader makes me giddy with happiness. Let’s say I’m reading a post by David on the New Zero-Day Mac OS X Flaw.  Now I know that my buddy Quinn worships at the altar of Apple, so I leave a comment just to see what response he’s going to give, and then I tag the post with “Commented” by hitting the “t” key and typing in the tag:

Now when I want to check a few days later on who has responded to my comment, I just hit the gt key combination to bring up the tags dialog:

I hit enter, and then I’m viewing the list of items that I’ve commented on, like so:

So now I can quickly follow up…   I guess Q is still sick, he hasn’t responded yet!

Alternatively, I could have subscribed to the comments feed on the article… but that becomes a royal pain to manage…. over a few weeks you end up with hundreds of subscriptions to particular blog posts that you don’t really need.

Thanksgiving for the Digg, it made my Lifehacking day

Thanksgiving was great this year… along with the obligation and gluttony, my post on Google Reader Tips and Tricks got featured both on Digg and Lifehacker. I was completed stuffed with turkey and traffic.

For only my second post since moving to Tech-Recipes, I’m extremely flattered, and would like to say thanks to everybody who voted for the article =)

I’m going to contine to post roundup articles on useful tips and tricks, so stay tuned for more good stuff.

 

full disclosure: I’m a vegetarian, I didn’t really eat turkey. =P

7 Google Reader Tips and Tricks

I love Google Reader. The end.

I switched from Bloglines to Google Reader a few weeks ago, and my life has forever changed for the better. Here’s the list of tips and tricks from what I’ve discovered so far.

  1. Use the bookmarklet With the Google Reader iconWhen you save the bookmarklet to your bookmark bar, it doesn’t by default have an icon, because the source url is javascript. There’s a simple workaround:
    1. Save a bookmark to Google Reader homepage.
    2. Click the bookmark once to make Firefox load the icon
    3. Edit the bookmark, and copy/paste the javascript from the Location field in the bookmarklet into the new bookmark.
    4. You can also change the Name of the bookmarklet to something else to indicate that it is a bookmarklet. For instance, I use the + symbol as the Name so that I can tell the difference between the regular bookmark and the bookmarklet:
  2. Install the GreaseMonkey Extension for firefox.This is critical… GreaseMonkey is an awesome extension for Firefox, and is required for the next item:
  3. Install the GreaseMonkey Smart Subscribe scriptThe Smart Google Reader Subscribe script will tell you if the page you are on has already been added to your subscriptions. This is invaluable if you already have 250 subscriptions and can barely remember if you’ve subscribed to the page you are reading.The script will also let you subscribe to any feeds that are listed in the meta tags on the page, which is the mechanism that allows the browser to detect the feeds.When you go to a web page that has an RSS feed, you will see this icon in the upper right hand corner of the Firefox window:

    If you hover your mouse over the icon, you’ll see the list of feeds that page offers. My blog only offers the main feed by default, so you’ll see this:

    But if you’ve already subscribed to a feed, you will see this icon instead, with a check mark over it:

    This is really useful as you start adding more and more feeds to your collection.

  4. Learn to use the Shortcut Keys.Navigating using the shortcut keys makes things so much simpler. Here’s a list of the easiest keys to remember, and the ones I use most:
    1. ga - Go to all items view.
    2. gs - Go to Starred Items.
    3. gu - Open up Ajax’y dialog to quickly select a particular feed.
    4. gt - Open up Ajax’y dialog to quickly select a tag
    5. s - Star an item
    6. n - Navigate to next item without opening it
    7. p - Navigate to previous item without opening it
    8. j - Open next item
    9. k - Open previous item
    10. o - Open / Close item
    11. r - Refresh. (I think I’ve worn out this key)
    12. t - Pop up dialog box letting you assign a tag to an item. Very cool.
    13. Shift+A - Mark all as read.
  5. Start Tagging Items For Later

    Let’s say you are reading a post, and realize that it would make a great blog topic, but you don’t have the time right then to mess with it. Hit the t key, and pop in “toblog” into the textbox to save the item for later.Later on that day, it’s time to start blogging. Simply hit the “gt” key combination, and up pops a great little Ajax’y goodness dialog that lets you easily select the tag you are looking for:This is most useful if you want to be able to tag a lot of items that you don’t necessarily need to read for a while. You could also use the Starred Items feature, but I tend to use that for things I actually am planning on reading thoroughly later.
  6. Share Items With FriendsGoogle reader lets you mark items to share with your friends. You get your own custom URL and your own RSS feed of shared items.To start sharing items, just click the Share link at the bottom of the item, or hit the Shift+s key combination:

    If you go to your Shared items folder, Google will give you your own custom web URL and RSS feed for these items. You can then share that with your friends.

  7. Share Items With Your Blog Readers

    The sharing feature goes one step further… Google lets you copy and paste some javascript code into your page, and presto! Your shared items show up on your blog or web page. You can find this feature on the “Shared Items” page in Reader.Since I just moved over to this new blog, I’ll just show you a screenshot of how this looks, instead of a live demo. (still have to get things in order here)

    There’s a bunch of color schemes you can choose from, so don’t worry about the drab colors…

I’m Joining Tech-Recipes!

I’ve been a small contributer to Tech-Recipes for a little while now, but now I’ve decided to become more of a part of the community by blogging here too.

I’ll be the guy writing recipes about Subversion, Ubuntu, Ruby on Rails, and well… anything I feel like =)

.NET LineCount Command-Line Utility

Half of my day at work was spent trying to locate a bug in a 1,996 line source file… which got me thinking… Just how many lines of code are in this application anyway?

Turns out there are 214649 lines of code, which is 4769 pages worth of code at my editor setting of 45 lines of code per page. That’s just far too much code! Since there’s no built-in functionality to count the lines of code in a project, I decided that it was time to write a command-line utility that I could reuse.

This was much simpler than I thought it would be, with a short recursive function that first loops through the directories, and then through the files in each folder.

First, we loop through the directories inside the current folder and call our function recursively:

foreach(DirectoryInfo subdir in theDirectory.GetDirectories())
{
	count += GetLineCount(subdir);
}

Then we loop through an array of file types, because we don’t want to just read any file, as we might get a binary file or something else unusable:

foreach(string filetype in new string[]{ “*.cs“,”*.aspx“, “*.ascx“,”*.xml“,”*.asax“,”*.config“,”*.js“})
{

Now we get to the actual line counting code:

FileInfo[] files = theDirectory.GetFiles(filetype);
foreach(FileInfo thefile in files)
{
	StreamReader sr = File.OpenText(thefile.FullName);
	while(sr.ReadLine()!=null)
	{
		count++;
	}
}

Here, we are just using a loop around the ReadLine() function, even though we aren’t processing any of the data, we can increment the counter.

 To call this function, you would use something like this to pass in the initial directory. You could also modify it to accept the directory on the commandline, but that seemed like overkill for what I wanted it for.

int count = GetLineCount(new DirectoryInfo(Directory.GetCurrentDirectory()));

And this is the source listing for the function:

/// <summary>
/// Recursive function to get the number of lines of code
/// </summary>
/// <param name=”theDirectory”></param>
/// <returns></returns>
public int GetLineCount(DirectoryInfo theDirectory)
{
	// Set the initial count to zero
	int count = 0;

	// Loop through the subdirectories and run this function recursively
	foreach(DirectoryInfo subdir in theDirectory.GetDirectories())
	{
		count += GetLineCount(subdir);
	}
	// Loop through each file type we are checking
	foreach(string filetype in new string[]{ “*.cs“,”*.aspx“, “*.ascx“,”*.asax“,”*.xml“,”*.config“,”*.js“})
	{
		// Get the list of each file of the particular file type
		FileInfo[] files = theDirectory.GetFiles(filetype);
		foreach(FileInfo thefile in files)
		{
			// Open the file, figure out how many lines there are and update the count
			StreamReader sr = File.OpenText(thefile.FullName);
			while(sr.ReadLine()!=null)
			{
				count++;
			}
		}
	}
	return count;
}

 

You can download the utility here. Running the utility in any folder will count the lines of code for that folder and folders beneath it.

LineCount 0.1 Command-Line Utility 

LineCount 0.1 Source

Debate on Social Bookmarking; Removal of Bling

Over the last week or so, there’s been a debate about all of the “Digg This” and “Furl that” type of links that have started showing up on everybody’s blogs everywhere on the planet. The premise of the argument is that nobody uses them, and they are just cluttering up the place.

Let’s be honest… if somebody is a dedicated del.icio.us user, they will already have the browser plugin or bookmarklet already installed. If they aren’t, then even if they click on the icon, they probably aren’t going to sign up for an account just to bookmark your article.

Another issue is that most of the “digg this” links point to the digg submission page, not to the vote page. This is more likely to create duplicates on digg than get your vote count up. There’s only a 24 hour window in which to hit the front page to begin with, so for hours 25 through infinity, there’s a pointless digg link taking up space.

The only one that works, and only for that 24 hour window, is the digg count plugins that show the little digg box and let you vote directly from the article. But I haven’t found a mechanism that works well enough with a WP-Cache site to install a plugin, and I haven’t had the time to make one myself. And of course there’s the fact that submitting a link to digg is a lot like buying a lottery ticket, unless you are in the “inside crowd”.

I’ve decided to officially voice my opinion on the matter by removing the icons from my site.

Windows Live Writer Error: blogger.getUsersBlogs method received from the weblog server was invalid

This was really irritating me today. I set up a new Wordpress installation (more on that another day), tweaked it up a little bit, and then couldn’t get it working with Windows Live Writer, which is my blogging tool at the moment. (It really is one of the better Microsoft products).

So I go through the add new blog wizard, and then I get this obnoxious error:

So irritating! Naturally I googled, and came across a solution. All I had to do was add these lines to my .htaccess file:

<Files xmlrpc.php>
SecFilterInheritance Off
</Files>

But that didn’t solve the problem. It actually made it worse…. now I was getting an apache error even getting to the blog page through a browser.

After doing some Http proxy snooping using Fiddler, I figured out that the error was this:

Warning: Cannot modify header information - headers already sent by (output started at /home/testdomain.com/html/wp-content/plugins/recent-posts.php:2)

Ah! Now we are getting somewhere. When I opened up the offending plugin file, I found blank lines at the top and bottom before the <? , which is what caused the whole problem… the xmlrpc.php in Wordpress couldn’t change the headers because the blank lines had already been sent down to the client. This then caused the XML to be invalid, which gave me that error.

What’s With the Ubuntu Version Number Scheme?

I recently read that Ubuntu 7.04 “Fiesty Fawn” has been announced for release in 2007, and it got me thinking… what is the deal with the version numbers Ubuntu has gone through? For some background, here’s the list:

  • 4.10 Warty Warthog
  • 5.04 Hoary Hedgehog
  • 5.10 Breezy Badger
  • 6.06 Dapper Drake
  • 6.10 Edgy Eft
  • 7.04 Fiesty Fawn (planned)

I already knew that Ubuntu has weird animal names for their development releases, but the numbering scheme was a little strange to me. A quick pop over to the Ubuntu FAQ page showed this:

 

Ahhh, that makes so much more sense now. So 6.10 was released on 06/2006, and that’s the reason for the number scheme.