Thursday, October 18, 2007

Exactly what it says on the Tin...

October 18, 2007 Posted by Jason Irwin , No comments
I mentioned in a previous post that I have recently been toying with Virtual Server 2005 - setting up some virtual servers at work....Well, this morning I was approached by another member of staff, who questioned the amount of disk space I had allocated on one of the drives. I had set up three dynamically expanding drives on each server, but the maximum available space was still not quite enough for my colleague's purposes. So I was left with the easy (hindsight is 20/20) task of adding more space to the disks. Sure, it would have been easy to set up another VHD, allocating the needed amount of space. But the disks were separated for Database placement, and adding another hard drive, though acceptable, would have been a dirty solution. My first assumption was that Virtual Server itself had to have this functionality in-built. After-all, the software that created the disks had to be able to resize them - right? Nope. It took a little google-ing to find a little tool that did exactly what i needed.

Vhd Resizer (freely available at http://vmtoolkit.com/) allowed me to resize an existing VHD (the Virtual Machine had to be shut down first obviously...) in about 4 mouse clicks. Furthermore, it allows changing of the drive type (dynamic/static), though I had no need to try out this additional functionality. It is by no means a fancy tool but it worked perfectly first time which is always a bonus! I added the new VHD (and removed the previous one) to the Virtual Machine, booted it back up and could see my extra space in Disk Manager...yes yes, it was an NT 4.0 Virtual Machine. Two clicks (highlighting the old partition and the new one) and holding down the ctrl key allowed me to combine these partitions in NT and after a quick reboot i had a nice big hard drive - courtesy of the nice people at vmToolkit. This nifty little tool saved me a ton of time and effort!

On a side note, vmToolkit offers a second tool - a VMDK to VHD converter - allowing VMWare images to be ported over to Virtual Server...which is nice!

Tuesday, October 16, 2007

Microsoft Health - Common User Interface

October 16, 2007 Posted by Jason Irwin No comments

As so often happens, I was sidetracked when Google-ing a specific problem in work this morning, only to find myself enamored by a new technology, unable to return to my original train of thought…unable to remember what it was I originally investigating!!


Today, it was Microsoft Health’s Common User Interface (CUI) that stole my attention (see http://www.mscui.net/Default.aspx). As my blog introduction stated, I work for a Healthcare Organization in the United States. On a daily basis we deal with the development and maintenance of an array of healthcare products. Legacy applications exist in a number of programming languages, but the .NET framework was adopted around the time of its inception and all new applications are developed in Win or Web Forms – making this CUI quite an exciting prospect. As the name suggests, the Common User Interface is UI oriented, aiming to provide design guidance and controls for healthcare applications. Its first release (CTP) was in July of this year and sample controls are downloadable from Codeplex.


What excites me about this is not that it has the potential to put me out of a job (joking of course) but that it has the potential to provide a safer and more efficient manner in which to develop healthcare-based applications. I would hate to fathom how much is spent in the US each year in developing MIS front-ends. Medical standards exist, so it seems a little strange that in many areas standards for the Information Systems that support them do not.


I had the chance to play with the CUI a little, and while it is not very mature (remember it is a CTP) it has quite a lot of promise. Developed with the British National Health Service (NHS) in mind, it appears address some moderately complex UI tasks such as medication display, and also some fairly minor (but nevertheless important) ones – Address Labels, Gender Labels, Date Input validation controls, etc. More exciting is that the technology supports Web Forms (AJAX supported) and Win Forms – though the former appears to be the primary development platform (for the NHS). The website allows interaction with a number of sample web controls and the toolkit can be downloaded from a provided Codeplex link. If you are in the healthcare business I recommend you look out for this as a firmer development strategy is formulated and toolkit additions are released. The future looks bright!


Friday, October 12, 2007

Lunchtime Session #1 - Ruby, First Impressions

October 12, 2007 Posted by Jason Irwin , No comments

OK, I know – I am waaaaaaaaaay behind on this one. But the thing is, I’m not only a .NET developer by trade - I’m a .NET developer by choice…

RANT

This may be seen as contemptuous by that more righteous side of the community that lives and breathes the FLOSS dictum. Don’t get me wrong – I am a big fan of open source software, and a bigger fan of those who choose to contribute their time and expertise to the greater good. I have often piggybacked on the (open source) creativity of others, and have undoubtedly grown as a developer in doing so. I always use the tool that does the job best and for development purposes, I have chosen .NET. I am pretty fluent in Java (with a few rough edges due to lack of industrial strength practice) and a host of web languages. I am in love with Visual Studio which matures beautifully with each iteration. The out-of-the-box functionality of the .NET languages is superior to anything I have seen before and I cannot imagine developing enterprise class applications with many other languages (J2EE aside). Because of my ties to .NET, I have little time to invest in outside technologies (I have a hard enough time keeping up with Microsoft’s release cycle (see my upcoming LINQ posts)).

I got an email from the Chicago .Net User Group regarding next month’s downtown meeting (Downers Grove generally gets the best content – but that is a rant for another time) and it is entitled “Ruby on Rails for the ASP.NET Developer”. I will more than likely attend so I decided to brush up on my Ruby before hand. This post marks my very first interaction with the technology. I hope to blog more on the subject as my knowledge grows, and at some point in the future start digging into rails. I apologize for the Rant:Content ratio.

CONTENT

My learning starts at the beautiful http://tryruby.hobix.com/ whose online interpreter (see screenshot) provided with both the tool and guidance (via it’s help mode) to start learning Ruby. I allotted a full lunchtime to take the help tutorial and was immediately, as a developer, enamored by the online interpreter. I’ve got to give these guys credit – the site is beautiful. In fact, it probably impressed me more than the language…


The tutorial itself was, as its description said it would be, basic! Like reading the first chapter in one of those books that claim they teach you a full technology in a single day, you come away knowing only the very basics – without any experience of the technology as it is used in real life. But as I said, this was to be expected and is in no way a negative reflection on the site. This is hour 1, so I am not expecting miracles. The basics are good for now. The main point was the syntactical differences between this language and those I am used to. It is an interpreted, weakly typed language, more akin to Perl than to .NET or Java. It seems to focus heavily on user interaction (attempting to make it easier to interact with variables, more intuitive to sort and filters lists etc.) but my first experience showed me nothing that could not be done as easily in other languages. I'm not sure what i was expecting - a language with which to design web applications or web sites, but so far i have seen nothing to suggest that the former is possible. Alas, these are early days...

On a side note, I’m uncertain if an issue that I came upon was caused by Ruby itself or if itis limited to the site whose interpreter I was running - but it was a LARGE source of annoyance, and caused my work to take far longer than normally. A number of times my mind worked quicker than my fingers, causing the usual typo or two that i'm used to once my mind is on the code. However, since the interpreter allows text to be input line by line, I was left with a typo on the previous line, seemingly unable to get back and change it. Perhaps there is a way of getting back there - but i couldn't find it. I could type reset and start over – which was fine (if not a little annoying) for today's purposes, but had I been creating a class of any decent size, this would not be a reasonable solution.

Conclusion

All in all I was more impressed with the tool I used than the language. The tutorial provided an interesting and concise introduction to the most basic of Ruby basics and introduced me to the language for the first time. http://tryruby.hobix.com/ deserves another plug as it enabled me to pick up a little Ruby rather than watch the lunchtime news. Any judgment of Ruby itself would be extremely premature, and i look forward to seeing what it can really do in the immediate future.

Wednesday, October 10, 2007

Querying Active Directory through SQL

October 10, 2007 Posted by Jason Irwin , , 2 comments
Lately I’ve had quite a lot of interaction with Active Directory, using multiple tools and methods to get the data I require. As a SQL developer, I was very pleased to find out that active directory could be queried through SQL, allowing data from active directory to be joined on data from our database, allowing queries across multiple operational domains.

This is a quick introduction to querying Active Directory using SQL – these queries
work in both SQL 2000 and 2005.

To query AD through SQL it is first necessary to create a linked server to Active Directory using the ADSI provider. This can be achieved as follows:



Next we query the linked server using the openquery command in SQL. The
below example selects all the users in the Accounting Employees organizational unit
on the irwinj domain.


Finally, if we want the same group of employees, but this time we need
to filter to show only active users, we can use bit-masking on the userAccountControl
to filter the group as follows:


NOTE: A major drawback when querying AD (regardless
of the method used) is that the default AD server setting imposes a return limit
of 1000 objects. If a query returns more than 1000 objects, this list will be cut
short. It is not recommended to increase this default return value, so we must query
around this! The obvious method, and SQL best practice, is to provide the most narrowing
filter possible to your SQL query, but if all else fails there are other possibilities
(http://blogs.msdn.com/ikovalenko/archive/2007/03/22/
how-to-avoid-1000-rows-limitation-when-querying-active-directory- ad-from-sql-2005-with-using-custom-code.aspx
)

Virtual Server 2005 - Storing VMC Files on a Network Share

October 10, 2007 Posted by Jason Irwin No comments

There are a number of tasks that a developer performs that go outside the realm of development. Recently I was given the task of performing a fresh install of Virtual Server 2005 on one of our boxes. Due to storage restrictions it was necessary to install VS on one server (srvr1) and place the virtual machines on another server (srvr2) – a simple task, but one which I hadn’t performed before and took a little investigation (and a lot of bugging one of our system guys) to get right.

I ran the default installation of VS, not knowing any better. I mapped a network drive to the folder which held my vmc, hoping that VS would see it as a local drive and allow me to mount it. I entered the path of the VMC (when adding a new server) but received an error indicating that the file was not found….not a good start!


I attempted to add the UNC to the ‘Search Paths’ stored in VS Configuration – but received an error indicating I did not have access permissions…still not a good sign, but a little bit of information to dig with. I came cross the following story:


http://pcquest.ciol.com/content/enterprise/2007/107020401.asp


This taught me a) what I was trying to do was possible and b) when setting up VS I should have set the Administration web site to run under an account with appropriate permissions on the network. So, I changed the Administration website authentication methods to enable anonymous access under a privileged account (see below screenshot), and re-entered the search path in VS. I was then able to add the Virtual Server by inputting it’s UNC in the add server dialog.


Now, I have srvr1 running VS, pointing to virtual servers on srvr2!