This file contains hidden or 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
    
  
  
    
  | // | |
| // main.cpp | |
| // wirth | |
| // | |
| // Created by Alex Muscar on 6/20/13. | |
| // Copyright (c) 2013 Alex Muscar. All rights reserved. | |
| // | |
| #include <iostream> | |
| #include <vector> | 
  
    
      This file contains hidden or 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
    
  
  
    
  | // | |
| // Program.cs | |
| // | |
| // Author: | |
| // Alex Muscar <muscar@gmail.com> | |
| // | |
| // Copyright (c) 2013 Alex Muscar | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | 
  
    
      This file contains hidden or 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
    
  
  
    
  | class ExpEndpoint<T> | |
| { | |
| private Queue<T> inputQueue; | |
| private Queue<T> outputQueue; | |
| private Object stateLock = new Object(); | |
| private TaskCompletionSource<T> reader; | |
| public ExpEndpoint(Queue<T> inputQueue, Queue<T> outputQueue) | |
| { | |
| this.inputQueue = inputQueue; | 
  
    
      This file contains hidden or 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 mimetypes as mime | |
| import os | |
| import socket | |
| import sys | |
| WWW_ROOT = 'www_root' | |
| STATUS_MESSAGES = { 200: 'OK', | |
| 404: 'Not Found', | |
| 500: 'Internal Server Error' } | 
  
    
      This file contains hidden or 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 sys | |
| import random | |
| # Read | |
| def read_file(path): | |
| f = open(path) | |
| text = f.read() | |
| f.close() | |
| return text.split() | 
NewerOlder