CodeVoyeur & Boo26 Jun 2008 12:00 am

My recent experiences with Ruby’s Rake have me interested in non-XML DSL usage. Boo seems to be emerging as the language of choice for building a DSL in .NET (IronRuby will surely follow suit). My most recent Code Voyeur article is my first attempt at building a non-XML based DSL.

A Boo DSL for Transforming Objects to RSS

It is admittedly not pretty at times…

NAnt & CruiseControl.NET12 Jun 2008 12:34 am

I realize it’s not popular to champion anything XML these days, but I have to admit I’ve recently become a fan of NAnt. I understand the criticisms. I won’t argue that

<fileset id="assemblies">
   <include name="**/*.dll" />
</fileset>

is better than

assemblies = FileList['*.dll']

I freely acknowledge that a DSL-based build system like Rake is far more expressive and extensible than an angle-bracket system like NAnt.

Writing blocks of C# in XML is strange.

<script language="C#" prefix="util" >
          <code>
            <![CDATA[
              [Function("concat")]
              public static string Concat(params object[] args) {
                  return String.Concat(args);
              }
            ]]>
          </code>
      </script>

Calling these C# blocks in XML is even stranger.

<echo message="${util::concat('foo', 'bar')}" />

Over the past couple of weeks, I’ve started replacing a CruiseControl.rb/Rake continuous integration solution with one that uses CruiseControl.NET and NAnt. The reason for the switch is a combination of scalability (20+ ruby.exe instances really have a negative impact on a box) and adoption (try to get a team of MS types to learn Ruby in their free time).

CC.NET makes it really easy to checkout a project from Subversion and to run MSBuild against a solution. So there’s really no reason for using NAnt for project compilation, but rather packaging and deployment. NAnt has tasks (just XML blocks) for all sorts of file operations ranging from copying to zipping. NAnt will read and write XML. NAnt can run executables or be extended with custom tasks. NAnt supports includes for reuse and targets for modular task execution. Simply put, NAnt does good things with those less-thans and greater thans. While you may have heard that MSBuild has made NAnt unnecessary, I have to disagree. Your builds don’t have to stop at compilation.

Being a fan of Boo, I’m eventually going to have to see how far along the Boo Build System is. But those build file extensions would not be easy to introduce into a corporate environment…

Here’s a great post that served as a starting point for my CC.NET/MSBuild/NUnit/NAnt solution.

Hosting02 Jun 2008 09:41 pm

I host dllhell.net at WebFaction. They’re a shared Linux host that I use for this blog and my non-ASP.NET experiments. I moved this blog there after my well documented troubles with this site when hosted at Ultima Hosts.

On Saturday, I noticed the site was down. It stayed that way for about 48 hours. Normally I’d be pretty livid, but… So when a transformer explodes and takes out three walls in the data center, I’m a little more forgiving. Also, they were and always have been transparent about their outages. I like that in a host. Ultima covered its tracks after its last major outage. I don’t like that in a host.

As for WebHost4Life… These guys are still pretty solid. I check my sites several times throughout the day to make sure things are running. I’ve yet to catch a single second of downtime. With Ultima, I could find downtime weekly or worse.

Castle & MySQL27 May 2008 10:59 pm

I tend to agree with those who believe that a good ORM will give you 90% of what you need. For me, with NHibernate and ActiveRecord it’s been closer to 95%. The remaining 5% tends to involve getting a DbConnection instance and executing some legacy stored procedure or something of that nature. For this post, I’ll describe a recent scenario that fell into that lesser bucket…

I recently decided to add full-text search to Jeopardy Story. I’d previously used full-text search for my articles on Code Voyeur (wow, two shameless plugs in one paragraph). Code Voyeur uses Spring.NET and SQL Server for data access. So a simple DAO implementation worked seamlessly. Jeopardy Story by contrast is built on Castle ActiveRecord and MySQL, which makes Full-text search a little more challenging.

First, MySQL supports full-text search only in tables using the MyISAM storage engine. MyISAM is really fast, but doesn’t support referential integrity or transactions. My full-text search was to be against a table that needed both. I chose not to give up InnoDB and its features. Instead, created a table to mirror the content of the transactional table, minus the columns not needed for the search. The MyISAM table is populated through a scheduled task. Admittedly, this is less preferable than a real time solution (triggers, etc.), but it works well enough and has minimal overhead. Also, triggers require SUPER privileges with MySQL. That privilege isn’t going to be handed out (hopefully) on a shared host… I did read on some forum that this requirement will change with the next release though.

The next challenge I had was trying to write the HQL query to execute the full-text search. Long story short - NHibernate (more accurately its SQL dialect providers) doesn’t support full-text search. After struggling with the HQL for a while, I finally looked at the Castle support forum and somewhere found a post informing me that full-text isn’t supported in the dialects (NHibernate uses SQL dialect providers to ensure the generated SQL is compliant with the target database). The only practical option I had was to use AR to get a DbConnection instance and run the SQL using plain-old-ADO. Something like:


ISession session = ActiveRecordMediator.GetSessionFactoryHolder().CreateSession(typeof(YourType));

string sql = @”SELECT your_columns_here
FROM your_table
WHERE MATCH(columns_in_your_index) AGAINST (?searchText)”;

IDbCommand cmd = session.Connection.CreateCommand();
cmd.CommandText = sql;
cmd.CommandType = CommandType.Text;
cmd.Parameters.Add(new MySqlParameter(”searchText”, text));

IDataReader reader = cmd.ExecuteReader();

while (reader.Read())
{
doYourStuffHere();
}

cmd.Dispose();
cmd.Connection.Dispose();
session.Dispose();

My actual query returns an ids from the copy table that I then use to get the actual ActiveRecord class instances through standard AR calls (e.g. FindAll). It’s a two step query I’d rather perform in one, but I’ve yet to work through an alternate solution. Should I find one, I’ll of course post it or reference it here…

Also, it’s a good idea to take a look at MySQL’s stop word list. Your unit tests might appear to fail when all that really happened is that you just chose the wrong word for a search…

Finally, it’s worth noting that MyISAM issues aside, it’s really easy to create a full-text index with MySQL - especially when compared with SQL Server. OK, SQL Server full-text isn’t all that difficult to setup. But with the MySQL GUI tools, it was click -> Add Index -> select type full text index -> drag and drop columns for the index. Done.

Hosting14 May 2008 08:51 pm

I hope this is my last post on shared Windows hosting for a while (unless I have a lot of good things to say about my new host). It’s still a little early to have a strong opinion one way or another about WebHost4Life, but I thought I’d throw out my initial experiences after about a week on their servers…

Ordering Process

Anyone who has ever purchased anything from Go Daddy knows what it’s like to have add ons thrown at you every step of the checkout process. Go Daddy tries to upsell you everything from related domain names to hosting services. I’d call WebHost4Life Go Daddy Lite. They have three Windows hosting plans costing $5.05, $11.95 and $22.05. The gimmick is that each day, a special discount is extended through that day. When I signed up on 5/7, the prices were discounted to $4.95, $9.95 and $19.95 each month. The discounts are always there. As far as I can tell, this is all marketing.

After picking a plan and a payment method, you have the option to “Turbo Charge” your purchase. This option ($1.95/month) gives you a bunch more hosting and database space, plus SAN storage and a virtual OS. They seem suspiciously careful not to say you don’t get SAN storage without the “Turbo Charge” option, so this too seems like a gimmick. But for $2/month more, the extra space was worth it to me. I took the bait. Oh yeah, and the bonus extra storage expires soon and is worth $500! :p

A couple things to keep in mind with WebHost4Life’s plans. You get only a single domain/website. Though you can create multiple websites with subdomains off of your primary domains. You can also point unlimited domains at your primary domain. If you wish to run multiple websites with different domains, you can pay an extra $15/year each. You’re limited to 8 of these additional site/domain purchases per hosting plan. Also, WebHost4Life offers only annual billing. You’ll have to prepay for a year, but they offer a 45 day money back guarantee and a pro-rata refund if you cancel during your year.

Control Panel

Within about 3 hours of signing up for a plan, I received confirmation that my account was ready to use. When I first logged into the control panel I was nervous about using another home-grown panel. But after getting used to some more gimmicky marketing mixed into the panel, I found that their “Total Control” tagline wasn’t all that off.

The panel has reasonably complete IIS management tools. It allows for controlling .NET versions, virtual directories, application settings, IIS protect, custom errors, directory browsing, application installers (DotNetNuke, etc.) and a handful of other expected features. Short of mapping custom extensions, I can’t think of anything missing with IIS management.

DNS management allows for creating MX, CNAME and A records. The panel also allows for creating and managing MySQL and SQL Server 2005 databases, FTP accounts and pretty much everything else I’ve seen in a commercial or home grown panel. I actually like the panel. It’s a bit primitive. You set paths by typing in a text box, not picking from a list for example. But overall, it does everything I need it to do and doesn’t have the awkward workflows that I found with panels like DotNetPanel.

The one thing that struck me after migrating my first site to WebHost4Life was that everything just worked. I moved the domain, created the site, created my database and ran the backup from my previous host, copied the website over, updated the config and browsed. Everything just worked with no headaches and no hassles. It was the best migration experience I recall.

Support

I have mixed feelings about support so far. Live chat is available and always a quick way to get an answer. They also have a telephone number, though I haven’t called it. But tickets (I’ve opened two) are very slow to be answered. It takes several hours to get a reply to a ticket. They do have priority levels in the ticket creation process. I wonder if higher priority tickets get expedited. I’ve left the default as I’ve yet to have a critical ticket. But again, with Live Chat available and phone support available 24/7 I’m hopeful that an outage wouldn’t get such a delayed response.

Performance

Perhaps the most impressive feature of WebHost4Life is performance. I’ve moved two sites over so far, Code Voyeur and Jeopardy Story. Both sites scream (OK, maybe talk very loudly). Ultima Hosts, where I had previously hosted these sites wasn’t too slow. But I definitely find consistently better performance with WebHost4Life.

For the curious, Code Voyeur runs Spring.NET’s Web and Data framworks and uses SQL Server 2005. Jeopardy Story is running Castle’s MonoRail and ActiveRecord and uses MySQL 5.

Other Thoughts

Again, I’ve only been on WebHost4Life for a week, but overall it’s been a good first week. Historical experience with WebHost4Life seem mixed. For example, back in 2004 there were some good reviews out there. Here is one and here’s another. A year or two later, opinions looked like this or this. Another two years later, I’m having a very different experience. I’m hoping they had some growing pains, but are on the right track now.

In general, I’ve learned it’s best to get with a host that doesn’t offer unlimited everything. I used to feel nickeled and dimed by getting limited websites, databases, etc… The dark side to to unlimited plans is unlimited outages (see Ultima Hosts). I’m happy to pay a little extra if it does indeed get me reliability. I also like that when I use Management Express to view my SQL Server database, I don’t see every other database on that server… I’m not sure why so many other hosts can’t get this right…

Anyway, I won’t come out and say definitely use these guys. But they’re worth a try if you’re in the market for a host. If you do give them a try (shameless referral link to follow) they do have a referral program. My referral link is below, for your convenience. ;)

http://www.webhost4life.com/default.asp?refid=zblock

Hosting08 May 2008 12:52 am

Finding reliable shared Windows hosting is much harder than it should be. I’ve been through a few over the past several years. I’ve more or less become a hosting Sherpa for my friends, family and co-workers. I test the waters and they follow when I say it’s safe.

Once again, I’m in the process of trying out yet another Windows host. In the meantime, I’ve moved this blog to a Linux host I use for experimenting with TurboGears and Rails. For my first post with this other host, I thought I’d share some experiences I’ve had with these companies.

M6
To be fair, it’s been many years since I’ve been with M6.net. Some of my experiences might be a bit dated at this point. That said, a friend who stayed with M6 long after I left lost her entire site during some outage. She is a designer and thought nothing of working with Dreamweaver (or maybe FrontPage) right on the server… That event was enough to stop my plans to reconsider M6 recently…

M6 was early to deploy ASP.NET 1.0. They offer lots of storage and features. But at the time, their control panel was horrible. It was home-grown and full of bugs. I forget most of what it was I wanted to do with the panel, but I recall long delays getting responses from support. But I do seem to recall them being somewhat helpful when engaged on a problem…

I’d personally pass on M6, but wouldn’t say they were any worse than the hosts that followed…

Exist Hosting

Exist Hosting came next. They were OK at first. Again, lots of features, space, etc. Exist uses H-Sphere for its control panel. I actually liked H-Sphere quite a bit. Domain management was really simple. Sites were easy to create. There were some limitations with Windows vs. Linux (single FTP user for example). But overall, the control panel was solid and that was better than M6.

Eventually, as with all shared hosts, problems arise. I had a few issues with email bouncing, canned-installers not working (phpBB), etc… The problem was tech support. It was just plain awful. It took forever to resolve any simple issue. Support would take days when hours were appropriate. Support definitely was the pain point here. Performance/reliability wasn’t any worse than most shared hosts. But that support team was useless (and rude).

When I signed up, there was a money back guarantee with a pro-rated refund for unused, prepaid time. When I canceled and tried to collect my refund, calls and emails to Exist went unanswered. Ultimately, I had to charge back through my credit card company to get my refund. These guys are pretty bad. I definitely would not consider them.

ASPnix

ASPnix offers standard fare for Windows hosting. HELM was the control panel there. It’s a nice application, but had some awkward workflows. I liked H-Sphere better. These guys were OK for a while, just like Exist. But like Exist, they had support issues.

I recall a few significant outages. Email or sites would be unavailable for hours at a time. My tolerance for such problems was definitely higher back then. Around the time I started with ASPnix, I started using Spring.NET, NHibernate and Castle. The first time I tried to run a Spring.NET site on their servers, I realized that they were restricting trust levels to medium only.

I tried to work with them on this. They’d been burned recently and made this decision to prevent issues from malicious code. I didn’t like it, but I got it. So having pre-paid for a year and having not been informed that the trust levels were limited, I asked for a pro-rata refund. What I got was a ton of attitude from one of their tech support guys. After a few unpleasant exchanges, I finally got a refund thanks to a very reasonable, senior staff member. I definitely would not consider ASPnix, again because of support.

Hosting Fest

Hosting Fest is another host cut from the same cloth as Exist and ASPnix. Their plans offered a little more for the money and used HELM for a control panel. Servers would be down for hours with seemingly no response plan. Hosting Fest supported full trust, so that kept me there for a while. And occasional server issues aside, they had some helpful and reasonably responsive tech support. I’d consider HostingFest for personal or hobby sites. They weren’t reliable enough for a site you’d like to have available 24/7. But for the money, I’d call them a maybe. I seem to recall telling them when I left I’d still recommend them (and I did a few times).

Ultima Hosts

I left Hosting Fest for Ultima Hosts. It was about 2 years ago and they were running a 2 for 1 (year) special. I couldn’t resist the Unlimited plan. Unlimited websites, email, MySQL, SQL Server… When I first signed up, Plesk was the control panel. Plesk is shiny, but wicked slow with Windows. It was eventually replaced with DotNetPanel. I don’t much care for DotNetPanel. The workflows are awkward. For example, email addresses are managed across an entire hosting plan and not for a single domain. It gets messy with a lot of domains. But for the most part, it’s a reasonably well featured control panel.

Ultima started off strong. They seemed to have fast, reliable servers. But over time, they’ve become perhaps the worst host with which I have worked. The first full site I deployed on their servers was Code Voyeur. The original SQL Server was fast enough, but I got constant errors. I was convinced it was something I was doing wrong with Spring.NET’s data API. Eventually, I tried moving to a different SQL Server and no problems.

Jeopardy Story and dll Hell both ran against a MySQL server that would at times run painfully slow. Ultima gave me access to a new server with better performance. This new server eventually became subject to regular outages. Again, I was given MySQL space on a new server. So I once again packed up my data and moved to another MySQL server.

I was happy with the new space at first. It was fast and reliable. But last Friday (5/2), that server went offline until the morning of 5/7. Three of my sites were down during this period. Ultima had no recovery plan and no tape backups of the server. It was an incredibly frustrating experience. Had Ultima not been plagued by the same periodic outages that other hosts experience, this offense would be more forgivable. But Ultima’s track record is no better than any of the hosts I’ve described (and they charge more). I would absolutely not consider Ultima Hosts.

Update: Ultima Hosts removed the forum posts relating to the outage described above. When I read that they had done this on an asp.net forum post I set Firefox to work offline and I saved out the cached version of those threads. I’ve attached them to this posting here and here.

WebHost4Life

So once again I’ll be packing up my bits and moving to a new host. This time I’m going to give WebHost4Life a try. I’ve only had my plan for a couple of hours now so I won’t opine just yet. I’ll save that for part III. They have a home-grown control panel that seems plenty powerful, but it’s not too pretty. My first site migration (Jeopardy Story) went very smoothly (almost too smoothly)… Performance is decent so far. More to come after some time passes.

Lessons learned

  1. If you choose a host that forces medium trust, make sure you understand the impact to your site. Set the trust level to medium in the config file. Full is the default…
  2. Don’t get a domain through the host. Use GoDaddy or another registrar. I’ve heard of hosts not letting domains go when people switch hosts.
  3. Use Google Apps for email. All of these hosts have adequate spam detection at best. Google’s is pretty amazing.
Hosting07 May 2008 08:37 am

Update 5/7: After all of the downtime w/ MySQL, my host just went offline for an hour or so. Just keeps getting better…

Update 5/7: This posting was moved from a temporary space setup due to the issue described below… I’m back on my original database server, planning a move to a new host later this evening… Hopefully my current host will stay online long enough for me to migrate.

dllHell.net has been offline now for over 72 hours. The hosting company I use has been fighting with some virtualization software since Friday (5/2). Taking a database server offline for over three days is bad enough. Not having a tape backup of the server is even worse. Adding insult to injury, I moved my databases to that server because of horrible performance on the one I was on (this one). So now for the time being, I’m back on the old database. I have some missing posts (March and April are in limbo right now). When the server is back online, I’ll be migrating this site to another host and will hopefully take the lost posts with me. My first post on the new host will be a candid discussion of several shared hosts that I’ve used over the years. Until then…

C# & .NET & IronPython & CodeVoyeur16 Apr 2008 11:46 pm

Continuing with my “IronPython will end world hunger series,” I’m again shamelessly self/cross-promoting a Code Voyeur article that I think it’s worth a read.

A Simple IronPython Dependency Injection Framework

It’s not Spring.NET and it’s not Windsor, but I really like the idea of configuring objects with IronPython rather than XML.

Enjoy!

C# & .NET & IronPython & CodeVoyeur08 Apr 2008 11:21 pm

I do try to keep the content between Code Voyeur and dll Hell distinct. OK, there’s not much content on either… But I think my latest (up to 4!, that’s 4 not 4 factorial) article on Code Voyeur is a pretty neat idea. Shameless cross-promotion link below:

A Simple IronPython Business Object Validation Framework

MonoRail & PHP05 Apr 2008 04:47 pm

First, I get the irony of posting this on a blog engine written in PHP…

In the past month or two, I’ve had to dig into the sources for a few different PHP projects. It’s not been fun… Though I’m admittedly ignorant about PHP’s various MVC frameworks, none of the apps I’ve been debugging have used one. The result? More spaghetti than found in all of Italy… Chasing down bugs through endless layers of includes and seemingly convention-less folder structures has soured me on a language I once wanted to learn.

One project I’ve been debugging has a strange path through an error handler that leads to a 404 header being written, hiding the original error completely behind a ‘File Not Found’ page. OK, so I know this is nothing PHP specific, but trying to trace down the original error has been a nightmare. This project, which has been a tremendous help to me as an adjunct, is well supported and in widespread use. But wow, it gets hairy trying to trace through the code…

I’m sure that PHP can be used effectively, and maybe even be made elegant. But I wonder why anyone making a platform choice for a new project would opt for PHP. Castle’s MonoRail has totally sold me on the value of a convention-oriented MVC framework. Debugging a MonoRail app is a predictable and rather pleasant experience. If static typing isn’t your thing, then TurboGears looks nice from what I’ve seen. I’ve been digging Ruby, but haven’t worked with Rails. I’m looking forward to writing my next personal project with Rails though.

Next Page »