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 __future__ import annotations | |
| import importlib | |
| from typing import TYPE_CHECKING | |
| import typer | |
| from typer.core import TyperGroup | |
| if TYPE_CHECKING: | |
| from click import Context |
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 pydantic import ValidationError | |
| from pydantic_core import ErrorDetails | |
| CUSTOM_MESSAGES = { | |
| "arguments_type": "Os argumentos devem ser uma tupla, lista ou um dicionário", | |
| "assertion_error": "Falha na asserção, {error}", | |
| "bool_parsing": "A entrada deve ser um booleano válido, não foi possível interpretar a entrada", | |
| "bool_type": "A entrada deve ser um booleano válido", | |
| "bytes_too_long": "Os dados devem ter no máximo {max_length} byte{expected_plural}", | |
| "bytes_too_short": "Os dados devem ter pelo menos {min_length} byte{expected_plural}", |
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
| """ | |
| This is an example of how to wrap an ASGI application to run it as a Cloud | |
| Function. Since I did it purely for academic purpose, I'm not quite sure of | |
| how well it performs, but as someone simply trying to run my FastAPI code | |
| inside the GCP serverless platform, it did great. | |
| Also, credits to jordaneremieff/mangum, I got a lot of inspiration from their | |
| work that has enabled running ASGI in AWS Lambda too. | |
| """ | |
| from __future__ import annotations |
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 http import HTTPStatus | |
| import flask.typing as ft | |
| from flask import Flask | |
| from wrapper import as_cloudfunction | |
| app = Flask(__name__) |
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
| #include "hashtable.hpp" | |
| #include <sstream> | |
| HashTable::HashTable(int size) { | |
| int i; | |
| count = 0; | |
| colisions = 0; | |
| capacity = size; | |
| array = new int *[capacity]; |
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 socket | |
| import threading | |
| import utils | |
| class DMClient: | |
| def __init__( | |
| self, *, ip_addr: str = "127.0.0.1", port: int = 41995, buffer_size: int = 4192 | |
| ) -> None: | |
| self.ip_addr = ip_addr |
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 <stdio.h> | |
| #include <stdlib.h> | |
| #define N 512 | |
| long long int CACHE[N] = { 0, 1 }; | |
| long long int fib(int n) { | |
| if (n > 0 && !CACHE[n]) | |
| CACHE[n] = fib(n - 2) + fib(n - 1); |
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 java.util.Arrays; | |
| import java.util.stream.IntStream; | |
| public final class Sudoku { | |
| private static final int[][] SQUARE_CORNERS = new int[9][2]; | |
| static { | |
| var lastIndex = 0; | |
| for (var i = 0; i < 9; i += 3) { | |
| for (var j = 0; j < 9; j += 3) { |
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 <stdio.h> | |
| #include <stdlib.h> | |
| int fib(int n); | |
| int main(int argc, char **argv) { | |
| // compiling: gcc fib.c -o fib | |
| // exec with: ./fib <n> | |
| int i_num; |
NewerOlder