- 博客(109)
- 收藏
- 关注
原创 Big data 001 -- what is big data?
Introduction to what big data is, and create definitions.
2022-08-26 02:38:12
601
原创 Angular -- Template Variables
<input type="text" id="item_input #item>#item is an example of a template variable, used to capture the user input of <input> element.Template variables help you use data from one part of a template in another part of the template.Synt.
2022-05-31 13:03:36
247
原创 Angular -- Pipes
PIPE,翻译为管道。Angular 管道是编写可以在HTML组件中声明的显示值转换的方法。Format:{{interpolated_value | pipe_name}}Example: Date Pipe 日期转换管道 {{ value_expression | date [ : format [ : timezone [ : locale ] ] ] }} today: number = Date.now(); ...
2022-05-30 13:25:33
155
原创 Distributed Systems 001 -- Introduction
A distributed system is a collection of autonomous computing elements that appears to its users as a single coherent system.System:a collection of computing elements -- Nodes. Node:a hardware device or a software process Autonomous computing elem...
2022-05-22 09:29:27
175
原创 Data types
INTINT[(width)] [UNSIGNED] [ZEROFILL]4 bytes in storage width = number of digits displayed!= storage width unsigned = positive number zerofill: fill left with 0 until widthExample:CREATE TABLE test_bigint (id BIGINT UNSIGNED);BIGINTBIGIN.
2022-02-24 08:45:02
326
原创 Express.js -- Request Object
req.paramsReturn route param. The stuff before query param -- '?'Node:router.get('/yomama/:something', function(req, res, next) { console.log(req.params.something);});URI:http://localhost:3000/fibonacci/yomama/3wafwa?node=xxxOutput:3waf
2022-02-02 14:23:43
338
原创 React.js -- Useful Component Examples
Input box w/ data Keep track of which cell to edit via this.state.edit. Render an input field when displaying the table if the row and column indices match the cell the user double-clicked. Update the data array with the new value from the inp
2022-02-02 08:59:24
96
原创 React.js -- Component Lifecycle
MountingComponent added to DOMMethodcomponentDidMount(): doing initialization work that require DOM e.g. add listener, fetch data from server UpdatingsetState() is called or prop updatedMethodgetSnapshotBeforeUpdate(): doing saving work
2022-01-26 16:37:14
681
原创 React.js -- Component
2个方法建react component:Use function -- return the UI Use ES6 class that extends React.ComponentUsing created component
2022-01-26 08:52:21
1162
原创 MySQL Learning Note 005 -- Adding, deleting and updating
Add data to tablesINSERT INTO table_name VALUES(col_1, col_2, col_3, ...); // 按顺序填入所有fields,字符串要加引号, 每个field之间要加逗号,结尾要加分号Use null when the field is auto-generated override auto value by manually providing a valuef Use ignore to disregard duplic
2022-01-25 05:36:14
915
原创 React.js -- JSX
适用于react的javascript语法扩展用于生成react element logic,markup 相结合的语法Advantage简单 快 type safeBasic JSXconst element = <h1>Hello, world!</h1>;const element = <img src={user.avatarUrl} />;const element = ( <div> <.
2022-01-24 14:02:46
581
原创 React.js -- Getting Started
React is a Javascript library High performance frontend framework Use small and isolated pieces of UI code called “components”Initializae React Appnpx create-react-app my-appcd my-appnpm startApp structure manifest.json 指定了开始页面 ind...
2022-01-24 13:23:35
260
原创 Node.js -- http
Create Server调用 http http.createServer(function(req,res){ ... }).listen(portNum); function用于处理client请求并返回response function每次request都会被运行 var http = require('http');var fs = require('fs');var url = require('url'); // 创建服务器http.createServer..
2022-01-23 02:34:11
85
原创 Node.js -- GET/POST
GET request解析url -- url.parse e.g.http://localhost:3000/user?name=Charlie var http = require('http');var url = require('url');http.createServer(function(req, res){ // 获取url参数列表 var params = url.parse(req.url, true).query; console.log.
2022-01-22 08:14:11
199
原创 Node.js -- File System
fs 同时支持sync & asynce.g. readdirSync vs. readdir获取文件列表fs.readdir(dir_name, function(err,files){})目录名 回调函数 error对象 files数组 fs.readdir('.', function(err,files){ // 读取当前目录文件列表并打印 console.log(files);})获取文件元数据fs.stat(file_p..
2022-01-22 04:23:15
747
原创 Node.js -- 全局变量
__filename当前正在执行的脚本的绝对路径__dirname当前执行脚本所在的目录setTimeout(cb, ms)在ms毫秒后执行一次函数(cb)clearTimeout(t)取消Timeout,tsetInterval(cb, ms)每ms毫秒后执行一次函数(cb)clearInterval(cb, ms)取消intervalconsole控制台Process当前进程,一个与操作系统的简单接口...
2022-01-21 09:20:13
535
原创 Node.js -- Modules
文件模块一一对应引入模块require用于从外部获取一个模块 引入当前文件夹内的hello.js var hello = require('./hello');导出模块exports用于把对象公开 公开文件中的 'world' function:【hello.js】exports.world = function() {...} 使用world:require('hello'); hello.world() //先import文件,再使用function 直接.
2022-01-21 08:51:27
108
原创 Node.js -- Stream
An abstract classthat is widely implemented and used in Node.jsTypes Readable- 可读操作。 Writable- 可写操作。 Duplex- 可读可写操作. Transform- 操作被写入数据,然后读出结果 Stream Events data- 当有数据可读时触发。 end- 没有更多的数据可读时触发。 error- 在接收和写入过程中发生错误时...
2022-01-21 08:07:27
216
原创 Node.js -- Buffer
该类用来创建一个专门存放二进制数据的缓存区创建 Buffer 类 const buf1 = Buffer.alloc(10); //创建长度为10的缓存区 写入缓冲区 len = buf.write("www.runoob.com"); //返回实际写入的大小 读取缓存区 buf.toString('utf8') //以utf-8返回字符串 转json buf.toJSON() // 返回 JSON 对象 长度 buf.length; ..
2022-01-21 07:48:59
218
原创 Node.js -- Event
Only object in event class: Event.EventEmitter Emitter can both listen and emit eventsMethods
2022-01-21 06:54:22
218
原创 MySQL Learning Note 004 -- Querying
Select rows based on column valueSELECT * FROM table_name WHERE col_name = value; // select all rows that satisfies SELECT col_1, col_2 FROM table_name WHERE col_name = value; // only specified columns from rows that satisfiesExample matching cond
2022-01-21 06:46:08
405
原创 Typescript
> npm i typescript> tsc test.ts> node test.jsType Systemany: no type number: double precision (64-bit) floating point null vs. undefined:A variable initialized with undefined means that the variable has no value or object assigned t..
2022-01-20 06:53:36
340
原创 Promise
asynchronous programming handle multiple tasks at the same time kip the current operation and move to the next line of the codeSyntaxvar promise = new Promise(function(resolve, reject){// our logic goes here ..});If the function’s response is .
2022-01-19 09:30:40
83
原创 MySql Learning Notes 003 -- DB Design
Collect requirement from stakeholders Identify entities Identify primary keys Identify relationship N:M -- create intermediate relations (to convertN:M into two 1:N relationships) 1:N -- "1" side entity PK as foreign key in N...
2022-01-18 23:53:00
504
原创 Express.js -- Introduction
SetupCreate project folder cd. into the folder and run "npm i -g express-generator" to install project generator globally run "express" to generate project in the project folder option "--view=hbs" sets up the view template run "npm install" instal
2022-01-16 05:24:24
167
原创 Node.js -- HTTP
basic es6 classdefinitionclass Note { constructor(key, title, body) { this._key = key; this._title = title; this._body = body; } get key() { return this._key; } get title() { return this._title; } set title(
2022-01-15 14:41:42
203
原创 Node.js: CP5
reqreq.url: host名之后的所有内容. e.g. http://localhost:4200/url --> req.url = /url req.method: http method. i.e. GET, POST, PUT DELETEaccessing req body dataNode sends its data using stream API, that is, inchunks.Therefore,the best way to access dat..
2022-01-10 05:45:02
237
原创 HTML MegaDoc
FormHTML user input<form action="/action_page.php" method="get"> <label for="fname">First name:</label> <input type="text" id="fname" name="fname"><br><br> <label for="lname">Last name:</label>
2022-01-10 04:25:26
313
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人