Skip to content

Instantly share code, notes, and snippets.

View xyos's full-sized avatar

xyos xyos

View GitHub Profile
# python3 suma_cuadrados.py
# Nombre del archivo:test1.txt
# 13
with open(input("Nombre del archivo:"), 'r') as archivo:
num1 = int(archivo.readline().strip())
num2 = int(archivo.readline().strip())
print(num1*num1+num2*num2)

Keybase proof

I hereby claim:

  • I am xyos on github.
  • I am xyos (https://keybase.io/xyos) on keybase.
  • I have a public key ASBDeooHLzv60eDYLa2cZ1nfLfmIleu7cDvnbTcXffAMcAo

To claim this, I am signing this object:

@xyos
xyos / test.cc
Created November 25, 2017 18:41
void rotate () {
int l_size = sizeof(leds)/sizeof(*leds);
int first_five = leds[0] >> 3;
int five_leds = 0;
for (int i = 1; i < l_size; ++i) {
five_leds = leds[i] >> 3;
leds[i-1] = ( ( leds[i-1] << 5 ) & 0b11100000 ) | five_leds;
cout << leds[i-1] << "\n";
}
leds[l_size-1] = ( ( leds[l_size-1] << 5 ) & 0b11100000 ) | first_five;
let msj =
" 000 000 000 000 000 000 000 000 ooo 000 000 000 000 000 000 000 "+
" 0 0 0 0 0 0 0 0 0 0 o o 0 0 0 0 0 0 0 0 0 " +
" 000 0 0 000 0 0o0 000 0 ooo 000 0 0 0 000 000 0 0 0 " +
" 0 0 0 0 0 0 0 0 0 0 oo 0 0 0 0 0 0 0 0 0 0 " +
" 0 0 000 000 000 000 0 0 0 000 o o 000 000 0 0 000 000 0 0 000 ";
msj = msj.split("").reverse()
var leds = [];
for (var i = 0; i < 80 ; i++) {

The power of Vim

Example 1 (power of dot)

example.h

bool Process1(int nitems);
bool Process2(int position);
bool Process3(int ntrials, bool property);
const data = {
1: {
prime: !0,
name: 'water',
ingredients: [['ice', 'heat'], ['snow', 'heat']],
creates: [
'steam',
'sea',
'ocean',
'mud',