Calendar

January 2012
S M T W T F S
« Jul    
1234567
891011121314
15161718192021
22232425262728
293031  

Categories

The Zoey Chronicles: A Poem

Daddy’s House, Nana’s House
Daddy’s House, Daddy’s House

Trees are up
Clouds are Down
Trees are up, trees are down.
Clouds are up, clouds are down.

Close you eyes, I’m a do maaaaaagic.

The Zoey Chronicles #2 – The Hungry Dinosaur

Today, I bring you the second story told to me by Zoey.

“The Hungry Dragon”

There was a dragon. He was hungry. What did he eat? Five Dora chips. Five Dora chips that were as big as a car!

But he was still hungry.

Then he ate three fluffy cheese pops.

But he was still hungry.

So he ate a bunny.

He wasnt hungry anymore! He was friendly and smiled a lot.

The End

The Zoey Chronicles – #1 : The Bunny on the Lake

Today, i bring you the first, in what i hope to be a series, of many stories, as told by my daughter, Zoey. Today, she is just shy of 3 years old. I asked her to tell me a story. And this is how it went:

There was a bunny on a lake.
The bunny hopped and hopped. She hopped on the lake so high. So high to the sky.
The bunny got stuck in a tree. She has an owie.
The bunny’s mommy gave her a big kiss and made her all better.
The bunny is still in the tree.

The end.

I hope you enjoyed this story as much as i did. I have to wonder, though, why the bunny is still in the tree. This is a mystery we may never solve.

Converting SQL DateTime to a Simple Date

Just to remind myself at a later date, this is a SQL Query that shows how to strip the timestamp from a datetime value.

Declare @fulldate datetime

Set @fulldate = getdate()

Declare @shortdate smalldatetime

Set @shortdate = convert(datetime,convert(char(10),getdate(),101))

Select @fulldate, @shortdate

Using Recaptcha in the C# CreateUserWizard

I have been playing around with a new .NET website for a while now. One of the great features of .NET is the concept of the CreateUserWizard. It helps take some of the tedium out of user registration and membership. However, out of the box, it is very basic.

In my solution, I wanted to ensure the user was indeed a real live human being. Outside of creating a largely robust Turing test, I decided to implement a captcha. While somewhat annoying, it can be highly effective in filtering a bunch of spam traffic. Add into the mix an email verification scheme, I should be set.

I chose Recaptcha as my control of choice. It appears to be widely used and officially supported. One problem, though, is you can’t just drop it in and have it work. I will assume you have the control correctly setup in your project. If not, repeat after me: “Google is my friend.” To use the control, find (or create) the appropriate WizardStep in your control and insert the control code. If you don’t know this, you will once you’ve registered for Recaptcha. If not, repeat after me: “Bing is also my friend.”

The second task was to have the CreateUserWizard actually verify the Recaptcha validation. This proved tricky, but not insurmountable. In fact, once I learned of the CreatingUser method (not to be confused with the CreatedUser method), it was straightforward. I have provided a sampling of code below (provided as-is with no warranty of quality… use at your own risk… I cannot be held liable for your code screwing up… blah blah blah):

protected void RegisterUser_CreatingUser(object sender, LoginCancelEventArgs e)
{
    // validate recaptcha
    Recaptcha.RecaptchaControl mycaptcha = (Recaptcha.RecaptchaControl)RegisterUser.CreateUserStep.ContentTemplateContainer.FindControl("YOUR_RECAPTCHA_CONTROL_NAME");
    mycaptcha.Validate();
    Boolean answer = mycaptcha.IsValid;
    if (answer == false)
    {
        // captcha failed
        // cancel process
        e.Cancel = true;
    }
    else
    {
        // captcha succeeded, proceed and do nothing
    }
}

Hope this helps you out. Happy coding!

U-Verse and 3Rd Party Email Connectivity

If you are an AT&T U-Verse subscriber and are having difficulties sending emails to a 3rd Party Email service, consider checking your access to Port 25. I discovered this morning that U-Verse actively blocks this port for many web hosts (including M6.net). That being the case, you will need to have AT&T Customer Support (thru ConnecTech) unblock port 25. I have yet to determine what the cost for this “service” will be.

The Ukelele

This past Christmas, I received a soprano ukelele. I was thrilled. I finally had a comically small instrument on which to play music.

Then, i tried tuning it. Who knew that nylon strings snapped that quickly?

So, i finally got knew strings and got it tuned correctly: G – C – E – A. Now that it is good to go, i am just a short leap away from “Somewhere Over the Rainbow”. Zoey will be thrilled!

Amazon.com – Video Game Pre-order Deals (02/28/2011)

Here is a list of current Amazon.com pre-order bonuses for a variety of video games. Of note, Gears of War 3, LA Noire, and Mass Effect 3.

Brink – $10 credit
Cars 2: The Video Game – $10 credit
Crysis 2 – Limited Edition – $10 credit
F.E.A.R. 3 – $20 credit + comic
Final Fantasy XIV – $10 credit
Fight Night Champion – $10 credit + George Foreman DLC
Gears of War 3 – $20 credit
Green Lantern: Rise of the Manhunters – $20 credit
Homefront – $10 credit
LA Noire – $10 credit
LEGO Battles Ninjago – $10 credit
LEGO Pirates of the Caribbean – $10 credit
Lego Star Wars III: The Clone Wars – $10 credit
Major League Baseball 2K11 – $10 credit
Mass Effect 3 - $10 credit
Mortal Kombat – $10 credit + Reptile DLC
NASCAR The Game 2011 – $10 credit
Shift 2 – Unleashed – $10 credit
SOCOM 4: U.S. Navy Seals – $10 credit
Spec Ops: The Line – $10 credit
Tiger Woods PGA TOUR 12: The Masters – $10 credit + putter DLC
Tom Clancy’s Ghost Recon Future Soldier – $10 credit
Top Spin 4 – at least $10 credit

RexEx Recipes – No Special Characters

I am not a RegEx (regular expressions) guru. In fact, these mystical formulas are rather foreboding and I consider them a black art. To those that are wizards, though, they can wield powerful results.

For my needs, I needed to prevent certain special characters from my text entry fields. I knew a RegEx validator would be useful, I just didn’t know the correct formatting. As luck would have it, as evidenced by a quick Google search, there were many to choose from.

This particular formula suited my needs perfectly.

[^<>/?&{};#]+

You can read more about this expression here: http://regexlib.com/REDetails.aspx?regexp_id=2126

Thanks, www.regexlib.com!

How do I determine a machine’s MAC address?

If you know the machine’s IP address, you can find MAC by using the nbtstat command:

nbtstat -A <ip address>

MUST BE uppercase A with IP address.

type nbtstat /? for help