If you have two lists and would like to build a dictionary where one list will be the keys and the second list will be the values, Python has a way to do this easily using the built-inzip() function. With small enough examples, we could build our dictionary manually by typing it at the keyboard. … Continue reading Python: How to build a dictionary with two lists using zip( )
Month: November 2017
p5.js: How to build a clock
In this article, I will show how to build a clock using p5.js, step by step. Here is what the final result looks like: Step 1: Create a square canvas with an origin point When you create a new p5.js sketch in the Processing IDE, you start with empty setup() and draw() functions. For example: … Continue reading p5.js: How to build a clock
p5.js: Understanding circles
To understand how to code with circles in p5.js, it is necessary to have a foundation of knowledge about the parts of a circle and how they map to code. The first mapping is the name. Circles are actually called ellipses in p5.js and are produced using the ellipse() function, that takes in four (or … Continue reading p5.js: Understanding circles
WordPress: How to display excerpts instead of full posts on archive pages
In the WordPress dashboard under Settings –> Reading, there is an option that appears as if it would show summaries of each post on the main page, instead of full posts. Next to “For each article in a feed, show”, there are options for “Full text” and “Summary”. This does not do what I thought … Continue reading WordPress: How to display excerpts instead of full posts on archive pages
JavaScript: Intro to AJAX
AJAX stands for Asynchronous JavaScript And XML. The basic concept is to use JavaScript and combine the fetching of XML (or JSON) data and make that data appear in some location of a web page without the page ever having been refreshed. This allows for dynamic content in an otherwise static page. w3schools.com describes it … Continue reading JavaScript: Intro to AJAX
JavaScript Web App: JavaScript ASCII Engine
The JavaScript ASCII Engine is a web tool I created to be able to quickly find ASCII values when a chart is not available. All you do is type in a single keyboard character in the input box and the tool will output the ASCII equivalent values in decimal, hex and binary. I created this … Continue reading JavaScript Web App: JavaScript ASCII Engine
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