原创 CentOS7下yum安裝Redis

原文鏈接:https://www.cnblogs.com/diantong/p/11255019.html (1).Redis概述   Redis是一個開源的使用ANSI C語言編寫、支持網絡、

原创 HTML中合併單元格的例子

代碼: <html> <body> <table style="width:300px; height:100px;" border="1" cellspacing="0"> <tr align="center" valign="

原创 Python自帶的簡單的HTTP服務器,可以用來遠程訪問linux中的文件

原文鏈接:https://blog.csdn.net/weixin_36283095/article/details/68940811 情景 最近在對爬蟲比較感興趣,就嘗試爬去一些網上的圖片到本

原创 在程序中用new ClassPathXmlApplicationContext()獲取Spring的上下文環境注意事項

原文鏈接:https://blog.csdn.net/budapest/article/details/38493003 問題背景:在我們的web程序中,用spring來管理各個實例(bean)

原创 Java AIO方法實現TCP Socket服務器支持多客戶端的例子

代碼: import java.io.IOException; import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.channel

原创 Linux中複製C/C++程序的所有依賴庫的腳本

腳本如下,保存爲copy.sh,放到C/C++程序所在的文件夾(以C/C++程序名爲App爲例) deplist=$( ldd $1 | awk '{if (match($3,"/")){ print $3}}' ) cp -L -

原创 Qt5.9在Centos7中qDebug不輸出的解決辦法

(1)在/etc/xdg/QtProject/路徑下找到qtlogging.ini文件,如果沒有則創建 (2)將文件內容修改爲如下內容 [Rules] *.debug=true qt.*.debug=false (3)重新運行Qt程序,

原创 遠程登陸樹莓派,使用root用戶運行Qt程序提示No protocol specified QXcbConnection: Could not connect to display :0.0

轉載自: https://blog.csdn.net/lslsyqyq/article/details/87164749 問題: 樹莓派連接顯示器A 顯示器B 使用ssh遠程登陸樹莓派。     在B上使用sudo su切換到root用戶

原创 Qt5.8.0編譯QtMqtt庫並使用該庫連接有人云的例子

一 編譯QtMqtt庫 Qt5.10才官方支持MQTT,但我用的Qt版本是5.8.0 Mingw_32BIT, 爲了在Qt5.8.0上添加MQTT支持,需要自己編譯源碼 步驟: (1) git clone https://github.c

原创 手動一步一步來製作備份Raspberry Pi樹莓派SD卡的img映像文件(不用dd命令,已測試通過)

說明 整理自:https://blog.csdn.net/zhufu86/article/details/78821056,感謝原作者分享 說明:將樹莓派Zero SD卡中的系統在樹莓派3 B+上做成img鏡像,並使用dd命令將生成的im

原创 OpenCV2.4.10 + VC2010 + Qt5.4.2(MSVC2010) + QtCreator3.4.1 搭建OpenCV開發環境

(1)搭建好VC2010 + Qt5.4.2(MSVC2010) + QtCreator3.4.1 的集成開發環境; (2)下載並運行OpenCV2.4.10的安裝程程序,安裝程序會將OpenCV需要的動態庫,靜態庫,頭文件等解壓到安裝目

原创 樹莓派Zero的ttyAMA0使用pi用戶訪問時拒絕訪問(Permission denied)的解決辦法(已在Zero上遇到並測試通過)

I'm also guessing that you are using a Pi 3B. On a Pi 3B, "/dev/ttyAMA0" is normally reserved for Bluetooth. To use the

原创 QListView配合Model和Delegate工作的例子

主要代碼: #ifndef STUDENT_H #define STUDENT_H #include <QString> class Student { public: Student(); void setId(i

原创 QTableView的單元格中嵌入多個可點擊的超鏈接的例子

關鍵代碼: #ifndef STUDENT_H #define STUDENT_H #include <QString> class Student { public: Student(); void setId(i

原创 Qt通過類名稱創建類的實例的兩種方法

1 通過qRegisterMetaType和QMetaType #ifndef ANIMAL_H #define ANIMAL_H class Animal { public: Animal(); virtual v