Category Archives: Programming

Starting with Python

python logo
Python logo

For about a year I have been programming in Python as a Matlab alternative. I love Matlab but I can’t afford being tied to a licence. Python is free, open source, and so far I have been able to do everything I did with Matlab. I am fairly impressed!

Python is becoming, or it may be already, a main stream programming language, specially for open source software. Since it’s a scripting language a lot of programs use it for scripting in that app. A few examples are Blender for 3D modeling and animation, FreeCad for 3D mechanical modeling, Fenics for solving differential equations by finite element methods, etc. Many universities have adopted Python in their class work, MIT, Georgia Tech, UC Davis, etc.

If you want to start with Python let me recommend the following:

  1. Use Enthought! Yes, I know … there is also a licence attached if you really want full support and all the packages. But it’s free if you have a .edu email and even if you don’t have one there is a totally free version of Enhtought: Canopy Express! By the way, the Enthought distro works on Mac, Linux and Windows. It’s perfect!
  2. If you really… really don’t want to be attached to a licence (I made my peace with Enthought since they have a free version) you can use Spyderlib. It’s also an Integrated Development Environment (IDE) like Enthought but has a few less python libraries… but you can install them separately with a bit of pain.

If you want to lear more about Python and how to get started check these references:

WordPress permissions problems

Permissions are a common problem when installing WP. It took me hours to try to figure out the best permissions configurations and finaly I realized that there is a filesystem method in WP-config that overrides the direct file I/O by using the FTP credentials:

In wp-config.php

Change

define(‘FS_METHOD’,’direct’);

to

define(‘FS_METHOD’,’ftpsockets’);

If the above does not solve your permission problems try:

$sudo chown -R YourUserName:www-data

$sudo chmod -R 775 *

 

Resources

SVN 1.7 for Mac OS Lion

Mac OS Lion comes with SVN 1.6 installed by default. But I needed to install SVN 1.7 to work on a project that uses SVN1.7.

Here is what I did to come trough:

I like using the SVN GUI tool svnX. The current version of the program is: svnX 1.3.3 (http://code.google.com/p/svnx/wiki/Features_1_3). Take a look and download it if you like what you see. It’s free and after you learn how to use it you will love it!. Download here.

The latest version of subversion is 1.7.5 (as today) and it can be found in
http://apache.is.co.za/subversion/

But svnX 1.3.3 is compatible with svn 1.7.4 so we are going to install that rather that the latest svn (1.7.5). Also I because I found some problems with svn 1.7.5.

1) Create a folder where you will put the svn 1.7.4 files. Download and extract the source.

$mkdir ~/Downloads/svn
$cd ~/Downloads/svn
$curl http://archive.apache.org/dist/subversion/subversion-1.7.4.tar.gz > ./subversion-1.7.4.tar.gz
$tar -xvjf subversion-1.7.4.tar.bz2  //to uncompress a bzip2 tar file: .tbz or .tar.bz2
$cd subversion-1.7.4

Configuration setup, Building and install the binary

$./configure --prefix=/usr/local
$make
$sudo make install

It should now be installed in /usr/local/bin/svn. Check if it got correctly installed.

$/usr/local/bin/svn --version

Notes:

  • You may try to install version 1.7.5 at your risk. Replace ‘subversion-1.7.5.tar.bz2’ with the latest version you find in the above link on the ‘curl’ command.
  • You can also install the latest version of subversion using MacPorts

Resources: