Neil's profileMSN Meets BlogPhotosBlogLists Tools Help

Blog


    September 01

    Haribo Experiment

    When someone buys you a bag of Haribo, what do you do with it?

     

    Haribo Experiment

    May 17

    Nice solution to input type="file"

    http://www.quirksmode.org/dom/inputfile.html

     

    This guy has written a nice solution to styling the input type="file". Check it out, worth a read just to be aware of the problem.

    April 28

    Font Finder

    Rocking little site that finds the type of font used in an image.

     

    http://www.myfonts.com/WhatTheFont/

     

    Really useful for amending existing images.

    April 22

    Don't talk rubbish

    More pearls of wisdom, before you go slagging a class of in .net try to make sure you know what your talking about first. In my previous post i was discussing the threadpool class and about long running tasks. Turns out that was complete rubbish and the threadpool class is great in everyway. Just don’t send the threads into an infinite loop *grin*

    April 21

    Threading Tip

    ThreadPool.QueueUserWorkItem(AddressOf Method) is great for having some free thread handling. It will queue up the method to be executed on any spare system thread lying around.

    One small note however is do not put anything that might take more than a second or two onto that system. I used the ThreadPool class to do some WebRequest work and after 3-4 requests, my whole machine came to a grinding halt.

    April 20

    Jumping to bookmarks

    An annoyance with ASP.NET is that most of the server controls use PostBack to submit data. This causes the browser to jump back to the top of the page on each click. Easiest way to solve this is to use bookmarks. They however are a bit of a pain to implement in ASP.NET pages.

    This little function will help implement bookmarks. Allowing you to reduce / stop the browser jumping on postback.

    Public Shared Sub JumpToBookmark(ByVal Page As Page, ByVal BookMark As String)

    Dim script As String = "<SCRIPT language='javascript'>location.href='#" & BookMark & "'</SCRIPT>"

    Page.RegisterStartupScript("startupscript", script)

    End Sub
    April 19

    Something Great

    I was going to put something great in here... Now im just gonna put a lame plug for my site.

    www.silvergames.net

    Go be happy.

    April 15

    The Power Of Css

    http://www.csszengarden.com/

    Feel the power of pure CSS might. The site has only one page of html, the only thing that changes is the css files. Stunning!

    April 14

    SQL Day Compare

    Argh! One problem I keep hitting in SQL Server is a function to compare days. All I want to do is check if one date is greater than another date without comparing any time values, so just the days.

    One solution our R&D guy came up with is to use a numeric value to compare the days. Its not a great solution but it works.

    (DATEPART(yyyy, @DateTime) * 1000) + DATEPART(dy, @DateTime)

    To make life a little easier we made it a user defined function to compare the days.

    CREATE FUNCTION dbo.ifnDateToNumber (@DateTime as datetime)
    RETURNS int

    --Convert datetime into an integer based on (YEARS * 1000) + dayofyear
    --this can then be used in datetime comparisons to avoid the problem of random time values
    --being considered when comparing dates

    AS
     BEGIN

     return (DATEPART(yyyy, @DateTime) * 1000) + DATEPART(dy, @DateTime)
     END

     

    April 13

    Blug and MSN? Huh?

    Who would have thought Blog would come to MSN? Well it's here and it's kinda cool.