www.codinghillbilly.com   kyle.baley.org  Subscribe / Contact
 
 
 
 
LATEST POSTS
Saturday, January 31, 2009

Some interesting comments to yesterday's post on working with VMs, enough so that I'm going to free-associate in a follow-up.

A couple of people reported success with using a second virtual hard drive rather than a shared folder. I did start down the road of separate virtual hard drives for databases and projects. But I found out pretty early that you can't share it between virtual machines. Or rather, if you do share it 'twixt machines, you can't have both of them open at the same time.

That may not be too big a deal-breaker. At the time, I had visions of using it to store documents, code, and databases on it. Tom Clarkson outlined what I think is a better solution. Use a shared drive for documents and store code and databases on virtual drives.

This scenario will work provided I don't need to share too much among VMs. Which I think will be the case. At the moment, I have only two development VMs, one for coding and one for Livelink. I don't expect there to be any overlap there.

I know other people that spin up a separate VM for each client they have. I have a base image ready to do that should the need arise but at the moment, I'm trying to keep it simple. If I do need to do that, I suspect there will be considerable overlap in the tools and utilities I use in each one. (Note: And I'd prefer not to store them with the underlying VM itself because they change often as I pick up new tools, update existing ones, and drop others.) But in this case, I don't see the harm in some overlap. Disk space is cheap.

What I envision then is thus:
- Shared drive for documents, music, videos, etc.
- A separate virtual hard-drive per VM to store code and databases used by that VM.

Some may claim I should have one drive for code and another for databases. I'm open to that. But at the moment, this already sounds like a lot of overhead. It's easy enough to move files around at a later date. I suppose I won't truly appreciate the effort I'm putting in until my hard drive crashes or I get a new computer.

Kyle the Optimistic

Friday, January 30, 2009

Since getting his new desktop a couple o’ weeks ago, the hillbilly’s gone all virtual. I’ve been playing with virtual machines as my primary destination, leaving the host as dumb as I can possible make it. And to be quite honest, it is difficult to make something dumb, which is surprising considering some of the comments from past clients.

One of the things I had hoped to do was keep all my data on the host machine and access it via a shared drive from my VMs. It’s basically the 21st century version of creating an Apps partition and a Data partition. Then I’d use SyncToy to keep that folder up-to-date on an external hard drive as well as the virtual machines themselves. (On a side note: I dearly hope the promise of virtual machines holds true because setting up a new workstation is more mind-numbing than the stuff I have brewing in the still in the basement.)

I’ve run into a couple of issues with this set up. First was a time-sucking annoyance where I wasn’t able to copy documents in the same folder. I.e. Select the document, press Ctrl-C, then Ctrl-V. Kept getting permission errors. I was able to create new documents just fine. It’s one of those annoyances that goes away if you ignore it long enough apparently because I’m no longer able to duplicate it.

The second problem was trying to attach a database to SQL Server from a shared drive. Perhaps it’s possible with a SQL statement but from the GUI, it doesn’t even list network drives.

Problem three: IIS seems to have trouble with web apps using a network drive as well. It had trouble reading the web.config file until I moved the thing locally.

Problem four actually pre-dated problem three. I didn’t actually have IIS installed when I started this odyssey. After I did, it took a while to figure out that I had installed IIS after I had installed .NET 3.0. Hence, none of my WCF services would register. That was solved by running servicemodelreg.exe –r from C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation. It appears to be analogous to aspnet_regiis.

So all in all, it’s been a configuriffic afternoon. I’m still trying to get the hang of booting to various virtual machines. I do NOT like the fact that I can’t change my primary monitor in a VM with VMWorkstation.

This is also my first foray into the 64-bit world and I’m discovering the idiosyncrasies that brings. For example, UltraMon still has some work to do to make it work on Vista 64-bit. The smart taskbar is kinda flaky and the two extra window icons (move to other monitor, maximize across both monitors) don’t appear, though you can click in the general area and get the same effect.

Kyle the Virtual

Thursday, January 29, 2009

I’ve recently had to set up a local Livelink environment because my system is running too smoothly and I need to throw an enterprise-level content management system at it to remind it that there are things in this world that can take you down in a second.

To minimize the (inevitable) damage, I’ve set up a separate virtual machine for it using a clone of a base Windows 2008 Server image I have. One with IIS7.

I’ve become quite adept at configuring IIS6 for Livelink (versions 9.5 and 9.7). You create a virtual directory against C:\opentext\cgi (configured as an application) and another for c:\opentext\support. You also need to allow executables. AND Allow Unknown CGI Extensions and Allow Unknown ISAPI Extensions under Web Service Extensions in IIS6. I’ve always been leery about opening it up like this so for IIS7, I was looking for a more restricted way of allowing livelink.exe to run.

IIS7 does things similarly but the options are in a different spot. Essentially, you’re configuring it to run CGI applications.

I’m assuming you’ve run the Livelink install on your machine already. In order to configure IIS7 after it’s done:

  • Open IIS
  • Click on the server name at the top
  • Double-click ISAPI and CGI Restrictions

iis7

  • Click Add and enter the page to your livelink.exe. Make sure you select Allow extension path to execute

iis7

  • We’re only partway done. This allows the livelink.exe module to execute when given permission. But by default, IIS7 doesn’t allow CGI applications to execute. In the main IIS window, select the Livelink application and open Handler Mappings

iis7

  • Next, select cgi-exe at the top of the list in the main panel, then click Edit Feature Permissions… on the right. In the dialogue box, check off Execute and click OK. (In the screenshot, I haven’t checked Execute because as soon as you do, the UI is updated underneath, making the screenshot harder to explain.)

iis7

  • Finally, reset IIS (i.e. run iisreset from the command prompt or the Run dialog).

After that, you should be able to access your new Livelink installation from Internet Explorer (e.g. http://localhost/livelink/livelink.exe). Firefox is another matter. For whatever reason, it’s not working on my machine. It keeps wanting to download livelink.exe rather than run it as a CGI application. I have reason to believe it is related to content type but I’m nearly positive it worked under IIS6 without any further configuration.

Ah well, a post for another day. If ambition holds, I’ll put something up on configuring a SQL Server database for a local environment too.

Kyle the Livelink’d

Monday, January 26, 2009

I have a hate-hate relationship with Microsoft Money. Or rather, with it’s delivery mechanism. I’ve railed on this before more than once. You’d think I would have learned my lesson but here I am, once again, with a new computer that needs a new copy of Money 2008 installed and me without my installer…

One of the “problems” is that I upgraded from version 2006 to 2008 late last year. This was because Money 2006 stopped updating prices for my portfolio automatically and I figured it was because my 2-year dealie thing had expired. Alas, upgrading to version 2008 didn’t work and it was only through their support centre (which, I will freely admit, was extremely helpful) that I was able to get that feature working again.

Now 2009 brings the hillbilly a brand new desktop and the *only* application I’ve had any issues installing is Microsoft Money. Everything else, both paid and unpaid, went off without a hitch. ReSharper, SmartFTP, VisualSVN, FoxIt PDF Creator. Each of these (paid) products I was able to get up and running the same way:

  • Download from their website
  • Install
  • Search my Inbox for a license key and enter it

(It should also be noted that every single one of these products is more expensive than Microsoft Money.)

But Microsoft Money has a download limit of 30-days. After that, you’re out of luck unless you purchased the extended download service, which gives you access for up to two years. During my attempts to fix this, the helpful folk at DigitalRiver.com said I could purchase said service after the fact but try as I might, I simply can’t figure out how, even with the instructions they sent. (I could e-mail them to ask but in my most recent reply, I was a little too sarcastic and told them I’d rather eat glass than buy it.)

Enter Quicken as the most viable replacement. Except that you can’t download a trial version. And for software that manages my money, I like to see what I’m getting first. The Twitterati has made a few alternative suggestions, like Yodlee and GnuCash but personal banking is a pain as it is in the Bahamas and I’d like to stick with software I’m reasonably familiar with. Plus, the automatic price updating seems to be a missing feature in both of those.

Note: it could be argued that this is all my fault. I read the terms and conditions and was fully aware of the 30-day download limit and shouldn’t have deleted the set up application. That’s very true. I have a habit of downloading to my desktop, then cleaning house on a regular basis and my memory for this sort of thing sucks. As it turns out, over the course of writing this post, I did end up finding the original download (which I had mistakenly filed under the Visual Studio 2005 Macros folder). So I no longer have anything to rant about. But the practice is still very much outdated and should be reworked so I’m going ahead anyway.

Kyle the Vented

Friday, January 23, 2009

This is a managerial update that I’ll include now so as to double my post count for the month.

I have resurrected my old blog over at http://kyle.baley.org. Those of you who subscribe to my personal feed (and lord knows why you do when you can get all that and more with the CodeBetter one) have probably received a whole bunch of duplicates of recent posts, assuming I’ve configured everything properly.

imageAs I’ve mentioned before, I am staying put at CodeBetter for the foreseeable future. I mean, what kind of guy would use CodeBetter to boost his exposure, then bolt? But sometimes, I don’t feel like coding better. Sometimes, a guy just wants to sit down at his keyboard and code adequately (or, code worse). You know the feeling. You’ve just had a bad “experience” at a family gathering and you just wanna vent on the stifling rules society places on the more enlightened of us.

Plus, the Hillbilly has amassed more than a little knowledge in the Open Text Livelink arena (yeah, I hadn’t heard of it before either). But it’s rather specialized and has only a very little to do with what I consider CodeBetter material.

So I’m using the old homestead as a random dumping ground of even more random thoughts as well as an outlet for the very closed world of Livelink. (Those of you who are even remotely familiar with the product will probably understand the attraction to it by someone with very liberal views of family trees.) It will also be a nice little chronicle of my BahaNET adventures which I also feel has a more limited scope.

If you’re interested in joining me over there, I’ve updated my FeedGoogleBurnerAnalytic-type link to point to it, I think. Everything I post here will be posted there. The cross-posted material will be stuff I think is relevant to .NET and programming in general. So if that’s all you care about from me, there’s no need to adjust your set.

As for the rest of you, well, like I always say: You can’t save everybody.

Kyle the Debunked

Tuesday, January 06, 2009

I've said this before and I'll say it again: Lord Tunderin' Jayzus!

The target this time is NHibernate Profiler. As of this moment, I've had it "installed" for all of fifteen minutes and I've already reduced the query count of one page from 205 to 1. Such is the story you will read about today. I suspect typing it out will take longer than it took me to optimize the page I'm about to describe.

By the way, I put "installed" in quotes because installing the application consists of unzipping it to a folder of your choosing. Means you need to set up shortcuts on your own but I like the minimalist approach myself.

The app I've already described. To sum up, Surveyors have many MonumentAssignments. Here is the (original) Fluent NHibernate mapping for review:

public SurveyorMap() {
    WithTable("Surveyor");

    Id(x => x.ID, "SurveyorID")
        .WithUnsavedValue(0)
        .GeneratedBy.Identity();

    // Boring stuff

    HasMany( x => x.Monuments )
        .Cascade.AllDeleteOrphan( )
        .WithKeyColumn( "SurveyorID" );
}

Notice how I put (original) in brackets there. That's what we in the legitimate journalism field like to call "foreshadowing" (or, more likely, foreboding).

The page in question provides a list of Surveyors. First name, last name, commission number. That's it. It isn't displaying anything from the Monuments collection. (See? More foreshadowing.)

So it was much to my surprise when I profiled this application that it outlined a total of 205 SQL statements for 202 Surveyors. "Odd" says I, and I proceeded to work my way through NHibernate Profiler to see what it can tell me.image

Quite a bit as it turns out. The screenshot at right shows a summary of the alerts. The one that jumped out at me was 199 SELECT N+1 alerts.

The ellipsis took me to this page which was pretty helpful. It says if I'm going to iterate over the collection, I should consider eager loading. Well, you won't accuse me of not being eager so that's what I did. My GetAll method now looked like this:

public IList GetAll()
{
    var criteria = DetachedCriteria.For( );
    criteria.SetFetchMode( "Monuments", FetchMode.Eager );
    return criteria.GetExecutableCriteria( Session ).List( );
}

That baby reduced my query count from 205 to 3. And my alerts consisted of two "Use of implicit transactions discouraged" and one "Unbounded result set". "Acceptable" says I!

But then something occurred to me. I'm not using the Monuments collection in this page. Why is it even retrieving them? Maybe I *am* being too eager after all...

As it turns out, the HasMany call in my map doesn't retrieve the Monuments lazily by default as I had expected it would. So with a flourish of my hand, I remedy that:

public SurveyorMap() {
    WithTable("Surveyor");

    Id(x => x.ID, "SurveyorID")
        .WithUnsavedValue(0)
        .GeneratedBy.Identity();

    // Boring stuff

    HasMany( x => x.Monuments )
        .Cascade.AllDeleteOrphan( )
        .WithKeyColumn( "SurveyorID" )
        .LazyLoad();
}

I also reverted my previous eager change because it was no longer necessary and poof! I am now down to a single SQL query for the page, which is as it should be. I still prefers that I limit my result set and put things in an explicit transaction so I'll be tackling those shortly. But for now, I'm agog, AGOG I TELL YOU!!1!

Granted, exposing my ignorance is not exactly an Olympic event. But just this morning, I made some facetious remark (no, it's true) that I wanted to make an application that was wildly successful in spite of itself. Several people responded with variations of "is there any other kind?" Given what I know of its creator, I'm hoping this is an exception: an application that is wildly successful because it fills a niche *and* because it is reliable and well-built.

That said, Ayende, if you're reading, it'd be nice if you could clear individual sessions from the list...

Kyle the Reduced

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Copyright © 2010 Kyle Baley. All rights reserved.
 
CATEGORIES
.NET General (18) alt.net (4) altnetconf (9) ASP.NET AJAX (40) ASP.NET MVC (29) Bahamas (1) Bahanet (9) BDD (1) Brownfield (18) Career (9) Castle (1) Code coverage (1) Coding Style (6) Communication (1) Community (18) Conscientious Coding (34) Continuous Integration (11) dasBlog (12) Development (16) DevTeach (4) Domain (2) Environment (4) Estimating (1) Featured (14) Flamingo (10) Games (1) Google App Engine (2) GWT (5) Hardware (6) Java (1) Javascript (7) Linq (2) Livelink (6) Lucene.NET (2) MbUnit (1) Metrics (1) Miscellaneous (24) Mocking (4) NAnt (4) NHibernate (12) NInject (1) Office (3) Office Development (6) Open Rasta (1) Patterns (5) Presenting (13) Professional Development (15) Refactoring (10) ReSharper (11) REST (2) S#arp Architecture (5) Security (3) Software (11) Sundry (18) TDD (19) Tools (21) User Interface (5) Utilities (8) Visual Studio (8) VSTO (1) Web development (12) Windows (3) Working Remotely (16) Workplace (3) Writing (4)
 
LATEST POSTS
 
POPULAR POSTS
 
 
ARCHIVE