DotSVN is an Open Source .NET library that allows you to programmatically access a Subversion library. While this is an interesting idea, what I found even more interesting was the article's graph showing the growth in usage of Subversion over the last 3.5 years. The rate of adoption is dramatic, and this is just for public Apache servers!
Tuesday, September 25, 2007
A "weak" reason to invoke garbage collection
Call GC.Collect() is generally considered unnecessary and can actually disrupt the smooth functioning of the .NET garbage collector. Dennis Dietrich gives a scenario where it is reasonable to call the garbage collector in your code. His example outlines a situation where you want to test that all references to an object have been deleted at some point in the program so that the object can be garbage collected. The catch-22 is if you maintain a reference to the object to see if it still exists, it cannot be collected.
Enter WeakReference. This class allows you to maintain a reference to an object while letting it be collected if need be. In the time between the object's destruction and its pickup by GC, a WeakReference allows you to continue to use the object. Now continuing to use an object that's in limbo may seem like a bad idea, as the garbage man could drive by anytime. But here's an interesting scenario where you may wish to keep a WeakReference so that you could have the possibility of turning it back into a strong reference (and thus keep the object from being collected).
In our testing case, we wish to do the opposite, make sure we cannot continue to reference the object. After GC.Collect() is called, we check the IsAlive property of our WeakReference.
On a side note, it's interesting that something so fragile implements ISerializable.
Saturday, September 01, 2007
Windows XP Commands
In the process of looking up some cheat sheets, I found this site. The SQL 2005 was what led me there, but this caught my eye, since a lot of guys at work use the command line. There are things in here I had never heard of, much less used.
For example: CSVDE Import or Export Active Directory data. Wow. I've used TRACERT quite a bit, but now there's also PATHPING. If you are cmd junkie, check it out.
TDD? .NET 2.0 SP1??
I recently started a new position where they use VS2005 and Test-Driven Development, which is something new to me. At home I've been using VS2008 beta2, and it has been very solid. So, I installed it side-by-side on my company laptop. All of a sudden, one of the unit tests I was working with failed. After a bit of digging, it turned out that it was related to the order of List<T>.Sort().
This particular unit test was for a custom IComparer that cared only about certain high-priority filename extensions. The rest of the extensions were left essentially unsorted, and the filename portions were ignored. The thing was, the unit test was expecting all of the items sorted to be in a particular order. When I put some debugging in, I found that order of two of the four "non-high-priority" extensions were swapped when I ran the test.
After some angst and some mild reproaches from my boss ("We usually use VPCs for installing beta software..."), I decided the best course of action was to repave the machine. Later on, buried in a post about how garbage collection is changed in 3.5, I found a reference to "SP1 for the 2.0 framework"!
It kind of makes sense that something would need to be done to allow the new multi-targeting feature, but I had always thought everything was going to be pretty much the same in the 2.0 framework. Turns out that's not exactly the case. I didn't come to any conclusive evidence in short time I spent Reflectoring, but it's clear that something's different, since the size and date of mscorlib is different in 2.0 after 3.5 is installed.
In any event, I pointed out that the framework documentation for 2.0 (and all subsequent versions) says that a Quicksort algorithm is used, which does not guarantee that equals will remain in their original order. I finally got a concession that perhaps the tests could be revised. In doing so, I found out that the version control history showed that someone else had found the same problem and had simply changed the expected sort order to match what came up on that test machine!
As my first taste of Test-Driven Development, this was a bit sour. Shouldn't we be thinking about what needs to be tested instead of just writing any old thing? In this case, it was testing that items inserted into the List<T> after an initial sort would also be sorted when you once again issued List<T>.Sort(). WTF?!? If List<T>.Sort is broken and it's up to my puny unit test to find it, let's all just pack up and go home.
If a test produces a "false failure", shouldn't we see if something needs to be revised instead of changing the test to match the new result?? If it's too much trouble to make sure the tests test what should be tested and have them run correctly, why do we do TDD?
Friday, July 27, 2007
Goodbye, J# - We hardly knew ye.
Don't miss the samples page after you install. There are some new and interesting items there.
Thursday, July 05, 2007
One was a blog from Dan Moran a SQL Server specialist (or at least he stays right on top of SQL Server tech info). His recent blog post The More Things Change references a much earlier one with a provocative title (Can Generalists Handle Complex IT?)
Here's the thing that caught my eye:
Back in the days of "Little House on the Prairie," Doc Baker did a good job of handling the medical needs of Walnut Grove. He was a great doctor for the time and knowledge available, but today I'd want to see a top specialist if I needed brain surgery. More and more, what’s considered a commonplace solution is the IT equivalent of brain surgery, but more often than not, the IT equivalent of general practitioners still do the work.As a confirmed generalist by circumstance (almost all my jobs have been with very small IT departments or software companies) and temperment (high degree of curiosity about new tech, esp. software), I have to wonder...
Am I doing a service or disservice to my employer by trying to keep up?
On the one hand, if there is literally nobody else who can handle, for example, keeping up with service packs and which ones to apply and when, should I take on this area? Hiring a consultant at my current job (a non-profit) would be out of the question. Who else will keep the wolves from the security door?
On the other hand, if you become too much of a generalist, do you start to become unemployable? If a company wants a consultant, will they look at someone who has good problem solving skills because of broad experience but not a great deal of in-depth experience in the job's skillset?
A generalist tends to know how to "get things done" but not all of the ins and outs of the best practices in the area. Is it more important to focus on, let's say, ASP.NET and have little or no practical experience in WinForms? In a bigger outfit, sure that works well. They can hire specialists. But even so, isn't there room for someone who has a larger vision of how something can be architected because of experience with mainframes, minis, and and VTAM as well as PCs, LANs and HTTP?
Another source was a Hanselminutes podcast, an interview with Tim Ferriss, author of The 4-Hour Work Week. One of his main thrusts is Simplify. He has an assistant respond to much of his email, for instance. When you really need to concentrate, reduce distractions - close your door, redirect your phone, turn off IM & email. The podcast is worth a listen, though if you turn up enough to hear Ferriss, you will be blown away by Scott. (A little db metering before recording would be welcomed...)
Web Worker Daily has a few items, here, there, and over here, which have a few tidbits of useful info.
One of the more interesting writers on the subject in my brief confluence of influences is Christopher Hawkins, who has written several times on the topic. One of the quotes:
Basically, if it's not helping me to secure or complete projects for my company, if it's not helping me to make money, if it's not improving my life in some way, it's mental clutter and it's out.I can agree with this, but what if keeping up is what helps your company make money? And I think any techie will agree that lifetime learning is essential, whether or not you try to learn all or just some of what's going on.
Finally, I stumbled across some encouraging items. Perhaps I'm just adjusting to The New Normal, which is where overload is a Good Thing and Continuous Partial Attention is the order of the day.
The one thing that is clear is that any tendency toward ADD, which many if not most techgeeks have, is exacerbated by infoloading (vs. carboloading, which we also do). The danger is that you will flit from thing to thing without really absorbing any of it.
My idea is to make a list of topics, turn off everything else, learn a significant amount about the first one. Repeat as needed.
Saturday, June 16, 2007
Measuring the impact of the Sales Force
I first became familiar with this phenomenon when working for a software development outfit. I really liked the salesman (singular), who taught me the term "Salesman's License". This refers to the fact that the customer is always right and can only be sold if the requested feature is "in the pipeline". He took some license with the current state of our products, based on what he thought we could do or were actually thinking about doing.
Thanks for helping me find a vocabulary to talk about this issue! ;^)
How do you do it?
How do you handle it? It must be easier when, say, WCF development is your job. You are surfing one of the first waves of a new technology. I'm more of a generalist in my job. I may have to handle "my system doesn't work" questions as well as "I need to know how many angels danced on the head of pin between June and December of last year". Inbetween, I try to keep my mind alive by enhancing our main web app, writing a utility, or exploring new technologies.
But my natural curiosity takes me too far, into too many areas. It's just all so fascinating! So, what do you do when it's not your job to keep up with technology but you crave doing it? Do you use will-power and make yourself stick with a few things at a time? Explore F# just up to the point that you know you could rewrite your query app in it, even if you don't actually do it?
I've heard you talk about the issue - what do you actually do to handle information overload?
Netscape 9.0 beta
I stuck with it until the HR page of the new company I started with failed to register one of my kids for insurance, because a Microsoft-only feature did not show up when I used NS. When I found out about Avant, I dropped NS and have not looked back until now.
I've known that there was underground development of NS going on, but as IE7, Firefox 1.x and 2.x came out, it meant less and less. Finally, I decided to try 9.0 beta, partly for nostalgia.
Right away I was put off by the tab text refreshing at the same rate that .gifs and other elements were being downloaded. This began to bother me so much visually that I uninstalled it. That's rare for me, as I tend to the packrat end of the spectrum.
I will probably try another version someday, but I'm not sure why NS is still going. In skimming the features, I failed to see what they have that isn't being done well by someone else. It's sad from a "good old days" point of view. But only for a moment, as the firehose continues to pump. Acropolis, Silverlight and DLR are adding to my already-crippling burden of things to track.
Wednesday, May 30, 2007
FolderShare
It is owned by Microsoft now and is still in "beta" even after a couple of years, but it works without a hitch. Almost. (see below)
I have a directory on both my home and work machines that are connected in a "library". When I find an interesting utility that would be useful at home, I put a copy in that folder and the transfer happens automatically, in the background. Naturally, the sending and receiving machines have to be running the FolderShare program, but I rarely turn off either machine.
Not only that, but you can have multiple users sharing the same folder. It's kind of like RSS for files, only you control who can 'subscribe' to the directory.
One of the really nice things is that it works behind just about any firewall because it's port 80 based!
Now, the hitch. In theory, you can visit the web site and browse another machine's shared directories (the site is password protected, of course). If you click on a particular file, it will initiate a file transfer. However, I have had only mixed success with this. Sometimes it will just sit forever, sometimes it will timeout, sometimes you get the file. Size (in this case) doesn't matter.
And in my case, the chums who control the firewall have added this site to the blocked list under the category "Peer to peer sharing sites". I've put in a request to have it unblocked, but it looks like they won't do it. But the folder sharing auto-transfer feature is just great and works flawlessly.
Tuesday, May 08, 2007
What's so good about NHibernate?
I have seen several items lately, particularly from Ayende of course (I love the idea of Bumbler!) Sam considers it Noteable. In the past, he has also mentioned it in contrast to Microsoft's flagging ORM efforts as a Good Thing.
Time to check it out. I go to NHibernate.org (or rather a page off of Hibernate.org) and check out the Nhibernate Quick Start Guide. In five steps, the first of which you may not need (create a database), the last of which is really several steps to get the configuration and connection objects lashed up, you can begin firing at your database.
The first few examples look good, such as:
User newUser = new User();
newUser.Id = "joe_cool";
newUser.UserName = "Joseph Cool";
newUser.Password = "abc123";
newUser.EmailAddress = "joe@cool.com";
newUser.LastLogon = DateTime.Now;
session.Save(newUser); // commit all changes to the DB
transaction.Commit();
session.Close();
Seems natural enough. Then we go down a bit to find
Let's say you want to retrieve an object when you know the user ID (eg. During a login process to your site). Once a session is opened it's a one-liner; pass in the key and you're done:
// open another session to get the new user
session = factory.OpenSession();
User joeCool = (User)session.Load(typeof(User), "joe_cool");
Casting? Why are we casting?? Why not create an object of the type you want and get IntelliSense for its columns, properties, and methods? That's what the MyGeneration d00dads architecture lets you do. Here is their canonical example.
And what's up with all the code you have to write? One would assume that NH devotees use code generation for the class with its properties and the
Now a lot of any ORM or DAL tool is what you get used to doing. If NH floats your boat, I won't try to argue you out of it. But I'd love to know if anyone using NH has also tried something a bit more automated, perhaps even SubSonic, which is starting to look very nice in v2.0.
If you have tried something else and still use NH, I'd love to know why.
Friday, July 22, 2005
Here's what's wrong with the Tablet PC
Tablet PCs are just too slow.
None of the current implementations have fast enough processors to be usable. Mind you, I am in love with the idea of Tablet PCs. In the healthcare world, they have great potential to make things both easier for the provider and more accessible. I read white papers and testimonials from healthcare professionals and organizations saying how they have been used or how promising the idea is.
But, as I play with the three that we have purchased in our organization (healthcare), I am frustrated that the mouse cursor cannot keep up with normal handwriting or pen movement. It's yet another case of the human having to make too much of a concession to the machine to get something done.
As a programmer, I make concessions all the time. I devise workarounds for tools that misbehave. I translate data from one program's format to another format because the receiver or sender cannot accomodate the other. All of us live with quirky operating systems that require special care and feeding. I am willing to do these things because I like technology and enjoy making it work.
My end users, on the other hand, have much less interest in fiddling with bits or pieces of hardware. They could care less that they hold a wonderful but nascent technology in their hands. They only know that "this thing doesn't work!". When I create a solution for them, I try as much as possible to look at it from that viewpoint. And when I pick up a Tablet and use it from that perspective, it just doesn't hold up.
I bet if we could go somewhere over the 2Ghz range, the O/S could be responsive enough to make it truly what it was intended to be. We're just so close, and I really want us to get there.
Thursday, July 21, 2005
Tabbed browsing
I finally had to quit using Mozilla when there were too many important web sites I was required to visit that would not display properly. I looked around in the IE wrapper world and came up with Avant Browser. I have not looked back since. All the tabbed goodness of the old Mozilla with the (for better or worse) engine of IE. And the feature set of these wrapper apps (Maxthon is another) has not stagnated.
How about being able to drag a new tab near other related tabs? How about being able to duplicate a tab with or without its current history of pages? What if you like multiple rows of tabs rather than one long one. Firefox, even with Tabbrowser Preferences installed, keeps squeezing the width of the tabs until they are unreadable. How unusable.
Do yourself a favor. Try Maxthon or Avant Browser (my choice). Pick one. Don't look back.
Notes from the firehose
Even in one arena, there are things happening on multiple fronts. I feel like a beleaguered general with too few troops caught in an open plain with armies closing in on all sides.
But, one must press on. I already try to keep up with far too many technical blogs. Every so often, I have to narrow my focus, weed out what's not of immediate value, and soldier on. It's fun, isn't it? :-)
This corner of blogdom will report on my sips from the firehose.
