A small library for MathBot that adds head and tail functions for manipulating lists.
This file contains hidden or 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
| module Main exposing (..) | |
| -- elm init | |
| -- elm install elm/url | |
| -- elm install rtfeldman/elm-css | |
| import Browser | |
| import Browser.Navigation as Nav | |
| import Css | |
| import Css.Global |
This file contains hidden or 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
| #!/usr/bin/env node | |
| /* | |
| ASCIIMathTeXImg.js | |
| Based on ASCIIMathML, Version 1.4.7 Aug 30, 2005, (c) Peter Jipsen http://www.chapman.edu/~jipsen | |
| Modified with TeX conversion for IMG rendering Sept 6, 2006 (c) David Lippman http://www.pierce.ctc.edu/dlippman | |
| Updated to match ver 2.2 Mar 3, 2014 | |
| Modified to run as a standalone script using November 6, 2018 (c) Declan McDonnell https://probablyaweb.site | |
| Program reads from stdin and writes to stdout |
This file contains hidden or 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
| # Nothing | |
| f -> |
This file contains hidden or 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
| ''' | |
| grammar_bot.py | |
| A discord bot that unrelentingly corrects your | |
| writing and makes suggestions. | |
| This is silly. Don't actually use it in anything | |
| serious. | |
This file contains hidden or 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
| /* | |
| Befunge interpereter, in one large file. | |
| Code taken from this repo: https://github.com/programble/befungeec | |
| It's been smooshed into one file and modified somewhat. | |
| Improvements: | |
| - Shows a special symbols for unprintable characters in debug mode. | |
| - Shows a help message when run with no arguments, rather than crashing. |
This file contains hidden or 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
| /* | |
| Implementation of a (relatively) simple persistent range tree. | |
| Supports point updates (set) and range-query of sums. | |
| Note that all the ranges in this code are [inclusive, exclusive) | |
| Compiles with | |
| g++ persist.cpp -o persist -std=c++11 -Wall -Wextra -Wshadow -Wpedantic -O2 |
This file contains hidden or 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
| import random | |
| import numbers | |
| from timeit import timeit | |
| data = [0] * 1000000 + [0.0] * 1000000 + [(0, 0)] * 1000000 + [[0, 0]] * 1000000 | |
| random.shuffle(data) | |
| def is_int_float(x): | |
| return isinstance(x, int) or isinstance(x, float) |
These are some tricks in python that should help with speed-based programming competitions, like ProgComp.
enumerate is usually used when you want to iterate over a list, and have easy access to both the value and the index.
for index, value in enumerate(my_list):
This file contains hidden or 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
| #include <iostream> | |
| /* | |
| Implementation of a splay tree | |
| Derived from | |
| - github.com/jonnyhsy/splay-tree | |
| - en.wikipedia.org/wiki/Splay_tree | |
| */ |
NewerOlder