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
#include <iostream> | |
#include <stack> | |
int main() | |
{ | |
std::string program; | |
unsigned char tape[30000] = {0}; | |
unsigned char* ptr = tape; |
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
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <limits.h> | |
#define STACK_MAX 100 | |
#define TAPE_MAX 30000 | |
#define ECHO_MESSAGES 1 | |
enum MESSAGE |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <gmp.h> | |
char* calculatePi(unsigned long digits); | |
int main() | |
{ | |
const unsigned long piDigits = 500; | |
char* pi = calculatePi(piDigits); |
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
#include <cstdlib> | |
#include <cstring> | |
#include <fstream> | |
#include <iostream> | |
#include <stdexcept> | |
#include <vector> | |
#include "lodepng/lodepng.h" // you have to have lodepng in this folder to compile | |
bool open_input(std::string filename, std::vector<unsigned char> &img, unsigned int &width, |
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
{% macro print_errors(field) -%} | |
{% for err in field.errors %} | |
<span style="color: red;">[{{ err }}]</span> | |
{% endfor %} | |
{%- endmacro %} |
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 matplotlib.pyplot as plt | |
def get_input(): | |
print('X label?') | |
xlabel = input() | |
print('Y label?') | |
ylabel = input() |
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
def role_required(role=ROLE_USER): | |
def wrapper(f): | |
@wraps(f) | |
def role_checker(*args, **kwargs): | |
if not current_user.is_authenticated: | |
abort(403) | |
if role == ROLE_USER or current_user.role == role: | |
return f(*args, **kwargs) | |
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
<div class="ui one column centered grid"> | |
<h1 class="row">text</h1> | |
</div> | |
<div class="ui divider"></div> |
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
// Based on Ben Eater's tutorial | |
#define SHIFT_DATA 2 | |
#define SHIFT_CLOCK 3 | |
#define SHIFT_LATCH 4 | |
#define EEPROM_I0 5 | |
#define EEPROM_I7 12 | |
#define WE 13 | |
void set_address(int addr, bool OE) |
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
let last_index = 0; // TODO: check if last_index is in range of videos.length | |
sections.forEach(section => { | |
section.data.forEach(item => { | |
item['video'] = last_index; | |
last_index++; | |
}); | |
}); |
OlderNewer