[Valid RSS]

Assert statement in Objective C

Share

Hi,
if you like to use assertions in your source code, but you miss this feature in ObjectiveC, give a look to this small class.
Assert.h

#import <Foundation/Foundation.h>

@interface Assert : NSObject {

}

+(void)that:(BOOL)expr;

@end

Assert.m

#import "Assert.h"

@implementation Assert

+(void)that:(BOOL)expr{

 if (!expr) {

  [NSException raise:@"Failed assertion." format:@"Failed assertion", nil];

 }

}

@end

As you can see, there’s only one static method that you can use wherever you want.
In this [...]

Get rid of MantisBT date_default_timezone_get() warning

Share

If you installed a MantisBT instance on a system with a recent PHP version, there’s the chance you get a warning saying:

SYSTEM WARNING: date_default_timezone_get(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods [...]

Linux Shell Survival Toolkit

Share

Hi, having a strong Windows background, I hardly remember all options of the huge set of commands available in the Linux shell… so, I’m slowly but steadily building up this Survival Toolkit. Hope it helps.

File and directory management
Symbolic link

Sometimes it is useful to hide the real location of a directory. For instance you could have [...]

Playing around with twitter list

An F1 related list on Tweetter. Just follow F1 without a [...]

Ruby on CentOS

Install a recent Ruby version in CentOS via Yum is almost impossible, since the packages are a little outdated. Maybe it is worth to give Enterprise Ruby a [...]

Database testing with Mono and NUnit

A class to set the database in a well know status before running an integration [...]

Obtain the root logger programmatically in log4net

Share

If you use log4net, you could have the need to configure the loggers programamtically. The problem arise when you want access to the root logger, since the documentation does not explain well how to obtain it.
So, here’s a snippet that show how to do it. Don’t forget to imort the log4net namespaces.

using log4net;

using log4net.Core;

using log4net.Appender;

using [...]