Archive for category Lessons

Dynamically Resize a Web Page with CSS Flex and Media Queries

📅 October 16, 2023
“Must I use floats and relative positioning?”

Have you ever visited a modern web site and resized your browser window only to notice that the entire site changed appearance as the browser width was adjusted? Have you visited the same site on a desktop computer and then on a mobile device and witnessed the same site content but organized differently?

How do they do that?

The answer is with a recent CSS (Cascading Style Sheet) property called a flex box that, when combined with a CSS media query using @media, will rearrange the content of a web page dynamically within the browser without needing to reload the entire page.

Gone is the hassle of floats, extra divs, absolute positioning, and endless adjustments. Now, we can achieve a more flexible result with minimal HTML and CSS.

Read the rest of this entry »

Leave a comment

Get WOTD from Subject Line in Multiple Thunderbird Emails – Part 2

📅 July 8, 2019
In the previous lesson, we explored regular expressions to create a Bash one-liner to extract words from Thunderbird email subject lines.

While it worked well for a simple task, residue was not filtered, and this required manual editing.

Can we improve it further to handle inconsistencies and reduce the manual edits? Yes! This article demonstrates using sed and regular expressions to eliminate any manual editing.

Read the rest of this entry »

, ,

Leave a comment

Let’s Learn JavaScript • Lesson 7 • Variables

📅 November 7, 2017
A variable allows us to store a value that can change during a script’s execution.

Its contents are variable — meaning it can change, and that is why it is called a variable.

Variables exist in memory, and we lose their contents when a computer is powered off or after the script is finished using it (often encountered during a concept called scope).

Read the rest of this entry »

,

Leave a comment

Let’s Learn JavaScript • Lesson 6 • Statements and Comments

📅 August 18, 2017
The JavaScript interpreter executes lines of code one by one from top to bottom. A statement is a line of code that tells JavaScript what to do.

Statements contain keywords, which are words reserved by the JavaScript language for specific instructions. These keywords, combined with user data, form the statements that comprise a script.

Read the rest of this entry »

,

Leave a comment

Let’s Learn JavaScript • Lesson 5 • Object Primer

📅 July 31, 2017
“An object? What’s that?”

JavaScript uses object-oriented programming concepts (OOP) in order to make programming easier by mirroring real-world ideas.

While it is not necessary to use objects all of the time, it helps to understand what an object is because JavaScript views various parts of a web page and browser as objects.

Read the rest of this entry »

,

Leave a comment

Let’s Learn JavaScript • Lesson 4 • Planning a Script

📅 July 24, 2017
A script usually refers to a short program executed by an interpreter. Python, Perl, and JavaScript are examples of interpreted scripting languages. When we code client-side JavaScript, we write scripts that run in web browsers.

Scripts are intended to be lightweight and short in order to consume fewer system resources than full-fledged applications. This way, pages render faster in a web browser.

The purpose of using JavaScript in a web page is to make the page interactive either with the user directly or with a web server. Interactive pages are dynamic — page contents can change as the page is loaded or while the page is being viewed. JavaScript can access and modify page content and react to user input, such as button clicks or form entry. The result is a web page that feels more alive compared to static content that does not change.

No matter how simple or fancy a script might be, we need to plan before writing any code.

Read the rest of this entry »

,

Leave a comment

Let’s Learn JavaScript • Lesson 3 • Beginning JavaScript

📅 July 19, 2017
Continuing from the exciting Greetings Universe! HTML file we wrote in the previous lesson, let’s add some JavaScript to show a popup dialog and write text to the page.

 

Read the rest of this entry »

,

Leave a comment

Let’s Learn JavaScript • Lesson 2 • Basic HTML 5

📅 July 14, 2017
Client-side JavaScript requires a knowledge of HTML, so this lesson will focus on building a minimal HTML 5 file that we can use for writing JavaScript.

Read the rest of this entry »

,

Leave a comment

Let’s Learn JavaScript • Lesson 1 • Introduction

📅 July 13, 2017
• Have you ever submitted a form only to find that some fields will filled incorrectly with red borders? That is JavaScript in action.

• Have you scrolled through a list of images and noticed new images appear? That is JavaScript trying to make life easier for you while conserving bandwidth.

• Have you ever thrown up your hands in anger as annoying popups littered your desktop with mind-jarring, blinking ads accompanied by new browser windows that expand to fullscreen in order to advertise an online survey? That is JavaScript being used to aggravate in hopes that you will part with your money.

JavaScript is a full-featured programming language that produces web pages whose content can change when certain conditions are met. If you have ever wanted to learn how to perform this mysterious magic in JavaScript, then here is the first lesson that introduces the background of this fun language.

Read the rest of this entry »

,

Leave a comment

Binary Lesson 17 – Parity

📅 March 4, 2015
lesson17The word parity originates from the Latin word par, meaning equal. Take the sport of golf, for example. A hole on a golf course is usually assigned a par number. If you sink the golf ball into the hole with the same number of strokes as the par, you are said to be on par — equal to the number of expected strokes. If you expend more strokes than the par, then you need practice, and you should probably try again.

An identical strategy applies to computers. Parity is an early form of error detection often used with serial communications, such as modems and serial ports, for example. An extra bit is appended to each data byte to make the total number of 1 bits even or odd. This extra bit, called the parity bit, is separate from the data byte, and it does not contain data information. It is only used to make the total number of 1 bits even or odd.

There are two main types of parity: Even parity and odd parity. Both operate in the same manner aside from the evenness or oddness.

This lesson focuses on 8-bit data even though the concept can apply to any number of data bits, such as 7-bit ASCII.

Read the rest of this entry »

Leave a comment