自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(47)
  • 收藏
  • 关注

原创 c语言可变长参数

例void func(void* arg1, unsigned long argc,...){#define MAX_ARG 5 unsigned long argv[MAX_ARG+1]; int i; va_list arglist; va_start(arglist, argc); if(argc>MAX_ARG) { argc=MAX_ARG; } argv[0]=argc; for(i=0;i<argc;i++) {

2022-03-10 16:21:35 787

原创 PAHO MQTT交叉编译

1. 下载git clone https://github.com/eclipse/paho.mqtt.c2. 编译a. 在 cmake/ 下创建一个自己的 交叉编译链 cmake 文件 toolchain.linux-aaa.cmake# path to compiler and utilities# specify the cross compilerSET(CMAKE_C_COMPILER aaa-gcc)SET(CMAKE_CXX_COMPILER aaa-g++)# m

2021-07-16 16:04:00 1480

转载 git rm 未匹配任何文件

$ git rm ../doc/demo\241\214\346\226\271\346\263\225.txt fatal: 路径规格 '../doc/demo241214346226271346263225.txt' 未匹配任何文件原因:中文文件的显示方式设置不对。修改:git config --global core.quotepath falsecore.quotepath设为false的话,就不会对0x80以上的字符进行quote。中文显示正常。(https.

2021-06-30 15:20:06 2495

转载 incline function编译报错

编译时带了CFLAGS += -std=gnu99时,内联函数报错:warning: inline function ‘Function_A’ declared but never defined在函数‘Function_B’中:xxxx.c:152:对‘Function_A’未定义的引用修改为:CFLAGS += -std=gnu99 -fgnu89-inline再编译后正常了。...

2021-06-21 17:47:29 412

原创 ubuntu minicom使用

1. 安装sudo apt-get install minicom2. 设备名一般是 /dev/ttyUSB0 /dev/ttyUSB1 ...3. 使用sudo minicom -D /dev/ttyUSB0#(加 -D 指定设备名,可以打开多个串口)4. 设置第3步后进入了 minicom 界面,此时发现在界面上只有输出,不能输入,需进行设置。界面底部有提示CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7 |

2021-05-18 14:03:34 1351

转载 设置python3为默认python

https://blog.youkuaiyun.com/WK785456510/article/details/81094040当前版本:$ pythonPython 2.7.12 (default, Mar 1 2021, 11:38:31) [GCC 5.4.0 20160609] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> exit()查看py.

2021-05-12 14:07:35 277

原创 Linux less命令的使用

1. 打开文件#less filename2. 显示当前行信息输入'='test.log lines 3105918-3105978/3108794 byte 306609857/306873196 100% (press RETURN)3.3.1 全屏导航ctrl + F - 向前移动一屏ctrl + B - 向后移动一屏ctrl + D - 向前移动半屏ctrl + U - 向后移动半屏3.2 单行导航j - 向前移动一行k - 向后移动一行3

2021-03-23 11:03:36 1506

原创 printf 宏

#include <stdlib.h>#include <stdio.h>#include <string.h>#include <errno.h>#include <unistd.h>#include <sys/types.h>void testPrintf(){ printf("__func__: %s\n", __func__); printf("__BASE_FILE__: %s\n", __B

2021-01-21 14:28:13 303

原创 Ubuntu 16.04分辨率异常

碰到了主机与显示器的连接线,显示器灭了后起来,发现界面突然异常了,显示的所有的东西都变大了。查看设置项中的显示项,发现分辨率只有两个选项了:800X600 和 1024X768。运行了一下命令 sudo apt update ,再去看分辨率,发现又都出现了,赶紧设回了 1920X1080。...

2020-12-11 14:35:18 329

原创 虚拟机添加共享文件夹&添加USB设备

Ubuntu 16.04 系统,使用系统默认VirtualBox版本5.1.38,默认安装好了增强功能。虚拟机中安装了windows10系统。增加共享文件夹:1. 在虚拟机设置中添加共享文件夹2. 打开虚拟机(后使用VirtualBox版本为6.0.10时,不需要此步骤)选择 “计算机->映射网络驱动器”,选择上一步添加的文件夹2. 添加USB设备系统:Ubuntu 16.04虚拟机:VirtualBox 6.0.10 r132072 (Qt5.6.

2020-11-11 15:01:35 2443

转载 嵌入式CPU占用过高问题

1. 现象程序运行过程中某一阶段,其CPU占用会高达90%。2. 分析方法2.1 使用以下命令得到当前占用CPU情况awk '{print $1,$2,$14,$15,$14+$15 | "sort -r -n -k5";}' /proc/191/task/*/stat2.2 参考https://blog.youkuaiyun.com/litao31415/article/details/80905891中代码,可以看出当前每个线程占用CPU的比例代码中做了一点修改,显示线程名以及新加线程:.

2020-10-15 15:26:26 1113

原创 Linux remove函数和unlink函数

用man命令查看这两个命令:1. unlinkunlink有两个,1类和2类,函数中使用的是2类,因此使用以下命令查看:$ man 2 unlinkNAME unlink, unlinkat - delete a name and possibly the file it refers toSYNOPSIS #include <unistd.h> int unlink(const char *pathname);

2020-09-29 14:23:34 1013

原创 Volume was not properly unmounted. Some data may be corrupt

在板子上运行程序,报错误FAT-fs (mmcblk0p1): error, fat_get_cluster: invalid cluster chain (i_pos 141586439)umount又 mount后报错误FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.将T卡插到电脑上,用df命令查看到器挂载的路径, /dev/sdc1,运行 fsc

2020-09-07 10:40:39 8635

转载 根据epc定位linux_kernel_panic位置

https://www.cnblogs.com/embedded-linux/p/8687291.htmlepc:异常点ra:返回位置objdump -d -r elfFile

2020-08-25 17:53:43 252

原创 makefile--宏控制

定义宏用于两种使用场景:一是直接在makefile中用; 一种是在源文件中使用。#closeUSE_IN_MAKEFILE_MARCO =#open#USE_IN_MAKEFILE_MARCO = 1 ifdef USE_IN_MAKEFILE_MARCO#commandCFLAGS += -DUSE_IN_SOURCE_CODE_FILE_MARCOendif//SOURCE_CODE_FILE#ifdef USE_IN_SOURCE_CODE_FILE_MARCO//co

2020-06-19 15:54:20 639

原创 wpa_cli使用

1. 添加过程# wpa_cli -i wlan0 add_network1# wpa_cli -i wlan0 set_network 1 ssid '"aaa"'OK# wpa_cli -i wlan0 set_network 1 psk '"aaa"'FAIL# wpa_cli -i wlan0 set_network 1 psk '"aaaabbbb"'OK# wpa_cli -i wlan0 set_network 1 priority 5OK# wpa_cli -i w

2020-06-17 10:14:13 922 1

原创 linux 编译链接

预处理 gcc -E hello.c -o hello.i编译 gcc -S helloc.c -o hello.s or gcc -S helloc.i -o hello.s汇编 gcc -c hello.s -o hello.o or gcc -c hello.c -o hello.o链接 gcc -o hello hello.o or gcc -o hello hello.c...

2020-06-08 14:07:57 153

原创 关于warning: implicit declaration of function疑问

编译时出现警告:warning: implicit declaration of function 'func_nameXXX' [-Wimplicit-function-declaration]查了以下资料基本都是说,未声明函数。但我已把函数声明放在了头文件中,并include了此头文件。为什么?????后来把此函数使用extern在此文件头声明,再编译未出现此警告。why?????...

2020-05-21 10:20:44 2109

转载 分辨率、帧率和码率三者之间的关系

帧率:FPS(每秒钟要多少帧画面); 以及Gop(表示多少秒一个I帧)码率:编码器每秒编出的数据大小,单位是kbps,比如800kbps代表编码器每秒产生800kb(或100KB)的数据。分辨率:单位英寸中所包含的像素点数; VGA:Video Graphics Array(视频图像分辨率)三者的对应直播质量的影响因素:帧率:影响画面流畅度,与画面流畅度成正比:帧率越大,画面越流畅;帧率...

2020-04-25 15:30:35 3023

原创 C语言 -- 取值范围

打印类型(C 语言printf打印各种数据类型的方法(u8/s8/u16/s16.../u64/double/float)(全)_悟空明镜的博客-优快云博客_printf打印uint8)u8 %d s8 %d u16 %d or %hu s16 %d or %hd u32 %u s32 %d u64 %llu s64 %lld int ...

2020-04-17 18:20:34 1898

转载 android 5.0以上通知栏、状态栏图标变成白色

因为google在android5.0上面做了限制,为了统一系统风格。之后的状态栏icon就不能够随便用一张色彩丰富的图片了,只能够有白色和透明两个颜色出现。5.0以上(不包含5.0),系统默认通知栏图标为系统启动图标,会自动将通知栏的图标(有色区域)全部填充为白色,像一个白色格子,这是Google 为了实现材料设计规范,特意为之。为了去除白色图标,镂空背景即可:所以这之后...

2019-11-21 11:31:22 808

转载 Intent 各启动flag

android Intent启动flagFLAG_GRANT_READ_URI_PERMISSION如果设置这个标记,Intent的接受者将会被赋予读取Intent中URI数据的权限和ClipData中的URIs的权限。当应用与Intent的ClipData交互时,所有的URIs和data的所有递归遍历或者其他Intent的ClipData数据都会被授权。FLAG_GRANT_WR...

2019-11-16 14:00:03 789

转载 GreenDao 获取指定列

https://stackoverflow.com/questions/23445174/how-do-i-execute-select-distinct-ename-from-emp-using-greendaopublic static List<String> listEName(DaoSession session) { ArrayList<String&g...

2019-07-15 19:42:27 2675

原创 AS地址memo

android gradle插件和gradle版本对应关系https://developer.android.google.cn/studio/releases/gradle-plugin.html#3-0-0Plugin version Required Gradle version SDK build tools 1.0.0 - 1.1.3 2.2.1 - 2...

2019-07-03 10:18:17 304

转载 audio剪切

#!/usr/bin/python#coding=utf-8import osimport globimport refrom pydub import AudioSegment# 循环目录下所有文件for each in os.listdir('.'): filename = re.findall(r"(.*?)\.mp3", each) # 取出.mp3后缀的文件...

2019-06-27 20:55:47 188

原创 mongodb中 or 和 and 组合查询

A=a1 or A=a2 or ...and(B=b1 and C=c1) or (B=b2 and C=c2) or ...public DBObject getDBObject(List<String>aNumbers, Map<String, String> values) { BasicDBList dbList = new BasicDBList(...

2019-05-23 11:55:05 2337

原创 mongod连接问题

在linux上运行服务端,在windows虚拟机上运行客户端。客户端一直报Connect Exception: Connection refused查看linux上的端口,发现监听的是localhost:27017端口,而虚拟机不是走localhost。根据这篇文章version v4.0.9mongod --dbpath /dbpathlsof -i:27017COMMA...

2019-04-24 10:13:10 199

转载 Ubuntu 版本的命名规则和开发代号

转载:https://www.jianshu.com/p/5ce0dc0525c4Ubuntu版本的命名规则是根据正式版发布的年月命名,Ubuntu 8.10 也就意味着 2008年10月发布的 Ubuntu,研发人员与用户可从版本号码就知道正式发布的时间。大家都知道 Debian 的开发代号来源于电影《玩具总动员》,而脱胎于 Debian 的 Ubuntu,其开发代号同样很有意思。...

2019-04-23 20:25:23 1651

原创 查看被占用端口

使用netstat命令netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships参数:-a: Show both listening and non-listening sockets.-p: ...

2019-04-23 17:17:39 102

转载 linux 打开终端和文件夹

1. 在当前路径打开终端(https://blog.youkuaiyun.com/IOT_Flower/article/details/71189816):首先进行插件的安装:$sudo apt-get install nautilus-open-terminal然后重启系统生效:$sudo shutdown -r now意打开一个路径,右键,可以看到多了一个open in termi...

2019-01-24 17:59:11 437

原创 getResourceAsStream返回NULL

编译后,在 target/classes 目录下生成了config.propertes 配置文件。代码中在A类中使用此配置文件,使用方法如下:prop.load(Object.class.getResourceAsStream("/config.properties"));结果一直报NULL错误。打印路径查看System.out.println(Object.class.g...

2019-01-22 10:34:33 5818

原创 安装Paho MQTT C Library

1. 下载源码git clone https://github.com/eclipse/paho.mqtt.c2. 安装makesudo make install 注,在 sudo  make install 时报错误:install -m 644 build/output/doc/MQTTClient/man/man3/MQTTClient.h.3 /usr/loc...

2019-01-16 11:11:02 2693

原创 安装mosquitto时openssl版本

安装mosquitto前,电脑的openssl版本是1.1.1a,安装时一直报以下错误:make[1]: 正在进入目录 `/work/MQTT/mosquitto-1.5.5/client'cc -c pub_client.c -o pub_client.o -Wall -ggdb -O2 -I.. -I../lib -DVERSION="\"1.5.5\"" -DWITH_TLS -D...

2019-01-14 14:55:47 4347 3

原创 ubuntu14.04 openssl升级

旧版本是1.0.1f,本想先卸载旧版本,卸载时提示有依赖问题。就不卸载了,直接安装新版本。下载了1.1.1a的源码,按INSTALL文档提示安装: on Unix (again, this includes Mac OS/X): $ ./config $ make $ make test $ make install运行./config时,...

2019-01-11 12:01:44 1344

原创 虚拟机的ns_error_failure 0x80004005错误

电脑重启后,要启动虚拟机时,报这个错误了,可能导致这种情况的操作,想了下,应该没有。搜索网上的解决方法,有说 sudo /etc/init.d/virtualbox restart 的,运行了后报错说缺少/sys/module/xhsjkrnl_4/holders文件;换个方法,错误log中提到 homepath/.config/VirturalBox/VirtualBox.xml 文件,...

2019-01-10 12:22:25 22184 2

转载 printf "%.*s"

转载: http://www.cnblogs.com/yuaqua/archive/2011/10/21/2219856.html小数点.后“*”表示输出位数,具体的数据来自参数表printf格式字符串中,与宽度控制和精度控制有关的常量都可以换成变量,方法就是使用一个“*”代替那个常量,然后在后面提供变量给“*”。同样,小数点.前也可以添加*,也要用户输入一个位宽值来代替,表示输出的字符...

2019-01-09 15:49:22 4717

原创 'for' loop initial declarations are only allowed in C99 mode

android中编译c语言编写代码,出现错误:error: 'for' loop initial declarations are only allowed in C99 modefor(int i = 0; i &lt; zeroes; i++) {原因:for中定义i变量的形式是C99的标准,而默认标准应该是C89,不支持这种写法。改正方法一:int i;for (...

2018-12-25 16:41:44 970

原创 SkPaint中的getTextWidths方法

/** Return the advances for the text. These will be vertical advances if * isVerticalText() returns true. * * @param text the text * @param byteLength number of b...

2018-12-19 20:54:04 325

转载 AS错误

1. Gradle sync failed: Cause: error in opening zip file 的错误https://www.cnblogs.com/maydear/p/6849745.htmlhttps://blog.youkuaiyun.com/u010064206/article/details/68699981 2. Gradle project sync failed...

2018-11-02 17:46:44 207

原创 bind socket报EACCES(Permission denied)错误

使用的端口是443端口。通过apk运行bin文件中的bind socket方法,一直报EACCES (Permission denied)错误。查网上资料,基本解决方法都是加权限以及不在UI线程中运行连接网络的部分,我按此修改了之后,都没有效果。估计是因为端口号是443端口,是保留端口的缘故?查bind的文档,针对此错误的解释:EACCES The address is pro...

2018-08-15 20:51:36 5611

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除