College studies on CODE - NAME @ ICMC - University of São Paulo.
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
void drawGrid() { | |
push(); | |
stroke(0); | |
boolean switch_color = false; | |
for (int line = 0; line <= width; line += cell_size) { | |
for (int column = 0; column <= height; column += cell_size) { | |
if (switch_color) { | |
fill(255); | |
switch_color = false; | |
} else { |
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
if (thickness_flag) { | |
thickness += 1; | |
if (thickness >= 5) { | |
thickness_flag = false; | |
} | |
} else { | |
thickness -= 1; | |
if (thickness <= 1) { | |
thickness_flag = true; | |
} |
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
color[][] colors = { {#f7f4e3,#f9c4aa}, | |
{#fcd77f,#ff2e4c} | |
{#fcac0c,#ececec} | |
}; | |
void mouseClicked() { | |
// get random colorscheme | |
// (and guarantee it's a new colorscheme) | |
random_index = (int)random(colors.length); |
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
# wal | |
function rice { sudo -E wal -i "$1" -g --backend "$2" && sudo -E oomoxify-cli -g ~/.cache/wal/colors-oomox && ~/.wal-telegram/wal-telegram && sudo -E wal-steam -w } | |
export rice |
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
size(640, 360); | |
//background(#F2EAE8); | |
background(#ECE9E4); | |
translate(640 / 2, 360 / 2); | |
fill(#5E5554); | |
noStroke(); | |
ellipse(0, 0, 100, 100); |
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
#!/bin/bash | |
shopt -s nullglob | |
for ext in .in; do | |
files=(tests/*"$ext") | |
printf 'number of %s files: %d\n' "$ext" "${#files[@]}" | |
for i in `seq 1 ${#files[@]}`; do | |
rm results$i.out; | |
printf "\nRunning test $i\n"; |
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
sns.set() | |
sns.set_context("poster") | |
# plot something | |
figure = plt.gcf() # get current figure | |
# 800 x 600 | |
figure.set_size_inches(8, 6) | |
# save with high DPI | |
plt.savefig("plots/plot.png", dpi=100) |
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
if __name__ == '__main__': | |
try: | |
import IPython.core.ultratb | |
except ImportError: | |
# No IPython. Use default exception printing. | |
pass | |
else: | |
import sys | |
sys.excepthook = IPython.core.ultratb.ColorTB() | |
main() |
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
float posX, posY; | |
float radiusX, radiusY; | |
float theta; | |
int frames = 0; | |
PVector position; | |
ArrayList<PVector> trail; | |
int trailSize = 50; | |
int trailLength; |