Wednesday, 3 July 2013

M101J : MongoDB for Java Developers by 10Gen

Recently, I undertook the MongoDB for Java developers course provided by 10gen Education. The course duration is 7 weeks with an estimated effort of 10 hours per week. Delivery of the course material  was online using videos and every week there were weekly assignments and at the conclusion of the 7th week, there was an exam.

As a part of the course-ware, every week there were several short video lectures that discussed various topics ranging from the installation of MongoDB to Sharding and Replication. Each video duration ranged from 2 minutes to 8 minutes and it would take around 2-4 hours to get through all the videos for the given week and complete the associated quiz questions. At the end of the course videos, every week there were also a set of homework questions which had to be completed before the end of the week. These homework questions had a 50% weight-age towards the final score while the final exam made up the other 50% of the course grade.

Overall my experience with the course was very positive. The course has been well designed and the instructors are closely related to the development of MongoDB at 10gen and so have a very clear working on the internals of MongoDB . I had no experience with MongoDB prior to undertaking this course and by the end of the 7th week, I was confident in setting up Replica Sets and Sharded servers.
The only irritant to the course was that it became clear that 10gen Education were running the course for the 1st time for Java developers as there were a few cases when they mixed up data sets and code from the Python version of the course which in turn led to confusion among the students. An unfortunate miss was incorrectly marking a correct answer wrong in the final exam which raised the ire of the students but  most of these problems were ironed out within a day. Apart from these issues, the course material and teaching was very good and if one is looking to learn MongoDB, this course would be a good place to start.

Finally, my exam score. I got 90% in the course. The 10% I lost was in the final exam where I got 2 questions wrong. According to the stats released my 10Gen, "Of the 7,105 students enrolled, 1,434 students completed the course successfully, a completion rate of 20%." To achieve a grade of completion, one needed to achieve a mark of above 65%.

Friday, 7 June 2013

Oracle Java Certification SE 7 : Changes to the exam process

The Java Certification process has undergone a major over haul since Oracle bought out Sun. Since I started looking into the certification process, I thought I'd summarise the changes in the certification process for Java  SE 6 / 7 in the last 3 years.The following table lists some of the major changes to the Oracle Java Programmer certification process.

Exam Code
Number of Questions / Pass Percent
Time For Exam
Certification Name
Is Exam Still Available?
IZ0-803
90(77%)
140mins
Oracle Certified Java Associate /Java SE 7 Programmer I
Yes / Since Oct 2011
IZ0-804
90(65%)
150 mins
Oracle Certified Java Programmer /Java SE 7 Programmer II
Yes / Since Oct 2011 
IZ0-851( Java 6)
60 (61%)
150 mins
Oracle Certified Java Programmer 6
Yes / Since Oct 2011
CX 301-065 ( Java 6)
72/47 (65%)
210 mins
Oracle Certified Java Programmer 6
No / Replaced by  IZ0-851

To summarise, as on June 2013, if you do not hold any prior certification the certification path to becoming a Oracle Certified Java Programmer SE 7 requires, two exams to be taken (IZ0-803 & IZ0-804).  If holding a prior certification, then it is just one upgrade exam (IZO-805)
Please take a look at this post where I am collecting exam preparation resources.

Saturday, 1 June 2013

Configuring Solr 4.0 to index data from a MySQL database


In a previous post, I documented the steps in setting up Solr 4.0 on a Tomcat 7.0.28 instance. In this post, I'll describe the steps involved in configuring the same Solr instance to index data from a MySQL database.

1.Set up another Solr core.

A Solr core holds the configuration details for connecting to a data store as well as the indexed data of the data store.
The simplest way to set up a core is to copy the collection_1 core and re-name the copy 'test_core'
To make Solr aware of this new core, bring up the Solr Admin console at http://localhost:8080/apache-solr-4.0.0/#/
Select the core-admin option and add core and supply the parameters for name, instanceDir, dataDir, config and schema.

As a result of adding this core, the solr.xml file in the root of the solr_home directory will have the following entry

2. Set up the required libraries

Since to index data from the MySQL database, we will be calling a DataImporter, we will need the Solr libraries. The lib directory is available in your downloaded unzipped version of Solr at c:\apache-solr-4.0.0\dist
Copy all jar files within this directory and transfer them to your solr_home. The solr_home directory should look similar to the screenshot below



I could have transferred these jars to my Tomcat/lib and have solr use them from there but I was worried about conflicts with existing jars.
Finally, tell Solr about this lib directory by modifying the solr.xml file and adding the sharedLib="lib" element.
The solr.xml looks like this.


3. Configure your test_core to talk to the database.

To enable this, you'll need to follow the instructions given on http://wiki.apache.org/solr/DIHQuickStart
To summarise, essentially you will :
(a) Modify the solrconfig.xml and add the defintion for a DataImportHandler


  
    data-config.xml
  


(b) Create a data-config.xml file in the same directory as your solrconfig.xml and specify the database connection parameters


  
  
    
      
      
      
    
  

Ensure that the name values in the element have corresponding matches in the schema.xml
For example : The value 'description' should exist in the schema.xml

Finally, we are all set up to import records from our MySQL test schema.

4. Select the test_core in the Solr Admin console and click on the DataImport option which should be last option available in the menu.
Clicking on the DataImport option will bring up the DataImporter Interface, select the Clean and Commit checkboxes and click on Execute Import.

When the indexing is complete, you will see a message giving the number of documents added or deleted.
To check if the indexes have been created as expected and we are getting some sensible results back, perform a Search using 'Query' option
available under the 'test_core'

In my case, I searched for the term 'Hyundai' as I knew of one record having that particular value in the column that has been indexed.
And we get 1 record returned.



Tuesday, 21 May 2013

JExcel vs Apache POI : Reading and Writing Excel Files

JExcel is a relatively simple and robust Java based library for manipulating Excel (.xls) files. While it has relatively less functionality than its bigger and more popular brother, Apache POI, it offers a simple API for Excel manipulation.Some features that made me choose JExcel were its relatively smaller memory foot print, simple API and upto date documentation.
On the other hand, some drawbacks that made me wary of choosing the tool were its lack of support for .xlsx files and the fact that the last release was in October 2009, more than 3 years ago. This discussion has listed a significant number of differences between JExcel and POI and while it may appear that Apache POI would be the obvious winner, it all boils down to your requirements. After all you can travel from point A to B in a car or do the same trip in a truck. In situations where the requirements are not very clear, are extensive  or might require support for .xlsx files in the future, Apache POI might be a better choice but if your requirements are clear, you need a fast and efficient Excel generating tool with minimum fuss, choose JExcel.
  
  
   net.sourceforge.jexcelapi
   jxl
   2.6.12