The Wiert Corner – irregular stream of stuff

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

  • My badges

  • Twitter Updates

  • Pages

  • All categories

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

    Join 1,839 other subscribers

Hanselman’s Newsletter of Wonderful Things: December 17th, 2013 – Scott Hanselman

Posted by jpluimers on 2014/02/03

Always an interesting read, and usually posted to his blog a while after the email blast gets out.

There is too much information to fully re-post here, so here is an abstract of the entries I already had benefits from, or have a high interest in:

(BTW: don’t you love the that the bug report about WordPress.com adding backslashes in the “Press This” functionality still got no official WordPress response after 3 months?)

–jeroen

via: Hanselman’s Newsletter of Wonderful Things: December 17th, 2013 – Scott Hanselman.

Posted in Development, Power User, Software Development, Windows | Leave a Comment »

idank/explainshell: explainshell.com – match command-line arguments to their help text

Posted by jpluimers on 2014/02/03

This is brilliant for learning *nix shell programming:

explainshell.com – match command-line arguments to their help text

explainshell is a tool (with a web interface) capable of parsing man pages, extracting options and explain a given command-line by matching each argument to the relevant help text in the man page.

It has open source code at gitub too: idank/explainshell.

–jeroen

Posted in *nix, Development, Linux, Power User, Scripting, Sh Shell, Software Development, SuSE Linux | Leave a Comment »

K-Type Independent Type Foundry » Freebies

Posted by jpluimers on 2014/01/31

Yes, I’m a font addict (:

K-Type Independent Type Foundry » Freebies.

Most of their fonts have at least one style that is a Freebie for non-commercial use too, a great way to experiment with some of their fonts: Read the rest of this entry »

Posted in About, Font, LifeHacker, Personal, Power User | Leave a Comment »

Sanibel Island Bike Trail Sections

Posted by jpluimers on 2014/01/30

The bike paths on Sanibel are very well suited for running. Sanibel Island Bike Trail Sections.

–jeroen

Posted in LifeHacker, Power User | Leave a Comment »

.NET/C#: refactoring some C# 1 code that uses HashTables as a poor mans property bag (via:Stack Overflow)

Posted by jpluimers on 2014/01/30

A while ago, I was refactoring some C# 1 code that uses HashTables as a poor mans property bag.

The problem was that I felt my code was convoluted, and should be denser, especially avoiding Convert.ChangeType. My code was already much simpler than casting tuples to a superclass.

So I asked this question on StackOverflow: c# – Is there a solution that feels less clumsy than Convert.ChangeType to get the value from a HashTable – Stack Overflow.

User dasblinkenlight showed it could be shortened and explained why (hyperlinks are mine):

Since System.String is sealed, the expression

genericType.IsSubclassOf(stringType)

is the same as

genericType == stringType

Therefore you do not need a call of Convert.ChangeType: you can cast to T by casting to object, like this:

object stringResult; // Note the change of type to "object"
if (haveValue)
    stringResult = ((string)properties[propertyName]).Trim();
else
    stringResult = string.Empty;
result = (T)stringResult; // It is allowed to cast object to generic T

The original .NET 1.1 code had loads of null checks wrapped if/then/else statements to assign default values for null values.
I wanted to get rid of that, and get code like this: Read the rest of this entry »

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

Amazon Glacier off-site backup Pricing

Posted by jpluimers on 2014/01/30

Wow, I didn’t expect these prices to be so low: Pricing.

I wonder what other providers there are.

–jeroen

Posted in Backup, Power User | Leave a Comment »

1/9998 = 0.0001 0002 0004 0008 0016 0032 0064 0128 0256.. | Hacker News

Posted by jpluimers on 2014/01/30

1/9998 = 0.0001 0002 0004 0008 0016 0032 0064 0128 0256.. | Hacker News.

Posted in Power User | Leave a Comment »

delphi – With a class operator is an implicit typecast to itself allowed? – Stack Overflow

Posted by jpluimers on 2014/01/29

In the series “interesting stuff you can do with Implicit operators”: delphi – With a class operator is an implicit typecast to itself allowed? – Stack Overflow.

Be careful though, as Implicit assignment will allow more code paths to the compiler than you expect at first sight (:

–jeroen

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Leave a Comment »

.NET/C#: fun with enums and aliases part 2

Posted by jpluimers on 2014/01/29

In the .NET/C#: fun with enums and aliases part 1 you saw that an enumerated type can specify an underlying type.

The underlying type is limited to a strict set of built-in C# types: , so you cannot use a CTS type for it.

So you might think that you can only define enumeration values by integer constant like this:

namespace BeSharp
{
    enum TwoState
    {
        False = 0,
        True = 1,
    }
    enum ThreeState
    {
        False = 0,
        True = 1,
        Unknown = -1,
    }
}

Well, you can do it like this too, since Operations between different enum types are allowed in another enum declaration: Read the rest of this entry »

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

Clean Up And Shrink VMWare Fusion Virtual Machines With Ease | The Webernets

Posted by jpluimers on 2014/01/29

While getting a Retina MacBook Pro screen replacement, I upgraded from VMware Fusion 4 to VMware Fusion 6 and found out it is really easy to Clean Up And Shrink VMWare Fusion Virtual Machines With Ease | The Webernets.

That saved me bout 100 gigabyte across in total.

Sometimes tiny things not much advertised make an upgrade worthwhile.

Note that as usual some restrictions apply (like not having snapshots, having a backup, and the machines needing to be in the “shut down state), but it went really really smooth (probably the SSD helps a lot here).

–jeroen

Posted in Apple, Fusion, Mac, MacBook, MacBook Retina, MacBook-Pro, Power User, VMware | Leave a Comment »