Using Google Adsense With BlogEngine.NET 2.0

by Rob 10. June 2011 21:30

If you've used BlogEngine in the past; you might be familar with the AdSense widget or the Literal widget....but they don't seem to work in 2.0!  So, how do you get your Google Adsense Ads into your site?

First, log in and go to your home page.  Look for the 'widget' dropdown on the right-hand side of the page.

Select 'Textbox' and click the 'Add' button.  You should see a new TextBox Widget Appear.  Click 'Edit'

You should see something that looks like this.  Unclick 'Show title'.

DO NOT paste your adsense code into the textbox.  It won't work!  The TextBox widget will escape important characters.  Just type the word 'TEST' and hit save.

Now browse to your webserver and enter the 'App_Data/datastore/widgets/' folder.  Locate a .xml file with a timestamp of a few seconds go.  Download it and open it.  

Take the Javascript from Google's Adsense page (it should look like this)

<script type="text/javascript"><!--
google_ad_client = "ca-pub-2052174281835744";
/* Blog - Side Bar Small */
google_ad_slot = "3419877836";
google_ad_width = 250;
google_ad_height = 250;
<script type="text/javascript"

And replace all of the < with &lt; replace all of the > with &gt; and replace all of the " with &quote; - then remove the endlines.  Paste this line into the value field.


<?xml version="1.0" encoding="utf-8"?>
    <DictionaryEntry Key="content" Value="<script type="text/javascript"><!--google_ad_client = "ca-pub-2052174281835744";/* Blog - Side Bar Small */google_ad_slot = "3419877836";google_ad_width = 250;google_ad_height = 250;//--></script><script type="text/javascript"src=""></script>" />


Hit save and upload to the server.  Now, visit your site....TaDa!  It's not as easy as the old AdSense widget or the old Literal widget; but it gets the job done.  


The End Of (Your) Spam....

by Rob 5. June 2011 13:29

In the grand scheme of things, spam is probably low on your list of daily concerns.  But you are probably sick and tired of it.  Where does it come from?  And how did they get your e-mail address in the first place?  Why isn't there a simple solution to spam....

Presenting:  Rob Paulson's Spam Solution!

Relax.  I'm not selling anything.  But, if you are willing to pay the trivial $10 dollars or so each year to register a domain name - not only can you avoid spam completely, you'll also be able to track down exactly who sold you out.  Which company you did legitamate business with decided to sell your e-mail to spammers.  Which company was too lazy to protect their data that is now in the hands of spammers and phishers!

And it's pretty easy....

Step #1 - Register a Domain Name. 

Step #2 - Configure Google Apps to Work With Your Domain 

Step #3 - Setup Filters In Gmail

Got it?  That's it!  

Let me walk you through it.  See, once you have your domain name (like you don't have one e-mail address.  You have a near infinate number of email addresses.  Any single combination of valid characters is an e-mail address.  All of them.  And now you have an infalible way of sorting incoming messages!

Now, you use a different e-mail address for each site or company you do business with.

If you order from - you give them the email address ''
If you order pizza from - you give them the email address ''

Every single thing you do, you give it a different e-mail address.

And, when the spam comes in - you know EXACTLY which company sold you out!  Not only can you voice your objection to their policies, you can add ONE RULE that will automatically delete anything sent to that ONE e-mail address.  All of your other email continues to be received as expect.

Problem solved.  Everyone you do business with gets a unique email address that gets forwarded to the one account you check (but don't distribute) and that clearly indicates who they are.  If you ever do get spam sent to one of those e-mail addresses, you create a rule that deletes everything sent to that e-mail.  Everything else continues to work.  Plus, who doesn't want a domain name?  

At least, problem solved so long as a minority of internet users take this approach.  For the time being, I'm not concerned.  You'll get a few random emails to common addresses like '' that you'll quickly create filters to handle.

You'll also get the added benefit of having additional control over your e-mail experience.  If you use Gmail or Hotmail for all your email needs and, tomorrow, they make a change you don't agree can either go along with it, or you can give up your e-mail address.  It took legislation to seperate your phone number from your cell phone provider; but there is nothing like that for e-mail.  If you own your domain name, you can point it to any mail server you want to do business with.  


Sudoku Game

by Rob 16. May 2011 20:05

There's no shortage of Sudoku games, tutorials, and even source code, online....but I had a slow weekend and figured I'd take a stab at it.  One of these days, I'll rewrite it in F#.  Anyway - here's the core of it:

    Public Sub Solve()
        While SetObviousValues()            
        End While

        If IsSolved Then
            Exit Sub
        End If

        Dim BestPoint As Point = GetLowestPossibleValuePoint()

        If BestPoint.X <> -1 Then
            Dim GuessVals() As Integer = GetPossibleValues(BestPoint.X, BestPoint.Y)

            If GuessVals.Count <> 0 Then
                For i As Integer = 0 To GuessVals.Count - 1                    
                    Dim newNumbers(,) As Integer = _Numbers.Clone
                    newNumbers(BestPoint.X, BestPoint.Y) = GuessVals(i)
                    Dim newGrid As New Grid(newNumbers)

            End If
        End If

    End Sub

This will find all possible solutions to a given puzzle.  Here's how'd you use it (as a console application)...

        Dim StartVal(,) As Integer = { _
                                    {0, 0, 0, 0, 0, 0, 0, 7, 6}, _
                                    {0, 0, 0, 0, 7, 8, 0, 0, 2}, _
                                    {8, 0, 0, 0, 4, 2, 3, 0, 0}, _
                                    {1, 0, 9, 0, 0, 0, 0, 0, 0}, _
                                    {0, 2, 0, 7, 8, 9, 0, 4, 0}, _
                                    {0, 0, 0, 0, 0, 0, 9, 0, 5}, _
                                    {0, 0, 2, 8, 6, 0, 0, 0, 7}, _
                                    {7, 0, 0, 2, 1, 0, 0, 0, 0}, _
                                    {4, 5, 0, 0, 0, 0, 0, 0, 0}}

        Dim myGrid As New Grid(StartVal)


The source is available here.  

Or, you can play the online version here


Why I Don't Like

by Rob 11. May 2011 08:12

I love the concept of StackOverflow.....a super Q&A site, moderated by the users themselves.  Everything is searchable, taggable, editable.  From time to time, I'd search a question on Google and find myself at quickly getting an answer.  What's not to love?

That is, until I started actively contributing to it.  

Let's face it, programming languages, frameworks, best practices and the like change much more slowly than it takes for someone to ask a great question about those changes.  The good questions are already asked.  So, what's left?  High school and college kids pasting homework questions into SO, lazy programmers asking a question directly rather than taking 30 seconds to search for it, lazy programmers asking for someone else to debug their code, and SO users intentionally asking questions to gain reputation.  That's about it.  

Since these questions have little value to anyone other than the person asking the question, as soon as it is answered it will sit unused and unloved down in the dirtiest corners of some database.  If you want to earn any reputation, you don't just need to answer the question, you need to answer it *now*.  And you need to cross your fingers because providing the correct answer doesn't mean you'll get anything.  You are still racing the other SO users and entirely dependent on the asker selecting your answer as correct.

What an odd situation that is!  You have groups of software developers fighting to be the first to do some CSCI 101 homework to earn reputation.  Which raises my next question:

Why Do You See The Reputation and Picture Of People Who Participate in SO? 

If you wanted to impartially determine which answer in a list of answers is the best; certainly, you'd want to EXCLUDE that information.  Let each answer be judged on it's own merit.  Isn't that supposed to be one of the defining positives of the internet?  Anecdotally, I've found that the more reputation I earn, the more likely I am to receive upvotes and the less likely my questions are to be closed.  Because, again, the majority of questions are trivial it's not uncommon for multiple people to post equivalent answers within seconds or minutes.  Who is most likely to get the upvotes/accepted answer?  Whomever has more rep and more badges.  And a picture!  Either a funny, clever or professional one seems to have the best results.  If you have 1 rep and the default autogenerated image....well, it'll be an uphill battle.

Don't get me wrong, I'm not against tracking reputation or having a profile picture.  I'm also not suggesting that the top members of SO aren't really smart, really knowledge people.  But the question of 'why' is a pretty obvious one.  The creators of StackOverflow and the sister sites (StackExchange, I think they are calling it) have really just provided a framework for Q&A (and please, don't think I'm trivializing their's a GREAT Q&A Framework.  Arguably the best ever created).  The *value* of the site, the reason people go, is to get answers.  When you answer a question, you are, quite literally, unpaid tech support.  There is very little tangible benefit to you.  Some people will argue that you are *learning*.  I don't buy it.  The same time spent reading a book or following tutorials would yield far more knowledge than the same time spent answering other people's questions on SO.  So, instead, you are paid in bits.  Virtual badges of honor you can proudly display.  But is it worth it?

Maybe.  But not for me.  I'm leaving SO for the same reasons I left WoW.  I've going to chase a carrot, it's not going to be a *virtual* carrot.


Google Voice And Sprint....No Thanks!

by Rob 5. May 2011 16:39

If you haven't already heard, Goole and Sprint have partnered up.  Now Sprint customers can seemlessly integrate Google Voice with their Sprint account. 

Best of all - it's free!  Or so they claim.

What happens to my monthly plan with Sprint?Nothing changes. You don't pay more for these new features, and you don't have to sign a new contract. Your monthly minutes, texts and calling features all stay the same

As it turns out, that is only half true.  

If you are already using Google Voice you are used to sending and receiving phone calls from the website.  Previously, this was free and Sprint was not involved at all.  You were simply a Google Voice user making a Google Voice call.  But if you link your Sprint account and Google Voice account....your previously free calls now cost you money.  That's right, the same call that was free and didn't involve Sprint *at all* yesterday; will now use your Sprint minutes.  

Rob Paulson: "Yesterday, if someone called my GV number and I answered it on the computer; Sprint would not be involved at all.  It was free.  Today, I linked my Sprint # and my GV account.  If someone calls me today, dialing my Sprint #, and I answer on my computer; it will use my Sprint minutes. 

Rob Paulson: "Is that correct?"

Agent (Katherine B): "Yes, you are correct."

So you need to sacrifice the best part of Google Voice (free calls) in order to use your Sprint number.  And the only benefit you get is that you can use your Sprint phone number?  But only as long as you are a Spring customer!

If your Sprint contract expires. You will be on a month to month basis and your services will not be impacted unless you request to conclude your services with Sprint. Keep in mind, should you choose to cancel your services and want to keep your number with Google Voice. You would need to port your number to Google Voice.

Unless you plan on sticking with Sprint forever, you are either going to lose your phone number or you are going to pay $20 to port the number to Google.  In either case, why not continue to enjoy free calls with Google Voice and either port your number now, or move to a new free Google Voice number?


Presenting....My Resignation Letter

by Rob 1. May 2011 19:40

This is a bit premature and still in 'beta'; but I think I've finished up my resignation letter.

You can play it here.

Source available here.


2x4s And Drywall Screws - Is There Anything They Can't Do?

by Rob 28. April 2011 19:04


2x4's are seriously underrated.  Or maybe it's just that nobody builds anything anymore.  Unless it comes from a store, it must be crap, right?  I'm not what you would consider handy, by any stretch of the imagination, but even *I* can build stuff with 2x4s.

Home gyms are expensive!  $300 for a nice squat rack or.....$15 dollars in 2x4s 
And who needs an expensive ladder from the hardware store when you one for less than lunch at McDonalds?

For the record: the rack is shown holding 325 pounds (which is more weight than I see most people use at the gym anyway). What the pictures doesn't show is that I was also hanging from the bar, for a total weight of ~500 pounds! For only $15! You can't beat that. I used it for over a year without any problems or any signs of fatigue.

New House....New Website....

by Rob 24. April 2011 20:08


Tuesday made it official; the house is sold!  All things considered it was a pretty painless closing.  I still don't know if the check at closing was worth all of the time and effort...but it was a good experience.


I had a feeling prices would drop like a rock following the end of the First-time home buyer's credit; and as it turns out, I was pretty right.  

In hindsight, maybe I should have sold earlier.  Oh well.  I'm content with my 26% increase in sale price.

And hey, if I'm moving houses, why not move websites too?  I liked my old host ( but I kept wishing for something with ASP.Net support.