Orchard CMS: Exporting and Importing custom content types

Orchard CMS provides a nice module to import and export content items. You just need to enable the module called “Import Export”. This will add a menu item in the left navigation sidebar. There you can export all content items of given types. This will create an XML file containing all exported content items. It […]

Switching to user root

Why switch to root ? When in a shell as a non-root user, you have to use sudo to execute a command which requires root privileges e.g.: sudo chown henribenoit:_www * That’s the clean way of doing it: use a non-root user and only use sudo when required. But sometimes it just drives me crazy […]

SVN: Subversion 1.8 on Debian 7 (Wheezy)

Debian 7 (Wheezy) is still only shipping with Subversion 1.6 (see Details of package subversion in wheezy). First you need to add the WANdisco GPG key to the apt sources keyring: $ wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | apt-key add – Then you need to add the appropriate apt source. You can either extend /etc/apt/sources.list or […]

Orchard CMS: Cloning custom content items

When listing instances of a custom content item type, you will see that next to the Preview, Publish, Edit and Delete operations, there is also a Clone operation. When using it on a custom content item, you will also see that it’s merely creating an empty content item, not taking over any of the actual […]

Sybase ASE: List all tables in the current database and their size

In order to get a list of all tables in the current database, you can filter the sysobjects table by type = ‘U’ e.g.: select convert(varchar(30),o.name) AS table_name from sysobjects o where type = 'U' order by table_name In order to get the number of rows of each table, you can use the row_count function. […]

JavaScript: dynamically call functions

Sometimes you need to call a Javascript function but only know which one will be called at runtime. So you cannot directly call the function in you code but need to some get a function in a variable and be able to use it to call the appropriate function. Of course a simple solution is […]

C#: Safe navigation avoiding NULLs

Groovy has a safe navigation operator “?.” which works just like the dot operator except that it returns nulls instead of throwing NullPointerExceptions when the object on the left is null. Let’s see you want to do the following: a.b.c; But a could be null or a.b could be null, then you have to write […]

NHibernate: NullReferenceException on bitwise operations in the where clause

When performing a bitwise operations in the where clause of a LINQ query using the NHibernate LINQ provider e.g.: from o in SomeObjects where (o.SomeFlags & myBitMask) != myBitMask you might geht the following exception: System.NullReferenceException: Object reference not set to an instance of an object. at NHibernate.Criterion.SubqueryExpression..ctor(String op, String quantifier, DetachedCriteria dc, Boolean prefixOp) […]

Choosing an open source NoSQL database

I’m currently evaluating which NoSQL we could use in a new project and thought I’d document the considered options are and the relevant criteria here. First let’s see what a NoSQL database is at all. NoSQL doesn’t necessarily stand for “No SQL” but rather for “Not only SQL”. So this means it’s a database which […]