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 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"); |
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
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} |
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
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} |