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
from abc import ABC, abstractmethod | |
from typing import Generic, TypeVar, Type, Callable, Union, Dict | |
C = TypeVar('C') | |
class DefineClassDerivative(Generic[C]): | |
def __init__(self, define: str): | |
def empty_init(*args, **kwargs): |
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
""" | |
MIT License | |
Copyright (c) 2022 SealtielFreak | |
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 | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
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 javax.swing.*; | |
import java.awt.*; | |
import java.awt.image.BufferedImage; | |
public class JDoubleBuffered extends JFrame { | |
void loop() throws Exception { | |
boolean isRunning = true; |
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
def count_bits(number): | |
bit = 1 | |
i = 0 | |
while True: | |
if bit > n: | |
return i | |
bit += bit | |
i += 1 |
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
""" | |
MIT License | |
Copyright (c) 2022 SealtielFreak | |
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 | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
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
require 'benchmark' | |
require 'matrix' | |
module Color | |
def self.from_i(c, c_map = [16, 8, 0]) | |
c_map.map { |i| ((c >> i) & 0xFF) } | |
end | |
def self.from_rgb(c) | |
'0x' + c.map { |i| |
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 jruby | |
require 'java' | |
require 'set' | |
require 'singleton' | |
java_import java.awt.Color | |
java_import java.awt.Dimension | |
java_import java.awt.FlowLayout | |
java_import java.awt.GridLayout |
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/jruby | |
require 'java' | |
require 'set' | |
require 'singleton' | |
java_import java.awt.Color | |
java_import java.awt.Dimension | |
java_import java.awt.FlowLayout |
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
#ifndef CONIO_H | |
#define CONIO_H | |
struct text_info { | |
unsigned char curx, cury; | |
unsigned short attribute, normattr; | |
unsigned char screenwidth, screenheight; | |
}; | |
struct char_info { |
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
template<typename R, typename ...Args> | |
class Functor { | |
protected: | |
virtual R call(Args ...args) = 0; | |
public: | |
R operator()(Args ...args) { | |
return call(args...); | |
} | |
}; |