Aug 2nd, 2010
by Marthijn.
Today I updated my HTC Desire to Android 2.2. The update was successful but I noticed one problem; my mobile internet didn’t connect any more. I found out that I had to add (or delete and add new) APN carrier settings in: Settings → Wireless & networks → Mobile networks → Access Point Names.
For a list of settings of Dutch and Belgium mobile network operators see this page.
Posted in: Android.
Tagged: Android · HTC Desire · Mobile internet
Jul 28th, 2010
by Marthijn.
I took the following panoramas during my holiday on Madeira with my Canon 50D and Tamron 17-50 f/2.8 lens. All the images are made out of two or more pictures and I used AutoPano to stitch the pictures.
Câmara de Lobos

Continue reading →
Posted in: Photography.
Tagged: Canon · DSLR · Lens · Madeira · Panorama
Jun 27th, 2010
by Marthijn.
Currently I’m developing a web application in PHP using the CodeIgniter framework. Since I needed some admin functionality such as create, read, update and delete records (CRUD) I searched for CodeIgniter libraries. I came across this post by Henri. His solution is very simple and easy to understand and implement. In this post I’ll describe how to improve his solution so it’s possible to sort columns. I start with the files Henri provided in his post.
In order to enable sorting I first modify the get_paged_list function of the PersonModel class:
function get_paged_list($limit = 10, $offset = 0, $order_column = '', $order_type = 'asc'){
if (empty($order_column) || empty($order_type))
$this->db->order_by('id','asc');
else
$this->db->order_by($order_column, $order_type);
return $this->db->get($this->tbl_person, $limit, $offset);
}
Continue reading →
Posted in: Development, Tutorials.
Tagged: CodeIgniter · CRUD · PHP · Table
Jun 9th, 2010
by Marthijn.
Like in older versions of Visual Studio it is possible to use NUnit as an external tool in the new 2010 version. By creating a toolbar as well it is very easy to run your test suite. The usual way to add an external command is by clicking the menu Tools -> External Tools. However, by default this menu item is not visible. To enable this menu item go to Tools -> Settings -> Expert Settings.

Continue reading →
Posted in: .NET, Development, Software, Testing, Tutorials, Windows.
Tagged: .NET 4.0 · NUnit · Visual Studio
May 10th, 2010
by Marthijn.
Each lens manufacturer uses different abbreviations to describe the features or aspects of a lens. This post lists all abbreviations of Canon, Nikon, Sigma, Tamron and Tokina. Some general terms such as AF (auto-focus) and MF (manual-focus) are not listed.
Canon
| Abbreviation | Meaning | Description |
| AFD | Arc-Form Drive | An older type of auto focus motor, generally slower and noisier than USM |
| DO | Diffractive Optics | A technology used to make lenses with long focal lengths without the normal increase in physical size |
| ED | Extra-low Dispersion | Prevents chromatic aberration because it concentrates and directs the wavelength of the light more effectively onto the camera's sensor |
| EF | Electro Focus | Standard lens mount, compatible with all EOS bodies |
| EF-S | Electro Focus - Short back focus | Lens mount for APS-C sensor DSLRs |
| IF | Inner Focus | To ensure stability in focusing, this lens moves the inner lens group or groups without changing the lens' physical length |
| IS | Image Stabiliser | A family of techniques used to reduce blurring associated with the motion of a camera. Specifically, it compensates for pan and tilt of a camera |
| L | Luxury | Professional lenses; good optical performance and a solid construction |
| MP-E | Macro Photo Electronic | These lenses are designed for macro photography and do not have autofocus, the "electronic" refers to the electronic aperture control |
| TS-E | Tilt-Shift lens | Control of perspective and depth of field |
| USM | Ultra Sonic Motor | Auto focus motor that offers fast and silent focusing powered by the ultrasonic vibration of a component, the stator, placed against another component |
Continue reading →
Posted in: Photography.
Tagged: Abbreviations · Canon · DSLR · Jargon · Lens · Nikon · Sigma · Tamron · Tokina
May 5th, 2010
by Marthijn.
The mobile operating system Android has a hidden service menu where some information about the phone can be viewed (Phone information, Battery information, Battery History and Usage statistics). To access this menu open the dialer and dial:
*#*#INFO#*#*
In numbers:
*#*#4636#*#*
I have tested this on my HTC Desire (Android 2.1 and 2.2) and in an emulator (Android 2.1). The following screen is shown:

Service menu
Continue reading →
Posted in: Android.
Tagged: HTC Desire · Tweaks
Apr 14th, 2010
by Marthijn.
Watir is an open-source Ruby library for automating web browsers. Combined with unit testing for Ruby it is a really powerful tool to test websites and webapplications. In this post I explain how to write a test for a simple website.

Watir
Continue reading →
Posted in: Development, Software, Testing, Tutorials.
Tagged: Ruby · Watir
Mar 30th, 2010
by Marthijn.
Type conversion (or typecasting) is the technique to change an entity from one data type into another. In general there are two types of type conversion; implicit and explicit conversion. This post tells about type conversion in C#.NET and the performance issues.
Implicit conversion
Implicit conversion (or coercion) is automatic type conversion by the compiler. In C# it does not require a special syntax because the type conversion is safe and no data will be lost. In the following example the value of an integer is stored in a long. This is safe because an integer is 4 bytes (on a 32 bit computer), and a long is 8 bytes. So every value that fits in an integer fits in a long. For a complete conversion table see this page.
int i = 12345678;
long l = i;
It is also possible to cast a derived class to a base class without using a special syntax.
Continue reading →
Posted in: .NET, Development, Software, Windows.
Tagged: C# · Type conversion
Mar 15th, 2010
by Marthijn.
In some of my web applications I use Rhino Mocks to create mock objects. Usually the code has a record section where the expected calls are recorded, and a playback section where the testing is done. In the following code snippet the DoSomething() function calls a void function which is defined in the interface of _myMock. The problem is this void function is not expected and the NUnit test run will fail:
Rhino.Mocks.Exceptions.ExpectationViolationException : IMyInterface.MyVoidFunction; Expected #0, Actual #1.
using (_mock.Record())
{
Expect.Call(_myMock.GetValue("a")).Return("b");
/* insert expectation for void function here */
}
using (_mock.Playback())
{
// DoSomething calls the mocked object's GetValue function, which returns 'b' when the parameter is 'a'
// DoSomething also calls a void function which is located in the interface of the mocked object, so this
// void function must be mocked too, else the test run will fail
Assert.AreEqual("b", _myObject.DoSomething("a"));
}
Continue reading →
Posted in: .NET, Development, Software, Testing.
Tagged: C# · NUnit · Rhino Mocks
Mar 10th, 2010
by Marthijn.
On my server I want to create accounts that can do SSH in a chroot environment. On the internet I searched for tools and I found Jailkit. In this post I will tell how I installed Jailkit on Ubuntu server 9.10, created a jail and how users are added to the jail. Note that most commands in this tutorial should be executed as su or sudo.
Jailkit installation
First I installed Jailkit by using the following commands:
# cd /tmp
# wget http://olivier.sessink.nl/jailkit/jailkit-2.11.tar.gz
# tar -zxvf jailkit-2.11.tar.gz
# cd jailkit-2.11
# ./configure
# make
# make install
Continue reading →
Posted in: Linux, Software, Tutorials.
Tagged: chroot · Jailkit · Server · Ubuntu