generally inappropriate work, school, hobbies, and toilet jokes

2Jan/100

Public Domain Book Illustrations on Flickr

Public Domain Book Illustration

I found this great set of scans from old books that are now in the public domain on Flickr. There are a lot of great old photos, illustrations, and patterns that could add a cool retro look to any project.

Check it out: Public Domain Book Illustrations

31Dec/090

isNumericString(): A JavaScript Function to Identify Numbers Stored as Strings

Some Javascript Code

I wrote this function recently to determine whether a given string can be converted into a number by JavaScript's built-in parseInt() and parseFloat() functions. Take a look and let me know if you have any suggestions for improvement!

function isNumeric(str)
{
    /*
        Valid numeric string examples:
            123456
            1.23456
            1.23e456
            +123456
            -123456
            +1.23456
            -1.23e456
            etc.
    */

    var validChars = "0123456789";
    var validOnce = ".e";
    var validAtStart = "+-";
    var notValidAtStart = "e";

    for (i = 0; i < str.length; i++)
    {
        var ch = str.charAt(i);

        if(i == 0)
        {
            if (validChars.indexOf(ch) == -1 &&
                validAtStart.indexOf(ch) == -1 &&
                validOnce.indexOf(ch) == -1)
            {
                return false;
            }else if(notValidAtStart.indexOf(ch) != -1)
            {
                return false;
            }
        }else if (validChars.indexOf(ch) == -1 &&
            validOnce.indexOf(ch) == -1)
        {
            return false;
        }
    }

    //check validonce are only appearing once
    for (i = 0; i < validOnce.length; i++)
    {
        var ch = validOnce.charAt(i);

        if(str.indexOf(ch) != str.lastIndexOf(ch))
        {
            return false;
        }
    }

    return true;
}
31Dec/090

photos8.com: Free Photos and Wallpaper

Photos8.com is a great resource for free stock photos. All images can be used royalty-free for any purpose.

Check it out: photos8.com

4Apr/095

SV650S Seat Mod!

The end result:

102_3756

2Sep/080

Woot Contest 189: Who I Oppressed On My Summer Vacation

Filed under: Uncategorized No Comments