Skip to content

Instantly share code, notes, and snippets.

View ADCDS's full-sized avatar
🥒
afiando a mandioca

Adriel Santos ADCDS

🥒
afiando a mandioca
View GitHub Profile
@ADCDS
ADCDS / timed_scheduler.hpp
Last active January 9, 2023 14:05
Timed task scheduler using boost asio
//
// Created by agiu on 1/4/23.
//
#ifndef INCLUDE_TIMED_SCHEDULER_HPP
#define INCLUDE_TIMED_SCHEDULER_HPP
#include <boost/asio/io_context.hpp>
#include <boost/system/error_code.hpp>
#include <boost/asio/steady_timer.hpp>
#turing machine that tests if the number of blank spaces between zero is even
input: '0 0'
blank: ' '
start state: start
table:
start:
0: {write: 0, R: B}
B:
' ': {write: ' ', R: C}
0: {write: 0, R: accept}
input: '<()()('
blank: ' '
start state: start
table:
start:
<: {write: <, R: A}
A:
X: {write: X, R: A}
(: {write: (, R: A}
): {write: X, L: B}
#Check if a string W is concated with self
#ex of accepted word: abaaba
input: '<abaabaab'
blank: ' '
start state: start
table:
start:
<: {write: <, R: A1}
A1:
input: '<abbabbbaaa'
blank: ' '
start state: start
table:
start:
<: {write: <, R: A}
A:
x: {write: x, R: A}
a: {write: x, R: B}
b: {write: x, R: D}
input: '<11111011101111000'
blank: ' '
start state: start
table:
start:
<: {write: <, R: q0}
q0:
0: {write: 0, R: q0}
1: {write: 1, R: q1}
' ': {write: ' ', R: accept}
input: '<0011001001110'
blank: ' '
start state: start
table:
start:
<: {write: <, R: q0}
q0:
0: {write: 0, R: q0}
1: {write: 1, R: q1}
' ': {write: ' ', R: accept}
input: '<aaabaaa'
blank: ' '
start state: start
table:
start:
<: {write: <, R: A}
A:
a: {write: x, R: B}
b: {write: x, R: F}
' ': {write: ' ', L: accept_E}
name: concat_w
source code: |
input: '<aaaaa'
blank: ' '
start state: start
table:
start:
<: {write: <, R: A}
A:
a: {write: x, R: B}
name: anbn
source code: |
input: '<aaabbb'
blank: ' '
start state: start
table:
start:
<: {write: <, R: I}
I:
a: {write: a, R: B}