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

Highlight Text In A String Using JavaScript And AngularJS

Have you ever wanted to highlight text in a string on a web page using AngularJS? If your answer was no, don’t disregard, because you may one day need to. The good thing is this is not very hard to accomplish.

There are many ways to do this using JavaScript, but we’re only going to examine one of those methods.

Using AngularJS and a few regular expressions (RegEx) with JavaScript, you can find text in a string and then apply your own customizations.

Read More

Get Remote HTML Data And Parse It In Express For Node.js

Have you ever wanted to fetch remote HTML data in a similar fashion to cURL or Wget using some backend web service and parse it? If you said no, don’t worry, I said the exact thing until I was challenged to do so. For the challenge, I chose to use Express as my framework and a few libraries to assist in the process of fetching and parsing.

I chose to use the HTTP and HTTPS libraries for fetching the data and the htmlparser2 for parsing the HTML data. These are of course only a few of many alternatives to choose from for such a task.

Read More

Use RegEx To Test Password Strength In JavaScript

Recently one of my Twitter followers asked me how they might validate password strength using regular expressions (RegEx) in their code.

Regular expressions via Wikipedia:

A sequence of characters that forms a search pattern, mainly for use in pattern matching with strings, or string matching.

RegEx is nice because you can accomplish a whole lot with very little. In this case we are going to check various aspects of a string and see if it meets our requirements, being a strong or medium strength password.

Read More

Determine If A Number Is Prime Using JavaScript

Continuing on the topic of interview questions for programming and software engineering type positions, I thought I’d brush up on a popular one.

Although I have never personally been asked about this, other people have told me that they’ve been asked to determine if a number is prime or to print out all prime numbers up to a certain number.

Read More

Create A Complex Calculator App Using Ionic Framework

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

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

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