02 2020 档案

摘要:Generate a certificate git clone https://github.com/RubenVermeulen/generate-trusted-ssl-certificate.git cd generate-trusted-ssl-certificatebash genera 阅读全文
posted @ 2020-02-28 21:37 Zhentiw 阅读(399) 评论(0) 推荐(0) 编辑
摘要:In this course, we'll learn how to exploit and then mitigate several common Web Security Vulnerabilities: Man in the Middle (MITM), Cross Site Request 阅读全文
posted @ 2020-02-28 03:49 Zhentiw 阅读(430) 评论(0) 推荐(0) 编辑
摘要:Unlike JavaScript's const variable declarations, TypeScript allows you to create fully immutable types. In this lesson, we learn how to create immutab 阅读全文
posted @ 2020-02-26 00:25 Zhentiw 阅读(660) 评论(0) 推荐(0) 编辑
摘要:There might be cases where you have selective data for your entities. Let's say that you are building a public API endpoint to get all the registered 阅读全文
posted @ 2020-02-26 00:15 Zhentiw 阅读(146) 评论(0) 推荐(0) 编辑
摘要:The component we test against: import {Component, OnInit} from '@angular/core'; import {Course} from "../model/course"; import {Observable} from "rxjs 阅读全文
posted @ 2020-02-25 19:55 Zhentiw 阅读(341) 评论(0) 推荐(0) 编辑
摘要:What makes objects different is that we can create more of them. Every time we use the {} object literal, we create a brand new object value: let shre 阅读全文
posted @ 2020-02-25 18:46 Zhentiw 阅读(93) 评论(0) 推荐(0) 编辑
摘要:When you give an element an id attr, it will automaticlly create a object with the same name of id: <form id="theform" action="/" method="post"> <labe 阅读全文
posted @ 2020-02-25 02:22 Zhentiw 阅读(138) 评论(0) 推荐(0) 编辑
摘要:Let's see a simple code example: let pet = "dog" console.log(pet) We have console.log(pet) inside the code, when you read it, you might say: Pass ´pet 阅读全文
posted @ 2020-02-24 18:39 Zhentiw 阅读(134) 评论(0) 推荐(0) 编辑
摘要:It can be confusing to understand when and how the .prototype and .proto properties are created and used. They both seem to imply having something to 阅读全文
posted @ 2020-02-21 20:36 Zhentiw 阅读(189) 评论(0) 推荐(0) 编辑
摘要:"let" keyword, the same as "const" does hoist the variable. But different from 'var', it does both hoist and assign value as "undefined". "let" in oth 阅读全文
posted @ 2020-02-21 19:48 Zhentiw 阅读(106) 评论(0) 推荐(0) 编辑
摘要:Continue with previous post: https://www.cnblogs.com/Answer1215/p/12342540.html Now we need to think about functionExpression and ArrowFunction: funct 阅读全文
posted @ 2020-02-21 19:13 Zhentiw 阅读(446) 评论(0) 推荐(0) 编辑
摘要:Continue with the previous post: https://www.cnblogs.com/Answer1215/p/12337243.html What we want to do in this post, is adding parent function name in 阅读全文
posted @ 2020-02-21 18:41 Zhentiw 阅读(269) 评论(0) 推荐(0) 编辑
摘要:第一个原则:四项错误 一个三段论中,只能有三个不同的概念。如果有四个,就一定错了 比如: “人已经存在几百万年了,而你没有存在几百万年,所以你不是人”。看上去只有三个概念, “人,几百万年,你”。但是前后两个“人”的概念不同,前一个是指“人类”,而后一个指的是“人体”。所以总共有四个概念“你,几百万 阅读全文
posted @ 2020-02-21 04:40 Zhentiw 阅读(2430) 评论(0) 推荐(0) 编辑
摘要:For example we have current code: function add(a, b) { console.log(a, b) return a + b } function subtract(a, b) { console.log(a, b) return a - b } add 阅读全文
posted @ 2020-02-20 20:15 Zhentiw 阅读(194) 评论(0) 推荐(0) 编辑
摘要:The Promise.any() method accepts an array (or any other iterable) of promises as a parameter. It returns a Promise object that is fulfilled with the v 阅读全文
posted @ 2020-02-20 19:01 Zhentiw 阅读(192) 评论(0) 推荐(0) 编辑
摘要:The Promise.allSettled() method accepts an array (or any other iterable) of promises as a parameter. It returns a Promise object that is fulfilled wit 阅读全文
posted @ 2020-02-20 18:27 Zhentiw 阅读(439) 评论(0) 推荐(0) 编辑
摘要:In this post, we are going to see how to use 'fakeAsync' to test async code in Angular Context. fakeAsync using Zoom.js underhook, it detects all the 阅读全文
posted @ 2020-02-20 17:59 Zhentiw 阅读(284) 评论(0) 推荐(0) 编辑
摘要:In Javascript, there are two types of event loops for async tasks. First one, is well known one, for example, setTimeout, http request, click event wi 阅读全文
posted @ 2020-02-20 17:04 Zhentiw 阅读(122) 评论(0) 推荐(0) 编辑
摘要:In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue. For now, suppose you are a domin 阅读全文
posted @ 2020-02-20 05:15 Zhentiw 阅读(202) 评论(0) 推荐(0) 编辑
摘要:l逻辑三大定律之三: 排中律: 两个自相矛盾的观点,一定又一个是对的,没有“都不对”这种中间状态。在这种情况下,一个人可以不表态,但是如果表态,就不能说“两个我都不同意” 比如: 我认为降价不对,这会造成品牌价值受损。但是不降价也不对,毕竟眼前的销售压力很大。。。 什么是自相矛盾的观点? 就是“降价 阅读全文
posted @ 2020-02-19 23:48 Zhentiw 阅读(1925) 评论(0) 推荐(0) 编辑
摘要:逻辑三大定律之二,矛盾律 两个相互否定的思想,不可能都对 比如 今年过节不收礼,收礼只收XXX。 就是通过制造矛盾,抓住大家的注意力。 理解什么是“否定” 比如 成功的否定,是什么? 是失败马?不是 是“未成功”。 未成功的结果不一定就是失败,还可能是成功。未成功的外延大于失败。 培养识别三种“自相 阅读全文
posted @ 2020-02-19 23:06 Zhentiw 阅读(1386) 评论(0) 推荐(0) 编辑
摘要:For example, we have the source code: getVersison('3.4.5') function getVersion(versionString) { const versionRegex = /(\d)\.(\d)\.(\d+)/ const [, majo 阅读全文
posted @ 2020-02-19 20:27 Zhentiw 阅读(167) 评论(0) 推荐(0) 编辑
摘要:The smart component we want to test: import {Component, OnInit} from '@angular/core'; import {Course} from "../model/course"; import {Observable} from 阅读全文
posted @ 2020-02-19 17:17 Zhentiw 阅读(966) 评论(0) 推荐(0) 编辑
摘要:Primitive Values Undefined (undefined), used for unintentionally missing values. Null (null), used for intentionally missing values. Booleans (true an 阅读全文
posted @ 2020-02-18 17:24 Zhentiw 阅读(218) 评论(0) 推荐(0) 编辑
摘要:Training an algorithm involes four ingredients: Data Model Objective function: We put data input a Model and get output out of it. The value we call i 阅读全文
posted @ 2020-02-18 02:55 Zhentiw 阅读(120) 评论(0) 推荐(0) 编辑
摘要:“人已经存在几百万年了,而你没有存在几百万年,所以你不是人” -- 偷换了“人”的概念 “人已经存在几百万年了” 指的是权人类; “所以你不是人” 🈯️得是生命个体存在的“人体”,虽然两次提及了“人”,却指代的不是同一个概念。 什么是概念? 概念由两部分组成:内涵和外延 比如: “产品”的内涵: 阅读全文
posted @ 2020-02-18 01:17 Zhentiw 阅读(1041) 评论(0) 推荐(0) 编辑
摘要:Code: const disallowedMethods = ['log', 'info', 'warn', 'error', 'dir'] module.exports = { meta: { docs: { description: 'Disallow use of console', cat 阅读全文
posted @ 2020-02-17 19:50 Zhentiw 阅读(225) 评论(0) 推荐(0) 编辑
摘要:For eslint prevent console plugin, we also want to prevent user do so: var csl = console csl.log() Code: const disallowedMethods = ['log', 'info', 'wa 阅读全文
posted @ 2020-02-17 19:05 Zhentiw 阅读(148) 评论(0) 推荐(0) 编辑
摘要:Html: <input type="range" value="0" [style.--thumb-rotate]="720 * $any(input.value)/100 + 'deg'" #input (input)="0"> CSS: input[type="range"]::-webkit 阅读全文
posted @ 2020-02-17 17:30 Zhentiw 阅读(259) 评论(0) 推荐(0) 编辑
摘要:The $any() type cast function Sometimes a binding expression triggers a type error during AOT compilation and it is not possible or difficult to fully 阅读全文
posted @ 2020-02-17 17:28 Zhentiw 阅读(196) 评论(0) 推荐(0) 编辑
摘要:@Injectable({ providedIn: "root" | "any" | "platform" }) export class MyService {} More ProvidedIn: root Every service defined with 'root' will be pro 阅读全文
posted @ 2020-02-17 17:21 Zhentiw 阅读(404) 评论(0) 推荐(0) 编辑
摘要:In Angular version 8, TestBed.get was deprecated. In Angular version 9, we see why: TestBed.inject<T> is introduced as a type-safe replacement. There 阅读全文
posted @ 2020-02-17 16:48 Zhentiw 阅读(141) 评论(0) 推荐(0) 编辑
摘要:When we redirect to a different route from within our component's code using the Router.navigate or from within a component template via a [routerLink 阅读全文
posted @ 2020-02-16 23:15 Zhentiw 阅读(285) 评论(0) 推荐(0) 编辑
摘要:onSave(personName) { this.person.name = personName; this.peopleService.save(this.person).subscribe(() => { // redirect back people list // this.router 阅读全文
posted @ 2020-02-16 23:11 Zhentiw 阅读(92) 评论(0) 推荐(0) 编辑
摘要:In this post, let's see how to make all the optional fields to be required with the help of Required. type User = { name: string; age?: number; gender 阅读全文
posted @ 2020-02-16 22:53 Zhentiw 阅读(167) 评论(0) 推荐(0) 编辑
摘要:There might be cases where you would want to create a type while excluding some of the properties from a type. Let's say you have a database query on 阅读全文
posted @ 2020-02-16 22:51 Zhentiw 阅读(199) 评论(0) 推荐(0) 编辑
摘要:Sometimes we need to prevent some properties on a JavaScript object from being iterated over and accessed in "for ... in" loops. In this lesson, we wi 阅读全文
posted @ 2020-02-16 22:14 Zhentiw 阅读(102) 评论(0) 推荐(0) 编辑
摘要:When building a web app, sometimes we need to approach it top-down. Modern browser devtools allow us to set breakpoints not only on the JS code but al 阅读全文
posted @ 2020-02-16 22:10 Zhentiw 阅读(109) 评论(0) 推荐(0) 编辑
摘要:教养的本质就是对外的分寸感和对内的克制力 哪些行为会让你在职场上显得没有教养呢? 1. 失信 过分相信自己的能力,而夸下的海口,却没有能够完成。 2. 迟到 尊重别人的时间颗粒度,你迟到几分钟,可能觉得无所谓,但对他人来讲,并不是一回事,他的时间颗粒度可能比你小很多。 如果真的迟到了,一定要诚恳地道 阅读全文
posted @ 2020-02-16 21:55 Zhentiw 阅读(247) 评论(0) 推荐(0) 编辑
摘要:什么是事实,什么是观点? “天气热”是观点,“今天气温是30度”是事实 多少度算热,多少度算冷因人而异,不因你的喜好而转移。 观点只要符合以下两点,就没有对错之分: 不违反事实 逻辑自洽 切勿认为只有自己的观点才是无可辩驳的,与之相悖的都是错的 职业化的基础尊重,尊重的基础是理解,理解的基础是接受不 阅读全文
posted @ 2020-02-16 21:46 Zhentiw 阅读(1049) 评论(0) 推荐(0) 编辑
摘要:每人每天24小时,第一个8小时,大家都在睡觉,第二个八小时,大家都在工作,第三个八小时,你会做什么? 人与人的区别,其实主要是由第三个8小时造成的,这就是著名的“三八理论” 1. 找到“不被打扰的时间” 我们需要2-4小时,安静的时间用来学习,写作,阅读,思考。连续高效的两个小时,远远超过零碎的8个 阅读全文
posted @ 2020-02-16 03:38 Zhentiw 阅读(1269) 评论(0) 推荐(0) 编辑
摘要:This monkey-on-the-back analogy highlights a truism that is as obvious as it is subtle. Before a manager can develop initiative in his subordinates, h 阅读全文
posted @ 2020-02-15 22:21 Zhentiw 阅读(744) 评论(0) 推荐(0) 编辑
摘要:GTD method rests on the idea of moving planned tasks and projects out of the mind by recording them externally and then breaking them into actionable 阅读全文
posted @ 2020-02-15 21:49 Zhentiw 阅读(196) 评论(0) 推荐(0) 编辑
摘要:Setting up a Presentational Component: import {Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation} from '@angular/core'; import {Course 阅读全文
posted @ 2020-02-14 17:19 Zhentiw 阅读(510) 评论(0) 推荐(0) 编辑
摘要:Much of our code in real life is full of if statements that check the validity of a given input to see if a given computation should be performed. Usi 阅读全文
posted @ 2020-02-14 03:22 Zhentiw 阅读(118) 评论(0) 推荐(0) 编辑
摘要:How to test a service The service we want to test against: import {Injectable} from '@angular/core'; import {LoggerService} from './logger.service'; @ 阅读全文
posted @ 2020-02-12 16:50 Zhentiw 阅读(462) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] 阅读全文
posted @ 2020-02-12 02:39 Zhentiw 阅读(207) 评论(0) 推荐(0) 编辑
摘要:Invert a binary tree. Example: Input: 4 / \ 2 7 / \ / \ 1 3 6 9 Output: 4 / \ 7 2 / \ / \ 9 6 3 1 /** * Definition for a binary tree node. * function 阅读全文
posted @ 2020-02-10 20:46 Zhentiw 阅读(107) 评论(0) 推荐(0) 编辑
摘要:it ('should add two numbers', () => { const logger = jasmine.createSpyObj('LoggerService', ['log']) // logger.log.and.returnValue(); const calculator 阅读全文
posted @ 2020-02-10 02:52 Zhentiw 阅读(183) 评论(0) 推荐(0) 编辑
摘要:Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: [1,2,3,4,5,6,7] and k = 3 Output: [5,6,7,1,2,3,4] 阅读全文
posted @ 2020-02-07 04:24 Zhentiw 阅读(118) 评论(0) 推荐(0) 编辑
摘要:"scripts": { "ng": "ng", "start": "ng serve --proxy-config ./proxy.json", "server": "ts-node -P ./server/server.tsconfig.json ./server/server.ts", "bu 阅读全文
posted @ 2020-02-07 04:00 Zhentiw 阅读(133) 评论(0) 推荐(0) 编辑
摘要:// include all the scss @import "~@angular/material/theming"; // Include non-theme styles for core. @include mat-core(); $mat-custom-primary-theme: ( 阅读全文
posted @ 2020-02-05 04:17 Zhentiw 阅读(197) 评论(0) 推荐(0) 编辑
摘要:For example we have a rest endpoint, we need to validate the data we receive in correct format: import { IsMongoId, IsString, IsBoolean, IsInt } from 阅读全文
posted @ 2020-02-04 14:57 Zhentiw 阅读(1313) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示