-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.xml
59 lines (59 loc) · 18.9 KB
/
search.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title><![CDATA[Mac配置vscode进行C++开发]]></title>
<url>%2F2018%2F12%2F22%2FMac%E9%85%8D%E7%BD%AEvscode%E8%BF%9B%E8%A1%8CC-%E5%BC%80%E5%8F%91%2F</url>
<content type="text"><![CDATA[#前言 平时工作做C/C++方面的开发更多还是在Windows下使用Visual Studio,Qt,CodeBlock等。自己的电脑是macOS下使用过IDE性质的XCode,CLion,Qt Creator,也使用过轻量级的诸如TextMate, Sublime Text,vim。但始终没有宇宙最强IDE—MS家族的VS。那种操作体验爽。废话少说了,直接上教程 需求格式化自动补全Lint符号检索方便的跳转和查看可视化调试 步骤1.下载并安装Visual Studio Code2.检查自己的Mac是否安装了编译器,打开控制台。输入 g++ -v 和 clang++ -v如下图3.然后回到VSCode去安装如下图所示的两款插件,以获得C++语法高亮、错误检查和调试等功能。 那么,前期准备工作完成后进入具体的配置阶段。首先在目录下新建一个文件夹作为工程目录,然后在VSCode中打开该文件夹。在里面新建一个cpp文件命名为main.cpp。随意写点程序在里面。 12345678910#include<iostream>#include<stdlib.h>#include<stdio.h>using namespace std;int main(int argc, char const *argv[]){ cout<<"Hello~"<<endl; return 0;} 然后点击侧边栏的Debug按钮,点击设置图标,便会提示你选择环境,这里就选择C++那一项。 此时VSCode会在你的工程目录下自动新建一个.vscode的文件夹,并新建了一个launch.json的文件,这里需要对生成的文件进行一些小改动。本人配置如下: 1234567891011121314151617181920{ // 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "(lldb) Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/a.out", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "MIMode": "lldb" } ]} 保存后按快捷键⇧⌘B编译,此时会出现提示没有找到要运行的生成任务,所以接下来将进行生成任务的配置工作,VSCode提供了一些模版,有需要的可以自行选择,这里就选则Others。 此时.vscode目录下会出现一个task.json文件,对它进行改写。本人配置如下: 12345678910111213141516171819{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "hello world", "type": "shell", "command": "clang++", "args": [ "main.cpp" ], "group": { "kind": "build", "isDefault": true } } ]} 保存后再次按快捷键⇧⌘B就能够顺利编译了,编译完成后按F5执行,得到输出结果。 每次编译完成后,我们会发现目录下多了一个a.out文件,这个文件是Linux/Unix环境下编译器编译源代码并连接产生的可执行文件,在未指定的情况下其默认命名为a.out。那么如何通过修改配置文件来修改这个文件的命名呢? 方法很简单,在task.json中的args属性下填入-o yourfilename.out,以本人的配置作为示例: 1234567891011121314151617181920{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "hello world", "type": "shell", "command": "clang++", "args": [ "-o app.out", "main.cpp" ], "group": { "kind": "build", "isDefault": true } } ]} 可以发现这里的command和args两个属性就相当于在命令行中执行了clang++ -o yourfilename.out main.cpp,所以如果还有其他的需求也可以对这里进行改写。最后不要忘记修改launch.json中的program属性,将.out的文件名修改为与task.json一致。便可以成功编译执行了。编译后结果如下图:]]></content>
<categories>
<category>编程工具</category>
</categories>
<tags>
<tag>Mac</tag>
<tag>IDE</tag>
</tags>
</entry>
<entry>
<title><![CDATA[Hello World]]></title>
<url>%2F2018%2F12%2F22%2Fhello-world%2F</url>
<content type="text"><![CDATA[Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new "My New Post" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment]]></content>
</entry>
<entry>
<title><![CDATA[如何关联结构体中的各个变量]]></title>
<url>%2F2018%2F11%2F09%2F%E5%A6%82%E4%BD%95%E5%85%B3%E8%81%94%E7%BB%93%E6%9E%84%E4%BD%93%E4%B8%AD%E7%9A%84%E5%90%84%E4%B8%AA%E5%8F%98%E9%87%8F%2F</url>
<content type="text"><![CDATA[日常查询一个结构体里面的变量,一般都是直接拿着结构体往控件填写相应的参数即可,但是实际应用中涉及到查询等操作时,需要根据某个名称获取其他的信息比如,它的相关说明等等。 思路:ID和Name 这两变量本身没有任何关联,需要用一种关联容器实现二者关联。即QMap 本文关键字:QListView; QStringList; QMap; 信号和槽 mainwindow.cpp 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364#include "mainwindow.h"#include "ui_mainwindow.h"#include <QMessageBox>#include <QDebug>#include <QString>#include <QMap>MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){ ui->setupUi(this); init();}MainWindow::~MainWindow(){ delete ui; }void MainWindow::init() { m1_sAreaInfo = {"0x1","名称4","防区安全"}; m2_sAreaInfo = {"0x2","名称5","防区未知"}; m3_sAreaInfo = {"0x3","名称6","防区安全"};ItemModel = new QStandardItemModel(this);QStringList strList;strList.append(QString::fromStdString(m1_sAreaInfo.ID));strList.append(QString::fromStdString(m2_sAreaInfo.ID));strList.append(QString::fromStdString(m3_sAreaInfo.ID));map.insert("0x1","名称4");map.insert("0x2","名称5");map.insert("0x3","名称6");int nCount = strList.size();for(int i = 0; i < nCount; i++){ QString string = static_cast<QString>(strList.at(i)); QStandardItem *item = new QStandardItem(string); ItemModel->appendRow(item);}ui->listView->setModel(ItemModel);ui->listView->setFixedSize(200,300);connect(ui->listView,SIGNAL(clicked( QModelIndex )),this,SLOT(showClick(QModelIndex)));}void MainWindow::showClick( QModelIndex index){QString strTemp;strTemp = index.data().toString();QMap<QString, QString>::iterator mi; // mi = map.find(strTemp);QString strName = map[strTemp]; //获取键的值QMessageBox msg;msg.setText(strName);msg.exec();} mainwindow.h 123456789101112131415161718192021222324252627282930313233343536373839404142434445#ifndef MAINWINDOW_H#define MAINWINDOW_H#include <QMainWindow>#include <QStringListModel>#include <QStandardItemModel>#include <QModelIndex>namespace Ui {class MainWindow;}class MainWindow : public QMainWindow{ Q_OBJECTpublic: explicit MainWindow(QWidget *parent = 0); ~MainWindow();private: Ui::MainWindow *ui;public: QStringListModel *Model; QStandardItemModel *ItemModel; void init(); struct sAreaInfo { std::string ID ; //ID std::string Name ; //名称 std::string Remark; //说明 }; sAreaInfo m1_sAreaInfo; sAreaInfo m2_sAreaInfo; sAreaInfo m3_sAreaInfo; QMap<QString, QString> map;private slots: // void showClick(QModelIndex sAreaInfo); void showClick(QModelIndex);};#endif // MAINWINDOW_H main.cpp 1234567891011#include "mainwindow.h"#include <QApplication>int main(int argc, char *argv[]){ QApplication a(argc, argv); MainWindow w; w.show(); return a.exec();} 打开Qt Creator,拖放一个QListView运行效果以上demo仅供参考]]></content>
<categories>
<category>Qt</category>
</categories>
<tags>
<tag>编程语言,C++,C,Qt</tag>
</tags>
</entry>
<entry>
<title><![CDATA[蔡佩軒 Ariel Tsai Cover【TOP COVER SONGS 2018】 最佳翻唱 - 最佳歌曲名单]]></title>
<url>%2F2018%2F11%2F03%2F%E8%94%A1%E4%BD%A9%E8%BB%92-Ariel-Tsai-Cover%E3%80%90TOP-COVER-SONGS-2018%E3%80%91-%E6%9C%80%E5%A5%BD%E5%90%AC%E6%AD%8C-%E6%9C%80%E4%BD%B3%E6%AD%8C%E6%9B%B2%E5%90%8D%E5%8D%95%2F</url>
<content type="text"><![CDATA[蔡佩軒 Ariel Tsai -That Girl-.mp3 var ap = new APlayer({ element: document.getElementById("aplayer-PwbleeHn"), narrow: false, autoplay: false, showlrc: false, music: { title: "that gril", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92%20Ariel%20Tsai%20-That%20Girl-.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap); 蔡佩軒 Ariel Tsai -体面.mp3 var ap = new APlayer({ element: document.getElementById("aplayer-uwyjrrKb"), narrow: false, autoplay: false, showlrc: false, music: { title: "体面", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92%20Ariel%20Tsai%20-%E4%BD%93%E9%9D%A2.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap); 蔡佩軒 Ariel Tsai -光年之外.mp3 var ap = new APlayer({ element: document.getElementById("aplayer-dQvDGWpQ"), narrow: false, autoplay: false, showlrc: false, music: { title: "光年之外", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92%20Ariel%20Tsai%20-%E5%85%89%E5%B9%B4%E4%B9%8B%E5%A4%96.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap); 蔡佩軒 Ariel Tsai -剛好遇見你.mp3 var ap = new APlayer({ element: document.getElementById("aplayer-gwsIEhUK"), narrow: false, autoplay: false, showlrc: false, music: { title: "刚好遇见你", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92%20Ariel%20Tsai%20-%E5%89%9B%E5%A5%BD%E9%81%87%E8%A6%8B%E4%BD%A0.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap); 蔡佩軒 Ariel Tsai -告白氣球 .mp3 var ap = new APlayer({ element: document.getElementById("aplayer-OfUEnpJA"), narrow: false, autoplay: false, showlrc: false, music: { title: "告白气球", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92%20Ariel%20Tsai%20-%E5%91%8A%E7%99%BD%E6%B0%A3%E7%90%83.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap); 蔡佩軒 Ariel Tsai -妮妮.mp3 var ap = new APlayer({ element: document.getElementById("aplayer-XAxaebvS"), narrow: false, autoplay: false, showlrc: false, music: { title: "妮妮", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92%20Ariel%20Tsai%20-%E5%A6%AE%E5%A6%AE.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap); 蔡佩軒 Ariel Tsai -漂向北方.mp3 var ap = new APlayer({ element: document.getElementById("aplayer-ytksTDUT"), narrow: false, autoplay: false, showlrc: false, music: { title: "漂向北方", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92%20Ariel%20Tsai%20-%E6%BC%82%E5%90%91%E5%8C%97%E6%96%B9.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap); 蔡佩軒 Ariel Tsai -演員.mp3 var ap = new APlayer({ element: document.getElementById("aplayer-ccFJxxom"), narrow: false, autoplay: false, showlrc: false, music: { title: "演员", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92%20Ariel%20Tsai%20-%E6%BC%94%E5%93%A1.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap); 蔡佩軒 Ariel Tsai -礼物.mp3 var ap = new APlayer({ element: document.getElementById("aplayer-YHOqueJp"), narrow: false, autoplay: false, showlrc: false, music: { title: "礼物", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92%20Ariel%20Tsai%20-%E7%A4%BC%E7%89%A9.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap); 蔡佩軒 Ariel Tsai -等你下課.mp3 var ap = new APlayer({ element: document.getElementById("aplayer-OmpwoyrD"), narrow: false, autoplay: false, showlrc: false, music: { title: "等你下课", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92%20Ariel%20Tsai%20-%E7%AD%89%E4%BD%A0%E4%B8%8B%E8%AA%B2.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap); 蔡佩軒 Ariel Tsai -追光者.mp3 var ap = new APlayer({ element: document.getElementById("aplayer-sXIzqCMA"), narrow: false, autoplay: false, showlrc: false, music: { title: "追光者", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92%20Ariel%20Tsai%20-%E8%BF%BD%E5%85%89%E8%80%85.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap); 蔡佩軒 Ariel Tsai -雪落下的聲音.mp3 var ap = new APlayer({ element: document.getElementById("aplayer-OTlOHNbo"), narrow: false, autoplay: false, showlrc: false, music: { title: "雪落下的声音", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92%20Ariel%20Tsai%20-%E9%9B%AA%E8%90%BD%E4%B8%8B%E7%9A%84%E8%81%B2%E9%9F%B3.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap); 蔡佩軒 Ariel Tsai-卡農卡農.mp3 console.error("Error: [hexo-tag-aplayer] Specified asset file not found (href=#蔡佩軒-Ariel-Tsai-宣言-mp3)"); 蔡佩軒 Ariel Tsai-青春有你.mp3 var ap = new APlayer({ element: document.getElementById("aplayer-ZMRJUOKv"), narrow: false, autoplay: false, showlrc: false, music: { title: "青春有你", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92%20Ariel%20Tsai-%E9%9D%92%E6%98%A5%E6%9C%89%E4%BD%A0.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap); 蔡佩軒Ariel -學貓叫.mp3 var ap = new APlayer({ element: document.getElementById("aplayer-XaCSXhyJ"), narrow: false, autoplay: false, showlrc: false, music: { title: "学猫叫", author: "蔡佩轩", url: "http://music.varygod.top/%E8%94%A1%E4%BD%A9%E8%BB%92Ariel%20-%E5%AD%B8%E8%B2%93%E5%8F%AB.mp3", pic: "", lrc: "" } }); window.aplayers || (window.aplayers = []); window.aplayers.push(ap);]]></content>
<categories>
<category>歌单</category>
</categories>
<tags>
<tag>蔡佩轩</tag>
<tag>Ariel Tsai</tag>
</tags>
</entry>
<entry>
<title><![CDATA[vsftpd服务器的移植]]></title>
<url>%2F2018%2F07%2F15%2Fvsftpd%2F</url>
<content type="text"><![CDATA[一、简介 vsftpd即very secure FTP daemon(非常安全的FTP进程),是一个基于GPL发布的类UNIX类操作系统上运行的服务器的名字(是一种守护进程),可以运行在诸如Linux、BSD、Solaris、HP-UX以及Irix等系统上面。vsftpd支持很多其他传统的FTP服务器不支持的良好特性。使用 vsftpd 可以在 Linux/Unix 系统上搭建一个安全、高性能、稳定性好的轻量级FTP服务器。 二、准备工作 vsftpd源码包 vsftpd-3.0.2.tar.gz 下载入口 arm-linux-gcc 交叉工具编译链 下载入口 linux平台(Ubuntu 12.04 32bit) 1PS:本人所使用的是arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 三、编译vsftpd源码1、解压 12# tar -xvf vsftpd-3.0.2.tar.gz -C /home/zhangxu/# cd /home/vsptfd-3.0.2 2、配置环境变量 1#export PATH = $PATH:/home/zhangxu/software/arm-2009q1/bin 3、修改Makefile和vsf_findlibs.sh 12345#vi Makefile CC = /home/myvpc/software/arm-2009q1/bin/arm-none-linux-gnueabi-gcc LIBS = './vsf_findlibs.sh' - lcrypt (参数- lcrypt ,否则编译提示找不到crypt) #vi vsf_findlibs.sh 注释掉49-59行 4、编译 1# make #编译,如果电脑是多核CPU,如四核,使用make -j4可提高编译速度 编译完成后,当前目录下会生成两个文件:vsftpd 和 vsftpd.conf,这两个文件是我们要用的。 四、复制vsftpd 和vsftpd.conf文件到目标板将生成的 vsftpd 复制到目标板 /usr/sbin 目录,vsftpd.conf 复制到目标板 /etc 目录,并修改vsftpd 为可执行,从PC上传到目标板方式任选,可以用tftp或者挂载的方式均可 1#chmod +x vsftpd 五、目标板FTP服务 配置使用 vi 打开 vsftpd.conf 文件,并进行配置,如下配置可实现正常上传下载功能: 12345678anonymous_enable=NO # 默认的 YES 改为 NOlocal_enable=YES # 删除前面的#号注释符号write_enable=YES # 删除前面的#号注释符号anon_upload_enable=NO # 删除前面的#号注释符号,并将 YES 改为 NOanon_mkdir_write_enable=NO # 删除前面的#号注释符号,并将 YES 改为 NOanon_other_write_enable=NO # 删除前面的#号注释符号,并将 YES 改为 NO(这一项新版本中可能没有) chroot_local_user=YES # 删除前面的#号注释符号,改行表示把FTP用户都限制在根目录中allow_writeable_chroot=YES # 添加本行到文件最后 再在目标版上使用命令行配置: 12# adduser nobody # vsftpd默认配置需要# mkdir /usr/share/empty # vsftpd默认配置需要 创建一个本地用户,并设置密码: 12345# adduser ftpadminChanging password for ftpadminNew password: Retype password: Password for ftpadmin changed by root 六、开启vsftpd服务配置完之后,在目标板上打开vsftpd,命令: 1# vsftpd & #注意,后面还有一个& 如果要让 vsftpd 开机启动,可以将该命令添加到 /etc/profile 或者 rc.local 文件最后。 七、 客户端测试]]></content>
<categories>
<category>嵌入式</category>
</categories>
<tags>
<tag>vsftpd</tag>
</tags>
</entry>
<entry>
<title><![CDATA[我的小窝]]></title>
<url>%2F2018%2F07%2F15%2F%E6%88%91%E7%9A%84%E5%B0%8F%E7%AA%9D%2F</url>
<content type="text"><![CDATA[今日入驻github 2018年10月29日00:55:41 修改了主题新的配置文件]]></content>
</entry>
</search>