Thursday, August 28, 2003 |
|
|
The C# Source Code Generator for .NET has already been linked to by many, many blogs out there, but I thought I'd link to it as well, just because it seems so potentially useful. Some of the potential uses will be eliminated when C# templates arrive on the scene, of course, but this seems like a good tool to have at your disposal. I wonder if it could be integrated into the build process somehow... |
8/28/2003 10:26:45 AM (Pacific Daylight Time, UTC-07:00) | | Code
|
|
|
|
|
It's not every day that you run across a new blog where most of the entries seem interesting, so I thought I'd make sure you know about it: http://weblogs.asp.net/jkey/ |
8/28/2003 8:37:20 AM (Pacific Daylight Time, UTC-07:00) | | Blogs
|
|
|
|
Tuesday, August 26, 2003 |
|
|
I typed up that last entry, clicked Post to Weblog... and got an error message. My heart skipped a beat because I realized that I've been breaking my own rule -- never type interesting content into a browser window, because you're liable to lose it. Of course it wasn't still there when I hit the Back button. Fortunately the post actually made it through, so I didn't have to try to reproduce what I wrote -- which I really, really don't like to do.
Of course, typing a blog entry should be fairly spontaneous, so my standard procedure of first typing the entry into TextPad would be a bit much. Perhaps I'll try to remember to Ctrl+A, Ctrl+C before posting in the future. Just in case. |
8/26/2003 10:48:27 AM (Pacific Daylight Time, UTC-07:00) | | Blogs
|
|
|
|
|
Did I mention that VSS should support Check Out without a Get? Of course I did. Occasionally I wonder if my daily habit of doing a full recursive Get in the morning before I open and build our main project is really a good use of my time. So I don't do it. That's usually when I get burned. Ah well. |
8/26/2003 10:43:47 AM (Pacific Daylight Time, UTC-07:00) | | Tools
|
|
|
|
|
One of my favorite computer games of all time (which isn't saying much; I've played relatively few of the many games released in my lifetime) was Lemmings. I played it many years ago on my PC, I played it fairly recently on my Sony Clíe (from ardiri.com), and I played it again today in Internet Explorer. If the Libronix DLS isn't a testament to the amazing things that can be done in DHTML, this site certainly is. (Don't bother trying it in a non-IE browser; it hung Firebird... And please don't kill the rest of your work day playing it... Also keep in mind that he may not have the legal rights to the levels...)
Update: The game can now be found here. This one works with Mozilla-based browsers! |
8/26/2003 9:43:04 AM (Pacific Daylight Time, UTC-07:00) | | Games
|
|
|
|
Monday, August 25, 2003 |
|
|
Okay, I'm familiar with the use of the javascript: protocol for executing code in response to a hyperlink. What I didn't know is that if the code in question evaluates to anything but undefined, the content of the page gets replaced with that value! How I've gotten this far without knowing that simple fact is beyond me. For example: <a href="javascript:DoSomething()">click here</a>
calls the DoSomething function, which is fine if DoSomething doesn't actually return something. If DoSomething returned true, for example, the page gets replaced by the text "true", which is almost certainly undesirable.
In any case, if you want to make sure that a javascript: link doesn't ever replace the content of the page, use the void operator like so: <a href="javascript:void DoSomething()">click here</a>
Seems like a good habit to get into. |
8/25/2003 3:29:33 PM (Pacific Daylight Time, UTC-07:00) | | Code
|
|
|
|
Friday, August 22, 2003 |
|
|
Glad to see that the next revision of the C# compiler makes it a bit easier to use delegates, generic and otherwise. |
8/22/2003 8:50:11 AM (Pacific Daylight Time, UTC-07:00) | | Code
|
|
|
|
Thursday, August 21, 2003 |
|
|
I recently read Code Reading: The Open Source Perspective by Diomidis Spinellis. I can see how it could be of use to someone trying to contribute to a software project if they didn't have much experience in the language or tools that it used, especially if it was an open source project. I've learned "the hard way" more than I need to know about building and using open source projects, and I've got reasonable experience in a good number of languages and tools, so this book didn't have that much new material for me.
If you'd like to skim a condensed version of the book, you're in luck; flip to the back of the book and check out Appendix E: Maxims for Reading Code, which summarizes the main points of the book in a dozen or so pages. Here's a good one from chapter 1:
You can successfully modify large well-structured systems with only a minimum understanding of their complete functionality. I've always resisted this maxim -- it's more fun to rewrite than modify -- but over the years I've learned that it's true, and modifying existing projects almost always gets the job done faster than starting from scratch, even if the latter seems like more fun.
In fact, all of the maxims from chapter 1 are pretty good, so even if you don't read the whole book, chapter 1 is probably worth it. Chapters 2 through 5 read more like An Introduction to C. The rest of the book seemed pretty intuitive to me -- not many surprises there -- but again, you might find them interesting, so don't avoid the book on my account.
The last chapter is A Complete Example, and shows some of his code reading maxims in practice. If you read that chapter and think you could have done better, maybe this book isn't for you. If you read that chapter and aren't sure you would have thought to do what he did, perhaps the book is worth a closer look. |
8/21/2003 2:16:17 PM (Pacific Daylight Time, UTC-07:00) | | Code | Books
|
|
|
|
|
Is there a really good reason that the try statement (in C++, C#, JavaScript, etc.) and its friends catch and finally require a brace-enclosed block? What's wrong with this? try DoSomething(); catch (x) LogError(x);
I know that the grammar doesn't allow it; I just wonder why. I suppose I could scour the newsgroups for the answer. Maybe I should ask on the proposed comp.std.csharp newsgroup. |
8/21/2003 1:32:13 PM (Pacific Daylight Time, UTC-07:00) | | Code
|
|
|
|
|
I've not been able to find any XML parsers out there that preserve whitespace between XML attributes. A Google search for "whitespace between attributes" comes up with people looking but not finding. Why would one ever want to preserve whitespace between attributes? Well, the most obvious reason is if you want to modify an XML document without messing with line-based difference algorithms too much; if the original document has line feeds between attribute values and you want to use a DOM to modify that document, it's going to look a lot different after you save it.
I really do understand why it doesn't exist; not that many people care, but they do want fast XML parsers, and worrying about this sort of thing certainly wouldn't speed them up any. Seems like they could at least provide an option, though... |
8/21/2003 11:50:43 AM (Pacific Daylight Time, UTC-07:00) | | Code
|
|
|
|
|
I'm really looking forward to getting generics in C#. (That's "templates" for you C++ programmers.) C# is already a terribly fun language to program in; once I get generics, will C++ ever tempt me again? |
8/21/2003 10:33:50 AM (Pacific Daylight Time, UTC-07:00) | | Code
|
|
|
|
|
The next time I write an application or library that isn't mostly just user interface fluff, I'm going to have to find the discipline to give unit testing and test-driven development a try. I've done more than enough reading about it, and both methodologies sound like great ideas, but I've not had the opportunity to give them a test run. |
8/21/2003 10:29:15 AM (Pacific Daylight Time, UTC-07:00) | | Code
|
|
|
|
Wednesday, August 20, 2003 |
|
|
Free advice if you have a blog -- don't bother with descriptions. Descriptions only show up in aggregators like SharpReader, and most people would rather see the full article in the aggregator anyway, which happens automatically if you don't include a description.
For that matter, you don't even need to include a title; the start of the article will automatically be used as a title in that case. People who generally blog dozens of entries every day don't bother with titles; I figure with just one or two a day, I can bother to come up with a useful title for each entry. |
8/20/2003 1:25:47 PM (Pacific Daylight Time, UTC-07:00) | | Blogs
|
|
|
|
Tuesday, August 19, 2003 |
|
|
"Everybody" is linking to the Career Calculus article by Eric Sink. It's basically an argument for taking every opportunity to learn new stuff while in the development profession, an argument that I agree with wholeheartedly.
Special thanks to Bob for always being willing to provide me with the latest information on technology, be it books, magazines, or surf time. |
8/19/2003 4:35:10 PM (Pacific Daylight Time, UTC-07:00) | | Misc
|
|
|
|
Monday, August 18, 2003 |
|
|
Hopefully you're all enjoying my customized dasBlog theme. I know I've got work to do on the stuff in the margin; some day I'll get to it...
If you're running dasBlog and you want to use/abuse my theme, let me know. I certainly have no love for any of the standard themes. |
8/18/2003 2:52:22 PM (Pacific Daylight Time, UTC-07:00) | | Blogs
|
|
|
|
|
Brad Abrams wants to know where best to put sample code. The majority of the comments support the most energy going into individual property/method documentation examples, and I tend to agree. I generally just want a concrete example on how to use the method I'm trying to use. |
8/18/2003 1:12:09 PM (Pacific Daylight Time, UTC-07:00) | | Code
|
|
|
|
|
If you upgrade to dasBlog 1.2, I would definitely recommend following the instructions to change the times of 1.1 entries. If you don't, in our time zone at least, the old blogs will show up on the wrong dates, and you won't even be able to edit them.
So, here's what I did -- copy the *dayentry* and *dayextra* files from the content folder into a temporary directory, drag-and-drop them into TextPad, and do an all-document search and replace from "-07:00" to "+00:00". Copy the files back into the content folder and "touch" the Web.config file in the blog directory. |
8/18/2003 9:23:50 AM (Pacific Daylight Time, UTC-07:00) | | Blogs
|
|
|
|
|
Notification messages in "classic" Win32 programming drive me crazy. Why? Because they're always sent to the parent window. So if you're writing an enhanced edit control and want to know when the content changes, or if you're writing an enhanced combo box and want to know when the selection changes, you've got to notice when the _parent_ gets the EN_CHANGE or CB_SELCHANGE message. Both MFC and ATL have standard mechanisms for "reflecting" these sorts of messages back to the control, but if you don't control the parent, this can be easier said than done.
Anyway, if you're writing interesting controls in .NET or DHTML, just be glad that you can just catch simple events, and don't have to deal with notification messages. I'm off to put a rich edit control in an otherwise needless container window just so I can reliably reflect the notification messages back to the rich edit control... (I was previously dynamically subclassing the parent window, but it turns out that windows don't like to be subclassed twice, as this causes a bizarre crash that one must spend hours trying to track down until you finally figure it out.) |
8/18/2003 9:16:21 AM (Pacific Daylight Time, UTC-07:00) | | Code
|
|
|
|
Thursday, August 14, 2003 |
|
|
I just helped one of our esteemed interns with this, so I thought I'd make it a matter of public record.
Basically, if you're going to be drawing text in GDI+, read MSDN KB 307208: http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q307208
In summary, you'll probably want to avoid the 1/6 em of space that's measured and displayed before and after a string, so you'll probably want to use the GenericTypopgraphic StringFormat object.
Incidentally, I didn't end up ever using this information personally, since our PDF driver actually uses FreeType with GDI+ to display text. |
8/14/2003 11:16:30 AM (Pacific Daylight Time, UTC-07:00) | | Code
|
|
|
|
|
I have to say, I'm not much impressed with any of the avaialble themes for this blog. I'll have to make my own one of these days. The styles are okay, but there are annoying display bugs that I'd really like to get rid of.
Incidentally, if you'd like to make your own blog with this software, it's pretty simple -- just follow the directions at http://www.dasblog.net/documentation/, and let me know if you'd like assistance. |
8/14/2003 10:13:30 AM (Pacific Daylight Time, UTC-07:00) | | Blogs
|
|
|
|
|
I was getting the strangest dialog box when trying to Save As... an .htc file in VS.NET -- something to do with checking out a file modified in memory...? Anyway, I finally realized that I was editing the .htc file with the frightening VS.NET HTML/XML editor! <gasp>
So I quickly changed the default editor for .htc files to the Source Code Editor with Open With... in the Solution Explorer, as I'd already done for .html, .xml, and .js files.
One of these days I'm going to post all of my favorite settings for all of my favorite software programs. Really! |
8/14/2003 10:10:05 AM (Pacific Daylight Time, UTC-07:00) | | Tools
|
|
|
|
|
I was just reflecting on Visual SourceSafe and I think I realized something -- you shouldn't have to get the latest version of a file to check it out. When you check the file in, it merges with the latest version without changing your local copy. This is similar to the "always checked out" model of CVS but doesn't eliminate the usefulness of "seeing who has what checked out".
Anyway, this would get rid of the annoying problem we have now, which is making sure that you notice if you end up with the latest version when you check out a file. Because if you did end up with the latest version, it probably depends on other code changes that you don't have because you haven't done a full Get. Not to mention the headaches we get from VS.NET when we get the latest version of one or more project files, particularly if you're trying to modify one of them...
I wonder if SourceGear Vault allows a check out without an implicit Get... |
8/14/2003 9:52:59 AM (Pacific Daylight Time, UTC-07:00) | | Tools
|
|
|
|
Wednesday, August 13, 2003 |
|
|
I finally found free blogging software that was fairly easy to install, so I thought I'd give this whole blogging thing a try. I'm starting small -- this blog is (hopefully!) not visible outside the company, and I intend for it to be a simple way to communicate interesting, but not critical, information to my coworkers. Normally I just call out to anyone within earshot, or send someone a quick Messenger message, but maybe this way I'll be able to share the wealth (ha!) with everyone that might possibly care.
So the question is -- will I actually ever post anything interesting here at all? Stay tuned. |
8/13/2003 2:30:18 PM (Pacific Daylight Time, UTC-07:00) | | Blogs
|
|
|
|
|
|
|
| Archive |
| March, 2008 (1) |
| January, 2008 (1) |
| September, 2007 (1) |
| July, 2007 (1) |
| June, 2007 (3) |
| May, 2007 (2) |
| January, 2007 (2) |
| December, 2006 (1) |
| November, 2006 (2) |
| August, 2006 (6) |
| July, 2006 (3) |
| May, 2006 (4) |
| April, 2006 (2) |
| March, 2006 (1) |
| February, 2006 (1) |
| January, 2006 (1) |
| December, 2005 (2) |
| November, 2005 (5) |
| October, 2005 (11) |
| September, 2005 (7) |
| August, 2005 (1) |
| July, 2005 (2) |
| June, 2005 (2) |
| April, 2005 (5) |
| March, 2005 (11) |
| February, 2005 (6) |
| January, 2005 (2) |
| December, 2004 (1) |
| November, 2004 (1) |
| October, 2004 (3) |
| September, 2004 (1) |
| August, 2004 (5) |
| July, 2004 (10) |
| June, 2004 (3) |
| May, 2004 (5) |
| April, 2004 (3) |
| March, 2004 (10) |
| February, 2004 (10) |
| January, 2004 (15) |
| December, 2003 (1) |
| November, 2003 (2) |
| October, 2003 (13) |
| September, 2003 (20) |
| August, 2003 (24) |
|
|
|
|