How to install Octave in Mac OS Yosemite ?

I was trying to execute my Octave scripts to recognize digits using a Neural Network. Octave did not work after I upgraded to Yosemite. Now it works after these steps. It may look simple but this wasted several hours.

brew tap homebrew/science

sudo chmod -R 777 /usr/local/share

brew link –overwrite xz

brew install gcc

I thought this prevented the gcc installation from completing.

==> ../configure –build=x86_64-apple-darwin14.3.0 –prefix=/usr/local/Cellar/gcc/5.1.0 –li
Error: Permission denied – /Users/radhakrishnan/Library/Logs/Homebrew/gcc

So I changed the permissions and tried again.

sudo chmod 777 /Users/radhakrishnan/Library/Logs/Homebrew

brew install gcc

sudo chmod -R 777 /usr/local/include/freetype2

brew link freetype

brew install octave –with-x11

Java byte code in practice

I am listening to Rafael on Virtual JUG

Screen Shot 2015-05-20 at 10.27.03 am

Deep learning course at the University of Oxford.: 2014-2015 and another MIT book


I am viewing these Course materials with a feeling of awe. I hope these resources provide some fodder for this blog and my imagination.

One more.

An MIT Press book in preparation

Yoshua Bengio, Ian Goodfellow and Aaron Courville


One more.

The wonderful resources by Andrej Karpathy

‘mvn package’ through our debilitating NTLM proxy

I was morose, grief-stricken and close to tears when our evil corporate proxy stopped me from doing anything. Each tool needs a different type of parameters to pass through this proxy. I tried to use cntlm but that did not help. After many hours I realized that this settings.xml builds everything properly.

There are two proxy sections but I have not attempted to remove one. It is working as it is.

<settings xmlns=""
    <!--make the profile active all the time -->
      <!--Override the repository (and pluginRepository) "central" from the
         Maven Super POM -->
      <name>Maven Plugin Repository</name>


I have been building and quickly exploring various JDK 9 features during this past weekend.
There is a new REPL now among other gems. I will update this post as I explore it further.

Mohans-MacBook-Pro:openjdk radhakrishnan$ java -version
java version “1.9.0-ea”
Java(TM) SE Runtime Environment (build 1.9.0-ea-b61)
Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b61, mixed mode)
Mohans-MacBook-Pro:openjdk radhakrishnan$ java -jar kulla-0.508-20150510054454.jar
| Welcome to JShell — Version 0.508
| Type /help for help


-> String s = “__mainn__”.replaceAll(“[^a-z\\s]”, “”);
| Added variable s of type String with initial value “mainn”

-> System.out.println(s);

-> mainn

-> final Map count = s.chars().map(Character::toLowerCase).collect(TreeMap::new, (m, c) -> m.merge((char) c, 1, Integer::sum), Map::putAll);
| Warning:
| Modifier ‘final’ not permitted in top-level declarations, ignored
| final Map count = s.chars().map(Character::toLowerCase).collect(TreeMap::new, (m, c) -> m.merge((char) c, 1, Integer::sum), Map::putAll);
| ^—^
| Added variable count of type Map with initial value {a=1, i=1, m=1, n=2}

-> int x = 26;
| Added variable x of type int with initial value 26

-> count.entrySet().stream().sorted((l, r) -> r.getValue().compareTo(l.getValue())).forEach(e -> count.merge(e.getKey(), x–, Math::multiplyExact));

-> System.out.println(count.entrySet().stream());
-> stream.ReferencePipeline$Head@548a9f61

-> System.out.println(count.entrySet().stream().mapToDouble(e -> e.getValue()).sum());

Everything can be changed in the REPL. Nothing is final and it is ignored. That is what told me.

Resolution for MacOS issue related to freetype

A new pull request is submitted.

git clone

cd adoptopenjdk-getting-started-kit

git remote add upstream

git fetch upstream

* [new branch] Nashorn -> upstream/Nashorn
* [new branch] master -> upstream/master
Mohans-MacBook-Pro:adoptopenjdk-getting-started-kit radhakrishnan$ ls cover.jpg cover_small.jpg en pt
Mohans-MacBook-Pro:adoptopenjdk-getting-started-kit radhakrishnan$ cd pt
Mohans-MacBook-Pro:pt radhakrishnan$ ls
AdoptOpenJDKLogo-100×100.png intermediate-steps
adopt-openjdk-getting-started known-issues
advanced-steps openjdk-projects
binaries source-code
cover.jpg virtual-machines
Mohans-MacBook-Pro:pt radhakrishnan$ cd known-issues/
Mohans-MacBook-Pro:known-issues radhakrishnan$ ls
Mohans-MacBook-Pro:known-issues radhakrishnan$ cat
# MacOS

The configuration fails because it does not find **freetype

configure: error: Could not find freetype!
configure exiting with result code 1

Check if **freetype** is installed

$ brew install freetype
Error: freetype-2.5.3_1 already installed
To install this version, first `brew unlink freetype’

Since it is already installed we configure like this.

$ bash configure –with-freetype-include=/usr/X11/include/freetype2 –with-freetype-lib=/usr/X11/lib
A new configuration has been successfully created in
using configure arguments ‘–with-freetype-include=/usr/X11/include/freetype2 –with-freetype-lib=/usr/X11/lib’.
Mohans-MacBook-Pro:known-issues radhakrishnan$ git commit -m “Resolution for MacOS issue related to freetype”
[master 9173bc0] Resolution for MacOS issue related to freetype
1 file changed, 18 insertions(+)
Mohans-MacBook-Pro:known-issues radhakrishnan$ git push origin master
Counting objects: 10, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 786 bytes | 0 bytes/s, done.
Total 5 (delta 3), reused 0 (delta 0)
6f1c9e0..9173bc0 master -> master


I started with this code which motivated me to explore ES6 further.

        let m = new Map();


        for (let [k, value] of m.entries()) {
            m.set(k, (m.get(k) * 2))

        for (let value of m.entries()){
            console.log('Value [' + value + ']');


Earlier I had cooed with pleasure when I coded this.

Now I want to push my luck. So I managed to wangle this code in bits and pieces from some EcmaScript6 aficianodos 🙂

I find it hard to admit that this code is not easy even for someone who claims to have rich experience with Java and software !! Bugs in this code are a different matter altogether.

Moreover since the sorted order changes somehow the result is different than the result of the Java code but I don’t have the motivation to fix this. This is actually an investigation of EcmaScript6 after all.

        var map = new Map;
            .map(c => c.toLowerCase())
            .forEach(c => map.set(c, (map.get(c) | 0) + 1));

        let a = [];

        var x = 26;
        a.sort(([k1, v1], [k2, v2]) => v1 < v2).forEach(([k, v]) =>
                                                            console.log( 'k [' + k + '] v [' + v * x--+ ']');
LOG: 'Value [m,1]'
LOG: 'Value [a,1]'
LOG: 'Value [i,1]'
LOG: 'Value [n,2]'

LOG: 'k [n] v [52]'
LOG: 'k [m] v [25]'
LOG: 'k [a] v [24]'
LOG: 'k [i] v [23]'