info

Android 如何获取CPU的温度

北城余情 提交于 2020-02-01 19:30:59
最近的项目有需求要获取CPU的温度,在网上找了一些资料,基本算是解决了问题: 进入adb shell执行下面的命令: shell@android:/ $ cat /etc/thermald.conf 这个不同设备得到的结果可能是不已样的,有这样的: sampling 5000 [tsens_tz_sensor0] sampling 5000 thresholds 10 thresholds_clr 5 actions none action_info 0 [tsens_tz_sensor1] sampling 5000 thresholds 60 thresholds_clr 57 actions none action_info 0 [tsens_tz_sensor2] sampling 5000 thresholds 60 thresholds_clr 57 actions none action_info 0 [tsens_tz_sensor3] sampling 5000 thresholds 60 thresholds_clr 57 actions none action_info 0 [tsens_tz_sensor4] sampling 5000 thresholds 60 thresholds_clr 57 actions none action_info 0

UniGUI的SQLite数据库(04)

为君一笑 提交于 2020-02-01 12:44:26
1]放FDConnection1和FDQuery1到界面上 2]在OnFormCreate事件里写 FDQuery1.Connection := FDConnection1; FDConnection1.LoginPrompt:=false; //取消登录提示框 FDConnection1.Open('DriverID=SQLite;Database=test1.Sqlite3');//test1.Sqlite数据库要与E:\UniGui_Learn\04OnLineIditom\Win32\Debug\Project1.exe位置一致 3]单条数据 FDQuery1.Open('select id,info from atb where id = 11111 ' ); unimemo1.Text:= FDQuery1.fieldbyname('info').asstring; 4]多条数据 FDQuery1.Open(‘select id,name,info from atb where 1=1’);//只读取第一个 unilistbox1.Items.Add( FDQuery1.fieldbyname('name').asstring); unimemo1.Text:= FDQuery1.fieldbyname('info').asstring; FDQuery1.next;

多线程并发服务器的简单实现

元气小坏坏 提交于 2020-01-31 22:53:30
分析同多进程并发 代码实现 1 //多线程服务器 2 #include "wrap.h" 3 #include < sys / types . h > 4 #include < sys / wait . h > 5 #include < pthread . h > 6 #define SERV_PORT 8888 7 //客户端的信息封装在一起,传给线程去处理 8 struct c_info 9 { 10 int cfd ; 11 struct sockaddr_in caddr ; 12 } ; 13 14 void * pthread_func ( void * arg ) 15 { 16 int n ; 17 char buf [ BUFSIZ ] ; 18 char str [ 128 ] ; 19 struct c_info * info = ( struct c_info * ) arg ; 20 21 printf ( "Client ip =%s ,port =%d\n " , inet_ntop ( AF_INET , & ( info -> caddr . sin_addr . s_addr ) , str , sizeof ( str ) ) 22 , ntohs ( info -> caddr . sin_port ) ) ; 23 24 while ( 1

BeanUtils.populate的作用

谁都会走 提交于 2020-01-31 18:19:12
BeanUtils.populate的作用 首先,它是在org.apache.commons.beanutils.BeanUtils包中的一个方法。 方法的作用:用来将一些 key-value 的值(例如 hashmap)映射到 bean 中的属性。 servlet中有这样的使用: 先定义form表单内容的Info对象(当然你要先写一个bean,这个bean中包含form表单中各个对象的属性) InsuranceInfo info = new InsuranceInfo(); (这是一个javabean) BeanUtilities.populateBean(info, request); ——> populateBean(info, request.getParameterMap());(先将request内容转为Map类型) ——>BeanUtils.populate(info, propertyMap);(调用包中方法映射) 映射的过程就是将页面中的内容先用request获得,然后再将之转换为Map(这里用request.getParameterMap()) 最后使用BeanUtils.populate(info,map)方法将页面各个属性映射到bean中。之后我们就可以这样使用bean.getXxxx()来取值了。 来源: https://www.cnblogs.com/L

Ceph 之RGW Cache

别说谁变了你拦得住时间么 提交于 2020-01-31 17:23:28
Overview 缓存是为达到系统快速响应的一项关键技术,Ceph 作为一个复杂的分布式存储系统,有多种、多级缓存存在。缓存按照位置分为: 客户端缓存 服务端缓存 网络中缓存 按照部署方式分为: 单体缓存 缓存集群 分布式缓存 而Rados 网关缓存,也即RGW Cache 按照位置:作为Ceph client 可以归为客户端缓存,作为上层应用的服务端可以归为服务端缓存。而按照部署方式则为分布式缓存,因为Ceph 集群通常会存在多个RGW 实例,分布式缓存会涉及到缓存同步等问题。 RGW Cache 将对象存储的相关元数据存储在内部缓存中,用于提升性能。 RGW Cache 执行路径 前面已经提到,目前Ceph 中涉及RGW Cache 的配置参数有三个: rgw_cache_enabled: RGW Cache 开关,默认为true,即开启。 rgw_cache_expiry_interval: 缓存数据的过期时间,默认900秒。 rgw_cache_lru_size: RGW 缓存entries的最大数量,当缓存满后会根据LRU算法做缓存entries替换,entries size默认为10000。读请求较多的场景,适当大的参数配置可以带来更好的性能。 查看RGW cache 命中率: [root@umstor14 build]# bin/ceph daemon out

单向链表

僤鯓⒐⒋嵵緔 提交于 2020-01-31 14:00:52
链表节点(其中info 表示节点信息,next是下一个节点引用,其中info可以通过template<class T> 实现泛型链表) #pragma once class IntSSLNode { public: IntSSLNode() { next = 0; info = 0; } IntSSLNode(int info, IntSSLNode* in = 0) { this->info = info; next = in; } int info; IntSSLNode* next; }; 链表类 #pragma once #include "IntSSLNode.h" class IntSSList { public: IntSSList() { head = tail = 0; } ~IntSSList(); int isEmpty() { return head == 0; } void addToHead(int); void addTotail(int); int deleteFromHead(); int deleteFromTail(); void deleteNode(int); bool isInList(int) const; private: IntSSLNode* head, * tail; }; #include<iostream> #include

Docker & Consul & Fabio & ASP.NET Core 2.0 微服务跨平台实践

我只是一个虾纸丫 提交于 2020-01-31 07:57:27
相关博文: Ubuntu 简单安装 Docker Mac OS、Ubuntu 安装及使用 Consul Consul 服务注册与服务发现 Fabio 安装和简单使用 阅读目录: Docker 运行 Consul 环境 Docker 运行 Fabio 环境 使用 Consul 注册 ASP.NET Core 2.0 服务 使用 Docker 发布部署 ASP.NET Core 2.0 服务 本篇博文的目的:在 Mac OS 中使用 VS Code 开发 ASP.NET Core 2.0 应用程序,然后在 Ubuntu 服务器配置 Docker 环境,并使用 Docker 运行 Consul 和 Fabio 环境,最后使用 Docker 运行 ASP.NET Core 2.0 应用程序。 你要的项目源码: https://github.com/yuezhongxin/HelloDocker.Sample 上面配置看起来还蛮简单,但实际去操作的时候,还是遇到了蛮多的问题,并且花了很多的时间去解决,比如 Docker 运行 Consul 和 Fabio,下面详细说下过程。 1. Docker 运行 Consul 环境 关于 Consul 的概念: Consul 是 HashiCorp 公司推出的开源工具,用于实现分布式系统的服务发现与配置。与其他分布式服务注册与发现的方案,比如

SpringBoot 报错:ERROR 10224 --- [ restartedMain] o.a.tomcat.jdbc.pool.ConnectionPool 已解决

不问归期 提交于 2020-01-31 04:56:42
SpringBoot 报错:ERROR 10224 — [ restartedMain] o.a.tomcat.jdbc.pool.ConnectionPool : Unable to create initial connections of pool. 解决方案 文章目录 eclipse报错 主要问题代码 解决思路 修改为正确代码 eclipse报错 2020-01-30 12:49:04.620 INFO 10224 — [ restartedMain] com.how2java.springboot.Application : Starting Application on LAPTOP-LELBA6ER with PID 10224 (E:\sprbt\springboot_h2j4\target\classes started by int in E:\sprbt\springboot_h2j4) 2020-01-30 12:49:04.620 INFO 10224 — [ restartedMain] com.how2java.springboot.Application : No active profile set, falling back to default profiles: default 2020-01-30 12:49:04.664 INFO

【爬虫学习笔记day66】7.8. scrapy-redis实战-- IT桔子分布式项目2

允我心安 提交于 2020-01-31 04:27:23
文章目录 7.8. scrapy-redis实战-- IT桔子分布式项目2 项目实现: items.py settings.py middlewares.py spiders/juzi.py scrapy.cfg 运行: 演示效果: 7.8. scrapy-redis实战-- IT桔子分布式项目2 项目实现: items.py # items.py # -*- coding: utf-8 -*- import scrapy class CompanyItem ( scrapy . Item ) : # 公司id (url数字部分) info_id = scrapy . Field ( ) # 公司名称 company_name = scrapy . Field ( ) # 公司口号 slogan = scrapy . Field ( ) # 分类 scope = scrapy . Field ( ) # 子分类 sub_scope = scrapy . Field ( ) # 所在城市 city = scrapy . Field ( ) # 所在区域 area = scrapy . Field ( ) # 公司主页 home_page = scrapy . Field ( ) # 公司标签 tags = scrapy . Field ( ) # 公司简介 company_intro

模块 json,sys,pickle,logging

…衆ロ難τιáo~ 提交于 2020-01-31 03:53:55
sys模块 sys.argv 命令行参数List,第一个元素是程序本身路径 sys.exit(n) 退出程序,正常退出时exit(0) sys.path 返回模块的搜索路径,初始化时使用PYTHONPATH环境变量的值 ========================================================sys.argv de 作用 返回的命令是列表,通过列表把用户名和密码直接赋值 -------------------------------------sys.path 添加模块的路径,导入使用 ============================logging 日志模块 import logging 写日志文件的级别,依次增加权限 logging.debug('debug message') logging.info('info message') logging.warning('warning message') logging.error('error message') logging.critical('critical message') 日志一共分成5个等级,从低到高分别是:DEBUG INFO WARNING ERROR CRITICAL。 DEBUG:详细的信息,通常只出现在诊断问题上 INFO:确认一切按预期运行 WARNING