ConciseXMLParser Java Library

I was happy to have my first opportunity at delivering an open-source project for the use of everyone. This project is available here and has been uploaded into Sonatype’s Central Maven Repository.

Isn’t there already XML Parsers for Java?

It may seem weird as there are already many XML parser out there for Java. Actually I was using XML in an odd scenario and could not find a solution suitable to my needs after a few hours of searching.
I noticed that many libraries that were available were verbose and I wanted to minimize the number of lines required to load the XML file content. I also needed it to be able to accommodate XML that is not intended to represent structured data (objects with the same attributes) but rather I needed it to be able to handle the unstructured data that can be found in an application configuration file.
Oddly, after completing the library I did read about a Java Library called XPath and also read that the same solution was not geared toward performance consideration.

Why not write a Java properties file?

One of the considerations I had is if I needed to move the config in the future I would rather have it as an XML as parsers would be available for many programming languages.
Another is that the properties file can become really difficult to read and maintain if your intention is to logically nest objects within others. Imagine having to read keys like:


Now try nesting a few more times to see the point.

What is it about?

The project basically is geared towards reading an entire XML file and providing it as key->value pairs in a HashMap. In order to accomplish this, a few assumptions had to be made in order for the library to work effectively.
The readme in GitHub explains what these assumptions are as well as the rules used for generating the keys for each value.

Advice to Undergraduate Students

Having gone through a five year engineering and management program, I have learned and advised many things to newcomers. In this article I provide advice for those entering, or are in the process of completing, an undergraduate degree.

Before diving into my advice I feel its good to know where I come from. Somethings may feel exaggerated or may not affect you.

  • Completed a five year engineering and management program
  • I never did coop/internship
  • I did work part time as either a self-employed tutor, or a teaching assistant since the beginning of my third year, up till my last semester of undergrad
  • I was fortunate to not have OSAP (student loan in Canada), though I had to struggle a bit to get into that position
  • I always lived off-campus while studying, LIKE OFF (1 hour bus)
  • My parents separated at the end of my second year and later divorced

And now for the advice…

Sleep Early and Well when you can
In many scheduled years of many programs this may seem impossible. It was not until about fourth year that I started to sleep well (on most days). I found that my productivity increased significantly. I also found it was necessary to do exceptionally well in presentations. Once you get yourself out of sleeping late for a few days (and managing time), it will become easier to adjust to the habit.

Avoid Driving the Car, use the Bus
I know it sounds ridiculous at first but hear me out. It seems like cars would be more beneficial because it usually gets you from A to B faster. If you are the one driving the car you are spending your cognitive resources while driving; you will likely need to rest sooner rather than later. On the bus on the other hand, I found it was nice to take a nap on the bus to prepare myself to do work when I arrive to my destination. It was incredibly helpful to take the bus when I had a test to write. Of course it was incredibly helpful to get dropped off at school when you had to study last minute for a test too.

And hinted in the previous one…

Sleep well before writing a test/exam
Believe me, every time you pickup your test after writing it with 30 minutes of sleep, you realize how stupid your mistakes were. I literally got 65% on a midterm where after picking it up I know I knew 90% of what was on it. You tend to read questions wrong and make goofy mistakes when you are not well rested entering a test.

Sometimes you have to make Sacrifices
2% quiz or 20% midterm? If you can do both and still do well on the midterm, good. If you don’t have enough time then its best to forget the quiz. In many programs you take at university you will likely run into this issue a couple of times.

Attend Test Review
Most of the time it does help when it is run by the one who prepared the test. I have had professors accidentally hint questions during sessions. Sometimes you will only get a breakdown of a test in the review session. I had one situation where the professor had already submitted the exam for us to write but realized a few days prior that most of the class did not understand how to solve one of the questions on the exam. He held a review session where about 1/12 of the class showed up. Guess who got the 12? If review session is not provided by the instructor it may still be useful but often times I found it wasn’t.

Don’t be Afraid to Approach (Most) Instructors
Before jumping to conclusions about how your instructor might be if you approach them. Try a few times and see what happens. I managed to convince a few instructors to extend assignment deadlines by sending genuine emails explaining a situation that likely exists for many people in the class. Also, I have received very helpful information from a number of instructors when I would ask questions about assignments. Some instructors will intentionally ignore emails and students. You should always make an effort to try before you jump to conclusions.

Make Genuine Relationship
There is always advice telling you to make connections. People often take this advice the wrong way and try to make friendships and acquaintances without any sincerity. It’s usually pretty obvious, and most of the time it doesn’t go well. When you make genuine relationships with people, you can make solid connections. I have received freelance offers as well as other benefits without expecting it most of the time due to genuine friendships I have with many people I met as a student.

Advice I took too late
One thing I was advised to do when it was too late was to ensure that when you select a group for graded assessments, you should make sure you communicate to the other members what your mark expectations are before you set it in stone. This is obviously not useful to those who “just want to pass” more so it is useful for those who want a mark of B+ and higher.