Sean Lynch

March 13, 2010

Migrating to WordPress with URL Rewriting

Filed under: Uncategorized — Sean Lynch @ 11:38 pm

Recently I switched from using SubText to WordPress as my blog engine. The reason for the switch was to get access to all of the plug ins available, I could have added the functionality, but unfortunately I find myself a bit time starved as of late.

In order to prevent all of my old permalinks links from breaking, while moving from a /year/month/day/postname format to simply having postname as the url, I am using IIS7′s URL Rewriting Module. It turned out to be quite simple to do this, and here are the entries that change the requests to the new Url Scheme:

<rule name="Aspx" enabled="false" stopProcessing="true">
<match url="archive/[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]/([A-Za-z0-9\-_.]+).aspx" />
<conditions logicalGrouping="MatchAny" />
<action type="Redirect" url="http://sean-lynch.net/{R:1}" />
</rule>
<rule name="Rss" enabled="false" stopProcessing="true">
<match url="rss.aspx" />
<conditions logicalGrouping="MatchAny" />
<action type="Redirect" url="/feed" redirectType="Permanent" />
</rule>

This has been working well, the only issue that I have run into so far is that categories in subtext were marked with numbers by default, and google’s crawler is finding them as broken links. I haven’t decided how to handle these links yet.

Reblog this post [with Zemanta]
<rule name=”RemovedDefault” enabled=”false” stopProcessing=”true”>
<match url=”(.+)default.aspx” />
<conditions logicalGrouping=”MatchAny”>
<add input=”{URL}” pattern=”default.aspx” />
</conditions>
<action type=”Redirect” url=”http://sean-lynch.net/{R:1}” />
</rule>

March 18, 2008

.Net based SVN client library

Filed under: Uncategorized — Sean Lynch @ 1:30 am

As an exercise to figure out socket programming I have been messing around with creating an SVN client library to use with DevExamples.com, well actually a generic SC client library that would allow me to change what repository site I was working against, SVN just seemed like the simplest of them at the moment.

However, after thinking about it, I think it would be better to use one that is already built if possible. I just have not been able to find a pure .Net client library. It is also seems rare for a source control library to work without a working folder, which is somewhat limiting when I want to check the propagation of examples using this method on the same machine.

Though I think it would be interesting to write a LINQ to Source provider, as a way to learn expression trees better. Plus it would be nice to be able to not only easily switch hosting providers (the reason I am looking for a pure .Net library) but also to have a standard syntax to allow me to easily switch from SVN to SourceGear’s Vault (which I use for my personal development projects) to TFS (which we use at work) as the storage system for the examples.

Though SvnBridge could possibly help with that too.

Technorati Tags: ,,,

Being blocked by internal/private

Filed under: Uncategorized — Sean Lynch @ 12:54 am

I ran into a situation that reminded me of Steam Harman’s post about A New Year’s Resolution for Developers in which he states that by default methods should be public and virtual unless there is a good reason not to.

This started when after I decided I was missing functionality like RegisterClientScriptBlock, allowing me to add a client script only if one of the controls needs it, along with only adding it once. I was also missing the ability to use designers.

To this end, I decided I was going to make a simple server control library with server controls that would provide the functionality found in the MVCToolkit Html extension methods. I also figured it would be nice if I could allow them to function in WebForms as well, if they are on a runat server form tag.

After a while I found the VerifyRenderingInServerForm method on the Page, which seemed to be the only method available for this. Unfortunately while I can override this method after loading up reflector to see how the base Page was determining that the control is in a form tag, I found that I could only do it with a try/catch around base.VerifyRenderingInServerForm.

While I don’t really have much of a problem doing this, there is a little bit of nagging in the back of my head over the fact that the Page class contains a method called IsInOnFormRender, which has exactly the information I want. Unfortunately this property is internal, preventing me from retrieving efficiently retrieving this information.

The other problem I find with this is that these server controls would need to run on a special page in order to have the desired functionality, have each of the controls that while have the functionality do the try/catch on VerifyRenderingInServerForm, or use reflection to get access to that variable. None of which are particularly optimal.

On a side note, I wish I had found this method when I years ago when I was writing the controls of the framework we use at work. Since I could not have our controls running within a runat server form tag because we submit the data through an IFrame, overriding VerifyRenderingInServerForm would have allowed me to stop them from throwing the error.

Technorati Tags: ,

A few simple MVC control suggestions

Filed under: Uncategorized — Sean Lynch @ 12:49 am

I finally got around to updating the website to the MVC preview 2, and ran into a couple of things.

  1. TagBuilder being internal. While the implementation of it CreateInputTag, CreateTag and CreateAttributeList. The removal of .ToAttributeList() was actually what made me go looking for this. The HtmlExtensionUtility extension methods would have been nice to have also.

    I guess a better way to say it is it would be nice not to have to reimplement the functionality that CreateAttributeList and ConvertObjectToAttributeList already implement.

  2. It would be nice if SimpleForm inherited from a class, that could be subclassed to make Div and Span tags that have attributes based on routing information.

    Admittedly it is a rather simple to implement what I am talking about but I think it would be nice to have already there.

 

I’m still rummaging through the routing stuff, so don’t have to much input on those it at the moment. But it looks like I will be able to take all the category discovery information out of my controllers, and just have it passed into the action, which will be nice.

On a side note, after looking at the classes that were made into base classes. I cant really say that I would ever have a need for them to be interfaces. As I can’t think of any other class I would want to tack their functionality onto, after all interfaces were the answer to not having multiple inheritance (I still wish I had it multi-inheritance though).

I do however hope that IRouteHandler stays an interface though, because I can see myself taking that behavior onto an object. Just not sure where.

Technorati Tags:

September 10, 2007

Committing to subtext, blog/domain aliases

Filed under: Uncategorized — Sean Lynch @ 2:23 am

Well, I got my first major feature for Subtext done, blog/domain aliases for the blog, but I find myself hesitant to click commit. Its not that I doubt it works, it is currently running on my blog right now. I just don’t feel comfortable checking in code that I can’t respond to problems with for about 19 hours, and would hate to really foobar stuff so soon after getting commit access ;) .

After I do check it in, something along the lines this will be showing in the host admin:

image

This works a lot like the www prefix currently does.

So I’ve decided to wait till tomorrow after work to commit. Will likely type of some what I learned type of post too, mostly to get in the habit.

Powered by WordPress