Nipon

Friday, July 05, 2013

Speed up mac by eliminating inactive memory

Problem: my Mac is slow mainly because of the shortage of memory.

Solution: Run ActivityMonitor. If you see a big chunk of your memory to be under inactive category (blue section), simply run the next command on terminal to free up the memory:

> purge

Solution found here.

Monday, July 01, 2013

How to not include names when copying emails in Apple Mail

Problem: When I copy a list of emails in apple mail software, names are also included.

Solution:  Run this in your command:
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool NO

Wednesday, November 28, 2012

Problem with opening iWeb files on Mac OS 10.7

Problem: When I open a previously designed homepage with iWeb it opens the default website

Solution: Copy your iweb file to "Home/Library/Application Support/iWeb/" and rename it to "Domain". Unfortunately you have to do this everytime you want to switch your file.

Thursday, November 08, 2012

Permutation in Python using arrays


def perms(X, perm_sample= array([],'uint8') , allPerms = None,ind = 0):
    # Returns all permutations and number of permutations
    # X = [2 3]
    # res,perm_count = ([[0,0],[0,1],[0,2],[1,0],[1,1],[1,2], 6)
    
    if allPerms is None:
        #Get memory
        size        = prod(X)
        allPerms    = zeros((size,len(X)),'uint8')
    if len(X) == 0:
        allPerms[ind,:] = perm_sample
        perm_sample = array([],'uint8')
        ind = ind + 1;
    else:
        for x in arange(X[0]):
            allPerms, ind = perms(X[1:],hstack((perm_sample, [x])), allPerms, ind)
    return allPerms, ind

Thursday, October 25, 2012

matplotlib on Mac OS 10.7.5 64 bit machine

Problem:
Installing matplotlib on Lion was not trivial. If you follow most tutorials you can import matplotlib but it fails at importing matplotlib.pylab!

What did not work:

http://fonnesbeck.github.com/ScipySuperpack/
http://penandpants.com/2012/02/24/install-python/
http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/
http://wolfpaulus.com/journal/mac/installing_python_osx
http://sourceforge.net/projects/matplotlib/files/matplotlib/
For Lion: sudo easy_install -N -Z https://dl.dropbox.com/u/233041/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg

What worked:
1.The problem disappeared when I downloaded the python 2.7.2 specifically for 64 bit machines at:
http://python.org/ftp/python/2.7.2/python-2.7.2-macosx10.6.dmg

2.Follow the tricks here till step 6: http://wolfpaulus.com/journal/mac/installing_python_osx

Tuesday, October 09, 2012

Letterbox plugin stopped working after update

Problem: 
I updated my MacOS and my letterbox plugin stopped working.

Fix:
Install http://www.macupdate.com/app/mac/37804/mailpluginfix

Thursday, September 20, 2012

Bibtex Citations



Problem: Some authors' first name appear as full while others appear abbreviated.


Solution: You are using one of the plain style bibliographies. Switch to one of the following depending on the package your are using:

\bibliographystyle{abbrvnat} 
\bibliographystyle{abbrv}