sourcecode

Tan Miaoqing's Source Code

Some source code I have written, no big deal

C/C++

tinyC Interpretive Compiler

A Recursive-Descent Parser which generates quarternary expression, cooperates with an interpreter which runs the intermediate code and makes the output executable.

Simple FTP Server

A simple FTP server implementation by applying ACE, which supports uploading and downloading files. (FTP client command "get" and "put").

Markov Chain Algorithm

Random text generator generates nonsense in the style of another work, because the probability of spitting out each word depends only on the n words before it. More details can be found here. My code is generally followed the code written by Rob Pike and Brian Kernighan.

Data Structure

Several basic data structure practices, including stack (find paths out of a maze, big integer arithmetic), tree (huffman coding, heap, and binary search tree), graph (Dijkstra's shortest path, Minimum spanning tree).

Algorithm

Some algorithm practices, including sorting (insertion sort, selection sort, heap sort, quick sort), backtracking (N-queens), sieve of Eratosthenes, and practices from "Programming Pearls".

Java

BitRun BitTorrent Client

BitTorrent is a peer-to-peer (P2P) file distribution protocol, and it is designed to distribute large amounts of data widely without incurring the corresponding consumption in costly server and bandwidth resources. My BitTorrent client implementation is capable of requesting, and transmitting any type of computer file over a network, using the BitTorrent protocol. Additionally, it supports both Strict Priority (once a single sub-piece has been requested, the remaining sub-pieces from that particular piece are requested before sub-pieces from any other piece) and Rarest First (when selecting which piece to start downloading next, peers generally download pieces which the fewest of their own peers have first) algorithm.

Simple HTTP Server

A simple HTTP server implementation, which can serve multiple concurrent HTTP requests. It supports both HTTP GET and PUT methods.

Reactor Pattern

A course work of my course Concurrent Programming. The full description can be found here. Reactor pattern receives events from a set of handles and distributes them sequentially to the corresponding event handlers. Thus, the application using the Reactor need only use one thread to handle concurrently arriving events.

Tuple Space

Another course work of Concurrent Programming. The full description can be found here. The goal is to implement a new platform-independent chat system that is intended to allow users to participate in a conversation from a wide range of devices. Messages are distributed between threads and the various servers in the system by utilizing Tuple Space.

The practice of programming brought me infinite joy by solving problems and creating, thus driving me to probe the computer science. I gradually realized that programming not only meant coding, but also contained testing, debugging, portability, performance, design alternatives, and style.

This page is maintained by Tan Miaoqing, Email: mitan@cc.hut.fi

The contents of this page has last been updated 17.01.2007