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 sys | |
def common_item(lista, listb, mode=0): | |
items = [] | |
for x in lista: | |
for y in listb: | |
if x==y: | |
if not mode: | |
return True | |
if mode: |
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 math | |
def f(x): # change this to the function of your choice | |
squared = math.pow(x, 2) | |
return math.sqrt(squared+1) | |
a = 0 # start | |
b = 2 # end | |
n = 6 # increase for more accuracy | |
dx = (b-a)/n |
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
$fn = 50; | |
union () { | |
difference() { | |
cube([8, 8, 9.6], center=true); | |
translate([0, 0, -3.2]) { | |
cube([4.8, 4.8, 3.2*3], center=true); | |
} | |
} | |
translate([0,0,9.6/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
import requests | |
# https://uinames.com/ | |
def random_name(amount=1, gender="", region="", minlen="", maxlen="", key="name"): | |
if gender != "": | |
gender = "?gender=" + gender | |
if region != "": |
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
# generated by PrusaSlicer 2.1.1+win64 on 2020-01-30 at 20:15:18 UTC | |
[print:0.2 mm] | |
avoid_crossing_perimeters = 0 | |
bottom_fill_pattern = rectilinear | |
bottom_solid_layers = 3 | |
bridge_acceleration = 0 | |
bridge_angle = 0 | |
bridge_flow_ratio = 1 | |
bridge_speed = 60 |
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
bool equal(int x, int y) | |
{ | |
if (x == 0 && y == 0) | |
{ | |
return true; | |
} | |
x--; | |
y--; | |
if (x<0 || y<0) | |
{ |
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 requests | |
class USGovWeatherSearch(): | |
def __init__(self): | |
self.lat = 41.08 | |
self.lng = -81.51 | |
self.gridx = 0 | |
self.gridy = 0 | |
self.base_url = "https://api.weather.gov/" | |
self.json = None |
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 json import loads | |
from datetime import datetime | |
from time import sleep | |
def operate_blinds(opened=False): | |
# operate the blinds | |
# write your blind operation code here | |
print(f"Blinds state: {opened}") | |
if __name__=="__main__": |
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
// in mm | |
height = 180; | |
leg_width = 55.88;// this is the length of width of the table leg | |
union() { | |
translate([0, 0, height*0.6]) { | |
difference() { | |
cube([leg_width, leg_width, 38.1], center=true); | |
cube([leg_width-6.35, leg_width-6.35, 38.25], 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
Desktop | |
Documents | |
Downloads | |
Music | |
Pictures | |
Public | |
Templates | |
Videos |