Archives for the Month of June, 2006

Wordpress Additional Backslash Shows Up

If you’re finding code within PRE tags are getting additional backslashes, this following post by mlambie may help out:

At the risk of being pedantic, the code [in wpautop()] should read:

$pee = preg_replace(
‘!(<pre.*?>)(.*?)</pre>!ise’, ” stripslashes(’$1′)
. stripslashes(clean_pre(’$2′))
. ‘</pre>’ “, $pee);

Thanks mlambie!

Lisp Usenet (almost) Wipes Newbie’s HD

What a contrast between lisp forums and python forums. Check out the following usenet thread.
A newbie after learning how to hello world in lisp, is given a snippet with the equivalent of “rm -rf /*” as a solution after posting a legitimate question on comp.lang.lisp.
View thread on google groups.

(defun reset-cluser ()
“Delete [...]

Virtualization with Parallels

Phil Windley revies Parallels and mentions that “Virtualization will become part of our everyday lives”. I tend to view virtualization on the desktop as a necessary evil rather than being a good thing on its own.
I had to use a colleagues desktop, running Linux with a Windows running in VMWare which then had a [...]

JRuby on Rails

This piece of news about JRuby on Rails ought to make James McGovern sit up.
Incidentally, I have been experimenting with a Rails clone in PHP called Cake PHP. It was pleasant, and remarkably close to Rails. Given how widely PHP is supported in the web hosting world, Cake seems to give a PHP developer a [...]

Writing Good Check-In Comments

from http://software.jessies.org/scm/
Here’s a checklist of things you should try to get into a habit of going through in your mind as you write a check-in comment:

Bug/defect number - if you have a bug database, reference it. There’s likely to be plenty of extra information/dialog in there that shouldn’t go to waste. This is why SCM [...]

Revenge, Sweet Revenge

Scanned in newscopy of a police who caught someone speeding.

ASP.net GridView Shortcut

When dealing with Strongly Typed datasets on the ASP.net GridView 2.0, I found myself writing one too many lines of code like this:

<asp:TemplateField HeaderText="Category">
<ItemTemplate>
<%# DataBinder.Eval(
((System.Data.DataRowView) Container.DataItem).Row,
"CategoryRow.CategoryName") %>
</ItemTemplate>
<asp:TemplateField>

Solution?

<asp:TemplateField HeaderText="Category">
<ItemTemplate>
<%# EvalEx(Container.DataItem, "CategoryRow.CategoryName") %>
</ItemTemplate>
<asp:TemplateField>

protected object EvalEx(object DataItem, string [...]

Don’t Fight the .Net GridView

The .Net GridView prefers to work through DataSources. I tried to use old style Fill dataset, then DataBind() and it simply doesn’t play well with Editing.
In addition, the ObjectDataSource.DataObjectTypeName is riculously underpowered. This version doesn’t get types of inner classes. It uses System.Web.Compilation.BuildManager.GetType instead of System.Type.GetType.

System.Type.GetType("MyStronglyTypedDataSet.MyTableRow"); // works
System.Web.Compilation.BuildManager.GetType("MyStronglyTypedDataSet.MyTableRow", true); // fails

Update 1 : Inner [...]