This is the output we expect and should be the same regardless of any solution.
Note that WSRewriter
and ProxySocket
receive different values and the client receives only one message.
> node streams.js
Solution *
WSRewriter:
var http = require('http'); | |
var fs = require('fs'); | |
server = {} | |
/** | |
* Builds a url from the array object <b>path</b>. If anything needs to be appended to the path please add it in <b>file</b> | |
* @param file Any directories that need to be prepended to the string of the resource | |
* @param path An array of items that will be used to construct the url | |
* @author <a href="mailto:coreystubbs@microbialdev.com">Corey Stubbs</a> | |
* @since 0.1 | |
*/ |
/* Blue Dude */ | |
var draw = function(ctx) { | |
ctx.save(); | |
ctx.beginPath(); | |
ctx.moveTo(0,0); | |
ctx.lineTo(640,0); | |
ctx.lineTo(640,480); | |
ctx.lineTo(0,480); | |
ctx.closePath(); | |
ctx.clip(); |
/* Author: Corey Stubbs cas5542 (AT) gmail [DOT] com | |
* Date: 11/12/2012 | |
* About: This a a javascript program that uses the concept of self description when adding two numbers. | |
* The main purpose of this program is found within the addTwo function of Program. The function | |
* will add the two numbers, a and b, iff the third parameter, string, is the string encoding of Program. | |
* If string is not the encoding, the function will always return 0. Very strange, I know, but this is a | |
* very important concept in computer science and is made possible via the recursion theorem. This | |
* particular kind of program is know as a quine. I have provided two links in regards to recursion | |
* theorem and quines. If you have any questions let me know! | |
* |
# CMPSC 473, Project 4 | |
# Corey Stubbs, 90201575, cas5542@psu.edu | |
# Jeremy Ploumis, 974335459, jep5190@psu.edu | |
SRC = pr4.c | |
#LIB = | |
#INC = | |
#$(LIB) $(INC) | |
pr3: $(SRC) | |
gcc -std=c99 -Wall -Wextra -o pr4 $(SRC) |
(defn add [x] | |
(apply + x)) |