博文

目前显示的是 七月, 2018的博文

learn Nodejs & Express & MongoDB

Ref: http://lonka.github.io/blog/2016/08/18/ng2/ng2-cli-quickstart/   http://www.imooc.com/article/6179 remove Nodejs del %USERPROFILE%\.npmrc rmdir /s/q "c:\Program Files\nodejs" rmdir /s/q "%APPDATA%\npm" rmdir /s/q "%APPDATA%\npm-cache" 安装 Nodejs v6.2.2(npm3) & Visual Studio Code 安装 npm install -g gulp yo webpack rimraf npm install -g typescript typings angular-cli npm install -g eslint tslint npm install -g angular-cli gulp yo webpack rimraf typescript typings eslint tslint ng new demo1 cd demo1 npm install   --- Error: Cannot find module ‘ exists-sync' 这是 1.0.0-beta8 的 issue ng build ng serve   (-prod 同时关闭 live Reload)   -- http://localhost:4200   -- http://localhost:49152(live Reload ) ng generate component header  //直接在「\app\」下加入一個 Component 名為 header ng generate service search ng build     // 以下命令可以將專案發行至 「 \dist 」 中 Ref: http://lonka.github.io/blog/2016/08/18/ng2/ng2-cli-quick

MongoDB & Linux

图片
1. environment set path = D:\opt\MongoDB\Server\3.4\bin D:\opt\MongoDB\Server\3.4\bin; http://mongodb.github.io/mongo-csharp-driver/2.8/getting_started/quick_tour/ http://mongodb.github.io/mongo-csharp-driver/2.8/getting_started/installation/ http://mongodb.github.io/mongo-csharp-driver/2.8/getting_started/quick_tour/ https://github.com/mongodb/mongo-csharp-driver 2. start up mongo service mongod --dbpath D:\data\db ./bin/mongod --dbpath=/home/m20 --logpath=/home/mlog/m20.log --fork --configsvr --port 27020 ./bin/mongos --logpath=/home/m30.log --configdb=192.168.1.202:27020 --fork mongod --port 27017 --dbpath D:\MongoDB\data\db Add the following lines in "mongo.config" file port=27017 dbpath=C:\mongodb\data\db\ logpath=C:\mongodb\log\mongo.log Start server : mongod.exe --config="C:\mongodb\mongo.config" Connect to remote MongoDB server via command line with authentication. mongo --username abcd --password abc123 --host server_ip_or_dns --port 27

DataAnnotations & Model in .Net Core

DataAnnotations is in System.ComponentModel.DataAnnotations. 1.using System.ComponentModel. DataAnnotations ; 1.1 [ Required ] 1.2 [ RegularExpression (@"^\d+$", ErrorMessage = "Only number")] public long Id { get; set; } 1.3[ Display (Name = "Color head")] public string displayOtherName { get; set; } 1.4[ Key ]  [Table("view_name")]     public class EFReservation     {       [ Key ]       public long keyId { get; set; }    } 2.using System.ComponentModel. DataAnnotations. Schema ; 2.1 [ Table ("TableName")]       public class EFBrandConfig{...} 2.2[ NotMapped ] public string notMapped { get; set; } 2.3[ Column ("my_id")] public string MyID { get; set; } 2.4 [ Column(TypeName = "datetime")] [Required]     [Display(Name = "Start DateTime")]     [Column(TypeName = "datetime")]     public DateTime? Start { get; set; } 3.using System. ComponentModel ; [ DefaultValue

Git tips

1.git rebase develop Current Branch : master ; Other Branch :  develop ; Beginning base point both master and develop :  Base_Node Other Branch develop 's last committed point: developLastPoint What does it mean to "git rebase develop" runs when the current branch is master? Hi, Git. I'm master branch. Please rebuild me base on develop. My beginning point will be developLastPoint of the branch develop . 2. git merge develop Current Branch : master ; Other Branch :  develop ; Means: Hi, Git. I'm master branch. Please make  a combination of differents of the branch develop and append it into my branch. 3. workflow 3.1 git init -> git add -> git commit 3.2 git init -> git commit -a  (equals git add -> git commit) git init: Hi git, please handle current folder. git add: Hi git, please add some files into staging area. 4.branch git branch git branch new_branch_name git branch -d will_be_deleted_branch_name git branch -D Must_b