Saturday, February 24, 2007

Moving files with Powershell

After I reinstalled my computer all the fonts I had gotten of design magasines CDs were gone. I had used one of the fonts in a t-shirt design which was now broken so I had to get them back on my PC. It had been a real pain getting them off the CDs in the first place since most of the mwere either zipped or in a folder and since Vista cannot have folders in its fonts folder (which in itself is stupid) then I had to go through each folder an manually copy the file I wanted to the system Font folder.

Not this time...

The culpits were a selection of fonts from FG. I put all those folders in a new folder:
C:\FGfontTest> and created a sub-folder C:\FGfontTest\OTFonts>
Here is the content of one of those font folders

PS C:\FGfontTest\FGAddiction> ls

Directory: Microsoft.PowerShell.Core\FileSystem::C:\FGfontTest\FGAddiction

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 4/22/2006 5:47 PM 4036 FGAddiction.afm
-a--- 4/22/2006 5:47 PM 481 FGAddiction.inf
-a--- 4/22/2006 5:47 PM 55080 FGAddiction.otf
-a--- 4/22/2006 5:47 PM 66649 FGAddiction.pfb
-a--- 4/22/2006 5:47 PM 731 FGAddiction.pfm
-a--- 4/22/2006 5:44 PM 84604 FGAddiction.ttf
-a--- 5/16/2006 6:52 PM 961 fontgarden.txt

I wanted to move all the OTF files to the OTFonts folder. After quite a bit of mocking around I finally got it to work with this script:
PS C:\FGfontTest> Get-ChildItem ./f* -recurse -include *.otf | Move-Item -dest C:\FGfontTest\OTFonts

I didn't come up with this all by myself. My first attempts were along the lines of
PS C:\FGfontTest> foreach ($d in dir f* )
>> { Move-Item $d C:\FGfontTest\OTFonts -filter *.otf }

which did not work.

Finaly example 4 in Get-Help Move-Item -detailed got me unblocked. Get-Childitem (alias is GCI) has a parameter called -recurse which essentially lets you do what I tried to do in the foreach loop only it can dig into arbitrary levels of folders.

Anyway, fonts are moved and now backed up so I won't have to go thorough this next time I install a PC. The cool thing is that Powershell let me do do a repetivie task across many folder with one line of code


Thursday, February 22, 2007

Tomato Juice

Tomato juice is, like olives, an aquired taste. But it has its purposes. It is the closest thing to fluid food that is readily available in the office. Good for the hunger.

Sunday, February 18, 2007

Talk to the competitive in people

Talk to the competitive in people when you build software. Let people compete against themselves or others if it makes sense at all. Ask yourself if your software handles something that can be measured, for instance time on data entry, and whether it makes sense to measure.

What can be measured?
Time and money are usually easy to measure and compare. You can measure the time it takes to complete a task or the amount of money someone has spend or earned.

What makes sense to measure?
Will you application be used in an environment where people care about what you can measure? Call center software is a great example. Usually the goal of management is for each call to take as little time as possible, if however you take that mentality to say an in-house call center where it is more important that the calling employee is completely unblocked than the number of calls processed per employee, then you may screw the dynamics in the wrong direction. If you reward high throughput, in your software, then that will produce high throughput behavior and that may not be what the business want.

But if your application will be used in an environment where measurements are valued, then your software should support it.

Call centers, sales applications, data entry applications, and fitness programs are obvious candidates for showing how you perform against your targets, against your previous performance and your colleagues' performance. Point of sale applications is another area where it makes perfect sense to emphasize corporate procedures/politics. Harvard business review had an article in the Winter 06 edition about great managers. One of the examples was from a Walgreens shop. Apparently employees are rewarded based on a 'Suggestive selling program'. Basically Walgreens focuses on a few items, put them near the cashier, and when you are about to pay, they ask you if you also want one of those items. If you end up buying it, they are rewarded on that extra sale. Here is an opportunity to help the employees remember how well they are doing against others and themselves. Let them see how much they have sold, how much the average employee have sold etc. Help them remember, help them focus, and help corporate strategy blossom though talking to the competitive in each of those cashiers.

It is all about talking to the basic human instincts.

Saturday, February 17, 2007


Vista ultimate and Office ultimate. Visual studio, WPF, Blend and Graphic Designer. SmartFTP and Itunes. And of course Powershell. Upgraded my computer today to the modern day and age. ahhh.

Friday, February 16, 2007


Want to be over

To reach what I think
I should
In the horizon