Memo-Tech
Qt
install Qt on Ubuntu
- Download
*.runfile; - 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 managertracks 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-keygenssh-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 ...
随机推荐
- 使用原生方法查询指定元素是否包含指定className
如果我们要查找某个指定元素是否包含指定的className,可以使用以下方法 eg:document.getElementById('Id').classList.contains('要查询的clas ...
- 使用Pytorch在多GPU下保存和加载训练模型参数遇到的问题
最近使用Pytorch在学习一个深度学习项目,在模型保存和加载过程中遇到了问题,最终通过在网卡查找资料得已解决,故以此记之,以备忘却. 首先,是在使用多GPU进行模型训练的过程中,在保存模型参数时,应 ...
- DOS命令集
1.ASSOC显示或修改文件扩展名关联.ASSOC [.ext[=[fileType]]] .ext 指定跟文件类型关联的文件扩展名 fileType 指定跟文件扩展名关联的文件类型键 ...
- Linux系统:Centos7下搭建PostgreSQL关系型数据库
本文源码:GitHub·点这里 || GitEE·点这里 一.PostgreSQL简介 1.数据库简介 PostgreSQL是一个功能强大的开源数据库系统,具有可靠性.稳定性.数据一致性等特点,且可以 ...
- Prthon多线程和模块
Prthon多线程和模块 案例1:简化除法判断 案例2:分析apache访问日志 案例3:扫描存活主机 案例4:利用多线程实现ssh并发访问 1 案例1:简化除法判断 1.1 问题 编写mydiv.p ...
- orm层面的删除的注意事项
orm层面的删除 当两张表的外键约束设置为RESTRICT or ACTION时,在sql的层面上想要删除父级表的数据时吗,mysql会拒绝删除,但是 使用orm的delete还是会删除父级表的数据. ...
- go 反射包
一.什么是反射? 反射是用程序检查其所拥有的结构,尤其是类型的一种能力: 二.Printf Printf 的函数声明为: func Printf(format string, args ... int ...
- PHPDocumentor2.8.5 安装,使用及快速上手
PHPDocumentor当前版本是phpDocumentor-2.8.5.tgz 关于PHPDocumentor有什么用,还有其历史,我就不介绍了,直接进入正题.老版本的叫PHPDoc,从1.0开始 ...
- 28.3 api--date 日期 (日期获取、格式化)
/* * Date: 表示特定的瞬间,精确到毫秒,他可以通过方法来设定自己所表示的时间,可以表示任意的时间 * System.currentTimeMillis():返回的是当前系统时间,1970-1 ...
- C++语言实现链式栈
在之前写的C语言实现链式栈篇博文中,我已经给大家大概介绍了关于链式栈的意义以及相关操作,我会在下面给大家分享百度百科对链式栈的定义,以及给大家介绍利用C++实现链式栈的基本操作. 百度百科链式栈 链式 ...