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 itertools import zip_longest | |
class Bits(bytes): | |
CHUNK = 8 | |
def __new__(cls, n): | |
return super().__new__(cls, cls.number_to_bits(n)) | |
@staticmethod |
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
"""Geometry""" | |
class Point: | |
def __init__(self, x, y): | |
self.x = x | |
self.y = y | |
def __eq__(self, other): | |
return self.x == other.x and self.y == other.y |
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
""" | |
13. wordcount | |
Este desafio é um programa que conta palavras de um arquivo qualquer de duas | |
formas diferentes. | |
A. Lista todas as palavras por ordem alfabética indicando suas ocorrências. | |
Ou seja... |
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
""" | |
01. donuts | |
Dado um contador inteiro do numero de donuts, retorne uma string | |
com o formato 'Number of donuts: <count>' onde <count> é o numero | |
recebido. Entretanto, se o contador for 10 ou mais, use a palavra 'many' | |
ao invés do contador. | |
Exemplo: donuts(5) retorna 'Number of donuts: 5' | |
e donuts(23) retorna 'Number of donuts: many' | |
""" |
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 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 onEdit(e) { | |
var rule = e.range.getDataValidation(); | |
if (rule != null) { | |
var value = e.range.getCell(1,1).getValue(); | |
var criteria = rule.getCriteriaType(); | |
var validationRange = rule.getCriteriaValues()[0]; | |
var i = findInRange(value, validationRange.getValues()); |
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
/* Google Spreadsheet Data Validation by Reference | |
Author: Henrique Bastos <[email protected]> | |
License: MIT | |
*/ | |
function onEdit(e) { | |
var rule = e.range.getDataValidation(); | |
if (rule == null) { | |
return; |
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
# The definitive guide to setup my Python workspace | |
# Author: Henrique Bastos <[email protected]> | |
# Updated: 2022-07-14 for reference. | |
PY3=3.10.4 | |
PY3TOOLS="youtube-dl s3cmd fabric pytest poetry requests" | |
VENVS=~/.ve | |
PROJS=~/workspace |
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
#!/usr/bin/python -tt | |
# Copyright 2010 Google Inc. | |
# Licensed under the Apache License, Version 2.0 | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# Google's Python Class | |
# http://code.google.com/edu/languages/google-python-class/ | |
"""Mimic pyquick exercise -- optional extra exercise. | |
Google's Python Class |
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
asd | |
asd | |
asd | |
asd | |
asd | |
asd |