Wednesday, October 24, 2012

Finding a Good Platform for Learning to Program

Learning to program requires many conditions to succeed.  Besides motivation, an easy programming language, and efficient platform will be great help.  In old days, anyone's first program will print "Hello, world!".  In today's visual world, it's simply not good enough.

I have been searching for efficient language/platform to help ease the pain of learning programming.  For past several years, I decided Java is the Language/platform.  It's very capable to doing graphics.  There are many great free IDEs such as Eclipse and Netbeans, for writing programs.  A couple of week ago, I found a better one.

Khan Academy is offering computer programming lessons now.  They provide a web page for interactive programming, besides many tutorial video of programming examples.  The Language they have chosen is Proccessing.  I played around a while and love it.

The code on the left figure generates the shapes on th right.  If you click a number in you code, a sliding bar appears on top of it.  By dragging the sliding bar, the shape will move/deform with you. I encourage that all beginner and veteran programmers should try it out.  I have coded several examples and everyone is welcome to play with them and freely copy them: pi-computationnumerical-integrationroot-finding-newtons-method.

After many years of programming in several languages for scientific purposes, I always find it hard to program a simple computer game in any environment.  Now with this web based Processing environment, I programmed a simple game: angry-monkey.  I am thrilled!  I think every game loving teenage (and teenage within) should start to do game programming now!

Wednesday, July 11, 2012

Half Way through Grace's China Trip

Grace has been to China for 20 days today.  This is the second time she is away from home for more than a couple of days.  A couple years ago, she was with a leadership program, a kind of summer camp for high school students for fiver days in Boston.  This time she is on the other side of the globe.  She is there with her aunts, uncles, and many cousins.  She is mostly having fun.

This is the last summer before she goes to college.  The main reason for this China trip was for her to help Alun, one of her cousins,  with his English.   Alun just graduated from college and plans to come US for a graduate degree.  It turned out he just got girl friend several month ago, and was not in the mood to learn English.  Luckily, Grace has many cousins.  She flew from south to north of China to spend some fun time with families from her Mom's side.

We had a nice chat with her through Skype.  I remind her that several years ago she stopped by my office and wrote this message on my whiteboard.  It's still here.  I just took a picture, as shown below.  Grace has been very sweet recently.  She has matured greatly for past several months.  She used to get upset with me and stopped talking to me for several days a time.  I keep this message on my whiteboard just to remind me she loves her Dad always.   And she does.


Tuesday, May 1, 2012

Grace is Going to College

Grace is going to college this fall.  She was accepted by several University of California campuses: Santa Barbara (with $6000 scholarship), Davis (with Regent scholarship)  San Diego (with $2000 scholarship), Los Angeles, and Berkeley.  She is going to UC Berkeley.

Grace has always been a good student.  Last time she got a B was when she was in six grade, for her PE.  Grace always finishes her homework on time.  She never complains about the load of her school work.  Grace is reasonably good at math and science, and she is talented in writing.  Her favorite subject is biology, although she hasn't decided her major, yet.  She still has a lot of time to do that.

Mom, Dad and Pete went to Cal Day with Grace.  We went to many events.  We heard many students talking about UC Berkeley.  We also met a Grace's friend from her Saturday Chinese School days.  She started attending Berkeley this spring.  She showed us around her residential place.   Grace certainly had a good time.  She very excited about college now.

Netbeans vs. Eclipse, round 2

Netbeans had been my favorite IDE for quite a while.  Besides the fact that it has all the features a modern IDE has to have, it has easy-to-use GUI tools for Java programming.  Java has been my favorite programming language for several years now.  I not only use Java for scientific algorithm development, also for many GUI tools.  Netbeans fits the bill perfectly.

Netbeans generates Java codes with a developer's drag and drop.  The results are most time usable but not precise.  The generated codes are locked, i.e., not editable.  Fine tuning the GUI layout is nearly impossible.  Recently, I needed to arrange the GUI layout of a Java project precisely, and Netbeans' GUI tool was just not satisfying enough.  I went on searching and came across with WindowBuilder.

WindowBuilder is a Eclipse plugin for Java GUI programming.  Like Netbeans, it let a developer drag and drop.  Like Netbeans, after the Java code is generated after dragging and dropping, a developer can edit the code and WindowBuilder can read back the manually edited code and new GUI can be displayed under design mode. However, WindowBuilder does the job better than Netbeans does.  The cycle goes on.  This is simply amazing.  I still like Netbeans and use it from time to time.  But most of time I use Eclpise.  Of course, I spend a lot of time developing for Android and Eclipse is practically the only IDE for it.


Wednesday, March 7, 2012

Tools for Java Lessons

Pete was complaining that teaching his friends Java through screen sharing was not very efficient, since you can share your screen to one other person at a time.  He also said that video chatting using Skype can only work with one other person, too.  If you want to have video conference with more than one party, you have to pay for it.  I certainly am not ready to pay to teach lessons, yet.

After having thought about the efficient ways to deliver the lessons, I realized that we can use Google+ hangout for multi-party video conferences.  And video from screen capture should be a clear way to deliver a programming tutorial.  I have seen many tutorials from Youtube, but have never done it myself.  I went searching and found Ksnapshot for Linux among other apps, and several other free apps for windows.  I tried out Ksnapshot and really liked it.  Pete will find a Windows app he likes.

So, with a blog for the text part of material, a screen video capture tool for video tutorials, and Google+ hangout for video conferences, we are all set for the exciting Java programming lessons to come, I think.

Tuesday, March 6, 2012

iRobot + Kinect + Java

A while back I bought iRobot Create, the vacuum cleaner without the cleaning part, under the pretense that Pete will learn to do more interesting programming with it.  Secretly, I myself wanted to do a little programming with a robot, and didn't want to start from scratch.  The vacuum cleaner seams to be the right equipment to start.  We got the command module with iRobot and was able to program it to do simple things.  But we wanted more.  We want it be able to see with a webcam, or maybe Kinect.

iRobot has a serial port the can communicate with outside world, say, a light laptop.  The choice of programming language is Java.  I decided that C++ is unnecessarily difficult for a teenager as a starting programming language.  I have to confess that I prefer Java to C++ for my day job, too.  We got a laptop running Windows XP to communicate with it.

The laptop can detect simple printed signs, such as "L30", "R90", for "turning left 30 degree" and "turning right 90 degree", respectively.  The programming using simple computer vision algorithms which I develop for my day job.

I really want get away from Windows, and use Linux, instead.  The combination of Linux+Java+serial port was not easy at first.  After many long searches, I settled with RXTX, an open source package for Java serial port programming.  It turns out that you don't have compile the package from the source.  It's ready to be installed for Ubuntu.  My combination of Linux+Java+serial is working smoothly now.

I got Kinect working under Windows 7 Ubuntu 10.10 with OpenNI, but I am running Ubuntu 11.10.  I am not sure I should wait for Kinect with OpenNI ready for 11.10, or downgrade to 10.10.  So many things to do, so little time.

Monday, March 5, 2012

Java IDE: Netbeans or Eclipse?

I started my Java programming using Netbeans about five years ago, and it has been my favorite IDE ever since.  Netbeans is always compared with Eclipse.  Both IDEs has their loyal followings.  I like Eclipse, too.  As a matter of fact, I started using Eclipse about 10 years ago, when I was programming with Python.

When Nokia released Symbian SDK, programming for smart phone become possible.  With it, come many possibilities.  I started developing applications for Nokia 6681, and later N81, N95.  The only practical IDE was Eclipse.  For our applications, processing speed was, and still is, critical.  So, we always using C++.  Unfortunately, Nokia's version of Eclipse/SDK left a lot to be desired, and developing for Symbian was a painful process.

Then came Android, for which Eclipse has been the only practical IDE.  This time, coding was much more pleasant.  To have simple application with live video working, you only need one file, two classes, and under 100 lines of code together.  For extra speed, you can put CPU intensive code in C++.  Everything is just perfect.  But for algorithm development, with happens on desktop/laptop, I still prefer Netbeans.

Netbeans comes with palette, with makes simple GUI programming a breeze.  You can simply drag/drop panels, menus, buttons, and so on.  You can build an events-driven application with GUI very quickly.  I have been very happy with it for many years, until a couple of weeks ago, when I need to make the application I have been developing more professionally looking.

Netbeans' drag and drop GUI programming, while easy, is always awkward to use.  The layout is always difficult to get precise.  The end result is always amateur looking.  I do mind at all when I was only concerned with algorithm development.  This time, the application I am developing is going to be used by many low-vision doctors and other professionals in the low vision field.  All of a sudden, the appearance become very important.

I was searching for a better tool for Java GUI programming and finally came across WindowBuilder plugin for Eclipse, donated by Google.  After working with it for a couple of days, I am hooked.  Like Netbeans, you drag/drop GUI components, unlike Netbeans, you can manually edit the generated code, and the new edits will be picked up by WindowBuilder.  So the it a two-way tools.  The generated GUI code by Netbeans cannot be edited.  After many trials, I got the exact layout I want for my application.