msgbartop
Of Linux, Programming, and Singaporean Ramblings
msgbarbottom

08 Jan 09 Using Zend Framework with jQuery to do Auto-Completion

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.
(more…)

Tags: , , , , ,

17 Dec 08 MySQL Error 1005

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.

17 Dec 08 MySQL Error 1452

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.

(more…)

08 Oct 08 Using my BlackBerry

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. (more…)

Tags:

22 Sep 08 First Post from a BlackBerry

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.

16 Sep 08 Customisation for Vim Editor

When doing some simple programming, I like to use the Vim editor instead of using a full-blown IDE. It’s a good editor but I want to use it more efficiently. Some of the things I customise for myself are:

  • auto indentation – this is a must for programmers
  • tab size – to indent I use the tab key but different applications represent the tab character with different number of spaces; I like mine to be 4
  • I like my colours to be different

These settings are saved in a file named .vimrc in each user’s home directory. Simply save the vi commands in this file to have your customisation. But remember to remove the semicolons. Below is my .vimrc contents to achieve my customisation.

set tabstop=4

set autoindent

colorscheme wombat

wombat is a colour scheme file which I saved in the directory /usr/share/vim/vim71/colors/.

P.S. While searching for some help on setting the file types in Vim, I found this page in wikibooks.org that describes the tips a programmer would use. It’s unbelievably useful. Do check it out if you use vi editor!

Another page with some useful tips is http://tips.webdesign10.com/general/vim

Tags:

08 Sep 08 Finally, A New Desktop!

I’ve finally got around to buying a new desktop for home use. Nothing fancy, but because I want the best bang for my buck, I’ve put off the purchase for quite sometime now. Being an IT guy, of course I chose to have my system assembled from the shops in Sim Lim Square instead of a PC vendor.

So, like any decent programmers/IT specialist will do, I analysed my requirements first. My needs are simple:

  1. It has to be at least dual core – I run VMware so nothing less than a dual core for me.
  2. It cannot be an overkill – I’ve seen too many instances where money is really put to waste. (Raise your hand if you’ve heard someone bought a quad-core processor to do word processing.)
  3. Plenty of hard disk space and running SATAII but must also support IDE drives,
  4. It must be supported by Linux and be able to run Compiz/Compiz Fusion.
  5. I prefer Gigabyte motherboard – been using it since my first desktop and never had any problems with it.

With my requirements listed carefully, I settled for Gigabyte motherboard GA-G31M-S2L, which has Intel GMA 3100, Realtek 8168B PCI-Express Gigabit Ethernet Controller, I specifically mentioned these two components because they have been my biggest worry if I were to use LInux.

(more…)

29 Aug 08 Converting PS files to PDF

In openSUSE 10.3, there is no readily available solution (that I know of) that lets a user print to PDF. The closest thing there is to that is a PostScript (PS) file. Fortunately there is a easy way to convert PS files to PDF. There is a command called ps2pdf which does exactly that. Its usage is very straightforward as well:

ps2pdf document.ps document.pdf

How much simpler can that get?

Tags:

28 Aug 08 Installing Fonts in Linux

Installing fonts has been somewhat of a neglect in Linux. Although I haven’t checked, it seems that recent distributions of SUSE Linux has made it GUI-friendly.

Nevertheless, being a console guy, I believe it’s better to know a more reliable way to make things work that is more ‘portable’ (i.e. work in other distributions as well).

So for fonts, the most straightforward way I know is to copy the font into your personal directory’s hidden font folder e.g. /home/coder/.fonts

After having done that, the next step is to then make the font available to your applications. This can be done with the command:

fc-cache -fv

That’s all there is to it!

Tags: ,

14 Aug 08 Eee PC – Installing openSUSE 10.3 on SD Card

I’ve always read that installing an operating system, regardless of Windows XP or Linux, on a SD card in the Eee PC is possible. But I haven’t got the chance to prove that – until now.

(more…)

Tags: