Archive for the ‘Programming’ Category

Putting formatted text on the clipboard

Working with the Windows clipboard in managed code is both easy and hard. It’s easy because all you need to do in order to put a bit of text on the clipboard is this:
Clipboard.SetText("Put this on the clipboard");

It’s hard because you can’t just do something like this in order to get formatted text:

Clipboard.SetHtml(‘<a href="http://twwilliams.com/>A link</a>"’);

The [...]

How to change your screen resolution using C#

My laptop gets confused when it goes in or comes out of the docking station and always picks the wrong resolution for the monitor. Part of this might be due to a difference in aspect ratios: the laptop screen is a widescreen model (width:height is 4:3) while the monitor connected to the docking station is [...]

ADO.NET vNext CTP is live

Happy day today: the ADO.NET vNext CTP is available. We have worked hard to get this out the door and we’re anxious to know what you think. You can discuss it at the ADO.NET Technology Preview forum on MSDN.
Alex has been bugging me to write about the experience of pulling this Community Technology Preview together to provide [...]

Translating from cmd.exe to PowerShell: dir

After a long hiatus from Monad, err, PowerShell, I have started working with it again now that Release Candidate 1 is available.
One thing that frustrated me when I last used the shell was figuring out how to do all the things I was used to doing with dir in cmd.exe. Things like dir /o:d to [...]

Strong typing epiphany

It has nothing to do with skills at the keyboard, but with programming languages and environments. For the first time ever, while working on a small, self-contained script, I missed having static typing and a compiler to help verify what I was doing. I almost fell off my chair when I realized it.
Let’s back up [...]

Refactor Pro now supports Visual Studio 2005

Refactor Pro now supports Visual Studio 2005, and there’s a trial version available. It expires on the 20th of March. I’m almost afraid to try it out — I may grow so attached that I’ll just have to spend the US$99 and buy it when the demo expires.
Tags: Development, refactoring, refactorpro, visualstudiodel.icio.us tags: Development, refactoring, [...]

A little structure goes a long way

Natural language processing is one of the holy grails of computer science. Why should people have to learn special, strange languages for interacting with the computer? Very few people can construct a workable query using SQL, for example. Why can’t we just ask the computer questions the same way we would ask another person using natural [...]

Why does PHP have to be professional-grade?

Tim Bray complains that all the PHP code he has seen has been “messy, unmaintainable crap.” The responses he has posted mostly confirm his opinion, saying things like, “it really needs to clean its act up to appeal to people coming from other programming languages, instead of just people coming from dreamweaver.” Or “it hasn’t [...]

Productive weekend

It’s been quite a weekend. I finally got fed up with dasBlog hanging the worker threads on my old blog site* so I decided to move all the content to Wordpress and start up a new blog. No single part of the process was hard, but there were a lot of moving pieces. Among other [...]