L298N
接口
- OUT A,接马达 A
- OUT B ,接马达 B
- POWER,+5V、GND、+12V
- 5V 电源,接 +5V + GND
- 12V 电源,接 +12V + GND
- 控制端口,ENA、INA1、INA2、INB1、INB2、ENB
- 接 GPIO
- ENA、INA1、INA2 控制马达 A
- ENB、INB1、INB2 控制马达 B
参数 | 默认值 | 说明 |
---|---|---|
-XX:MaxDirectMemorySize | 64M | 非堆内存大小 |
G1GC是区域化、分代式垃圾回收器。堆内存被划分为大小相同的若干区域(Region),区域大小取值为[1,32]
之间2的幂,若不配置Region大小,JVM以数量不超过2048个区域为目标,确定Region大小。这些Region逻辑上组合成传统的Eden、Survivor、Tenured。
G1GC在两个阶段之间交替,young-only和space-reclamation。young-only 阶段包括垃圾回收,其逐渐将
Young-only 阶段
该阶段开始是一些普通年轻代回收(Normal yount collection),其将对象晋升至老年代。Young-only向Space-reclamatioin阶段过渡始自老年代使用率达到设定阈值。此时,G1执行**并行开始年轻代回收(Concurrent Start young collection)**替代普通年轻代回收。过渡周期包含以下阶段。
Space-reclamation 阶段
该阶段包含多个混合回收,除了年轻代区域外,还会压缩(evacuate)老年代区域集合中的存活对象。当G1确定压缩更多老年代区域不会产生足够值得努力的空间时,space-reclamation阶段结束。
确定初始堆占用率
初始堆占用率(Initiating Heap Occupancy Percent,IHOP)是触发初始标记回收的阈值,定义为老年代大小的百分比。
默认情况下,G1通过观察标记耗时及标记周期内老年代分配内存,自动决定最佳的IHOP。该特性称为Adaptive IHOP,当该特性激活时,参数-XX:InitiatingHeapOccupancyPercent
指定的值作为,G1在还没有足够观察值确定该值时的初始值。通过参数-XX:-G1UseAdaptiveIHOP
可关闭该特性,此时 -XX:InitiatingHeapOccupancyPercent
参数指定的值总是决定该阈值。
标记
G1标记使用初始快照算法(Snapshot-At-The-Beginning,SATB)。在初始标记暂停时(Initial Mark pause),为堆创建虚拟快照,
参数 | 默认值 | 说明 |
---|---|---|
-XX:+UseG1GC | - | 使用G1回收器 |
-XX:MaxGCPauseMillis | 200 | 最大GC停顿时间,单位毫秒 |
-XX:InitiatingHeapOccupancyPercent | 45 | 触发标记周期的堆占用率阈值 |
-XX:NewRatio | 2 | 新生代与老年代大小比例 |
-XX:SurvivorRatio | 8 | eden与suvivor区大小比例 |
-XX:MaxTenuringThreshold | 15 | 提升年老代的最大临界值 |
-XX:ParallelGCThreads | - | STW工作线程数 |
-XX:ConcGCThreads | - | 并行标记线程数 |
-XX:G1ReservePercent | 10 | 空闲空间的预留内存百分比 |
-XX:G1HeapWastePercent | 10 | 触发混合垃圾回收的可回收堆内存阈值 |
-XX:G1HeapRegionSize | - | region分片size,1M~32M,2的幂 |
-XX:G1MixedGCCountTarget | 8 | |
-XX:G1OldCSetRegionThresholdPercent | 10 | |
-XX:-G1UseAdaptiveIHOP | - | 关闭自动设置IHOP特性 |
实验参数
使用实验参数,需要添加解锁实验参数标记。
参数 | 默认值 | 说明 |
---|---|---|
-XX:+UnlockExperimentalVMOptions | - | 解锁实验参数 |
-XX:G1NewSizePercent | 5 | 年轻代最小百分比 |
-XX:G1MaxNewSizePercent=60 | 60 | 年轻代最大百分比 |
-XX:G1MixedGCLiveThresholdPercent | 65 | 混合垃圾回收周期中要包括的老年代region使用率阈值 |
日志
参数 | 说明 |
---|---|
-verbose:gc | - |
-XX:+PrintGCDetails | - |
-XX:+PrintGCDateStamps | - |
-XX:+PrintGCApplicationStoppedTime | 打印应用停留时间 |
-XX:+PrintTenuringDistribution | 老年代分布 |
-Xloggc:/path/to/gc.log | - |
-XX:+UseGCLogFileRotation | - |
-XX:NumberOfGCLogFiles=10 | - |
-XX:GCLogFileSize=128M | - |
-XX:InitiatingHeapOccupancyPercent
-XX:G1MixedGCLiveThresholdPercent
-XX:G1HeapWastePercent
-XX:G1MixedGCCountTarget
-XX:G1OldCSetRegionThresholdPercent
1 | // c |
1 | void *memset( void *dest, int ch, size_t count ); |
1 | char str[] = "hello world"; |
1 | #include <algorithm> |
1 | template< class ForwardIt, class T > |
1 | sizeof(type/object) |
1 | // 定义结构 |
1 | .idea/ |
1 | Byte-compiled / optimized / DLL files |
生成公钥
1 | ssh-keygen -t ed25519 -C "<your email>" |
配置全局信息
1 | git config --global user.name "sunzhenkai" |
适用
1 | 生成公钥 |
1 | git restore --staged . # 恢复所有暂存 |
用于暂存代码。
1 | 暂存 |
1 | 添加子模块 |
1 | rm -rf path/to/submodule |
1 | cd /path/to/submodule/dirctory |
1 | git submodule update --init submoduleName |
1 | git tag -s "tag_name" -m "comments" |
1 | git filter-branch -f --prune-empty --index-filter "git rm -rf --cached --ignore-unmatch recommend/keywords.txt" --tag-name-filter cat -- --all |
1 | 设置用户名、邮箱 |
参考这里。
1 | git blame <file> -L <start-line>,<end-line> |
1 | 删除分支 |
1 | 检出 /path/pattern 下文件在 tree-ish 下的状态 |
检出并保存在其他路径
1 | git archive f9ee8bb31f04f4e6a8c0d3e96fbb98deeb448d45 | tar -x -C /tmp/f9ee8bb31f04f4e6a8c0d3e96fbb98deeb448d45 |
从 remote 检出
1 | git archive --remote=https://github.com/user/repo.git <tree-ish> | tar -x -C /path/to/target-dir |
1 | 打印配置 |
1 | 默认仓库级别 |
1 | git config user.name '...' |
1 | 设置 |
1 | feature/JIRA-1929-support-oneid |
1 | git config --global core.quotepath false # 显示 status 编码 |
错误信息
1 | /opt/rh/rh-git218/root/usr/libexec/git-core/git-remote-http: error while loading shared libraries: libcurl-httpd24.so.4: cannot open shared object file: No such file or directory |
解决
1 | find / -name 'libcurl-httpd24.so.4' |
错误信息
1 | ! [remote rejected] master -> master (shallow update not allowed) |
解决
1 | git filter-branch -- --all |
错误信息
1 | case 1 |
原因
在仓库为空时,执行了 git submodule add
解决
1 | rm -r .git/modules/{dest-dir} |
/etc/gitlab/gitlab.rb
external_url 'http://git.sample.com:port'
/etc/gitlab/gitlab.rb
,注意:host 和 port 要分开修改
gitlab_rails['gitlab_ssh_host'] = 'git.sample.com'
gitlab_rails['gitlab_shell_ssh_port'] = 2222
1 | create volumn |
注解 | 对象 | 说明 |
---|---|---|
@Controller | 类 | DispatcherServlet会自动扫描注解了此注解的类 |
@Service | 类 | - |
@Reponsitory | 类 | - |
@Component | 类 | - |
@Autowired | 方法、字段 | 依赖注入 |
@Configuration | 类 | 声明类为配置类 |
@ComponentScan | 类 | 自动扫描指定包内特定注解并注册Bean,默认扫描@Service、@Component、@Controller、@Repository注解,可自定义规则 |
@Bean | 方法、注解 | 声明返回值为Bean,可定义init、destroy方法,在Bean创建、销毁时调用 |
@Aspect | 类 | 声明切面 |
@After | 方法 | 后置建言,原方法前执行 |
@Before | 方法 | 前置建言,原方法前执行 |
@Around | 方法 | 环绕建言,在原方法执行前执行,在原方法执行后再执行 |
@PointCut | - | 声明切点,即定义拦截规则,确定有哪些方法会被切入 |
@Transactional | 声明事务 | |
@Cacheable | 声明数据缓存 | |
@Value | 值注入,常与Sping EL表达式语言一起使用,注入普通字符,系统属性,表达式运算结果,其他Bean的属性,文件内容,网址请求内容,配置文件属性值等等 | |
@PropertySource | 指定文件地址,提供了一种方便的、声明性的机制,向Spring的环境添加PropertySource。与@Configuration一起使用 | |
@PostConstruct | 方法 | 构造函数执行完成之后执行该方法 |
@PreDestroy | 方法 | 对象销毁之前执行该方法 |
@Profile | 根据配置条件注册/激活 | |
@EnableAsync | 配置类 | 开启异步任务支持 |
@Async | 类、方法 | 注解在方法上标示这是一个异步方法,在类上标示这个类所有的方法都是异步方法 |
@EnableScheduling | 类 | 开启对计划任务的支持 |
@Scheduled | 方法 | 声明该方法是计划任务,支持多种类型的计划任务:cron、fixDelay、fixRate |
@Conditional | 类 | 条件声明 |
@RunWith | 类 | junit注解 |
@ContextConfiguration | 类 | 用来加载配置ApplicationContext,其中classes属性用来加载配置类:@ContextConfiguration(classes = {TestConfig.class(自定义的一个配置类)}) |
@ActiveProfiles | 类 | 用来声明活动的profile |
@EnableWebMvc | 配置类 | 开启SpringMvc的Mvc的一些默认配置:如ViewResolver,MessageConverter等。同时在自己定制SpringMvc的相关配置时需要做到两点:1.配置类继承WebMvcConfigurerAdapter类,2.必须使用这个@EnableWebMvc注解 |
@RequestMapping | 类、方法 | 映射web请求(访问路径和参数 |
@ResponseBody | 方法、类 | 将返回值放在response体内 |
@RequestBody | 参数 | request的参数在request body内,此注解放置在参数前 |
@PathVariable | 参数 | 接受路径参数 |
@RestController | 类 | 组合了@Controller和@ResponseBody,当我们只开发一个和页面交互数据的控制层的时候可以使用此注解 |
@ControllerAdvice | 类 | 声明一个控制器建言,它也组合了@Component注解,会自动注册为Spring的Bean |
@ExceptionHandler | 方法 | 异常处理 |
@ModelAttribute | 参数、方法 | 将键值对添加到全局,所有注解了@RequestMapping的方法可获得此键值对 |
@WebAppConfiguration | 类 | 一般用在测试上,注解在类上,用来声明加载的ApplicationContext是一个WebApplicationContext。他的属性指定的是Web资源的位置,默认为src/main/webapp,我们可以修改为:@WebAppConfiguration(“src/main/resources”) |
@EnableAutoConfiguration | 类 | 此注释自动载入应用程序所需的所有Bean,该注解组合了@Import注解,@Import注解导入了EnableAutoCofigurationImportSelector类,它使用SpringFactoriesLoader.loaderFactoryNames方法来扫描具有META-INF/spring.factories文件的jar包。而spring.factories里声明了有哪些Bean自动配置 |
@ImportResource | 类 | 用来加载额外配置(xml等定义) |
@ConfigurationProperties | 类 | 将properties属性与一个Bean及其属性相关联,从而实现类型安全的配置 |
@ConditionalOnBean | 类 | 条件注解,当容器里有指定Bean的条件下 |
@ConditionalOnClass | 类 | 条件注解,当类路径下有指定的类的条件下 |
@ConditionalOnExpression | 类 | 条件注解,基于SpEL表达式作为判断条件 |
@ConditionalOnJava | 类 | 条件注解,基于JVM版本作为判断条件 |
@ConditionalOnJndi | 类 | 条件注解,在JNDI存在的条件下查找指定的位置 |
@ConditionalOnMissingBean | 类 | 条件注解,当容器里没有指定Bean的情况下 |
@ConditionalOnMissingClass | 类 | 条件注解,当类路径下没有指定的类的情况下 |
@ConditionalOnNotWebApplication | 类 | 条件注解,当前项目不是web项目的条件下 |
@ConditionalOnResource | 类 | 条件注解,类路径是否有指定的值 |
@ConditionalOnSingleCandidate | 类 | 条件注解,当指定Bean在容器中只有一个,后者虽然有多个但是指定首选的Bean |
@ConditionalOnWebApplication | 类 | 条件注解,当前项目是web项目的情况下 |
@EnableConfigurationProperties | 类 | 声明开启属性注入,使用@Autowired注入,例:@EnableConfigurationProperties(HttpEncodingProperties.class)。 |
@AutoConfigureAfter | 类 | 在指定的自动配置类之后再配置,例:@AutoConfigureAfter(WebMvcAutoConfiguration.class) |
注解 | 说明 | JSR版本 |
---|---|---|
@Resource | 依赖注入 | JSR250 |
@Inject | 依赖注入 | JSR330 |
注解 | Processor | 注入方式 |
---|---|---|
Resource | AutowiredAnnotationBeanPostProcessor | 默认字段名(field name),若失败退化为类型(type) |
Inject | AutowiredAnnotationBeanPostProcessor | 默认依据类型注入 |
Autowired | CommonAnnotationBeanPostProcessor | 默认依据类型注入 |
工具 | 用途 |
---|---|
pandas | 提供大量快速便捷处理数据的函数及高效操作大型数据集所需的工具 |
numpy | 用于存储和处理大型矩阵与维度数组 |
matplotlib | 图标绘图系统 |
seaborn | 基于 Matplotlib 的数据可视化库 |
工具 | 用途 |
---|---|
scikit-learn (sklearn) | 常用的数据预测分析工具,机器学习 |
pytorch | 深度学习工具 |
tensorflow | 深度学习工具 |
paddlepaddle | 深度学习工具 |
工具 | 用途 |
---|---|
jupyter server / jupyter notebook | 基于 web 的交互式计算平台 |
zeppelin | 基于 web 的数据驱动、交互式数据分析平台 |