Software techniques in a Unix-style environment, using scripting languages and a machine-oriented programming language (typically C). What goes on in the operating system when programs are executed. Core topics: creating and using software tools, pipes and filters, file processing, shell programming, processes, system calls, signals, basic network programming.
C program that implements a variant of the
Game of Life
Your program reads three command line arguments: the first
represents the height of the board (the number of rows),
the second represents the width of the board (the number of
columns), and the third represents the number of states to print.
C program that constructs a tree (an FTree) representing a file
tree rooted at the file specified by the user. You will also write
a function to walk an FTree and to print some of the file
information stored in it.
For example, here is the output of our solution run on the example
directory from the previous section (see below for information on
the order that items appear):
$ ../print_ftree .
===== . (d700) =====
ftree.c (-640)
Makefile (-640)
===== temp (d750) =====
hello.txt (-640)
temp_link (l777)
ftree_linked.c (-640)
ftree.h (-644)
print_ftree.c (-644)
$
The goal of this assignment is to practice creating and using
multiple processes in C. For this assignment, you will write a
multi-process implementation of the
Closest Pair of Points
that takes advantage of parallel computation. In other
words, using pipes() to communicate between processes.
For this assignment, we created a simple version of a Twitter
server. When a new user connects, the server will send them
"Welcome to CSC209 Twitter! Enter your username: ".
After they input an acceptable name that is not equal to any
existing users's username and is not the empty string, they are
added to Twitter, and all active users (if any) are alerted to the
addition (e.g., "Karen has just joined.").
If they input an
unacceptable name, they should be notified and asked again to.
enter their name.
Furthermore they can:
follow username
unfollow username
show (shows perviously sent messages of user this user follows)
send message (broad casts message to every that follows this user)
quit (disconnect from server)
Sample server log
Ryans-MacBook-Pro:a4 ryanchang$ make PORT=53748 gcc -DPORT=53748 -Wall -g -std=gnu99 -c twerver.c gcc -DPORT=53748 -Wall -g -std=gnu99 -c socket.c gcc -DPORT=53748 -Wall -g -std=gnu99 -o twerver twerver.o socket.o Ryans-MacBook-Pro:a4 ryanchang$ ./twerver A new client is connecting Waiting for a new connection... New connection accepted from 192.168.0.252:51347 Connection from 192.168.0.252 Adding client 192.168.0.252 [4] Read 7 bytes hello hello hello has just joined. ^C Ryans-MacBook-Pro:a4 ryanchang$ Ryans-MacBook-Pro:a4 ryanchang$ make PORT=53748 gcc -DPORT=53748 -Wall -g -std=gnu99 -c twerver.c gcc -DPORT=53748 -Wall -g -std=gnu99 -o twerver twerver.o socket.o Ryans-MacBook-Pro:a4 ryanchang$ ./twerver A new client is connecting Waiting for a new connection... New connection accepted from 192.168.0.252:51351 Connection from 192.168.0.252 Adding client 192.168.0.252 [4] Read 6 bytes ryan has just joined. A new client is connecting Waiting for a new connection... New connection accepted from 192.168.0.252:51353 Connection from 192.168.0.252 Adding client 192.168.0.252 [5] Read 4 bytes [5] Read 2 bytes jack has just joined. [5] Read 7 bytes [5] Read 2 bytes [5] Found newline:send hi with length 7 User jack: sent msg: hi [4] Read 17 bytes [4] Found newline:send hello jack with length 15 User ryan: sent msg: hello jack [5] Read 10 bytes [5] Read 2 bytes [5] Found newline:jakdfa daf with length 10 Invalid command [5] Read 11 bytes [5] Read 2 bytes [5] Found newline:follow ryan with length 11 User jack following ryan. [4] Read 25 bytes [4] Found newline:send inpirational tweet with length 23 User ryan: sent msg: inpirational tweet [5] Read 30 bytes [5] Found newline:send wow quite inspirational with length 28 User jack: sent msg: wow quite inspirational [5] Read 14 bytes [5] Found newline:send goodbye with length 12 User jack: sent msg: goodbye [5] Read 4 bytes [5] Read 2 bytes [5] Found newline:quit with length 4 got here 55 Removing client 5 192.168.0.252 Client 5 disconnected [4] Read 4 bytes [4] Read 2 bytes [4] Found newline:quit with length 4 got here 55 Removing client 4 192.168.0.252 Client 4 disconnected
Overall:3.5/5, Workload 3.5/5, Difficulity 4/5
The workload was fair. Content wise, one of the most interesting courses
I've taken. Learning about parallel processing opened my eyes about how
CPUs allocate work to "perform" video games.
Exploring C and its "low levelness"
showed me how computer work under the hood. C really gets your hands dirty.