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 cartesianProduct(a, b, repeatDigit = False): | |
if repeatDigit: | |
return {f'{aItem}{bItem}' for aItem in a for bItem in b} | |
else: | |
return {f'{aItem}{bItem}' for aItem in a for bItem in b if all([char not in bItem for char in list(aItem)])} | |
odd = {'1','3','5','7','9'} | |
even = {'0','2','4','6','8'} | |
natEven = {'2','4','6','8'} |
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
# Blender v2.79 (sub 0) OBJ File: 'Pentagon.blend' | |
# www.blender.org | |
mtllib Pentagon.mtl | |
o Plane | |
v -1.200000 -0.000000 -1.200000 | |
v -1.000000 0.000000 0.000000 | |
v 0.000000 -0.000000 -2.200000 | |
v 1.200000 -0.000000 -1.200000 | |
v 1.000000 0.000000 0.000000 | |
v -1.200000 0.100000 -1.200000 |
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
class Test: | |
objects = {} | |
def __new__(cls, id): | |
# Check if id is already used | |
if id in Test.objects: | |
print(f'Id {id} previously used, returning existing object') | |
# Return reference to existing object | |
return Test.objects[id] | |
else: | |
print(f'Id {id} not used, creating new object') |
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
public static void main(String[] args) { | |
int width = 1024; | |
int height = 800; | |
World earth = new World(width, height); | |
Turtle t0 = new Turtle(earth); | |
Random r = new Random(); | |
// Draws a random pixel for every pixel on th | |
for(int i = 0; i < width*height; i++){ | |
int x = r.nextInt(width); |
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.awt.Color; | |
import java.util.Scanner; | |
public class ATest{ | |
private static final int WORLD_WIDTH = 800; | |
private static final int WORLD_HEIGHT = 650; | |
private static World w; | |
private static Turtle t; | |
private static Scanner in = new Scanner(System.in); | |
private static boolean bold = false; |
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
/** | |
* Write a description of class Fraction here. | |
* | |
* @author (your name) | |
* @version (a version number or a date) | |
*/ | |
public class Fraction | |
{ | |
private int numerator; |
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
class BaseException(Exception): | |
""" This is a basic exception """ | |
class NotBasicException(BaseException): | |
""" This is not a basic exception """ | |
def args_decorator(ExceptionType, msg, status_code): | |
def decorate(func): | |
print(f'Decorating {func}') |
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
[INITIALIZATION][CLIENT][ERROR] [crafttweaker]: Error executing {[0:crafttweaker]: pixelmon.zs}: null | |
java.lang.NullPointerException | |
at crafttweaker.mc1120.recipes.MCRecipeShaped.toCommandString(MCRecipeShaped.java:335) | |
at crafttweaker.mc1120.recipes.MCRecipeManager$ActionBaseAddRecipe.calculateName(MCRecipeManager.java:824) | |
at crafttweaker.mc1120.recipes.MCRecipeManager$ActionBaseAddRecipe.setName(MCRecipeManager.java:818) | |
at crafttweaker.mc1120.recipes.MCRecipeManager$ActionAddShapedRecipe.<init>(MCRecipeManager.java:880) | |
at crafttweaker.mc1120.recipes.MCRecipeManager$ActionAddShapedRecipe.<init>(MCRecipeManager.java:875) | |
at crafttweaker.mc1120.recipes.MCRecipeManager.addShaped(MCRecipeManager.java:151) | |
at Pixelmon.__script__(pixelmon.zs:79) | |
at __ZenMain__.run(Pixelmon) |
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
print("Loading pixelmon recipes!"); | |
// Setup disc -> base recipes | |
val iron_disc = <pixelmon:iron_disc>; | |
val iron_base = <pixelmon:iron_base>; | |
recipes.addShaped(iron_base, [ | |
[iron_disc, null, iron_disc], | |
[iron_disc, iron_disc, iron_disc], | |
]); |
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 unittest | |
from flask05 import app | |
class FlaskTest(unittest.TestCase): | |
def setUp(self) -> None: | |
self.client = app.test_client() | |
def test_index(self): |
OlderNewer