摘要: 前言: Ubuntu系统上部署django,使用的部署方案是 Ubuntu + django + uwsgi + nginx Ubuntu系统版本用的是 ubuntu-20.04.2.0-desktop-amd64 *:所有的安装尽量都在 root 用户下安装,不然后面会有很多麻烦 前置条件: 准备 阅读全文
posted @ 2022-09-06 17:37 十一的杂文录 阅读(604) 评论(0) 推荐(0)
摘要: 目前Python格式化字符串的方式有三种: 1. % 2.format 3.f-string % 格式化常用方法: # % 格式化字符串 s1 = 'name is %s' % ('zhangsan') # >>> name is zhangsan # % 格式化整数 s2 = 'age is %d 阅读全文
posted @ 2022-08-05 09:57 十一的杂文录 阅读(534) 评论(0) 推荐(0)
摘要: 读文件返回base64函数: void CZZUser::hidFileToBase(const char* filePath) { // 文件 转 base64 // 计算文件长度 unsigned long filesize = 0; FILE* f1; f1 = fopen(filePath, 阅读全文
posted @ 2022-06-17 15:46 十一的杂文录 阅读(341) 评论(0) 推荐(0)
摘要: 不得不bb一下, 场景:用户传base64数据,我生成PDF文件保存到指定路径下 背景:在前人写好的工程上增加这个功能,工程中有base64的.h, .cpp 文件,我试了base64编码没有问题,所以在用到解码的时候,我理所当然的认为解码函数也是没问题的,但是每次我写完文件,就发现文件报错损坏打不 阅读全文
posted @ 2022-06-17 15:41 十一的杂文录 阅读(471) 评论(0) 推荐(0)
摘要: 每次比对 .h .cpp 文件,BCompare总是默认以西欧字符编码打开文件,导致中文都变成乱码了,还需要手动的修改文件字符编码,这样才能正常的显示。非常的不方便 然后我们就需要设置默认的字符编码,设置的方法找了好久没有找到,所以这里记录一下: 1.点击【工具】【文件格式】 2.我们只需要设置 c 阅读全文
posted @ 2022-05-25 11:53 十一的杂文录 阅读(748) 评论(0) 推荐(0)
摘要: 今天客户在用Python调用我们的动态库的时候,遇到一个问题,调用动态库中的函数,函数返回的是BSTR字符串,但是客户接收到的是一个8位长度的数字。 动态库函数原型:EXTERN_C BSTR ELOAMAPI EloamGlobal_GetIdCardData(LONG flag) 解决这个问题可 阅读全文
posted @ 2022-05-24 11:34 十一的杂文录 阅读(199) 评论(0) 推荐(0)
摘要: 我们在使用谷歌浏览器浏览PDF文件时,总是会出现章节预览缩略图和工具栏,我们可以使用 参数来控制浏览器不显示出工具栏 #scrollbars=0&toolbar=0&statusbar=0 只需要在文件的后面加上参数就可以了 例:直接打开本地文件 D:a.pdf#scrollbars=0&toolb 阅读全文
posted @ 2022-05-06 10:59 十一的杂文录 阅读(1111) 评论(0) 推荐(0)
摘要: 平时我们推送网页、打开窗口都是用的 window.open,但是谷歌却不支持这种方法,也不是不支持,是可以打开窗口,但是无法将窗口移动到扩展屏上。 后面经过百度,发现了一个支持谷歌推送网页到扩展屏的方法:PresentationRequest 完整demo: 亲测有效 <!DOCTYPE html> 阅读全文
posted @ 2022-05-05 19:58 十一的杂文录 阅读(728) 评论(0) 推荐(0)
摘要: 现在打包主要是使用 innosetup 这个软件来进行打包,支持录制脚本和手动编写脚本,比较好用。 此文章主要记录手写脚本,便于后期查询,借鉴。 文档: inno setup :https://blog.csdn.net/Sakuya__/article/details/89306701 inno 阅读全文
posted @ 2022-04-20 16:54 十一的杂文录 阅读(448) 评论(0) 推荐(0)
摘要: # mytest.py class Test: def hello(self): print("this is test class hello function no params return 123") return 123 def myadd(self, x, y): print("this 阅读全文
posted @ 2022-04-02 17:30 十一的杂文录 阅读(208) 评论(0) 推荐(0)
摘要: # mytest.py def myjoin(a, b): print("num a + str b") return f"{a}=={b}" #include "Python.h" #include <iostream> using namespace std; int main(int argc 阅读全文
posted @ 2022-04-02 17:29 十一的杂文录 阅读(217) 评论(0) 推荐(0)
摘要: # mytest.py def myadd(a, b): print("this is test python print add function") return a+b #include "Python.h" #include <iostream> using namespace std; i 阅读全文
posted @ 2022-04-02 17:27 十一的杂文录 阅读(113) 评论(0) 推荐(0)
摘要: # mytest.pydef hello1(): print("this is test python print hello world 1") return "456" #include "Python.h" #include <iostream> using namespace std; in 阅读全文
posted @ 2022-04-02 17:25 十一的杂文录 阅读(597) 评论(0) 推荐(0)
摘要: # mytest.py def hello(): print("this is test python print hello world") return 123 #include "Python.h" #include <iostream> using namespace std; int ma 阅读全文
posted @ 2022-04-02 17:24 十一的杂文录 阅读(163) 评论(0) 推荐(0)
摘要: #include "Python.h" #include <iostream> using namespace std; int main(int argc, char* argv[]) { Py_Initialize(); if (!Py_IsInitialized()) { cout << "初 阅读全文
posted @ 2022-04-02 17:21 十一的杂文录 阅读(73) 评论(0) 推荐(0)
摘要: 1.进入到Python安装目录 2.将Python安装目录中的 include 和 libs 文件夹放在 C++项目中 3.设置 附加包含目录 和 附加库目录、附加依赖项(python310_d.lib) *: 如果安装的Python是64位的,注意C++编译环境设置成 x64。不然就安装32位Py 阅读全文
posted @ 2022-04-02 17:19 十一的杂文录 阅读(219) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; /*题目: 如果一个渔夫从2000年1月1日开始每三天打一次鱼,两天晒一次网,编程实现档输入2000年1月1日以后的任意一天, 输出该渔夫是在打鱼还是在晒网 */ /*分析 根据题意假设鱼的总数是x,那么第一次每人分到 阅读全文
posted @ 2022-01-25 23:29 十一的杂文录 阅读(120) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; /*题目: A、B、C、D、E5个人在某天夜里合伙去捕鱼,到第二天凌晨时都疲惫不堪,于是各自找地方睡 觉。第二天,A第一个醒来,他将鱼分成5份,把多余的一条鱼扔掉,拿走自己的一份。B第二个醒 来,也将鱼分为5份,把多余 阅读全文
posted @ 2022-01-25 22:07 十一的杂文录 阅读(231) 评论(0) 推荐(0)
摘要: 判断是否是字符串 isString (o) { //是否字符串 return Object.prototype.toString.call(o).slice(8, -1) 'String' } 判断是否是数字 isNumber (o) { //是否数字 return Object.prototype 阅读全文
posted @ 2021-12-12 23:45 十一的杂文录 阅读(40) 评论(0) 推荐(0)
摘要: 1.选择设备 device 里面显示的是设备,分割线上面是视频设备,分割线下面是音频设备 2.打开图像 options > Preview 勾选上就是打开视频,再次点击取消勾线就是关闭视频 3.设置分辨率 options > Video Capture Pin... 点击后就可以切换分辨率 4.设置 阅读全文
posted @ 2021-11-18 14:05 十一的杂文录 阅读(2924) 评论(0) 推荐(0)
摘要: .h 文件 #pragma once #include <QtWidgets/QWidget> #include "ui_xuexi.h" #include "QMouseEvent" #include "QKeyEvent" #include "QPainter" class xuexi : pu 阅读全文
posted @ 2021-11-04 23:23 十一的杂文录 阅读(910) 评论(0) 推荐(1)
摘要: 在一的基础上改造: .h 文件 #pragma once #include <QtWidgets/QWidget> #include "ui_xuexi.h" #include "QMouseEvent" #include "QKeyEvent" #include "QPainter" #inclu 阅读全文
posted @ 2021-11-04 23:02 十一的杂文录 阅读(436) 评论(0) 推荐(0)
摘要: 新建一个Qt项目,在 .h 文件中写入 #pragma once #include <QtWidgets/QWidget> #include "ui_xuexi.h" #include "QMouseEvent" #include "QKeyEvent" #include "QPainter" cl 阅读全文
posted @ 2021-11-04 22:56 十一的杂文录 阅读(341) 评论(0) 推荐(0)
摘要: Qt 设置软件窗口图标有三种方式: 一、通过资源文件,设置图标 this->setWindowIcon(QIcon(":/logo.ico")); 二、通过 pro 文件,设置图标 # Windows RC_ICONS = myico.ico # Mac ICON = myico.icns 三、使用 阅读全文
posted @ 2021-10-22 15:49 十一的杂文录 阅读(7988) 评论(0) 推荐(0)
摘要: #include "QtWidgetsApplication1.h" #include <QtWidgets/QApplication> #include <QtDebug> #include <QFile> #include <QTextStream> #include <QDateTime> # 阅读全文
posted @ 2021-10-18 22:05 十一的杂文录 阅读(1553) 评论(0) 推荐(1)
摘要: 有一座八层灯塔,每层的数量是上一层的一倍,共有765个灯,求最上层和最下层灯的数量。 #include <iostream> #include "string" using namespace std; int main() { int n = 1, m, sum, i; while (1) { m 阅读全文
posted @ 2021-10-15 17:24 十一的杂文录 阅读(63) 评论(0) 推荐(0)
摘要: 中国古代数学家张丘建在《算经》中提出著名的“百钱白鸡问题”:鸡翁一,值钱五,鸡母一,值钱三,鸡雏三,值钱一,百钱买百鸡,问翁、母、雏各几何? int x, y, z; for (x = 0; x <= 20; x++) { for (y = 0; y <= 33; y++) { for (z = 3 阅读全文
posted @ 2021-10-14 00:12 十一的杂文录 阅读(337) 评论(0) 推荐(0)
摘要: 集邮爱好者把所有的票存放在3个集邮册中,在A册内存放全部的十分之二,在B册内存放不知道是全部的七分之儿,在C册内存放303张邮票,问这位集邮爱好者的集邮总数是多少?以及每册中各有多少邮票? int x, y, z, i, sum; for (i = 0; i <= 5; i++) { if (106 阅读全文
posted @ 2021-10-14 00:11 十一的杂文录 阅读(65) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; int main(int argc, char const *argv[]) { // 乘法口诀表 for(int i=1; i<10; i++) { for(int j=1; j<=i; j++) { cout << 阅读全文
posted @ 2021-10-14 00:10 十一的杂文录 阅读(32) 评论(0) 推荐(0)
摘要: int i, a, b; for (i = 1000; i < 10000; i++) { a = i / 100; b = i % 100; if ((a + b) * (a + b) == i) cout << i << endl; } 阅读全文
posted @ 2021-10-14 00:09 十一的杂文录 阅读(138) 评论(0) 推荐(0)