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
let diff_dt_now = new Date(); | |
let diff_dt_const = new Date('2020-12-31'); | |
// delta between current month and 2020-12-31 (integer) | |
let month_diff = (diff_dt_const.getTime() - diff_dt_now.getTime()) / 1000; | |
month_diff /= (60 * 60 * 24 * 7 * 4); | |
month_diff = Math.abs(Math.round(month_diff)); | |
class Month { | |
constructor (range) { |
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
Africa/Abidjan | |
Africa/Accra | |
Africa/Addis_Ababa | |
Africa/Algiers | |
Africa/Asmara | |
Africa/Asmera | |
Africa/Bamako | |
Africa/Bangui | |
Africa/Banjul | |
Africa/Bissau |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Data; | |
using System.Windows.Documents; | |
using System.Windows.Input; |
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
Number.prototype.map = function (in_min, in_max, out_min, out_max) { | |
return (this - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; | |
} |
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
entry = input("Enter a Mayan date: ") | |
i=0 # this is used to track our position in the string | |
output = "" # start with output set to nothing | |
while entry[i:]: | |
# if we hit a space, then we've got to the end of that number | |
# print it out and reset the output | |
if entry[i] == " ": | |
print (output) |
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
-- Author: Michael-Keith Bernard | |
-- Date: May 22, 2012 | |
-- Description: Various implementations of the Fibonacci sequence in Lua. Lua | |
-- has native support for tail-call elimination which is why `tail_call` and | |
-- `continuation` run in near constant time. For sufficiently large numbers of n | |
-- you can start to see linear performace characteristics (particularly for the | |
-- `continuation` implementation), but ultimately the `tail_call` implementation | |
-- is an order of magnitude faster than iteration even for values of n as small | |
-- as 500k. |