Skip to content

Instantly share code, notes, and snippets.

View finalchild's full-sized avatar
:octocat:
Without intelligence

finalchild finalchild

:octocat:
Without intelligence
  • PortOne
View GitHub Profile
@finalchild
finalchild / convex-hull.cpp
Last active January 29, 2021 07:11
convex-hull.cpp
#include <algorithm>
#include <concepts>
#include <iostream>
#include <ranges>
#include <type_traits>
#include <vector>
#define self (*this)
#define repeat(i, n) for (remove_cv_t<remove_reference_t<decltype(n)>> i = 0; i < (n); ++i)
using namespace std;

Keybase proof

I hereby claim:

  • I am finalchild on github.
  • I am finalchild (https://keybase.io/finalchild) on keybase.
  • I have a public key ASAsPgwRbyEI0Ksk75SLwrjhh_fiHFv7ZbzivIrpgWILBQo

To claim this, I am signing this object:

@finalchild
finalchild / lexical-structure.txt
Created July 5, 2019 12:36
pseudo lexical structure
## tokens
keyword
operator
identifier
literal
symbol
### keyword
"_"
"as"
template<typename T, const T& Combine(const T&, const T&)>
class segment_tree {
darray<T> v;
T default_value;
T combine_considering_default(const T& left_value, const T& right_value) const {
if (left_value == default_value) {
return right_value;
} else if (right_value == default_value) {
return left_value;
} else {
@finalchild
finalchild / processor2.js
Last active December 16, 2018 04:14
Hangaram Timetable Reader gist
const timetableElement = document.getElementById('timetable');
const roomDataElement = document.getElementById('room-data');
const timetableGrid = makeGrid(timetableElement);
const roomDataGrid = makeGrid(roomDataElement);
const timetable = processGrid(timetableGrid);
//download(timetable[0], 'timetable1.json');
//download(timetable[1], 'timetable2.json');
//download(timetable[2], 'timetable3.json');
@finalchild
finalchild / processor.js
Last active July 28, 2018 10:19
Hangaram High School timetable processor
function downloadTimetable(timetableElement) {
const timetable = makeTimetable(timetableElement);
download(timetable[0], 'timetable1.json');
download(timetable[1], 'timetable2.json');
download(timetable[2], 'timetable3.json');
}
function download(o, fileName) {
const blob = new Blob([JSON.stringify(o)], {type: 'application/json'});
const url = URL.createObjectURL(blob);