Dexter Jin

Deprecated Experiments

Showing 106 changed files with 0 additions and 1018 deletions
1 -// Please implements multiplication tables (구구단)
1 -var numbers = new Array(12, 45, 2, 31, 4, 56, 6, 7);
2 -
3 -// find out maximum number and minimum numbers
4 -
5 -for (var index in numbers) {
6 - console.log ("index[" + index +"] = " + numbers[index]);
7 -}
1 -var numbers = new Array (10, 11, 2, 1, 3, 1, 4, 10, 20, 21);
2 -
3 -// Sort numbers in ascending order
1 -<html>
2 -<body>
3 -<script type="text/javascript">
4 -<!--
5 -document.write("Hello World");
6 -//-->
7 -</script>
8 -</body>
9 -</html>
1 -console.log("Hello");
2 -console.log("Hello");
3 -console.log("Hello");
4 -console.log("Hello");
5 -console.log("Hello");
1 -var a = 33;
2 -var b = 10;
3 -var c = "Test";
4 -console.log("a + b = ");
5 -result = a + b;
6 -console.log(result);
7 -
8 -console.log("a - b = ");
9 -result = a - b;
10 -console.log(result);
11 -console.log("a / b = ");
12 -result = a / b;
13 -console.log(result);
14 -console.log("a % b = ");
15 -result = a % b;
16 -console.log(result);
17 -console.log("a + b + c = ");
18 -result = a + b + c;
19 -console.log(result);
20 -a = a++;
21 -console.log("a++ = ");
22 -result = a++;
23 -console.log(result);
24 -b = b--;
25 -console.log("b-- = ");
26 -result = b--;
27 -console.log(result);
1 -var a = 33;
2 -var b = 10;
3 -console.log("Value of a => (a = b) => ");
4 -result = (a = b);
5 -console.log(result);
6 -console.log("Value of a => (a += b) => ");
7 -result = (a += b);
8 -console.log(result);
9 -console.log("Value of a => (a -= b) => ");
10 -result = (a -= b);
11 -console.log(result);
12 -console.log("Value of a => (a *= b) => ");
13 -result = (a *= b);
14 -console.log(result);
15 -console.log("Value of a => (a /= b) => ");
16 -result = (a /= b);
17 -console.log(result);
18 -console.log("Value of a => (a %= b) => ");
19 -result = (a %= b);
20 -console.log(result);
1 -var a = 2; // Bit presentation 10
2 -var b = 3; // Bit presentation 11
3 -console.log("(a & b) => ");
4 -result = (a & b);
5 -console.log(result);
6 -
7 -console.log("(a | b) => ");
8 -result = (a | b);
9 -console.log(result);
10 -
11 -console.log("(a ^ b) => ");
12 -result = (a ^ b);
13 -console.log(result);
14 -
15 -console.log("(~b) => ");
16 -result = (~b);
17 -console.log(result);
18 -
19 -console.log("(a << b) => ");
20 -result = (a << b);
21 -console.log(result);
22 -
23 -console.log("(a >> b) => ");
24 -result = (a >> b);
25 -console.log(result);
1 -var a = 10;
2 -var b = 20;
3 -console.log("(a == b) => ");
4 -result = (a == b);
5 -console.log(result);
6 -
7 -console.log("(a < b) => ");
8 -result = (a < b);
9 -console.log(result);
10 -console.log("(a > b) => ");
11 -result = (a > b);
12 -console.log(result);
13 -console.log("(a != b) => ");
14 -result = (a != b);
15 -console.log(result);
16 -console.log("(a >= b) => ");
17 -result = (a >= b);
18 -console.log(result);
19 -console.log("(a <= b) => ");
20 -result = (a <= b);
21 -console.log(result);
1 -var a = 10;
2 -var b = 20;
3 -var linebreak = "<br />";
4 -console.log ("((a > b) ? 100 : 200) => ");
5 -result = (a > b) ? 100 : 200;
6 -console.log(result);
7 -console.log ("((a < b) ? 100 : 200) => ");
8 -
9 -result = (a < b) ? 100 : 200;
10 -console.log(result);
1 -var numbers = new Array(1,2,2,3,4)
2 -for (var num in numbers) {
3 - // key and Value
4 - console.log(num + " = " + numbers[num]);;
5 -}
6 -console.log ("Exiting from the loop!");
1 -var age = 20;
2 -if( age > 18 ) {
3 - console.log("Qualifies for driving");
4 -}
5 -
6 -var age = 15;
7 -if( age > 18 ) {
8 - console.log("Qualifies for driving");
9 -} else {
10 - console.log("Does not qualify for driving");
11 -}
12 -
13 -
14 -var book = "maths";
15 -if( book == "history" ) {
16 - console.log("History Book");
17 -} else if( book == "maths" ) {
18 - console.log("Maths Book");
19 -} else if( book == "economics" ) {
20 - console.log("Economics Book");
21 -} else {
22 - console.log("Unknown Book");
23 -}
1 -var a = true;
2 -var b = false;
3 -console.log("(a && b) => ");
4 -result = (a && b);
5 -console.log(result);
6 -console.log("(a || b) => ");
7 -result = (a || b);
8 -console.log(result);
9 -console.log("!(a && b) => ");
10 -result = (!(a && b));
11 -console.log(result);
1 -var grade='A';
2 -console.log("Entering switch block");
3 -
4 -switch (grade)
5 -{
6 - case 'A':
7 - console.log("Good job");
8 - break;
9 -
10 - case 'B':
11 - console.log("Pretty good");
12 - break;
13 -
14 - case 'C':
15 - console.log("Passed");
16 - break;
17 -
18 - case 'D':
19 - console.log("Not so good");
20 - break;
21 -
22 - case 'F': console.log("Failed");
23 - break;
24 -
25 - default:
26 - console.log("Unknown grade")
27 -}
28 -
29 -console.log("Exiting switch block");
30 -
31 -
32 -
33 -switch (grade)
34 -{
35 - case 'A':
36 - console.log("Good job");
37 -
38 - case 'B':
39 - console.log("Pretty good");
40 -
41 - case 'C':
42 - console.log("Passed");
43 -
44 - case 'D':
45 - console.log("Not so good");
46 -
47 - case 'F':
48 - console.log("Failed");
49 -
50 - default:
51 - console.log("Unknown grade");
52 -
53 -}
54 -
55 -console.log("Exiting switch block");
1 -var a = 10;
2 -var b = "String";
3 -result = (typeof b == "string" ? "B is String" : "B is Numeric");
4 -console.log("Result => ");
5 -console.log(result);
6 -result = (typeof a == "string" ? "A is String" : "A is Numeric");
7 -console.log("Result => ");
8 -console.log(result);
1 -var name = "Ali";
2 -var money;
3 -money = 2000;
4 -
5 -console.log("my name is " + name);
6 -console.log("my money is " + money);
7 -
8 -var myVar = "global"; // Declare a global variable
9 -function checkscope( ) {
10 - var myVar = "local";
11 - // Declare a local variable
12 - console.log("print myVar " + myVar);
13 -}
14 -
15 -console.log("print myVar " + myVar);
16 -checkscope();
1 -var count = 0;
2 -console.log("Starting Loop ");
3 -
4 -while (count < 10) {
5 - console.log("Current Count : " + count);
6 - count++;
7 -}
8 -console.log("Loop stopped!");
9 -
10 -
11 -var count = 0;
12 -console.log("Starting Loop");
13 -do {
14 - console.log("Current Count : " + count);
15 - count++;
16 -} while (count < 5);
17 -console.log ("Loop stopped!");
1 -function addPrice(amount) {
2 - this.price = amount;
3 -}
4 -function book(title, author) {
5 - this.title = title;
6 - this.author = author;
7 - this.addPrice = addPrice;
8 -}
9 -
10 -var bookList = new Array(new book("Perl1", "Mohtashim"),new book("Smith", "Mohtashim"),new book("Carl", "Mohtashim"),new book("Perl2", "Mohtashim"));
11 -
12 -console.log(bookList);
13 -console.log("After Sorting");
14 -//bookList.sort(sortBook);
15 -console.log(bookList);
1 -function slice(str, start, end) {
2 -
3 -}
4 -var str = "Apples are round, and apples are juicy.";
5 -var sliced = str.slice(1, 3);
6 -console.log( sliced );
7 -console.log( slice(str, 1, 3));
1 -function reverse (input) {
2 -
3 -}
4 -var arr = [0, 1, 2, 3];
5 -console.log ("Reversed array is : " + arr.reverse() );
6 -console.log ("Reversed array is : " + reverse(arr));
1 -
2 -var alpha = ["a", "b", "c"];
3 -var numeric = [1, 2, 3];
4 -var alphaNumeric = alpha.concat(numeric);
5 -console.log("alphaNumeric : " + alphaNumeric );
6 -
7 -
8 -var numbers = [1, 4, 9];
9 -var element = numbers.pop();
10 -console.log("element is : " + element );
11 -
12 -var numbers = new Array(1, 4, 9);
13 -var length = numbers.push(10);
14 -console.log("new numbers is : " + numbers );
15 -
16 -var arr = [0, 1, 2, 3].reverse();
17 -console.log("Reversed array is : " + arr );
18 -
19 -console.log("Reversed Again : " + arr.reverse());
20 -
21 -
22 -var element = [105, 1, 2, 3].shift();
23 -console.log ("Removed element is : " + element );
24 -
25 -
26 -var arr = new Array("orange", "mango", "banana", "sugar");
27 -var length = arr.unshift("water");
28 -console.log("Returned array is : " + arr );
29 -console.log("Length of the array is : " + length );
30 -
1 -var test = new Array(1,2,3,4,5,6);
2 -
3 -for (var aa in test) {
4 - console.log(aa); // Set breakpoint here
5 -}
1 -function concatenate(first, last)
2 -{
3 - var full;
4 - full = first + last;
5 - return full;
6 -}
7 -function secondFunction()
8 -{
9 - var result;
10 - result = concatenate('Zara', 'Ali');
11 - console.log (result );
12 -}
13 -secondFunction();
1 -var val = new Number(100.000);
2 -
3 -console.log(val.toExponential());
4 -console.log(val.toFixed());
5 -console.log(val.toLocaleString());
6 -console.log(val.toPrecision());
7 -console.log(val.toString());
1 -function addPrice(amount) {
2 - this.price = amount;
3 -}
4 -function book(title, author) {
5 - this.title = title;
6 - this.author = author;
7 - this.addPrice = addPrice;
8 -}
9 -var myBook = new book("Perl", "Mohtashim");
10 -myBook.addPrice(100);
11 -console.log("Book title is : " + myBook.title);
12 -console.log("Book author is : " + myBook.author);
13 -console.log("Book price is : " + myBook.price);
1 -var val = new String("test");
2 -
3 -console.log(val.charAt(1));
4 -console.log(val.charCodeAt(1));
5 -console.log(val.concat("aaa"));
6 -console.log(val.indexOf("st"));
7 -console.log(val.indexOf("t"));
8 -console.log(val.lastIndexOf("t"));
9 -console.log(val.replace("te","a"));
10 -console.log(val.slice(2));
11 -console.log(val.split("es"));
12 -console.log(val.substr(2,2));
1 -function add(a,b) {
2 - return a+b;
3 -}
4 -function sub(a,b) {
5 - return a-b;
6 -}
1 -var Producer = require('./producer');
2 -var producer = new Producer();
3 -
4 -producer.on('add', function(t) {
5 - console.log('add:', t);
6 -});
7 -
8 -producer.start();
9 -
10 -// stop the clock 10 seconds after
11 -// setTimeout(function() {
12 -// clock.stop();
13 -// }, 10e3)
1 -var inherits = require('util').inherits;
2 -var EventEmitter = require('events').EventEmitter;
3 -
4 -
5 -var Producer = function () {
6 - if (! (this instanceof Producer)) return new Producer();
7 -
8 - EventEmitter.call(this);
9 -}
10 -
11 -module.exports = Producer;
1 -var fs = require("fs");
2 -var searchString = "test";
1 -var events = require('events');
2 -var eventEmitter = new events.EventEmitter();
3 -var connectHandler = function connected() {
4 - console.log('connection successful.');
5 - eventEmitter.emit('data_received');
6 -}
7 -
8 -eventEmitter.on('connection', connectHandler);
9 -
10 -eventEmitter.on('data_received', function(){
11 - console.log('data received successfully.');
12 -});
13 -
14 -eventEmitter.emit('connection');
15 -console.log("Program Ended.");
1 -var events = require('events');
2 -var eventEmitter = new events.EventEmitter();
3 -var listner1 = function listner1() {
4 -console.log('listner1 executed.');
5 -}
6 -var listner2 = function listner2() {
7 -console.log('listner2 executed.');
8 -}
9 -
10 -eventEmitter.addListener('connection', listner1);
11 -eventEmitter.on('connection', listner2);
12 -var eventListeners = require('events').EventEmitter.listenerCount(eventEmitter,'connection');
13 -console.log(eventListeners + " Listner(s) listening to connection event");
14 -
15 -eventEmitter.emit('connection');
16 -eventEmitter.removeListener('connection', listner1);
17 -console.log("Listner1 will not listen now.");
18 -
19 -eventEmitter.emit('connection');
20 -eventListeners = require('events').EventEmitter.listenerCount(eventEmitter,'connection');
21 -console.log(eventListeners + " Listner(s) listening to connection event");
22 -console.log("Program Ended.");
1 -
2 -var dt = require('./mymodule');
3 -
4 -console.log(dt.myDateTime());
1 -exports.myDateTime = function () {
2 - return Date();
3 -};
1 -var express = require('express');
2 -var app = express();
3 -var bodyParser = require('body-parser');
4 -
5 -app.use(bodyParser.urlencoded({ extended: false }));
6 -app.use(bodyParser.json());
7 -
8 -
9 -var books = new Array();
10 -
11 -app.get('/book/:bookId', function (req, res) {
12 - // Get book information
13 -
14 -});
15 -
16 -app.put('/book/:bookId', function (req, res) {
17 - // Update book information
18 -
19 -})
20 -app.post('/book', function (req, res) {
21 - // Create book information
22 -})
23 -
24 -app.delete('/book/:bookId', function (req, res) {
25 - // Delete book information
26 -
27 -})
28 -var server = app.listen(23023);
29 - console.log(books);
1 -{
2 - "name": "assignment01",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "index.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "author": "",
10 - "license": "ISC",
11 - "dependencies": {
12 - "body-parser": "^1.17.1",
13 - "express": "^4.15.2"
14 - }
15 -}
1 -var express = require('express');
2 -var app = express();
3 -var bodyParser = require('body-parser');
4 -var session = require('express-session')
5 -
6 -app.use(session({ secret: 'keyboard cat', cookie: { maxAge: 60000 }}))
7 -app.use(bodyParser.urlencoded({ extended: false }));
8 -app.use(bodyParser.json());
9 -
10 -
11 -var users = new Array();
12 -var userId = 'test';
13 -var userPass = '1234';
14 -
15 -app.get('/login/:userId/password/:password', function (req, res) {
16 - if (req.params.userId == userId && req.params.password == userPass) {
17 - req.session.userId = userId;
18 - }
19 - res.send("Login");
20 -});
21 -
22 -app.get('/logout/:userId', function (req, res) {
23 - // Logout
24 - req.session.userId = null;
25 - res.send("LogOut");
26 -
27 -});
28 -
29 -var auth = function (req, res, next) {
30 - // Session Check
31 - if (req.session.userId != null)
32 - next();
33 - else
34 - res.send("Error");
35 -
36 -};
37 -app.get('/user/:userId', auth,function (req, res) {
38 - // get User Information
39 - res.send("OK");
40 -});
41 -var server = app.listen(23023);
1 -{
2 - "name": "assignment02",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "index.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "author": "",
10 - "license": "ISC",
11 - "dependencies": {
12 - "body-parser": "^1.17.1",
13 - "express": "^4.15.2",
14 - "express-session": "^1.15.2"
15 - }
16 -}
1 -var express = require('express');
2 -var app = express();
3 -
4 -app.get('/', function (req, res) {
5 - res.send('hello world');
6 -})
7 -
8 -app.route('/book')
9 - .get(function (req, res) {
10 - res.send('Get a random book');
11 - })
12 - .post(function (req, res) {
13 - res.send('Add a book');
14 - })
15 - .put(function (req, res) {
16 - res.send('Update the book');
17 - });
18 -
19 -
20 -var server = app.listen(23023);
1 -{
2 - "name": "approute",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "index.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "author": "",
10 - "license": "ISC",
11 - "dependencies": {
12 - "express": "^4.15.2"
13 - }
14 -}
1 -var express = require('express');
2 -var app = express();
3 -var birds = require('./birds');
4 -
5 -
6 -app.get('/', function (req, res) {
7 - res.send('hello world');
8 -})
9 -
10 -app.use('/birds',birds);
11 -var server = app.listen(23023);
1 -var express = require('express');
2 -var router = express.Router();
3 -
4 -
5 -router.get('/', function (req, res) {
6 - res.send('Birds home page');
7 -})
8 -router.get('/about', function (req, res) {
9 - res.send('About birds');
10 -});
11 -
12 -module.exports=router;
1 -{
2 - "name": "expressrouter",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "index.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "author": "",
10 - "license": "ISC",
11 - "dependencies": {
12 - "express": "^4.15.2"
13 - }
14 -}
1 -var express = require('express');
2 -var app = express();
3 -app.get('/', function (req, res) {
4 - res.send('Hello World');
5 -})
6 -
7 -var server = app.listen(23023, function () {
8 - var host = server.address().address
9 - var port = server.address().port
10 - console.log("Example app listening at http://%s:%s", host, port)
11 -})
12 -
1 -{
2 - "name": "helloworld",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "index.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "author": "",
10 - "license": "ISC",
11 - "dependencies": {
12 - "express": "^4.15.2"
13 - }
14 -}
1 -var express = require('express');
2 -var app = express();
3 -
4 -app.get('/b', function (req, res, next) {
5 - console.log('the response will be sent by the next function ...')
6 - next()
7 -}, function (req, res) {
8 - res.send('Hello from B!')
9 -})
10 -
11 -var cb0 = function (req, res, next) {
12 - console.log("call by cb0");
13 - next()
14 -}
15 -var cb1 = function (req, res, next) {
16 - console.log("call by cb1");
17 - res.send('Hello from C!')
18 -}
19 -app.get('/c', [cb0, cb1])
20 -
21 -var server = app.listen(23023);
1 -{
2 - "name": "multiplehandler",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "index.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "author": "",
10 - "license": "ISC",
11 - "dependencies": {
12 - "express": "^4.15.2"
13 - }
14 -}
1 -var express = require('express');
2 -var app = express();
3 -
4 -app.set('view engine', 'ejs');
5 -app.set('views', 'views');
6 -
7 -app.get('/', function(req, res) {
8 - res.render('index', { title: 'OSS Page' });
9 -});
10 -
11 -var server = app.listen(23023);
1 -{
2 - "name": "render",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "index.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "author": "",
10 - "license": "ISC",
11 - "dependencies": {
12 - "ejs": "^2.5.6",
13 - "express": "^4.15.2"
14 - }
15 -}
1 -html>
2 -<body>
3 -<%= title %>
4 -</body>
5 -</html>
1 -var express = require('express');
2 -var app = express();
3 -
4 -app.get('/users/:userId/books/:bookId', function (req, res) {
5 - res.send(req.params);
6 -})
7 -
8 -var server = app.listen(23023);
1 -{
2 - "name": "routeparameter",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "index.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "author": "",
10 - "license": "ISC",
11 - "dependencies": {
12 - "express": "^4.15.2"
13 - }
14 -}
1 -var express = require('express');
2 -var app = express();
3 -
4 -// The routing path matches requests to /about
5 -app.get('/about', function (req, res) {
6 - res.send('about')
7 -})
8 -
9 -// The routing path matches requests to /random.text
10 -app.get('/random.text', function (req, res) {
11 - res.send('random.text')
12 -})
13 -
14 -// This route path matches abcd, abxcd, abRANDOMcd, ab123cd, and so on.
15 -app.get('/ab*cd', function (req, res) {
16 - res.send('ab*cd')
17 -})
18 -
19 -var server = app.listen(23023);
1 -{
2 - "name": "routingpath",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "index.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "author": "",
10 - "license": "ISC",
11 - "dependencies": {
12 - "express": "^4.15.2"
13 - }
14 -}
1 -var express = require('express');
2 -var app = express();
3 -
4 -var session = require('express-session')
5 -
6 -app.use(session({ secret: 'keyboard cat', cookie: { maxAge: 60000 }}))
7 -
8 -
9 -
10 -app.get('/', function(req, res, next) {
11 - var sess = req.session;
12 - console.log(req.session);
13 - if (sess.views) {
14 - sess.views++;
15 - res.send("session Views " + sess.views);
16 - res.send();
17 - } else {
18 - req.session.views = 1;
19 - res.send("welcome to the session demo. refresh!");
20 - res.end();
21 - }
22 -});
23 -
24 -var server = app.listen(23023);
1 -{
2 - "name": "session",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "index.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "author": "",
10 - "license": "ISC",
11 - "dependencies": {
12 - "express": "^4.15.2",
13 - "express-session": "^1.15.2"
14 - }
15 -}
1 -var express = require('express');
2 -var app = express();
3 -
4 -app.get('/', function (req, res) {
5 - res.send('hello world');
6 -})
7 -
8 -var server = app.listen(23023);
1 -{
2 - "name": "simplerouting",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "index.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "author": "",
10 - "license": "ISC",
11 - "dependencies": {
12 - "express": "^4.15.2"
13 - }
14 -}
1 -var express = require('express');
2 -var app = express();
3 -
4 -app.all('/', function (req, res, next) {
5 - console.log('Accessing the secret section ...')
6 - next() // pass control to the next handler
7 -})
8 -
9 -app.get('/', function (req, res) {
10 - res.send('hello world');
11 -})
12 -
13 -app.post('/', function (req, res) {
14 - res.send('POST request to the homepage')
15 -})
16 -
17 -var server = app.listen(23023);
1 -{
2 - "name": "specialrouting",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "index.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "author": "",
10 - "license": "ISC",
11 - "dependencies": {
12 - "express": "^4.15.2"
13 - }
14 -}
1 -var express = require('express');
2 -var app = express();
3 -app.use(express.static('public'));
4 -app.get('/', function (req, res) {
5 - res.send('Hello World');
6 -})
7 -var server = app.listen(23023);
1 -{
2 - "name": "staticfiles",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "index.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "author": "",
10 - "license": "ISC",
11 - "dependencies": {
12 - "express": "^4.15.2"
13 - }
14 -}
1 -<html>
2 -<body>
3 -Public index.html
4 -</body>
5 -</html>
1 -US President Donald Trump said no nation should underestimate American resolve, as he arrived in Japan at the start of a marathon Asian tour.
2 -Addressing US troops at Yokota air base near Tokyo, he pledged to ensure the military had the resources needed to keep peace and defend freedom.
3 -Mr Trump's visit comes amid heightened tensions with North Korea over its nuclear programme and missile tests.
4 -It will be the longest tour of Asia by a US president in 25 years.
5 -"No-one, no dictator, no regime... should underestimate American resolve," President Trump told cheering US and Japanese troops shortly after his arrival in Japan.
6 -Before touching down, he told reporters on board Air Force One that he expected to meet Russian President Vladimir Putin during his trip.
7 -"I think it's expected we'll meet with Putin," he said. "We want Putin's help on North Korea."
8 -Mr Trump was meeting Japanese Prime Minister Shinzo Abe for lunch before the two leaders were due to play a round of golf.
9 -Stops in South Korea, China, Vietnam and the Philippines are also on the itinerary in the coming week.
1 -West Ham manager Slaven Bilic says he is under "big pressure" and in a "very difficult" situation after Saturday's 4-1 Premier League defeat by Liverpool.
2 -
3 -Thousands of Hammers supporters left London Stadium early for the second home game in a row as the Hammers were left a point above the bottom three.
4 -
5 -"The pressure mounts game by game and at this moment it is big," Bilic, 49, told BBC Sport.
6 -
7 -"We will see what the club will do. The club is above everyone."
8 -
9 -West Ham have lost three of their past four games at London Stadium and were unable to cope with Liverpool's pace on the counter-attack throughout Saturday's game.
10 -
11 -Mohamed Salah scored twice for the visitors, with Joel Matip and Alex Oxlade-Chamberlain also on target. Manuel Lanzini briefly gave West Ham home by making it 2-1.
1 -For less than a month’s rent in her hometown of Vancouver, Lydia Lee is having a second storey built onto the villa she rents on the tropical island of Bali.
2 -Relocating to Indonesia seven years ago has meant she’s been able to build her business and afford a much more lavish lifestyle than she could at home. A life coach, Lee can now eat out every day, employ a cleaner and get weekly massages.
3 -She ditched her six-figure salary in marketing and business development and now works for herself and travels the world. But relocating overseas doesn’t always work out so well financially.
4 -Financial shocks
5 -Not all expats find they can afford to live the high-life. InterNations, a networking resource for expats, recently surveyed more than 12,500 people living in 188 countries or territories and the picture the data paint of their finances is remarkably diverse.
1 -#!/bin/bash
2 -
3 -FILES=${1}
4 -
5 -if [ ${#} -ne 1 ]
6 -then
7 - echo "Usage : psget process_name"
8 -fi
1 -#!/bin/bash
2 -
3 -FILES=${1}
4 -
5 -if [ ${#} -ne 1 ]
6 -then
7 - echo "Usage : rv files or directories"
8 -fi
1 -#!/bin/bash
2 -
3 -DIRECTORY=${1}
4 -
5 -if [ ${#} -ne 1 ]
6 -then
7 - echo "Usage : $0 directory"
8 -fi
1 -#!/bin/bash
2 -
3 -DIRECTORY=${1}
4 -
5 -if [ ${#} -ne 1 ]
6 -then
7 - echo "Usage : $0 directory"
8 -fi
9 -
10 -##################################
11 -## Get Checksum of file ##
12 -## checksum=`md5sum file` ##
13 -##################################
1 -const express = require('express');
2 -const fileUpload = require('express-fileupload');
3 -const app = express();
4 -
5 -//var aws = require('aws-sdk');
6 -//aws.config.loadFromPath('./awsconfig.json');
7 -
8 -//var BUCKET_NAME = 'intothegalaxy';
9 -//var s3 = new aws.S3();
10 -
11 -
12 -function uploadFile(file, res) {
13 -
14 - // Use the mv() method to place the file somewhere on your server
15 - file.mv('./upload/' + file.name, function(err) {
16 - if (err)
17 - return res.status(500).send(err);
18 -
19 - res.send('File uploaded!');
20 - });
21 -
22 -
23 -}
24 -
25 -// default options
26 -app.use(fileUpload());
27 -
28 -app.post('/', function(req, res) {
29 - if (!req.files)
30 - return res.status(400).send('No files were uploaded.');
31 - uploadFile(req.files.file, res);
32 -});
33 -
34 -app.get('/:fileName', function(req, res){
35 - var file = __dirname + '/upload/' + req.params.fileName;
36 - res.download(file); // Set disposition and send it.
37 -});
38 -
39 -var server = app.listen(23023);
40 -
1 -{
2 - "accessKeyId": "",
3 - "secretAccessKey": "",
4 - "region": "ap-northeast-2"
5 -}
1 -{
2 - "name": "experiments11",
3 - "version": "1.0.0",
4 - "description": "",
5 - "main": "app.js",
6 - "scripts": {
7 - "test": "echo \"Error: no test specified\" && exit 1"
8 - },
9 - "repository": {
10 - "type": "git",
11 - "url": "git@khuhub.khu.ac.kr:Prof.JinSeongwook/OSS-2017-02.git"
12 - },
13 - "author": "",
14 - "license": "ISC",
15 - "dependencies": {
16 - "aws-sdk": "^2.62.0",
17 - "express-fileupload": "^0.1.3"
18 - }
19 -}