Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Parse An XML Response With Java And Dom4J

Previously we’ve explored how to parse XML data using Node.js as well as PHP. Continuing on the trend of parsing data using various programming languages, this time we’re going to take a look at parsing XML data using the dom4j library with Java.

Now dom4j, is not the only way to parse XML data in Java. There are many other ways including using the SAX parser. Everyone will have their own opinions on which of the many to use.

Read More

Evaluate A Reverse Polish Notation Equation With JavaScript

Previously, I demonstrated how to convert an Infix Notation expression into Reverse Polish Notation using JavaScript, but I never explained how to evaluate the expression.

Reverse Polish Notation via Wikipedia:

A mathematical notation in which every operator follows all of its operands, in contrast to Polish notation, which puts the operator in the prefix position. It is also known as postfix notation and is parenthesis-free as long as operator arities are fixed.

In this phase two article, we’re going to look at how to solve a mathematical expression that has been parsed into Reverse Polish Notation (RPN).

Read More

Parse With The Shunting Yard Algorithm Using JavaScript

Anyone who knows how to program can probably solve a mathematical equation such as 5 + 3 * 6 - ( 5 / 3 ) + 7, but how might you get a computer to understand the appropriate order of operations? The equation I listed is in a format known as Infix Notation.

Infix Notation via Wikipedia:

Infix notation is the notation commonly used in arithmetical and logical formulae and statements. It is characterized by the placement of operators between operands.

This format is not the most ideal to work with when attempting to solve.

Instead it is more appropriate to use format such as 5 3 6 * + 5 3 / - 7 + which is more commonly known as Postfix Notation or Reverse Polish Notation (RPN). This conversion can be accomplished by what is known as the Shunting Yard algorithm.

Read More

Create A Random Nonce String Using JavaScript

Have you ever needed to come up with a random string of characters say for a password? Maybe you’re looking for a random string of characters for an oauth 1.0 nonce. Maybe you’re in a job interview and you’re asked to generate a random alpha numeric string.

Whatever the case, we’re going to look at generating a random string of characters of any given length using JavaScript.

Read More

Parse A JSON File With Java

Recently I was tasked with reading a JavaScript Object Notation (JSON) file using Java. In my project, the JSON file contained properties information to be used inside the application.

There are many libraries available for reading or parsing JSON data in Java, but in particular we are going to be using the library found on json.org.

Read More

Check And Update Outdated NPM Packages

The Node Package Manager (NPM), is becoming a major go-to resource for all development software and libraries. It is easy to use and covers a lot of ground.

If you’re anything like me you’re going to have more than twenty global packages installed on your machine through NPM, but how do you go about tracking whether or not any of them have become outdated?

Read More

Reverse Words In A String Using JavaScript

Back on the topic of possible programming interview questions, you may at some time in your career be asked to reverse words in a string. This is a much simpler problem and may be more likely to appear on a technical phone screening.

In it’s simplest form, you would assume all space separated string collections to be words. To clarify, it doesn’t matter if you’re looking at a true word or just some jumbled text separated by a space character.

Read More