search


Hello Clojure
Wed Jun 06 00:00:00 UTC 2018

The first thing to do when learning a new programming language is to write an obligatory 'hello world' program. The reason 'hello world' is the first program to write is because it is simple and sucessfully running hello world is a good test that your development environment is setup and configured correctly. We've been using Power Turtle and Maria Cloud because there is no required setup and software installation but to do any serious development you will need a local development environment.

We will be using mainly emacs. Emacs has a relatively high learning curve but it has the benefit of allowing you to code remotely on a server. The majority of Clojure/LISP programmers use emacs for development so there is good tooling and support. However, if you prefer a traditional graphical IDE download and install Intellij Community Edition IntelliJ is an open source Java IDE that supports Clojure/ClojureScript development with the Cursive Plugin Cursive is commercial but as a student you can get a free license

Setup for Windows

If you're using windows 10, install ubuntu for Windows using this tutorial . Once you've installed Ubuntu for Windows, follow the setup instructions for Ubuntu below

Setup For Ubuntu

Open a shell and run the following commands one line at a time. The % represents the command prompt and not what you should type. Type the commands after the % prompt.


% sudo add-apt-repository ppa:kelleyk/emacs 
% sudo apt-get update 
% sudo apt install wget git openjdk-8-jdk emacs26-nox tmux 
% wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
% chmod a+x lein
% sudo mv lein /usr/local/bin
% mkdir -p ~/.emacs.d/lisp
% wget -c https://www.emacswiki.org/emacs/download/doremi.el -O ~/.emacs.d/lisp/doremi.el
% wget -c https://www.emacswiki.org/emacs/download/doremi-cmd.el -O ~/.emacs.d/lisp/doremi-cmd.el
% wget -c https://raw.githubusercontent.com/clojure-emacs/clj-refactor.el/master/clj-refactor.el -O ~/.emacs.d/lisp/clj-refactor.el
% wget -c https://bit.ly/2NlZY2G -O ~/.emacs.d/init.el
% wget -c https://bit.ly/2uNg1ic -O ~/.tmux.conf

After this start the Clojure REPL using lein. Then type (prn "hello world") like below


% lein repl

nREPL server started on port 33333 on host 127.0.0.1 - nrepl://127.0.0.1:33333
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_151-b12
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e

user=> (prn "hello world")
"hello world"
nil
user=>

To exit the repl and return to the command prompt, type Ctrl-D

Setup for Mac

Download JDK 8 for mac. Make sure to download jdk 8 and not 9 or 10. Lein has not been upgraded to be compatible with jdk 9 or 10. Once you've downloaded the JDK, make sure it is executable in your shell. by typing

% java -version

% wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
% chmod a+x lein
% sudo mv lein /usr/local/bin
% mkdir -p ~/.emacs.d/lisp
% wget -c https://www.emacswiki.org/emacs/download/doremi.el -O ~/.emacs.d/lisp/doremi.el
% wget -c https://www.emacswiki.org/emacs/download/doremi-cmd.el -O ~/.emacs.d/lisp/doremi-cmd.el
% wget -c https://raw.githubusercontent.com/clojure-emacs/clj-refactor.el/master/clj-refactor.el -O ~/.emacs.d/lisp/clj-refactor.el
% wget -c https://bit.ly/2NlZY2G -O ~/.emacs.d/init.el
% wget -c https://bit.ly/2uNg1ic -O ~/.tmux.conf

Follow instruction for starting a Clojure REPL in the Ubuntu section.



Graduation
Tue May 22 00:00:00 UTC 2018

Congratulations on graduating. Now what? Is this the end of your education? On the contrary, this day marks the beginning of a never-ending journey.

We are here to talk about your future. I'm not an oracle. I'm nobody famous. Who I am is not important. However, what is important is the message I have to share. The world is changing faster than anyone can imagine. Humanity is on the verge of technological tipping point that will disrupt everything in society. Technological revolution causing disruption and changing human societies are not new but what makes this next revolution unique is that it will make us question what it means to be human both mentally and physically. Artificial Intelligence, Robotics, Cybernetics, CRISPR/CAS9 are posed to challenge our idea of human intelligence and human biology. There will be high unemployment yet many jobs will remain unfilled. Many people will have existential crisis except for the few who have prepared themselves for this future.

If your education has been anything like my primary school education, it has not prepared you for the future. What you’ve learned, if you’ve learned anything, is probably irrelevant for this high tech future. Don’t get me wrong, education is extremely important, but educational institutions all over the world are not equipped to prepare students for this high tech future. Schools are using a teaching model designed to train factory workers for the industrial revolution started a few centuries ago.You are taught and tested to memorize instead of critical thinking and asking questions. What should you do going forward starting from today? Mark Twain said it best, “Don’t let school interfere with your education”

Let me share my experience with education. In primary school, I was not a good student, a below average student at best. However, I did graduate from an Ivy-League University. In Asian culture, there is intense pressure to do well in school but my parents are different. They never gave me any pressure but I felt ashamed when their friends brag how well their kids are doing in school while my parents stayed silent with nothing to brag about. When I was about 10 yrs old, I was tired of being ashamed so I studied hard and became the best student in class with straight A’s. I proudly gave my report card to my parents thinking now they have something to brag about with their friends. My dad’s response was a cold “I’m not impressed”. I was hurt, angry and ran away on the verge of tears. I worked hard to make my parents proud but my dad’s response was “I’m not impressed”? What more does he want? What can be better than straight A’s?

My dad sat me down and asked a few simple question: What does straight A’s mean? What can you do with straight A’s? Can you invent something with straight A’s? Can you make money with straight A’s? He then said he would be impressed if I learn stuff even the teacher can’t teach me. He said go beyond school and teach yourself. He then gave me $50 to buy any book I wanted at the university bookstore. I bought a calculus book even though I did not even know algebra. The book cost more than $50 so I had to ask him for more money.

"Go beyond school and teach yourself" is the most important lesson I learned from my dad and today I share it with you. It has set me on on a lifelong journey of continuous learning. I cannot tell you what to study or what to learn because the future is hard to predict. One thing I know for sure is the future is interdisciplinary and multicultural requiring knowledge in many disciplines like mathematics, the sciences, economics/business, the arts and humanities, different languages and cultural understanding. You need to master English because it is the de facto international language and the totality of human knowledge is available in English or translated into English. Teach yourself but also teach others because in teaching others you will gain a better perspective and understanding of what you've learned. Join me on this lifelong journey of being a student and a teacher.