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
/* | |
* RPi2c - test i2c communication between an Arduino and a Raspberry Pi. | |
* | |
* Copyright (c) 2013 Carlos Rodrigues <[email protected]> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
f=(b,c=j=(l=b.replace(/\n/g,r='')).length)=>[...b].map(d=>{for(a=t=9;a;)t-='H'!=l[(0|j-1+(--a%3-1)*b.search` | |
`+a/3)%c];j+=` | |
`!=d,r+={H:'t',t:'.','.':t&&3>t&&'H'}[d]||d})&&r |
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 f(a){a=a.split("\n");for(var g=a.length,e=a[0].length,l=[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1]],b="",d=0;d<g;d++){for(var h=0;h<e;h++){var c=a[d].length<e?" ":a[d][h];if(" "==c)b+=" ";else if("H"==c)b+="t";else if("t"==c)b+=".";else if("."==c){for(var k=c=0;8>k;k++){var m=(d+g+l[k][0])%g;"H"==(a[m].length<e?" ":a[m][(h+e+l[k][1])%e])&&c++}b=1<=c&&2>=c?b+"H":b+"."}}d+1<g&&(b+="\n")}return b}; |
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
f=(a,g,e,b,d=(a,c)=>a>--c?c:0<a&&0|a)=>e.map((l,c)=>b.map((b,h)=>b.map((b,k)=>s+=e[d(h-1+c/3/a,g)*a*3+3*d(k-1+c/3%a,a,z+=b)+c%3]*b),s=z=0)|d(z?s/z:s,256)) |
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
#!/usr/bin/env python3 | |
grid = [] | |
with open("report.txt", "r") as f: | |
for line in f: | |
grid.append([c for c in line.strip("\n")]) | |
size = len(grid) |
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
/* | |
* Yet Another Plasma Effect v2.0 - 10 years later... | |
* | |
* Copyright (c) 2008 Carlos Rodrigues <[email protected]> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
/* | |
* Pin A0 -> 2MΩ resistor -> GND | |
* Pin A0 -> antenna (a piece of wire a few centimeters long) | |
* | |
* Pin 11 -> LED -> 330KΩ resistor -> GND | |
*/ | |
static const char sensorPin = 0; | |
static const char ledPin = 11; |
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
// File: fire.pov | |
// Vers: 3 | |
// Desc: Burning cylinder with a sphere on top and toruses around | |
// Date: 11-05-97 | |
// Auth: Carlos Rodrigues | |
#include "colors.inc" | |
#include "textures.inc" | |
#include "shapes.inc" | |
#include "user.inc" |