May 31, 2013

[Link] 10 Object Oriented Design Principles Java Programmer should know

Nice posting on OOD for Java.


  • Don't repeat yourself.
  • Encapsulate what changes.
  • Open closed design principle.
  • Single responsibility principle.
  • Dependency injection or inversion principle.
  • Favor composition over inheritance.
  • Liskov substitution principle.
  • Interface segregation principle.
  • Programming for interface not implementation.
  • Delegation principle.

May 28, 2013

Game: Karateka

Retro Karateka game revamped for iOS -- it was a shocking experience seeing Karateka for the first time back in 80's.  Its realistic animation amazed everyone back then.  I believe it was written by the same programmer who developed Prince of Persia.

Last year (2012), it was revamped for iOS, and also there is the classic Karateka for iOS as well:

New Karateka in iTune
Classic Karateka in iTune

I had the apps (new Karateka and the classic) installed and played with my son -- he's not too impressed with the classic version.  It's difficult and too much waiting time (just like real Apple II!) between selecting menus or between different screens (e.g. restarting the game).

And for the new version, my son loved it, but he finished the game in 1-2 hours.  It's way too simple and easy.  Its graphic is very nice and game itself is not too violent -- just martial art style fighting.  iTunes has 9+ rating.

May 27, 2013

Book: The Most Human Human: What Talking with Computers Teaches Us About What It Means to Be Alive

Amazon's Book Description:
Each year, the AI community convenes to administer the famous (and famously controversial) Turing test, pitting sophisticated software programs against humans to determine if a computer can “think.” The machine that most often fools the judges wins the Most Human Computer Award. But there is also a prize, strange and intriguing, for the “Most Human Human.”

Brian Christian—a young poet with degrees in computer science and philosophy—was chosen to participate in a recent competition. This playful, profound book is not only a testament to his efforts to be deemed more human than a computer, but also a rollicking exploration of what it means to be human in the first place.

* * *

I played with Eliza clone when I was a kid, and fascinated by it at first, but got quickly bored of its simple responses.  Nowadays, it's probably true that everyone has talked to a voice automated system or chat-bot for support on some company's web site.  And there are several chat-bot apps for mobile platforms.

As I study on various AI topics like NLP, ANN, etc, and got to know about Turing Test.  This book talks about Turing test and related thoughts, that makes (me) to think about languages, intelligence and meaning of communication more deeply and in different ways.

It is not a technical book with full of algorithms and mathematics.  It's an easy reading you can breeze through it quickly, but still gain a lot of insights and many interesting stories to be fascinated of, and thought provoking.

I really enjoyed the book and couldn't wait 'til get a chance to read it each day.  No wonder why this book got so many good reviews on Amazon.

May 26, 2013

Apple II game: Star Blazer

This was one of my favorite games when I was a kid, playing on Apple II.  I was so fascinated by the movement of dropping bombs and the chasing rockets.  I programmed in BASIC and assembly back then, and knew some graphics programming (bitmap, page switching, vector, a bit of 3D) on it -- I was amazed and puzzled how such smooth realistic bomb dropping and chasing rocket movement was programmed.

It was fun days -- things were simple and more fun programming trying to figure out how things were done -- algorithm and graphics wise.

May 25, 2013

Book: Handbook of Neuroevolution Through Erlang

What is Neuroevolution? (Wikipedia):
Neuroevolution, or neuro-evolution, is a form of machine learning that uses evolutionary algorithms to train artificial neural networks. It is useful for applications such as games and robot motor control, where it is easy to measure a network's performance at a task but difficult or impossible to create a syllabus of correct input-output pairs for use with a supervised learning algorithm. In the classification scheme for neural network learning these methods usually belong in the reinforcement learning category.

Amazon's Book Description:
Handbook of Neuroevolution Through Erlang presents both the theory behind, and the methodology of, developing a neuroevolutionary-based computational intelligence system using Erlang. With a foreword written by Joe Armstrong, this handbook offers an extensive tutorial for creating a state of the art Topology and Weight Evolving Artificial Neural Network (TWEANN) platform. In a step-by-step format, the reader is guided from a single simulated neuron to a complete system. By following these steps, the reader will be able to use novel technology to build a TWEANN system, which can be applied to Artificial Life simulation, and Forex trading. Because of Erlang’s architecture, it perfectly matches that of evolutionary and neurocomptational systems. As a programming language, it is a concurrent, message passing paradigm which allows the developers to make full use of the multi-core & multi-cpu systems. Handbook of Neuroevolution Through Erlang explains how to leverage Erlang’s features in the field of machine learning, and the system’s real world applications, ranging from algorithmic financial trading to artificial life and robotics.

* * *

Disclaimer: I'm not an AI expert -- it's just my personal interest.

When I first started to study Erlang, I was very excited that it is the language for ANN.  And while I reading/studying on GA/GP -- it seems natural that ANN and GA/GP should be emerge.

I wanted to find more on ANN in Erlang implementation but I only found very few resources and examples (may be I didn't try hard enough) -- unfortunately, they were all very rudimentary basic ANN implementation, more of a proof-of-concept.  I also wanted to find a way to combine ANN and GA/GP.  Then I found this book.  It felt like I struck a gold mine -- I ordered the book right away.  I'm still in the middle of it and I enjoy every minute of reading it.  I highly recommend this book.


Book: C++ Concurrency in Action

When I reviewed this book, C++11 wasn't available, and it was called C++0X then; and the development branch of GNU g++ didn't support all the features of the threading specification.  I  haven't dealt with C++ since then, so not sure how things are in 2013, but it was surely a good reading.  Just quick look at the Amazon now, it seems like the book is on demand and many people purchase it despite the high price.

Well, as a Java developer, Java surely made threading so darn easy.  (But still not easy to get it right!) :-)

May 24, 2013

Book: ElasticSearch Server

As far as I know, this is the only printed book on ElasticSearch.  I think Manning has an early access book on it too, but not published yet.  There are many blogs and articles, and ElasticSearch site has many documents too -- but I found the information is too scattered and needed a book, and this was the only one available anyway.  It is actually good and very helpful.  However, it seems that it was rushed to print and I hope the next edition of this book has more special cases and real examples.

ElasticSearch is very impressive software, and there are a lot of things it can do, and so many things can be configured, but no decent document on it (yet), and googling and reading documents available through out the net just takes too much time, and not organized, therefore it's confusing, especially after reading so many postings on the web.  The book helped a lot, but still, for your unique problems, it's better to interact with the community.

What is ElasticSearch? (Wikipedia):
ElasticSearch is a distributed, RESTful, free/open source search server based on Apache Lucene. It is developed by Shay Banon and is released under the terms of the Apache License. ElasticSearch is developed in Java.

May 23, 2013

Book: Web Application Architecture - Principles, Protocols and Practices

I've reviewed the Search section with Otis (co-author of Lucene in Action), and read the whole book -- I know the author personally, and he's one of the most intelligent and energetic person I've known.  The book covers most of the internet technologies and common web application architectures -- and any developers must read this book.

Book: Taming Text

When I was reviewing this book for Manning, I was quite surprised that this book covers all the things I and my colleagues were doing -- NLP, search, entity extraction, categorization, topics, etc...  And with great examples.  If you're working on one of those, you ought to get this book.

May 22, 2013

Book: Hadoop in Action

There are several books on Hadoop now, but this stands out that it's a good introduction book.  I reviewed this book for Manning publication before it was published.  It's a bit old book now -- so unless you can get this really cheap price, I would recommend get another recently published Hadoop book. :-)

Book: Lucene in Action

The popular open source search engines as Solr and ElasticSearch are based on Lucene.  And this is the only book on Lucene library -- and it's written quite well too.

Book: Erlang and OTP in Action

Erlang got a lot of attention until 2-3 years ago, but I noticed more demands on Erlang skill nowadays.  As usual, Manning's In-Action series books, this book introduces Erlang quite well.

What is Erlang? From Wikipedia:
Erlang is a general-purpose concurrent, garbage-collected programming language and runtime system. The sequential subset of Erlang is a functional language, with strict evaluation, single assignment, and dynamic typing. It was designed by Ericsson to support distributed, fault-tolerant, soft-real-time, non-stop applications. It supports hot swapping, so that code can be changed without stopping a system.

By its nature - being functional, distributed and actor based concurrency model, it is the way to do next level of parallel programming, IMO.

Book: HBase in Action

What is HBase?
"Apache HBase is the Hadoop database, a distributed, scalable, big data store."

HBase is an open source, non-relational, distributed database modeled after Google's BigTable and is written in Java. It is developed as part of Apache Software Foundation's Apache Hadoop project and runs on top of HDFS (Hadoop Distributed Filesystem), providing BigTable-like capabilities for Hadoop. That is, it provides a fault-tolerant way of storing large quantities of sparse data.

And this is a book on HBase.  :-)  I've reviewed this book for Manning, and found it's very easy to follow, like any other Manning's in-action series books.

May 21, 2013

Book: Hibernate Search

It was published in 2009, and a bit old – but regardless it is a good book to have and read.  It shows various techniques using search/lucene in practical ways.
I’ve reviewed this book for Manning publication, and I highly recommend this book.

May 19, 2013

Moving VirtualBox's VM files to a different location

Disclaimer: I use Oracle VirtualBox v4.12.2 (updated recently) on Windows 7 64bit.  This instruction may not apply to other version of VirtualBox.

I recently had to move my VM files to a different drive as I'm running out of space on my C: drive.  When I google'd on moving VM files to different location, I only found methods for older version of VirtualBox, involving XML file, which doesn't apply to the version I have.  After playing around with it a bit, I figured out how.

Change the default location of VM files

VirtualBox's default configuration is to create VM files in C: drive -- and this may not be the desirable location.  If no VM has been created yet, the default location can be changed by going to: File -> Preferences (Ctrl-G), and VIrtualBox-Settings dialog box will pop up.  Change the "Default Machine Folder" setting.



Move existing VM files to different location

If a VM is already created -- one caveat is the drive file(s) can be moved, but log files and setting files will still be located where they are created (with this method).  This method doesn't modify any registry or XML files but just using the VirtualBox Manager UI.

  1. Shutdown the guest VM.
  2. Copy the VM folder to a different drive or directory.  E.g. I copied the whole directory "C:\Users\kkim\VirtualBox VMs\CentOS-1" to "G:\VirtualBox VMs\CentOS-1". 
  3. From the VM Virtual Manger go to File -> Virtual Media Manager.   (a) Right click on the drive of the VM you want to move, and select "Release".  The entry should be still there.  (b) Right mouse click on it again, and select "remove".  Since the files were already copied, it is safe to delete the file, but it's not necessary.

  4. From Virtual Manager GUI, right mouse click on the VM, select "settings."  Then Click on General, and "Advanced" tab.  And change the Snapshot folder location to a different VM file location:
  5. Click on Storage and click on "Add Hard Disk" icon next to "Controller: SATA", click on "Choose existing disk":
  6. Select the VM disk file you moved, and start the VM. 


Pretty simple.