Thursday, March 6, 2014

MOOC Review: MongoDB for Java Developers

* This review is my personal review on the course and is not sponsored by MongoDB, Inc. 

Course Name:
M101J: MongoDB for Java Developers
Link:
https://education.mongodb.com/courses/10gen/M101J/2014_March/about
Institution:
MongoDB
Instructors:
Andrew Erlichson, Jeff Yemin

The most difficult part of the course, in my opinion, was the first week, in which I had to install things on Windows, which was not too easy. This was partially because the videos were mainly for... (I forgot the OS used in the demo, but it should be the like of Linux.) Still, with the discussion forum and other online resources, I was still able to install and use things on Windows.

Although something later in the course still varied from OS to OS, the cases were handled easily and well by some text explanations. This is why I did not encounter many issues after the first week.

I usually learn better by reading than by watching videos, so it scared me in the first week that the course was mainly composed of videos. However, the instructors' voice was clear, and subtitles were available. Therefore, I got used to the mode as the course progressed.

The videos introduced MongoDB and its Java driver. The non-driver part is almost the same as that for two other courses offered by MongoDB University - M101JS: MongoDB for Node.js Developers and M101P: MongoDB for Developers as far as what I completed (I did not complete the other two). The Java driver part can be learned more easily with the API documentation.

Most videos were short, and it was not difficult for me to pay attention for the duration of a video.

Sometimes comparisons between MongoDB and relational database were introduced. It might be interesting to those who know relational database as I do.

Most videos were followed by quizzes, which helped understand what was covered by the videos and did not count toward the certificate. They were helpful in my opinion. The types included multiple choice and scripting, and the problems were similar to some of the weekly assignment problems.

The assignments included multiple choice, scripting, and programming problems. The scripting ones were done either on the browser or on MongoDB Shell, depending on the problem. These helped me get familiar with commands on MongoDB Shell. The programming ones typically involved using the Java driver and building a blog (the user interface design was provided, so one did not have to make one).

The blog project was interesting to me in that it increased experience working on something complicated.

The final exam was like the assignments, but the problems required more thinking to deal with the data.

The last week of the course contained the final exam and case studies. The case studies were interviews with Jon Hoffman from Foursquare and Ryan Bubinksi from Codecademy. It was interesting to learn more about these two websites.

In general, the course was organized, and the quality of the materials was good. The difficulty was okay (except for the first week for Windows users who are not familiar with IT stuff). There was also help on the discussion forum from the staff and other participants. The course should serve as a good introduction to MongoDB.

Wednesday, March 5, 2014

MOOC Review: Artificial Intelligence Planning

Course Name:
Artificial Intelligence Planning
Link:
https://www.coursera.org/course/aiplan
Institution:
The University of Edinburgh
Instructors:
Gerhard Wickler, Austin Tate


Although I could not spend much time on this course, I managed to complete the Awareness Level of the course (rather the Foundation Level and Performance Level, which required more commitment to the course). Below are two badges I got from this course (I like to collect badges).


Badge awarded to all participants who start the MOOC. 


Badge awarded to all participants who successfully complete the MOOC at the Awareness Level. 

The requirements for the Awareness Level were watching certain videos and completing the final exam for the Awareness Level. For the Foundation Level, one had to take the final exams for the Awareness Level and for the Foundation Level. Both the levels had their own minimum marks to pass. As for the Performance Level, one had to take both the final exams and choose from two programming assignments and one creative challenge to pass the required minimum marks.

The videos included "Feature" videos and typical lecture videos. The Feature videos introduced Artificial Intelligence (AI) Planning's history and applications. These did not have much technical detail and were suitable for people of little technical background. For those who did not intend to get a certificate, simply watching the Feature videos might be good enough.

The lecture videos contained much more technical stuff, including algorithm introduction and pseudocode. Even for the Awareness Level, one had to watch some of these. These help with the programming assignments. The instructors' voice was clear, and they paused appropriately. It was easy to listen even without the pause function and subtitles of the video.

The programming assignments were based on the lectures and did not have tricky problems. One simply had to make use of the algorithms and concepts learned. I managed to complete the first one when I had time. I did not take much time.

The creative challenge is flexible, but most people who completed chose to introduce fields where AI planning is used and technology related to AI planning. Their works were linked on discussion forums. It was interesting to browse through the classmates' projects. I thought of introducing AI planning for image processing, which has been researched more than 15 years (I do not know exactly how long the history of this field is), but was unable to allocate time for this.

After the 3rd week of the course was a break week, which was very useful for busy people to catch up. Without this break week, I would have had no time to complete even the first programming assignment.

On Twitter, the course had its tag #aiplan, and there were many updates and tweets about the course, by the course team or students. The course team handle is @aiplanner. 

In general, the course difficulty was just right in my opinion. Maybe it is because the instructors were not trying to give the students hard time. The variety of resources (such as reference readings) was good. The discussion on the forum was good, too. The creative challenge works by other students were among my favorite about the course.

The course will start again in 2015. Maybe I will take it again to reach a higher level.

Tuesday, March 4, 2014

Ceiling of Square Root of BigInteger in Java

I was working on the programming assignment* of a MOOC dealing with big integers. I chose Java as the language and used BigInteger to handle the giant integers. In the assignment, I had to find the ceiling of the square root of a big integer (to be used somewhere else in the assignment), so I tried to find a built-in function for this. As some people I saw on online discussion forums, I could not find such a built-in function. As a result, I had to either use one coded by someone or implement one myself. The later was easier for me because by doing that, I did not have to worry about possible lack of background knowledge to understand a decent but difficult algorithm. 

(* Because the assignment is not about finding the ceiling of the square root of an integer, the code in this article does not violate any code of conduct. In fact, finding the ceiling of the square root of an integer for this assignment can be done by programming in another language using that language's libraries.)

Because what I wanted was the ceiling, which is also an integer, a simple algorithm for the approximation of the square root can lead to such a ceiling. I wrote a function for this for positive integers (for the assignment's purpose, many checks were unnecessary and therefore omitted): 

    /***
     * Finds the ceiling of the square root of an integer
     * @param N: the integer whose square root to find
     * @return the ceiling of the square root of N
     */
    public static BigInteger biSqrt(BigInteger N) {
        BigInteger o = new BigInteger("1");
        BigInteger t = new BigInteger("2");
        
        BigInteger u = N; // upper bound of search region
        // initial search value = ceil(0.5*N)
        BigInteger r = N.mod(t).compareTo(o) == 0 ? N.divide(t).add(o) : N.divide(t);
        BigInteger b = new BigInteger("0"); // lower bound of search region
        
        // new search value is ceiling of mid of upper and lower bounds
        while (true) {
            BigInteger r2 = r.pow(2); // square of search value
            
            if (r2.compareTo(N) > 0) {
                // too large, lower search upper bound
                u = r;
                BigInteger s = u.add(b);
                r = s.mod(t).compareTo(o) == 0 ? s.divide(t).add(o) : s.divide(t);
            } else if (r2.compareTo(N) < 0) {
                // too small, increase search lower bound
                b = r;
                BigInteger s = u.add(b);
                r = s.mod(t).compareTo(o) == 0 ? s.divide(t).add(o) : s.divide(t);
            } else {
                // find the value
                break;
            }
            
            // handle non-integer square root, 
            // whose ceiling = final upper bound
            if (u.compareTo(r) == 0) {
                break;
            }
        }
        
        return r;
    }

If executing these: 

        BigInteger z = new BigInteger("0");
        BigInteger o = new BigInteger("1");
        BigInteger t0 = new BigInteger("9");
        BigInteger t1 = new BigInteger("11");
        BigInteger t2 = new BigInteger("1099511627776"); // 2^40
        BigInteger t3 = new BigInteger("1099511627777"); // 2^40 + 1

The results are: 

0
1
3
4
1048576
1048577

The code was not reviewed by anyone other than myself, so it might have issues. Also, there are better algorithms for the same task. However, this should suffice for completing the assignment in Java. 

Any constructive feedback will be appreciated. 

Thursday, January 30, 2014

Data Mining with Weka: Enrolments open for a new session of Data Mining w...

Data Mining with Weka: Enrolments open for a new session of Data Mining w...: Enrolments have opened for a new session of  Data Mining with Weka :   http://weka.waikato.ac.nz   The course will start on 3rd Marc...



The MOOC on data mining will start again on March 3rd, 2014. Visit its blog for more information.

Tuesday, January 28, 2014

Signal Detection Theory and Rods: Thoughts on Fred Rieke's Guest Lecture

This week, the Computational Neuroscience course on Coursera has a guest lecture by Fred Rieke, a professor in Department of Physiology & Biophysics at University of Washington. In the lecture, he talks about single photon detection with rod signals and noise under dim light.

-----
My summary of his talk: 

Between the rods and the rod bipolar cell connected to them, there can be a nonlinear filter having a threshold to determine whether a photon is detected or not. The threshold is one for the amplitude of the received signal, which can be contributed by the signal resulted from the photon or noise.

How to pick a threshold to have a higher possibility of correctly determining whether a photon is received is the main topic of the talk. If applying the maximum likelihood using the probability distribution of the amplitude of the signal and noise without considering the probability of receiving a photon, the threshold picked is lower than that if the probability of receiving a photon, which is quite low, is considered.

Therefore, a reasonable pick on the threshold is one at which the probability of the received signal being noise is extremely low. What is emphasized is that the prior probability matters.
-----

In his lecture, my favorite part is the application of the signal detection theory, which I used when learning basic radar detection concepts, to single photon detection in neuroscience. For me, this is a new application of the same theory I learned before, which is interesting.

From his lecture, I learned more about the rods beyond what I had learned before about the nervous system and a beautiful model (I assume it is a simplified one) about the rod signals.

The most difficult part in the lecture, for me, is the new materials about the cells. Although not long, it took me a little time learning about the rod and cone bipolar cells.

Thanks to my random signal processing professor, whose help made me able to enjoy this lecture quite a lot, and thanks to the Computational Neuroscience course instructors and staff, as well as Fred Rieke, who brought this good experience for me.

Thursday, January 9, 2014

Step into Databases

I finally started learning about databases. I found many useful resources online, but the resources I am using are the Stanford Online and MongoDB University MOOCs. Udacity's data science courses seem interesting, too, but I do not have time for them for now. (I have added the two websites to the MOOC Resources page.)

I had played with SQL before, but I did not have enough (in my own opinion) understanding about databases. I hope these courses can help me be comfortable with databases.

The webpages of the courses I mentioned:

Stanford Online - Introduction to Databases https://class.stanford.edu/courses/Engineering/db/2014_1/about
MongoDB University - MongoDB for Java Developers https://education.mongodb.com/courses/10gen/M101J/2014_January/about

Tuesday, December 31, 2013

Proof Wiki Short Review

A resource I used when learning random signals was Proof Wiki (http://www.proofwiki.org/wiki/Main_Page). It has the proofs of many PDFs, CDFs, and PMFs, some of which were not covered in the textbook. Although the proving involved in the introductory random signal course was not hard, having Proof Wiki to compare the methods used to prove were still helpful (inspiring me somehow).

If checking the homepage, one might find that the theories included in Proof Wiki are not only the fundamental ones (ex. complex modulus) but also those more advanced ones (ex. central limit theorem), used in specific engineering and scientific fields.

I am thinking to contribute something, too, but so far, there have been many smart (or simply enthusiastic) people who have contributed the stuff I think of. Maybe some day I can catch up the giants' progress?