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 whtornb(j): | |
oned = {'1': 'I', '2': 'II', '3': 'III', '4': 'IV', '5': 'V', | |
'6': 'VI', '7': 'VII', '8': 'VIII', '9': 'IX', '0': ''} | |
twod = {'1': 'X', '2': 'XX', '3': 'XXX', '4': 'XL', '5': 'L', | |
'6': 'LX', '7': 'LXX', '8': 'LXXX', '9': 'XC', '0': ''} | |
threed = {'1': 'C', '2': 'CC', '3': 'CCC', '4': 'CD', '5': 'D', | |
'6': 'DC', '7': 'DCC', '8': 'DCCC', '9': 'CM', '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
from tkinter import * | |
from tkinter import ttk | |
from math import * | |
calc = Tk() | |
calc.title('Calculator 1.0') | |
calc.resizable(0, 0) | |
# functions |
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 tkinter import * | |
from tkinter import ttk | |
from tkinter import messagebox as mbox | |
from matplotlib.figure import Figure | |
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg | |
class Frame: | |
def __init__(self, root, framename, framelabel, col, row): | |
self.root = root |
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 math import * | |
from tkinter import * | |
from tkinter import ttk | |
app = Tk() | |
app.title('Prime number Checker') | |
def primecheck(x): | |
xa = sqrt(x) | |
if (xa % 1) == 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
# item 1 | |
i = 0 | |
while i <= 5: | |
asteriskshits = '*' * i | |
spacing = ' ' * (5 - i) * 2 | |
print( asteriskshits, spacing, asteriskshits) | |
i += 1 | |
# item 2 |
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
param = int(input('Enter a number: ')) | |
line_length = (param * 2) - 1 | |
for i in range(param + 1)[::-1]: | |
multiplier = ((i * 2) - 1) | |
center_string = str(i) * multiplier | |
if multiplier < line_length: | |
sides = [] | |
for ii in range(i + 1, param + 1): | |
sides.append(str(ii)) | |
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
function getPeakHours(feeds, consideration) { | |
const feedCount = feeds.length | |
// check if all feeds has a length of 12 | |
for (let i in feeds) { | |
if (feeds[i].length !== 24) { | |
return 'rejected: feed must have a length of 24' | |
} | |
} | |
// get hour averages |
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
/** | |
* order, orderBy, search by text, and set offset / limit for array of objects (depth = 1) | |
*/ | |
const sample = [ | |
{ | |
name: "cDudeson", | |
age: 32 | |
}, | |
{ |
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
filebeat.inputs: | |
- type: docker | |
containers.ids: '*' | |
processors: | |
- add_docker_metadata: ~ | |
output.elasticsearch: | |
hosts: ["http://192.168.99.103:9200"] | |
username: "elastic" | |
password: "changeme" |
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
/** | |
* y = a + bx | |
* | |
* | |
* a = ʏ̅ - bx̅ | |
* | |
* b = Σxy - nx̅ʏ̅ / Σx^2 - nx̅^2 | |
* | |
* */ |
OlderNewer