- 博客(57)
- 资源 (13)
- 收藏
- 关注
原创 MACOS使用Karabiner解决CapsLock按键切换大写延迟问题
苹果MBP在macOS Mojava(10.14.6)及以上的版本中,键盘在小写状态下,默认短按CapsLock键是没有任何反应的,而且尝试修改了很多地方,最终发现官方没有给任何可以配置该delay的入口。对此苹果官方表示,这样设置是为了防止误按操作而设置的贴心服务,但是对英文书写和写代码时非常不友好。I can’t work with this obnoxious delay。该问题可以通过...
2019-12-31 18:16:22
5084
8
原创 Go 使用pprof內建包实现server的内存、系统资源等调试
使用pprof包嵌入到golang实现的server代码中, 可以实现实时内存、系统等资源占用情况, 进而实现调试的目的。pprof使用代码中引用:import _ "net/http/pprof"go func() { http.ListenAndServe("0.0.0.0:8899", nil)}()如果已经有HTTP服务, 则可以不用增加ListenAndServe...
2019-12-11 15:40:03
514
原创 Ubuntu 18.04 实现Alt+Tab不跨工作区
Ubuntu 18.04 Alt+Tab跨工作区问题Ubuntu 18.04 使用的GNOME桌面, 当使用 ALT+TAB 键切换应用时会跨工作区(workspace)切换, 解决方案如下:执行命令:gsettings set org.gnome.shell.app-switcher current-workspace-only true问题解决....
2019-07-14 10:40:51
1709
原创 openwrt 安装ssh客户端更新openwrt安装源
0.更新openwrt安装源更改源文件vim /etc/opkg.conf更新内容:dest root /dest ram /tmplists_dir ext /var/opkg-listsoption overlay_root /overlaysrc/gz barrier_breaker_base http://downloads.openwrt.
2015-06-18 13:45:26
8695
原创 Linux平台下的Qt50应用发布
0.说明:在Linux平台下开发的Qt应用,发布时有两种方式:1.静态编译;2.将全部链接赋值到目标目录下一同发布。介于现在Qt5(目前最新为Qt5.4.1)下载后直接是.run可执行程序,静态编译需要在source上打钩,且安装完后进src目录下再执行静态源码编译,不是很方便,因此采用方式2.1.准备工作:1.需要cde工具,下载方式:sudo apt-get ins
2015-03-16 16:51:16
1206
原创 fedora20 下配置cocos2d-x3.2开发环境 just for android
注:上篇日志没写完,是因为没时间搞那么复杂,做android又不是做linux的开发.因此在这篇日志中,只记录android环境的配置.当前环境系统:fedora20cocos2d-x版本:3.2C++ IDE:CLion目标平台:AndroidANT:apache-ant-1.9.4-bin.tar.gzNDK:android-ndk-r9dADT:adt-b
2014-09-19 15:26:25
3791
原创 fedora20 cocos2d-x 3.2 开发环境配置(for android)2
1.当前环境系统:fedora20cocos2d-x版本:3.2
2014-09-19 13:23:24
3470
原创 fedora20 执行 arm-linux-gcc 出现 libz.so.1: cannot open shared object file问题解决方案
6. 编译测试代码arm-linux-gcc -o test test.c错误提示:/opt/FriendlyARM/tools/arm-linux-gcc-4.5.1/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.1/../../../../arm-none-linux-gnueabi/bin/as: error while load
2014-08-21 00:34:58
13996
原创 fedora20 安装搜狗输入法及各种问题的解决
http://my.oschina.net/wallenheng/blog/226272
2014-08-18 10:39:44
29275
6
原创 ubuntu boot-repair new install method
sudo add-apt-repository ppa:yannubuntu/boot-repairsudo sed 's/trusty/saucy/g' -i /etc/apt/sources.list.d/yannubuntu-boot-repair-trusty.listsudo apt-get updatesudo apt-get install -y boot-repair &&
2014-07-07 12:44:24
803
原创 windows Qt编程之wchar_t * to QString格式转化
QString str1= QString::fromWCharArray(szMsg);
2014-06-27 14:45:21
6724
原创 移植cryptopp 5.6.2版本到ARM中需要进行的GNUmakefile 修改:
CXXFLAGS = -DNDEBUG -g -O2# -O3 fails to link on Cygwin GCC version 4.5.3# -fPIC is supported. Please report any breakage of -fPIC as a bug.CXXFLAGS += -fPIC# the following options reduce code
2014-05-09 15:10:15
3058
原创 python判断文件或文件夹是否存在
import os os.path.isfile('test.txt') #如果不存在就返回False os.path.exists(directory) #如果目录不存在就返回False
2014-04-29 15:03:22
981
原创 QT 嵌入式编译出错:cc1: fatal error: .pch/release-shared-emb-arm/QtGui: No such file or directory 解决方案:
configure参数:./configure -confirm-license -release -shared -opensource -embedded arm -xplatform qws/linux-arm-g++ -little-endian -qt-sql-sqlite -no-qt3support -no-webkit -no-javascript-jit -no-script
2014-01-23 10:14:53
7836
原创 ubuntu \ Fedora 下修改chrome root方式启动
将文件/opt/google/chrome/google-chrome最后一行修改为:exec -a "$0" "$HERE/chrome" "$@" --user-data-dir
2014-01-20 15:15:43
1046
转载 python package numpy和scipy 的安装与配置
关于最早要用这个GAT——genomic association tester,最早怕要追溯到去年的这个时候了,安装一直搞不定,后来也就放下没有再用。因为是用python写的,要安装python以及一系列的package,外行的我几度放弃几度磨叽,今天终于算是半搞定,说是半搞定,因为在安装SciPy的过程有好多warning,不知道未来跑大的dataset是否会出问题,而且目前只是在我笔记本上wu
2014-01-02 17:41:54
12671
原创 pyhton 判断文件 或 目录是否存在
判断目录是否为:目录:os.path.isdir(path)Return True if path is an existing directory. This follows symbolic links, so both islink() andisdir() can be true for the same path.判断目录是否为:文件:os.path.isfile(pat
2013-12-16 16:59:10
908
原创 Qt记录(二)
一 qt设置字体大小(目前用于textEdit)infoTextEdit->setFontPointSize(9);二 qt调用外部程序://1.通过调用linux C 函数system("opt/myApp");//2.通过QProcess,阻塞调用QProcess::execute("/opt/myApp");//3.通过QProcess,非阻塞调用
2013-12-02 15:49:41
860
转载 python 的 subprocess模块用法 popen
从python2.4版本开始,可以用subprocess这个模块来产生子进程,并连接到子进程的标准输入/输出/错误中去,还可以得到子进程的返回值。subprocess意在替代其他几个老的模块或者函数,比如:os.system os.spawn* os.popen* popen2.* commands.*一、subprocess.Popensubprocess模块定义了一个类: Po
2013-12-02 10:32:14
101229
原创 移植cocos2d-x 到ubuntu 12.04
怎么移植网上很多教材,按部就班就OK,但在make过程中,出现了一个源码级问题:../Classes/PerformanceTest/PerformanceAllocTest.cpp: 在成员函数‘virtual void NodeCreateTest::initWithQuantityOfNodes(unsigned int)’中:../Classes/PerformanceTes
2013-11-30 17:38:31
1148
原创 qt环境搭建预先需要的所有库
Qt在linux平台上搭建开发环境的时候,总需要一些依赖库,而在configure检测时Qt又不对依赖库进行fucking检测!!!而在make 时又fucking的时间特别长!!!如果在同时需要编译pc版和arm版,看到中途的make error就会又被插的阵痛……如果为了节省时间而放在夜间编译就会有菊花fucking的亚嘛呆爽感~!!!! 为了不让这些蛋疼菊紧的事铺面而来,特收集
2013-11-29 09:37:50
910
原创 Unknown media type in type 'all/all' 问题解决方案
在安装含有UI的linux deb文件时报错:Unknown media type in type 'all/all'Unknown media type in type 'all/allfiles'Unknown media type in type 'uri/mms'Unknown media type in type 'uri/mmst'Unknown media typ
2013-11-28 17:08:41
12705
转载 udhcpc 后台运行的方法
最近在做项目的时候卡在了dhcp处,当没有网络的时候,板子一直发送dhcp请求,导致程序不往下执行,解决的办法是把它切换到后台运行,可是如何切换到后台呢,有办法,它自带参数可以实现该功能。如下: udhcpc -b -i eth0 -p /var/run/udhcpc.pid -R解释一下,-b就是切换到后台指令,-i是指定使用哪个网络接口,双网卡的时候一定要使用它来指定eth0 o
2013-11-26 10:41:28
3677
原创 Linux sigaction信号机制积累
1.Linxu下使用signal()函数获取信号:signal()函数:#include typedef void (*sighandler_t)(int); sighandler_t signal(int signum, sighandler_t handler);返回值:signal() returns the previou
2013-11-08 11:26:20
2691
原创 Linux获取系统当前时间(精确到毫秒)
#include #include #include void sysLocalTime(){ time_t timesec; struct tm *p; time(×ec); p = localtime(×ec); printf("
2013-10-31 14:35:26
36470
3
转载 va_list用法
怎样写出一个可以处理想printf一样能够处理可变长参数的函数呢。看printf的定义:int printf(char *fmt, ...);C语言标准库中头文件stdarg.h索引的接口包含了一组能够遍历变长参数列表的宏。主要包含下面几个:1、va_list 用来声明一个表示参数表中各个参数的变量。2、va_start 初始化一个指针来指向变长参数列表的头一个变量(注意,..
2013-10-31 11:32:16
5934
转载 Linxu的struct ifaddrs 与getifaddrs()函数
来自man函数手册中的介绍:1,关于struct ifaddrs的说明:struct ifaddrs{ struct ifaddrs *ifa_next; /* Next item in list */ char *ifa_name; /* Name of interface */ unsigned int if
2013-10-30 17:05:26
20088
原创 Linux记录积累(一)
一.Linux查看CPU版本命令,用于区分CPU平台(跨平台编程)dmidecode | grep Version Version: F.0F Version: 0494200000000D10100000000 Version: 50.16 Version: N/A Version: Intel(R) Core(TM) i5 CP
2013-10-28 17:34:57
777
原创 Qt记录(一)
一. QTest:没有那个文件或目录在你工程的 .pro 文件中加上下面这一行QT += testlib如果前面已经有一些其他选项了,则QT += sql \ qt3support \ testlib
2013-10-21 17:52:13
2649
原创 Qt设置窗体大小不可变/edit只能输入数字
Qt设置窗体大小不可变:frame.setFixedSize(width, height);Qt edit只能输入数字:QValidator *validator=new QIntValidator(0,100,this); // 0-100 only accept numberQLineEdit *edit = new QLineEdit(); edit->setV
2013-10-16 23:08:57
3825
转载 C++ explicit构造函数----禁止隐式格式转换
按照默认规定,只有一个参数的构造函数也定义了一个隐式转换,将该构造函数对应数据类型的数据转换为该类对象,如下面所示:class String {String ( const char* p ); // 用C风格的字符串p作为初始化值//…}String s1 = “hello”; //OK 隐式转换,等价于String s1 = String(“hello”); 但是有
2013-10-16 10:30:15
4049
原创 Qt源码编译完成后,执行中出现undefined symbol: _ZN16QCoreApplicationC1ERiPPci错误解决方案
编译成功,但在移植到其他设备时出错,信息为:undefined symbol: _ZN16QCoreApplicationC1ERiPPci 解决方案是:1. 查看是否动态库路径不同或错误,在linux平台中执行env查看环境变量,看有关于Qt lib库的指定是否与编译平台的路径相同,如果不同通过export修改。关于怎么对应,网上很多,Google一下即可。2.
2013-10-15 14:53:06
8635
原创 Linux USB识别信息目录文件: (vendors, products, classes, sub‐classes and protocols).
Linux USB识别信息目录文件,包括vendors, products, classes, sub‐classes and protocols/var/lib/usbutils/usb.ids
2013-10-14 17:21:39
1092
转载 strstr积累记录
包含文件:string.h函数名: strstr函数原型:extern char *strstr(char *str1, char *str2);功能:从字符串str1中查找是否有字符串str2,如果有,从str1中的str2位置起,返回str1中str2起始位置的指针,如果没有,返回null。返回值:返回该位置的指针,如找不到,返回空指针。
2013-10-14 15:46:10
741
转载 C for linux 更改当前工作目录函数 chdir 或 fchdir
头文件:#include 用法格式:int chdir ( const char *path ); int fchdir ( int fd );chdir用来将当前工作目录改为参数path指定的目录。注意:path指针指向的参数一定是连续的路径且不能带空格,否则将会返回 -1 。例如:#include #include int
2013-10-14 15:27:58
6979
原创 atexit()函数积累记录
函数名: atexit头文件:#include功 能: 注册终止函数(即main执行结束后调用的函数)用 法: int atexit(void (*func)(void));注意:按照ISO C的规定,一个进程可以登记多达32个函数,这些函数将由exit自动调用。atexit()注册的函数类型应为不接受任何参数的void函数,exit调用这些注册函数的顺序与它们 登记时候的顺序相反
2013-10-14 14:23:57
987
原创 Qt动画----窗体渐进开启
在窗体继承类的构造函数中加入:QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity");animation->setDuration(1000);animation->setStartValue(0);animation->setEndValue(1);animation->start
2013-10-12 15:47:27
1614
4个等保2.0国家标准.zip
2019-12-31
Ubuntu12.10触摸板失灵解决方案脚本
2013-04-03
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人