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
from starlette.requests import Request | |
from typing import Dict | |
import ray | |
from ray import serve | |
from ray.serve.handle import RayServeHandle | |
from transformers import pipeline |
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
# GitKit | |
## Experimental git branch management tool | |
function gk(){ | |
if [ $# -eq 0 ]; then | |
echo "Usage: gk <command> [args]" | |
echo "Commands:" | |
echo " branch <branch> - create a new branch off the current branch" | |
echo " parent [branch] - get the parent of the current branch or the given branch" |
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 Data.List | |
window :: Int | |
window = 14 | |
main = do | |
input <- readFile "input.txt" | |
print $ solve window input | |
noDupes :: Eq a => [a] -> Bool |
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 qualified Data.Text as T | |
main = do | |
input <- readFile "input.txt" | |
print $ solve input | |
type StackState = [[Char]] | |
data Action = Action { | |
num :: Int, | |
source :: Int, |
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 qualified Data.Text as T | |
main = do | |
input <- readFile "input.txt" | |
print $ countpredranges oneissubset input | |
print $ countpredranges theyoverlap input | |
type Range = (Int, Int) | |
countpredranges :: (Range -> Range -> Bool) -> String -> Int |
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 qualified Data.Set as Set | |
import Data.Char | |
main = do | |
input <- readFile "input.txt" | |
print $ fn input | |
fn :: String -> Int | |
fn = sum . (fmap procline) . lines |
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 Data.List | |
import qualified Data.Text as T | |
main = do | |
input <- readFile "input.txt" | |
print $ fn input | |
fn :: String -> Int | |
fn input = sum $ fmap scoreline $ lines input |
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 qualified Data.Text as T | |
import Data.List | |
main = do | |
input <- readFile "input.txt" | |
putStrLn $ show $ fn input | |
fn :: String -> Integer | |
fn = | |
sum |
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
# Below is the Jones-Sato-Wada-Wiens prime polynomial encoded in Python | |
# Ultimately, expressing it in this format is somewhat useless because of the | |
# size of numbers involved. | |
# https://thomas1111.wordpress.com/2015/02/01/what-do-solutions-of-the-jones-sato-wada-wiens-polynomial-look-like/ | |
def jones_sato_wada_wiens(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z): | |
return (k * 1) * ( | |
1 | |
-(w*z+h+j-q)**2 |
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
git config alias.ass "\!echo ' | | | \n / \ \n / \`, \ \n | ) ) \n | _/_ _ / \n \ | |\n | | ,'" |
NewerOlder