LINQ to NHibernate

Best Quote from Oren on DNRtv:

Oren: “This is HQL, Hibernate Query Language. It is similar to the SQL look but it has more OO notation. …”

Carl: “Starting to look like LINQ a little bit.”

Oren: “Yes, it looks like LINQ, but this is string. This is string but what will happen is once LINQ passes beta status me or someone else from NHibernate community will write a LINQ adapter for NHibernate. I don’t know the exact name. It actually isn’t very hard. I talked with at TechEd isreal last year and it doesn’t look very hard at all to do this. The concept is very much the same.”

So, learn and use NHibernate (or Castle ActiveRecord) now. Don’t worry or fret about LINQ, DLINQ, LINQ to SQL, LINQ to Entities, LINQ to DataSets. The beauty of LINQ will be available for NHiberate. LINQ is not the death of NHibernate.

NHibernate is a vast library with many extensiblity points. NHibernate exists today, it has proven itself for years. Its intricacies are well understood by the community and there is excellent documentation surrounding it. Now I’m sure that LINQ to SQL will have reams of docoumentation as most Microsoft products eventually do. But, LINQ to SQL is for Microsoft SQL Server only. NHibernate has mappings to MSSQL, PostgreSQL, Firebird, MySQL, SQLite, even Access, and probably many others. By leaning on NHibernate you are assured a high level of compatibility with any RDBMS. Some organizations value this. I value this.

Omer van Kloeten on Operating Systems

Omer van Kloeten has a series of posts on Operating Systems. It is damn find overview for me. It has been seven or eight years since I took my Operating Systems course in college. I also find the posts important because I’m aware of the number of programmers who have never had any higher education. Its very valueable to at least be aware of these things. Its why its taught in college. Very few programmers go and program at this level, but we must always be aware of what is really going on layers underneath us.

Processes, Signals and Threads
Scheduling

Thanks Omer!

Test a web app – I must try Selenium in addition to WatiN

WOW!

Dan Bunea has an awesome post on Test First Web Applications

I felt a little dirty after CodeMash because Selenium was presented there and it really looked at felt like a more powerful web testing system than Watir or Watin. I had just adopted Watin for some basic tests and I had to admit I really didn’t like the fact that it was just driving an IE engine. Especially since I don’t really care about IE, Firefox is my standard.

I didn’t know about Selenium RC. Apparently I can use .NET to write my tests and they will get translated to something Selenium will use. This is what I was looking for when I opted to use Watin. I’m not sure if this was mentioned in the CodeMash presentation. I had duct out trying to see both the Selenium talk and the “What Makes Rails Work” talk.

Thanks to Dan for the awesome post.

Oh and the post is also an awesome example of building a MonoRail application.

I made it back alive from CodeMash

CodeMash was sweet.

So many other people are blogging about how awesome it was, I almost feel like I don’t need to mention it at all.

Any mention on the net is good, as long as they spell your name right. Meeting tons of people at CodeMash was a blast. Everyone was very down to earth. Keith was great to talk too. Catching up with Dustin Campbell was a blast as always. Of course talking with people I see more often like Bill Wagner, Josh Holmes, Jason Follas and Dianne Marsh was great too. It was great to talk with Richard Perry who is living in Detroit (well, Ferndale) who loves Detroit. I love Detroit too.

Bruce Eckel’s keynote was awesome. The non-codemash of software direction and burning man inspiration was awesome.

Neal Ford’s keynote was very fun. The Starbucks and Waffle House Domain Specific Languages are not to be forgotten.

Dave Donaldson represented NHibernate and I’ve very glad to see an open source .NET project get some exposure. I talked to a number of people who had never heard of NHibernate or Castle Project. I tried my best to explain to them what they were and of course talk them up as much as possible. I do happen to disagree with Dave when he says that LINQ is an ORM killer. LINQ to SQL, LINQ to Entities are just implementations of LINQ that happen to by ORMs themselves. There is nothing stopping the NHibernate community from creating LINQ to NHibernate. In fact, I’ve been thinking about how it could be done and I don’t think it would be too difficult.

I put some photos up on my flickr.

My camera was in the wrong mode for a number of the head shaving photos and I didn’t realize it until it was too late to capture the action. I love this picture of Josh and Brian just having their heads shaved and Josh just happens to be standing such that the projector is displaying “codemash” on his forehead. It was a very fun coincidence.
CodeMash 020

Did I mention that Richard Perry is a lot of fun?
CodeMash 004

It was also great hanging out with Richard Harding and Mark Ramm. Mark always has the most interesting and outrageous stories.

If you didn’t make it to codemash, I’m sorry to tell you that you REALLY missed out. I look forward to seeing you at the next one.

Code Mash Openning night.

Checked in a little before 8pm. So I agreed to meet my wife at 9pm and I went down and registered and listened to the already started expert panel on languages.

They definitely covered a lot of things.

The only things I’d like to add is on the topic of an enterprise architecture based on Web Services(SOAP). I think WCF is compelling enough that is bears mentioning. Yes, right now it is .NET only, but it is pluggable everywhere. You could (probably without too much effort) talk to java, python or whatever with it. The reason I find WCF so compelling is that it can start off as SOAP and WS-*, but based on its entirely customizable and extensible framework, you can completely change these transports to whatever you want. It could be binary. It could be RESTful XML over HTTP. It could be RESTful JSON over HTTP. Or… and this is one thing that I would love to explore… it could be your own protocol with your own states. I’ve always liked they way SMTP, POP, and IMAP were plain text (mostly) over TCP. It would be fun to try to come up with a generic WCF provider which would look, talk, and act like a plain text protocol over TCP.

The rest of the night is OpenSpaces talks. The only two I saw posted at 10min till 9pm was a 9pm on DotNetNuke and a 10pm on Open Source with .NET. I’ve missed most of the first writing this. I need to get food, so I hope I don’t miss the 10pm.

Cygwin Setup for distribution and yourself

Beating cygwin setup into submission can be a challenge. I finally figured it out.

I have need to install cygwin on servers which have no internet connection. I have no computer with internet except my lowly workstation. It already has cygwin installed. I would like to be able to download the cygwin installer, tell it to download only(it does support this) and then copy that package directory to a non-connected machine and run the cygwin installer.

The catch is that when I run the cygwin installer on my workstation, it sees all the packages I have installed. I can select a package for re-download, but then it downloads only that package and not all of its dependencies. I want a way to fetch everything! I actually suffered through an openssh cygwin bundle once. Adding a dependant package when I found it, trying again and so on, until after about 5 rounds, I had functioning openssh. It was a horrible experience.

It turns out the cygwin setup program reads setup information from /etc/setup. The simple workaround is to rename /etc/setup(aka c:\cygwin\etc\setup) do your download only install, and then delete the /etc/setup and rename your original back in place.

So far it works very well. You can even keep around multiple setup directories for different cygwin bundles.

Your own Apache proxy without root

I have a shell account on various friends servers all over the internet. Thanks to ssh, I can create a SOCKS proxy and tunnel traffic through ssh out the internet through any of these shell boxes. However, for various reasons (usually DNS related) SOCKS isn’t always good enough. I like to have an HTTP proxy as well.

Enabling mod_proxy in apache is pretty darn easy any any linux distro… if you have root to make changes to the apache configuration and to restart apache. I have friends nice enough to give me shell, but they don’t give me root. (I don’t blame them.) It turns out that running your own apache, without compiling it, is very easy with a little know how on most modern linux distributions.

First, copy the apache configuration which came with the system (hopefully apache is installed. If it is not, these instructions are not for you).

$ mkdir etc ; cp -a /etc/apache2 etc

Next, make directories for apache runtime information and logs.

$ mkdir -p var/log/apache2 var/lock/apache2 var/run

Now edit etc/apache2.conf and change… well… a lot of things. Just apply this patch instead. It is easy to read and see what is changed.

--- /etc/apache2/apache2.conf   2006-01-07 05:51:10.000000000 -0800
+++ etc/apache2/apache2.conf    2006-10-05 11:39:11.000000000 -0700
@@ -10,7 +10,7 @@
 # (available at );
 # you will save yourself a lot of trouble.

-ServerRoot "/etc/apache2"
+ServerRoot "/home/jrwren/etc/apache2"

 # The LockFile directive sets the path to the lockfile used when Apache
 # is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
@@ -20,12 +20,12 @@
 # DISK. The PID of the main server process is automatically appended to
 # the filename.

-LockFile /var/lock/apache2/accept.lock
+LockFile var/lock/apache2/accept.lock

 # PidFile: The file in which the server should record its process
 # identification number when it starts.

-PidFile /var/run/apache2.pid
+PidFile var/run/apache2.pid

 # Timeout: The number of seconds before receives and sends time out.

@@ -98,8 +98,8 @@
 AcceptMutex fcntl
 

-User www-data
-Group www-data
+User jrwren
+Group jrwren

 # The following directives define some format nicknames for use with
 # a CustomLog directive (see below).
@@ -110,20 +110,20 @@


 # Global error log.
-ErrorLog /var/log/apache2/error.log
+ErrorLog var/log/apache2/error.log

 # Include module configuration:
-Include /etc/apache2/mods-enabled/*.load
-Include /etc/apache2/mods-enabled/*.conf
+Include mods-enabled/*.load
+Include mods-enabled/*.conf

 # Include all the user configurations:
-Include /etc/apache2/httpd.conf
+Include httpd.conf

 # Include ports listing
-Include /etc/apache2/ports.conf
+Include ports.conf

 # Include generic snippets of statements
-Include /etc/apache2/conf.d/[^.#]*
+Include conf.d/[^.#]*

 #Let's have some Icons, shall we?
 Alias /icons/ "/usr/share/apache2/icons/"
@@ -390,4 +390,4 @@
 #

 # Include the virtual host configurations:
-Include /etc/apache2/sites-enabled/[^.#]*
+Include sites-enabled/[^.#]*
diff -ru /etc/apache2/mods-available/proxy.conf etc/apache2/mods-available/proxy.conf
--- /etc/apache2/mods-available/proxy.conf      2006-01-07 05:51:10.000000000 -0800
+++ etc/apache2/mods-available/proxy.conf       2006-10-05 08:00:33.000000000 -0700
@@ -3,12 +3,13 @@
         #turning ProxyRequests on and allowing proxying from all may allow
         #spammers to use your proxy to send email.

-       ProxyRequests Off
+       ProxyRequests On

        
                Order deny,allow
                Deny from all
                #Allow from .your_domain.com
+               Allow from 127.0.0.1
        

        # Enable/disable the handling of HTTP/1.1 "Via:" headers.
diff -ru /etc/apache2/ports.conf etc/apache2/ports.conf
--- /etc/apache2/ports.conf     2006-07-26 12:15:44.000000000 -0700
+++ etc/apache2/ports.conf      2006-10-05 06:47:47.000000000 -0700
@@ -1,2 +1 @@
-Listen 80
-Listen 3080
+Listen 1080
diff -ru /etc/apache2/sites-available/default etc/apache2/sites-available/default
--- /etc/apache2/sites-available/default        2006-07-26 11:01:53.000000000 -0700
+++ etc/apache2/sites-available/default 2006-10-05 07:01:11.000000000 -0700
@@ -25,13 +25,13 @@
                Allow from all
        

-       ErrorLog /var/log/apache2/error.log
+       ErrorLog var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

-       CustomLog /var/log/apache2/access.log combined
+       CustomLog var/log/apache2/access.log combined
        ServerSignature On

     Alias /doc/ "/usr/share/doc/"

Beware that the cp command from before copies the symlinks and they still point to /etc, so you may need to recreate some symlinks in etc/apache/mods-enabled.

Now you should be able to just start apache.


$ apache2 -d etc/apache2 -f apache2.conf

The patch configured apache to run on port 1080, so now use ssh with -L 1080:localhost:1080 and point your http proxy to localhost:1080 and you can browse the web via the ssh connection, also utilizing the remote hosts DNS.

That public wifi point won’t see any of your web traffic, just the ssh connection.

We are not alone

WE ARE NOT ALONE! How would you feel if aliens landed at your local airport, just sat there for a couple of hours and then flew away? Just a hypothetical(of course), but how would you feel if it was 100% irrefutable proof? What if you witnessed it with your own eyes? How would you feel about our(humankind’s) place in the universe?

Ann Arbor Dot Net Developer group will be having a meeting on January 10th, but currently we are homeless! Our usual meeting location is under construction. We will be finalizing a meeting location very soon. I’ll let you know.

We have an awesome meeting topic. This description was stolen from Darrell Hawley‘s email.

Matt Winkler, Technical Evangelist for Windows
Workflow Foundation (WF), will be speaking at our next meeting on January
10. If you haven’t heard, WF is the programming model, engine and tools for
quickly building workflow enabled applications. WF radically enhances a
developer’s ability to model and support business processes. Sound
interesting? Make sure you don’t miss AADND on January 10th starting at 6:00
pm.

Matt Winkler is the Technical Evangelist for Windows Workflow. He was born
and raised in St. Louis, Missouri, home of Budweiser, the Cardinals and
toasted ravioli. After college at Denison University, he returned to work
for a consulting firm and a software development firm. For the last few
years he has been focused on integration and workflow technologies, so he’s
very excited about Windows Workflow, and looking forward to finding many
different cool uses for it.