Skip navigation

I have been simply trying to find out what the cost of a Comcast, Internet-only, package would be for a good 30 minutes now. I find it quite interesting that they would make the decision to more-or-less hide information from existing customers trying to find pricing for their services. I remember before they did the re-design, I was able to find pricing information on their services, narrowed down to my area, and compare everything in a nice matrix…So, it was all in plain site before, and now it’s almost impossible to find? Kind of odd…

After doing some digging, and running my browser through a few different proxy servers, I’ve found that they are not allowing customers who are coming from an existing Comcast connection to view the pricing information for anything up-front, but rather will only show them pricing if they attempt to add a service to an existing account. They also don’t allow you to “downgrade” a package online either once you’re in this part of the site, which is quite funny since you can definitely “upgrade” said packages. (I also tested signed-in vs. signed-out vs. clearing cookies, cache, restarted browser, etc. to make sure they couldn’t know who I was before-hand as well)

To me this wreaks of a poor way of trying to not only hide factual pricing information from customers so they can’t compare pricing to the other competitors, but also getting people “just far enough along” that they’ll have to call  Customer Support to wrap things up, and in-turn have a chance to attempt an up-sell for a bunch of different packages (phone, then cable, then home security, then internet security, etc.) and wasting the customer’s time since they already know what they’re calling for at this point.

Could be poor web design, could be a bad business decision, could be both, who knows…I’ll let the people reading this decide.

I just wanted to share a workaround I found in dojo 1.6 for the uploader. My page is pretty complex in that it has a bunch of nested border containers and a tab container within a border container. The way I was including it in my template was like this:

 <input data-dojo-type="dojox.form.Uploader" data-dojo-props="label: 'Select a File'" data-dojo-attach-point="uploadNode" />

When I included the Uploader as a part of the template for one of my widgets, some odd things were happening. First off, the button was sized very oddly. It was taking up the entire width of the screen. Also, in flash mode (IE), clicking on the button did nothing. After playing around with it for a few hours, I decided to try adding the widget during the startup event of my widget like so:


    this.uploader = new dojox.form.Uploader({ 
        url: admin.rootUrl + "admin/cmsResource/uploadFile", 
        multiple: false, 
        label: "Select..." 
    });

    this.uploadContainerNode.appendChild(this.uploader.domNode);

This has solved the problem, now the uploader is sized properly and works just fine in IE!

Once again, I’m apparently working in uncharted territory for the Dojo framework. I am working on a rich application that uses a Tree View to navigate certain data. When a user makes changes, the tree needs to update itself. In previous applications I’ve resorted to refreshing the entire tree due to the fact that the dijit.Tree is not very developer friendly. It is difficult to set up in the first place due to lack of documentation. This time however, I decided to dive into the code and figure out how to refresh only certain nodes in the tree. Here is what I found, it is pretty straight forward:

dojo.provide("my.ContentTreeNode");

dojo.require("dijit.Tree");

dojo.declare("my.ContentTreeNode", [dijit._TreeNode], {

	_setIconClassAttr: function(iconClass) {
		dojo.query("> .dijitTreeRow > .dijitTreeContent > .dijitIcon", this.domNode).attr("class", "dijitIcon dijitTreeIcon " + iconClass);
	},

	updateChildItems: function(items) {
		this.clearChildren();
		// set the child items of the node
		this.setChildItems(items);

		this.tree._expandNode(this, true);
	},

	clearChildren: function() {
		var childNodes = this.getChildren();

		dojo.forEach(childNodes, function(childNode) {
			// remove the node from the tree's item node map
			delete this.tree._itemNodesMap[this.tree.model.getIdentity(childNode.item)];
			// remove each node
			this.removeChild(childNode);
		}, this);
	}

});

As you can see, I extended dijit._TreeNode in order to add a few methods.
In order to use this tree node, you’ll also have to extend the dijit.Tree:

dojo.provide("MyContentTree");

dojo.require("dijit.Tree");
dojo.require("my.ContentTreeNode");

dojo.declare("my.ContentTree", [ dijit.Tree ], {
	_createTreeNode: function(args) {
		return new my.ContentTreeNode(args);
	}
});

I just thought I’d share this since Dojo’s documentation is lacking useful information. It seems like no matter how many documentation websites the guys at Dojo create, they never fully document everything. Here is a perfect example. I couldn’t for the life of me find out how to programatically create a dijit.PopupMenuItem. Through trial and error I figured this out:

var menuItem = new dijit.PopupMenuItem({
	label: "My Item",
	iconClass: "myIconClass",
	popup: new dijit.Menu()
});

The key being the popup property. If you don’t initialize the popup property with an instance of a new dijit.Menu, the whole thing doesn’t work. You can then use menuItem.popup.addChild(…) to add new menu items to the popup menu item.

I found a way to disable the infinitely annoying web development server that pops up for those of us who use IIS to develop ASP.NET applications. I often attach to the w3wp.exe process in order to debug my MVC controllers and whatnot and I always get a million little tray icons for the stupid web development server.

Now, I’m sure many people know you can click into the properties of each individual web application and set the project to run in IIS, or a custom web server. If you configure a project so that visual studio knows it’s an IIS application, visual studio becomes even more annoying. If you open a project that hasn’t been mapped in IIS it will bug you until you do it, and if you don’t the project will be unloaded. I say, screw you Microsoft, let me do my job. I know what I’m doing.

Now that I’ve gotten the rant out of the way, on to the solution. All you have to do is:

  1. Select all of the web projects in your solution.
  2. Open the properties pane if you don’t already have it open.
  3. Change the option “Always Start When Debugging” to false.

That’s it, say goodbye to 15 million development server icons in your tray.

I just wanted to quickly throw this out there because I had a really hard time finding any information out there on this issue.  The scenario I have is a base abstract class which contains a handful of properties.  There are three types which extend this class and add their own relationships.

The problem I ran into is that by default the auto mapper for Fluent automatically uses the type names as the discriminator to determine which type should be loaded.  What this means is the column in the database must be a varchar.  I think it is pretty obnoxious to have the full type of your class in every single row.  What I want is to use an enum to determine which type is used, and have it stored as an integer in the database.  You’d think this would be a pretty simple and well documented use case; it is not.

First off, you’ll need to create an auto mapping override for the parent class:

public class ParentMap : IAutoMappingOverride {
    public void Override(AutoMapping mapping) {
        mapping.DiscriminateSubClassesOnColumn("Type", 0);
    }
}

Regardless, I figured out how to do what I wanted to do.  In your auto mapping configuration class, you’ll need to tell the auto mapper to ignore the types which extend the abstract base class, like so:

public override bool ShouldMap(System.Type type) {
	return type != typeof(ChildType1) && type != typeof(ChildType2) && type != typeof(ChildType3);
}

Next, you need to create your own SubclassMap which manually maps all of the properties specific to the child class. Just to be clear, you do not have to map any of the properties defined in the parent class. These properties should be handled by the auto mapper (and if you need to modify the mappings you should create an Auto Mapping Override.

class ChildType1Map : SubclassMap {
    public ChildType1Map() {
        this.DiscriminatorValue((int)MyEnum.ChildType1);
        this.References(x => x.AnotherThing);
        this.Map(x => x.Name);
    }
}

The important part here is the call to DiscriminatorValue. This is where you instruct NHibernate what the value of the discriminator column will be for this type. Do the same for your other entities that extend the parent class. In order to get Fluent to pick up on these mapping files you’ll need to register them in your AutoPersistenceModel:

model.Add(typeof(ResourceFolderMap));

That should be all it takes. Hopefully this saves someone the hours I spent researching this.

For whatever reason…the GNOME people decided that menu / button icons were a usability problem.  I feel the opposite way.  I think the menu / button icons are absolutely a must have for usability. Icons make certain menu items stand out immediately.  The interface tab has now disappeared from the Appearance app in GNOME which means you have to manually enable the options to display icons.  This is easily done, just run gconf-editor in either the terminal or if you’re smart you have Gnome Do.

Once you’re there, navigate to Desktop -> Gnome -> Interface.  Check off buttons_have_icons and menus_have_icons.  These settings take effect as soon as you check off the options.  Enjoy.

I have been working with LINQ quite a bit for a contract I am working on.  And I have to say I’m not impressed.  I think Microsoft has continued to make poor decisions with the .NET framework.  Although I like the idea of a simple to use query language / ORM (Entity Framework), there are a number of problems.

  • The documentation is absolutely horrible.
  • It can be rather difficult to get the query language to do what you want it to do.
  • Exception messages are misleading and not informative.

I am originally a .NET guy.  I started my professional career working with C# and I really liked it.  Recently, I made the switch over to Java.  I liked the idea of Java because there is such a great open source community that has turned out a lot of really excellent and re-usable code.  In the open source community, the documentation is, in general, excellent.  Microsoft’s documentation has always been piss poor because how else would the publishers sell books?  In open source world, there are books available, but the documentation is usually sufficient.

I have run into a number of situations where the query language is very difficult to work with.  Specifically with reporting type queries where you’re getting into sub-selects.  Again, if the documentation were better I probably would have found a decent solution to my problem quickly.

My biggest trouble with the whole thing is when there is a problem and an exception is thrown, the messages are horrible.  For instance, I created a quick class to import some data from tab delimited files.  I set up some new data models and created my tables.  I gave the code a shot and I received an exception with this vague message: “System.Data.Linq.ChangeConflictException: Row not found or changed”.  All I can think of is “PC Load Letter, WTF does that mean?”  It turned out that one of my columns in the model design didn’t have the same data type as the column in the database.  Come on M$, how does that message make sense for that problem?  If it weren’t for someone else having that same problem in a forum, I could have lost HOURS hunting around trying to figure that out.

Again, I am a Java guy.  I am used to Hibernate which has been around for a while and is rock solid.  I feel like the open source community comes up with much better solutions compared to Microsoft.  Everything they do is always very specific, always a black box with very little insight, and generally has all kinds of annoyances that make the thing a pain to work with.

EDIT: Another thing…there is no way to batch insert.  Inserting seems to take far longer than it should…something that would take mere minutes with Hibernate / MySQL is going on an hour with LINQ / SQL 2005.

System.Data.Linq.ChangeConflictException: Row not found or changed

While we’re waiting for Firefox 4.0, which will bring significantly better compatibility with Windows 7, the Strata40 theme combined with StrataBuddy will make your Firefox 3.5/3.6 look pretty with Aero.  It is the best theme available for the current version of Firefox in my opinion.  StrataBuddy lets you customize the theme to your liking.  Check out the screenshot below.  Links are posted below the image.

The Strata40 theme makes Firefox look pretty on Windows 7!

Strata40 on Windows 7

Get the Strata40 theme

Get the StrataBuddy plugin

P.S. I didn’t mention Vista because Vista is CRAP.

I recently added functionality to the CMS I’ve been working on for my company.  It allows us to enter GSP tags into the content that is being posted to our Grails website.  These tags would then be properly rendered through Grails.

After searching around for hours, I thought I had found a solution to pass a string through the grails template engine:

new GroovyPagesTemplateEngine().createTemplate(attrs.templateString, “somepage.gsp”).make(attrs.model).writeTo(out)

This works great for our ${} style tags, however it does not work for anything in a tag library.  Again, I went to google and I could not find anything!  Finally, I found an obscure post describing how to build e-mails using GSP.  There isn’t any explanation as to how the template engine is acquired, but it seems to work.  In your tag lib, or controller create a member variable:

GroovyPagesTemplateEngine groovyPagesTemplateEngine

It seams as though you have to name it exactly as it is above.  You can then call the same method as before:

groovyPagesTemplateEngine.createTemplate(attrs.templateString, “somepage.gsp”).make(attrs.model).writeTo(out)

And bam, all of your tag libs are referenced properly!  Also, you can put whatever you want in “somepage.gsp”.  It doesn’t seem to matter.  However, I would assume for performance purposes, if the template is expected to be the same, make sure the page name is the same (so that grails can do its internal caching magic).