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 math | |
def simulate_cache(addresses, cache_size, block_size): | |
block_size_bits = block_size * 32 | |
index_bits = int(math.log2(cache_size)) | |
cache = {} | |
results = [] | |
for address in addresses: | |
binary_address = bin(address)[2:].zfill(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
def decimal_to_binary_32bit(number): | |
return format(number, '032b') | |
addresses = [3, 180, 43, 2, 191, 88, 190, 14, 181, 44, 186, 253] | |
results = [] | |
num_blocks = 16 | |
index_bits = 4 |
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 { | |
createBrowserRouter, | |
RouteObject, | |
RouterProvider, | |
} from "react-router-dom"; | |
import { ListResources } from "./pages/Resources/ListResurces"; | |
import { Root } from "./pages/Root"; | |
import ViewResource from "./pages/Resources/ViewResource"; | |
import CreateResourceForm from "./pages/Resources/CreateResource"; | |
import { Button, Result } from "antd"; |
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 os | |
import sys | |
import subprocess | |
def main(): | |
if len(sys.argv) != 2: | |
print("Uso: python script.py <BRANCH_NAME>") | |
sys.exit(1) | |
branch_name = sys.argv[1] |
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
// Seleção de elementos | |
const todoForm = document.querySelector("#todo-form"); | |
const todoInput = document.querySelector("#todo-input"); | |
const todoList = document.querySelector("#todo-list"); | |
const editForm = document.querySelector("#edit-form"); | |
const editInput = document.querySelector("#edit-input"); | |
const cancelEditBtn = document.querySelector("#cancel-edit-btn"); | |
let oldInputValue; |
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
/* Geral */ | |
* { | |
padding: 0; | |
margin: 0; | |
font-family: Helvetica; | |
color: #333; | |
box-sizing: border-box; | |
} | |
body { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Todo Avançado</title> | |
<!-- CSS do projeto --> | |
<link rel="stylesheet" href="css/styles.css"> | |
<!-- Font Awesome --> |
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 handleMessages(filter) { | |
const valuesAlreadySent = [] | |
const interval = setInterval(() => { | |
if (valuesAlreadySent.length >= Object.keys(filter).length) { | |
clearInterval(interval) | |
return | |
} | |
const div_message = document.querySelectorAll('div[data-message-text]') |
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
const fs = require('fs'); | |
const path = require('path'); | |
const readline = require('readline'); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
terminal: false | |
}); |
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 _validateCPF( | |
value: string, | |
handleResponse: (value: Record<string, unknown>) => void | |
): void { | |
let data = {}; | |
let sum; | |
let rest; | |
sum = 0; | |
if (value === '000.000.000-00') { |
NewerOlder