树莓派通过模数转换芯片ADC0832读取LM35温度传感器数据 今天和小朋友一起玩树莓派,打算来做一个测量室温的小实验。经过几个小时的研究和测试,终于能够成功读取LM35传感器的温度数据了。本文主要记录一些这个实验的过程。 使用的材料 Raspberry PI 3B 这个就不用多介绍了,超级流行的一 ...
分类:
其他好文 时间:
2020-01-31 14:22:55
阅读次数:
222
【From】https://spring.io/guides/gs/reactive-rest-service/ Building a Reactive RESTful Web Service —— 用 Spring WebFlux 构建reactive restful web服务 本文转自以上Pi ...
分类:
编程语言 时间:
2020-01-29 14:31:03
阅读次数:
74
欧拉函数 一.简介 我们定义一种函数φ(x),它的值为比x小的数里与x互质的数的个数。 其计算公式是 (其中p1, p2……pn为x的所有质因数,x是不为0的整数)。 定义φ(1) = 1。 这个公式可以这样理解,对于整数x的任何一个素因子pi,在1-n中,它的倍数的个数为x/pi,剩下的数就是x* ...
分类:
其他好文 时间:
2020-01-28 22:56:38
阅读次数:
100
#include<iostream> #include<algorithm> #include<cstring> #include<vector> using namespace std; const int INF=0x3f3f3f3f; struct node{ int l,s,h; }; ve ...
分类:
其他好文 时间:
2020-01-28 15:50:15
阅读次数:
83
C++ 11提供的智能指针有:shared_ptr、unique_ptr、weak_ptr。在 头文件 memory 中。 一、new delete 直接管理内存 1、初始化 string * ps = new string // 初始换为一个空string int * pi = new int ; ...
分类:
编程语言 时间:
2020-01-28 10:49:44
阅读次数:
99
https://vjudge.net/contest/353156#problem/A 一开始想着按背包做 = = 我的dp还是太菜了 应该按照单调序列做 1 #include <iostream> 2 #include <algorithm> 3 #include <vector> 4 using ...
分类:
其他好文 时间:
2020-01-27 13:48:24
阅读次数:
59
1.#define 命令是c语言中的一个宏定义命令 该命令有两种格式:一种是简单的宏定义,另一种是带参数的宏定义; (1)简单的宏定义: #define <宏名><字符串> #define PI 3.1415926 (2)带参数的宏定义: #define <宏名>(<参数表>)<宏体> #defin ...
分类:
其他好文 时间:
2020-01-26 20:54:01
阅读次数:
88
前奏:统计 n! 中的所有质因子中pi的个数 普通方法:复杂度O(nlogn), 当n为10的18次方无法承受 // 复杂度O(nlogn), n为10的18次方无法承受 int cal(int n, int p){ int ans = 0; for (int i = 2; i <= n; i++) ...
分类:
其他好文 时间:
2020-01-26 13:01:28
阅读次数:
59
一、保留有效数字的问题 1 #include<iostream> 2 #include<iomanip> 3 #include "stdlib.h" 4 using namespace std; 5 int main(){ 6 double PI=3.1415926; 7 cout<<setprec ...
分类:
其他好文 时间:
2020-01-26 13:01:13
阅读次数:
90
Exercises 3.2 21. (a). For $\omega = sinz$, what is the image of the semi-infinite strip $S_1 = \{x+iy|-\pi<x<\pi,y>0\}$ (b). what is the image of the ...