The Wiert Corner – irregular stream of stuff

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

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

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

    Join 1,862 other subscribers

Archive for July, 2013

Reminder to Self: Messagepack / BSON / ProtocolBuffers

Posted by jpluimers on 2013/07/25

Need to find/create a Delphi compatible version of Messagepack or BSON.

–jeroen

via Serializing and deserializing (packing/unpacking) to a file and/or memorystream with MessagePack in C# ».

Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Delphi, Delphi XE2, Delphi XE3, Development, Software Development | 4 Comments »

.NET/Visual Studio: VersionInfo extension checks if you have the latest service pack/update/hotfixes installed

Posted by jpluimers on 2013/07/24

For Visual Studio 2010 and up (including Visual Studio 2012), the VersionInfo extension will check if you have the latest service pack, update and hotfixes installed.

Of course you can manually check the List of available VS2010 hotfixes, or follow the lists maintained by Terje Sandstrom:

But installing the Visual Studio 2010/2012: Version and update information tool is much easier.

–jeroen

.

.

.

Posted in .NET, Development, Software Development, Visual Studio 11, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

.NET/C# assemblies and namespaces

Posted by jpluimers on 2013/07/23

Ever since I started .NET programming after .NET Beta 1 Arrived in 2001, I found that many people struggle with the relation between assemblies and namespaces.

So I was glad that I posted this answer about 2.5 years ago on StackOverflow. Below is the slightly edited form:

People are easily confused by the namespace/assembly thing, as it decouples the concept of where your code is physically located (the assembly) and how you reference it:

  • logically reference is by using the namespace
  • physical reference is by referencing the assembly

I usually explain the relation using the word contribute:

  1. An assembly can contribute to multiple namespaces.
    For instance, the System.Data.dll assembly contributes to namespaces like System.Data (e.g. the class System.Data.DataTable) and Microsoft.SqlServer.Server (e.g. the class Microsoft.SqlServer.Server.SqlContext).
  2. Multiple assemblies can contribute to a single namespace.
    For instance both the System.Data.dll assembly and the System.Xml.dll assembly contribute to the System.Xml namespace.
    Which means that if you use the System.Xml.XmlDataDocument class from your project, you need to reference the System.Data.dll assembly.
    And if you use the System.Xml.XmlDocument class, you need to reference the System.Xml.dll from your project.

(the above examples are .NET 4.0, but likely hold for previous .NET versions as well).

Danny Thorpe explained the concept of namespace and internal really well, so I won’t go into detail about those.

Ever since I started .NET courses 10 years ago, I draw a table explaining assemblies and namespaces like this:

Assemblies contributing to namespaces
Assembly Namespaces it contributes to
System.Data Microsoft.SQLServer.Server System.Xml
↑ Example classes
System.Data.dll DataTable SqlContext XmlDataDocument
System.Xml.dll XmlDocument

–jeroen

via: C# assemblies, whats in an assembly? – Stack Overflow.

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, .NET CF, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »

Keyboard shortcut for resizing all columns in a listview control to fit – The Old New Thing – Site Home – MSDN Blogs

Posted by jpluimers on 2013/07/22

I always forget this one:

The keyboard shortcut for resizing all columns in a report-mode (also known as Details mode) list view control to fit the current content width is Ctrl+Num+. That’s the + key on the numeric keypad.

–jeroen

via Keyboard shortcut for resizing all columns in a listview control to fit – The Old New Thing – Site Home – MSDN Blogs.

Posted in Keyboards and Keyboard Shortcuts, Power User, Windows | Leave a Comment »

Some Buffalo – WLAE-AG300N links

Posted by jpluimers on 2013/07/21

Some Buffalo WLAE-AG300N links:

–jeroen

via: Buffalo – Downloads – Performance Matters.

Posted in Power User, WiFi | Leave a Comment »

Logitech Logimouse C7 and Mouse programmers toolkit PDFs at Bitsavers

Posted by jpluimers on 2013/07/20

Bitsavers published 2 new Logitech PDFs:

Who didn’t have a Logitech mouse back then?

I had the C7, various MouseMans, and a few more modern mice. Why not all mice? I developed RSI in the DOS era, ending up with TrackPoints and more recently Apple touchpads)

I remember the Logimouse C7, not because it was from Logitech, but because it was available from so may OEMs. Long before Logitech built OEM mice for Apple, they were founded in Apples, Swizerland.

The cool thing: the Programmers Toolkit had examples in Modula-2. I used that as a base to write quite some Turbo Pascal code for mouse handing.

Oh: Bitsavers does have a Logitech Modula-2 PDF online too for quite some time. I mentioned that in More Old Micro Cornucopia issues on BitSavers from 1987 and 1988.

–jeroen

via: Bitsavers’ Index of /pdf/logitech.

Posted in BitSavers.org, Development, History, Pascal, Power User, RSI, Software Development, Turbo Pascal | Tagged: , , , | Leave a Comment »

How to Crack a Wi-Fi Network’s WPA Password with Reaver

Posted by jpluimers on 2013/07/19

Wow, I thought WPS always required a button press on a device.

It appears it doesn’t  on many device, and cracking therefore is way to easy: How to Crack a Wi-Fi Network’s WPA Password with Reaver.

–jeroen

Posted in Power User, WiFi | Leave a Comment »

Research list: Offline Blog editors that support WordPress.com

Posted by jpluimers on 2013/07/19

Some links for my research list on offline blog editors that support WordPress.com blogs:

–jeroen

Posted in Power User, SocialMedia, WordPress | Leave a Comment »

Delphi virtual constructors: example of the “Factory” design pattern (via: Stack Overflow)

Posted by jpluimers on 2013/07/18

I bumped into the below answer that I gave a while (what is 4 years in a developer’s life ) on StackOverflow.

It is about Delphi Design Patterns. Sepcifically the Factory Pattern, and explains how virtual constructors implement it.

They are one of the 3 corner stones on which the component based Delphi form designer and object inspector are built:

  • Virtual constructors
  • Properties (events are just a special form of property)
  • Run-Time Type Information.

So here it goes: Read the rest of this entry »

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Software Development | 6 Comments »

C#: combining “adding `char` and `int` and “`a += b` means `a = a + b`, but `a += b + c` does not mean `a = a + b + c`”.

Posted by jpluimers on 2013/07/18

A while ago, I wrote about .NET/C# duh moment of the day: “A char can be implicitly converted to ushort, int, uint, long, ulong, float, double, or decimal (not the other way around; implicit != implicit)”.

There is another duh moment having to do with the various C# operators like += which is being described as being

a += b

is equivalent to

a = a + b

You might think that this also holds:

a += b + c

is equivalent to

a = (a + b) + c

But Eric Lippert has explained this is not the case: it is equivalent to:

a = a + (b + c)

In his explanation, he also shows the confusion can get you very surprising results if you mix string, chars and ints in the expression: depending on the statement and ordering, you either concatenate characters, or add ints to characters.

He also recommends you should not do concatenation: either use String.Format, or StringBuilder. I totally agree with that.

Recommended reading!

–jeroen

Posted in .NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »