Track Your rel=canonical URL With Google Analytics

I have been putting some (but very little) effort in to getting my pages tagged with rel=canonical and I have noticed that some of the time I was getting 1+ pageviews with a different page name that were actually for the same page in Google Analytics. So I decided that a little javascript to grab my rel="canonical" and dump that in to pageTracker._trackPageview(); would be nice.

[More]

Regular Expression to Determine if a Base 10 Number is Divisible by 5

This regular expression is a really easy one to write, but it will highlight that when writing regular expressions, it is sometimes easier to skip writing the DFA; which provided to be a useful step when I created a regular expression to determine if a base 10 number is divisible by 3.

The Problem:

Let L = { w | w mod 5 = 0 }, where the alphabet is {0,1,2,3,4,5,6,7,8,9}; give the DFA for L, and convert this in to a regular expression.

 

The Solution:

[More]

Regular Expression to determine if a base 10 number is divisible by 3

I decided to work out the regular expression for matching mod3=0 positive decimal (base 10) integers today. I had a dream about the problem last night (remembering an old lecture) and could not find my notes with the solution (if I even wrote it down). So, after googling around for a bit, I gave up, and worked the solution out myself, because it looks like a good void to fill on the interwebs.

The Problem:

Let L = { w | w mod 3 = 0 }, where the alphabet is {0,1,2,3,4,5,6,7,8,9}; give the Deterministic Finite Automaton (DFA) for L, and convert this to a regular expression.

 

The Solution (don't peak):

[More]

© Erik Vold 2007-2010. Contact Erik Vold. Top ^