Sven's Blog

MemoryStream ms = new MemoryStream(MyBrain); // Management and technology considerations

Subscriptions

<March 2010>
SuMoTuWeThFrSa
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910

News

Welcome to my spot on the 'Net. I am the Principal Consultant at Adduxis, a management and IT consulting firm. This blog will provide you with some (hopefully) useful information and links to tidbits found on the Internet.

Navigation

Post Categories

Microsoft Bloggers

General (RSS)

Posts not belonging in any other category.
Logging on as Administrator is a bad idea...
For your day-to-day activities, that is. The blog post below points this out one more time:
NEWS: “Removing end user admin rights eliminates 92% of vulnerabilities"
This advice holds independent of operating system, version, etc.
I do believe though that Vista's User Account Control (UAC) provides significant security and usability benefits by allowing people to easily provide administrative credentials or elevation of privilege to selected processes.

posted Tuesday, March 03, 2009 12:37 PM by SvenAelterman with 0 Comments

Blog is still alive, although on life support

I couldn't blame anyone for thinking that this blog is dead. However, it's not. I could come up with scores of excuses as to why I haven't posted anything, but that won't serve any valuable purpose.

Rather, I'd like to write something about the subjects I can post about, namely

  • The betas of Windows Vista and Office 2007.
    I've installed them both, and I am gradually learning the differences and the exciting new features. Many pundits always claim that upgrades such as these have very little to offer in terms of business value. While I believe that they often make good points, I also think that for true "Information Workers" (I don't like that term very much...), the differences between Office 95 and Office 2007 are certainly significant. I am using such a big timespan to illustrate that over an 11-year period, there are significant advances in software. If each individual upgrade didn't provide benefits, where did these combined advances come from?
    Office 2007's new user interface is radically different. My first experiences with it are positive. I've been used many of the advanced features of Outlook and Word (Excel somewhat less) for many years now. Naturally, I was apprehensive about this new interface. I was afraid that I wouldn't be able to find the commands I was looking for anymore. Good news on that front: everything is right where I would expect it to be. The first time using a command, it might take perhaps a second or two, but the new interface grows on me quickly. Whether or not novice users will now actually be able to find and use the advanced features more easily remains to be seen. I suspect that they might.
  • Visual Studio 2005 and SQL Server 2005
    They have been available for several months now, of course. If you've read my blog before, you'll know that I've been developing applications using Visual Studio 2005 for quite some time. Visual Studio is not without its problems (Service Pack, please...), but I believe that Microsoft is committed to fixing some of the problems they introduced (witness thereof the new Web Application Project and Web Deployment Project templates).
  • Atlas
    I don't buy into the Web 2.0 etc. hype. But, AJAX does offer benefits. I've been developing an application that requires a form to be completed in a number of steps; and within each step, the web server has to provide more data based on user selections. While regular ASP.NET can handle that just fine, refreshing entire (complex!) web pages versus just a few of the elements on them is very different. The user experience is enhanced significantly by allowing a page to be partially refreshed. Speed is one factor. I know the form inside out, and I can complete it in about 60 seconds with AJAX. It takes over 2 minutes if AJAX is not enabled. The difference: the web server response time.
    I don't recommend site designs that do not ever navigate to a new web page, because there are certainly many issues with that approach, including manageability and accessibility.
  • VOIP
    I recently switched to Voice over IP at home and in the office. I am impressed with the quality, the features and the price. However, using cable modem connections at both locations highlights one important point: Using QoS (Quality of Service) is absolutely necessary. Backups at the office are done over the Internet to a remote site, and these uploads take up most/all of the available uplink bandwidth. Having a phone conversation at the same time is impossible without bandwidth management.

I hope to be writing about these subjects more soon.

Sven Aelterman.

posted Monday, June 05, 2006 1:47 PM by SvenAelterman with 0 Comments

Alabama Code Camp: Great Event

The Alabama Code Camp last Saturday was, from my perspective, a success. I thought that attendance was high and the quality of the sessions I attended good to very high. Thanks to the sponsors for enabling this (including a "free lunch").

The only side of the event I liked less was the venue. Computer classrooms are not the best places to sit and watch demonstrations. Also, the building is a complete maze and there are no pointers whatsoever to help you find a particular room number.

I believe people who came to my presentation were satisfied. Unfortunately, one hour was not nearly enough to show what I really wanted to show. My slides and the code for WSE 2.0 have been posted. I am working on an issue with one of the demos in WSE 3.0, but expect those files to be posted soon. I need to mention that the idea for Demo 2 in my presentation was obtained from William Stacey's blog.

Security Gaffe

One thing that is nearly as funny as this, is a poster I noticed at the Virginia College, Palisades II campus (where the Code Camp was held). The poster was meant to inform their students of the availability of a virtual library. As such, it was posted at the main entrance. Unfortunately, the poster included not only the URL to the virtual library, but also the password...

I wonder why they even bother to have a password then? (Note that I didn't actually try this out, and it's possible that the virtual library is only accessible through their student portal site, which probably requires a separate logon. Still, it makes no sense to have a secondary password then.)

posted Sunday, October 30, 2005 2:06 PM by SvenAelterman with 0 Comments

An improved Microsoft Excel color banding solution

Today, someone asked me if it was possible to make Excel highlight the column and the row of the cell that is selected. Excel already highlights the column and row header, but when working on a high-resolution screen, that does not help much in ensuring that you are actually entering data in the right cell.

I set out to find a solution, and on the Microsoft Office Assistance site, I found [1]. While this certainly works, it has a major drawback: any conditional formatting that is applied to any cell in your worksheet is lost. The worksheet for which this solution was needed didn't actually have any conditional formatting, but I figured that that might change and users would probably never figure out why their conditional formatting was always lost.

The problem with the solution at [1] is that it indiscriminately removes all conditional formatting in the worksheet. I figured that a better solution can be found if you merely keep track of the previously highlighted area. That way, you only need to undo the conditional formatting the macro applied, rather than all of it. In addition, the macro can be improved even further by only removing the conditional formatting that actually matches the conditional formatting it previously set. In other words, only delete the conditional formatting if the formula and the expression matches what the macro itself applies.

That conditional formatting is very simple, by the way. It merely applies a background color (which is guaranteed to be different from any background color the cell already has and from the font color in the cell) if the formula "TRUE" is True, which it always is, of course.

An additional improvement I made is that the last "banding" is removed before the workbook is closed. That way, when you open the workbook next time, there are no oddly highlighted cells. If that would happen anyway, the solution is simple of course: just put the cursor cell that was selected before the workbook was saved and then move it away from that cell.

Here's the VBA code that achieves this. Just copy and paste it in your workbook's ThisWorkbook VBA code.

Option Explicit

Private LastTarget As Range

Private Sub Workbook_BeforeClose(Cancel As Boolean)

    UndoBanding LastTarget
   
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal target As Range)

    ' Undo last target band coloring
    UndoBanding LastTarget
   
    ' Save the current target as the last target
    Set LastTarget = target
   
    ' Band color the current target
    DoBanding target
   
End Sub

Private Sub UndoBanding(ByVal target As Range)

    Dim c As Range
    Dim CurrentRow As Integer, CurrentColumn As Integer
    Dim i As Integer
   
    If (Not target Is Nothing) Then
        ' Undo in the actual target cell(s)
        If (target.Cells.Count = 1) Then
            UnBandCell target
        Else
            UnBandCell target.Cells(1, 1)
        End If
       
        ' Un-highlight the same column's cells above
        CurrentRow = target.Cells(1, 1).Row
        CurrentColumn = target.Cells(1, 1).Column
       
        For i = CurrentRow - 1 To 1 Step -1
            UnBandCell target.Worksheet.Cells(i, CurrentColumn)
        Next i
       
        ' Un-highlight the same row's cells to the left
        ' TODO: How about other cultures? (R-t-L)
        For i = CurrentColumn - 1 To 1 Step -1
            UnBandCell target.Worksheet.Cells(CurrentRow, i)
        Next i
    End If
   
End Sub

Private Sub DoBanding(ByVal target As Range)

    Dim HighlightColor As Variant
    Dim c As Range
    Dim CurrentRow As Integer, CurrentColumn As Integer
    Dim i As Integer
   
    If (Not target Is Nothing) Then
        HighlightColor = target.Interior.ColorIndex
       
        ' Ensure that a proper color is selected
        If (HighlightColor < 0) Then
            ' The default is light blue
            HighlightColor = 37
        Else
            ' Add 1 to the color index of the current cell
            HighlightColor = HighlightColor + 1
        End If
       
        ' Highlight the actual target cells
        If (target.Cells.Count = 1) Then
            BandCell target, HighlightColor
        Else
            BandCell target.Cells(1, 1), HighlightColor
        End If
       
        ' Highlight the same column's cells above
        CurrentRow = target.Cells(1, 1).Row
        CurrentColumn = target.Cells(1, 1).Column
       
        For i = CurrentRow - 1 To 1 Step -1
            BandCell target.Worksheet.Cells(i, CurrentColumn), HighlightColor
        Next i
       
        ' Highlight the same row's cells to the left
        ' TODO: How about other cultures? (R-t-L)
        For i = CurrentColumn - 1 To 1 Step -1
            BandCell target.Worksheet.Cells(CurrentRow, i), HighlightColor
        Next i
    End If
   
End Sub

Private Sub UnBandCell(ByVal cell As Range)

    Dim fc As FormatCondition
   
    If (Not cell Is Nothing) Then
        ' If this cell has any conditional formatting at all
        If (cell.FormatConditions.Count > 0) Then
            ' Find the conditional formatting this macro applied
            For Each fc In cell.FormatConditions
                ' This is based on the formula and the expression type
                ' Note: in the very unlikely case that someone actually has a use for
                ' this conditional formatting, it would be deleted also
                If (fc.Formula1 = "TRUE" And fc.Type = 2) Then
                    fc.Delete
                End If
            Next
        End If
    End If

End Sub

Private Sub BandCell(ByVal cell As Range, ByVal color As Variant)

    ' Ensure that the cell's background color is not the same as the color about to be applied
    If (color = cell.Interior.color) Then
        color = color + 1
    End If
   
    ' Ensure that the cell's font color is not the same as the color about to be applied
    If (color = cell.Font.color) Then
        color = color + 1
    End If
   
    ' If there are no conditional formattings applied yet
    If (cell.FormatConditions.Count = 0) Then
        ' Apply it
        cell.FormatConditions.Add xlExpression, , "TRUE"
        cell.FormatConditions(1).Interior.ColorIndex = color
    End If
   
End Sub

Not all is well with this solution. Because four loops have to be executed and conditional formatting is applied on a cell-by-cell basis, slower machines may experience a delay, especially the further away from the A:1 cell the cursor is positioned. Also, if it would so happen that all cells that would be highlighted by this macro already have conditional formatting applied, not a single cell will be highlighted. Of course, this does not cause any harm, but then again, the macro doesn't do anything to make the spreadsheet easier to use either.

[1]: http://office.microsoft.com/en-us/assistance/HA011366231033.aspx

posted Wednesday, October 05, 2005 2:36 PM by SvenAelterman with 0 Comments

Spam control

I just read an article on the BBC News web site that deals with spam and how users's "bad" behavior sustains it.

As I am sure everyone does

  1. I hate spam. It is counterproductive, gives the companies involved a bad name, and is a waste of costly bandwidth.
  2. I receive spam. About 40%-60% of messages daily are spam.

Here's what I do to combat spam. Not all of these measures will be appropriate for everyone.

  • Use several e-mail addresses. That's an easy one. If you have to fill out a form online to get something or to register on a site, use a different e-mail account than the one you use for work or personal purposes. That way, if the address ends up in the wrong hands, they can only send messages to that address. You could get a (second?) Hotmail, Yahoo!, etc. account for that purpose..
  • Don't put your e-mail address in newsgroup posts, blog posts etc.
    If you really have to, scramble it. So, someone@somedomain.com could become someone_AT_somedomain.nospam.com. A human reader can interpret this, automated bots may have some issues with it. Although I think it won't be long (if it hasn't already happened) before automated bots (that scour the Internet for e-mail addresses) can reconstitute those e-mail addresses too.
  • Use anti-spam tools. Personally, I use a free tool called SpamPal. It is free, easy to use, and actually offers the ability to install plug-ins. Using such plug-ins (most of which are free and available from the SpamPal site), you can highly customize SpamPal's behavior. I get about 1 in 100 false positives and 1 in 100 false negatives. In other words, 1 in 100 messages are not flagged as spam while they should be and 1 in 100 are flagged as spam while they shouldn't be. I am not sure what the average ratio is, but to me, that sounds really good.
  • Create e-mail aliases.
    If you have your own domain name (like I have aelterman.com), host your e-mail with a host that offers unlimited e-mail aliases (one such host is DirectNIC). Why? Because then you can create an alias for each company you do business with. If your domain is somedomain.com, and you buy things from Amazon.com, create an alias amazon@somedomain.com. This has two advantages. First, if the e-mail address gets abused, you just delete the alias and you will no longer be receiving messages on that address. (if the site is legitimate, change your address in your profile of course). Secondly, it makes it easy to find out who the source of the spam is. If you all of a sudden start getting junk mail at amazon@somedomain.com, you know it has to be Amazon who leaked your address (whether intentionally or not).
  • Never ever click on a link in a spam message.
  • Never ever buy anything through a spam message. Apparently, according the BBC article, 10% of recipients actually do that.
    If you do receive a message that markets a product of interest to you, go to the company's web site by typing in their address or by using Google (or better yet, use A9, Amazon's search engine to get discounts at Amazon.com) to find out what it is. The reason for this is that the links in spam e-mail messages contain references. Those references are then used for two purposes:
    • To validate your e-mail address. If you click on the link, the spammer knows that that e-mail address is valid and in use.
    • To get paid. The more clicks and/or sales spammers generate, the more they get paid. If no one clicks on the links, no one gets paid.

So, use your common sense (how often do you buy something from someone who shows up unannounced at your doorstep?) and just delete the spam messages.

I look forward to comments on this post to find out how you combat the increasing amount of junk mail. Last note: there might be some good news, the ratio of spam messages to real messages actually declined  in February 2005 from the record high of somewhere in the 80%-range in January 2005. I am not sure if we just all started sending more valuable messages or if the amount of spam really decreased.

Hope this helps,

Sven.

posted Wednesday, March 23, 2005 11:45 AM by SvenAelterman with 0 Comments

A blog, a real blog, finally...

Hello everyone, and welcome to my first blog and my first blog post.

I have decided to join the blogosphere to share some insights gained through my work as a management and IT consultant.

To find out more about the company I work for, visit http://www.adduxis.com.

Some ground rules:

  • I can't promise that I will post on a regular basis. However, when I will post, I promise it will be checked for spelling and grammar mistakes (please do tell me if you find one) and that it will be well-researched.
    Whether or not it is interesting is up to you to decide.
  • Comments and trackbacks are allowed, but subject to censorship and review. Inappropriate comments will not make it to the list. I moderate all comments.
  • I love feedback, but won't be able answer personal e-mails and inquiries. Use the blog comments to leave me a message regarding the topic in that post.

Finally, I would like to thank to people at Telligent Systems for creating Community Server, the software product that is used to run this blog and community site. They did a great job!

I hope you will enjoy reading my material.

Sven.

posted Tuesday, March 22, 2005 7:32 PM by SvenAelterman with 0 Comments

Powered by Community Server, by Telligent Systems