DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 637 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

Klaus Subscribe to this feed
Klaus
Profile Kicked Submitted Comments Tags Friends Kicked By Friends Submitted By Friends

Stories submitted by Klaus
2
kicks
submitted by Klaus Klaus 2 days, 23 hours ago

tellingmachine.com — We just made it through the holidays and I finally found time to write about the most annoying thing in PowerShell: Hash table semi-automatic, which can easily result in some subtle bugs. And all of that, just because the hash tables don't behave as I would expect. I assumed hash tables to be implicitly sorted by the keys using the Sort-Object cmdlet and to always stay hash tables and not get converted into arrays of Dictionary Entries or even a single Dictionary entry when piped into a Where-Object cmdlet. To workaround these strange defects you need to apply some unnatural constructs and roll your own select statements. It just doesn't feel fair to make your children call GetEnumerator() before they try to find today's window on their Advents Calendar. read more...

Add a comment add a comment | category: | Views: 5
tags: , , | tag it

2
kicks
submitted by Klaus Klaus 21 days, 23 hours ago

tellingmachine.com — PowerShell has a great potential, but it needs professional tool support in order for it to mature. The current solutions are far too amateur. Here is my list of PowerShell improvements for Santa Claus read more...

Add a comment add a comment | category: | Views: 13
tags: , , , , | tag it

19
kicks
published 28 days, 12 hours ago, submitted by Klaus Klaus 28 days, 15 hours ago

tellingmachine.com — Yes I did it. I downloaded all 65,563,667,714 bytes and saved them as 407 files on my nice new WD Passport hard drive that I brought home from the PDC2008. And, yes I did it the old fashioned manual way: Right-Click on link and Save-As. But you don't have to do it. In this blog post I provide the metadata of all the files I downloaded and a PowerShell script that will help you automating the download process. Besides the PDC content you also get to a treasure trove of PowerShell scripting techniques ranging from dynamically generating Regular Expressions to loading meta-data form XML and CSV files. read more...

Add a comment add a comment | category: | Views: 214
tags: , , , | tag it

1
kicks
submitted by Klaus Klaus 1 month, 12 days ago

tellingmachine.com — I am almost done with my biggest PowerShell scripting project so far. The last feature that I implemented was a flexible pattern matching facility. I wrote a procedure that would try to filter out a set of file names based on the first letters and the extensions of the file. The possible name prefixes and extensions would be provided by string arrays that could contain zero or more elements. The challenge as always with PowerShell is to understand its type conversion magic. One approach to this is to use baby steps while morphing the static regex string to a dynamically built regex string. This progression and the result is captured in this blog post. read more...

Add a comment add a comment | category: | Views: 7
tags: | tag it

2
kicks
submitted by Klaus Klaus 1 month, 28 days ago

tellingmachine.com — I use a simple PowerShell script to replace some of the URLs in my blog post's html source before I publish them to www.tellingmachine.com. In my case the posts are stored as XML files. Usually I use Windows Live Writer to write my posts. I publish the documents for test purposes frequently during the authoring to the VisualStudio 2008 development web server that runs locally on my machine. Once the post is ready to put online, I take the XML file, run the PowerShell script against it and then copy it to my production server. Occasionally the XML files refuse to open in Internet Explorer after I ran the script. It took me few minutes to figure out why. Here is the story! read more...

Add a comment add a comment | category: | Views: 8
tags: | tag it

3
kicks
submitted by Klaus Klaus 2 months, 24 days ago

tellingmachine.com — Walter and I gave a presentation at the WonderWorld 2008 conference in Las Vegas last week. To get many people exited about our talk, we asked customers what they think the coolest thing on the planet is. They thought first that this is a trick question, but we didn't keep them in the dark for too long. The coolest thing on the planet is: PowerShell read more...

Add a comment add a comment | category: | Views: 9
tags: | tag it

1
kicks
submitted by Klaus Klaus 4 months, 9 days ago

tellingmachine.com — While working on a elaborate PowerShell script I needed to find a solution for the following problem: I wanted to do a string replace operation on a file system path name and have the resulting new string be reflected by the file system. For example the path name "C:\dogs\dog food\my favorites\hot dogs\Who let the dogs out.mp3" should be renamed by replacing "dog" with "cat". The resulting path name would be "C:\cats\cat food\my favorites\hot cats\Who let the cats out.mp3". Sounds easy, but how do I move the folders and files that are referred to in the path to their new locations? And even better, how can I do this recursively? This short blog post demonstrates two possible approaches. read more...

Add a comment add a comment | category: | Views: 1
tags: | tag it

3
kicks
submitted by Klaus Klaus 4 months, 25 days ago

tellingmachine.com — PowerShell provides the += operator to add one hash table to another hash table. By default this operation will result in an error, if both hash tables have at least one key that is common in both collections. In some cases you may want to have a more granular control. For example, you don't want to get an error, if not only the key, but also the value is common in both collections. read more...

Add a comment add a comment | category: | Views: 7
tags: | tag it

4
kicks
submitted by Klaus Klaus 5 months, 13 days ago

tellingmachine.com — Every now and then I need to investigate bugs that get exposed because countable "things" are less or more than expected. In my special case I was dealing with an application that manages subscription handles to memory registers of programmable logic controllers (PLC). These programs are called Data Access Servers. Occasionally we get calls form customers reporting that the number of handles is less, or sometimes more than expected. The first step to debug this situation is to find out, which handles are missing or which ones are duplicates. This blog post describes how PowerShell's Compare-Object cmdlet makes this task, which used to be a pain in the "peep" now a piece of cake. read more...

Add a comment add a comment | category: | Views: 4
tags: | tag it

4
kicks
submitted by Klaus Klaus 5 months, 16 days ago

tellingmachine.com — This blog post shows a simple Powershell command that searches a log file for errors and warnings and adds the matched lines to either to the errors.txt file or to the warnings.txt files. It takes advantage of the most powerful operator in Powershell, which is the switch operator. In my example here I exported the log file from the Wonderware SMC logger. read more...

Add a comment add a comment | category: | Views: 6
tags: | tag it

3
kicks
submitted by Klaus Klaus 5 months, 21 days ago

tellingmachine.com — I love Powershell. I am only halfway through Bruce's book, but I am getting already a glimpse of its potential. I like especially the dynamic aspect of it. Creating and extending types on the fly is something that is quite exciting. Next I am looking to find a solution for my open issues with sorting hash tables. I think building a custom PSObject type with an integer NoteProperty and a NoteProperty that holds a FileInfo object might get me a few steps closer to solving the sorting challenge. read more...

Add a comment add a comment | category: | Views: 4
tags: | tag it

4
kicks
submitted by Klaus Klaus 6 months, 5 days ago

tellingmachine.com — Being confronted with an occasional bug in a complex system can be quite overwhelming. There are three disciplines that help you to stay strong: 1) Read and learn about your platform and how to debug it. 2) Use tools to quickly get the low hanging fruit. This might be enough in most of the cases to identify the bug. 3) Think out of the box and try to be creative. Build a model, play with it, break it and fix it. In the worst case, you won't have found the cause of the bug, but you learned at least something new about your software. read more...

Add a comment add a comment | category: | Views: 10
tags: , | tag it

6
kicks
submitted by Klaus Klaus 6 months, 28 days ago

tellingmachine.com — The tool that I am presenting here renames batches of files that have some kind of numerical index as part of their file name. It can rename the text before the index, it can shift the index numbers, give the files a new extension and add or remove leading zeros to and from the numerical index part of the file name. It uses Regular Extensions to parse the file names. read more...

Add a comment add a comment | category: | Views: 23
tags: , , | tag it

4
kicks
submitted by Klaus Klaus 7 months, 25 days ago

tellingmachine.com — It is a common practice to store time as UTC on the server and render it as local time based on the time zone the browser is running in. This blog post describes one simple approach to solving this problem. read more...

Add a comment add a comment | category: | Views: 34
tags: | tag it

5
kicks
submitted by Klaus Klaus 8 months, 17 days ago

tellingmachine.com — IPv6 might break the connection between IE 7 to the local instance of the Visual Studio development web server "webdev.webserver.exe". read more...

Add a comment add a comment | category: | Views: 0
tags: | tag it

9
kicks
published 8 months, 21 days ago, submitted by Klaus Klaus 8 months, 23 days ago

tellingmachine.com — Getting the time stamps and time zones right is straight forward. There are many options. Making it transparent to the user is an interesting challenge. It will require some plumbing changes in the core on top of a BlogEngine extension. read more...

Add a comment add a comment | category: | Views: 2
tags: | tag it

 

Sponsored Link: www.carlist.ie

Search:

Ads by The Lounge