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 <string> | |
#include <conio.h> | |
using namespace std; | |
template<typename T> | |
class password { | |
public: | |
template<typename T> |
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
mov eax, dword[module] | |
add eax, dword[eax + 0x3C] ; e_lfanew | |
mov eax, dword[eax + 0x50] ; SizeOfImage |
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 numpy as np | |
from collections import deque | |
clear = lambda: os.system('cls' if os.name=='nt' else 'clear') | |
class TuringTape: | |
def __init__(self, initial_data, empty_symbol): | |
self.data = deque(initial_data) | |
self.base_offset = 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
//https://geektimes.ru/post/255488/ | |
#include <IRremote.h> | |
#define IR_KEY_POWER 0x807F08F7 | |
#define IR_KEY_MENU 0x807FA857 | |
#define IR_KEY_VOLUME_MORE 0x807F708F | |
#define IR_KEY_VOLUME_LESS 0x807FF00F | |
#define IR_KEY_PROGRAM_NEXT 0x807F30CF | |
#define IR_KEY_PROGRAM_PREV 0x807FB04F |
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
#define F_CPU 1000000UL | |
#include <avr/io.h> | |
#include <avr/interrupt.h> | |
#include <avr/sleep.h> | |
#include <avr/sfr_defs.h> | |
#define TCNT0_COUNT 256 | |
#define TCNT1_COUNT 65536 | |
#define TCNT1_SCALE 64 |
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 <avr/io.h> | |
#include <avr/interrupt.h> | |
#include <avr/sleep.h> | |
#include <avr/sfr_defs.h> | |
#define SW1 _BV(PINB1) | |
#define SW2 _BV(PINB2) | |
typedef unsigned char byte; |
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
#define F_CPU 1000000UL | |
#include <avr/io.h> | |
#include <util/delay.h> | |
typedef unsigned char byte; | |
void init_ports() { | |
// Setup diodes | |
DDRB = 0xFF; |
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
set backspace=indent,eol,start | |
set number | |
set ruler | |
set autoindent | |
set nowrap | |
set expandtab | |
set tabstop=4 | |
set shiftwidth=4 | |
set softtabstop=4 |
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> | |
using namespace std; | |
constexpr char *date = __DATE__; | |
constexpr char *mon[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; | |
constexpr char mond[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; | |
// https://stackoverflow.com/a/25195711/1901561 | |
constexpr bool is_digit(char c) { |
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
from datetime import datetime | |
def get_build_number(): | |
time = datetime.now().timetuple() | |
day_of_year = time.tm_yday - 1 | |
year_since_1900 = time.tm_year - 1900 | |
build_num = day_of_year + int((year_since_1900 - 1) * 365.25) | |
if year_since_1900 % 4 == 0 and time.tm_mon > 2: | |
build_num += 1 | |
build_num -= 42593 |