Craig Gemmill's Blog

There is nothing more secure than an educated user!

September 2006 - Posts

Search.Live.Com. I want to like it, I really do...

Since it's no longer tagged Beta, its fair game right? Well, I have to be honest; so far I've had nothing but bad experiences with using the Live.com search engine. I'll give you my latest example:

I was watching a video of Victor Wooten, one of the most unique bass players around. Being a bass player myself, I like to learn other people’s styles and try to incorporate them into my music. So what's one of the first things you do when you need help learning someone else's song? Tab search, of course! Just look at the difference between Live and Google results for the value "wooten amazing grace bass tab":

Live: http://search.live.com/results.aspx?FORM=IE7&q=wooten+amazing+grace+bass+tab
Google: http://www.google.com/search?q=wooten+amazing+grace+bass+tab

It almost feels like the Live search results are based around trying to sell you stuff rather than relevance.

I tried every combination I could think of, short of searching for an exact URL. I even tried other search engines and was surprised to see that every other engine actually returned more relevant results than Live... except for Lycos. Then I noticed at the bottom of the Lycos page, it says: "Portions powered by Windows Live". Well, no surprise there.

I have hope for the future of Live search, but for right now I'm just a little surprised it's not still in Beta, because it really should be.

VB.NET Hexadecimal to Floating Point / Single (IEEE 754)

A post just came across the forum I frequent regarding Hexadecimal to Floating Point conversion. Strangely there appears to be no direct way to do this in .NET, and the solutions I found were pretty lame and tedious… so it became my mission to get it done the .NET way, and here is the result:

    Private Function ConvertHexToSingle(ByVal hexValue As String) As Single

        Try

            Dim iInputIndex As Integer = 0

            Dim iOutputIndex As Integer = 0

            Dim bArray(3) As Byte

 

            For iInputIndex = 0 To hexValue.Length - 1 Step 2

                bArray(iOutputIndex) = Byte.Parse(hexValue.Chars(iInputIndex) & hexValue.Chars(iInputIndex + 1), Globalization.NumberStyles.HexNumber)

                iOutputIndex += 1

            Next

 

            Array.Reverse(bArray)

 

            Return BitConverter.ToSingle(bArray, 0)

        Catch ex As Exception

            Throw New FormatException("The supplied hex value is either empty or in an incorrect format. Use the following format: 00000000", ex)

        End Try

 

    End Function

 

 

ConvertHexToSingle("3C000000")

Even though this is just a rough example, it does work, and it can be expanded to support larger types (such as Double) with a couple of small mods.

 

More Posts