Monday, January 7, 2013

Figure Settings Matplotlib

From Evernote:

Figure Settings Matplotlib

In Lion, all figure settings live inside
/Library/Python/2.7/site-packages/matplotlib/mpl-data/matplotlibrc

You can modify such file, however it will be overwritten on the next python update. 
Instead to have your user-defined changes in a save place, write your changes to this location
/Users/myuser/.matplotlib/matplotlibrc

Friday, December 7, 2012

Permanently add path to python Mac Os

From Evernote:

Permanently add path to python Mac Os

We could add the PYTHONPATH variable to our .profile file in our home directory. 
An alternative is to create a user.pth file inside /Library/Python/2.7/site-packages, where python automatically looks inside all .pth files and adds the to the systems PATH

Monday, April 2, 2012

Installing Modules In Python

From Evernote:

Installing Modules In Python


A miscellaneous command that I always seem to forget….An easy way to install modules in Python is through pip

easy_install pip  (if not installed already)
pip install numpy
pip install matplotlib

Tuesday, April 12, 2011

Adding new file type to Xcode

This will help you get color syntax on .txx files:

Create a file
/Users/isa/Library/Application Support/Apple/Developer Tools/Specifications/TXX.pbfilespec
or
/Library/Application Support/Apple/Developer Tools/Specifications/TXX.pbfilespec

containing the following

(
        {
            Identifier = sourcecode.cpp.tpp;
            BasedOn = sourcecode.cpp.cpp;
            Extensions = (txx);
            ComputerLanguage = c;
            AppliesToBuildRules = yes;
            IncludeInIndex = NO;
            CanSetIncludeInIndex = NO;
        },
)

You may need to re-add sources or regenerate project file

Wednesday, November 10, 2010

Building VTK with QT on a Mac

VTK libraries are built in a similar fashion as VXL. You will need Cmake installed and create directories fro source and build.
The configuration for using VTK with QT are borrowed from here
In summary:

  1. Grab Qt 4.5.3 here.
  2. Launch CMake. Set the build directory to where you want to build VTK and the source directory to the VTK source tree.
  3. Turn on the following options:
    1. BUILD_SHARED_LIBS
    2. VTK_USE_QT
    3. VTK_USE_CARBON
    4. VTK_USE_GUISUPPORT
  4. Turn off the VTK_USE_COCOA option.
  5. Click “Configure”.
  6. Set DESIRED_QT_VERSION to 4.
  7. Click “Configure” again.
  8. Turn on VTK_USE_QVTK_QTOPENGL
  9. Click “Configure” yet again.
  10. Click “Generate”.

Tuesday, June 1, 2010

Format Date in Xcode

By default, when using the field DATE in Xcode, the date is in month/day/year format. In order to change the format you could type in the terminal a command of the following form:

defaults write com.apple.xcode AppleICUDateFormatStrings '{ 1 = "d-MMM-yyyy"; }'

A good source for what fields can be used in Xcode templates see this link