Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/usr/bin/env python | |
# Solutions for Advent of Code 2022 | |
# Problem 1.1 | |
with open('./input.txt') as f: | |
elves_kal = [list(map(int, i.split())) for i in f.read().split('\n\n')] | |
print(max(sum(k) for k in elves_kal)) | |
# Problem 1.2 |
#!/usr/bin/env python3 | |
from subprocess import ( | |
Popen, | |
PIPE | |
) | |
class Service(object): | |
def __init__(self, service_name): |
#!/usr/bin/env bash | |
#Salve esse conteudo em um arquivo com o nome "install-docker.sh" ou outro de sua preferencia, e execute em um terminal | |
#usando "sh install-docker.sh" | |
executa_imagem=$() | |
echo "Removendo versões antigas do Docker...\n" | |
sudo apt-get remove -y docker docker-engine docker.io containerd runc > /dev/null |
date | opening | closing | lowest | highest | volume | quantity | amount | avg_price | |
---|---|---|---|---|---|---|---|---|---|
2018-10-10 | 1.5 | 1.65796 | 1.5 | 3.99 | 801301.09566204 | 433794.72838648 | 2552 | 1.84718956 | |
2018-10-11 | 1.65794 | 1.55901 | 1.46 | 1.7474 | 983668.51610792 | 613071.13758692 | 2116 | 1.60449327 | |
2018-10-12 | 1.55 | 1.62999 | 1.523 | 1.7 | 223158.52971305 | 136410.13539226 | 736 | 1.63593804 | |
2018-10-13 | 1.63 | 1.61995 | 1.6 | 1.7 | 158644.91389793 | 96865.23944556 | 527 | 1.63778993 | |
2018-10-14 | 1.61989 | 1.56 | 1.55 | 1.68 | 199750.14166781 | 123145.50911021 | 623 | 1.62206598 | |
2018-10-15 | 1.598 | 1.686 | 1.51 | 1.75 | 503712.90168951 | 303882.55315445 | 1473 | 1.65759072 | |
2018-10-16 | 1.66005 | 1.8299 | 1.64795 | 1.99998 | 564935.82582822 | 322736.91790896 | 1639 | 1.75045306 | |
2018-10-17 | 1.78105 | 1.77901 | 1.73 | 1.875 | 301418.01795127 | 169484.65835049 | 1274 | 1.77843836 | |
2018-10-18 | 1.779 | 1.73999 | 1.6999 | 1.805 | 257539.85030187 | 148232.1956103 | 947 | 1.73740832 |
from random import randint, choice | |
def plus_minus_expressions(quantity: int = 30) -> None: | |
for i in range(quantity): | |
n = lambda: choice([1,-1])*randint(0, 10) | |
oper = choice(['-', '+']) | |
print(f'{n()} {oper} {n()} {oper} {n()} = ') | |
def division_times_expressions(quantity: int = 30) -> None: | |
for i in range(quantity): |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/bin/sh | |
# Copyright 2020 Paul Morgan | |
# License: GPLv2 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) | |
set -x | |
set -e | |
# | |
# Docker build calls this script to harden the image during build. | |
# | |
# NOTE: To build on CircleCI, you must take care to keep the `find` | |
# command out of the /proc filesystem to avoid errors like: |
# -*- coding: utf-8 -*- | |
from mpl_finance import candlestick_ohlc | |
import numpy as np | |
from matplotlib import pyplot | |
import pandas as pd | |
from bs4 import BeautifulSoup | |
import urllib.request | |
import re |
__author__ = 'David Manouchehri' | |
from bs4 import BeautifulSoup | |
import urllib.request | |
import gzip | |
import io | |
url = 'http://yoururlgoesherehopefullythisisntavalidurl.com/pages.html' | |
headers = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', |
AF | 0132 | AFEGANISTÃO | |
---|---|---|---|
AL | 0175 | ALBÂNIA, REPÚBLICA DA | |
DE | 0230 | ALEMANHA | |
BF | 0310 | BURKINA FASO | |
AD | 0370 | ANDORRA | |
AO | 0400 | ANGOLA | |
AI | 0418 | ANGUILLA | |
AG | 0434 | ANTIGUA E BARBUDA | |
0477 | ANTILHAS HOLANDESAS | ||
SA | 0531 | ARÁBIA SAUDITA |