Qt导出PDF(QPainter、QTextDocument)

// 添加打印支持 QT += printsupport // 包含头文件 #include <QDesktopServices> #include <QFileDialog> #include <QTextBlock> #include <QTextDocument> #include

三味线 Published on 2020-07-19

python requests 请求传参数空格处理

import json import urllib import requests param1 = {'name': 'hello world'} param2 = urllib.parse.urlencode({'name': 'hello world'}, quote_via=urllib.p

三味线 Published on 2020-06-06

PGSQL COPY命令导入/导出数据

PGSQL中可使用COPY命令来导入/导出数据,这里以CSV文件为例。 导出数据 SQL Shell执行: COPY table_name (col1,col2,col3) TO 'path_name.csv' CSV HEADER; 如果表格使用了分表,需使用select获取数据: COPY (s

三味线 Published on 2020-05-14

Python发送邮件

#!/usr/bin/python # -*- coding: UTF-8 -*- import smtplib from email.mime.text import MIMEText from email.header import Header # 第三方 SMTP 服务 mail_host

三味线 Published on 2020-04-27

js forEach中的continue,break

Lodash 中的 forEach 函数 var array = ["a", "b", "c", "d"]; _.forEach(array, function (item) { if (item == "a") { return true; // continue

三味线 Published on 2020-03-27

js中写文件到远程共享文件夹(SmbFile|net use|mount.cifs)

重构代码时遇到的问题,原Java代码用的SmbFile及相关库,现在要改在js中实现; 1. Windows下可以使用net use命令 net use <local_dir> <remote_dir> <password> /user:<username> net use Z: \\10.3.3

三味线 Published on 2020-02-09

PGSQL UPSERT使用

PG 9.5开始支持的特性,根据约束,存在则更新,不存在则插入; 使用某字段约束: INSERT INTO distributors (did, dname) VALUES (8, 'Anvil Distribution') ON CONFLICT (did) DO UPDATE SET dname

三味线 Published on 2020-01-14

CentOS连接Sql Server 驱动安装

一、使用微软的 Microsoft ODBC Driver for SQL Server sudo su #Download appropriate package for the OS version #Choose only ONE of the following, corresponding

三味线 Published on 2020-01-03

js 字符串作为函数运行

1. new Function var test = new Function("(function(){console.log('hello!')})()"); 会在外面再包一层函数,获取不到返回值: 2. eval var test = eval("(

三味线 Published on 2019-08-05

QTableView文字换行

使用QStyledItemDelegate代理手动绘制文字 #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QStyledItemDelegate> class QTableView; clas

三味线 Published on 2019-07-17
Previous Next