ASP.NET Server Tags

There are a number of different server tags (<%, <%#, <%$, <%@, <%=) which each mean different things.

This article goes into a little depth talking about each of these tags.

The one I never use, is <%$, which I learned is for displaying expressions, but you can also easily write your own expression provider by extending the expressionbuilder class.  An example of doing so can be found here.

Pretty cool.

VS.Net Go To Implementation

Visual Studio has a nice “Go to definition” shortcut, but with our MVP pattern we are doing a lot of work against interfaces, which means that quite often going to definition actually takes us to a method in an interface.  For example:

Dim e As IEmployee = New Employee(1234)
Call e.GiveRaise(1.05)

If you did “Go to Definition” on “GiveRaise” you would not end up in the Employee class, but rather than IEmployee interface.

This plugin helps fix that problem.

I ended up skipping that part where he sets up the keyboard shortcut in favor of just using right click, but if you want to set that up you might find that the menu item he talks about is missing.  To get that dialog to show up use the keyboard shortcut CTRL+ALT+SHIFT+O.

 

OpenOfficespace.com

Companies that have unused office space can sublet it to individuals or other small group swho need an office but can’t afford the full deal.

It’s great for independent contractors who want to have an office outside of their house.

http://openofficespace.com attempts to make these arrangements (and other more standard office space) easy to list/find.  While it “kinda” worked for me, the implementation is really lacking.  Lots of the results that came back were not in the specified area radius and some that WERE were not shown until I modified my location.

People listing $0/month is also quite useless for people who don’t want to have to call the agent to find out that actual asking price.

But still, probably a useful resource.

Threaded Comments Database Schema

Interesting post on how to use a different schema strategy for nested comments that doesn’t involve a recursive hierarchy:

http://stackoverflow.com/questions/3763273/asp-net-threaded-comments

———————–

One approach I remember seeing somewhere was rather than using a Comment ID and a Parent ID , comments had a Comment ID and a “sort key” which was a concatenation of all the Comment IDs of their ancestors.

E.g. If comment 1 had two replies, comments 2 and 3, the sort keys would be:

1 : 0001
2 : 0001.0002
3 : 0001.0003

Then if someone replied to comment 2, it would be..

4 : 0001.0002.0004

So if you select all comments and sort by this sort key, they’ll fall out in the right order.

Then, to do the indenting, you simply look at the length of the sort key to see how many levels deep the comment is, and indent an appropriate amount.

Adding comments is easy: the sort key of the new comment is simply it’s parent’s sort key, with its own ID added on to the end.

———————–

Obviously you’d have to pad the ID values sufficiently.  In addition, if you wanted to just show comment 12345 and all children, you could just display the thread where code like ‘%00012345%’.

Aligning TABLE inside TDs

I inherited a web app that has a structure like this:
table
  tr
     td
     td
     td
        table

The last table in that list was supposed to be right align, but no modifications to it’s TD parent will change that.  You can’t use align=”right” or text-align:right.

You need to use align=”right” on the TABLE that you want to be right aligned, not on its TD parent.

I know this is a bad idea as CSS is much better for aligning elements instead of nesting tables, but in this case I’m not going to rewrite the whole app layout for 1 thing.