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 by locate libGL)

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() and position()

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());
}

添加图标

  1. .ico文件添加到对应的文件夹内
  2. .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命令

  1. $HOME下创建一个bin文件夹
  2. ~/.bashrc中添加export PATH=$PATH":$HOME/bin"
  3. . ~/.bashrc
  4. bin中创建脚本,格式如:
#!/bin/bash
[script]
  1. 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

远程执行的内容在<< remotesshremotessh之间, remotessh可以随便修改成其他形式. exit退出远程节点. 如果不想日志文件在本机出现可以修改配置

ssh root@192.168.0.23 > /dev/null 2>&1 < < remotessh

bash: passing parameters

  1. 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.
  2. We can use < or > to redirect stdin and stdout for c++ executable. We should use echo, 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子系统

安装

  1. 开启开发者模式
  2. 通过Win10任务栏中的Cortana搜索框搜索打开“启用或关闭Windows功能”,向下滚动列表,即可看到“适用于Linux的Windows子系统(Beta)”项。打开。
  3. 在应用商店下载ubuntu18

文件浏览器

浏览当前文件夹explorer.exe .

终端美化——cmder

  1. 下载cmder-mini.zip并解压
  2. Cmder.exe所在文件夹添加到环境变量中
  3. cmd中键入Cmder.exe /REGISTER ALL以在任意文件夹下右键打开cmd
  4. 设置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

linux服务器密钥

  1. ssh-keygen
  2. 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)

  1. 下载微PE,插上U盘并将微PE安装到U盘上。微PE安装程序不要放在U盘上。
  2. 将iso文件拖入U盘内
  3. 重启进入PE系统
  4. 格式化C盘
  5. CGI备份还原Windows安装器安装。其中,Windows安装器中,引导驱动器安装在一个百兆级别的小盘里(比如Z盘),安装磁盘为C盘
  6. 上一步完成后,关机,拔出U盘,开机,进入win10系统设置界面
  7. 使用驱动精灵快速安装必要驱动

开机密码设置设置-账户-账户设置-改用本地账户登录

密码与安全

  • 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.

  1. I assert y a vowel if and only if it is not the first character and if it is preceded by a consonant
  2. 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
  3. 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,

  1. I wish to get a list of vowels, of consonants, of vowel appendices, alongside the probability of each element
  2. In the same time, I have to determine the probability that a vowel has an appendix composed of consonant characters
  3. 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:

  1. 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
  2. I must determine whether or not a sequence is random-like. A sequence 0101..., for example, is definitely not random-like
  3. 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

浏览器插件

  1. Install Chrome Extensions - 作者: Opera Software
  2. 简悦 - SimpRead - 作者: Kenshin Wang
  3. FVD Video Downloader - 作者: NimbusWeb

Memo-Tech的更多相关文章

  1. 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 ...

  2. memo的一般方法

    str := '好时代卡卡卡的水平佛单师傅开锁'; Memo1.Lines.Add(str); // 在最后加一行字符串 Memo1.Lines.Delete(x); // 删除x+1行字符串 Mem ...

  3. 转 Microsoft's Objective-C tech started on BlackBerryOS, Tizen

    今天看到了这个  Microsoft's Objective-C tech started on BlackBerryOS, Tizen 见原文 http://www.osnews.com/story ...

  4. Atitit 编程语言知识点tech tree v2 attilax大总结

    Atitit 编程语言知识点tech tree v2 attilax大总结 大分类中分类小分类知识点原理与规范具体实现(javac#里面的实现phpjsdsl(自己实现其他语言实现 类与对象实现对象实 ...

  5. 修复 XE8 Win 平台 Firemonkey Memo 卷动后会重叠的问题

    问题:XE8 Firemonkey 在 Windows 平台 Memo 卷动时,在第 1 , 2 行会产生重叠现象. 更新:XE8 update 1 已经修复这个问题,无需再使用下面方法. 修改前: ...

  6. 修正 Memo 設定為 ReadOnly 後, 無法有複製的功能

    问题:当 Memo 設定為 ReadOnly = True 後, 选取一段文字后,無法有複製的功能. 适用:XE6 Android 系统(目前 iOS 还找不到方法) 修正方法: 请将源码 FMX.P ...

  7. TStringList TMemo Text与Add赋值的区别 Memo.Text赋值高度注意事项,不得不知的技巧。

    Memo.Text赋值高度注意事项,不得不知的技巧. list := TStringList.Create;  list.Text:= str:  list.Count; list.Clear;  l ...

  8. 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 ...

  9. 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 ...

  10. 第一部分实现功能:使用一个TabControl和一个Memo和TDictionary类实现文本临时存储

    效果图: 一期功能概要: a.双击tab关闭tab,双击tab右边空白添加tab(标题为以hhnnsszzz的时间格式命名) b.切换tab将数据存入dictionary,key为标题,value为m ...

随机推荐

  1. python:匿名函数lambda

    看个例子: a=list(map(lambda x:x*x,(1,2,3))) print(a) 输出:[1, 4, 9] lambda实际上就是匿名函数,相当于: def f(x): return ...

  2. STM32CubeMX的安装

    1.下载STM32CubeMX 在ST的官方网站上下载STM32CubeMXXX软件的安装包. 下载的安装包如下图所示.双击SetupSTM32CubeMX-5.0.1.exe. 安装STM32Cub ...

  3. pywinauto之PC端windows自动化测试

    pywinauto是一个用纯Python编写的GUI自动化库,并为Windows GUI精心开发.最简单的是,它允许您将鼠标和键盘操作发送到Windows和Linux上的对话框和控件,而到目前为止,仅 ...

  4. PHP的运行方式(SAPI)

    PHP 常量 PHP_SAPI 具有和 php_sapi_name() 相同的值. define('IS_CGI',(0 === strpos(PHP_SAPI,'cgi') || false !== ...

  5. 【数据库】MySQL数据库(四)

    一.对数据的操作(详细版) 1.添加数据 1> insert into 表名 (字段1,字段2...) values (值1,值2...); 2> insert into 表名 (字段1, ...

  6. 给定一个整数数组 nums 和一个目标值 target,求nums和为target的两个数的下表

    这个是来自力扣上的一道c++算法题目: 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标. 你可以假设每种输入只会对应一个答案 ...

  7. 37.3 net--TcpDemo1 大小写转换

    需求:使用TCP协议发送数据,并将接收到的数据转换成大写返回 启动方式:先打开服务端,再打开客户端 客户端 package day35_net_网络编程.tcp传输; import java.io.I ...

  8. python-从酷狗下载爬取自己想要的音乐-可以直接拿来体验哟

    因为最近发现咪咕音乐版权好多,当时我就在想是不是可以爬取下来,然后花了一些时间,发现有加密,虽然找到了接口,但是只能手动下载VIP歌曲,对于我们学IT的人来说,这是不能忍的,于是就懒得去解密抓取了,但 ...

  9. Angular input / ion-input ion-searchbar 实现软件盘换行 改 搜索 并且触发搜索方法 Android iOS适用

    Angular 实现软件盘 换行 改 搜索 并且除非 搜索方法:    Form 必须有 action="javascript: return true;”   input / ion-in ...

  10. .NET Core技术研究-主机

    前一段时间,和大家分享了 ASP.NET Core技术研究-探秘Host主机启动过程 但是没有深入说明主机的设计.今天整理了一下主机的一些知识,结合先前的博文,完整地介绍一下.NET Core的主机的 ...