Skip to main content

Tips on Using VI Editor (continued)

· One min read

More on VI...

H - position the cursor at the top of the screen (left most position)

M - position the cursor in the middle of the screen (left most position)

L - position the cursor in the bottom of the screen (left most position)

G - position the cursor at the bottom of the file (left most position); last line in file

gg - position the cursor at the top of the file (left most position); first line in file

:_n_ - position the cursor at line n of the file

Tips on Using VI Editor

· One min read

This is a one of many mini-posts that I will do on using the VI editor. I've recently bumped into some pages that contains valuable information on how to use VI. The problem with it is its too wordy and that makes it hard to look for information when you need it.

So this post and the following ones will use tags relevant to the subject to help the search for relevant information quicker.

D - delete the characters of the line after the cursor position

C - delete the characters of the line after the cursor position and change to insert mode

R - change to insert & overwrite mode; it's like pressing the Ins key on the keyboard; whereas 'r' replaces a single character, 'R' replaces every character that you type over

s - behaves like 'x' but switches to insert mode

S - deletes the whole line and change to insert mode

Zend Framework Testing with PHPUnit – Setup

· 13 min read

Finally, I've started on the follow-up post on Zend Framework Unit Testing (link to previous post)! After a whooping four months. I've been really busy - perhaps with the wrong reason. Anyway, this post shall follow up on the previous post by continuing on the AllTests.php file that was created at the end of the last post.

Readers who are first time users of Zend Framework should find this and the last post helpful in getting your feet wet with unit testing with Zend Test. The focus of this post is on preparing the setup and teardown phases of the testing sequence.

Restoring GRUB for Linux

· 2 min read

Frequent Linux users who dual boot their machines with Linux and Windows will inevitably find their GRUB boot loader corrupted at some point in time. This post will help you restore your GRUB boot loader.

Zend Framework Testing with PHPUnit - Installation

· 5 min read

This post describes how to set up automated testing with Zend Test and PHPUnit. The latter is a unit testing package for PHP applications done in PHP. I had searched for posts on how to do this but there weren't any easy-to-understand or straightforward examples to follow, so I decided to write one myself. This post will thus be written in a way that newbies are able to get a test working straight away by following the examples in this article. After reviewing the length of the post, I decided to break this article into several smaller ones that are much easier to digest. It'll be easier for you to get to specific information with smaller articles rather than a large one as well.

I hope this post will help some newbie down the road. Bear in mind that I'm no expert on this - only enough to get it working (and maybe to screw up, which I hope doesn't happen.) So if I make any mistakes, please point them out and I will make amendments where necessary. If you have something to ask or simply want to share, please comment at the end of the post. Hope you find the following useful!

Using Zend Framework with jQuery to do Auto-Completion

· 5 min read

This post describes how you can perform text field auto-completion with Zend Framework (ZF) and jQuery. To make full use of this post, you will need to have a working knowledge of Zend Framework and of jQuery. You don't need to be an expert at using them though cos if you do, you probably won't be reading this post. Here goes.

The basic assumptions here are that you've got your application running on the Zend Framework already and that your jQuery script is placed in the right place which means all your view scripts can access jQuery code.

MySQL Error 1005

· One min read

From personal experience, the error ERROR 1005 (HY000) is the result of having foreign key constraints of the same symbol name. It appears that the foreign key constraint cannot have the same symbol in the database - in other words, it must be unique throughout the database, not just the table.

MySQL Error 1452

· One min read

This is to help developers who encounter the error ERROR 1452 (23000) in MySQL resolve it.

There can be a few causes to this error. One of the reasons is the newline characters that terminate each line. There are differences between the Windows platform and the Linux-based platforms when terminating each line. Refer to this forum post for more information.

The other reason I found out personally is the existing data in the table. For example, suppose the field in the table was of type VARCHAR(20) and all rows have numeric strings in this field. Even if the field was modified to be an integer type, referencing this field to a numeric field in another table will not work because the data in the rows are character types. Therefore, before the foreign key constraint can be created, the data in the field has to be changed to integer types.

Using my BlackBerry

· 4 min read

Now that I've got my BlackBerry working fine, it's time to get it to work its magic. This, and the previous post, are made with my BB Bold.

A little bit of background on my Bold - I got it from M1, one of three telecom providers in Singapore. It comes with two flavours of BlackBerry plans: a S$30 plan with a data limit of 4 MB and a S$60 plan with unlimited data.

First Post from a BlackBerry

· One min read

Well, this is a test post from a BlackBerry - not sure if it will work.

Called up M1 a couple of days ago and changed the APN from mobilenet to sunsurf and performance has improved a lot. Trying to see if it works better with Wordpress.