June 2006 - Posts

 

A few months ago I finally gave in and became a CodeRush user addict. It's not free (or particularly cheap) but it’s worth every penny. At this point I can really imagine programming without it.

 

I just heard the CodeRush 2.0 has been released. Here are two video of some of the news features:

CodeRush2Intro CodeRush2Cool

  • Context sensitive template preview – a vast improvement over the old template navigator
    • namespace filtering to remove type you don’t work with
  • templates for generic types
  • decoupling of types from templates
  • text fields, which let tab and enter work on methods like they would on a web form
  • Use type in templates – right click on your custom types to set a mnemonic and use with other CodeRush templates
Posted by swein | with no comments

If you've ever lamented the lack of a good command line shell for the Windows environment, you really want to do yourself a favor and download Windows PowerShell right now.

So of course you’ll want to have your environment set up so you can run .Net SDK tools. Robert W. Anderson explains how to get a VS2005 PS command prompt:

Add the following lines to your "$home\My documents\PSConfiguration\Microsoft.PowerShell_profile.ps1"

pushd 'C:\Program Files\Microsoft Visual Studio 8\vc'

cmd /c “mybatchfile.cmd&set” |

foreach {   if ($_ -match “=”) {     $v = $_.split(“=”); set-item -force -path "ENV:\$($v[0])"  -value "$($v[1])"   } }

popd

 

I never really bothered to learn batch/cmd, it always seemed like too much effort for too little return, so as a result I find that the transition from cmd to PowerShell is effortless, everything just works. And on occasion you find something that works a little bit better. Like 'cd' - in PowerShell you can do

PS C:\> cd I:\Documents

PS I:\Documents>

In just one command, instead of the tedious two steps required in cmd.

I'm taking an organic approach to learning the new stuff, as I need to solve a problem, I start looking through the help.

Recently I needed to take a listing of files, filter out some based on name, and get the resulting count and total size on disk. Here’s what I came up with:

$files =$( Get-Content FilestoConvert.txt|ls)

$files = ($files|where {$_.name -notmatch "codepage" -and $_.name -notmatch "Constants"})

$size=0;$files|foreach { $size += $_.length};$size/1024/1024;$files.count

Posted by swein | 1 comment(s)
More Posts