Shoebox Computing

As I’ve stated elsewhere the name iLude came from a time when I installed a linux computer in my 1995 Honda Prelude. I used this computer for playing mp3’s and other geeky things that allowed me to vent some creativity.

Anyway that system was powered by a mini-itx board. I recently repurposed that board as the webserver for this site. Unfortunately that was short lived as the filter capacitors on the board had apparently dried out and they blew. Amazingly the system still ran but would become unstable after a time( shocking I know ).

So I replaced the board with a new Foxconn itx board. And installed it in a new “case”. Behold the shoebox server:
IMG_0111 IMG_0112

Monday, October 18th, 2010 Personal No Comments

Returning every document of a Type from RavenDB

Running with Scissors

I have recently been working on a new idea and made the choice to use RavenDB for my persistent storage. For the most part its working out well. But I’ve run into two issues. The first I’ll hopefully deal with in a later post but the other was a real pain in my butt. Raven limits the returned query result sets to 128 documents regardless of how many documents match the query. Now Ayende claims that this is a good thing. I disagree and I’m not the only one. Yes you can override it….somehow, but knowing that this behavior exists and how to change it would need to be documented. I couldn’t find it after looking for a few hours and I’m more interesting in writing my software not fixing someone else’s.  I hope that Ayende and his team will address the documentation issue soon.

In my case I want to do some batch processing and need all the documents of a type and I don’t want to jump through flaming hoops to get them.  So here’s the extension method I came up with to solve my issue.

public static class RavenExtensions {

    public static IEnumerable<T> LoadAll<T>(this IDocumentSession session) {

      var count = 0;

      IDocumentQuery<T> results;

      do {

        var ofTypeT = string.Format("Tag:[[{0}]]", ReflectionUtil.GetFullNameWithoutVersionInformation(typeof(T)));

        results = session.LuceneQuery<T>().Where(ofTypeT).Skip(count).WaitForNonStaleResults();

        foreach (var result in results) {

          count++;

          yield return result;

        }

      } while (results.QueryResult.TotalResults > count);

    }

  }

This gives us a new session method that we return all of the documents when enumerated, but still obeys the small result set constraint enforced by the server.

I’ll wrap this up by saying that this method is for very specific uses. Ayende is correct that there are many problems that are the result of unbounded result sets. But I do not agree that the client API should make it more difficult that needed to do a common operation. I’ll leave you with this final link to a post that makes the same point.

Sunday, October 17th, 2010 Coding 1 Comment

Links to Command and Query Responsibility Segregation (CQRS) Pattern Code and Discussions

In my quest to get a better understanding what the heck Greg Young and Udi Dahan are talking about I’ve been on a search to find examples of how people are actually implementing these patterns.

› Continue reading

Tuesday, February 23rd, 2010 Coding 3 Comments

New Year, New Challenges

Just a short personal post.  Its a new year and I’m facing some new self created challenges.

bathtime

     My first child arrived at the end of November to change my life and steal my heart. And although taking care of her and mom occupies a lot of my time. I still want to make time to get more posts up this year.

     So thanks for stopping by and I hope I have something to share this year that is helpful, entertaining and at least a bit educational.

Monday, January 18th, 2010 Personal No Comments

Thoughts on Messaging and MVC

When I start to learn a new style of programming I like to experiment by creating my own versions of things. This has lead to writing my own ORM framework and Mime parser just to name a few of my coding accomplishments for which I pride my self. Writing each was a valuable learning experience that allowed me a much better understanding of similar software systems. › Continue reading

Saturday, July 25th, 2009 Coding, MVC 3 Comments

Dropdown Menus of Simplicity

One of those things that I’m often asked for by clients is “Can we have a drop down menu across the top?” To which I answer “Sure!”. And then once I start trying to work their look and feel into some jquery, javascript and CSS menuing plug-in I suddenly recall that I hate mutating someone else’s mess of html, css and javascript into something that still works across all the browsers and looks like what the client wants. YUCK!

› Continue reading

Thursday, April 30th, 2009 Coding 2 Comments

What’s in your wallet? – Part 2

I felt I should follow up on my post from yesterday. First I want to say that I’m not trying to bash Jeff or otherwise rub his nose in it. Jeff has stated that he learns best from the “Smackdown“. And I’m nothing if not confrontational :-)

As I stated, my first dealings with Ayende were back around 2003 or so when the company I worked for tasked me with developing a new webmail program. The previous version had been written in java and functioned but lacked many features that our customers were asking for. At the time the company had the grand idea of the “standard language”, and following the “no one ever got fired for buying Microsoft” logic mandated that C# was to be that language.

One of the major hurdles I ran into was the lack of a performant pop3/mime library. Many were tried but most relied on regular expressions to parse the messages and this would bring the server to its knees if more than one or two users attempted to open their mailbox at the same time. So off I went to write a mime parser. › Continue reading

Sunday, March 1st, 2009 Coding 1 Comment

What’s in your wallet?

I’ve refrained from posting on the stir that occurred after Stack Overflow #38. I’m firmly on the side of the apparent “SOLID“-nista’s. The reasons for this is that learning and applying them has made me a better programmer. I’ve used TDD and SOLID principles on large codebases and found that this has allowed significant changes and evolutions to happen to these libraries and have them rolled out into numerous separate projects with absolutely no issues. Why? Because there are several hundred tests surrounding each of these projects. And the use of the SOLID principles has allowed me to swap out large sections of code with better implementations and add new functionality with little effort thanks to the reduced dependencies. › Continue reading

Saturday, February 28th, 2009 Coding 3 Comments

Custom LINQ Operator?

K. Scott Allen has a great post up titled Why Would I Create A Custom LINQ Operator? I figured I’d add my minor addition to the discussion.

public static bool Contains<T>(this IEnumerable<T> enumerator, Predicate<T> predicate)
{
    if(enumerator == null)
        throw new ArgumentNullException("enumerator");
    if(predicate == null)
        throw new ArgumentNullException("predicate");
    foreach(T item in enumerator)
    {
        if(predicate(item))
            return true;
    }
    return false;
}

 

This allows you to do this:

if(tags.Contains(x => x.Name == "Coolest Blog Ever")) {
    // we found a matching tag
}
else {
    // no tag found :-( 
}

 

Nothing special I know, but hopefully it helps someone out.

Saturday, February 14th, 2009 Coding 3 Comments

Refactoring the ASP.NET MVC project template – Part 4

I wasn’t planning on continuing this series until I’d had a chance to play with the new RC1 release of the MVC framework, but Phil Haack has a post up that I’d like to touch on. To summarize with the latest release the MVC team has added a ContentPlaceHolder to the head section of the Site.Master file. This is a good thing and has been recommended by others as an excellent way to control the page title, scripts and css files from within your views. The issue is that the head tag has the runat=”server” attribute. So while the page is being rendered by the server the view engine parses this tag and runs some asp.net code to “help” you.  In this case one thing it helps you with is adding a title tag if you didn’t provide one. If you construct your head section improperly you end up getting an error :

› Continue reading

Wednesday, January 28th, 2009 Coding, MVC No Comments
Blog WebMastered by All in One Webmaster.

WP SlimStat