The C# conditional operator is a kind of shorthand for an if…else statement. For example, this code:
int result; if (y == 0) result = 0; else result = x/y;
Can be rewritten using the conditional operator:
int result = (y == 0) ? 0 : x/y;
Terseness isn’t a goal in and of itself, . . . → Read More: Type inference and the conditional operator
The .NET WebClient class abstracts away most of the complexity associated with downloading data from and uploading data to Web sites. Once you instantiate a WebClient instance, you can upload or download a page with a single line of code. For example:
var MyClient = new WebClient(); // Download a page string pageText = . . . → Read More: Throwing the wrong exception
We do a fair amount of batch processing at work, and I have some fairly involved scripts that are combinations of Windows batch files and VBScript. Both languages are wonky in the extreme, and I’ve been uncomfortable working with them. But it’s what I knew I knew four years ago. What were simple scripts early . . . → Read More: Powershell
I’ve often heard, “You are what you eat” It’s true. What you eat and how much you eat accounts for a very large part of your physical development.
What you don’t hear as often (if ever) is that, mentally, you are what you read, watch, listen to, or otherwise experience.
Information theory deals with the . . . → Read More: You are what you read
Serendipity is an odd thing. Shortly after I wrote my previous entry, I stumbled across a possible solution to the problem while I was reading comments on an unrelated blog post. I spent a little time this morning checking it out.
According to Microsoft Technet, the LargeSystemCache registry entry controls file caching behavior. This key, . . . → Read More: More Windows file caching
Operating systems use file caching to prevent having to read commonly-accessed information from the disk repeatedly. Depending on the situation, the operating system might keep the most recently read stuff in memory, or it might keep the most commonly accessed stuff in memory. Either way, the system dynamically adjusts how much memory it uses for . . . → Read More: Windows file copy bug revisited
I’ll admit, I have my oddities. As a programmer and writer, I’ve always found vertical screen space to be precious. I like to see lots of lines of code or text. So anything I can do to increase the number of lines that I can see is a benefit. Years ago, when Windows 95 first . . . → Read More: Lock the taskbar!
Salad claws are implements used for tossing or serving salad. They come in many different forms.
These claws are about four inches long and three inches wide, and are carved from two different pieces of yellow poplar. As you can see, one piece has a lot more of the greenish color that the wood is . . . → Read More: Salad Claws