Syntax Highlighting under BlogEngine.NET

 

On Sharp Fellows we are currently using a variety of ways to post code to the blog. After evaluating a few different ways my preferred way is using Alex Gorbatchevs Syntax Highlighter.

A nice and easy way to integrate this with BlogEngine.NET is to use a lovely extension written by David Pokluda called SourceCodePlugin. The instructions posted on the main page are great and installation is a breeze, I had it working with BlogEngine within minutes.

The bundled Live Writer plug-in which comes with SourceCodePlugin is quite functional, however I prefer the one provided by Anthony Bouch called PreCode Snippet. It has a nice UI which exposes all the functionality which I’ve needed from Syntax Highlighter and puts it in a convenient location on the Live Writer edit bar.

image

The Fix Indentation feature is particularly helpful when copying fragments of nested code from Visual Studio.

Happy Blogging.

Slower than Reflection: Take Two

This is a hugely belated reply to: http://kozmic.pl/archive/2008/10/13/slower-than-reflection-meet-stacktrace.aspx

I’m looking to perform some instrumentation on some already compiled code, and part of that involves getting a handle to a previous method. I wondered how slow accessing this through the StackTrace would actually be, and it turns out to be too slow according to that article.

I was hoping that Kozmic’s approach to getting the entire stack trace before filtering was causing the massive performance hit, so I did some benchmarks of my own…

Profile(() => new System.Diagnostics.StackTrace(false).GetFrame(1).GetMethod(), "Unfiltered StackFrame");

Profile(() => new StackFrame(1, false).GetMethod(), "Filtered StackFrame");

 

The unfiltered version is comparable to Kozmic’s example, and the filtered example is supposed to be more performant as we don’t need the entire stack trace. But the question is, “Is it faster?”. Let’s see:

image

(Results in milliseconds)

Yes it is!  However, quite unfortunately it is still not performant enough for my purposes. If you want to try out your own benchmarks the code is: http://bitbucket.org/naeem.khedarun/stacktrace.experiments/

Session downloader for MIX 2010

I’ve rehashed the session downloader to be able to download the Mix 2010 sessions just gone by.

Thanks to Marcin Kaluza for helping out and giving the application some much needed design love.

image

As usual you can pick up the source at bitbucket: http://bitbucket.org/naeem.khedarun/fancypcddownloader2009/

And the download is now available via click-once: http://sharpfellows.com/SessionDownloader/publish.htm

Please let me know if you have any trouble with the application!

A really inspirational project

Personally I have never been strong at communication, and as a demographic programmers probably share this as a failing.

Recently I was rolled of a project which I was part of for a year, where I learned just how important communication and knowledge sharing is between peers, a big enough lesson for me to attempt to maintain a blog (three previous failed attempts).

Our medium for knowledge sharing was rather retro: emails. But we've learned is that what works - works. Theres no point trying to setup a forum or Wiki if no-one has the patience to use it, with real importance given to activity and participation. The atmosphere and attitude in the email threads we're motivating, inspiring and copious amounts of fun :-)

There's a satisfaction in sharing knowledge, helping others, and hopefully for having a platform to receive feedback from others, so:

My reasons for this blog?

  • Personal dumping ground of information I would like to archive.
  • Keep my peers better updated in what I'm doing.
  • Give Google a chance to index some potential useful information for other coders.
  • Satisfaction in contributing to the blogging community.

It is true that I could maintain a personal Wiki to dump my own useful information and use emails to keep peers updated, but I'm far too lazy (I'm sure you understand) to have to deal with more than one medium.

Why did I write this post? Mainly so I know why I'm maintaining this blog...

Newer Posts Older Posts