Ternary: Reducing code

I like my scripts to be readable and terse.  They’re scripts after all and I want to get the most done with the least amount of code.  There’s a lot to be said for having a readable script but I only value that when I intend to keep the script around for awhile.  PowerShell does…

1

C# Lambda Type Inference

One of the limitations of C# type inference is that you cannot use it to infer the type of a lambda expression.  For example, the following code will not compile var f = () => 4; Normally this is not too much of an issue because you can just explicitly declare the type of the…

1

Filtering get-psdrive to all Local Drives

Recently I needed to filter the return of get-psdrive to return all of my local hard drives.  I didn’t want to accidentally start operating on floppies, CDROM’s and more importantly, network drives.  There are a couple of ways to do this but I found the most straight forward is to combine the WMI data with…

2

Types of Immutability

By definition, an immutable object in computer science is one that is not able to change.  Parallel coding is becoming more necessary as the number of cores in a processor are increasing but not the overall speed.  As such immutability is will become more important because it is an important asset of multithreaded programming.  Immutable…

3

Getting my Fortune

Fortune is a Unix command that gets a random message from a set of databases and displays it on the screen.  These messages have a wide variety but tend to be funny, quirky or famous quotes (most are indeed geeky).  Nearly all unix systems have a version of Fortune.  Windows doesn’t have any version by…

1

ViEmu and Suites

ViEmu is a Visual Studio Package which adds Vim keybinding support into Visual Studio.  For former VI users this is huge benefit as I can use all of my cryptic key combinations inside of Visual Studio. For those unfamiliar, Vi is one of the original editors for the Unix operating systems.  Vim (VI iMproved) is…

1