Skip to content

Instantly share code, notes, and snippets.

View tzdanows's full-sized avatar
🎯
Focusing

Tom Zdanowski tzdanows

🎯
Focusing
View GitHub Profile
@tzdanows
tzdanows / kafkaConsumer.java
Created November 7, 2023 08:14
kafka consumer and producer files
import org.apache.kafka.clients.producer.*;
import java.util.Properties;
public class SimpleProducer {
public static void main(String[] args) {
Properties props = new Properties();
props.put("bootstrap.servers", "localhost:9092");
props.put("acks", "all");
props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
@tzdanows
tzdanows / TM2.yml
Created May 9, 2021 23:56
TM2 from turingmachines.io
input: '000001#000011'
blank: ' '
# Problem TM2.
start state: start
table:
start:
0: {write: ' ', R: have0}
1: {write: ' ', R: have1}
# Base case: empty string.
' ': {R: reject}
@tzdanows
tzdanows / TM1.yml
Created May 9, 2021 23:32
TM1 from turingmachine.io
input: '00111010'
blank: ' '
# Problem TM1. Using the Turing machine simulator at turingmachine.io, write a TM program
# that accepts the language L = {w | w is a binary string with an even number of zeroes and
# an even number of ones}.
start state: state0
table:
state0:
0: {R: state1}
1: {R: state2}