<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3874252081774939607</id><updated>2011-07-08T00:14:59.158-07:00</updated><category term='cbmunger'/><category term='reqall'/><category term='cool'/><category term='asp.net powerbuilder ServerControls subclass'/><category term='iphone'/><category term='FitnessRocks PaleoDiet InsulinResistance'/><category term='MP3 C#'/><category term='c# wrap code best practices'/><category term='organization'/><category term='sleep exercise'/><category term='internet'/><category term='comments'/><category term='weight'/><category term='Dropbox music'/><title type='text'>Miscellaneous Maunderings</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-8800320460872781279</id><published>2010-04-09T11:35:00.000-07:00</published><updated>2010-04-09T11:45:43.536-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c# wrap code best practices'/><title type='text'>Wrapping code: Good practice?</title><content type='html'>I wrap native code because:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Wrapping makes it extensible.&lt;/li&gt;&lt;li&gt;It's easier to remember.&lt;/li&gt;&lt;li&gt;The native code is absurdly lengthy / wordy / etc.&lt;/li&gt;&lt;li&gt;Code in the library will never be lost.&lt;/li&gt;&lt;/ul&gt;In the halls of computer science (a discipline that hadn't been invented when I was in college), do deep-thinking people ever advocate the idea that calling native code &lt;span style="font-style: italic;"&gt;directly &lt;/span&gt;is a *bad practice*? That code should be &lt;span style="font-style: italic;"&gt;wrapped in a method&lt;/span&gt;, to make it extensible?&lt;br /&gt;&lt;br /&gt;Here's an example I ran into last night:&lt;br /&gt;&lt;br /&gt;I've written a utility for executing miscellaneous C# methods, which has a f.OpenFile() helper method that wraps Process.Start(). Pass in a file name and it opens using the associated application. f.OpenFile() adds a *little* functionality, throwing an exception that logs the file name, when the file doesn't exist. So far, the method is called about a hundred places.&lt;br /&gt;&lt;br /&gt;Last night I enhanced it to prompt the user when the file doesn't exist at the passed path, allowing the user to browse to the file's location, and applying that location going forward. If the alt-key is down when the utility method is run, the user gets the prompt regardless of whether the path is valid -- so the user can point the method at a different path. That let's me change the path without going into the code, a time-saver.&lt;br /&gt;&lt;br /&gt;I could not have done that (without difficulty) if I'd had 100+ Process.Start() calls in my code. With f.OpenFile(), I only had to change the code in one place. It was easy to add the new feature because ProcessStart() was *wrapped*. I had a hook. It made Process.Start() extensible, in some sense.&lt;br /&gt;&lt;br /&gt;Over the years, this pattern has occurred often enough, and *so usefully* -- that I wonder if it has been recognized with a special name??&lt;br /&gt;&lt;br /&gt;Another reason I wrap code is because my brain has tired RNA. I can't possibly remember this:&lt;br /&gt;&lt;br /&gt;    using (StreamReader streamReader = &lt;br /&gt;        new StreamReader(HttpWebRequest.Create(_theUrl).GetResponse().GetResponseStream()))&lt;br /&gt;    return streamReader.ReadToEnd();&lt;br /&gt;&lt;br /&gt;But I can remember the wrapper method f.GetUrlsHtml(). A few months ago, I refactored f.GetUrlsHtml(), and I *could* refactor it, because it was wrapped, instead of being native code in a couple dozen locations. I suspect this may be considered to be a bad practice, because *so often* I see the same tired block of code repeated and repeated, copied and pasted. Doesn't DRY imply *"Wrap it!"*?&lt;br /&gt;&lt;br /&gt;Wrapping seems particularly appropriate, when it takes too many lines to do something simple.&lt;br /&gt;&lt;br /&gt;    f.ExecuteCommand(@"%SystemRoot%\system32\restore\rstrui.exe", 0);&lt;br /&gt;&lt;br /&gt;The method executes about 10 lines -- which *begs* for wrapping, to me.&lt;br /&gt;&lt;br /&gt;And yet another reason to wrap: laziness and/or esthetics.&lt;br /&gt;&lt;br /&gt;    if (String.IsNullOrEmpty( aStringVar1 ) || String.IsNullOrEmpty( aStringVar2 )) ...&lt;br /&gt;&lt;br /&gt;To me, String.IsNullOrEmpty() seems ridiculously long. It's tedious and distracting. I wrap it:&lt;br /&gt;&lt;br /&gt;    if (f.ns(aString1) || f.ns(aString2))&lt;br /&gt;&lt;br /&gt;The "ns" stands for Non-String. Once, it just called String.IsNullOrEmpty(), but now f.ns() returns true if the string is all *whitespace*. When you're validating a string, don't you want to catch it, when the calling code passes a single space? With f.ns(), I can set a breakpoint to catch where in the code an invalid string is passed.&lt;br /&gt;&lt;br /&gt;Could that be done with String.IsNullOrEmpty()? I'd like to know; that could be very helpful.&lt;br /&gt;&lt;br /&gt;Another reason for wrapping code is so it doesn't get lost. A friend emailed slick code applying LINQ to subtract one List&lt;t&gt; from another (T being a simple type). I wrapped it in a method, so I could test it, and so it would be there when I needed it... which wasn't too long in coming. I routinely wrap code that I find on the web, that I'll find useful someday. It will never be lost if it's in my library.&lt;br /&gt;&lt;br /&gt;I guess I could put code in a repository for that purpose (anyone have a recommendation?), but then I'd have to *find* it. It's easy to find in Visual Studio.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;An argument *against* wrapping is that the code is unfamiliar, because I invented it, so no one else will understand it. f.ns() is obscure, I admit. "Right-click, Go To Implementation" is pretty easy, though. The name f.GetUrlsHtml() is more transparent than the code it wraps, right? Maybe f.GetHtmlFromUrl() would be better (I love VS's rename!!).&lt;br /&gt;&lt;br /&gt;I guess using the methods creates a dependency on the method library. OK. I'll deal.&lt;br /&gt;&lt;br /&gt;Are there other reasons why wrapping frequently-used code is a bad practice?&lt;br /&gt;&lt;br /&gt;I'm really intent on getting better at this. Your responses are appreciated.&lt;br /&gt;&lt;br /&gt;- Hoytster&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-8800320460872781279?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/8800320460872781279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2010/04/wrapping-code-good-practice.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/8800320460872781279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/8800320460872781279'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2010/04/wrapping-code-good-practice.html' title='Wrapping code: Good practice?'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-2634807383794577411</id><published>2010-03-20T07:02:00.000-07:00</published><updated>2010-03-20T07:28:44.579-07:00</updated><title type='text'>IronPython notes</title><content type='html'>Michael Foord http://www.voidspace.org.uk/ironpython/hosting_api.shtml&lt;br /&gt;&lt;br /&gt;Business rules stored as a Python or Ruby backed Domain Specific  Language could be extremely useful - they can be read / written by  business managers, rather than programmers, and even changed at runtime.&lt;br /&gt;&lt;br /&gt;.NET 4 offers the &lt;span style="font-style: italic;"&gt;dynamic &lt;/span&gt;keyword in C#, which makes it much easier to use DLRs like IronPython.&lt;br /&gt;&lt;br /&gt;This is an example of coding C# dynamically:&lt;br /&gt;&lt;br /&gt;http://keithhill.spaces.live.com/Blog/cns!5A8D2641E0963A97!6676.entry?wa=wsignin1.0&amp;amp;sa=168208183&lt;br /&gt;&lt;br /&gt;C# 4 supports named parameters and optional parameters, to make it easier to call Office methods.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-2634807383794577411?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/2634807383794577411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2010/03/ironpython-notes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/2634807383794577411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/2634807383794577411'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2010/03/ironpython-notes.html' title='IronPython notes'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-1726938661970820385</id><published>2010-03-18T06:05:00.001-07:00</published><updated>2010-03-18T06:43:02.241-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sleep exercise'/><title type='text'>You're getting sleeeeeepy, sleeeeeeeeeeeeeeeepy</title><content type='html'>I saw Dr. Stillman (call him &lt;span style="font-style: italic;"&gt;Mike&lt;/span&gt;!) yesterday. We focused on sleep. He prescribed Lunestra, every other day; eliminate alcohol; and get more exercise.&lt;br /&gt;&lt;br /&gt;Last night Janet and I enjoyed a beer together to celebrate St. Patrick's Day. That is the last alcohol I'll have (in theory) until April 18. I was tempted to eat after dinner, as usual, and went so far as opening the drawer containing the huge chunk of super-sharp cheese -- but I closed it -- and decided that I was really looking forward to breakfast (I put some cheese in my organic tomato basil soup). And I didn't drink any alcohol.&lt;br /&gt;&lt;br /&gt;Lights out was 10:30 and I feel asleep easily. I woke around 2:00, got up and played with the computer for 45 minutes, felt sleepy and returned to bed and slept. I woke up again at 5:00, stayed drowsily in bed until 6:00. Feel sleepy this morning.&lt;br /&gt;&lt;br /&gt;Breakfast was too many calories: a good sized bowl of the soup, plus maybe 2-3 ounces of cheddar -- and then a large orange and a large Chinese pear on the way to work.&lt;br /&gt;&lt;br /&gt;I did my first real weight-lifting session in at least a month, working pretty hard for maybe 45 minutes. I feel slightly weaker than previously. I added the leg press to the routine. I need a new routine.&lt;br /&gt;&lt;br /&gt;Two pounds a week requires a calorie deficit of 1000 per day. Lots of luck. I'll settle for 1 or 1.5 pounds.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-1726938661970820385?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/1726938661970820385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2010/03/youre-getting-sleeeeeepy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/1726938661970820385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/1726938661970820385'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2010/03/youre-getting-sleeeeeepy.html' title='You&apos;re getting sleeeeeepy, sleeeeeeeeeeeeeeeepy'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-4040585126558833067</id><published>2010-01-04T15:32:00.001-08:00</published><updated>2010-01-04T23:54:12.001-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='weight'/><title type='text'>Take my own advice, dernit</title><content type='html'>Sent to a friend. Posted here so I can review as needed.&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;Here's the diet strategy that works best for me.&lt;br /&gt;&lt;br /&gt;1) Commit to exercising every day. Make a plan at the beginning of the day. Even if I do not manage to exercise 7 days a week -- trying to helps me exercise more often that I would otherwise. I bought &lt;a href="http://www.powerblock.com/blocks.html" target="_blank"&gt;PowerBlocks &lt;/a&gt;so I have the equivalent of dumbbells in the range 10-45 pounds in 5 pound increments -- in the space of 1.5 shoeboxes. 20 minutes of weight-lifting kills me, and my bench is set up in the basement -- so there's always a way to exercise, and always time.&lt;br /&gt;&lt;br /&gt;2) Get in the habit of eating more-or-less fixed meals for breakfast and lunch. I'm eating steel-cut oats for breakfast every day. Literally, the entire processing is cutting up the oats into smaller bits -- which means they take longer to digest and pose less of a sugar hit -- which is what leads to hunger. Lunch: broccoli and friends from the caf. Oats lower cholesterol.&lt;br /&gt;&lt;br /&gt;3) Continually get information on the subject, to keep me in the game. FitnessRocks.org has 150 podcasts from a physician - fitness nut, that Susie can put on her iPhone and listen to while she grocery shops or works out. I'm on podcast 60 -- my second pass through the collection. RealAge is good. I keep this &lt;a href="http://www.amazon.com/Eat-Drink-Be-Healthy-Harvard/dp/0743266420/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1262628439&amp;amp;sr=8-1-catcorr" target="_blank"&gt;&lt;i&gt;excellent &lt;/i&gt;book&lt;/a&gt; next to the bed and pick it up every few days. Check the reviews on Amazon. You want to be eating the Mediterranean diet. A huge error I made for decades was avoiding fats in food. There are &lt;i&gt;healthy &lt;/i&gt;fats, esp. olive oil. Atkins worked for millions, and that wasn't low fat.&lt;br /&gt;&lt;br /&gt;Something I have not tried, which I intend to try, when I'm a bit fitter and the weather is less nasty -- is seeking the company of skinny people. A FitnessRocks episode and other sources present research that being around heavy people makes you heavier. Your psychological set point changes, or something. With luck, this spring, I'll get routinely involved with my wife's running club. There are a couple people there as chubby as me -- but the average is more like the general population looked, 40 years ago. I went to the club's annual party a few weeks ago and was struck by the seeming gauntness -- which is what used to be normal. I wince when I think of Wall-E -- how the captains were successively heavier, the whole population huge. How many captains into that sequence am I? With 67 percent of U.S. adults overweight or worse, "normal" is not healthy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-4040585126558833067?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/4040585126558833067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2010/01/take-my-own-advice-dernit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/4040585126558833067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/4040585126558833067'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2010/01/take-my-own-advice-dernit.html' title='Take my own advice, dernit'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-7923135307033135307</id><published>2010-01-04T15:28:00.000-08:00</published><updated>2010-01-04T15:31:16.918-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MP3 C#'/><title type='text'>An email about identifying duplicate MP3s (etc)</title><content type='html'>How do I find duplicate music files?&lt;br /&gt;&lt;br /&gt;Here's an idea for finding duplicate music files at the album level, that is, when the MP3s are organized from the start by album.&lt;br /&gt;&lt;br /&gt;Order the MP3s by run time -- how many minutes and seconds they run. Using the run time accounts for the fact that there can be several versions of a song -- if you want to keep the versions (like, single vs album). It would work across formats, like MP3 vs WMA vs FLAC.&lt;br /&gt;&lt;br /&gt;Compute the ratios (within some accuracy) of one to the next, and turn that into a hash that serves as a unique key for the &lt;i&gt;album&lt;/i&gt;. #1 is 1.3 times longer than #2, which is 1.13 times longer than #3, which is 1.4 times longer than #4, etc Using the ratios might help with error estimating the run time; the time would be off systematically, we hope. It might be best to compute the hash from the 3 or  longest, to avoid accumulating too much error. Experimentation would show that, maybe.&lt;br /&gt;&lt;br /&gt;Given the hash, compare it to the other albums that have the same number of songs. If you find a match -- keep the bigger set, hoping for higher quality. Or always keep FLAC, if you like FLAC.&lt;br /&gt;&lt;br /&gt;Can you determine the MP3 run time in C# code? I dunno. I saw a couple comments where people were struggling.&lt;br /&gt;&lt;br /&gt;So figure it out by playing them! Write a hugely multi-threading app that simultaneously plays as many MP3s (or FLACs, etc) as your computer will manage. Use some tag-writing code to stash the run time in the ID3 tag, so you only have to play it once. Do the math: if you get (pick a number) 100 players going at once -- can you get through your collection before the energy death of the universe?&lt;br /&gt;&lt;br /&gt;&lt;a href="http://developer.novell.com/wiki/index.php/TagLib_Sharp"&gt;This &lt;/a&gt;might be helpful. &lt;a href="http://www.mperfect.net/aiSomMusic/"&gt;This &lt;/a&gt;was impressive, but probably not so helpful, except conceptually maybe. &lt;a href="http://dotnet.org.za/deon/pages/3057.aspx"&gt;Here&lt;/a&gt;'s a way to play 'em. &lt;a href="http://stackoverflow.com/questions/1065086/length-of-an-mp3-wav-audio-file"&gt;This &lt;/a&gt;enlists Windows Media Player to get the length.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-7923135307033135307?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/7923135307033135307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2010/01/email-about-identifying-duplicate-mp3s.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/7923135307033135307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/7923135307033135307'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2010/01/email-about-identifying-duplicate-mp3s.html' title='An email about identifying duplicate MP3s (etc)'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-9015447888128485962</id><published>2009-12-15T11:02:00.000-08:00</published><updated>2009-12-15T11:10:20.307-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='comments'/><title type='text'>Email not sent, because NO ONE COMMENTS</title><content type='html'>I just decided not to email this to the local standards keeper, as we set out on a new project.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;I would like to suggest a standard that almost no one else is the world things is sensible: a developer coming to unfamiliar code should be able to understand it by &lt;span style="font-weight: bold;"&gt;reading the comments&lt;/span&gt;. In my view, the comprehension of code is like a &lt;span style="font-style: italic;"&gt;transuranic element&lt;/span&gt; -- rapidly decaying, short-lived -- and that's in the &lt;span style="font-style: italic;"&gt;mind of the coder&lt;/span&gt;. Expecting someone else to read code and simply get it is unrealistic. Oft times, the coder spent a lot of time figuring out how to code something; the code embodies business logic. When that thought process is not captured in a comment -- it vanishes. And it has to be in a comment in the code, else it will be lost. "We wrote that up in the functional spec, that's never been updated and we can't find it anyway." That doesn't work.&lt;br /&gt;&lt;br /&gt;It doesn't take that long to type comments. We type for a living! The confusion and uncertainty presented by poorly commented code yields wasted time trying to comprehend code, and more time chasing down bugs introduced because of a failure to comprehend the code correctly. Comments save time.&lt;br /&gt;&lt;br /&gt;I have heard of the argument that excessive commenting is worse than no commenting, because the comments get stale and are misleading. The easy answer to that is "Maintain the comments as you modify code." I would encourage people to comment excessively -- because if they lean in that direction, the chances are increased that they'll comment adequately.&lt;br /&gt;&lt;br /&gt;A while back, I incorporated this standard in a automated code reviewer utility: it computed an estimated ratio of comments to code, and while there was no specfic ratio required, a low ratio made the coder suspect, and more likely to get dinged for insufficiently commenting during the real code review. The utility worked with enhancements, in addition to new code, because we applied the utility to the differences listing for existing code.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;I write to deaf eyes, I know. No one comments. It mystifies me and makes me crazy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-9015447888128485962?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/9015447888128485962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/email-not-sent-because-no-one-comments.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/9015447888128485962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/9015447888128485962'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/email-not-sent-because-no-one-comments.html' title='Email not sent, because NO ONE COMMENTS'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-5935657595096963730</id><published>2009-12-10T06:22:00.000-08:00</published><updated>2009-12-10T06:27:27.662-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dropbox music'/><title type='text'>DropBox: Switching out the music with ease</title><content type='html'>DropBox.com is a service that synchronizes files across the internet.&lt;br /&gt;&lt;br /&gt;Today I put it to good use for the first time. I decided to would listen to the most recent 5 remastered Beatles albums at work today. So, this morning, I copied the albums to the DropBox folder on my home computer.&lt;br /&gt;&lt;br /&gt;About 20 minutes after I turned on my notebook at work, the Beatles music was there in the notebook's DropBox folder.&lt;br /&gt;&lt;br /&gt;It couldn't be much easier.&lt;br /&gt;&lt;br /&gt;Do any operations on the DropBox folder -- adds, deletes -- and they are reflected in however many other computers have the DropBox client installed, associated with your account. When I'm done with the Beatles, I'll move some Frank into the folder; it's the anniversary his birthday Saturday.&lt;br /&gt;&lt;br /&gt;DropBox gives you 2GB of space for free. The next price point is unfortunately expensive: $10/month for 50GB. If they charged by the GB, I'd sign up for 10GB for $1/month.&lt;br /&gt;&lt;br /&gt;Maybe I'll suggest that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-5935657595096963730?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/5935657595096963730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/dropbox-switching-out-music-with-ease.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/5935657595096963730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/5935657595096963730'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/dropbox-switching-out-music-with-ease.html' title='DropBox: Switching out the music with ease'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-7437161869259598411</id><published>2009-12-09T13:08:00.000-08:00</published><updated>2009-12-09T13:12:02.480-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cbmunger'/><title type='text'>Is CBMunger ready for prime-time (I should I bother?)</title><content type='html'>I posted this to Stack Overflow a month ago. The gist of the replies was (1) Huh? What? and (2) run it up the CodePlex flag pole and see if anyone salutes. It could be a daily blog topic, the method of the day -- but so many are &lt;span style="font-style: italic;"&gt;so mundane -- &lt;/span&gt;but nonetheless useful.&lt;br /&gt;&lt;br /&gt;---- &lt;a href="http://stackoverflow.com/questions/1683776/is-this-utility-useful-enough-to-bother-putting-into-codeplex"&gt;The question on Stack Overflow&lt;/a&gt; ----&lt;br /&gt;&lt;div class="post-text"&gt;                 &lt;p&gt;It was my second C# project, undertaken years ago, and it has lived on, because (imho) it is Genuinely Useful Software. It's also badly designed and the code is embarrassing. &lt;/p&gt;  &lt;p&gt;It runs C# code. You write a method, the method name appears in a listbox, you double-click the method name to execute it. That's it.&lt;/p&gt;  &lt;p&gt;Examples:&lt;/p&gt;  &lt;p&gt;When I open up my C# web project at work, a method runs a couple command-window apps my project needs, and checks to confirm that the requisite service is up. I never have to remember that stuff.&lt;/p&gt;  &lt;p&gt;I hate UPPERCASE, so I have a method that lower-cases SQL, but preserves the case of quoted strings. Another method calls a web service to beautify SQL. Those both operate on the clipboard.&lt;/p&gt;  &lt;p&gt;One method fixes the names of MP3 files: title casing, replacing underscores and hyphens, optionally removing/inserting text or prepending numbers. Creates a playlist!&lt;/p&gt;  &lt;p&gt;I double-click to harvest all of my Twitter links, turning them into an HTML page with hyperlinks and a jQuery-powered search.&lt;/p&gt;  &lt;p&gt;A method searches the specified log4net.log for every operation that took longer than the specified number of milliseconds.&lt;/p&gt;  &lt;p&gt;I can create a restore point by double-clicking a method (and open up the corresponding dialog with another method).&lt;/p&gt;  &lt;p&gt;When my wife had to write some sorting algorithms for school, the utility was an ideal testbed. I use it to test bits of code all the time.&lt;/p&gt;  &lt;p&gt;None of these methods is in any way impressive. No large brain stuff. Most of it is just string manipulation, file system operations -- mundane stuff. Handy though!&lt;/p&gt;  &lt;p&gt;This morning, I wanted to format some SQL output as rows in an Excel table. I wrote a method to read the output and format it as tab-delimited columns, for import into Excel. I have no idea how else I could have done that. It took about 8 minutes to write.&lt;/p&gt;  &lt;p&gt;I have 300 methods, perhaps 50 of which are often useful, the rest there if the occasion arises. Occasionally I move the real cruft into the Zaps group, so it's out of the way.&lt;/p&gt;  &lt;p&gt;The utility has lots of ease-of-use features. I prefer the keyboard to the mouse, so methods are tagged into groups that are accessible from a dropdown: control-T selects a different group. Don't remember the group? You enter control-F to find all the methods matching a string. Arrow down and press to run the method. The parameters window always remembers its state: if you entered Hoytster last time, it's there this time. You can right-click a method to see its tooltip; double-right-click to see its source.&lt;/p&gt;  &lt;p&gt;I tried to make it easy to create new methods quickly. &lt;/p&gt;  &lt;p&gt;A method generates your new function's prototype: you enter the method's name, group tag, tooltip, etc, and the new method is created with the requisite attribute decorations. The prototype is placed in the clipboard so you can paste it into one of the utility's source files.&lt;/p&gt;  &lt;p&gt;It's easy to prompt for parameters:&lt;/p&gt;  &lt;p&gt;...GetParameters("*Target File", "@Report File", "Open Report [No, Yes]");&lt;/p&gt;  &lt;p&gt;opens a window with textboxes labeled Target File and Report File, and an Open Report checkbox with text that toggles Yes and No. Strings in curly-braces become radiobuttons. The Target File must exist, because of the initial asterisk; the parameters window will not close if an invalid target file is entered. The Report File must be valid (it CAN be created) because of the @-sign.&lt;/p&gt;  &lt;p&gt;When you run the method and the parameters window appears, it has a [Capture] button you click to generate the code needed to capture the returned parameters, putting it into the clipboard again:&lt;/p&gt;  &lt;p&gt;string targetFile = parameters["Target File"];   ...   boolean openReport = parameters["Open Report"] == "Yes";&lt;/p&gt;  &lt;p&gt;Ach, I go on too long.&lt;/p&gt;  &lt;p&gt;So, how ambitious should I be? CodePlex? Maybe a dedicated web site, where people can upload their methods?&lt;/p&gt;  &lt;p&gt;Getting the utility publish-ready would be a lot of work. I have to clean up the code; remove the really dumb methods and the never-finished methods; create a screen cast of the "make a new method" process, document the teeny "meta-language" (tongue-in-cheek) that drives the parameters window.&lt;/p&gt;  &lt;p&gt;I like the idea of y'all using my utility to be a bit more productive. I love the idea of seeing what methods you invent and share. No doubt it's out there, but I'm not aware of places on the net where people share code as simple as a method "Fix the names of my MP3s".&lt;/p&gt;  &lt;p&gt;Would you like to have this utility?&lt;/p&gt;  &lt;p&gt;Besides being overworked and lazy, I have never put up a web site (!) -- and y'all might mock me because my GetParameters() method has about 200 lines (my poor excuse: I started out with FORTRAN). This utility was never designed; it &lt;em&gt;accreted&lt;/em&gt;. :)&lt;/p&gt;  &lt;p&gt;So let me know: Do you think this utility is useful enough to put up on CodePlex (or somplace)?&lt;/p&gt;  &lt;p&gt;Thanks in advance! - Hoytster&lt;/p&gt;              &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-7437161869259598411?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/7437161869259598411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/is-cbmunger-ready-for-prime-time-i.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/7437161869259598411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/7437161869259598411'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/is-cbmunger-ready-for-prime-time-i.html' title='Is CBMunger ready for prime-time (I should I bother?)'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-687115937605809424</id><published>2009-12-07T09:26:00.000-08:00</published><updated>2009-12-07T09:50:07.900-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reqall'/><title type='text'>Reqall Take 2</title><content type='html'>Thoughts after using Reqall for a few days.&lt;br /&gt;&lt;br /&gt;I find myself continuing to rely on my familiar, pre-Reqall tools, because...&lt;br /&gt;&lt;br /&gt;1) The Reqall date-time voice recognition is very good, but not perfect, possibly because I am doing it wrong. My attempts at instructions like "...each second Wednesday of the month" have not worked, not even close. So it's more accurate to enter items into Google calendar, if I'm on my PC. Fortunately, Reqall provides a means to edit the calendar events, which I had overlooked until now. That helps.&lt;br /&gt;&lt;br /&gt;Reqall should be helpful when I'm at the dentist's scheduling my next appointment. I just have to remember to check such items. I don't know how difficult it is, to check something six months out. I guess I can search for "dentist" in Google calendar, if Reqall's interface does not suffice.&lt;br /&gt;&lt;br /&gt;I &lt;span style="font-style: italic;"&gt;love &lt;/span&gt;that Reqall and Google calendar keep each other updated.&lt;br /&gt;&lt;br /&gt;2) Using Reqall like my voice recorder, where I "note" miscellaneous stuff of greater and lesser urgency, fills up my Reqall daily queue with a lot of detritus that I do &lt;span style="font-style: italic;"&gt;not &lt;/span&gt;need to do any time soon. I found it necessary to write a little C# code that allows me to copy the Reqall lists of items into the clipboard, then remove all the links and such that I don't want, from the clipboard text -- yielding just the notes and to-do items -- which I then move into their various categories in OneNote -- per usual. &lt;span style="font-style: italic;"&gt;Then &lt;/span&gt;I need to go back to Reqall to &lt;span style="font-style: italic;"&gt;manually &lt;/span&gt;remove those items.&lt;br /&gt;&lt;br /&gt;Reqall's notification is a strong feature. If I have something scheduled for a given day, my phone will ding, redundantly with an email and SMS (I should eliminate the SMS, it costs) -- and my IM will pop up the message if I'm at work and have forgotten my phone. Reqall will help me most with weekend events, that I can otherwise overlook because I'm not in my calendar consistently on weekends. The 30-minute default notification can be changed to another default -- or the notification time can be changed manually for a given item. Nice.&lt;br /&gt;&lt;br /&gt;The shopping list feature seems slick. Given my C# method, though, I don't need to make Costco a known Reqall place, and go through the additional work of associating a Recall voice message with the Costco place (which takes maybe 3 clicks on the iPhone). Instead, I can simply start my note with "Costco" or "CVS" or "Groceries", and when I've cleaned up the resultant text with my C# method, then the Costco items will be sorted together. I have to &lt;span style="font-style: italic;"&gt;do &lt;/span&gt;that, however, and I have to print out the result... which is not so likely to happen. So maybe applying the official Reqall approach is better. Only, I don't think the Costco items would be available, if I went to another Costco, which is a real possibility; there's one near work, and one in Nashua, where I pick up Nelson.&lt;br /&gt;&lt;br /&gt;It's early, yet. I'll figure it out.&lt;br /&gt;&lt;br /&gt;It's a bummer that there's no way to remove items from the Reqall lists, en masse. I have to click each one. I wonder if I could write something to accomplish that for me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-687115937605809424?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/687115937605809424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/reqall-take-2.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/687115937605809424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/687115937605809424'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/reqall-take-2.html' title='Reqall Take 2'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-1818361562393113330</id><published>2009-12-03T12:31:00.000-08:00</published><updated>2009-12-03T12:33:17.426-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FitnessRocks PaleoDiet InsulinResistance'/><title type='text'>Comment on Fitness Rocks re the Evolution podcast</title><content type='html'>It was very cool, that Dr. Rubin (and crew) figured out that their missing link would be in rock that was (?) 325 million years old, because they knew when the descendants and ascendants were found in the fossil record. Wow: a "fish" with a neck and elbows, and walkie-things in the fins -- very likely our ancestor.&lt;br /&gt;&lt;br /&gt;It was fascinating, but the podcast was light on how evolution relates to our modern health predicaments, and especially how we should be eating.&lt;br /&gt;&lt;br /&gt;By coincidence, last week I encountered something new, the Paleo Diet. It's advocates say that we are not evolved to eat grain and dairy products, sugar and salt. Instead, we should be eating like our ancestors did, 10,000 years ago: meat, vegetables, fruit, nuts and roots (?). That's close to your familiar plant-based diet prescription, Monte -- leaving aside the meat. Paleo's hold that the wild game our species ate millenia ago was much leaner (and healthier) than our modern meat. Sounds credible to me: feedlots are all about adding fat, right?&lt;br /&gt;&lt;br /&gt;I don't know if these Paleo people are crazy. I chanced on a podcast, featuring a guy with a seemingly strong science background -- a PhD. in biochemistry (maybe?) &lt;i&gt;and&lt;/i&gt; a former Olympic class body-builder!! It sounded good, but I haven't read up on it yet.&lt;br /&gt;&lt;br /&gt;If you're interested, &lt;a href="http://www.thepaleodiet.com/published_research/"&gt;this page&lt;/a&gt; has abstracts of Paleo-related scientific papers, most with links to the journal articles. Dr. Loren Cordain is the main man, according to the podcast, and he's featured on the linked page.&lt;br /&gt;&lt;br /&gt;Insulin resistance is a focus of the Paleo crew -- which piques my interest, since I'm a recovering diabetic (my last A1C was 5.6, joy!). The podcaster was adamant about health problems in modern societies, because of a 20-1 ratio of omega-6 to omega-3 fats in the typical American diet -- asserting that it should be closer to 1-to-1. I &lt;i&gt;think&lt;/i&gt; the guy dissed flax seed oil -- he definitely was an advocate for fish oil supplementation.&lt;br /&gt;&lt;br /&gt;I'll email you if / when I learn more about the Paleo thing.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;I am so glad you're back!&lt;/b&gt; I'm passing through all the podcasts a second time -- but it's great that there are new 'casts coming. YAY!&lt;br /&gt;&lt;br /&gt;- Hoyt&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-1818361562393113330?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/1818361562393113330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/comment-on-fitness-rocks-re-evolution.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/1818361562393113330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/1818361562393113330'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/comment-on-fitness-rocks-re-evolution.html' title='Comment on Fitness Rocks re the Evolution podcast'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-3969565919410621174</id><published>2009-12-03T11:52:00.001-08:00</published><updated>2009-12-10T06:46:07.375-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net powerbuilder ServerControls subclass'/><title type='text'>Posted question on StackOverflow about always subclassing controls -- a la PowerBuilder</title><content type='html'>In my pre-ASP.NET development environment, there was a near-universal best practice:&lt;br /&gt;&lt;br /&gt;    * NEVER use the native controls!&lt;br /&gt;    * Instead, subclass ALL the controls, and ALWAYS use the subclassed version.&lt;br /&gt;&lt;br /&gt;Why? Because that gave you a hook... one place to write code and have it applied throughout your application.&lt;br /&gt;&lt;br /&gt;For example: Suppose you decide that you want a question mark icon to appear to the right of every TextBox in your webforms app. The icon is rendered, and hovering over it pops up bubble help -- iff there is text in the TextBox.ToolTip property.&lt;br /&gt;&lt;br /&gt;How would you accomplish that, if you're using the MS-provided TextBox control?&lt;br /&gt;&lt;br /&gt;If you consistently used a subclassed version of TextBox in your application, then you could go to that object, and add the method that renders the icon, stocked with your favorite bubblehelp javascript.&lt;br /&gt;&lt;br /&gt;Presto! All of your app's TextBoxes sprout little question mark icons -- or they will, when you set their ToolTip text.&lt;br /&gt;&lt;br /&gt;Over time, you can easily adapt and enhance ALL your TextBoxes, because they all have a base class that you can modify. You add a feature where ToolTips are set from a resource file. Next, you add a ShowOnLeft property that presents the icon on the left side of the TextBox. Do you like how the iPhone password control shows the last character you type, obscuring the earlier characters? Override your subclassed TextBox's default behavior for passwords with a method to implement that behavior.&lt;br /&gt;&lt;br /&gt;I have never encountered advocates for this practice, in ASP.NET. Have I just missed it? An article describing two dozen ASP.NET design patterns doesn't have anything related. The posts about *how* to subclass server controls describe special-purpose one-offs, like a TextBox that only accepts digits -- but none of them recommend the pervasive "ALWAYS use subclassed controls!" policy that I subscribed to in olden days.&lt;br /&gt;&lt;br /&gt;Does it make sense, to apply this ancient wisdom, when working in ASP.NET? To always use the subclassed equivalent of the native server controls?&lt;br /&gt;&lt;br /&gt;If not -- why not? Are there other ways to skin this cat? A technique that provides you with just one place where you can augment ALL your application's instances of a given control?&lt;br /&gt;&lt;br /&gt;I'd love to hear about that. I *want* my TextBoxQMark control. :-)&lt;br /&gt;&lt;br /&gt;TIA - Hoytster&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-3969565919410621174?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/3969565919410621174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/posted-question-on-stackoverflow-about.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/3969565919410621174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/3969565919410621174'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/posted-question-on-stackoverflow-about.html' title='Posted question on StackOverflow about always subclassing controls -- a la PowerBuilder'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-7990233886884820611</id><published>2009-12-01T05:31:00.000-08:00</published><updated>2009-12-01T05:40:22.942-08:00</updated><title type='text'>Code Generation</title><content type='html'>Someone suggested that I look at CodeDom, which is a .NET namespace. It allows you to describe code to generate in a precise, verbose way, that is &lt;span style="font-style: italic;"&gt;considerably &lt;/span&gt;longer than the generated code. The main advantage, if you care, is you can have the same CodeDom code generate code for either VB.NET or C#. The downside of that is you cannot use any C#-isms.&lt;br /&gt;&lt;br /&gt;T4 is a capability inside Visual Studio, a templated approach to code generation.&lt;br /&gt;&lt;br /&gt;My eyes glazed over as I read it. I want code generation to be driven by meta-data. If the STATUS column on a table is a single character, translated at run-time to something readable, then I want to record that fact in a database table, so the translation can be done when the SQL is generated (or when the business object is populated from the SQL). I want to generate SQL by retrieving a table's columns from USER_TAB_COLUMNS and (optionally) joining to related tables as indicated when I detect foreign key relationships. Where does the generated code go? We have multiple targets and each has its own folder structure for the various entities and objects. That's all meta-data. A large part of the app will be making it easy to set that data.&lt;br /&gt;&lt;br /&gt;Someone else suggested CodeSmith.&lt;br /&gt;&lt;br /&gt;I should look over T4 and CodeSmith enough to have a glimmer about how they work. At worst, that will help inform my own custom coding.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-7990233886884820611?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/7990233886884820611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/code-generation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/7990233886884820611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/7990233886884820611'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/code-generation.html' title='Code Generation'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-7684485666385986963</id><published>2009-12-01T05:26:00.000-08:00</published><updated>2009-12-01T05:31:49.394-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='internet'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><title type='text'>On becoming a stares-at-phone guy</title><content type='html'>I've long been mildly irritated and amused by all the people I see with their faces in their phones. Anywhere people are sitting, the youts have their phones out. Even during movies. Weird.&lt;br /&gt;&lt;br /&gt;Last night, as I walked three-quarters of a mile to the MS certification meeting, I was using Safari on my iPhone to look at SlickDeals.net. I'm a SAP, Stare-At-Phone guy.&lt;br /&gt;&lt;br /&gt;I have something approaching an addiction with the internet. Default activity if I have 10 minutes before bedtime: digg.com. Default activity when eating lunch at my desk: asp.net.&lt;br /&gt;&lt;br /&gt;With the iPhone, I have internet access &lt;span style="font-style: italic;"&gt;all the time &lt;/span&gt;(within the limits of AT&amp;amp;T apparently quite limited 3G network). I hope it isn't a problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-7684485666385986963?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/7684485666385986963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/on-becoming-stares-at-phone-guy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/7684485666385986963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/7684485666385986963'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2009/12/on-becoming-stares-at-phone-guy.html' title='On becoming a stares-at-phone guy'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3874252081774939607.post-6352687276027483835</id><published>2009-11-30T12:58:00.000-08:00</published><updated>2009-11-30T13:46:45.131-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cool'/><category scheme='http://www.blogger.com/atom/ns#' term='reqall'/><category scheme='http://www.blogger.com/atom/ns#' term='organization'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><title type='text'>Reqall: Adding reminders to my calendar by talking into my iPhone</title><content type='html'>I have just started using &lt;span style="font-weight: bold;"&gt;Reqall&lt;/span&gt; on the iPhone, with the service from Reqall.com. It's slick.&lt;br /&gt;&lt;br /&gt;I am driving my car, and call to make an appointment with my doctor. The call ends, and I immediately run the iPhone Reqall app. Hit the plus sign, tap the surface, and say "Appointment: Dr. Stillwater on Tuesday December 8 at 7:40 AM." I tap again to signify that I'm done.&lt;br /&gt;&lt;br /&gt;Within 15 minutes or so, my audio has been translated to English, and the English is sent back to my phone. In this case, it's letter-perfect. The translation is always close; names of people are the main stumbling block, no big deal. Reqall has versatile technology for recognizing dates and times; with the right phrase, I could add a meeting that meets on alternating weeks (!).&lt;br /&gt;&lt;br /&gt;Back at the office, I check my Google calendar, and the doctor's appointment is in there, with the right time and date, and the right text.&lt;br /&gt;&lt;br /&gt;I have it set up so that, by default, Reqall notifies me by email, SMS message AND by IM -- 30 minutes before an appointment. This doctor is a good ways away, so I set a reminder in Google calendar so it will send me an SMS message an &lt;i&gt;hour &lt;/i&gt;before the appointment, giving me time to get there. Aside from the notification interval, I do not need to put reminders in my Google calendar events; Reqall picks them up, and notifies me the usual three ways. The email and IM will be important on those too-frequent days that I forget to bring my phone to work.&lt;br /&gt;&lt;br /&gt;Hmmm: I could have just told Requal that my appointment was a 7:10 instead of 7:40.&lt;br /&gt;&lt;br /&gt;A lite version is free; I coughed up the $25 / year for the pro version. There's a client for the iPhone and Blackberry. If you don't own either, you can use an ordinary phone and call a provided toll-free number to &lt;span style="font-style: italic;"&gt;speak &lt;/span&gt;your reminders. There's a web client you can use to enter todo items and such, if you prefer to type them at your PC. You can set it up so that Requal associates you with several phones, e.g. cell / work / home. If I add my wife's cell to the list,  she will be able to ask me to pick something up from the grocery by calling Reqall; she speaks, and it appears in my to-do list. I'll think on that one.  ;)&lt;br /&gt;&lt;br /&gt;A &lt;span style="font-style: italic;"&gt;pro &lt;/span&gt;feature that I have yet to explore: I can tag items with locations -- and since the iPhone knows where I am at any given time -- when I go to my favorite grocery store, or Costco, Reqall will prompt me with the items I've associated with that place.&lt;br /&gt;&lt;br /&gt;It's really too cool.&lt;br /&gt;&lt;br /&gt;I invented this application in my brain, years ago. "Why can't a phone do voice recognition, so I can just tell it to remind me about things? And get a phone call when the event comes up?" I thought "I will buy an iPhone if it has this app" -- since the iPhone has an app for everything. I went looking, and sure enough, I found Reqall --and bought the iPhone. The voice-recognition technology was developed at MIT, apparently. Reqall does &lt;span style="font-style: italic;"&gt;not &lt;/span&gt;call me to remind me, but the email and SMS notification are as good or better, given that the iPhone draws attention to itself when those messages arrive.&lt;br /&gt;&lt;br /&gt;This app alone justifies the expense of the iPhone, for me. It's been almost impossible for me to get to dentist appointments that were made six months ago. In theory, I can put such events in Google calendar, and that does help a lot -- but I regularly fail to get such items into the calendar. No more! I can do it as I stand in the dentist's office, talking to my iPhone.&lt;br /&gt;&lt;br /&gt;The world just keeps getting cooler.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3874252081774939607-6352687276027483835?l=hoytsblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hoytsblog.blogspot.com/feeds/6352687276027483835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hoytsblog.blogspot.com/2009/11/reqall-adding-reminders-to-my-calendar.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/6352687276027483835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3874252081774939607/posts/default/6352687276027483835'/><link rel='alternate' type='text/html' href='http://hoytsblog.blogspot.com/2009/11/reqall-adding-reminders-to-my-calendar.html' title='Reqall: Adding reminders to my calendar by talking into my iPhone'/><author><name>Alphonse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://2.bp.blogspot.com/_00GYSlOBF_g/SxQ3uK0HonI/AAAAAAAAAFQ/HeLEdH9HEgw/S220/2009BirthdayFamilyPhoto.JPG'/></author><thr:total>1</thr:total></entry></feed>
