Skip to content

Instantly share code, notes, and snippets.

SQLite写是锁整个数据库的,在写着数据库的时候,不能进行其它操作,同时读没有问题。
Sqlite 插入速度慢,平均插入一条速度在110ms左右,所以需要优化:
法1)
//提升读写速度
m_database.exec("PRAGMA synchronous = OFF");
m_database.exec("PRAGMA journal_mode = MEMORY");
1
2
@gastonfeng
gastonfeng / 1555826334.txt
Last active December 5, 2023 08:42
PPA 镜像加速
PPA 镜像加速
2018年7月26日 BY : TATERLI
这里有USTC的反向代理.
https://lug.ustc.edu.cn/wiki/mirrors/help/revproxy
只要一句话,全替换成USTC加速的PPA.再也不担心了.
1
sudo find /etc/apt/sources.list.d/ -type f -name "*.list" -exec  sed  -i.bak -r  's#deb(-src)?\s*http(s)?://ppa.launchpad.net#deb\1 http\2://launchpad.proxy.ustclug.org#ig' {} \;
@gastonfeng
gastonfeng / 1555826128.txt
Last active April 22, 2019 10:10
ubuntu install lastest git
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
d={[]:”str”,{}:”11”}
TypeError: unhashable type: ‘dict’
python不支持dict的key为list或dict类型,因为list和dict类型是unhashable(不可哈希)的
@gastonfeng
gastonfeng / parseInt
Last active April 22, 2019 10:11
QML语法
可以使用内置的JavaScript parseInt()函数 - 例如
@
text:parseInt(textInput1.text)+ 1
@
对于常规启动,GPIO0和GPIO2都需要悬空,或者通过电阻上拉到Vcc。如果在常规启动时GPIO0或GPIO2为低电平,则无法启动。
#
# deb cdrom:[Ubuntu-Server 16.04.3 LTS _Xenial Xerus_ - Release amd64 (20170801)]/ xenial main restricted
# deb cdrom:[Ubuntu-Server 16.04.3 LTS _Xenial Xerus_ - Release amd64 (20170801)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
@gastonfeng
gastonfeng / install-odoo-saas.sh
Created October 23, 2017 16:07 — forked from bassn/install-odoo-saas.sh
install odoo from source
#!/bin/bash
################################################################################################
# Fully automated script to install Odoo and Odoo SaaS Tool (tested on a fresh Ubuntu 14.04 LTS)
# * Install & configure last stable version of nginx
# * Install & configure last stable version of postgresql
# * Install & configure Odoo
# * Configure automated backup of Odoo databases
# * Optional: Install & configure Odoo SaaS Tool
# * Optional: Background installation: $ nohup ./odoo_install.sh > nohup.log 2>&1 </dev/null &
################################################################################################
@gastonfeng
gastonfeng / qq_message_xml.md
Last active April 8, 2019 17:13 — forked from koukuko/qq_message_xml.md
发送XML消息的格式

QQ的XML消息格式整理

QQ可以使用xml的方式发送消息,以下为了方便描述统称为卡片。

发送方式

通过机器人的API进行发送xml即可,但是如果选择发送xml,那么其他如[image=xxx][@xxx]这些命令就不可使用了。整个消息只有XML。

基本结构

xml主要由msg,item,source这3部分组成

<?xml version='1.0' encoding='utf-8' standalone='yes'?>
@gastonfeng
gastonfeng / 0_reuse_code.js
Created July 12, 2016 17:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console