flux

基本电路概念(二)什么是电容?

邮差的信 提交于 2021-02-13 22:52:35
一、前言 我儿子对电路板有一种近乎疯狂的痴迷,每次周末加班的时候,他总是恳求我带他一起到公司,就是为了能够看一看电路板、看一看电路焊接过程。为了不影响工作,我只能是找一些废旧的电路板,加上从蜗窝同学那里搜刮来的电烙铁给小朋友进行电路焊接演示。废旧电路板上有不少的器件,于是问题少年的问题就来了,芯片里面有什么?电路板是几层的?电容的内部结构是什么?……于是乎钳子、起子、剪刀等工具不断的登场,我们家里就是一片狼籍,各种电子元件支离破碎…… 其实打开一个普通的电解电容,里面的结构很简单,两个铝箔,一个绝缘纸卷在一起放到一个圆柱形的容器中,两个铝箔引出电容器的两个引脚。那么它的具体功能是什么呢?当然,给小朋友解释很简单:就是用来存储小电子的,不过作为工程师,我们当然不能那么肤浅,本文的主题就一个:详细描述电容的概念。 作为一个“数学控”,不拽上点数学总是觉得少了点什么。section 2描述了理解后续内容需要的数学基础,理解这个章节的内容需要单变量微积分和基本向量的知识。如果阅读者觉得痛苦,那么不要犹豫,直接跳过这个章节。section 3描述了一些物理学的基础,如果这也不是你的菜,那么我建议你记住计算平板电容之间电场的公式即可,其他的可以无视。section 4主要描述电容的概念,这是本文的核心内容。 二、数学基础 1、曲面积分(Surface Integral) 在 什么是电压

React: onChange is not a function

时光毁灭记忆、已成空白 提交于 2021-02-11 15:53:32
问题 Am new to react and am trying to run unit test for a react app using jest, The app using the Flux pattern and I have already wrote one component "WEATHER" and before move on to another one I wanted to write test for that component and take TDD approach. My code running fine but the test fail with this error TypeError: tree.props.onChange is not a function The weather component code : // @flow import React from 'react'; import api from '../api'; import weatherStore from '../stores/weatherStore

React: onChange is not a function

被刻印的时光 ゝ 提交于 2021-02-11 15:51:59
问题 Am new to react and am trying to run unit test for a react app using jest, The app using the Flux pattern and I have already wrote one component "WEATHER" and before move on to another one I wanted to write test for that component and take TDD approach. My code running fine but the test fail with this error TypeError: tree.props.onChange is not a function The weather component code : // @flow import React from 'react'; import api from '../api'; import weatherStore from '../stores/weatherStore

《深入浅出React和Redux》(2)

倾然丶 夕夏残阳落幕 提交于 2021-02-08 22:17:11
Redux是Flux理念的一种实现。 关于Flux理念可以通过类比MVC模式来做简单理解。 MVC模式中,用户请求先到达Controller,由Controller调用Model获得数据,然后把数据交给View,按照这种模式,MVC应该也是一个controller->model->view的单向数据流,但是,在实际应用中,由于种种原因,往往会让view直接操作Model,随着应用的演进、逻辑变得越来约复杂,view与model之间的关系就会变得错综复杂、难以维护。 在MVC中让View和Model直接对话就是灾难 。 Flux理念可以简单看作是对MVC添加了更加严格的数据流限制。 Flux框架随React一同被Fackbook推出,但在Dan Abramov创建了Redux后,Redux已经替代了Flux。 基本原则 Flux的基本原则是“单向数据流”, Redux在此基础上强调三个基本原则: 唯一数据源(Single Source of Truth),应用的状态数据应该只存储在唯一的一个Store上,它是树形结构,每个组件往往只是用树形对象上一部分的数据,而如何设计Store上状态的结构,就是Redux应用的核心问题。 保持状态只读(State is read-only),不能直接修改store状态,必须要通过派发action对象的方式来进行。 数据改变只能通过纯函数完成

Spring Reactor Merge vs Concat

本小妞迷上赌 提交于 2021-02-04 18:39:05
问题 I´m playing with Spring reactor, and I cannot see any differences between concat and merge operator Here's my example @Test public void merge() { Flux<String> flux1 = Flux.just("hello").doOnNext(value -> { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } }); Flux<String> flux2 = Flux.just("reactive").doOnNext(value -> { try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } }); Flux<String> flux3 = Flux.just("world"); Flux.merge

Spring Reactor Merge vs Concat

☆樱花仙子☆ 提交于 2021-02-04 18:38:50
问题 I´m playing with Spring reactor, and I cannot see any differences between concat and merge operator Here's my example @Test public void merge() { Flux<String> flux1 = Flux.just("hello").doOnNext(value -> { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } }); Flux<String> flux2 = Flux.just("reactive").doOnNext(value -> { try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } }); Flux<String> flux3 = Flux.just("world"); Flux.merge

spring boot gateway自定义限流

无人久伴 提交于 2021-01-30 08:34:35
参考: https://blog.csdn.net/ErickPang/article/details/84680132 采用自带默认网关请参照 微服务架构spring cloud - gateway网关限流 ,参数与其唯一的区别是header中多了参数userLevel,值为A或者B 此处实现按传入参数取到不同配置 userLvl.A.replenishRate: 10 userLvl.A.burstCapacity: 100 userLvl.B.replenishRate: 20 userLvl .B.burstCapacity: 1000 自定义限流器 package com.gatewayaop.filter; import com.iot.crm.gatewayaop.common.config.UserLevelRateLimiterConf; import org.springframework.beans.BeansException; import org.springframework.cloud.gateway.filter.ratelimit.AbstractRateLimiter; import org.springframework.cloud.gateway.filter.ratelimit.RateLimiter; import org

Multiple operation on single column in Flux

♀尐吖头ヾ 提交于 2021-01-29 20:27:54
问题 Trying to recreate some of the basics in Flux compared to InfluxQL is quite a stretch at present. I can’t work out how to ask for multiple projections. select max(temp) - min(temp) from my_measurement I’m not sure how to go about this in Flux. Thanks 回答1: Option 1 - built in function The simplest way is probably to use the built-in spread function: The spread() function outputs the difference between the minimum and maximum values in a specified column. from(bucket: "example-bucket") |> range

Kubernetes secret with Flux and Terraform

拥有回忆 提交于 2021-01-29 12:38:14
问题 I am new to terraform and devops in general. First I need to get ssh key from url to known host to later use for Flux. data "helm_repository" "fluxcd" { name = "fluxcd" url = "https://charts.fluxcd.io" } resource "helm_release" "flux" { name = "flux" namespace = "flux" repository = data.helm_repository.fluxcd.metadata[0].name chart = "flux" set { name = "git.url" value = "git.project" } set { name = "git.secretName" value = "flux-git-deploy" } set { name = "syncGarbageCollection.enabled"

React native bidirectional data flow?

泄露秘密 提交于 2021-01-29 05:10:05
问题 I worked with ReactJS and flux. They are to used to build web based applications. And flux is used to enhance the way to data flow providing bidirectional data flow. I start learning react native and wants to know ─ Can I use flux into react-native ? OR ─ Is there any other libraries or framework available to use in react native. I came across Redux. Is that only option in react native ? Please help me to clarify what to use in react native. 回答1: Yes, you can use Flux in your react native app