Create a table to represent tree nodes.
CREATE TABLE `tree_node` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`data_body` text,
node_deleted datetime DEFAULT NULL,
| /* | |
| * Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
| */ | |
| var http = require('http'), | |
| fs = require('fs'), | |
| util = require('util'); | |
| http.createServer(function (req, res) { | |
| var path = 'video.mp4'; |
| <?php | |
| /* | |
| * Source: http://goo.gl/p2GybZ | |
| */ | |
| // for object | |
| function buildTree($items) { | |
| $childs = array(); | |
| foreach($items as $item) |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <div title="ok" id="oked"></div> |
| <?php | |
| function encrypt($str, $num){ | |
| $len = strlen(substr($str, $num, strlen($str) - $num)); | |
| $goin = str_repeat('*', $len); | |
| $res = substr($str, 0 , $num) .$goin . substr($str, $len, strlen($str)); | |
| return $res; | |
| } |
| function encrypt(str, num) { | |
| let len = str.substring(num, str.length - num).length; | |
| let goin = '*'.repeat(len); | |
| let res = str.slice(0, num) + goin + str.slice(str.length - num); | |
| return res; | |
| } | |
| console.log(encrypt('111111111111111111111111111', 4)); // 1111*******************1111 | |
| var http = require('http'); | |
| var url = require ('url'); | |
| var timestamp = (time) => { | |
| return Date.parse(time) | |
| } | |
| var unixTimestamp = (time) => { | |
| return { | |
| unixtime: timestamp(time) | |
| } |
| var http = require('http'); | |
| var server = http.createServer(function (req, res) { | |
| var body = ""; | |
| res.writeHead(200, { 'content-type': 'text/plain' }); | |
| if(req.method != 'POST') { | |
| return res.end('Please send a POST\n') | |
| } | |
| req.on('data', (data) => { |
| var http = require('http'); | |
| var fs = require('fs'); | |
| var server = http.createServer(function (req, res) { | |
| res.writeHead(200, { 'content-type': 'text/plain' }) | |
| fs.createReadStream(process.argv[3]).pipe(res); | |
| }) | |
| server.listen(process.argv[2]); |
| var net = require('net'); | |
| var date = new Date(); | |
| var y = date.getFullYear(); | |
| var m = zeroCheck(date.getMonth() + 1); | |
| var d = zeroCheck(date.getDate()); | |
| var h = zeroCheck(date.getHours()); | |
| var min = zeroCheck(date.getMinutes()); |