Monday, August 08, 2005
The many faces of C# delegates
Delegates in C# serve a few common purposes: asynchronous method invocation, event handling and callback functions. This article builds a nice example that shows all three of these roles in an entertaining format:
http://www.sellsbrothers.com/writing/default.aspx?content=delegates.htm
All of these patterns are very common and good documentation on them is very hard to find. Kudos to the author!
http://www.sellsbrothers.com/writing/default.aspx?content=delegates.htm
All of these patterns are very common and good documentation on them is very hard to find. Kudos to the author!
Tuesday, August 02, 2005
Prompting for arguments with KDE
Today, I needed to make an application shortcut (.desktop file) that prompted for arguments. I searched Google ten different ways and couldn't find any posts on doing what should be a simple task. I finally solved the mystery in a highly ghetto way - I used bash to find all binaries that begin with K. When I saw kdialog I knew how to do it. Good luck ever finding this on Google:
server=`kdialog --inputbox "Server to connect to"` ; rdesktop -x l -a 24 -u administrator -g 1024x768 $server
server=`kdialog --inputbox "Server to connect to"` ; rdesktop -x l -a 24 -u administrator -g 1024x768 $server