Archive for the ‘article’ Category.

Build NINJA-IDE on Mac OS X Lion from source

Though I’m mainly using VIM as my full-functionality editor for daily works. Sometime I just want to try something else. Somewhat like ar… A Integrated Development Environment?

I have to admit Eclipse is a great IDE for developing Java / PHP (you use cracked Zend Studio?) and with a plugin called Aptana we can also write Ruby / Python stuff with it. But I don’t like java much.

So that’s why a IDE for Python called NINJA-IDE caught my eyes, especially itself written in Python. We can find it here and here.
NINJA-IDE is built from python and Qt for GUI. so make sure you have PyQt (at least version 4) runtime on your system.

If you are using the python within homebrew, you can just open terminal.app and key the following command and waiting for things’ done :)


brew install -v sip
brew install -v pyqt

For me, I’m using Mac OS X Lion so I choose not to screw the native python environment up. You can use pythonbrew.

And one thing must be pay attention. Sip and PyQt4 don’t use the standard setuptools to install. We have to download the latest source code and build ourself. They also require python to be built in framework mode. If you are running on Linux or not the same as me, I suggest you refer to your system’s manual or google for about how to build these things.
So let’s get started :)

all the stuff we will need can be found as:

First, make sure the python has been built for framework mode.


# is supposed to be something like:
/Users/aleiphoenix/.pythonbrew/pythons/Python-2.7.2/Frameworks/Python.framework/Versions/2.7/bin/python

about how to build python for Macosx/Darwin framework


# use pythonbrew
# add `--framework`
# `--universal` for build 32bit / 64 bit for intel CPUs
# `-n` for
pythonbrew install --framework --universal -n 2.7.2

building Sip and PyQt4 is similar


# cd into source folder
# `-n` for universal binary
python configure.py --arch=x86_64 -n

# then `make` and `make install`
make && make install

# building PyQt4 is identical

Check whether the installation is successful. If don’t get any error, congratulations!


python -c 'import sip'
python -c 'import PyQt4'

Now we can start NINJA-IDE by hitting for following command in source code folder.


python ninja-ide.py

OK… the interface is not so awesome as their website.. but guess I will have a try with it :D

planning a new php framework

A framework widely used in my workplace call APF V2 is very powerful I have to admit. But some design of it just slow down the development, and sometime I won’t use those libs. I find myself not really familiar with PHP and web developing or I’m just a web developer, coding for food. But after all I want to be a designer of my code and work.

So after some tries I will plan to write a lightweight framework for my daily php developing. Also it will help me understand more details about how to make code together to work and the language itself. I am learning python and going to learn RoR so guess i will take advantage of  some ideas from them :)

The framework is aiming for fast developing, basically MVC design mode, restful and stick with standards(HTML/HTTP i mean), make coding more simple and easy.

I’ve created a repository on github. So if you’re interested in this new work, you can join me. Just drop a piece of comment here.