Archives for

Coding

Error whil creating super user in django1.4 on MAC

I got the following error while trying to create a super user from shell for django1.4. File “/Library/Python/2.7/site-packages/django/contrib/auth/management/__init__.py”, line 85, in get_system_username     return getpass.getuser().decode(locale.getdefaultlocale()[1]) TypeError: decode() argument 1 must be string, not None This problem was rectified by running this command in terminal before adding the user export LANG=”en_US.UTF-8″ I’m guessing this character encoding

Make command not found in Mac OSX

If you get a -bash: make: command not found error while trying to compile from source, you have to install xcode and then in xcode goto preferences->downloads and install xcode developer tools Download Xcode I’m not sure if you can install command lines without xcode. I can not test as I already have Xcode on

Subtracting two dimensional arrays in PHP

In the development a WordPress plugin I had to subtract two dimensional arrays. I tried array_diff() function, unfortunately it doesn’t seem to work for two dimensional arrays. Even if it worked, it wasn’t exactly the functionality I wanted. Be warned, this isn’t exactly a alternate for array_diff(). For difference of two dimensional arrays you may