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 java.io.*; | |
import java.util.LinkedList; | |
import java.util.List; | |
public class Hard162 { | |
public static void main(String[] args) { | |
if(args.length < 3) err("<Error: too few arguments>"); | |
if(args.length > 3) err("<Error: too many arguments>"); | |
if(!args[0].equals("-d") && !args[0].equals("-c")) err("<Error: unknown operation>"); |
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
2c2 | |
< xkb_keycodes "k" { | |
--- | |
> xkb_keycodes "evdev+aliases(qwerty)" { | |
259a260,262 | |
> virtual indicator 12 = "Shift Lock"; | |
> virtual indicator 13 = "Group 2"; | |
> virtual indicator 14 = "Mouse Keys"; | |
266a270,295 | |
> alias <LatQ> = <AD01>; |
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
#!/usr/bin/env python3 | |
import Xlib.threaded | |
import Xlib | |
import Xlib.display | |
from Xlib import Xatom | |
from PIL import Image | |
import os.path | |
from collections import defaultdict | |
try: |
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
// ==UserScript== | |
// @name Schedule | |
// @namespace c98 | |
// @include https://sms7.schoolsoft.se/nti/jsp/student/right_student_schedule_print.jsp?* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
print=alert; |
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
{-# LANGUAGE NoImplicitPrelude, UndecidableInstances, FlexibleInstances, FunctionalDependencies, UnicodeSyntax, TypeOperators, FlexibleContexts #-} | |
module TypeSort where | |
data T | |
data F | |
class (Either b l r) o | b l r → o | |
instance (Either T l r) l | |
instance (Either F l r) r |
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
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE CPP #-} | |
module Music (withMusic) where | |
#ifdef NO_SOUND | |
import Data.IORef | |
withMusic :: ((IORef Double, IORef Double) -> IO ()) -> IO () | |
withMusic f = do | |
a <- newIORef 0 |
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 sys | |
if not sys.gettrace(): | |
# f_trace doesn't work if settrace isn't set | |
sys.settrace(lambda a, b, c: None) | |
def j(n): | |
def hook(fr, event, arg): | |
assert event == "opcode" | |
fr.f_lineno += n |
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
# Deciphers ITM files into their raw form (usually a bmp, wav, or txt). | |
# Zwei II has an extra level of scrambling on its text files, so use --zwei for that. | |
# Gurumin's sound.itm is not enciphered at all, it's just a binary file. | |
from pathlib import Path | |
import struct | |
import numpy as np | |
Buf = np.ndarray[int, np.dtype[np.uint8]] |
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 typing as T | |
from pathlib import Path | |
from dataclasses import dataclass | |
@dataclass | |
class Chunk: | |
type: bytes | |
data: bytearray | |
def read_chunks(f: T.IO[bytes]) -> list[Chunk]: |
OlderNewer