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
# n_sum(n) = sum_{i=0}^n i | |
# n_sum(n) = n + n_sum(n-1) | |
# n_sum(n) = n + n-1 + n_sum(n-2) | |
# n_sum(n) = n + n-1 + ... + 0 | |
.text: | |
main: | |
# Por convención, en RISC-V el stack pointer (sp) apunta al dato que está |
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
.text: | |
# Inicializamos t1 con la dirección donde están guardados los pixeles. | |
la t1, pixels | |
# Cantidad de pixels. | |
li t3, 5 | |
# Inicializamos el valor máximo de rojo en 0. | |
li t4, 0 |
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
CXX := g++ | |
CXX_FLAGS := -pthread --std=c++2a | |
VPATH := bin/ | |
SRCS := $(shell find src -name '*.cpp') | |
BINS := $(patsubst src/%.cpp,%,$(SRCS)) | |
RUNS := $(addprefix run-,$(BINS)) | |
all: $(BINS) |
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
template<typename T> | |
vector<string> string_map<T>::keys() const { | |
vector<string> keys; | |
keys.reserve(_size); | |
_root->collectKeys("", &keys); | |
return keys; | |
} | |
template<typename T> | |
void string_map<T>::Node::collectKeys(const string& prefix, vector<string>* keys) { |
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 shlex | |
import subprocess | |
from django.core.management.base import BaseCommand | |
from django.utils import autoreload | |
class Command(BaseCommand): | |
def add_arguments(self, parser): |
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 time | |
from subprocess import call | |
from os.path import join | |
from django.conf import settings | |
from django.core.management.base import BaseCommand | |
from watchdog.observers import Observer | |
from watchdog.events import PatternMatchingEventHandler | |