Archive

Archive for the ‘Software’ Category

Installing Mercurial on Mac

May 29, 2014 Leave a comment
$ brew install mercurial

If you see errors like:

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future] clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

you can disable the ‘warning’ (which is now showing as error ) by:

$ ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future \ 
brew install mercurial

Again, after the install successed, if you see linking error:

Error: Could not symlink file: /usr/local/Cellar/mercurial/2.9/share/man/man5/hgrc.5
/usr/local/share/man/man5 is not writable. You should change its permissions.

You can change the permission. It is said to be safe to change the permission for the whole /usr/local. If you don’t want to do so, just do it for this case

$ sudo chown -R 'your-user-name' /usr/local/share/man/man5
 $ brew link mercurial
Categories: Python, Software

ImageMagick – resize image

February 29, 2012 Leave a comment

ImageMagick  is really a convenient tool for batch image process.

Install from here:  http://www.imagemagick.org/script/index.php

For my installation I simply choose what they recommended: x86 dynamic version.

Now, able to batch resize use command like( this will resize all the jpg image under the current folder (overwrite the original one) with a rescale ratio %25 :

mogify -resize %25 *.jpg

Here’s a link with more information:

http://www.imagemagick.org/script/command-line-processing.php#geometry

http://www.gimpusers.com/forums/gimp-user/11032-scaling-image-via-the-command-line

 

Use help to get all the command line functions provided.

$ mogrify -help

Usage: mogrify [options …] file [ [options …] file …]

 

Install Opencv Python API

February 16, 2012 1 comment

1. Download and install Python 2.7
2. Download and install NumPy and SciPy. You can find most of the compieled packages for windows here: http://www.lfd.uci.edu/~gohlke/pythonlibs/
3. Download OpenCV 2.3.1 for windows use the superpack one: http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.3.1/
4. Double click on the OpenCV installer. It will extract OpenCV to your selected folder. I put it to C:\OpenCV2.3.
5. Configure your opencv: add path to your system enviroment.
At least you should add C:\OpenCV2.3\build\x86\vc10\bin to PATH
I forget what I did when I first install opencv, well this is my current system path:
C:\OpenCV2.3\build\lib\Debug;C:\OpenCV2.3\build\x64\vc10\bin;C:\Program Files\Intel\tbb\4.0\bin\intel64\vc10;C:\OpenCV2.3\bin

6. OpenCV 2.3.1 folder structure is different from OpenCV 2.2. The pre-build library and Python package are located at C:\OpenCV2.3\build.
7. Open Python IDLE
8. Add the following path to your python path:

import sys
sys.path.append(r”C:\\OpenCV2.3\\build\\python\\2.7″)

8. Now, you are ready to import OpenCV with
import cv

 

Install Java-plugin for Ubuntu 11.04

July 23, 2011 2 comments

Install Java-plugin on Firfox, Ubuntu 10.4

Got a long time that the Java plugin not running well on my browser.

Here’s how to solve it:

– Open “System” –> “Administration” –> “Software Source”

– On tab “Other software”, Add

deb http://archive.canonical.com/ubuntu maverick partner

– In your command line:

sudo apt-get install sun-java6-plugin

sudo update-alternatives  –install /usr/lib/mozilla/plugins/mozilla-javaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 1

Helpful Links

Categories: Software, Ubuntu

Weekly Fun Software Collection

July 22, 2011 Leave a comment

Several Open Source Packages, which are fun~~

Scilab
Rapid-Miner
Karmasphere