Archive for the ‘Code’ Category

Python 3.0 + py30-readline on OS X (MacPorts)

Posted by michael on January 1st, 2009 under Code, OS X
Tags: , , ,  •  No Comments

Python 3.0 (release) seems to be in MacPorts now, but the py30-readline package fails to build:
—> Building py30-readline
Error: Target org.macports.build returned: shell command ” \
cd “/opt/local/var/macports/build/_opt_local_var_ \
macports_sources_rsync.macports.org_release_ports \
_python_py30-readline/work/Python-3.0/Modules” && \
/opt/local/Library/Frameworks/Python.framework/ \
Versions/3.0/bin/python3.0 setup.py build ” returned \
error 1
Command output: readline.c:396: warning: passing \
argument 1 of ‘free’ discards qualifiers from pointer \
target type…
I fixed it [...]

Both sides of a quick and simple web service

Posted by michael on April 3rd, 2007 under Code, MySQL
 •  4 Comments

To clarify the article title, when I say web service, I mean a piece of software that will receive and send out data via the HTTP protocol. Furthermore, this data is usually transmitted in XML format. I will also call this XML RPC occasionally, but there is also a specification called XML-RPC so things can [...]

Sorting arrays by an arbitary key value in PHP

Posted by michael on February 27th, 2007 under Code, MySQL
 •  3 Comments

I often (a couple times a month) have to sort an array of arrays by some arbitrary value located in the internal array. For example, I might want to sort the following structure by name.
Array[0] {
Array[0] {
id [...]

B2B: Ajax in JQuery with special effects

Posted by michael on January 31st, 2007 under Code, Javascript
 •  22 Comments

Today’s article is going to cover using the excellent JQuery library to implement an AJAX username availability checker (along with a bit of eye candy to show the results). The use of visual effects with AJAX can occasionally be quite tricky, depending on what you need to do - fades by definition will take a [...]

B2B: Testing and defining variables in PHP

Posted by michael on January 23rd, 2007 under Code, MySQL
 •  22 Comments

PHP is a dynamic, weakly-typed language, and as such, beginners to the language will often find their code acting unpredictably because of assumptions they have made.
PHP has a fairly low entry point for new programmers - it’s easy enough to get a couple of small sample scripts up and running, but on the same token, [...]