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
""" | |
This gist contains the solution for | |
Day 5 of Advent of Code 2023 (https://adventofcode.com/2023/day/5). | |
I first wrote it on version 3.11 and then ported it | |
to earlier versions to see how the language evolved. | |
Below is the listing for version 3.11 | |
""" | |
from __future__ import annotations |
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
/* | |
_ _ _ _____ _ ____ _ | |
| \ | | ___ | |_ | ___| | __ _ _ __ _ __ _ _ | _ \ _ _ ___| | __ | |
| \| |/ _ \| __| | |_ | |/ _` | '_ \| '_ \| | | | | | | | | | |/ __| |/ / | |
| |\ | (_) | |_ | _| | | (_| | |_) | |_) | |_| | | |_| | |_| | (__| < | |
|_| \_|\___/ \__| |_| |_|\__,_| .__/| .__/ \__, | |____/ \__,_|\___|_|\_\ | |
|_| |_| |___/ | |
compiler : GCC | |
command : gcc source.c -o FlappyBird.exe -Werror -Wall -W -s | |
license : www.unlicense.org (Please credit my channel tho) |
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
// Save this file as main_test.go and run "go test -bench ." | |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"regexp" | |
"strconv" | |
"testing" |
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
package bitly | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"net/http" | |
) | |
const BaseURL = "https://api-ssl.bitly.com/v4" |
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
import matplotlib.pyplot as plt | |
from PyQt5 import QtCore | |
import numpy as np | |
import time | |
import math | |
class VisualiseFrequency(QtCore.QThread): | |
def __init__(self, song, canvas, player): |
This is not an exhaustive list of all interfaces in Go's standard library.
I only list those I think are important.
Interfaces defined in frequently used packages (like io
, fmt
) are included.
Interfaces that have significant importance are also included.
All of the following information is based on go version go1.8.3 darwin/amd64
.
Function which determines if a given file is binary.
Test is based on the following algorithm (similar to that implemented within Perl):
- Empty files are considered text.
- If not empty, read up to 512 bytes as a buffer. File will be binary if:
- Null byte is encountered.
- More than 30% of the buffer consists of "non text" characters.
NewerOlder