Visual Studio Macro for Sentence Case

Wednesday, May 7th, 2008 at 4:10 pm

I can’t believe I couldn’t find this, so I wrote one:

    Sub SentenceCase()
        Dim textSelection As EnvDTE.TextSelection
        Dim newString As String = ""
        Dim firstCase As Boolean = False

        textSelection = CType(DTE.ActiveDocument.Selection(), EnvDTE.TextSelection)
        For Each ch As Char In textSelection.Text.ToCharArray()
            If Not firstCase And Char.IsLetter(ch) Then
                ch = Char.ToUpper(ch)
                firstCase = True
            ElseIf firstCase And Char.IsLetter(ch) Then
                ch = Char.ToLower(ch)
            End If
            newString = newString + ch
        Next

        textSelection.Text = newString
    End Sub

New Blag

Monday, April 14th, 2008 at 12:45 am

Previously I had Serendipity, but I decided to go mainstream with Wordpress. The interface is a lot more fun to use out of the box which hopefully means I’d update this more. It was ridiculously easy to switch since it will import blogs via RSS feed.

I signed up for Akismet since in the first thirty minutes of publishing the blog, I already had a spam post. So far so good.

Not only that, I’m trying out TwitterTalk about mainstream. I realize that since I don’t have a lot of time to blog, putting up a stream of out-of-context short thoughts could be worth it.

SubSonic Benchmarks

Thursday, March 20th, 2008 at 11:18 pm

I’ve started using an open source project at work called SubSonc. It’s a combination ORM and code generation tool for creating your DAL in .NET. It looks at your database and creates classes with CRUD functions for every table. Out of the box with no configuration. The best part is that they are implemented as partial classes so you can add your own business logic to them very easily. Finally, it doesn’t put the hate on stored procedures - all of them are made available via the generated DAL.

In the past, I had stored procedures for everything. After writing 50 stored procedures I started to worry. I decided to rewrite a small web project to use Subsonic for it’s DAL. I share with you the results in numbers.

(more…)

Come on Adobe!

Saturday, February 9th, 2008 at 11:57 pm

Right now I am trying to fix a web app with a Flash frontend that suddenly broke because of a major change in Flash player.

Adobe put out a new release of Flash Player 9 that disables the authorization header from being sent when doing any web request within a Flash file. It’s documented here.

(more…)

Mutually Exclusive Listboxes Extender on Codeplex

Wednesday, January 23rd, 2008 at 5:25 am

That’s a dreadfully long title for a project. I created it out of need for some things at work, and to help out the people who care about Work Item 13203 in the AJAX Control Toolkit. It’s not implemented exactly how they’ve envisioned it, but I think it’s as clean as an implementation as it can get.

From the description:

A .NET 2.0+ implementation of mutually exclusive listboxes using ASP.NET’s AJAX Control Toolkit. In other words, a UI with two or more listboxes where items can be moved between the them using buttons.

(more…)