What's a fast way to test if 2 rectangles are intersecting? A search on the internet came up with this one-liner (WOOT!), but I don't understand how to write it in Javascript, it seems to be written in an ancient form of C++. struct {...

It must be noted here that I performed the mathematics by hand on paper to derive the foregoing proofs. I am not sure if the proofs would have become apparent by solely using the medium of the modern computer. The definition of "efficiency"...

Given let doAsynchronousStuff = () => { return new Promise(resolve => { setTimeout(() => { resolve("abcdefg"[Math.floor(Math.random() * 7)]) }, Math.PI * 1 + Math.random()) }) .then(data => console.log(data))...

I have an idea for a few web apps to write to help me, and maybe others, learn Japanese better since I am studying the language. My problem is the site will be in mostly english, so it needs to mix fluently Japanese Characters, usually hirigana and...

There are many situations in parsing user input where the user has the opportunity to add several optional flags to the input which should be accepted in any order. How can this be parsed with regex so that each flag will be in it's own capture g...

I noticed a good while back that Wikipedia links to a Javascript implementation of different hash functions. Also found Clipperz Crypto. Even Mozilla implements a crypto object in Firefox. So, Is Javascript a proper platform for cryptography? Or, c...

I've tried a few google searches, and I cannot come up with any articles/previous questions that address this. The reason is a minor dispute I'm having with someone about using input validation to reject possible XSS. I know for a fact that...

Suppose you have to write a program that will test all programs in search of one that completes a specific task. For example, consider this JavaScript function: function find_truth(){ for(n=0;;++n){ try { var fn = Function(st...

I was reading this article today on two different regular expression algorithms. According to the article old Unix tools like ed, sed, grep, egrep, awk, and lex, all use what's called the Thompson NFA algorithm in their regular expresssions......

I've been reading "Algorithms, 4th Ed" by Sedgewick & Wayne, and along the way I've been implementing the algorithms discussed in JavaScript. I recently took the mergesort examples provided in the book to compare top-down and bot...

©2020 All rights reserved.