Python: How to read and write JSON

JSONĀ is a lightweight data-interchange format that stands for JavaScript Object Notation. It so happens that JavaScript objects look exactly like Python dictionaries, so JSON objects can be thought of as portable dictionaries of key-value pairs. This portability is what makes JSON so valuable. While JSON objects can be identical to Python dictionaries, there are some … Continue reading Python: How to read and write JSON

JavaScript: How to identify the browser using navigator.userAgent

While it is not a good programming practice to code workarounds for various browsers and versions , it is helpful to know how to detect the user’s browser. For example: Here is the complete HTML code that includes JavaScript that will detect the user’s browser and other information such as operating system: Some key pieces of … Continue reading JavaScript: How to identify the browser using navigator.userAgent

Vue.js: How to install Vue.js on Ubuntu Linux

Vue.js requires that Node.js version 6.x is already installed. See this previous article for instructions on installing Node.js: JavaScript: How to install Node.js on Ubuntu Linux To install Vue.js, use each one of these commands in the Ubuntu terminal, in order: Command #1: sudo npm install –g vue-cli Command #2: vue init webpack myapp Where … Continue reading Vue.js: How to install Vue.js on Ubuntu Linux

JavaScript: How to install Node.js on Ubuntu Linux

To install Node.js version 6.x on Ubuntu Linux VM, start by going here: https://nodejs.org/ Click on the DOWNLOADS link at the top, then click on the “Installing Node.js via package manager” link. Then under “Debian and Ubuntu based Linux distributions“, there are two commands to use. Run these commands, in order, in the Ubuntu terminal. … Continue reading JavaScript: How to install Node.js on Ubuntu Linux

JavaScript: How to create alerts and pop-up windows

In JavaScript, alerts can be created easily using the built-in alert() function. For this first example, an alert is placed directly inside the button tag: <button onclick=”alert(‘I am an alert box!’);”>Example 1</button> Example 1 Here is a more complete example, showing in the HTML context: <!DOCTYPE html> <html> <body> <h2>JavaScript Alert Example 1</h2> <button onclick=”alert(‘I … Continue reading JavaScript: How to create alerts and pop-up windows

WordPress: How to create an iframe refresh button

Let’s say you have an interactive canvas loaded in an iframe and you want to have the ability to “clear” the canvas without reloading the entire page. This example was created using p5.js and the html was loaded into an iframe. After drawing on this canvas, it can be cleared by clicking the “Clear Canvas” … Continue reading WordPress: How to create an iframe refresh button

p5.js: Getting Started

Getting started with p5.js, this article follows the instructions found here:https://p5js.org/get-started/ Where processing.py only allows interaction in the Processing code environment, p5.js allows for real time interactive experiences on the web. This article is similar to the previous article I wrote about getting started with Processing.py: In the Processing IDE, choose the p5.js option at … Continue reading p5.js: Getting Started

WordPress: Inject custom CSS to create borders around iframes and images

CSS can be used to style an iframe to give it a border with a drop shadow. For example: Then, in the tag that creates the iframe, reference this CSS using the tag id=”iframe_drop_shadow”. For example: Here is a real working example: An easy way to add the above custom CSS to WordPress is to … Continue reading WordPress: Inject custom CSS to create borders around iframes and images