- Programmer Productivity ##
- Variations on the HTML Two-Step #
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function computeLayout(idleDeadline) { | |
var milliseconds = idleDeadline.timeRemaining(); | |
var haltTime = performance.now() + milliseconds; | |
for (let i=lastIndex; i < queue.length; i++) { | |
if (performance.now() > haltTime) | |
break; | |
// pseudocode | |
x = R cosΦ sin(λ - λ₀) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A large array of points awaiting projection | |
var queue = []; | |
// index into the array of the next item to compute | |
var lastIndex = 0; | |
var idleCallbackId = 0; | |
. . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!blue 2.0 | |
h2.kicker Programmer Productivity | |
h1 Variations on the HTML Two-Step | |
figure { | |
img `https://javascriptfanboi.com/img/046/modern-dancers.jpg` *alt='Fancy footwork of modern dancers' | |
figcaption Photo by Haste LeArt V. from Pexels | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2 class=kicker>Programmer Productivity</h2> | |
<h1>Variations on the HTML Two-Step</h1> | |
<figure> | |
<img src='https://javascriptfanboi.com/img/046/modern-dancers.jpg' alt='Fancy footwork of modern dancers' /> | |
<figcaption>Photo by Haste LeArt V. from Pexels</figcaption> | |
</figure> | |
<p>The World Wide Web's hypertext markup language (HTML) has an inherent beauty all its own:</p> | |
<ul> | |
<li>Both the author's words and the typographer's instructions are contained in a single plain text file.</li> | |
<li>Instructions are encoded using short, easily remembered mnemonics.</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isInsideClippedPolygon(polygon, mouseX, mouseY) { | |
let c = false; | |
// make sure there are at least 3 visible nodes | |
var countv = 0; | |
for (let k=0; k < polygon.length && countv < 3; k++) { | |
if (polygon[k].visible == true) | |
countv++; | |
} | |
if (countv < 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const shapes = new Map(); | |
shapes.set('triangle', | |
[{x:100, y:100}, | |
{x:120, y:120}, | |
{x:140, y:140}, | |
{x:100, y:100}]); | |
shapes.set('quadrangle', | |
[{x:371, y:229}, | |
{x:229, y:229}, | |
{x:229, y:371}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isInsidePolygon(polygon, mouseX, mouseY) { | |
const c = false; | |
for (let i=1, j=0; i < polygon.length; i++, j++) { | |
const ix = polygon[i].x; | |
const iy = polygon[i].y; | |
const jx = polygon[j].x; | |
const jy = polygon[j].y; | |
const iySide = (iy > mouseY); | |
const jySide = (jy > mouseY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const articleUrls = [ | |
'/feb-28-2021.html', | |
'/feb-21-2021.html', | |
'/feb-14-2021.html', | |
'/feb-07-2021.html' | |
]; | |
const nextIndex = 0; | |
async fetchNextArticle() { | |
// fetch the article using HTTP |
NewerOlder