The Wiert Corner – irregular stream of Wiert stuff

Jeroen Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20120127-Microsoft-Visual-Studio-2010-New-Work-Item-menu-still-loading...-(try-again-in-a-moment)

    20120127-Microsoft-Visual-Studio-2010-Cannot-navigate-to-definition.Disable-this-productivity-power-tool

    20120127-Microsoft-Visual-Studio-2010-Cannot-navigate-to-definition

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 366 other followers

Archive for July, 2010

Nick Hodges | The End of the Chow Line

Posted by jpluimers on 2010/07/30

From the comments on Nick’s excellent post (that instantly made me feel hungry <g>):

If you find your developers bringing in their own equipment to work then you know there is a problem.

That reminds me of this story: Read the rest of this entry »

Posted in About, Opinions, Personal | Leave a Comment »

LinkedIn should send “Notifications for Requests to Join My Group” #fail

Posted by jpluimers on 2010/07/30

Right now, LinkedIn does not send Notifications for Requests to Join My Group.

They should!

Right now you need to watch the LinkedIn group very frequently, otherwise you miss the “requests to join.
Mail notification would make that much less of a burden.

–jeroen

Posted in LinkedIn, Opinions, Power User | Leave a Comment »

CodePlex: choosing a license

Posted by jpluimers on 2010/07/29

One of the toughest parts on  creating a new CodePlex project is choosing a license.

As Jeff Attwood wrote a couple of years ago, choosing a license – any license – is important, because if you don’t, you declare an implicit copyright without explaining how others could use your code.
In addition to that, Jeff published a list of licenses with a one-line phrase describing them, so it becomes easier to start making a choice.

Last year, ShreevastaR extended that list in his answer to this StackOverflow.com question on CodePlex licensing.
Brian Campbell did the same a few months later on  another StackOverflow question about CodePlex licensing.
There are many more StackOverflow.com threads like those 2, and they give similar results.

The reason I want to put up a CodePlex project, is to put my sample code for conferences, blog articles and course examples on-line so they are easier to share with other people.
Most is from Visual Studio or Delphi projects using languages C#, VB.NET and Delphi.
Some of it are batch-files, XSD, XSLT, or other small snippets to get stuff working. Read the rest of this entry »

Posted in .NET, Access, CodePlex, Database Development, Delphi, Development, Firebird, InterBase, Software Development, SQL Server | 4 Comments »

.NET/C#: a generic exception class

Posted by jpluimers on 2010/07/28

I want my exceptions to be bound to my business classes.
So you need your own exception class, and are expected to override the 4 constructors of the Exception class.

But I got a bit tired of writing code like this again and again:

using System;
using System.Runtime.Serialization;

namespace bo.Sandbox
{
    public class MyException : Exception
    {
        public MyException()
            : base()
        {
        }

        public MyException(string message)
            : base(message)
        {
        }

        public MyException(string message, MyException inner)
            : base(message, inner)
        {
        }

        public MyException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
    }
}

Searching for Generic Exception Class did not reveal any generic exception classes.
So I wrote this instead: Read the rest of this entry »

Posted in .NET, C#, C# 2.0, Development, Software Development | Leave a Comment »

Visual Studio 2005/2008/2010: ContextSwitchDeadlock was detected Message (via Keith Barrows)

Posted by jpluimers on 2010/07/27

Like Keith Barrows, each time I see a message like below, I’m reminded that I forgot to change my Visual Studio 2005/2008/2010 to disable these kinds of MDA messages:

ContextSwitchDeadlock was detected
Message: The CLR has been unable to transition from COM context 0x1a7728 to COM context 0x1a75b8 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.

Steps to get rid of these messages:

  1. Start Visual Studio :-)
  2. In the menu, select “Debug”; “Exceptions…” (Ctrl-D, E)
  3. Open the “Managed Debugging Assistants” tree
  4. Uncheck the first checkbox in the “ContextSwitchDeadlock” row

Maybe I won’t forget this next time :>

–jeroen

Via: Keith Barrows : ContextSwitchDeadlock was detected Message.

Posted in .NET, Development, Software Development, Visual Studio and tools | 1 Comment »

routes.tomtom.com UI suggestion #fail

Posted by jpluimers on 2010/07/26

There is an address that I have been traveling from lately quite a bit: “Weena 505, Rotterdam, NL”.

So: routes.tomtom.com has put it in my history.

So why is it then that every time I select that address from my history, and I start planning my route, I get an additional choice of addresses to choose from this selection:

From:

  • Weena 505, Rotterdam, NL
  • Weena, Rotterdam, NL
  • Weena, Rotterdam, NL
  • The Westin Rotterdam, Rotterdam, NL

Or review your input:

  • Weena 505, Rotterdam, NL

They do this for all kinds of addresses.
It drives me nuts for two reasons:

  1. It takes an extra action from my side
  2. You cannot perform that action by keyboard (you have to use a pointing device)

Are interaction designers and UI builders ever going to learn?

–jeroen

Posted in Uncategorized | 1 Comment »

Batch files: Remove a trailing backslash (via Jon Kruger’s Blog » Minor batch file tricks)

Posted by jpluimers on 2010/07/23

Even when doing batch files for a long (20+ years!) time, sometimes you learn something new.

Today was such a day.
I wanted to remove a trailing backslash, so I searched with google.

The first hit was a posting by John Kruger showing this little piece of code:

SET Line=C:\Windows\
IF "%Line:~-1%"=="\" SET Line=%Line:~0,-1%
echo %Line% — will output: C:\Windows

(note: copy the code above, be careful with the code on John’s site as somehow his double quotes got mangled).

Note that a stackoverflow answer has the same solution.

–jeroen

via Jon Kruger’s Blog » Minor batch file tricks.

Posted in Power User | Leave a Comment »

Now where did I hear that “Aurora” codename again?

Posted by jpluimers on 2010/07/22

Now where did I hear that “Aurora” product codename name again?

Aurora seems to be the new product codename for Microsof’ts’ on-premises/cloud mix of Small Business Server.

But wait, wasn’t it eras ago that you could choose to run PHP on clouds for your business apps?

And isn’t Aurora/Delphi for PHP all about creating those apps?

–jeroen

via: Microsoft small-business server futures: 5 things to know | ZDNet / Aurora – a Microsoft cloud server for the small guy?.

Posted in Delphi, Delphi for PHP, Development, Opinions, Software Development | 2 Comments »

Delphi: great post by Malcolm Groves about Debugging Initialization and Finalization sections

Posted by jpluimers on 2010/07/21

Long time Delphi user Malcom Groves just posted an interesting video on Debugging Initialization and Finalization sections.

What I especially like is that he performs this trick using the DUnit unit testing framework for Delphi.
+1 for using unit testing!

The trick he uses is an old one, but I didn’t realize that few people know it, so it is good to put it in writing.

Note that the trick does not work in all cases (see further on an alternative), but for most cases it does work well:

  1. Open your .dpr (From the Delphi menu, choose “Project” followed by “View source”
  2. Put a breakpoint on the begin and end of your program code (see listing below)
  3. Run your project
    (note: for some Delphi versions: you have to F7 into your project)
  4. At the begin of your program Press F7 (“Run” – “Trace into”) in stead of F8 (“Run” – “Step over”)
  5. At the end of each initialization section, press F7 again (not F8!) to step into the next initialization section
  6. At the end of your program press F7 (not F8!) to step into the finalization section
  7. At the end of each finalization section, press F7 again (not F8!) to step into the next finalization

Easy, when you know, difficult to find out yourself (I found out by accident eras ago <g>).

Sometimes (I have not found out why yet) some Delphi versions refuse to work this way.
So you need an alternative, which is this one: Read the rest of this entry »

Posted in Delphi, Development, Software Development | 9 Comments »

Delphi and the ‘leaving’ of Nick Hodges

Posted by jpluimers on 2010/07/20

I’ve let this boil for a while before reacting on the let go by Embarcadero of  Nick Hodges from his R&D Manager position.

Reacting as a non-native English person is a tad difficult, as it is tough to express the fine aspects of the implications well.

So I’m posting this  in both the Delphi and Opinions category; reactions are more than welcome. Read the rest of this entry »

Posted in Delphi, Development, Opinions, Software Development | 1 Comment »

Why digital signatures are weak: VeriSign Revokes Certificate Used to Sign Stuxnet Malware

Posted by jpluimers on 2010/07/19

The Stuxnet rootkit exploit shows why digital signatures are weak.
Not so much the signatures themselves are weak, but the process around signing with digital certificates is weak:

If an unauthorized person or piece of software  gains access to the private key of the digital certificate used for signing anything, then the whole chain starting with that digital certificate is compromised.

In this case, a private key used for signing Realtek drivers was used to sign the Stuxnet rootkit drivers.

VeriSign now has revoked this particular digital certificate.
Which results into all drivers that have been signed with this revoked certificate become marked as a potential security risk.

The rootkit also revealed another security issue with the Windows Shell exploited by specially crafted .lnk files, but the risk of the digital signing process has much bigger implications.

–jeroen

via: VeriSign Revokes Certificate Used to Sign Stuxnet Malware | threatpost.

Posted in Power User | Leave a Comment »

SQL Server: conditionally performing a DROP TRIGGER

Posted by jpluimers on 2010/07/19

Sometimes you need to drop a trigger, and depending on your SCM, your database might not actually have it.

Many people start blinding querying the system tables for this (a few of those examples are revealed by this Google search query).
This might be caused by old Microsoft documentation showing this as an example back in SQL Server 2000.

This is not needed for DML triggers (that react on data changes), querying the system tables is only needed for DDL triggers (that react on DDL actions).

For DML triggers (the vast majority!), you can use OBJECT_ID in stead. Read the rest of this entry »

Posted in Database Development, Development, SQL Server | Leave a Comment »

Solution: Can’t paste on a web-site with Ctrl-V

Posted by jpluimers on 2010/07/16

Quite a few web sites have fields where you cannot paste with Ctrl-V.
I don’t know why: pasting text input is a great way to speed up your work.

A solution for most of them: Read the rest of this entry »

Posted in Uncategorized | 1 Comment »

A few updates to: Google Calendar – printing multiple months or weeks to PDF

Posted by jpluimers on 2010/07/15

Thanks to Kilian Croese, I updated the Google Calendar – printing multiple months or weeks to PDF posting with this info:

  • No need to use Fiddler any more for obtaining the base printing URL.
  • Added information for these parameters:
    • pfs (font size)
    • po (page orientation)
    • pbw (black & white)
  • In addition, I improved the documentation on the parameter rand (which is a JavaScript EPOCH value)
  • Finally I dug a bit deeper into the page sources, and added information about these parameters:
    • pjs (PDF Printing Java Script)
    • pda (PDF download)

The original post is now both far easier to use, and much more complete.

–jeroen
Via: Google Calendar – printing multiple months or weeks to PDF « The Wiert Corner – Jeroen Pluimers’ irregular stream of Wiert stuff.

Posted in Google, Google Apps, Power User | Leave a Comment »

SQL Server: SELECT multiple declared variables

Posted by jpluimers on 2010/07/14

Declared @local_variables and parameters in stored procedures are a very handy feature of SQL Server.
They allow for local storage, and for passing information around without storing them in your database first.

You can assign values by using both SET @local_variable, and SELECT @local_variable.
Note that these are different than a regular SET or regular SELECT.
In addition, SET @local_variable and SELECT @local_variable are different too.
Though Microsoft recommends using SET, there are a differences between SET and SELECT, which can make SELECT a lot faster in loops.

Assigning multiple @local_variables in a single SELECT query

There seem to be no examples (or very few: as I could not find them) about using the SELECT @local_variable to select values into multiple @local_variables from a query.
This can be very useful,  so here is a small example: Read the rest of this entry »

Posted in Database Development, Development, SQL Server | Leave a Comment »

SQL Server 2005 script to restore .BAK file to a database in a specific directory

Posted by jpluimers on 2010/07/13

Recently I needed a way to automate some testing on SQL Server 2005.
The easiest way was to start with restoring some predetermined database state from a .BAK file.
Hence I wrote the script below.

Next to SQLCMD, this script uses SubInACL, which you can download here (don’t worry that version seems to be only for Windows 2000..2003: it still works in Windows 7).

Microsoft does not have much documentation (except the built-in by calling “SubInACL /help /full”.
But this SubInACL page has some more insight on how to use it. Read the rest of this entry »

Posted in Database Development, Development, SQL Server | Leave a Comment »

RT: JQuery: Novice To Ninja ebook free for 24 hours (or less now, I guess) – DelphiFeeds.com

Posted by jpluimers on 2010/07/12

If you want JQuery: Novice To Ninja ebook for free, then hurry :)

–jeroen

via: JQuery: Novice To Ninja ebook free for 24 hours (or less now, I guess) – DelphiFeeds.com.

Posted in Development, JavaScript, Web Development | Leave a Comment »

7 screens; 3 computers; 1 keyboard/mouse to direct them all: Input Director

Posted by jpluimers on 2010/07/12

At home, I have 7 screens on 3 computers on the same desk.

That sounds like a clutter, but all these keyboards and mice hooked up to them add even more clutter.

Until I found out about Input Director a while ago: a (virtual)  Software KVM to Control Multiple Computers.
It took only a few minutes to setup, and works like a breeze.

I have played around with it for about 2 months now, and it is great: I did not have to change any settings since the initial – and easy – setup.

Now I just use the keyboard/mouse that are most convenient to my situation: all keyboard/mice can control all computers and monitors.

A breeze indeed!

–jeroen

Posted in Power User | Leave a Comment »

Windows 7 shortcuts in Vista or XP

Posted by jpluimers on 2010/07/09

A while ago, I posted about Windows 7: new shortcut keys (windows hotkeys and more).

When you are in Vista or XP, you can feel a bit ‘lost’ missing those new keyboard shortcuts.

I just learned there is a tool that supplies the new Windows 7 keyboard shortcuts in Vista and XP :-)

–jeroen

Posted in Power User | Leave a Comment »

Date Time SQL Queries: Formatting Date Time Values for Access SQL in Delphi

Posted by jpluimers on 2010/07/08

Five words:

use parameters instead of literals.

via: Date Time SQL Queries: Formatting Date Time Values for Access SQL in Delphi.

Edit: Fixed “in stead of” into “instead of”: learned something new today :-)

–jeroen

Posted in Delphi, Development, Software Development | 9 Comments »

Hardening WordPress: when 10 Useful WordPress Security Tweaks are not enough

Posted by jpluimers on 2010/07/07

Last week, Jean-Baptiste Jung started a bit of a stir when posting on Smashing Magazine about 10 Useful WordPress Security Tweaks.

He totally missed the official Hardening WordPress page and generated a lot of comment traffic.
All of his tweaks were rebutted by commenter Vid Luther (Mobile Commerce and Technology Evangelist and ZippyKid owner) in a separate How to Secure a WordPress Site.

This once again shows that for serious work you really need to know what you are doing.
If you don’t, then leave the work to people who do: Vid is one of those guys.

–jeroen

via: 10 Useful WordPress Security Tweaks – Smashing Magazine.

http://www.smashingmagazine.com/author/jean-baptiste-jung

Posted in Development, Software Development, Web Development, WordPress | Leave a Comment »

Chrome – report New Issue – chromium

Posted by jpluimers on 2010/07/06

For my reference: Report a New Issue – chromium.

Posted in Power User | Leave a Comment »

Delphi interfaces on binary level « The Programming Works

Posted by jpluimers on 2010/07/06

This interesting post by Serg Kas on Delphi interfaces on binary level didn’t make it on DelphiFeeds, hence my reference to it.

It is a nice post about the inner workings of interfaces in Delphi.

Recommended reading!

–jeroen

via: Delphi interfaces on binary level « The Programming Works.

Posted in Delphi, Development, Software Development | Leave a Comment »

Alternative PDF viewers

Posted by jpluimers on 2010/07/06

Some alternatives to Adobe Reader for the Windows platform:

The development channel of Google Chrome now has a rudimentary built-in PDF viewer.

–jeroen

Posted in Power User | 2 Comments »

Bleeding Edge: Vodafone UMTS caused WordPress.com “edit link” to be broken in Google Chrome. #fail

Posted by jpluimers on 2010/07/05

Last week I wrote about Bleeding Edge: version WordPress.com “edit link” broken in latest Google Chrome stable build – or is Vodafone causing this? #fail.

Since then I have researched this further: I verified that the http://1.2.3.4/bmi-int-js/bmi.js link indeed was caused by Vodafone.

They use a mechanism of directing all HTTP traffic through a transparent proxy and rewriting both the HTML and images in compressed form in order to save bandwidth.

There are a few problems with this:

  1. The only way to turn this off is if your UMTS card or USB dongle is connected to your laptop (mine is on a router) and use the buggy “Vodafone Mobile Connect” software (which managed to add 32 virtual COM ports to one of my systems, and made that system not recognize any other USB devices any more).
    If someone finds out a way to disable this “feature” in a generic way, please net me know.
  2. They screw with your images, so you loose quality (pretty useless if Vodafone UMTS is the only connection you have on a certain location, and you need to verify image quality)
  3. They interfere with HTML editing (ideal when posting through sites like WordPress: now I need to check if none of my posts from last month have strange HTML in them).
  4. Somehow parts of the rewritten HTML end up in the cache, and since they use an hard-coded IP address, you are basically hosed.

The solution is simple:

  1. clear your browser cache when you switch from Vodafone UMTS back to a regular connection.
  2. switch to HTTPS connection when you are using Vodafone UMTS so you skip their transparent proxy
    (this only works if your sites can be accessed both by HTTP and HTTPS; for instance https://wiert.wordpress.com works, but their “Press This” bookmarklet defaults to HTTP).

–jeroen

Posted in Power User | Leave a Comment »

Original Administrator Account Does Not Appear During Friendly Logon Method

Posted by jpluimers on 2010/07/02

My Windows XP VM’s all use the classic logon, so logging in as Administrator involves just typing in the Administrator name and a password.

Recently though I had to use a VM with a “Frienly Logon” configuration (the one where you see icons for all available logon users), which did not list the Administrator user.

As a reminder to self: how to logon as Administrator when that account is not visible in the “Friendly Logon” account list. Read the rest of this entry »

Posted in Power User | Leave a Comment »

TFS: Undoing a checkout that belongs to another user – via TFS Version Control and more

Posted by jpluimers on 2010/07/01

I recently needed to undo a TFS checkout from a user on another workspace.
This particular user had an exclusive lock on the document, was scheduled to be away for considerable time, and I was supposed to finalize that document.

I know that performing the undo is not possible from the Visual Studio UI: you need use the TF command-line application for this kind of work.

Fiddling on my own with the TF undo syntax didn’t get me the results right away, so I was glad to find this “Undoing a checkout that belongs to another user” post by mrod (Mario Rodriguez) from Microsoft.

The trick was to include the bold part: Read the rest of this entry »

Posted in Development, Source Code Management, TFS (Team Foundation System) | 3 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 366 other followers