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 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;
        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

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:
For Lion: sudo easy_install -N -Z

What worked:
1.The problem disappeared when I downloaded the python 2.7.2 specifically for 64 bit machines at:

2.Follow the tricks here till step 6:

Tuesday, October 09, 2012

Letterbox plugin stopped working after update

I updated my MacOS and my letterbox plugin stopped working.


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: