Regular Expressions for Subversion keywords
Subversion March 28th, 2012
Here are different Regular Expressions to identify the common (to me at least), the Subversion keyword: $Id$ on different type of files (depending on how the comments go).
This one is for languages derived from C (like C++, C#, PHP, Java, JavaScript):
// \$Id\: [A-Za-z0-9\ \:\.\-\_]* \$
It will match something like:
// $Id: filename 3 2010-06-23 15:48:28Z username $
This one also for languages like C, but also, CSS:
/\* \$Id\: [A-Za-z0-9\ \:\.\-\_]* \$ \*/
It will match something like this:
/* $Id: filename 3 2010-06-23 15:48:28Z username $ */This one for Velocity files (as I’m using Castle MonoRail with NVelocity):
\#\# \$Id\: [A-Za-z0-9\ \:\.\-\_]* \$
That will match:
## $Id: filename 3 2010-06-23 15:48:28Z username $
So now, with these expressions, you can do some things like remove them from your code (if you are like me and are moving to Git).
Tags: C#, Castle, CSS, Git, JavaScript, regexp, Subversion, SVN
SQL Server’s nvarchar(max) on Castle ActiveRecord
Programming, SQL May 6th, 2009
I’m using the new SQL Server 2005′s data type nvarchar(max) on a .Net project (ntext has been deprecated in this version) in conjuction with Castle ActiveRecord. For a complete integration (including schema creation), ActiveRecord property should looks like this:
[Property("description", ColumnType = "StringClob", SqlType = "nvarchar(MAX)")]
ColumnType = “StringClob” avoids text to be truncated if it gets too long. SqlType = “nvarchar(MAX)” forces the field to be created as that data type, otherwise, it will be created as nvarchar(255).
A more detailed explanation can be found here and here.
Tags: .Net, ActiveRecord, Castle, Hibernate, NHibernate, nvarchar, nvarchar(max), SQL Server
About