原创 Ubuntu 18.04 實現Alt+Tab不跨工作區
Ubuntu 18.04 實現Alt+Tab不跨工作區 Ubuntu 18.04 使用的GNOME桌面, 當使用 ALT+TAB 鍵切換應用時會跨工作區(workspace)切換, 解決方案如下: 執行命令: gsettings
原创 Linux記錄積累(一)
一.Linux查看CPU版本命令,用於區分CPU平臺(跨平臺編程) dmidecode | grep Version Version: F.0F Version: 0494200000000D10100000000
原创 Go 使用pprof內建包實現server的內存、系統資源等調試
使用pprof包嵌入到golang實現的server代碼中, 可以實現實時內存、系統等資源佔用情況, 進而實現調試的目的。 pprof使用 代碼中引用: import _ "net/http/pprof" go func() {
原创 va_list用法
怎樣寫出一個可以處理想printf一樣能夠處理可變長參數的函數呢。 看printf的定義: int printf(char *fmt, ...); C語言標準庫中頭文件stdarg.h索引的接口包含了一組能夠遍歷變長參數列表的宏。主要包含
原创 Linux sigaction信號機制積累
1.Linxu下使用signal()函數獲取信號: signal()函數: #include <signal.h> typedef void (*sighandler_t)(int); sighandle
原创 Qt動畫----窗體漸進開啓
在窗體繼承類的構造函數中加入: QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity"); animation->setDuration(
原创 Qt源碼編譯完成後,執行中出現undefined symbol: _ZN16QCoreApplicationC1ERiPPci錯誤解決方案
編譯成功,但在移植到其他設備時出錯,信息爲:undefined symbol: _ZN16QCoreApplicationC1ERiPPci 解決方案是: 1. 查看是否動態庫路徑不同或錯誤,在linux平
原创 Linux USB識別信息目錄文件: (vendors, products, classes, sub‐classes and protocols).
Linux USB識別信息目錄文件,包括vendors, products, classes, sub‐classes and protocols /var/lib/usbutils/usb.ids 點贊 收藏
原创 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 me
原创 Linux獲取系統當前時間(精確到毫秒)
#include <stdio.h> #include <time.h> #include <sys/time.h> void sysLocalTime() { time_t timesec; s
原创 MACOS使用Karabiner解決CapsLock按鍵切換大寫延遲問題
蘋果MBP在macOS Mojava(10.14.6)及以上的版本中,鍵盤在小寫狀態下,默認短按CapsLock鍵是沒有任何反應的,而且嘗試修改了很多地方,最終發現官方沒有給任何可以配置該delay的入口。對此蘋果官方表示,這樣設
原创 Linxu的struct ifaddrs 與getifaddrs()函數
來自man函數手冊中的介紹: 1,關於struct ifaddrs的說明: struct ifaddrs { struct ifaddrs *ifa_next; /* Next item in list */ c
原创 Qt記錄(一)
一. QTest:沒有那個文件或目錄 在你工程的 .pro 文件中加上下面這一行QT += testlib 如果前面已經有一些其他選項了,則 QT += sql \ qt3support \
原创 C for linux 更改當前工作目錄函數 chdir 或 fchdir
頭文件:#include <unistd.h> 用法格式:int chdir ( const char *path );
原创 Qt設置窗體大小不可變/edit只能輸入數字
Qt設置窗體大小不可變: frame.setFixedSize(width, height); Qt edit只能輸入數字: QValidator *validator=new QIntValidator(0,100,this); /