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
function cleanPreviousIndentation(line) | |
return line:gsub("^%s+", ""):gsub("%s+$", "") | |
end | |
function escapeString(str) | |
return str:gsub("[()]", "%%%1") | |
end | |
function string:split(delimiter) | |
local array = {} |
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
def quicksort(l): | |
if len(l) == 0: | |
return l | |
pivot = l.pop() | |
return quicksort([x for x in l if x < pivot]) + [pivot] + quicksort([x for x in l if x >= pivot]) |
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 builtins import KeyError | |
import string | |
class Steckerbrett: | |
def __init__(self, *args): | |
self.map = {} | |
for arg in args: | |
if arg[0] in self.map or arg[1] in self.map: |
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
#!/usr/bin/bash | |
# /usr/local/bin/automount | |
label=$(blkid -o value -s LABEL $1) | |
if [[ "x${label}" == "x" ]]; then | |
label=$(blkid -o value -s UUID $1) | |
fi | |
if [[ "x${label}" != "x" ]]; then | |
dest="/media/${label}" | |
mkdir -p ${dest} |
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
$("a").each(function(c,a){"PDF"==a.innerHTML&&$.get(a.href,function(a){$(a).find("a").each(function(a,b){"Baixar este arquivo PDF"==b.innerHTML&&window.open(b.href,null)})})}); |
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
qtd_notas = int(input()) | |
notas = [int(nota) for nota in input().split()] | |
freq, top = {}, (0, 0) | |
for i in range(0, qtd_notas): | |
if notas[i] not in freq: | |
freq[notas[i]] = 0 | |
freq[notas[i]] += 1 | |
for key in freq: |
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
compr, qtd = [int(i) for i in input().split()] | |
print((compr - qtd + 1) ** 2 + qtd - 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
conj, seq = [int(i) for i in input().split()] | |
A = [int(i) for i in input().split()][:conj] | |
jogadas = [int(i) for i in input().split()][:seq] | |
B = [] | |
for jogada in range(0, len(jogadas)): | |
if jogadas[jogada] in A: | |
B.append(jogadas[jogada]) | |
elif len(B) == 0: |
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 275f39c3faa61e59383915288de85cc90d9aca06 Mon Sep 17 00:00:00 2001 | |
From: Ranieri Althoff <[email protected]> | |
Date: Sun, 19 Apr 2015 03:47:18 -0300 | |
Subject: [PATCH 1/1] Make player walkthrough optional | |
--- | |
config.lua | 1 + | |
src/configmanager.cpp | 1 + | |
src/configmanager.h | 1 + | |
src/player.cpp | 4 ++-- |
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
#!/usr/bin/env sh | |
sed -i "s/^\(ip\s*=\s*\)\".*\"/\1\"$(curl -s icanhazip.com)\"/" config.lua |