diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..342b52e
Binary files /dev/null and b/.DS_Store differ
diff --git a/.gitignore b/.gitignore
index 88acfc3..430555d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,5 +30,9 @@ node_modules
.npm
# Optional REPL history
+<<<<<<< HEAD
.node_repl_history
-.idea
\ No newline at end of file
+=======
+.node_repl_history
+.idea
+>>>>>>> 3ecd38f75474cf2841c56067b91cab60ab2bb1bc
diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..7b0be10
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+201601node
\ No newline at end of file
diff --git a/.idea/201601node.iml b/.idea/201601node.iml
new file mode 100644
index 0000000..2931aec
--- /dev/null
+++ b/.idea/201601node.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..97626ba
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml
new file mode 100644
index 0000000..cd1df6d
--- /dev/null
+++ b/.idea/jsLibraryMappings.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/201601node_node_modules.xml b/.idea/libraries/201601node_node_modules.xml
new file mode 100644
index 0000000..036cc50
--- /dev/null
+++ b/.idea/libraries/201601node_node_modules.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..72abef0
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..ac9efa2
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..7291d55
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,727 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $PROJECT_DIR$
+ true
+
+ bdd
+
+ DIRECTORY
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1457229239481
+
+ 1457229239481
+
+
+ 1457231367943
+
+
+ 1457231367943
+
+
+ 1457233082333
+
+
+ 1457233082333
+
+
+ 1457236185482
+
+
+ 1457236185482
+
+
+ 1457240830605
+
+
+ 1457240830605
+
+
+ 1457248874855
+
+
+ 1457248874855
+
+
+ 1457249784721
+
+
+ 1457249784721
+
+
+ 1457250796023
+
+
+ 1457250796023
+
+
+ 1457251394830
+
+
+ 1457251394830
+
+
+ 1457252107615
+
+
+ 1457252107615
+
+
+ 1457256540558
+
+
+ 1457256540558
+
+
+ 1457258503303
+
+
+ 1457258503303
+
+
+ 1457259114372
+
+
+ 1457259114372
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/10.event/emitter.js b/10.event/emitter.js
index 74c3dd3..25aeb5d 100644
--- a/10.event/emitter.js
+++ b/10.event/emitter.js
@@ -2,9 +2,14 @@ var EventEmitter = require('events');
var util = require('util');
function Girl(name){
this.name = name;
- EventEmitter.call(this);
+ EventEmitter.call(this); //Girl继承了EventEmitter的私有方法。
}
-util.inherits(Girl,EventEmitter);
+util.inherits(Girl,EventEmitter); //inherits让Gril继承了EventEmitter的原型方法。
+
+/*
+* Inherits是相当于js里的原型继承,只能继承prototype上的属性方法,用call是为了继承私有的,call看你自己的需要用不用
+* 也就是说call+Inherits =继承私有+原型
+* */
var girl = new Girl();
function Boy(name){
diff --git a/11.stream/write.txt b/11.stream/write.txt
index c0dbbd9..0baf063 100644
--- a/11.stream/write.txt
+++ b/11.stream/write.txt
@@ -1 +1,5 @@
-over123456789
\ No newline at end of file
+<<<<<<< HEAD
+123456789
+=======
+over123456789
+>>>>>>> b5f866fed8db516182cfdfd4ea9c4fcdc1d971b9
diff --git a/12.nodeclient/cross.js b/12.nodeclient/cross.js
new file mode 100644
index 0000000..19b7042
--- /dev/null
+++ b/12.nodeclient/cross.js
@@ -0,0 +1,15 @@
+var http = require('http');
+var fs = require('fs');
+var users = [];
+var server = http.createServer(function (req, res) {
+ var result = '';
+ req.on('data',function(data){
+ result+=data;
+ })
+ req.on('end',function(data){
+ users.push(JSON.parse(result));
+ //设置响应头,允许哪个来源来访问我这个服务器
+ res.end(JSON.stringify(users));
+ })
+
+}).listen(8080);
diff --git a/12.nodeclient/cross2.js b/12.nodeclient/cross2.js
new file mode 100644
index 0000000..3d3a984
--- /dev/null
+++ b/12.nodeclient/cross2.js
@@ -0,0 +1,14 @@
+var http = require('http');
+var fs = require('fs');
+
+var server = http.createServer(function (req, res) {
+ if(req.url == '/'){
+ fs.createReadStream('./index.html').pipe(res);
+ }else if(req.url =='/reg'){
+ //1. 获取请求里的请求体
+ //2. 构建一个指向8080的请求,把请求体传递过去
+ //3 .得到8080的响应,然后再传回客户端
+
+ }
+
+}).listen(9090);
diff --git a/6.file/1.read.js b/6.file/1.read.js
index a36b61a..faec3ba 100644
--- a/6.file/1.read.js
+++ b/6.file/1.read.js
@@ -8,6 +8,10 @@ function afterRead(err,data){
}
}
+<<<<<<< HEAD
+
+=======
+>>>>>>> 3ecd38f75474cf2841c56067b91cab60ab2bb1bc
/**
* 1.异步方法需要把回调函数传入
* 2. 回调函数会在同步方法执行完毕之后才执行异步回调
@@ -20,5 +24,9 @@ fs.readFile('./index.txt','utf8',function(err,data){
console.log(data);
}
});
+<<<<<<< HEAD
+
+=======
+>>>>>>> 3ecd38f75474cf2841c56067b91cab60ab2bb1bc
console.log('b');
console.log('c');
\ No newline at end of file
diff --git "a/6.file/6.\347\233\256\345\275\225.js" "b/6.file/6.\347\233\256\345\275\225.js"
index 8c223ac..65e58b6 100644
--- "a/6.file/6.\347\233\256\345\275\225.js"
+++ "b/6.file/6.\347\233\256\345\275\225.js"
@@ -47,3 +47,8 @@ fs.exists('./book',function(exists){
});
+<<<<<<< HEAD
+
+
+=======
+>>>>>>> 3ecd38f75474cf2841c56067b91cab60ab2bb1bc
diff --git a/6.file/7.path.js b/6.file/7.path.js
index c8dfd21..3278659 100644
--- a/6.file/7.path.js
+++ b/6.file/7.path.js
@@ -17,4 +17,8 @@ console.log(path.basename('7.path.js','.js'));
console.log(path.extname('7.path.js'));
//从一个相对路径解析出一个绝对路径
//以应用程序的所在目录为根起
+<<<<<<< HEAD
console.log(path.resolve('book','node.json','..','mysql.json'));
+=======
+console.log(path.resolve('book','node.json','..','mysql.json'));
+>>>>>>> 3ecd38f75474cf2841c56067b91cab60ab2bb1bc
diff --git a/7.http/6.query.js b/7.http/6.query.js
index 09ad684..fbecdb9 100644
--- a/7.http/6.query.js
+++ b/7.http/6.query.js
@@ -18,7 +18,11 @@ var url = require('url');
var server = http.createServer(function(request,response){
//把url转成url对象
var urlObj = url.parse(request.url,true);
+<<<<<<< HEAD
+ console.log(urlObj);
+=======
+>>>>>>> 3ecd38f75474cf2841c56067b91cab60ab2bb1bc
response.writeHead(200,{'Content-Type':'text/html;charset=utf-8'});
//pathname 指的是路径名 问号和端口号中间的那一部分
if(urlObj.pathname == '/apple'){
diff --git a/7.http/7.clock.js b/7.http/7.clock.js
index fa3a346..250123b 100644
--- a/7.http/7.clock.js
+++ b/7.http/7.clock.js
@@ -18,8 +18,11 @@ var url = require('url');
var server = http.createServer(function(request,response){
//把url转成url对象
var urlObj = url.parse(request.url,true);
+<<<<<<< HEAD
+=======
+>>>>>>> 3ecd38f75474cf2841c56067b91cab60ab2bb1bc
//pathname 指的是路径名 问号和端口号中间的那一部分
if(urlObj.pathname == '/'){
response.writeHead(200,{'Content-Type':'text/html;charset=utf-8'});
@@ -28,8 +31,13 @@ var server = http.createServer(function(request,response){
})
}else if(urlObj.pathname == '/clock'){
response.end(new Date().toLocaleString());
+<<<<<<< HEAD
+ //response.statusCode = 404;
+ //response.end('404');
+=======
response.statusCode = 404;
response.end('404');
+>>>>>>> 3ecd38f75474cf2841c56067b91cab60ab2bb1bc
}
});
//在8080端口上进行监听 ,主机名是localhost
diff --git a/8.ajax/2.AjaxPost/form.html b/8.ajax/2.AjaxPost/form.html
new file mode 100644
index 0000000..ee9a333
--- /dev/null
+++ b/8.ajax/2.AjaxPost/form.html
@@ -0,0 +1,55 @@
+
+
+
+
+ Title
+
+
+
+
+
+
\ No newline at end of file
diff --git a/8.ajax/2.AjaxPost/form.js b/8.ajax/2.AjaxPost/form.js
index 7b03c86..b28c9d2 100644
--- a/8.ajax/2.AjaxPost/form.js
+++ b/8.ajax/2.AjaxPost/form.js
@@ -44,12 +44,28 @@ http.createServer(function(req,res){
//发送响应
res.end('ok');
})
- }else if(pathname == '/reg2'){
+ }else if(pathname == '/reg2') {
// 构建一个解析器
- var formParser = new formidable.IncomingForm();
- ///用解析器解析请求体
+ var form = new formidable.IncomingForm();
+ ///用解析器解析请求体
//把非file的input放在fields里
//把文件类型的元素放在files里
+<<<<<<< HEAD
+ form.parse(req, function (err, fields, files) {
+ res.writeHead(200, {'content-type': 'text/plain'});
+ res.write('received upload:\n\n');
+ //inspect是把对象转成字符串
+ res.end(util.inspect({fields: fields, files: files}));
+ var formParser = new formidable.IncomingForm();
+ ///用解析器解析请求体
+ //把非file的input放在fields里
+ //把文件类型的元素放在files里
+ formParser.parse(req, function (err, fields, files) {
+ res.writeHead(200, {'content-type': 'text/plain'});
+ //inspect是把对象转成字符串
+ res.end("/imgs/3.png");
+ });
+=======
formParser.parse(req, function(err, fields, files) {
fs.readFile(files.avatar.path,function(err,data){
console.log(files.avatar);
@@ -82,8 +98,7 @@ http.createServer(function(req,res){
res.statusCode = 404;
res.end(JSON.stringify({name:'zfpx'}));
}
+>>>>>>> 348375664d1827fa3567d735906b4ba64d5cb627
})
}
-
-
}).listen(8080);
\ No newline at end of file
diff --git a/homework/.DS_Store b/homework/.DS_Store
new file mode 100644
index 0000000..52af75c
Binary files /dev/null and b/homework/.DS_Store differ
diff --git a/homework/1.git.png b/homework/1.git.png
new file mode 100644
index 0000000..77629d0
Binary files /dev/null and b/homework/1.git.png differ
diff --git "a/homework/2. \347\254\254\344\272\214\345\221\250\344\275\234\344\270\232.md" "b/homework/2. \347\254\254\344\272\214\345\221\250\344\275\234\344\270\232.md"
index 3d3f1ac..d168ea9 100644
--- "a/homework/2. \347\254\254\344\272\214\345\221\250\344\275\234\344\270\232.md"
+++ "b/homework/2. \347\254\254\344\272\214\345\221\250\344\275\234\344\270\232.md"
@@ -3,6 +3,9 @@
#2.使用node实现一个服务器端代理跨域服务器
+<<<<<<< HEAD
+#3.使用express实现注册登录的完整案例
+=======
#3.把自己上周的作业改为restful风格
#4.扩展作业
@@ -12,3 +15,4 @@
3. 登陆成功之后返回欢迎页 欢迎页
+>>>>>>> 92960b1d75100e5d0106c35a86ed80ab91c9fed7
diff --git a/homework/2.npm.png b/homework/2.npm.png
new file mode 100644
index 0000000..a497edd
Binary files /dev/null and b/homework/2.npm.png differ
diff --git a/homework/3.Buffer.concat/Buffer.concat.js b/homework/3.Buffer.concat/Buffer.concat.js
new file mode 100644
index 0000000..7e0a8bc
--- /dev/null
+++ b/homework/3.Buffer.concat/Buffer.concat.js
@@ -0,0 +1,19 @@
+/**
+ * Created by Akesure on 16-3-8.
+ */
+var buf1=new Buffer("珠");
+var buf2=new Buffer("峰");
+
+function concat(size,length){
+ var newSize=new Buffer(length);
+ var newStart=0;
+ for(var i=0,l=size.length;i
+
+
+
+ Title
+
+
+
+
+
+
+
+
+
+
+
+
+ | 用户名 |
+ 年龄 |
+
+
+ |
+ |
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/homework/index.html b/homework/index.html
new file mode 100644
index 0000000..e69de29
diff --git a/homework/index2.html b/homework/index2.html
new file mode 100644
index 0000000..e69de29
diff --git a/homework/int.txt b/homework/int.txt
new file mode 100644
index 0000000..b8626c4
--- /dev/null
+++ b/homework/int.txt
@@ -0,0 +1 @@
+4
diff --git "a/homework/\347\254\254\344\270\200\345\221\250\344\275\234\344\270\232.md" "b/homework/\347\254\254\344\270\200\345\221\250\344\275\234\344\270\232.md"
new file mode 100644
index 0000000..8ec929d
--- /dev/null
+++ "b/homework/\347\254\254\344\270\200\345\221\250\344\275\234\344\270\232.md"
@@ -0,0 +1,11 @@
+# 1. 玩游戏截图
+# 2. 发布一个npm包到服务器上
+# 3. 实现一个Buffer.concat方法
+# 4. 实现一个ajax增加和查询的功能。
+##查询
+把后台存放的用户数组查出来放在table里
+##增加
+把用户填写的表单添加到后台
+
+
+
diff --git "a/\345\215\236\345\212\237\347\243\212/friLessTest.html" "b/\345\215\236\345\212\237\347\243\212/friLessTest.html"
new file mode 100644
index 0000000..e88a868
--- /dev/null
+++ "b/\345\215\236\345\212\237\347\243\212/friLessTest.html"
@@ -0,0 +1,10 @@
+
+
+
+
+ Title
+
+
+第一节课git测试
+
+
\ No newline at end of file