(N)Hibernate tutorial/analysis
March 7th, 2007If you’re using (N)Hibernate, or thinking about it, this is great little hands-on walk through of the various mapping possibilities and their impact.
If you’re using (N)Hibernate, or thinking about it, this is great little hands-on walk through of the various mapping possibilities and their impact.
Damn, why didn’t I think of that?
This is another example of something I’ve personally ‘hacked’ almost everyday and of course it never occurred to me you could design a product out of it.
“Stainless steel can colander great for draining small cans such as tuna”
Link from cool tools.
In case it hasn’t become clear, I’m on the virtualization bandwagon. At least when it comes to my desktop. In terms of server based stuff, no clue.
Back in my mks days, we used removable harddrive chassis to mimick virtualization. So my desktop had a removable drive as it’s primary drive. Depending on what was happening I’d have three or four physical drives in my office. My two core environments were a Red Hat drive and a Windows 2000 drive. There’d be a few extras depending on the projects at the time. Anytime I wanted a new environment, get a clean drive, plug it in and install the OS.
Looking back at it now this was just a virtualization hack. It was a lot better than dual boots which were clumsy. This setup was a complete pain if you didn’t have network file storage available as you could only have one drive active at a time. Obviously you’d also be stuck booting and rebooting your machine all day long.
Time to move on……
In case anyone’s paying attention, here’s where I’m at in my attempt to be a computer geek.
I’ve ordered up a new desktop after having been running laptop only for over two years. Quickly, it’s details are:
All parts are fancy pants parts, ie respected brands, so it’s not cheap but it’s still a great deal, especially compared to a laptop.
I’m now planning to start with fedora 6 and try Xen and VMWare to virtualize a windows desktop for development purposes. I’m going to start with xen as it’s built into the kernal and uses paravirtualization. Certainly, I’ll use xen for any linux based virtualization but I don’t see doing much of that. Hopefully windows will work nicely as well, if not I’ll move to vmware.
Other stuff, I want to setup a software based RAID-1 array. My plan, at this point, is to use this desktop as my workstation when at my desk. As well, it will be used for some file serving purposes on our home network. When I need to be remote, including within my house, I will do one of the following:
I intend to quickly move my laptop to fedora as well. As well, I’m going to give Mono a serious look for windows development in fedora. In terms of databases, I may just run a small virtualized windows machine on my network for sql only. Or I’ll just use MySQL, code primarily in fedora, and do all my final testing in windows.
So basically, still a lot of crap to test.
It’s a lesson I learned the expensive way. The first thing I do with a new piece of mobile electronics that has a screen I care about is put a screen skin on it. It’s a simple, unobtrusive way to protect your screens, especially if you plan to throw devices into purses, pockets and backpacks.
I have a pack I purchased for a Palm pilot years ago that I just cut to size and use. These guys appear to have a good product but I’ve never used theirs.
Apologies upfront, this is nerdspeak, specifically C# nerdspeak, however, it’s something I’ve bumped into enough times that I felt it worth putting up. At least I’ll be able to find the answer easily next time I run into this.
Can you use an App.config file in a class library? Technically the answer is no, however, it’s not as limiting as it sounds. You can read an App.config file from an assembly, however, it must be in the context of the running assembly.
In the case of a large project with multiple assemblies, I typically want to have a single class that’s responsible for reading the configuration settings and making them available to other assemblies. So, is this even possible if you’d like that class to be in a library? Yes, however, you need to do some post-build work to make that happen.
Looking at a specific example, let’s say we have a console application named TheApp. That console app is only responsible for rendering it’s UI and all other work is done by multiple class libraries. We don’t want this assembly to contain the business logic related to reading configuration settings.
So we have another library, named Server. It has a static class named ConfigReader which reads the App.config file and makes settings available as discussed above. This can be done, however, the Server library will always look for and read the App.config file based on the running assembly, which in this case in the console application.
So, in order to make this work you have a few options, one of which is to simply have a nant task, or a post-build task, that copies the App.config file from your Server library into the console application’s bin directory, making sure to rename it based on the name of the console application, TheApp.exe.config. You can also generate this file, create from scratch, or simply keep it in the TheApp project itself.
If you grab the source code below and run it you’ll get an exception and it will appear as though it can’t read the App.config. That’s because one doesn’t exist in the bin directory you’re running in. Copy Server/App.config into TheApp bin directory and rename it to TheApp.exe.config and try again:
cp ../../../Server/App.config ./TheApp.exe.config
Again, another option would be to cut the App.config from the Server project and paste it into TheApp project. Build and you should be good. Now you have a class library reading your App.config file.
I’m not recommending you actually do any of this, just making sure you know it is an option. I find when you look around for information related to this, people often land on the conclusion that your only option is to read the App.config file in the console application (TheApp) which is not the case.
I’ve been reluctantly using windows as a development environment for the past couple of years. Prior to that, being that I was working primarily in java enterprise, I split my time between red hat linux and windows. I much prefer a *nix variant to windows as a development environment and have always pined for a return. Well it seems like I no longer have any excuse not to with the explosion of workable virtualization software.
I know of several developers who’ve are successfully doing windows development in OSX. The key is a commercial product named Parallels which allows you to create virtualized OS’s. So instead of having to dual boot, you can run an entire OS within a window in OSX. So now you can use OSX for everything except your windows development work, which you simply fire up you virtualized windows OS for.
A major feature in this setup is the protection this offers you from viruses etc. All a windows virus can harm now is your virtualized instance, in which case you should be able to easily return to a previous instance in time. As well, as you’re using windows in a far simpler fashion, only development tasks, it will tend to be a cleaner instance of windows which we all know is a good thing when it comes to windows.
So am I getting a mac? Well I’d love to, however, I can’t get over the price shock. As well, while I’d love to get at that slick gui and some of those applications, I’m not sure I’m willing to do that at the expense of having access to a pure shell environment. Using a shell in OSX means running it on top of a bulky windows manager. As well, I’d rather have hardware options instead of being a slave to whatever Apple chooses to offer me.
In the end, I would much rather give a BSD variant a try. With a BSD variant, I have control over the kernel if I need that, can run whatever windows manager I like when I need it, and can run a shell without a windows manager.
So, here’s my current plan. I’m going to try a bsd variant, pcbsd or desktopbsd. At this point my plan is to give pcbsd a try along with the virtualization product win4bsd to run windows. I’m contemplating building a new desktop to test this on. Building my own allows me to get exactly what I need, two drives in a RAID array etc at a reasonable cost.
If things work out then I’ll run primarily on the desktop and move my existing laptop to pcbsd using it primarily for browsing, email, etc.
CrowdSpirit is aiming to take the crowdsourcing movement into electronic products.
I use this a lot. It’s a free print driver that prints to a pdf file. It’s slick because anytime I need a pdf I can hit print, no matter what application I’m in, choose the pdf driver, watch a bad ad, and I’m done. No switching applications, exporting, importing, etc.