Tag: javascript

Create A Complex Calculator App Using Ionic Framework

April 8, 2015 Nic Raboy

If you’ve been keeping up, I previously wrote two tutorials on the topic of evaluating mathematical expressions. The first tutorial was on the topic of converting an Infix expression into a Postfix expression also known as Reverse Polish Notation using the Shunting Yard algorithm. The second tutorial was on the topic of solving the Postfix expression.

Using the hybrid application framework, Ionic Framework, we’re going to create a calculator application for solving these complex expressions. Think of it as a mobile front end for the nice algorithms we made.

Read More

Evaluate A Reverse Polish Notation Equation With JavaScript

April 1, 2015 Nic Raboy

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

Make An AngularJS Library For The Imgur REST API

March 25, 2015 Nic Raboy

Imgur is a great image service for sharing and viewing images across the internet.

Since there is a lot of buzz around AngularJS lately and there isn’t already an AngularJS extension for the Imgur REST API, I decided to take it upon myself and start creating one.

Read More

Using Oauth 2.0 In Your Web Browser With AngularJS

March 22, 2015 Nic Raboy

I have a few popular Oauth related posts on my blog. I have one pertaining to Oauth 1.0a, and I have one on the topic of Oauth 2.0 for use in mobile application development. However, I get a lot of requests to show how to accomplish an Oauth 2.0 connection in a web browser using only JavaScript and AngularJS.

We’re going to better explore the process flow behind Oauth 2.0 to establish a secure connection with a provider of our choice. In this particular example we’ll be using Imgur because I personally think it is a great service.

Read More

Parse With The Shunting Yard Algorithm Using JavaScript

March 16, 2015 Nic Raboy

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

March 10, 2015 Nic Raboy

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

Reverse Words In A String Using JavaScript

February 25, 2015 Nic Raboy

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