Memo-Tech
Qt
install Qt on Ubuntu
- Download
*.run
file; - Click downloaded file to install. Note that gcc module is also required;
- Open Qt Creator and try to compile a project;
- If it reports
cannot find -lGL
, do the following things:- Open terminal and run
locate libGL
- If the library is missing, install via libgl1-mesa-dev package
- run
sudo ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/libGL.so
(choose a url listed bylocate libGL
)
- Open terminal and run
deploy on linux
https://www.jb51.net/article/164480.htm
C++
explicit
: 在类构造函数加此关键字可以禁止隐式类型转换.protected
: 此标记下的类成员不可被类外函数调用, 但可以被继承类调用.
maintenance tool
手动添加储存库要定位一个储存有QT在线安装镜像的地址,这可难坏我了,但是经过不懈努力还是被我找到了http://download.qt.io/static/mirrorlist/,显示了各国的qt镜像站点,中国有四个,我用的是中科大的站,点击HTTP会进入一个网络文件夹。
然后依次进入/online/qtsdkrepository/windows_x86/root/qt/
,在这个界面复制一下当前地址框地址
在储存库中选择临时储存库
点击添加,在编辑界面写入刚刚复制的地址http://mirrors.ustc.edu.cn/qtproject/online/qtsdkrepository/windows_x86/root/qt/添加后可以进行一次网络测速,看是否连通。
pixel & point
- a pixel is a "picture element"(pix-el) in image. A 10x10 image is made up of a set of pixels in a grid 10 wide by 10 high, totaling 100 pixels.
- a point(pt) is \(\frac{1}{72}\)inch
- If a image is 72ppi(pixel per inch), then 1pt = 1 pixel.
- 理想情况下, \(1pt = \frac{1}{72}inch\). 但point的实际尺寸由系统决定, 例如, 当系统调整缩放比例时, \(1pt\)的实际大小也会随之改变.
- 在Qt中, 设备的DPI(Dot Per Inch, 约等于Pixel Per Inch, 即PPI)可以通过
QScreen
类获取.physicalDotsPerInch
给出物理DPI, 而logicalDotsPerInch
给出逻辑DPI(字体的pointSize
就是由逻辑DPI计算得到的). 一般使用逻辑DPI.
QTextDocument
https://www.cnblogs.com/techiel/p/8058430.html
QTextCursor
- access and modify
QTextDocument
; - mimic the behavior of a cursor in a text editor;
- current character: the character immediately before the cursor
position()
; - current block: the block that contains the cursor
position()
; - selection: the text between
anchor()
andposition()
QSessionManager
session manager
tracks a session;- session = {(application, state)}
- state = {documents opened, position and size, etc.}
QT_BEGIN_NAMESPACE
//qglobal.h
# define QT_BEGIN_NAMESPACE namespace QT_NAMESPACE {
# define QT_END_NAMESPACE }
Qt 随机数
#include <QDateTime>
int main () {
qsrand(QDateTime::currentDateTime().toTime_t());
}
添加图标
- 将
.ico
文件添加到对应的文件夹内 - 在
.pro
文件中添加RC_ICONS = yourIcon.ico
latex
pandoc
pandoc is a powerful tool for markdown - latex
conversion.
markdown to latex
pandoc example.md -o example.tex --listings
--listings
will produce syntax highlighting for code blocks.
--number-sections
or -N
will number the sections
depth of TOC and section number
\setcounter{tocdepth}{1} %stop at section
\setcounter{secnumdepth}{3} %stop at subsubsection
\begin{document}
%...
\end{document}
name | depth |
---|---|
part | -1 |
chapter | 0 |
section | 1 |
subsection | 2 |
subsubsection | 3 |
paragraph | 4 |
subparagraph | 5 |
TikZ/PGF
mathcha.io
Drawing a binary tree
% use lualatex to compile
\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{graphs,graphdrawing,arrows.meta}
\usegdlibrary{trees}
\begin{document}
\begin{tikzpicture}[>=Stealth]
\graph[binary tree layout,nodes={circle, draw}]{
a -> {
b -> {
c -> {
d -> { e, f },
/ %/表示空结点
},
h -> { i, j }
},
k -> {
l -> {
m -> { n, o },
p -> { q, } %缺省表示结点不存在
},
s -> {
v -> {w, x},
y -> {z}
}
}
}
};
\end{tikzpicture}
\end{document}
see Drawing binary trees with LaTeX labels
线条控制
调整段落边距
\begin{adjustwidth}{1cm}{0cm}
% text
\end{adjustwidth}
ubuntu/linux杂记
vimrc
set nu
set ts=4 sw=4 smarttab cin
syntax on
set nobackup
set noswapfile
map <F6> :call C_R()<CR>
func! C_R()
exec "w"
exec "!g++ -std=c++11 % -o %<"
exec "! ./%<"
endfunc
map <F7> :call C_R_T()<CR>
func! C_R_T()
exec "w"
exec "!g++ -std=c++11 % -o %<"
exec "! ./%< < ./%<.in"
endfunc
用nohup在服务器上后台运行程序
nohup [command] &
注意此命令执行后不能直接关闭终端, 而应当用exit
手动终止连接后关闭终端.
如何创建自己的bash命令
- 在
$HOME
下创建一个bin
文件夹 - 在
~/.bashrc
中添加export PATH=$PATH":$HOME/bin"
. ~/.bashrc
- 在
bin
中创建脚本,格式如:
#!/bin/bash
[script]
chmod +x [name of your script]
在目标服务器上执行批量的命令
#!/bin/bash
ssh root@192.168.0.23 << remotessh
killall -9 java
cd /data/apache-tomcat-7.0.53/webapps/
exit
remotessh
远程执行的内容在<< remotessh
至remotessh
之间, remotessh可以随便修改成其他形式. exit退出远程节点. 如果不想日志文件在本机出现可以修改配置
ssh root@192.168.0.23 > /dev/null 2>&1 < < remotessh
bash: passing parameters
- Basically, if you want your customized bash command to accept some parameters, some files for example, put a reference to them using
"$1"
,"$2"
, etc. Note that bash allows autocomplete of filenames itself. - We can use
<
or>
to redirect stdin and stdout for c++ executable. We should useecho
, however, in order to pass some input to our executable. For instance,echo 1 "hello" 2 > ./your_executable
.
wget
download a full site : wget --random-wait -r -p -e robots=off -U mozilla www.example.com
Anbox
见官方文档
PDF工具
需要安装poppler-utils
包
desciption of poppler-utils
Poppler is a PDF rendering library based on Xpdf PDF viewer.
This package contains command line utilities (based on Poppler) for getting information of PDF documents, convert them to other formats, or manipulate them:
- pdfdetach -- lists or extracts embedded files (attachments)
- pdffonts -- font analyzer
- pdfimages -- image extractor
- pdfinfo -- document information
- pdfseparate -- page extraction tool
- pdfsig -- verifies digital signatures
- pdftocairo -- PDF to PNG/JPEG/PDF/PS/EPS/SVG converter using Cairo
- pdftohtml -- PDF to HTML converter
- pdftoppm -- PDF to PPM/PNG/JPEG image converter
- pdftops -- PDF to PostScript (PS) converter
- pdftotext -- text extraction
- pdfunite -- document merging tool
LaTex
sudo apt-get install texlive-full
sudo apt-get install texlive-xetex
sudo apt-get install texlive-lang-chinese
//sudo apt-get install texstudio
win10下linux子系统
安装
- 开启开发者模式
- 通过Win10任务栏中的Cortana搜索框搜索打开“启用或关闭Windows功能”,向下滚动列表,即可看到“适用于Linux的Windows子系统(Beta)”项。打开。
- 在应用商店下载ubuntu18
文件浏览器
浏览当前文件夹explorer.exe .
终端美化——cmder
- 下载
cmder-mini.zip
并解压 - 将
Cmder.exe
所在文件夹添加到环境变量中 - 在
cmd
中键入Cmder.exe /REGISTER ALL
以在任意文件夹下右键打开cmd - 设置cmder:
- General: scheme改为
xterm
,startup task改为{WSL::bash}
- Appearance: 勾选
Hide caption always
- Tab bar: 去选
Tabs on bottom
,Tab double click actions - Tab bar改为Open new shell
- General: scheme改为
linux服务器密钥
ssh-keygen
ssh-copy-id -i ~/.ssh/*.pub root@?.?.?.?
Ubuntu服务器建站
安装wordpress: https://www.zhihu.com/question/35279626
win10装机
工具:微PE(00002-20190618-WePE_64_V2.0.exe
),win10iso文件(00002-20190618-Win10_1903_V1_Chinese(Simplified)_x64.iso
)
- 下载微PE,插上U盘并将微PE安装到U盘上。微PE安装程序不要放在U盘上。
- 将iso文件拖入U盘内
- 重启进入PE系统
- 格式化C盘
- 用
CGI备份还原
或Windows安装器
安装。其中,Windows安装器
中,引导驱动器安装在一个百兆级别的小盘里(比如Z盘),安装磁盘为C盘 - 上一步完成后,关机,拔出U盘,开机,进入win10系统设置界面
- 使用
驱动精灵
快速安装必要驱动
开机密码设置:设置
-账户
-账户设置
-改用本地账户登录
密码与安全
00001-20190613-echo.cpp
提供文档加密算法,加密方式由个人秘钥唯一决定。主要用于对密码生成算法代码的加密。00001-20190613-gen_enc
解密后可以得到核心的密码生成算法,整合了一代和二代的算法。- 待解决:将rand函数源代码整合到代码中,加强程序的跨平台适应性
生成伪单词
I split a word into syllables, and a syllable into a consonant and a vowel, or a single vowel sometimes, if it is the first syllable of a word.
Both the consonant and vowel are defined in a generalized way:
- a consonant is a string composed of consonant characters
- a vowel is basically a string composed of vowel characters, including a,e,i,o,u,y, with or without an appendix composed of consonant characters
The criterion for judgement is based on pronunciation rule.
y is a special character which can both be a vowel or a consonant.
- I assert y a vowel if and only if it is not the first character and if it is preceded by a consonant
- I assert a string of consonant characters a consonant if and only if it is the maximal prefix of some word satisfying the preceding definition. Note that y should be considered specially
- I assert a string of consonant characters a appendix of a vowel, if and only if it is the maximal appendix of some word preceded by a vowel
In order to generate an artificial word,
- I wish to get a list of vowels, of consonants, of vowel appendices, alongside the probability of each element
- In the same time, I have to determine the probability that a vowel has an appendix composed of consonant characters
- I also have to determine the probability that a word is leaded by single vowel
Task 1 & 3 are straightforward: stick to the definition and do an analysis on the list of English words.
Task 2 requires splitting words into syllables using the outcome of Task 1. I first split a word into vowels and substrings of consonant characters. If a substring is at the back of the word, mark it an appendix. As for those between two vowels, scan for the longest appendix that form a consonant, by inspecting the consonant list. Once it is done, the rest of the substring is marked as an appendix. By doing so, some new appendices could be found.
生成随机数
I decide to settle 3 main problems:
- the aimed algorithm must accept a sequence of 0 and 1, and generate an infinite sequence of 0 and 1 which is most random-like
- I must determine whether or not a sequence is random-like. A sequence 0101..., for example, is definitely not random-like
- It has to be made sure that the outcome strongly depend on the income. That is, the algorithm must be an injective function
Above was my initial aspiration. Yet after some inquiry in depth, I recognized that the whole thing itself forms a systematic subject, indicating that I'd better give up my daydreams at least for now. Nevertheless, my interest about the related subjects has been aroused.
A temporary random system is based on the knowledge of primitive root.
文档加密
模拟手写体
字体 陈旭东字体
Sub 字体修改()
'
' 字体修改 宏
'
Dim R_Character As Range
Dim FontSize(5)
' 字体大小在5个值之间进行波动,可以改写
FontSize(1) = "14"
FontSize(2) = "15"
FontSize(3) = "16"
FontSize(4) = "17"
FontSize(5) = "18"
Dim FontName(1)
'字体名称在三种字体之间进行波动,可改写,但需要保证系统拥有下列字体
FontName(1) = "CXD6763_Newest"
'FontName(2) = "萌妹子体"
'FontName(3) = "李国夫手写体"
Dim ParagraphSpace(5)
'行间距 在一定以下值中均等分布,可改写
ParagraphSpace(1) = "23"
ParagraphSpace(2) = "23.5"
ParagraphSpace(3) = "24"
ParagraphSpace(4) = "24.5"
ParagraphSpace(5) = "25"
'不懂原理的话,不建议修改下列代码
For Each R_Character In ActiveDocument.Characters
VBA.Randomize
'R_Character.Font.Name = FontName(Int(VBA.Rnd * 3) + 1)
R_Character.Font.Name = "CXD6763_Newest"
R_Character.Font.Size = FontSize(Int(VBA.Rnd * 5) + 1)
R_Character.Font.Position = Int(VBA.Rnd * 3) + 1
R_Character.Font.Spacing = 0
Next
Application.ScreenUpdating = True
For Each Cur_Paragraph In ActiveDocument.Paragraphs
Cur_Paragraph.LineSpacing = ParagraphSpace(Int(VBA.Rnd * 5) + 1)
Next
Application.ScreenUpdating = True
End Sub
注意 宏运行完后要把字体改为紧缩-2磅,以上操作都在office2019下完成。
浏览器视频无法播放?
禁用硬件加速。以Opera为例,在搜索框中键入opera://flags
,禁用Hardware-accelerated video decode
。
浏览器插件
- Install Chrome Extensions - 作者: Opera Software
- 简悦 - SimpRead - 作者: Kenshin Wang
- FVD Video Downloader - 作者: NimbusWeb
Memo-Tech的更多相关文章
- 25 highest paying companies: Which tech co outranks Google, Facebook and Microsoft?
Tech companies dominate Glassdoor’s ranking of the highest paying companies in the U.S., snagging 20 ...
- memo的一般方法
str := '好时代卡卡卡的水平佛单师傅开锁'; Memo1.Lines.Add(str); // 在最后加一行字符串 Memo1.Lines.Delete(x); // 删除x+1行字符串 Mem ...
- 转 Microsoft's Objective-C tech started on BlackBerryOS, Tizen
今天看到了这个 Microsoft's Objective-C tech started on BlackBerryOS, Tizen 见原文 http://www.osnews.com/story ...
- Atitit 编程语言知识点tech tree v2 attilax大总结
Atitit 编程语言知识点tech tree v2 attilax大总结 大分类中分类小分类知识点原理与规范具体实现(javac#里面的实现phpjsdsl(自己实现其他语言实现 类与对象实现对象实 ...
- 修复 XE8 Win 平台 Firemonkey Memo 卷动后会重叠的问题
问题:XE8 Firemonkey 在 Windows 平台 Memo 卷动时,在第 1 , 2 行会产生重叠现象. 更新:XE8 update 1 已经修复这个问题,无需再使用下面方法. 修改前: ...
- 修正 Memo 設定為 ReadOnly 後, 無法有複製的功能
问题:当 Memo 設定為 ReadOnly = True 後, 选取一段文字后,無法有複製的功能. 适用:XE6 Android 系统(目前 iOS 还找不到方法) 修正方法: 请将源码 FMX.P ...
- TStringList TMemo Text与Add赋值的区别 Memo.Text赋值高度注意事项,不得不知的技巧。
Memo.Text赋值高度注意事项,不得不知的技巧. list := TStringList.Create; list.Text:= str: list.Count; list.Clear; l ...
- ORA-04031 With Leak in "OBJ STAT MEMO" Allocations Seen in V$SGASTAT on 10.2.0.5 (文档 ID 1350050.1)
APPLIES TO: Oracle Server - Enterprise Edition - Version: 10.2.0.5<max_ver> and later [Relea ...
- Tech Stuff - Mobile Browser ID (User-Agent) Strings
Tech Stuff - Mobile Browser ID (User-Agent) Strings The non-mobile stuff is here (hint: you get jerk ...
- 第一部分实现功能:使用一个TabControl和一个Memo和TDictionary类实现文本临时存储
效果图: 一期功能概要: a.双击tab关闭tab,双击tab右边空白添加tab(标题为以hhnnsszzz的时间格式命名) b.切换tab将数据存入dictionary,key为标题,value为m ...
随机推荐
- 《Three.js 入门指南》3.1.1 - 基本几何形状 -多面体
3.1 基本几何形状 多面体 构造函数 正四面体(TetrahedronGeometry).正八面体(OctahedronGeometry).正二十面体(IcosahedronGeometry)的构造 ...
- PTA | 1012 数字分类 (20分)
给定一系列正整数,请按要求对数字进行分类,并输出以下 5 个数字: A1 = 能被 5 整除的数字中所有偶数的和: A2 = 将被 5 除后余 1 的数字按给出顺序进行交错求和,即计算 n1−n2+n ...
- git基础使用合集
1.git初始化仓库-git init git init 创建一个.git目录,跟踪管理版本 2.git 添加-git add git add xxx.xxx 添加到暂缓区里 git add * 添加 ...
- centos 64位安装jpeg-6b
先安装libtool和libtool-ltdl-devel 用find命令查找config.sub和config.guess文件 find / -name config.sub find / -nam ...
- JavaScript 入门 (一)
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- Oacle学习-01Oracle的安装
@ 目录 下载Oracle 安装Oracle 安装plsqldeveloper客户端 下载Oracle 官方下载地址:Oracle下载 网盘地址:链接:https://pan.baidu.com/s/ ...
- 列表的增加、修改、删除; list方法降序排序;练习注册
stus='xiaoming,xiaohei,xiaobai' #数组.列表.list,array stus = ['xiaoming','xiaohei','xiaobai' ] #列表# 0 1 ...
- CH5105 Cookies (线性dp)
传送门 解题思路: 贪心的想,贪婪值越大的孩子应该分得更多的饼干,那么先sort一遍在此基础上进行dp.最直观的方向,可以设dp[i][j]为前i个孩子一共分得j块饼干的怨恨最小值.然后转移第i+1个 ...
- centOS7常用操作命令
大多和DOS命令差不多 文件与目录操作 命令 解析 cd /home 进入 ‘/home’ 目录 cd .. 返回上一级目录 cd ../.. 返回上两级目录 cd - 返回上次所在目录 cp fil ...
- Python 中如何查看进行反汇编
dis模块 Python 反汇编是通过 dis 这个模块来查看的,一般有两种方式可以用来查看 方式一: 在命令行中使用 dis 查看 >>> def test ...