07 2020 档案

摘要:const displayMachine = createMachine({ initial: "hidden", states: { hidden: { on: { TURN_ON: "visible.hist", }, }, visible: { initial: "light", states 阅读全文
posted @ 2020-07-31 16:22 Zhentiw 阅读(165) 评论(0) 推荐(0) 编辑
摘要:When dragging, we want to have two modes, one in 'normal' mode, another one is 'locked', we enter the locked mode by holde on 'shift' key. To achieve 阅读全文
posted @ 2020-07-31 16:14 Zhentiw 阅读(187) 评论(0) 推荐(0) 编辑
摘要:When working with databases, it seems inevitable that you will find yourself needing to export data from a table to send along to another team, compan 阅读全文
posted @ 2020-07-30 15:12 Zhentiw 阅读(202) 评论(0) 推荐(0) 编辑
摘要:import { createMachine, assign, interpret } from "xstate"; const elBox = document.querySelector("#box"); const elBody = document.body; const assignPoi 阅读全文
posted @ 2020-07-29 20:02 Zhentiw 阅读(203) 评论(0) 推荐(0) 编辑
摘要:It uses " " as key, by default, this is the inital state, it often uses with 'cond' import { createMachine, assign, interpret } from "xstate"; const e 阅读全文
posted @ 2020-07-29 19:51 Zhentiw 阅读(187) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we'll learn how to use CSS Clip Path to add a notch clip-path: polygon( 0% 10%, 10% 0%, /*topleft*/ 92% 0, 100% 8%, /*top right*/ 100% 阅读全文
posted @ 2020-07-29 15:21 Zhentiw 阅读(97) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we cover how to replace the default text-decoration for links with an animated underline. We use multiple background images with a fix 阅读全文
posted @ 2020-07-29 14:53 Zhentiw 阅读(245) 评论(0) 推荐(0) 编辑
摘要:routes/index.js: used for defined all the endpoints: import express from "express"; import * as notes from "./notes.js"; const router = express.Router 阅读全文
posted @ 2020-07-28 16:02 Zhentiw 阅读(206) 评论(0) 推荐(0) 编辑
摘要:In this lesson we'll build a basic web server in 2 minutes using Express 5 and node 14's native ES module support. We'll start by creating a new proje 阅读全文
posted @ 2020-07-27 21:08 Zhentiw 阅读(121) 评论(0) 推荐(0) 编辑
摘要:Renaming every file in a directory with zsh is a common scenario when you're working with a series of related files. Using zsh's "for" loop, you can a 阅读全文
posted @ 2020-07-27 20:03 Zhentiw 阅读(110) 评论(0) 推荐(0) 编辑
摘要:JavaScript numbers and CSS hexadecimal numbers don't play very well together. You can solve this with a conversion function that takes the number, con 阅读全文
posted @ 2020-07-27 16:09 Zhentiw 阅读(80) 评论(0) 推荐(0) 编辑
摘要:When express App run syncronous code: app.get("/test", (req, res) => { throw new Error("Oh no! The world has ended!"); }); Those code works fine. But 阅读全文
posted @ 2020-07-27 16:05 Zhentiw 阅读(168) 评论(0) 推荐(0) 编辑
摘要:If we have just one feature, the error is big, preformance is not good; but if we have too many features selected then it might be overfitting. So we 阅读全文
posted @ 2020-07-23 22:05 Zhentiw 阅读(152) 评论(0) 推荐(0) 编辑
摘要:Just like the title h1 { font-size: 5vw; } Make font responsive to view width 阅读全文
posted @ 2020-07-23 19:06 Zhentiw 阅读(105) 评论(0) 推荐(0) 编辑
摘要:Garuded Transitions, it prevents the state goes from current sate to its target state is condition is falsy. const machine = createMachine( { initial: 阅读全文
posted @ 2020-07-22 20:50 Zhentiw 阅读(141) 评论(0) 推荐(0) 编辑
摘要:import { createMachine, assign, interpret } from "xstate"; const elBox = document.querySelector("#box"); const elBody = document.body; const assignPoi 阅读全文
posted @ 2020-07-21 18:46 Zhentiw 阅读(182) 评论(0) 推荐(0) 编辑
摘要:Right now, we're getting the ID route parameter off the of the parent route. This is because we want the info and items components to use the ID of th 阅读全文
posted @ 2020-07-21 15:43 Zhentiw 阅读(204) 评论(0) 推荐(0) 编辑
摘要:Using the https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API(Web Speech API) it is possible to use speech synthesis in the browser withou 阅读全文
posted @ 2020-07-21 15:35 Zhentiw 阅读(159) 评论(0) 推荐(0) 编辑
摘要:We have a message app: function App() { const messageDisplayRef = React.useRef() .... const scrollToTop = () => messageDisplayRef.current.scrollToTop( 阅读全文
posted @ 2020-07-21 15:26 Zhentiw 阅读(327) 评论(0) 推荐(0) 编辑
摘要:Let's we want to keep tracking how many times on element was click inside Machine model. We can use 'context' & 'assign' function. import { assign, cr 阅读全文
posted @ 2020-07-20 22:36 Zhentiw 阅读(186) 评论(0) 推荐(0) 编辑
摘要:Let's say we have a State Machine Model: import { createMachine, interpret } from "xstate"; const elBox = document.querySelector("#box"); const setPoi 阅读全文
posted @ 2020-07-20 22:25 Zhentiw 阅读(167) 评论(0) 推荐(0) 编辑
摘要:The k-means algorithm captures the insight that each point in a cluster should be near to the center of that cluster. It works like this: first we cho 阅读全文
posted @ 2020-07-17 20:52 Zhentiw 阅读(249) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/python import random import numpy import matplotlib.pyplot as plt import pickle from outlier_cleaner import outlierCleaner from sklearn.lin 阅读全文
posted @ 2020-07-16 23:25 Zhentiw 阅读(293) 评论(0) 推荐(0) 编辑
摘要:import { createMachine, interpret } from "xstate"; const elBox = document.querySelector("#box"); const machine = { initial: "inactive", states: { inac 阅读全文
posted @ 2020-07-16 18:48 Zhentiw 阅读(165) 评论(0) 推荐(0) 编辑
摘要:State + Event + Interpreter: const machine = { initial: "idle", states: { idle: { on: { FETCH: "pending", }, }, pending: { on: { RESOLVE: "resolved", 阅读全文
posted @ 2020-07-15 03:17 Zhentiw 阅读(172) 评论(0) 推荐(0) 编辑
摘要:Let's say we have a command line application: const { Task } = require("../../libs/types"); const { save, all } = require("../../libs/db"); const { la 阅读全文
posted @ 2020-07-07 19:35 Zhentiw 阅读(219) 评论(0) 推荐(0) 编辑
摘要:An ancient problem of centering items with CSS is finally (!) solved! In this quick lesson we're going to learn how to use place-items CSS property in 阅读全文
posted @ 2020-07-06 14:31 Zhentiw 阅读(106) 评论(0) 推荐(0) 编辑
摘要:Decision trees can handle none linear speratable dataset, in the picture, there is none separable dataset When we use dscision tree, we ask multi line 阅读全文
posted @ 2020-07-03 21:57 Zhentiw 阅读(190) 评论(0) 推荐(0) 编辑
摘要:Take the native HTML checkboxes and jazz them up while still ensuring they are keyboard accessible. We use pseudo-elements and pseudo-classes to repli 阅读全文
posted @ 2020-07-03 15:38 Zhentiw 阅读(146) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we dive into using CSS border-radius. We will look at how you can use it to create not only basic shapes but complex ones too. We will 阅读全文
posted @ 2020-07-03 15:27 Zhentiw 阅读(124) 评论(0) 推荐(0) 编辑
摘要:Building larger serverless applications can be tricky - creating many lambda functions as well as other resources such as DynamoDB tables, S3 buckets, 阅读全文
posted @ 2020-07-01 20:09 Zhentiw 阅读(344) 评论(0) 推荐(0) 编辑
摘要:Path: Compose Functors -> Monad Transformers -> Free Monad Free monads, it provides a way to modelling functions as Data type. So composing / chaining 阅读全文
posted @ 2020-07-01 14:54 Zhentiw 阅读(170) 评论(0) 推荐(0) 编辑

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