笔记
zhirongwang94
这个作者很懒,什么都没留下…
展开
-
网站应用开发Web App Development:如何让前端与后端快速地跑起来
工作的第一个project。 先从GitHub上面将repository clone下来,然后按照指示, 将网页跑起来。指示说的是cd Company/project/client/srcnpm installnpm start然而网页并没有按期望的形式跑起来,而是只让前端跑起来,后端并没有相应。 当我按前端按钮是,console还会显示一下错误:Proxy error: Could not proxy request /favicon.ico from localhost:3000 to ht原创 2021-09-07 14:42:16 · 627 阅读 · 0 评论 -
React: How to generate and render components
首先,用React的 CLI 来generate 一个component, 指令如下:npx generate-react-cli component ComponentName所需要的文件会自动生成, 可以选择是否用typescript, 我选了yes, 但是并不能import component 文件, 因此我将.tsx直接改成.js后缀。 然后就可以在 index.js 里面import 和render component了。import React from 'react';import原创 2021-09-04 06:39:50 · 150 阅读 · 0 评论 -
React 里面的 App.js vs index.js
App.jsimport './App.css';function App() { return ( <p> Hello world </p> );}export default App;index.jsimport React from 'react';import ReactDOM from 'react-dom';import './index.css';import App from './App';import r原创 2021-09-04 06:02:56 · 3159 阅读 · 0 评论 -
Docker container 有什么优点?
Docker container 有什么优点?方便方便:工业生产中,每个产品的开发,都需要特别的开发环境,其中包括有相应的sdk,数据库等。infrastructure engineer 会配置好其他engineer所需的开发环境,生成一个image。其他工程师可以直接复制不需要自己配置环境,只需要将配置好的image复制过来,在docker container上run,则能生存开发所需环境。light weight传统的virtual machine也能生成虚拟系统,譬如能安装Ubuntu,L原创 2021-08-15 01:38:02 · 170 阅读 · 0 评论 -
340. Longest Substring with At Most K Distinct Characters解题报告
Given a string s and an integer k, return the length of the longest substring of s that contains at most k distinct characters.Example 1:Input: s = "eceba", k = 2Output: 3Explanation: The substring is "ece" with length 3.Example 2:Input: s = "aa", k原创 2021-08-05 06:32:02 · 149 阅读 · 0 评论 -
311. Sparse Matrix Multiplication解题报告
Given two sparse matrices mat1 of size m x k and mat2 of size k x n, return the result of mat1 x mat2. You may assume that multiplication is always possible.Example 1:Input: mat1 = [[1,0,0],[-1,0,3]], mat2 = [[7,0,0],[0,0,0],[0,0,1]]Output: [[7,0,0],[-7原创 2021-08-05 05:51:43 · 259 阅读 · 0 评论 -
695. Max Area of Island解题报告
You are given an m x n binary matrix grid. An island is a group of 1’s (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.The area of an island is the number of cells w原创 2021-08-05 05:10:47 · 125 阅读 · 0 评论 -
781. Rabbits in Forest 解题报告
There is a forest with an unknown number of rabbits. We asked n rabbits “How many rabbits have the same color as you?” and collected the answers in an integer array answers where answers[i] is the answer of the ith rabbit.Given the array answers, return t原创 2021-08-05 04:39:06 · 154 阅读 · 0 评论 -
Virtaural DOM vs. DOM 面试准备
首先,virtual dom是react里面的一个概念,跟其他东西不相关。React引入virtual dom是为了提高update&render dom 的效率。传统的dom update 方法要update整个dom, 然后render整个。很费时。update virtual dom不需要render。很快。所以react在update真dom之前会先update virtual dom对比有什么component需要update的。然后直接update dom上需要update的compon原创 2021-08-03 14:54:45 · 47 阅读 · 0 评论