Blog

JavaScript – XOR In Any Base

After writing the Vernam Cipher post, I started thinking about alternatives to using bit-wise XOR in order to translate numbers. I started thinking about XOR for base 3. Therefore I concentrated on what makes XOR so great. What makes XOR stand out from other operators is the fact that assuming Read more…

By Chris West, ago
Blog

JavaScript – Debounce

Recently I was working on an HTA which contained an element that I wanted to be resized when the window resized. The issue was that I only wanted the resizing to occur after 0.5 seconds elapsed in which the user was not resizing the window. For this reason the debounce Read more…

By Chris West, ago
Blog

JavaScript – Weighted Randomization

Today I worked on a project which involved weighted randomization. In other words, I had to randomly choose an item from an array of weighted items. The items that were assigned a higher weight were to be more likely to be picked. The following is a JavaScript function that accomplishes Read more…

By Chris West, ago
Blog

JavaScript – Modify URL Parameters

Recently I had to develop a solution which involved changing the HREF attributes of links in the navigation bar of a site. This had to be done on the JavaScript side because at my company we are the 3rd-party JavaScript solution for modifying other companies’ sites. That being said, I Read more…

By Chris West, ago