Setup Django/mysql in Ubuntu server in VMWare Fusion

Basically the goal is To create a web application that run on VMWare using Python/Django with MySql, and able to accessed by the host OS.

Read More

iOS - Create UITableView with custom cell programmatically

Personally, I don’t like to use Xcode’s interface builder. I felt that everything programmatically will be easier to debug.

This post is share about create table view and custom table cell.

Read More

NSInvalidArgumentException caused by UITableViewCell

I keep hitting an error like this

1
2
3
4
5
2013-03-02 18:34:52.488 StoreSearch[84541:c07] -[UITableViewCell nameLabel]: unrecognized selector sent to instance 0x6a7d880
2013-03-02 18:34:52.489 StoreSearch[84541:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableViewCell nameLabel]: unrecognized selector sent to instance 0x6a7d880'
*** First throw call stack:
(0x14ab052 0xeabd0a 0x14acced 0x1411f00 0x1411ce2 0x3717 0xb4e0f 0xb5589 0xa0dfd 0xaf851 0x5a322 0x14ace72 0x1d6e92d 0x1d78827 0x1cfefa7 0x1d00ea6 0x1d00580 0x147f9ce 0x1416670 0x13e24f6 0x13e1db4 0x13e1ccb 0x1394879 0x139493e 0x1ba9b 0x20bd 0x1fe5)
terminate called throwing an exception(lldb)

Read More

Restrict Git commit message to certain pattern

For certain reason, some time you want your commit message to follow a standard pattern.

i.e. PJK-001: my message

Want to have a project code and assignment code there.

Read More

SQL - SELECT SUM joined with another table

I had always face a scenerio like this:

There are 2 tables

1
2
user(id, first_name, last_name)
transaction(id, qty, user_id)

Read More

Vim - Set indentation based on file type

Let say now you want your .js (JavaScript) file to 2 space indent.

Create a file named javascript.vim (NOT js.vim)

Read More

My practice Git Model

Thanks to this post. It get me more understand in Git.

Let’s have a try.

Read More

Enable display_errors in MAMP

As we all know that to enable display_errors was an easy task. Unfortunately I’ve made more than 10 attempts to configure this.

Initially I was edit /Applications/MAMP/conf/php5.4.4/php.ini, it doesn’t solve my problem. Then I’ve tried to edit all php.ini in each php version. Sadly, it failed again.

Read More

Unknown error when setting up virtual host in MAMP

I’m struggling for half day just to setup virtual host in MAMP.

/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/path/to/project"
ServerName www-yourproject.com
<Directory "/path/to/project">
Options All
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

Read More

iOS: Hide keyboard when the user tapped else where

In certain circumstances (i.e. The table row to edit.), we do want the keyboard to be hide in order to improve user experience

In YourViewController.m

Read More