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
import re | |
from collections import defaultdict | |
def parse_expression(expression): | |
"""Converte a string de expressão em uma lista de termos com coeficientes e variáveis.""" | |
# Regex para capturar coeficientes e variáveis | |
pattern = r'([+-]?\d*)([a-zA-Z]+)' | |
terms = re.findall(pattern, expression) | |
parsed_terms = [] | |
for coef, var in terms: |
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
import tkinter as tk | |
def invert_y(canvas, y): | |
# Obtendo a altura do canvas | |
canvas_height = canvas.winfo_height() | |
# Invertendo a o eixo Y | |
return canvas_height - y | |
# Criando a janela principal | |
root = tk.Tk() |
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
# Lista contendo apenas os itens de farmácia | |
itens_de_farmacia = [] | |
# Lista de compras | |
lista_compra = [ | |
"Dipirona", | |
"Paracetamol", | |
"Item3", | |
"Repelente", | |
"Item5", |
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
import paho.mqtt.client as mqtt | |
flag_connected = 0 | |
def on_connect(client, userdata, flags, rc): | |
global flag_connected | |
flag_connected = 1 | |
def on_disconnect(client, userdata, rc): | |
global flag_connected |
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
# Specify the URL of the Firefox download file | |
$url = "https://download.mozilla.org/?product=firefox-latest&os=win&lang=en-US" | |
# Specify the path for the downloaded file | |
$output = "$env:temp\FirefoxInstaller.exe" | |
# Download the file | |
Invoke-WebRequest -Uri $url -OutFile $output | |
# Start the installation | |
Start-Process -FilePath $env:temp\FirefoxInstaller.exe -Args "/silent /install" -Verb RunAs -Wait |
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
# Specify the URL of the Chrome download file | |
$url = "https://dl.google.com/chrome/install/latest/chrome_installer.exe" | |
# Specify the path for the downloaded file | |
$output = "$env:temp\chrome_installer.exe" | |
# Download the file | |
Invoke-WebRequest -Uri $url -OutFile $output | |
# Start the installation | |
Start-Process -FilePath $env:temp\chrome_installer.exe -Args "/silent /install" -Verb RunAs -Wait |
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
string = "Let kids play outside without adult supervision?" | |
new_string = string.replace("without", "with") | |
new_string = new_string.replace("?","!") | |
print(new_string) |
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
// | |
// main.swift | |
// RunningApps | |
// | |
// Created by Heitor Bisneto on 21/09/23. | |
// | |
import Foundation | |
import AppKit |
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
<?php | |
$arrayAssociativo = array( | |
"nome" => "João", | |
"idade" => 30, | |
"cidade" => "São Paulo" | |
); | |
$json = json_encode($arrayAssociativo); | |
?> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder