Long Cloud Technologies
"... A Yankee in the Land of the Long White Cloud, Aotearoa ..."

An oldie, but a REAL goodie!

I came across this again today, and couldn’t stop laughing (and pretending I NEVER did that!).

Introduction to Abject-Oriented Programming

Saddest thing about this article, in the comments some “programmers” were too stupid to get the joke.  They shouldn’t be let near a keyboard!

Posted on 25 Dec 09 08:14 by matthew.hintzen |

Bookmark this post with:

E-mail | Comments(0) | Comment RSS


Firefox is like the Cheese, It Stands Alone!

So one of my friends and former colleagues warned me today that my blog wasn’t working correctly with Google feedburner Link that Google generates (which isn’t really my fault) and that when he used the archive links to pull up the actual entry, he saw a whole bunch of spam at the bottom of the entry.  And he sent me screen shots

image

Ok, it’s not exactly spam, it’s Trackback links which the Evil Scum Lowlife f**kw*d spammers of the world have decided to ruin for the rest of us. I had actually “shut-off” my trackbacks, but it appears that they were still being allowed, at least that’s what it looks like from the screen shot I was sent!

So I immediately pull it up in my usual working browser and I don’t see the issue.

image

A second look show me that he is using ForeFix, FireFox, and as you can see, I’m using IE… So before I pull up FireFox to see if I can reproduce the error, I bring up the tie breaker Chrome.

image

Whoa, no problem there, so finally I open FireFox on my machine

image

DING, DING, DING, we have a Loser!

Ok, it is definitely my blog server (I shouldn’t be serving up those links), but still, FireFix is doing something wrong!

This blog entry is about my attempts to fix the problem on this blog (making this a recursive Blog entry, I love those types).

So let’s look at the page source from IE, Chrome and Firefox and see what we have:

And they all show the same thing, this is what we have:

Posted on
            10-Dec-09
         by Matthew C. Hintzen<br /><a href="/Blogs/archive/2009/12/10/refactoring-in-sql.aspx"> Link to this post
                </a>

        | Bookmark this post with: <span class="categories-post"><a href="http://del.icio.us/post?url=/Blogs/archive/2009/12/10/refactoring-in-sql.aspx&amp;title=Refactoring in SQL" title="Add to del.icio.us"><img src="/Blogs/themes/clean/images/delicious.png" border="0" /></a>

            <a href="http://digg.com/submit?phase=2&amp;url=/Blogs/archive/2009/12/10/refactoring-in-sql.aspx" title="Digg it"><img src="/Blogs/themes/clean/images/digg.png" border="0" /></a>

            <a href="http://technorati.com/cosmos/search.html?url=/Blogs/archive/2009/12/10/refactoring-in-sql.aspx" title="Technorati"><img src="/Blogs/themes/clean/images/technorati.png" border="0" /></a>

            <a href="http://www.facebook.com/share.php?u=/Blogs/archive/2009/12/10/refactoring-in-sql.aspx" title="Facebook"><img src="/Blogs/themes/clean/images/facebook.gif" border="0" /></a>

            <a href="http://reddit.com/submit?url=/Blogs/archive/2009/12/10/refactoring-in-sql.aspx&amp;title=Refactoring in SQL" title="Reddit"><img src="/Blogs/themes/clean/images/reddit.png" border="0" /></a></span><br />

        Tags:
            </div></div><div class="clear"> </div>

<!--
<div class="comments"><h3>Links to this post</h3><div class="comments-visitor"><span class="comments-intro">Klonopin.</span><p /><span class="comments-intro">
                Trackback from
                    <a href="http://www.viddler.com/explore/Klonopintkg">Snorting klonopin.</a>
                on 28 Mar 2009</span></div><div class="comments-author"><span class="comments-intro">Black shemale.</span><p /><span class="comments-intro">
                Trackback from
                    <a href="http://www.viddler.com/explore/shemale">Shemale galleries.</a>
                on 28 Mar 2009</span></div><div class="comments-visitor"><span class="comments-intro">Buy cheap phentermine.</span><p /><span class="comments-intro">
                Trackback from
                    <a href="http://www.kaboodle.com/buy_phentermine">Cheap phentermine free shipping.</a>
                on 28 Mar 2009</span></div><div class="comments-author"><span class="comments-intro">Shemale free.</span><p /><span class="comments-intro">
                Trackback from
                    <a href="http://www.viddler.com/explore/shemale">Shemale sex.</a>
                on 28 Mar 2009</span></div><div class="comments-visitor"><span class="comments-intro">Free gay porn video clips.</span><p /><span class="comments-intro">
                Trackback from
                    <a href="http://www.viddler.com/explore/free_gay_video">Free gay video free.</a>
                on 29 Mar 2009</span></div><div class="comments-author"><span class="comments-intro">Side effects of diovan.</span><p /><span class="comments-intro">
                Trackback from

And all the trackbacks are here on the page in the source, but they are commented out.  IE and Chrome pay attention to that comment out, but FireFox decided it was going to ignore it.  And for the record, the comment is properly closed.  Looking more carefully in the source from FireFox, here is a picture of how it is parsing the stuff (color-coded in the FireFox Source Viewer)..

image

You’ll notice that suddenly in the middle of  the commented out section, FireFox decides it’s no longer going to pay attention to that <!--  even though it hasn’t hit the terminating -->.

Browsers… what are you going to do.  Ok now that I KNOW its a bug in Firefox, let’s go fix my blog so the bug doesn’t show up.

I’m using Sharepoint to serve up my blog using the CKS:EBE blogging add-in.  So I go in to the Post.aspx and delete the commented out

<!--
<EBE:TrackBackLinks runat=”server” Transform-XslName="PostTrackBack.xsl" />
-->

Which the sharepoint server was actually rendering in-between comment indicators (and which makes sense if I had thought about it, so I admit it was originally my fault).

But still Firefox shouldn’t have done what it did.  I also went into Sharepoint lists and deleted all the trackback links from the database.  So all gone, bye bye now!

Posted on 11 Dec 09 08:27 by matthew.hintzen |

Bookmark this post with:

E-mail | Comments(0) | Comment RSS


Google Feedburner is mucking up links to this blog

If you are subscribed to this blog in feeds.feedburner, be aware that the links to the blog are being rendered incorrectly by Google.  I’m working on it to see if I can make a workaround for their bug.  Use http://www.longcloud.co.nz/Blogs/rss.xml instead.

Technorati Tags: Cold Pricklies

(Update on August 25th 2010, this whole blog has been moved so this no longer applies)

Posted on 11 Dec 09 08:15 by matthew.hintzen |

Bookmark this post with:

E-mail | Comments(0) | Comment RSS


Refactoring in SQL

This entry won’t be much to anyone used to working with sql or refactoring or the With Clause, but sometimes I like to just walk thru how I started and how I ended when refactoring, and SQL can be refactored just like any other type of code.

I’m working on a SQL procedure where I need to be able to sort a set of items, and find the “next” one in the list.  I figured out how to do that using two statements:

DECLARE @rowIndex int;

SELECT
    @rowIndex = RowNumber + @IndexDelta
FROM (
    SELECT
        ROW_NUMBER() OVER (ORDER BY [SheetId] DESC) AS [RowNumber],
        [Uid]
    FROM
        [Sheets.SheetInfo.Functions.SheetList.Sheet.SelectAll](
            @SheetType , @CreatedBy , NULL , @LocationUid ,
            @ObserverUid , @FromSheetId , @ToSheetId , @FromDate , @ToDate
        )
    ) AS temp
WHERE [Uid] = @SheetUid


SELECT
    ISNULL([Uid],  CAST('00000000-0000-0000-0000-000000000000' AS UNIQUEIDENTIFIER))
FROM (
    SELECT
        ROW_NUMBER() OVER (ORDER BY [SheetId] DESC) AS [RowNumber],
        [Uid]
    FROM
        [Sheets.SheetInfo.Functions.SheetList.Sheet.SelectAll](
            @SheetType , @CreatedBy , NULL , @LocationUid ,
            @ObserverUid , @FromSheetId , @ToSheetId , @FromDate , @ToDate
        )
    ) AS temp
WHERE  [RowNumber] = @rowIndex

Running the above code on my humongous load test database (3.5 gig in size), takes 5 seconds.

Well next thing up, is it seems to me we could Nest the entire structure and get rid of the intermediate @rowIndex

 

SELECT
    ISNULL([Uid],  CAST('00000000-0000-0000-0000-000000000000' AS UNIQUEIDENTIFIER))
FROM (
    SELECT
        ROW_NUMBER() OVER (ORDER BY [SheetId] DESC) AS [RowNumber],
        [Uid]
    FROM
        [Sheets.SheetInfo.Functions.SheetList.Sheet.SelectAll](
            @SheetType , @CreatedBy , NULL , @LocationUid ,
            @ObserverUid , @FromSheetId , @ToSheetId , @FromDate , @ToDate
        )
    ) AS temp
WHERE  [RowNumber] = (
    SELECT
        RowNumber + @IndexDelta
    FROM (
        SELECT
            ROW_NUMBER() OVER (ORDER BY [SheetId] DESC) AS [RowNumber],
            [Uid]
        FROM
            [Sheets.SheetInfo.Functions.SheetList.Sheet.SelectAll](
                @SheetType , @CreatedBy , NULL , @LocationUid ,
                @ObserverUid , @FromSheetId , @ToSheetId , @FromDate , @ToDate
            )
        ) AS temp
    WHERE [Uid] = @SheetUid
)

Well that is simplified and got rid of the intermediate int, but still it seems a little “off” and hard to read

Now as you can see, I’m using a nested from structure where one of my from clauses is to a stored procedure that takes some parameters, and that proc is used in both parts of the query, in fact the first level “from” is identical for both parts

SELECT
    ROW_NUMBER() OVER (ORDER BY [SheetId] DESC) AS [RowNumber],
    [Uid]
FROM
    [Sheets.SheetInfo.Functions.SheetList.Sheet.SelectAll](
        @SheetType , @CreatedBy , NULL , @LocationUid ,
        @ObserverUid , @FromSheetId , @ToSheetId , @FromDate , @ToDate
    )
) AS temp

Well rather then declaring this same item twice seems to me this is a good candidate for a “With” clause, and lets see if that cleans things up a bit…

WITH sheetsCte as (
    SELECT
        ROW_NUMBER() OVER (ORDER BY [SheetId] DESC) AS [RowNumber],
        [Uid]
    FROM
        [Sheets.SheetInfo.Functions.SheetList.Sheet.SelectAll](
            @SheetType , @CreatedBy , NULL , @LocationUid ,
            @ObserverUid , @FromSheetId , @ToSheetId , @FromDate , @ToDate
        )
)

SELECT
    ISNULL([Uid],  CAST('00000000-0000-0000-0000-000000000000' AS UNIQUEIDENTIFIER))
FROM
    sheetsCte
WHERE  [RowNumber] = (
    SELECT
        RowNumber + @IndexDelta
    FROM sheetsCte
    WHERE [Uid] = @SheetUid
)

and in fact that works just GREAT, reads nicely and I think a good exercise in Sql refactoring.

Posted on 10 Dec 09 08:29 by matthew.hintzen |

Bookmark this post with:

E-mail | Comments(0) | Comment RSS


My new Monitor Setup (4, count them 4)

So following the advice of Scott Hanselman, I bought a TouchScreen Mimo monitor.  VERY cool.

Checkout out my desktop now!  4 monitors (I bet 5 is not far off!) 

    2 – 24 inch
    1- 21 inch
    1 – 8 inch touch screen

image

One piece of advice however, if you are going to buy one, spend the extra money 30 bucks and get the Mimo 720-S instead of the Mimo iMo pivot you see here.  I really like the monitor, but the stand for it is too high and not adjustable.  If you want to use it as I am here on the desktop as a IM / Zune / Windows Media Player window, the 720-S has a better stand system.

Posted on 06 Dec 09 12:33 by matthew.hintzen |

Bookmark this post with:

E-mail | Comments(0) | Comment RSS