Jeff Perrin :: Archives for August, 2005

It’s Funny ‘Cause It’s True

Wednesday, August 31st, 2005

The last time I talked to a goat, he like totally sounded exactly like this…

I’ve tried about enough of the grass around here to last me a while. I’m sick of this grass. This damned same grass day in and day out, I could just about… I take that back. This grass is okay. I’ll eat it. It’s pretty good. It’s great, actually. I mean, it’s okay. Could you grab me a handful of weeds from the ditch? Don’t bother shaking off the dirt! That’s a waste of time! Just bring it over as is. Wave that near my mouth and it’s going down the belly hatch. I am not joking. I’ll eat weeds. Just watch me. You give me a rotten apple, and I will eat that whole thing, seeds and all. Tear off a piece of bark for me, and it’s gone.

Estimating Tasks in Software Development

Friday, August 12th, 2005

Chaz gives one of the lucid explanations on why estimating software delivery times is so hard. It’s one of the most concise explanations on the subject I’ve ever read.

“Hire somebody who you can trust to give you a good estimate. Then, if they learn something new and change the estimate, trust them again.”

Javascript Syntax Highlighting

Tuesday, August 2nd, 2005

A few months ago I toyed with the idea of doing syntax highlighting with javascript. I’m sure there’s several published solutions out there that do the same thing, but I figured I’d give it a go myself, mainly to practice up on my meagre javascript skills. I set out with the following goals:

  1. Highlight the code in a completely unobtrusive manner.
  2. Use absolutely no inline markup.

Basically, I wanted to be able to paste in the following markup…

<code class="csharp">
	private void Page_Load(object sender, System.EventArgs e)
	{
		 LoadEntity();
	}

	private void LoadEntity()
	{
		 User user = new User();

		 /*
			  Get the id of the entity from the request
		 */
		 if( this.RequestedEntityID > 0 )
		 {
			   user.ID = this.RequestedEntityID;
			   BrokerFactory.Fill( user );
		 }

		 //Load the appropriate view
		 EntityControl cont =
			(EntityControl)LoadControl( "EditStaff.ascx" );

		 cont.BoundEntity = user;
		 this.phEntity.Controls.Add( cont );
	}
</code>

…and have the syntax highlighting just work. I currently have
some test code that
is partly working (although not in IE, there seems to be a problem with setting the text to be pre-formatted).
View the source to see what I’m up to. It should be easy to extend it to check for the type
of highlighting that’s required based on the class of the code tag.

In closing, my main reason for posting this is that I’d like to see this working,
but just don’t have the time or energy to finish it off in the near future. So if anyone knows of
an existing solution that works in the same way, or wants to continue on with this implementation, feel free to
let me know.