September 2006 Blog Posts
A few days back Jon Galloway and I were discussing a task he was working on to document a database for a client. He had planned to use some code generation to initially populate a spreadsheet and would fill in the details by hand. I suggested he store the data with the schema using SQL extended properties.
We looked around and found some stored procs for pulling properties out, but no useful applications for putting them in there in a nice, quick, and easy manner.
A few days later, the freaking guy releases this Database Dictionary Creator, a nice GUI tool to document your database, storing the documentation as part of your database schema.
The tool allows you to add your own custom properties to track, which then get displayed in the data dictionary form grid as seen above. Audit and Source are custom properties. It is a way to tag our database schema.
You ask the guy to build a house with playing cards and he comes back with the Taj Mahal.
Check it out.
As developers, I think we tend to take the definition of Version for granted. What are the components of a version? Well that's easy, it is:
Where the Build and Revision numbers are optional. At least that is the definition given my the MSDN documentation for the
But look up Version in Wikipedia and you get a different answer.
The most common software versioning scheme is a scheme in which different major releases of the software each receive a unique numerical identifier. This is typically expressed as three numbers, separated by periods, such as version 2.4.13. One very commonly followed structure for these numbers is:
Notice that this scheme differs from the Microsoft scheme in that it places the build number at the very end, rather than the revision number.
Other versioning schemes such as the Unicode Standard and Solaris/Linux figure that three components is enough for a version with Major, Minor, and Update (for Unicode Standard) or Micro (for Solaris/Linux).
According to the MSDN documentation, the build number represents a recompilation of the same source, so it seems to me that it belongs at the end of the version, as it is the least significant element.
In Subtext, we roughly view the version as follows, though it is not set in stone:
- Major: Major update. If a library assembly, probably not backwards compatible with older clients. This would include major changes. Most likely will include database schema changes and interface changes.
- Minor: Minor change, may introduce new features, but backwards compatibility is mostly retained. Likely will include schema changes.
- Revision: Minor bug fixes, no significant new features implemented, though a few small improvements may be included. May include a schema change.
- Build: A recompilation of the code in progress towards a revision. No schema changes.
Internally, we may have schema changes between build increments, but when we are prepared to release, a schema change between releases would require a revision (or higher) increment.
I know some developers like to embed the date and counter in the build number. For example, 20060927002 would represent compilation #2 on September 27, 2006.
What versioning schemes are you fans of and why?
When Log4Net doesn’t work, it can be a very frustrating experience. Unlike your typical application library, log4net doesn’t throw exceptions when it fails. Well that is to be expected and makes a lot of sense since it is a logging library. I wouldn’t want my application to fail because it had trouble logging a message.
Unfortunately, the downside of this is that problems with log4net aren’t immediately apparent. 99.9% of the time, when Log4Net doesn’t work, it is a configuration issue. Here are a couple of troubleshooting tips that have helped me out.
Enable Internal Debugging
This tip is straight from the Log4Net FAQ, but not everyone notices it. To enable internal debugging, add the following app setting to your App.config (or Web.config for web applications) file.
<add key="log4net.Internal.Debug" value="true"/>
This will write internal log4net messages to the console as well as the
System.Diagnostics.Trace system. You can easily output the log4net internal debug messages by adding a trace listener. The following snippet is taken from the log4net FAQ and goes in your <configuration> section of your application config file.
Passing Nulls For Value Types Into AdoNetAppender
Another common problem I’ve dealt with is logging using the AdoNetAppender. In particular, attempting to log a null value into an int parameter (or other value type), assuming your stored procedure allows null for that parameter.
The key here is to use the RawPropertyLayout for that parameter. Here is a snippet from a log4net.config file that does this.
<parameterName value="@BlogId" />
<dbType value="Int32" />
<key value="BlogId" />
Hopefully this helps you with your log4net issues.
I’ve thought alot about the same issues with Subtext. Orginally my plan was to simply repurpose the existing category functionality by slapping a big tag sticker on its forehead and from henceforth, a category was really a tag. One big rename and bam!, I’m done.
But the API issue Duncan describes is a problem. After more thinking about it, I now plan to make tags a first class citizen alongside categories. In my mind, they serve different purposes.
I see categories as a structural element and navigational aid. It is a way to group posts into large high-level groupings. Use sparingly.
By contrast, I see tags as meta-data, use liberally.
One thought around the API issue is that there is a microformat for specifying tags (rel="tag") and Windows Live Writer has plugins for inserting tags into the body of a post.
My current thinking is to pursue parsing tags from posted content and using that to tag content.
tags: Rel-Tag, Microformat, Categories, Tags
Akismet is all the rage among the kids these days for blocking comment spam. Started by the founder of Wordpress, Matt Mullenweg, Akismet is a RESTful web service used to filter comment spam. Simply submit a comment to the service and it will give you a thumbs up or thumbs down on whether it thinks the comment is spam.
In order to use Akismet you need to sign up for a free non-commercial API key with WordPress and hope that your blog engine supports the Akismet API.
There are already two Akismet API implementations for ASP.NET, but they are both licensed under the GPL which I won’t allow near Subtext (for more on open source licenses, see my series on the topic).
So I recently implemented an API for Akismet in C# to share with the DasBlog (despite the bitter public mudslinging between blog engines, there is nothing but hugs behind the scenes.) folks as part of the Subtext project, thus it is BSD licensed.
You can download the assembly and source code and take a look. It is also in the Subtext Subversion repository.
UPDATE: This code is now hosted in the Subkismet project on CodePlex.
Not too long ago I wrote about using heuristics to fight comment spam. A little later I pointed to the NoBot control as an independent implementation of the ideas I mentioned using Atlas.
I think that control is a great start, but it does suffer from a few minor issues that prevent me from using it immediately.
- It requires Atlas and Atlas is pretty heavyweight.
- Atlas is pre-release right now.
- We’re waiting on a bug fix in Atlas to be implemented.
Let me elaborate on the first point. In order to get the NoBot control working, a developer needs to add a reference to two separate assemblies, Atlas and the Atlas Control Toolkit, as well as make a few changes to Web.config. Some developers will simply want a control they can simply drop in their project and start using right away.
I wanted a control that meets the following requirements.
- Easy to use. Only one assembly to reference.
- Is invisible.
The result is the
InvisibleCaptcha control which is a validation control (inherits from
BaseValidator)so it can be used just like any other validator, only this validator is invisible and should not have the
When the user submits the form, we take the submitted value from the hidden form field, combine it with a secret salt value, and then hash the whole thing together. We then compare this value with the hash of the expected answer, which is stored in a hidden form field base64 encoded.
This should be sufficient to block a lot of comment spam.
Quick Aside: As Atwood tells me, the idea that CAPTCHA has to be really strong is a big fallacy. His blog simply asks you to type in orange every time and it blocks 99.9% of his comment spam.
I agree with Jeff on this point when it comes to websites and blogs with small audiences. Websites and blogs tend to implement different CAPTCHA systems from one to another and beating each one brings diminishing margins of returns.
However, for a site with a huge audience like Yahoo! or Hotmail, I think strong CAPTCHA is absolutely necessary as it is a central place for spammers to target. (By the way, remind me to write a bot to post comment spam on Jeff’s blog)
Accessible property to false.
I developed this control as part of the
Subtext.Web.Control.dll assembly which is part of the Subtext project, thus you can grab this assembly from our Subversion repository.
Please not that if you add this control to your own assembly, you will need to add the following assembly level
WebResource attribute in order to get the web resource handler working.
You will also need to find the call to
Page.ClientScript.GetWebResourceUrl inside InvisibleCaptcha.cs and change it to match the namespace specified in the
If you look at the code, you’ll notice I make use of several hidden input fields. I didn’t use
ViewState for values the control absolutely needs to work because Subtext disables ViewState. Likewise, I could have chosen to use
ControlState, but that can also be disabled. I took the most defensive route.
[Download InvisibleCaptcha here].
tags: CAPTCHA, Comment Spam, ASP.NET, Validator
There’s nothing worse than waking up on game day and realizing you forgot to wash your soccer jersey from last game.
Thank god for Febreeze!
UPDATE: The Febreeze worked! We won 8 to 1!
I saw this story on the debugging section of Anecdota and thought it was funny, though I find it hard to believe.
In 1998, I made a C++ program to calculate pi to a billion digits. I coded it on my laptop (Pentium 2 I think) and then ran the program. The next day I got a new laptop but decided to keep the program running. It’s been over seven years now since I ran it. and this morning it finished calculating. The output:
“THE VALUE OF PI TO THE BILLIONTH DIGIT IS = ”
Mindblowing eh? I looked in the code of my program, and I found out that I forgot to output the value.
You would think he’d do a test run for smaller digits of PI, but I’ve done things like that. You make a small test run. It works. You make a tiny tweak that shouldn't affect anything and then start it running because you're in a hurry. Seven years later...
Of course, most (if not all) algorithms for calculating PI aren’t all or nothing. Usually they start calculating digits immediately, so there ought to be immediate output as you calculate PI to further and further digits, unless this person decided to store all billion digits in a string before displaying it.
tags: C++, Bugs, PI
Conceptus, a client of my company, recently launched not one, but two blogs using Subtext.
I emphasize two because I only really knew that their CEO wanted to start a blog. Of course, once you have Subtext set up, it's quite easy to start another blog.
This is our first (of hopefully many) commercial implementations of Subtext. The best thing about this particular project was that our client was very kind in contributing some of the customization work we did back to the Subtext project.
For me, I loved that this projected combined my passion for Subtext with my passion for feeding my family.
DISCLAIMER: I am not a medical professional so my brief description of the product is not medical advice. This is merely information I gleaned off their product website. For medical advice, consult your doctor.
To give you more background, the client is named Conceptus and they’ve developed a non-surgical permanent birth control device and procedure that takes around 35 minutes (not including doctor waiting room time and a typical post procedure wait of 45 minutes). Their procedure beats the pants off the typical alternative, tubal ligation (getting the tubes tied).
We worked with this client before under the direction of Shepard Associates to develop Conceptus's consumer focused site and their doctor focused site, both built on top of DotNetNuke.
Way back when I announced the first Roadmap for Subtext, I stated that Subtext would remove the multiple blogs feature and only support a single blog. Fortunately I was persuaded by many commenters to abandon that change and continue to support multiple blogs. Instead, I set out to simplify the process of configuring multiple blogs.
Now I am really glad that I did so. I currently have three blogs running off of a single installation of Subtext.
- This one http://haacked.com/
- My non-techie blog http://phil.haacked.com/
- My soccer team http://westsiderovers.com/
The benefit of this approach is that setting up a new blog is very easy. Rather than dealing with the rigamorel of setting up another IIS site and database, I can simply add a new DNS entry and point it to my existing IP address, add a host header in IIS, and then create the blog in my Host Admin.
Three easy steps to a new blog. I better be careful or I may get too crazy with this. A blog for every day of the week, anyone? You know, to color coordinate with my outfit.
UPDATE: In one comment, szeryf points out something I didn’t know and invalidates the need for the tool I wrote. This is why I post this stuff, so someone can tell me about a better way! Thanks szeryf! I’ve updated the post to point out the better technique.
Based on my recent spate of posts, you can probably guess that I am working on improving a particular build process.
In this situation, I have a pre-build step to concatenate a bunch of files into a single file. I tried to do this with a simple command like so:
FOR %%A in (*.sql) do CALL COPY /Y Output.sql + %%A Output.sql
Yeah, that would work, but it is so sloooooow.
Szeryf points out that I can simply pass
*.sql to the
COPY command and get the same result.
copy *.sql output.sql
This ends up running plenty fast as it doesn’t dumbly iterate over every file calling
COPY once per file. Instead it lets
COPY handle that internally and more efficiently. How did I not know about this?
So I wrote a one minute app by simply scavenging the code from BatchEncode and concatenating text files instead.
USAGE: batchconcat EXTENSION ENCODING OUTPUT
sourcedir: source directory path
extension: examples... .sql, .txt
output: the resulting file.
encoding: optional: utf7, utf8, unicode,
All paths must be fully qualified.
USE AT YOUR OWN RISK! NO WARRANTY IS GIVEN NOR IMPLIED
This ended up being mighty fast!
I figure someone out there might need to do this exact same thing in their build process and won’t mind using such crappy code.
I am going to pull a Nostradamus here and predict that the Mix series of conferences (did I ever tell you how much I loved Mix06?) will end with Mix09 if they even reach that point. Why do I make this prediction? Because Microsoft has Mix07.com, Mix08.com, and Mix09.com registered, but not Mix10.com (although mix010.com is available at the moment). ;)
I know, I’m being rather silly. This evening I was on a Skype chat with Atwood and Galloway asking when is the next big conference that we should all attend. Atwood’s reply was Mix07 which is a bit long of a wait, but Ok. That got me wondering if they plan on some more Mix conferences afterwards.
If they do, looks like Microsoft has it covered for the next three years.
I hesitate to blog this because this tool is really really really really rough, quick, and dirty. As in it needs a big ol’ box of Tide.
I needed to convert a bunch of UTF-16 text files into UTF-8 so I spent five minutes writing a little console app to do it.
This thing literally has no exception handling etc, but it gets the job done for my needs and I thought others might find it useful if they have exactly the same need.
Hey, feel free to clean up the code and send it back to me, or point me in the direction of some free tool I should’ve used all along.
USAGE: batchencode extension encoding [backup]
extension: file extension with the dot. ex .sql, .txt
encoding: values... utf7, utf8, unicode, bigendianunicode, ascii
backup: optional fully qualified (sorry) backup directory.
Download the code here.
Jon Galloway is my batch file hero. He’s the one who introduced me to the
FOR %%A in ... syntax.
Today I needed to rename a bunch of files. On one project, we haven’t kept our file extensions consistent when creating a stored procedure file in a Database project. Some of them had
.prc extensions and others have
I wanted to rename every file to use the .sql extension. I couldn’t simply use a batch rename program because I wanted these files renamed within Subversion, which requires running the
svn rename command.
So using a batch file Jon sent me, I wrote the following.
FOR %%A in (*.prc) do CALL :Subroutine %%A
svn rename %~n1.prc %~n1.sql
Pretty nifty. For each file in the current directory that ends in the
.prc extension, I call a subroutine. That subroutine makes use of the
%~n1 argument which provides the filename without the extension.
For help in writing your batch files, type
help call in the command prompt.
I can see using this technique all over the place. I will leave it to my buddy Tyler to provide the Powershell version.
You’re a struggling young 15th century composer (because who lived to be old back then?) in Europe struggling to make ends meet while trying to advance the state-of-the-art when it comes to counterpoint.
Perhaps you’re also dabbling in tonality as the next big thing in music, going so far as to call it Music 2.0 because you know that people are tired of that cookie-cutter modal music everyone else is producing.
What do you do to scrape by?
Well if you were lucky, you’d catch the attention of the Medici family. Fuggedabout the Sopranos, if you want a lesson in powerful Italian families, the Medicis make episodes of Cribs look like a documentary on poverty. With immense wealth, power, and influence, they had a big hand in jump starting the Italian Renaissance.
Many of the great artists of the time honed their crafts under the patronage of the Medicis such as Michelangelo and Donatello (thus paving the way for Teenage Mutant Ninja Turtles). They were also patrons of the sciences, funding Galileo in much of his work.
I started thinking about all this when I read John Lam’s post, Open Source, The Microsoft Community and Funding. Like the struggling 15th century composer, John is working on something that has a very small niche audience at the time. However, it also has the potential to be the next big thing in .NET development, who knows?
A project like this is not necessarily something VCs line up to throw money at, because its commercial viability may lie far in the future or because it is ahead of its time and not well understood. This is perhaps why John mentions in his comments that he is looking for a patron.
Yes, I am looking for a patron, and hopefully something will come out of my meetings here this week.
Another commenter then asks the question...
Doesn’t expecting to be paid for OSS work also belong in the “sense of entitlement” box? That someone chooses to develop and publish software in their spare time is that same as me choosing to go climbing in my spare time, and I doubt anyone will pay me to do that.
I wonder. Did Galileo feel a sense of entitlement every time he had a bowl of pasta paid for by his patron while working on his equations? What about Michelangelo? Perhaps they would have if they were the only ones to enjoy their own work. In their cases, their work was shared for many to benefit, unlike the rock climber.
In some respects, I see parallels with open source software in the recent direction of the music industry. Many music critics feel the music industry is stuck in a rut with cookie-cutter music artists who all sound the same dominating the air waves. The cost to produce a hit is so large, that the studios are unwilling to take gambles on something innovative (with notable exceptions of course!)
Not only that, the music industry is waging a losing battle against technology that makes it essentially free to copy and distribute its product.
Hmmm. What else is free to copy and distribute? Oh, I know. Open Source Software!The key difference obviously is that OSS makes this distribution intentional, causing many to wonder whether these people are simply nuts (we are). Free distribution is the whole point in OSS.
So what is in store for the music industry? Some have suggested that the music industry will die if it does not adapt. One proposed means to fund musicians is to take a fresh look at the patronage system, though refitted for the Internet Age. MySpace comes to mind in that regards. Perhaps some budding Medicis are online looking to start a new renaissance in music.
I’m not enough of a historian to understand the Medici’s true motivations in funding art and science. Did they do it out of pride in their city to demonstrate to the world how Florence is the source of great art and science? Was it pure showmanship? Did someone lose a bet? Or was there simply a desire to support the creation of beauty, whether it take the form of science or art?
Like I said, I have no idea, but I think the answer might shed light on whether the model of patronage would work today.
Recent discussions around who should contribute to Open Source projects tend to argue (myself included) that those who benefit from Open Source should consider contributing back to it.
Unfortunately only looking at it this way frames OSS as a quid-pro-quo situation. You get what you give. But many OSS project founders don’t see it that way. I can’t speak for John, but I bet he gives a lot to his project without expecting an equivalent contribution from others. What about the other side of the coin then?
Will we see the rise of the Medicis of Open Source Software, patrons with deep pockets who view interesting open source projects as a form art or science worth supporting because they push their fields forward, whether or not it equivalently lines their own pockets with cash? Or should the only software that be produced be software that is commercially viable, much like music on the radio?
Some are calling upon Microsoft to take that role. If so, would that even be a good thing? Quite possibly, if done well.
These are all questions I ask myself when I’m trying to procrastinate and start to get a bit too philosophical for my own good. These are not intended to be leading questions trying to promote one view or another, but rather questions whose answers I am working through for myself.
Pics like this make me bummed that I couldn’t make it to the Burning Man festival this year. How cool is that?
Original pic here.
UPDATE: Looks like this will get fixed in the next release according to a comment on Steve’s blog.
Steve Harman, a Subtext developer, was prototyping using Atlas in Subtext and encountered a rather problematic bug.
Not only did he encounter the bug, he went through the hard work to dig into the source of the bug right down to the line of code and proposes a fix. How is that for constructive criticism?
Unfortunately, he hasn't received any response from the Atlas team (at the time of this posting) regarding whether or not they recognize this as a bug and if they will fix it. He subsequently filed an official bug report at Microsoft Connect.
This is not some arcane bug, so you may get bit by it as well if you use any browser extension such as CoComment with Atlas.
Please validate and vote on this bug here.
tags: ASP.NET, Atlas
In general I like to regale my readers with stories of my brave accomplishments, ideally embellished to make me look like a hero.
But last night I was dealing with a problem that when I realized the solution, I knew I deserved a big red WTF on my forehead.
I was playing around with an Atlas UpdatePanel in a form on some existing code. No matter what I tried, the site would perform what appeared to be a full post back. I started cursing Atlas and it’s gee-whiz-bang-newfangled-broken UpdatePanel.
This morning, before work I thought I would take a quick look at the underlying code behind (not sure why I didn’t do this last night). Right there in the submit button event handler was the following line of code (actually slightly modified for brevity).
I had totally forgotten that there was a redirect in response to that button event! So the UpdatePanel was working just fine. The apparent post back was actually a redirect.
See, that's the problem with software. It does exactly what you tell it to do. Even when you mean otherwise.
tags: Atlas, WTF
Remember my recent post in which I suggested that we need more heuristic approaches to the comment spam problem?
Check out this new NoBot control in the Atlas Control Toolkit. I wonder if this came out before or after I wrote my piece, because I don’t want y’all to think I cribbed my ideas from this control. It has a couple features that I mentioned.
- Enforcing a configurable delay between when a form is requested and when it can be posted back. (Ex: a human is unlikely to complete a form in less than two seconds)
- Enforcing a configurable limit to the number of acceptable requests per IP address per unit of time. (Ex: a human is unlikely to submit the same form more than five times in one minute)
I think that will be a nice minor addition to a comment spam fighter’s toolkit. It’s Invisible CAPTCHA. Very cool!
tags: ASP.NET, Atlas, Comment Spam
For whatever reasons, I happen to be somewhat well endowed in the forehead region. My wife (bless her heart) likes to refer my forehead as my Sandwich Compartment.
She jokes that I can keep a sandwich in there, maybe even a soda. When she says this, she mimics the motion of opening up my forehead like a cooler and reaching in to grab a nice delicious sandwich.
A while ago we were talking about .NET bloggers in general because we just had dinner with Jeff Atwood. I showed her Scott Hanselman’s blog as an example of a really really popular .NET blog. She remarked,
Well he must be smart! His forehead is even bigger than yours!
See for yourself with these comparison photos.
Ready for a picnic
I told this story to Scott today via Skype and he confided in me that someone once referred to his forehead as his fivehead.
If I had been drinking a Coke at that point, it would have been snorted all over my keyboard. Many thanks to Scott for allowing me to share this story, albeit grudgingly. ;)
tags: Sandwich, Scott Hanselman, Forehead
UPDATE: Via Dare I learned that the video was leaked to YouTube prior to its world premier and has been taken down. You can find the song on Weird Al’s MySpace page. I’ve updated my link.
This video from Weird Al Yankovich cracks me up with such lyrical gems like this:
The only question
I ever thought was hard.
Is do I like Kirk?
Or do I like Picard?
Mad props to Al whose flow could give Eminem a run for his money. Click on the image to watch the video on YouTube. Beware, the tune is catchy and you might catch yourself singing it later.
Via Jason Calacanis.
tags: Humor, Funny, Video, Geek, Nerdy
Interesting post on how easy it is to open up a Diebold voting machine. Security is not realized by trusting the words of some CEO. Security is obtained via peer review and testing.
Even then, real Security is never fully obtained. It is always a matter of degrees. In this particular case, the thermostat is turned down really really low.
UPDATE: I remember that Scott Hanselman proposed that Microsoft put together an organization like INETA for Open Source Software in an editorial aside a while back while discussing NDoc.
Hanselman Editorial Aside: It's a shame that Microsoft can't put together an organization like INETA (who already gives small stipends to folks to speak at User Groups) and gave away grants/stipends to the 20 or so .NET Open Source Projects that TRULY make a difference in measurable ways. The whole thing could be managed out of the existing INETA organization and wouldn't cost more than a few hundred grand - the price of maybe 3-4 Microsoft Engineers.
This sounds like a great idea and it is a shame I didn’t think to link to it in my discussion here.
Dave writes that Microsoft should financially support open source projects in response to this blog post on Microsoft’s Open Specification Promise. There are two key points he makes in defense of his thesis.
- It’s in Microsoft’s own financial best interest.
- It is good PR for Microsoft.
Microsoft’s Financial Benefit
For the first point, Dave supplies anecdotal evidence in which open source software (DotNetNuke which has been supported by Microsoft) helped his company keep costs low and stay in business when they were just about to fold. Because of the turnaround, Microsoft received the financial benefit that his company was still around to purchase Microsoft licenses as they received funding.
Although I tend to believe this type of evidence as my own company has also implemented DotNetNuke successfully for a client in a project that would have otherwise been unprofitable, I am not easily convinced by anecdotal evidence. I doubt Microsoft would be.
It would be interesting to see Microsoft fund some studies to bolster or contradict these claims. If open source software built on Microsoft tools really does benefits Microsoft financially, they would probably like to know by how much.
Microsoft’s PR Benefit
Now this argument is a more compelling to me. As Dave points out, performing a Google search on the term Evil Empire and Microsoft shows up on the first page of results.
It’s amazing when you think about it. Despite the legion of Microsoft bloggers who put a real, articulate, and passionate human face to Microsoft, Microsoft still suffers from an image problem. I think the world of Microsoft because of bloggers like Dare, Steve, Clemens, Chris, and Don to name too few.
Why should Apple or Google enjoy the so hot right now status when Microsoft is the one really opening up. Microsoft’s PR problem seems to extend to its ability to retain top talent lately, though I don’t know if the perceived talent drain is truly real (they could be hiring just as many top quality replacements but we don’t hear about it).
I don’t know if supporting open source software would suddenly give people warm and fuzzies when they think of Microsoft, but it might attract developers to the platform who would otherwise be lured to Ruby on Rails or other such alternative platforms.
My Take On This
Ultimately I think Microsoft is not a charity and should do what’s best for Microsoft. Ultimately, I think it is in its best interest to look at this seriously and consider helping projects (like NDoc) out.
As for me, I wouldn’t want anyone to think that I’m going around looking for a handout. It’s not why I started this project nor why I devote my time to it. It’s an incredibly fulfilling way to spend my time and hone my skills, not to mention that the doormen at all the hot clubs in Los Angeles are Subtext users and let me cut to the front of the line (ok, maybe not).
I have implemented one instance of Subtext for a client at a steeply discounted rate, but I don’t see generating a huge amount of business from it. The point being, I don’t know if Subtext specifically is a benefit that would even register a blip on Microsoft’s radar. Could be I’m thinking too small. At least I know some of my posts have helped developers find solutions to problems saving them money.
However if someone were to wave money in front of me to help develop it with a good business case, I probably wouldn’t turn it down. I’m proud, but not stupid.
The situation I daydream about is one day having a position in which my job is to help a company implement some product that provides a service to the open source community (such as something like CodePlex, or a source search engine for open source software, or a blog host, etc...) and as part of my job description be given a decent amount of work time to lead development on Subtext. The Subtext time would have to not be charity, but seen as contributing to the company by keeping it relevant to its consumers.
But again, I digress. I’d love to hear your thoughts and comments, either here or over on Dave’s post.
UPDATE: Joe Brinkman has a great post on this topic that pretty much aligns with my views. However, I would only add that I do think it is in Microsoft’s best interest to be more active in leveraging successful open source projects to benefit Microsoft.
Especially in cases where software is licensed in a favorable manner (BSD baby!) for inclusion in its own products. Why write your own unit testing tool when you could have used MbUnit or NUnit and would not have any obligations to release your customizations if you so choosed (although my mom taught be that sharing was a good thing to do)?
tags: Open Source, Microsoft, Subtext
If you are using Subtext, or are using .TEXT and plan to use Subtext I need to ask you a few questions. Please answer as your answers may determine whether or not some features are removed for the sake of simplification.
These questions revolve around the Advanced Options when creating or editing a post in the admin tool.
1. Do you use the Title URL field?
Now before you answer, let me explain what this field is used for. You might have values in that column, but that doesn’t necessarily mean it is in use.
The Title Url field is used to specify an ALTERNATE URL for the title of a blog post. Ordinarily, the title of the blog post links to the blog post itself. Older versions of .TEXT and Subtext would update that field with the URL to the blog post, which was unnecessary since we could generate that URL on the fly.
In my humble opinion, it is a bad idea to have the title of a blog post link elsewhere as it is confusing to users. Unless there are large numbers of users who have specific needs for this feature, I would like to remove it.
2. Do you ever enter values for Source Name and Source Url for a blog post?
Scott Watermasysk, the original creator of .TEXT (Subtext, I am your father) graciously pointed out the use of the
SourceUrl fields in the comments of this post. These are used for the optional RSS
<source> element. It’s for properly attributing credit for a link when republishing a post from somewhere else (see the RSS spec). I’ve never seen any aggregators make use of this unfortunately and most people simply attribute others in the body of the post, so it is still a candidate for removal if nobody makes use of it.
As far as I can tell, these fields are intended for comments, not for blog posts. However the admin section does have text fields for entering these values. But These values are NEVER displayed for blog posts.
I’m 99.9% sure I’ll be removing these fields for blog posts so in part, this question is a warning. However if someone has an extremely compelling reason to keep them for blog posts, speak up now or forever hold your peace.
3. Would you find the ability to run Subtext off of another database such as MySql or Firebird very important?
I know some users might like to save a few bucks and go with .NET and MySql hosting. I’ve thought about implementing multiple database support, but don’t want to undertake such a big task if there is no demand.
Even if there is demand, it’d have to be overwhelming for me to consider doing it sooner rather than later.
Thanks! That’s all for now. I appreciate your responses.
If you’ve read my blog you know I have a bit of a thing for Microformats. I once wrote a little special effect script to highlight links to your friends when marked up using the XFN (XHTML Friends Network) Microformat used to denote relationships to people you link to.
Ever since I wrote and started using this script, I ran into a bit of interpersonal angst everytime I would link to someone. Every link spurred the following internal dialog.
Do I mark so-and-so as a friend or acquaintance? Well we’ve never met but I think he’d consider me a friend. But would it be presumptuous if I classified him as a friend. What if I mark him as a friend and he links to me as an acquaintance? I would be crushed! But what if I link to him as an acquaintance and he considers me a friend. Some feelings could be hurt!
By now you probably think I have some serious issues (very true) and am being overly paranoid. But check out Scott Hanselman’s response when I metadata’d him as an acquaintance. He called me a dick! *sniff* *sniff* Ouch! Well technically he used well formed markup (no namespace declared) to make that point, which softened the impact, but only slightly.
I have since realized that the standard XFN relationships are not granular enough to capture the nuances of real world relationships. To save others from such social insecurity and XFN relationship angst, I humbly propose some new relationships I think should be added to the format. For your reference, the current list is located here. I will group by proposed additions in the appropriate existing categories.
- This helps distinguish someone who is just a friend to someone you actually hang out and throw down beers with. Possible alternative would be buddy. Often Symmetric.
- As a very happily married man, I have no use for this, but maybe you do, tiger. Hopefully Symmetric.
- My market research indicates that Microformat usage is not very popular among the pre-teen Myspace crowd. This one is an attempt to reach that market. The format would have to allow alternate capitalizations and spellings for this one such as fReNd-4-eVA. Usually Symmetric or it gets really ugly.
- Currently the XFN profile only contains one value for the Physical category. I figured you need at least two to make it its own category (FxCop rule #37142). Let everyone know the two of you got into a fist fight over the merits of Ruby on Rails. Symmetric.
- Let everyone know, that regardless of what that filthy *#@!! said, it was you who dumped him/her! Inverse of dumped-by.
- Update: Ben Ward points out that dumped-by is not necessary. To indicate a reverse relationship, use
rev="dumped" instead. This usage is popular among whiny songwriters and adolescents who love to live in that moment of pain. Inverse of dumped.
- Again, invoking FxCop rule #37142, The Identity category needs another value. This lets others know that you are linking to a website created by your other personality. Symmetric and Transitive.
I hope to submit this Tantek, Matthew, and Eric for their consideration. Unfortunately I have a few strikes against this proposal becoming accepted.
For example, there’s this point on the background page of the XFN site.
Negative relationship terms have been omitted from XFN by design. The authors think that such values would not serve a positive ends and thus made the deliberate decision to leave them out. Such terms (we won't even bother naming them here) while mildly entertaining in a dark humor sort of way, only serve to propagate negativity.
There’s also this point on the same page.
XFN values are by implication present tense.
We have chosen to omit any temporal component for the sake of simplicity.
So yes, it appears I have my work cut out for me as many of my proposed additions completely violate the spirit and guidelines of XFN. But that is a minor quibble I’m sure we can resolve with your help. Thank you and good night.
I found out recently that many of my family members and friends who used to read my blog stopped doing so because most of my blog posts were pure gibberish to them. Apparently not everyone is fascinated by topics such as how many CPU cycles it takes to make a method call in a dynamic language? Neither are they enthralled by matching HTML with Regular Expressions. Go figure.
And yes, I have tried in the past to explain that my blog has categories and by going to the Day to Day category, you can filter out my geekery. But many of my friends simply bookmark http://haacked.com/ and simply can’t be bothered.
So I am starting a new blog just for them where I can post such personal things such as a picture of this vicious bruise I received in a soccer game which was actually worse than it looks.
In the past, I’ve tended to have the philosophy of just writing about anything here. But these days, I’ve migrated to seeing blogging as participating in a community. In my case, I have focused this blog to participate in the Software Development community, and more specifically the .NET developer community. As they say about writing, consider your audience! However I don’t think this some absolute truth of blogging. If you want to post pics of your cats in your geek blog, post away! This is just my preference for myself.
This also doesn’t mean that haacked.com will only consist of techie posts. I’ll still post the occasional personal item that I think might be interesting to my geek friends. I rather like injecting my personality here.
What I probably won’t do is post mundane stuff like, “Yo Dan. You and Judy want to have dinner tonight? Call me or post a comment here.” here, reserving that for my other blog.
The URL for my other blog is http://phil.haacked.com/.
How long will it take someone to write a Windows Live Writer plugin to do the same?
So if it is working correctly, the image here should have a reflection.
UPDATE: Doesn’t seem to align quite right for me in Firefox, but looks great in IE.
Don’t you love jumping in on the latest fad? What will be next? BlackVelvet.js?
Of course that assumes that Joel wears a size 9 and a half.
Once again the Joel Cycle takes another turn. The cycle goes something like this:
- Joel critiques something or other.
- Bloggers counter Joel’s claims, many with thoughtful counter arguments.
- Soon a flood of comments and posts start to turn a bit ugly and form around two camps: The Joel is an idiot why do you even read him? camp and the Joel is successful, what have you ever done that you can disagree with him? camp.
- Rinse and Repeat
It really is an interesting phenomenon to watch and participate in. For example, I’ve had my blog post lumped in as part of the angry lynch mob out to get Joel. All I said was that I found his argument unconvincing. Am I really a part of a mob conspiracy?
Now before anyone jumps down my throat, let me clarify something very important. I have tremendous amount of respect for Joel Spolsky. There, I said it. I can’t speak for Jeff Atwood, but I would venture to guess that he too has a lot of respect for Joel, despite the big red WTF on his forehead.
Anyone who has thousands of developers dissecting his every blog post and arguing the pros and cons of how he runs his company is doing something very right. I’d love to be in those shoes, running a very successful company with thousands of people invested in what I do and how I do it, whether positively or negatively.
If I were to blog something stupid (and I’m not saying he did, but just for the sake of argument, sheesh!), I’d be lucky to get a couple comments to the effect, “Dude, you’re an idiot.” Heck, I’d be happy if I even generated that level of passion. Rather I’d probably get a comment to the effect of, “I disagree. Nice Post! Buy Xanax”.
The other reaction Joel commonly gets is the I don’t know why y’all are reading him, I gave that shit up a long time ago reaction. I also don’t understand this reaction. For the most part, I think Joel’s signal to noise ratio is very high, and he’s written some really top notch articles on his blog. Just because he says a few things from time to time that you disagree with doesn’t mean you should throw the baby out with the bath water. Sure he comes across as a bit arrogant, but he’s that good.
The last question I often see is Why is everyone paying Joel so much attention? I addressed this very question before in my post, What Is It About Joel?.
In many respects, Joel is the closest thing the software community has to a bonafide rockstar. We’re half expecting to open up our aggregators one day and read about him enrolling in a drug rehab program, but one of those trendy ones in Malibu (or in the Hamptons I suppose with his fondness for New York). Like it or not, he’s opinionated, successful, and a thought leader in our field.
So when he says something controversial, it’s natural to want to provide a counter argument lest some young punk developer at your next team meeting argues vehemently for writing a custom programming language and uses an Appeal to Authority to make his/her case.
Obviously what works for FogBugz does not work for everyone else, but not understands that distinction.
In any case, this will be my last post on the subject of Joel. At least until the cycle begins anew.
tags: Software, Joel Spolsky, Developers
Some computer scientist by the name of Donald Knuth once said,
Premature optimization is the root of all evil (or at least most of it) in programming.
Bah! What did he know?
Of course we all know what he meant, but when you take his statement at face value, the claim is a bit vague. What exactly is it that is being optimized?
Well speed of course! At least that is the optimization that Knuth refers to and it is what developers typically mean when they use the term optimize. But there are many factors in software that can be optimized, not all of which are evil to optimize prematurely.
The key positive optimization that comes to mind is optimizing developer productivity. I hardly see anything evil about optimizing productivity early in a project. It is most certainly a healthy thing to do, hence the misleading title of this post.
However as with all things, optimizations bring with them tradeoffs. Optimizing for developer productivity often comes at the price of optimizing code execution speed. Likewise optimizing for speed will come at the cost of developer productivity.
Security is another example of an optimization that bears with it various trade-offs.
The point of all this is to keep in mind that at all times within a software project, whether explicitely or implicitely, you are optimizing for something. It is important to be intentional about what exactly you wish to optimize.
If you start optimizing for performance early, keep in mind Knuth’s forewarning. If you are optimizing for productivity early, then you are on the right track. This does not mean that you should never consider performance. On the contrary, a good developer should definitely design for performance and measure measure measure.
The danger to avoid is diverting too much optimization attention to areas that provide too little gain, as discussed in my last post on Ruby Performance.
tags: Performance, Optimization, Software, Programming
Joel Spolsky follows up on his earlier remarks about scaling out a Ruby on Rails site with this post on Ruby performance. I’m afraid it is a thoroughly unconvincing and surprising argument. He states...
I understand the philosophy that developer cycles are more important than cpu cycles, but frankly that’s just a bumper-sticker slogan and not fair to the people who are complaining about performance.
A bumper-sticker slogan? That’s a surprising statement considering that FogBugz is not written entirely in C. Is it because Wasabi compiled to PHP or VBScript is saving CPU cycles? Hardly.
As one might expect from a well designed application, FogBugz is written in a productive high-level language for the very reason that Ruby advocates push ruby - it saves developer cycles and thus money.
Also as one would expect from a well written application, in the few cases where performance is a problem, those particular features were written with a lower-level high performance language.
So why wouldn’t this approach apply to Ruby? From the tenor of his post, Joel seems to indicate that those who choose to implement their enterprise applications on Ruby are so religiously blinded by the benefits of Rails that they would never dare allow the impurity of non-Ruby code to enter the boundary of their architecture.
To his credit, Joel states at the end...
In the meantime I stand by my claim that it's not appropriate for every situation.
And this is true. It may not work well for that computation intensive Bayesian filter. But is anyone making the claim that Ruby is appropriate for every situation? The claim I’ve heard is that it is certainly appropriate for many more situations than Joel gives credit for. I believe that.
Update: Related Links
tags: Ruby, Ruby On Rails, Joel Spolsky, Performance
Just a little shout out to my wife to wish us a happy anniversary. We’ve been married for four years and each one has been better than the last. I love you honey!
She’s got a rock solid sense of humor (have you seen her gravatar?) and a smile with a gleam so bright it makes you shout Eureka!
I would post a picture, but my wife’s sense of online privacy would make Bruce Schneier look like a MySpace exhibitionist. In fact, I’ve already said too much.
Instead, I’ll post a picture of a ninja because ninjas have a lot in common with my wife. They both kick ass, they are both Japanese (except for this one), they are both concerned about privacy, and like my wife, ninjas are so totally cool!
I mean who doesn’t love ninjas!?
Picture from AskANinja.com
Update: You can click on the images (except the vegas one) to see larger pics.
As I mentioned in a previous post, I am currently on a road trip with my younger brother, which explains the lack of blogging.
This crazy kid started off from Anchorage and drove down the Alaskan Highway (which is known for being gravelly and unpaved in parts) and made his way to Los Angeles. And that is just the first leg of his drive. His final destination is Luverne, Minnesota where he will live for a year interning with a pastor at the local church.
Despite the crazy conditions on the Yukon roads, he was still able to take this picture of the Aurora Borealis (aka Northern Lights).
Once in Los Angeles, Brian stayed with us a couple of days before we set out towards Minnesota. My parents felt more relaxed that I was driving with him on this leg of his journey.
Leaving Los Angeles at around 9:30 PM on Wednesday night we made very good time and drifted into Las Vegas around 1:30 AM. My screams of “Vegas Baby! Vegas!” along the way did not making any sense to my brother who had not seen Swingers.
Being my brother’s first time in Vegas, it was my older-brotherly duty to introduce him to one of the (many) sins of Sin City - Gambling!
Usually such a duty ends in tragedy for everyone involved, but ours ended well.
After a half hour or so at the BlackJack tables, we were up a bill ($100), easily enough to cover the room for the night and some drinks, and probably turning my brother into a gambling addict for life. I’m sure his church will be happy with me for corrupting him.
The next morning we headed out towards Denver. This part of the drive was just amazing in terms of scenery, especially driving through the canyons of Utah. There were some lightning storms along the way and my brother managed to snap a couple pictures of the lightning from the car.
We are now in the tiny town of Luverne where my brother will live for the next year or so assuming he doesn’t go stir crazy. This is one of those small towns that seemed to cherry pick the good parts of progress, and not the bad.
For example, people often don’t lock their cars, even leaving them running in the winter when they run into a store to pick up a few items. Yet they are not so small town that I don’t have a high speed wireless connection at my disposal.
Also, Sioux Falls, South Dakota is only a half hour away and its a reasonably large city. We drove there last night and saw the falls which are surrounded by red rock, which is where we took this picture.
Tonight I will take an unfortunately long flight home with two stopovers (I wonder if I could just walk and be there sooner). This road trip with my brother has been a wonderful way to catch up with him, especially now that he’s leaving the nest and becoming a man (although one still prone to fart jokes).
Of course, during the trip, I realized he’s been grown up for a long time, which is hard to recognize when one is an older sibling.
As for me, the hours of driving left me free to reflect and get a bit philosophical. I’ll write about some of this in future posts, I hope.
Darren Neimke apparently is not one to shy away from a bit of trash talk. He IM’d me via MSN recently to warn me about a new SUB, ready to take down Subtext. In this case, it is his newly open sourced blog engine, SingleUserBlog or SUB, which is now hosted on CodePlex. Darren has been on a roll lately with the recent release of BlogML 2.0. Now SUB enters the scene with torpedoes blazing!
But Darren must know he is not dealing with a complete novice in warfare. I deftly guided him to choose the BSD license. So should they implement something I must have, I can just take it, BWAHAHA! (with proper attribution of course, following all terms of the license and other legal mumbo jumbo)
Darren, I believe I sunk your battleship.
Tonight at Soccer practice, we scrimmaged for a while then ran through some drills. We have an English guy and a Scottish guy (who hardly anyone can understand) on the team who are a laugh a minute. You can imagine their surprise when we started a shooting drill and our team manager tells them that we all have to shag our own balls.
Seems like all sorts of open source projects have been releasing lately. Darren Neimke and Keyvan Nayyeri proudly announce the release of BlogML 2.0 on CodePlex. Here’s a list of new features on Keyvan’s blog. With a bit of luck and lots of persistence, BlogML will hopefully be a key component in breaking vendor lock-in when it comes to blogging engine.
For example, if you decide to try Subtext as your blogging engine, and decide it’s not for you, I want you to have your data in a form that is easy to import to other engines. Why should you have to write code to move from one platform to another?
I contributed a BlogML provider framework with the goal of making it really easy to implement BlogML on other platforms. For example, the homegrown blog. I don’t feel I fully accomplished the goal of making it easy, but I think it’s a step in the right direction and I’m sure it’s in good hands now.
Of course I am now pissed (for you British, that’s angry, not drunk) that we have all this extra work to do for Subtext since we’re still running BlogML 1.0 (legacy!), and 2.0 has already been out a few hours!
This past weekend my wife and I drove up to San Francisco to attend a friend’s wedding, which ended up being a lot of fun. We always like visiting The City because of the many friends we have in the area, though being there reinforces the fact that it is not a place where we’d want to live (no offense to anybody who lives there, it’s just not our style).
While up there we were fortunate enough to have dinner with Mr. Coding Horror Jeff Atwood and his wonderful wife.
They gave us a tour of their new place and I was most impressed with his “boom boom” room (it’s his term and it’s not what you think). They have a separated room tricked out with surround sound THX speakers, an LCD Projector, a Play Station 2, Dance Dance Revolution game pads, and of course, Guitar Hero. Jeff gave us a quick demo of Guitar Hero and I was quite impressed, both by the fact that Jeff has some rhythm as well as the graphics and sound of the game.
In some ways, the boom boom room reminded me of Ricky Shroder’s room from Silver Spoons.
Meanwhile, my brother is moving from Alaska to Minnesota, but he’s doing it the hard way, driving. He drove down to Los Angeles from Anchorage, Alaska at a relatively leisurely pace visiting with friends along the way.
He will stay with us for a couple of days and then he and I will set out to drive to Minnesota. My parents are such worriers so it made them feel better that I was driving with him for this leg of the trip since he won’t be stopping much.
Hopefully we’ll get there with enough time to visit some relative we have in the area. In any case, if I am less than responsive to emails and Subtext mailing list/forums, you’ll know why.