Code clearly

December 6, 2010 § Leave a comment

I ran across a nice article just covering the basics of coding clearly. Since I’m currently spending most of my time correcting mistakes like this, I thought it worth a mention.

http://fob.po8.org/student-code

Free programming books

December 5, 2010 § Leave a comment

Need something to read? Check out this list of freely available programming books.

What’s in what, now?

December 1, 2010 § Leave a comment

I’ve been working with a client that is working on an Oracle to SQL Server conversion project, and part of it involves poring over stored procedures to fix inefficiencies. This type of thing keeps coming up, and since this isn’t the only client I’ve seen it at…

This is slow and inefficient:
SELECT @var1 = tab1.col2
FROM tab1
WHERE tab1.col1 =
  (
    SELECT tab2.col2
    FROM tab2
    WHERE tab2.col1 =
    (
      SELECT tab3.col2
      FROM tab3
      WHERE tab3.col1 = @par1
    )
  )

This is better and much, much faster:
SELECT @var1 = tab1.col2
FROM tab1
INNER JOIN tab2
  ON tab1.col1 = tab2.col2
INNER JOIN tab3
  ON tab2.col1 = tab3.col2
WHERE tab3.col1 = @par1

Georgia Amendment 1 – An Analysis

November 24, 2010 § Leave a comment

So obviously, Amendment 1 passed. It didn’t even barely pass, it passed with an overwhelming majority of votes. 1,628,507 out of 2,410,156 Georgians voted YES! on Amendment 1.

My previous blog entry regarding Amendment 1 was on the first page of google’s search results for most combinations of Georgia, Amendment, November 2nd, etc. It was the top search result in many cases. I assume it was largely the same for Bing and Yahoo, although to be honest, I haven’t really verified.

That blog entry got a little less than 3,000 hits by November 2nd (thank you WordPress site stats). So assuming that every one of those page views was by a registered Georgia voter (which is beyond unlikely), roughly 0.1% of people that voted on that amendment read that blog post.

Now quite obviously, a very large percentage of people get their news from television, newspaper, friends, and other sites, but still – 0.1% bothered to do a simple search to research the issues that they were going to vote on? Really?

I saw something interesting today…

November 17, 2010 § 1 Comment

public string PadString(string value)
{
    if (value.Length == 1)
    {
        return "000000000" + value;
    }
    else if (value.Length == 2)
    {
        return "00000000" + value;
    }
    else if (value.Length == 3)
    {
        return "0000000" + value;
    }
    else if (value.Length == 4)
    {
        return "000000" + value;
    }
    else if (value.Length == 5)
    {
        return "00000" + value;
    }
    else if (value.Length == 6)
    {
        return "0000" + value;
    }
    else if (value.Length == 7)
    {
        return "000" + value;
    }
    else if (value.Length == 8)
    {
        return "00" + value;
    }
    else if (value.Length == 9)
    {
        return "0" + value;
    }
    else
    {
        return value;
    }
}

Right, turn adult off

November 10, 2010 § Leave a comment

When using the Bing Search API, “&adult=off” doesn’t mean don’t show adult images. It means don’t filter adult images.

I added some filtering options to http://imgsho.com and cleaned up the CSS a bit (still lots more to do). Now the default is to perform a moderate filter on the images.

If you want to look at naked people, you can change the SafeSearch filter.

Thanks for the suggestions so far. Keep them coming.

imgsho.com – search-based image slideshow

November 4, 2010 § 2 Comments

I just published ImgSho.com, which is a search-based image slideshow. It allows you to do an image search for anything you like, and it will automatically cycle through the search results.

In order to make it, I hacked together the Bing search API (which is clean, nice, and easy to use) and the Galeriffic jQuery plugin (which works fine, but isn’t really designed for what I’m doing with it). Clearly there are some features missing that I will be adding, such as allowing you to restrict and filter your search. Also, the site is in serious need of an actual design. Despite that, though, the site is functional, and I thought I’d push something out. I haven’t spent too much time on it yet (obviously), but plan to put quite a bit of effort into polishing it over the next few weeks.

A little bit of backstory…

My daughter had her third birthday earlier this year, and one of the things she insisted on having was a Dora the Explorer cake (which I made for her, and am unabashedly showing off here.)

Making the Dora cake involved looking through many, many pictures of other Dora cakes online in order to get ideas. Perhaps predictably, my daughter enjoyed this a little too much, and looking at pictures of Dora cakes online soon became one of her favorite activities.

The problem with this is that looking at pictures of Dora cakes quickly grew tiresome (at least for the adult that was helping her), but she hadn’t yet learned how to navigate search results to see the pictures. I looked for an image search with a slideshow feature, but was not able to find one.

So, I made one . . . http://imgsho.com!

Let me know what you think – your feedback will drive what I work on. If you like the site, think it has potential, or would like some particular features, please let me know and I will do my best to add them. Either comment here or send me an email.