This file contains hidden or 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
# catches 'a', 'b', 'c' chars and Ctrl+C to stop program | |
import sys | |
import termios | |
import tty | |
from select import select | |
def getKey(settings, timeout): | |
tty.setraw(sys.stdin.fileno()) | |
rlist, _, _ = select([sys.stdin], [], [], timeout) | |
key = sys.stdin.read(1) if rlist else '' |
This file contains hidden or 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
const uint8_t pin_pwm_a = 11; // OC1A | |
const uint8_t pin_pwm_b = 12; // OC1B | |
const uint8_t pin_pwm_c = 13; // OC1C (LED pin!!!) | |
const uint16_t pwm_period = 40; // microseconds (== 25 kHz PWM) | |
const uint16_t timer_resolution = pwm_period * 8; // PWM resolution | |
uint16_t input_value = 0; | |
void setup() { | |
Serial.begin(57600); | |
pinMode(pin_pwm_a, OUTPUT); |
This file contains hidden or 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains hidden or 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 <thread> | |
#include <chrono> | |
#include <unistd.h> | |
#include <netdb.h> | |
#include <arpa/inet.h> | |
#include <string.h> | |
#include "opencv2/opencv.hpp" | |
#define SERVER_IP "127.0.0.1" |
This file contains hidden or 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 <unistd.h> | |
#include <netdb.h> | |
#include <arpa/inet.h> | |
#include <string.h> | |
#include "opencv2/opencv.hpp" | |
using namespace cv; | |
#define SERVER_IP "127.0.0.1" |
This file contains hidden or 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 <unistd.h> | |
#include <netdb.h> | |
#include <arpa/inet.h> | |
#include <string.h> | |
#define SERVER_IP "127.0.0.1" | |
#define SERVER_PORT 9999 | |
#define BUFLEN 4096 |
This file contains hidden or 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 | |
from socket import * | |
server_address = ("localhost", 10000) | |
buff_size = 1024 # 1Kb | |
with socket(AF_INET, SOCK_STREAM) as client_socket: | |
print(f"Connecting to {server_address}") | |
client_socket.connect(server_address) | |
while True: |
This file contains hidden or 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 | |
from matplotlib.animation import FuncAnimation | |
import random | |
x = [] | |
y = [] | |
def animate(i): | |
x.append(random.randint(0, 50)) | |
y.append(random.randint(0, 50)) |
This file contains hidden or 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
%% Initialization | |
clear;clc; | |
% symbols | |
syms X Y Z real | |
F = 0.5*(1 - X)^2 + 0.5*(Y - X^2)^2; % Функция Розенблата | |
%F = sin(X) + sin(Y); | |
dFx = diff(F, X); | |
dFy = diff(F, Y); | |
dFxx = diff(dFx, X); |
This file contains hidden or 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
fun createTexture(color: Color, circle: Boolean, w: Int, h: Int): TextureRegion { | |
val pixmap = Pixmap(w, h, Pixmap.Format.RGBA8888) | |
pixmap.setColor(color) | |
if (circle) { | |
pixmap.fillCircle(w/2, h/2, w/2) | |
} else { | |
pixmap.fill() | |
} | |
val textureRegion = TextureRegion(Texture(pixmap)) | |
pixmap.dispose() |