Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 paho.mqtt.client as mqtt | |
| import json | |
| import ssl | |
| import time | |
| # --- PRINTER CREDENTIALS --- | |
| PRINTER_IP = "192.168.x.x" | |
| SERIAL_NUMBER = "0309F....." | |
| ACCESS_CODE = "3081..." | |
| USERNAME = "bblp" |
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
| include <BOSL2/std.scad> | |
| difference(){ | |
| color("white") | |
| cyl(h=3, d=40, $fn=100, chamfer=0.5); // Increased $fn for a smooth circle | |
| engraved_text(); // Renamed to avoid recursion | |
| up(1.5-0.2) | |
| curved_text(0.05, 0.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
| from collections import defaultdict, Counter | |
| import csv | |
| def loadnums(filename): | |
| nums = [] | |
| with open(filename) as csvfile: | |
| reader = csv.reader(csvfile, delimiter=':') | |
| for r in reader: | |
| nums.extend([int(i) for i in r]) | |
| return nums |
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
| #include "M5Atom.h" | |
| #include <FastLED.h> | |
| #define NUM_LEDS 140 // Number of LEDs in your strip | |
| #define DATA_PIN 25 // Data pin connected to your LED strip | |
| #define BUTTON_PIN G39 | |
| #define STAR_START 57 // Start index of the "star" effect | |
| #define STAR_END 134 // End index of the "star" effect |
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
| fun dithering(bitmap: Bitmap) { | |
| val height: Int = bitmap.getHeight() | |
| val width: Int = bitmap.getWidth() | |
| val colors = 3 | |
| val threshold = 255/colors | |
| for (x in 0 until width) { | |
| for (y in 0 until height) { | |
| val pixel = bitmap.getPixel(x, y) | |
| var alpha = Color.alpha(pixel) |
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
| #include <M5StickC.h> | |
| #include "bugC.h" | |
| #define sampleTime 0.005 | |
| float pitch = 0.0F; | |
| float roll = 0.0F; | |
| float yaw = 0.0F; | |
| float roll_offset = 0.0F; |
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
| difference(){ | |
| scale([1,1,0.3]){ | |
| surface("YOUR FILE NAME GOES HERE", center=true); | |
| } | |
| cube([200,200,14], center=true); | |
| } |
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 GomokuBoard: | |
| def __init__(self, size=9): | |
| self.size = size | |
| self.board = [0]*(size*size) | |
| self.last_move = None | |
| self.total_moves = 0 | |
| def clone_board(self): | |
| new_board = GomokuBoard(self.size) |
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 GomokuSearchTree(Node): | |
| def __init__(self, parent, board, from_move, next_player, simulation_limit=1, exploration_constant=1): | |
| Node.__init__(self, parent=parent, simulation_limit=simulation_limit, exploration_constant=exploration_constant) | |
| self.board = board | |
| self.from_move = from_move | |
| self.next_player = next_player | |
| def create_from_move(self, move): | |
| new_board = self.board.clone_board() | |
| new_board.place_move(move, self.next_player) |
NewerOlder