To use Python with a Jupyter Notebook for Data Science and other projects, you will first need to make sure you have Python 3 and Jupyter Notebook installed. There are Jupyter Notebook installation instructions here: https://jupyter.readthedocs.io/en/latest/install.html This site recommends installing Anaconda, which bundles installation of Python 3 with Jupyter Notebook, which is just fine. However, … Continue reading Python: How to install WinPython and Jupyter Notebook
Python: How to open and read text documents
This article will details some basic Python techniques for opening and reading text files. This applies to any plain text files, they don’t have to have a .txt file extension. I will detail three different techniques. Example 1: Open text files and read one line at a time with .readline() This technique demonstrates probably … Continue reading Python: How to open and read text documents
JavaScript: How to create a custom range slider using bootstrap-slider
This article describes how to create a custom HTML range slider using Bootstrap 3, jQuery, HTML, CSS, and a JavaScript package called “bootstrap-slider”. There are download and installation instructions for this package on github. This slider can be custom styled with CSS and comes with a built-in tooltip. See the graphic below for a description … Continue reading JavaScript: How to create a custom range slider using bootstrap-slider
AngularJS: How to write a simple To Do app
In this article I will describe how to create a simple “To Do” app in AngularJS and write about some of the basic concepts of AngularJS. The app I will be describing looks like this: Step 1: AngularJS CDN To create an AngularJS app, the first thing you will need is a CDN in … Continue reading AngularJS: How to write a simple To Do app
jQuery: How to toggle switches programmatically
Let’s say you have some HTML/CSS switches in place of a traditional checkbox. jQuery makes it easy to toggle switches on or off. For example: function toggle(){ $(‘.slider’).click(); } Which can be called in a button like so: <button type=”button” class=”btn btn-primary” onClick=”toggle();”>Toggle</button> For example: Note: This same jQuery can be triggered without clicking … Continue reading jQuery: How to toggle switches programmatically
JavaScript: How to calculate the number of days between two dates
The following function takes in two dates and returns the number of days between them: // Calculate the difference of two dates in total days function diffDays(d1, d2) { let numDays = 0; let tv1 = d1.getTime(); // msec since 1970 let tv2 = d2.getTime(); numDays = (tv2 – tv1) / 1000 / 86400; numDays … Continue reading JavaScript: How to calculate the number of days between two dates
JavaScript: How to format a number to two decimal places
Let’s say we need to present a number on a web page so that it is always a floating point number with two decimal places. This is for cases where absolute precision is not needed but we want to always present a number output in a uniform way. Here is an example of how to … Continue reading JavaScript: How to format a number to two decimal places
jQuery: How to create an animated alert box
Let’s say you’ve made a login form and you want to display a placard whenever the login information is incorrect to alert the user. For example, when the user types an incorrect email address or password, they see the placard above the form, with a white background and red text: This is easy enough to … Continue reading jQuery: How to create an animated alert box
WordPress: How to create a local copy of a live site for development and testing
In this article, I will detail how to make a local “dev” copy of my live WordPress blog for the purpose of testing new styles, developing plugins and experimenting with new themes. My live WordPress blog is at http://bluegalaxy.info/codewalk. On my local Windows PC I have Bitnami WAMP stack installed, which includes an Apache2 server, … Continue reading WordPress: How to create a local copy of a live site for development and testing
Atom: How to enable minimap and file-icons extensions
This article describes a couple of useful plug-ins for the Atom code editor. In order to install the “minimap” and “file-icons” packages, you can follow the same package installation instructions that were used for the “data-atom” package found in this previous article: Atom: How to run MySQL queries in Atom using a package called Data Atom … Continue reading Atom: How to enable minimap and file-icons extensions