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
| local M = {} | |
| local function extract(t, key) | |
| -- Extract the value from the table, and remove it from the table. | |
| if key == nil then | |
| local res = t[1] | |
| table.remove(t, 1) | |
| return res | |
| end | |
| local res = t[key] |
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
| no secret here? |
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
| # ----------------------------------------------------------------------------- | |
| # Binary Knapsack Solver v0.1.0 | |
| # ----------------------------------------------------------------------------- | |
| # Copyright (c) 2025 Stefano Raneri | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is |
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 heapq | |
| from collections import defaultdict | |
| from dataclasses import dataclass | |
| import sys | |
| from typing import DefaultDict, Optional | |
| import numpy as np | |
| from PIL import Image, ImageDraw | |
| CELL_WIDTH = 96 |
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 base64 | |
| import sys | |
| from io import BytesIO | |
| import requests | |
| from PIL import Image | |
| class Client: |
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
| struct FastI { | |
| char cur; | |
| char tmp[1 << 8]; | |
| #ifdef _WIN32 | |
| char nextChar() { | |
| return cur=_getchar_nolock(); | |
| } | |
| #else | |
| static constexpr int BUFSIZE = 1<<14; |
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 json | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import matplotlib.patches as patches | |
| import matplotlib.lines as mlines | |
| import seaborn as sns | |
| sns.set(style="dark") | |
| # Data |
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
| class Content: | |
| def __init__(self, *args): | |
| self.data = args | |
| def sizes(self): | |
| return [len(str(x)) for x in self.data] | |
| def __len__(self): | |
| return len(self.data) | |
| class Header(Content): | |
| def layout(self, style): |
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
| #!/bin/bash | |
| mode="$1" | |
| if [[ "$mode" == "perf" ]]; then | |
| cmd="$2" | |
| i=0 | |
| while true | |
| do | |
| echo "Test $((i+=1))" | |
| python gen.py > gendata |
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
| # -*- coding: utf-8 -*- | |
| # | |
| #-- | |
| # Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at> | |
| # | |
| # This file is part of kramdown which is licensed under the MIT. | |
| #++ | |
| # | |
| require 'prawn' |
NewerOlder