commit 3de0fd9fcbde648b2cb728e4a52470d6cc8e59d0 Author: taynpg Date: Fri Mar 8 13:36:39 2024 +0800 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e257658 --- /dev/null +++ b/.gitignore @@ -0,0 +1,34 @@ +# ---> C++ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + diff --git a/README.md b/README.md new file mode 100644 index 0000000..a5db724 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# 3rd-use + +简要记录一些三方工具的常用使用方法。 \ No newline at end of file diff --git a/clang-format.txt b/clang-format.txt new file mode 100644 index 0000000..6e90f9e --- /dev/null +++ b/clang-format.txt @@ -0,0 +1,309 @@ +# https://clang.llvm.org/docs/ClangFormatStyleOptions.html +# https://www.bbsmax.com/A/VGzlMjexJb/ +# 链接:https://www.cnblogs.com/oloroso/p/14699855.html +# 语言: None, Cpp, Java, JavaScript, ObjC, Proto, TableGen, TextProto +Language: Cpp + +BasedOnStyle: LLVM + +# 访问说明符(public、private等)的偏移 +AccessModifierOffset: -4 + +# 左括号(左圆括号、左尖括号、左方括号)后的对齐: Align, DontAlign, AlwaysBreak(总是在左括号后换行) +AlignAfterOpenBracket: Align + +# 连续赋值时,对齐所有等号 +AlignConsecutiveAssignments: true + +# 连续声明时,对齐所有声明的变量名 +AlignConsecutiveDeclarations: true + +# 对齐连续位域字段的风格 +# AlignConsecutiveBitFields: AcrossEmptyLinesAndComments + +# 对齐连续宏定义的风格 +# AlignConsecutiveMacros: Consecutive #clang-format 12 + +# 用于在使用反斜杠换行中对齐反斜杠的选项 +AlignEscapedNewlines: Left + +# 水平对齐二元和三元表达式的操作数 +AlignOperands: Align + +# 对齐连续的尾随的注释 +AlignTrailingComments: true + +# 如果函数调用或带括号的初始化列表不适合全部在一行时 +# 允许将所有参数放到下一行,即使BinPackArguments为false +AllowAllArgumentsOnNextLine: true + +# 允许构造函数的初始化参数放在下一行 +AllowAllConstructorInitializersOnNextLine: true + +# 允许函数声明的所有参数在放在下一行 +AllowAllParametersOfDeclarationOnNextLine: true + + +# 允许短的块放在同一行(Always 总是将短块合并成一行,Empty 只合并空块) +AllowShortBlocksOnASingleLine: Empty + +# 允许短的case标签放在同一行 +AllowShortCaseLabelsOnASingleLine: true + +# 允许短的函数放在同一行: None, InlineOnly(定义在类中), Empty(空函数), Inline(定义在类中,空函数), All +AllowShortFunctionsOnASingleLine: Inline + +# 允许短的if语句保持在同一行 +AllowShortIfStatementsOnASingleLine: true + +# 允许短的循环保持在同一行 +AllowShortLoopsOnASingleLine: true + +# 总是在定义返回类型后换行(deprecated) +AlwaysBreakAfterDefinitionReturnType: None + +# 总是在返回类型后换行: None, All, TopLevel(顶级函数,不包括在类中的函数), +# AllDefinitions(所有的定义,不包括声明), TopLevelDefinitions(所有的顶级函数的定义) + +# 函数声明返回类型后是否换行(None 自动,All全部,TopLevel...) +AlwaysBreakAfterReturnType: None + +# 总是在多行string字面量前换行 +AlwaysBreakBeforeMultilineStrings: false + +# 总是在template声明后换行 +AlwaysBreakTemplateDeclarations: false + +# false表示函数实参要么都在同一行,要么都各自一行 +BinPackArguments: false + +# false表示所有形参要么都在同一行,要么都各自一行 +BinPackParameters: true + +# 大括号换行,只有当 BreakBeforeBraces 设置为Custom时才有效 +BraceWrapping: + # case 语句后面 + AfterCaseLabel: true + # class定义后面 + AfterClass: true + # 控制语句后面 + AfterControlStatement: Never + # enum定义后面 + AfterEnum: true + # 函数定义后面 + AfterFunction: true + # 命名空间定义后面 + AfterNamespace: false + # ObjC定义后面 + AfterObjCDeclaration: false + # struct定义后面 + AfterStruct: true + # union定义后面 + AfterUnion: true + # extern 导出块后面 + AfterExternBlock: false + # catch之前 + BeforeCatch: true + # else之前 + BeforeElse: true + # 缩进大括号(整个大括号框起来的部分都缩进) + IndentBraces: false + # 空函数的大括号是否可以在一行 + SplitEmptyFunction: false + # 空记录体(struct/class/union)的大括号是否可以在一行 + SplitEmptyRecord: false + # 空名字空间的大括号是否可以在一行 + SplitEmptyNamespace: false + +# 在二元运算符前换行: None(在操作符后换行), NonAssignment(在非赋值的操作符前换行), All(在操作符前换行) +BreakBeforeBinaryOperators: None + +# 在大括号前换行: Attach(始终将大括号附加到周围的上下文), Linux(除函数、命名空间和类定义,与Attach类似), +# Mozilla(除枚举、函数、记录定义,与Attach类似), Stroustrup(除函数定义、catch、else,与Attach类似), +# Allman(总是在大括号前换行), GNU(总是在大括号前换行,并对于控制语句的大括号增加额外的缩进), WebKit(在函数前换行), Custom +# 注:这里认为语句块也属于函数 + +# 大括号的换行规则 +BreakBeforeBraces: Custom + +# 三元运算操作符换行位置(?和: 在新行还是尾部) +BreakBeforeTernaryOperators: true + +# 在构造函数的初始化列表的逗号前换行 +BreakConstructorInitializersBeforeComma: false + +# 要使用的构造函数初始化式样式 +BreakConstructorInitializers: BeforeComma + +# 每行字符的限制,0表示没有限制 +ColumnLimit: 100 + +# 描述具有特殊意义的注释的正则表达式,它不应该被分割为多行或以其它方式改变 +# CommentPragmas: '' + +# 如果为true,则连续的名称空间声明将在同一行上。如果为false,则在新行上声明每个名称空间。 +CompactNamespaces: false + +# 构造函数的初始化列表要么都在同一行,要么都各自一行 +ConstructorInitializerAllOnOneLineOrOnePerLine: false + +# 构造函数的初始化列表的缩进宽度 +ConstructorInitializerIndentWidth: 4 + +# 延续的行的缩进宽度 +ContinuationIndentWidth: 4 + +# 去除C++11的列表初始化的大括号{后和}前的空格 +Cpp11BracedListStyle: true + +# 继承最常用的指针和引用的对齐方式 +DerivePointerAlignment: false + +# 关闭格式化 +DisableFormat: false + +# 自动检测函数的调用和定义是否被格式为每行一个参数(Experimental) +ExperimentalAutoDetectBinPacking: false + +# 如果为true,则clang格式会为短名称空间添加缺少的名称空间结尾注释,并修复无效的现有名称结束注释 +FixNamespaceComments: true + +# 需要被解读为foreach循环而不是函数调用的宏 +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] + +# 对#include进行排序,匹配了某正则表达式的#include拥有对应的优先级,匹配不到的则默认优先级为INT_MAX(优先级越小排序越靠前), +# 可以定义负数优先级从而保证某些#include永远在最前面 +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 2 + - Regex: '^(<|"(gtest|isl|json)/)' + Priority: 3 + - Regex: '.*' + Priority: 1 + +# 缩进case标签 +IndentCaseLabels: false + +# 要使用的预处理器指令缩进样式 +IndentPPDirectives: AfterHash + +# 缩进宽度 +IndentWidth: 4 + +# 函数返回类型换行时,缩进函数声明或函数定义的函数名 +IndentWrappedFunctionNames: false + +# 保留在块开始处的空行 +KeepEmptyLinesAtTheStartOfBlocks: true + +# 开始一个块的宏的正则表达式 +MacroBlockBegin: '' + +# 结束一个块的宏的正则表达式 +MacroBlockEnd: '' + +# 连续空行的最大数量 +MaxEmptyLinesToKeep: 10 + +# 命名空间的缩进: None, Inner(缩进嵌套的命名空间中的内容), All +# NamespaceIndentation: Inner + +# 使用ObjC块时缩进宽度 +ObjCBlockIndentWidth: 4 + +# 在ObjC的@property后添加一个空格 +ObjCSpaceAfterProperty: false + +# 在ObjC的protocol列表前添加一个空格 +ObjCSpaceBeforeProtocolList: true + +# 在call(后对函数调用换行的penalty +PenaltyBreakBeforeFirstCallParameter: 2 + +# 在一个注释中引入换行的penalty +PenaltyBreakComment: 300 + +# 第一次在<<前换行的penalty +PenaltyBreakFirstLessLess: 120 + +# 在一个字符串字面量中引入换行的penalty +PenaltyBreakString: 1000 + +# 对于每个在行字符数限制之外的字符的penalty +PenaltyExcessCharacter: 1000000 + +# 对每一个空格缩进字符的penalty(相对于前导的非空格列计算) +# PenaltyIndentedWhitespace: 0 + +# 将函数的返回类型放到它自己的行的penalty +PenaltyReturnTypeOnItsOwnLine: 120 + +# 指针和引用的对齐: Left, Right, Middle +PointerAlignment: Left + +# 允许重新排版注释 +ReflowComments: true + +# 允许排序#include +SortIncludes: true + +# 允许排序 using 声明顺序 +SortUsingDeclarations: false + +# 在C风格类型转换后添加空格 +SpaceAfterCStyleCast: false + +# 在逻辑非操作符(!)之后插入一个空格 +SpaceAfterLogicalNot: false + +# 在 template 关键字后插入一个空格 +SpaceAfterTemplateKeyword: false + +# 定义在什么情况下在指针限定符之前或之后放置空格 +# SpaceAroundPointerQualifiers: Before + +# 在赋值运算符之前添加空格 +SpaceBeforeAssignmentOperators: true + +# 左圆括号之前添加一个空格: Never, ControlStatements, Always +SpaceBeforeParens: ControlStatements + +# 空格将在基于范围的for循环冒号之前被删除 +SpaceBeforeRangeBasedForLoopColon: true + +# [ 前是否添加空格(数组名和[之间,Lambdas不会受到影响) +# 连续多个 [ 只考虑第一个(嵌套数组,多维数组) +SpaceBeforeSquareBrackets: false + +# 在空的圆括号中添加空格 +SpaceInEmptyParentheses: false + +# 在尾随的评论前添加的空格数(只适用于//) +SpacesBeforeTrailingComments: 3 + +# 在尖括号的<后和>前添加空格 +SpacesInAngles: false + +# 在容器(ObjC和JavaScript的数组和字典等)字面量中添加空格 +SpacesInContainerLiterals: false + +# 在C风格类型转换的括号中添加空格 +SpacesInCStyleCastParentheses: false + +# 如果为true,将在If/for/switch/while条件括号前后插入空格。 +SpacesInConditionalStatement: false + +# 在圆括号的(后和)前添加空格 +SpacesInParentheses: false + +# 在方括号的[后和]前添加空格,lamda表达式和未指明大小的数组的声明不受影响 +SpacesInSquareBrackets: false + +# 标准: Cpp03, Cpp11, Auto +Standard: Cpp11 + +# tab宽度 +TabWidth: 4 + +# 使用tab字符: Never, ForIndentation, ForContinuationAndIndentation, Always +UseTab: Never \ No newline at end of file diff --git a/clang-tidy.txt b/clang-tidy.txt new file mode 100644 index 0000000..6110a9d --- /dev/null +++ b/clang-tidy.txt @@ -0,0 +1,124 @@ +readability-delete-null-pointer:建议使用 delete 而不是 delete[] 来释放空指针。 +readability-deleted-default:提醒添加显式的 = default 或 = delete 来明确声明默认的或者删除的特殊成员函数。 +readability-inconsistent-declaration-parameter-name:在不同的声明中参数名称不一致时给出警告。 +readability-make-member-function-const:建议将不修改类成员的函数标记为 const。 +readability-misleading-indentation:提示缩进可能会误导阅读代码的意图。 +readability-non-const-parameter:建议将不修改参数值的函数参数声明为 const。 +readability-redundant-control-flow:发现冗余的控制流结构,建议简化代码。 +readability-redundant-declaration:警告多余的变量或函数声明。 +readability-redundant-function-ptr-dereference:提示不必要的函数指针解引用。 +readability-redundant-smartptr-get:发现多余的智能指针的 .get() 调用。 +readability-redundant-string-cstr:发现多余的字符串转换为 C 风格字符串的操作。 +readability-redundant-string-init:警告多余的字符串初始化。 +readability-simplify-subscript-expr:建议简化数组下标表达式。 +readability-static-accessed-through-instance:警告通过实例访问静态成员。 +readability-static-definition-in-anonymous-namespace:在匿名命名空间中定义静态变量时给出警告。 +readability-string-compare:建议使用字符串操作函数而不是直接使用运算符进行比较。 +readability-uniqueptr-delete-release:建议使用 reset() 而不是 release() 来释放 std::unique_ptr。 +readability-use-anyofallof:建议使用 C++17 的 std::any_of 或 std::all_of 算法。 +performance-implicit-conversion-in-loop:警告循环中的隐式类型转换可能影响性能。 +performance-inefficient-algorithm:提示可能存在效率低下的算法使用。 +performance-inefficient-string-concatenation:发现效率低下的字符串拼接操作。 +performance-inefficient-vector-operation:提示可能效率低下的向量操作。 +performance-move-const-arg:建议在函数参数传递时使用 std::move 来移动 const 对象。 +performance-move-constructor-init:提示在构造函数初始化列表中使用移动语义。 +performance-no-automatic-move:建议禁止自动移动语义,需要显式使用 std::move。 +performance-noexcept-move-constructor:建议将移动构造函数声明为 noexcept,以便优化。 +performance-trivially-destructible:标识可以标记为 trivially destructible 的类型。 +performance-type-promotion-in-math-fn:警告数学函数中可能的类型提升。 +performance-unnecessary-copy-initialization:提示不必要的拷贝初始化操作。 +performance-unnecessary-value-param:警告可能不必要的值传递参数。 +portability-simd-intrinsics:识别可能与 SIMD 指令集相关的代码,这可能不具备跨平台移植性。 +readability-avoid-const-params-in-decls:建议避免在函数声明中使用 const 参数。 +readability-const-return-type:建议将返回类型声明为 const。 +readability-container-size-empty:提示使用容器的 empty() 函数来检查容器是否为空,而不是使用 size()。 +readability-convert-member-functions-to-static:建议将不修改对象状态的成员函数改为静态函数。 +modernize-shrink-to-fit:建议使用 shrink_to_fit() 来减小容器的容量,以节省内存。 +modernize-unary-static-assert:建议使用一元静态断言(static_assert)代替传统的 assert。 +modernize-use-auto:推荐使用 auto 类型推断,以减少代码冗余和提高可读性。 +modernize-use-bool-literals:建议使用布尔字面值 true 和 false 代替 0 和 1。 +modernize-use-emplace:推荐使用容器的 emplace 函数代替 push_back 或 insert。 +modernize-use-equals-default:建议使用 = default 来声明默认的特殊成员函数。 +modernize-use-equals-delete:建议使用 = delete 明确删除特殊成员函数。 +modernize-use-nodiscard:建议在可能的情况下使用 [[nodiscard]] 标记函数,以便提醒调用者检查返回值。 +modernize-use-noexcept:建议使用 noexcept 来标记不会抛出异常的函数。 +modernize-use-nullptr:建议使用 C++11 的 nullptr 关键字代替 NULL。 +modernize-use-override:建议在派生类中使用 override 关键字来标记重写的函数。 +modernize-use-transparent-functors:建议使用透明函数对象代替手动构造函数对象。 +modernize-use-uncaught-exceptions:建议使用 std::uncaught_exceptions() 来替代 std::uncaught_exception()。 +mpi-buffer-deref 和 mpi-type-mismatch:这两个参数是针对 MPI(Message Passing Interface)库的规则,用于检查缓冲区解引用和类型不匹配的问题。 +openmp-use-default-none:建议在 OpenMP 指令中显式指定 default(none),以确保线程安全性。 +performance-faster-string-find:优化字符串查找操作以提高性能。 +performance-for-range-copy:优化循环中对于范围迭代器的复制操作。 +misc-new-delete-overloads:建议同时重载 new 和 delete 运算符以实现自定义的内存分配和释放方式。 +misc-no-recursion:提示避免递归调用,可能会导致栈溢出和性能问题。 +misc-non-copyable-objects:建议标记不可复制的类为 delete,以防止意外的复制。 +misc-throw-by-value-catch-by-reference:建议异常抛出时使用值,而捕获异常时使用引用,以避免异常对象切片问题。 +misc-unconventional-assign-operator:识别并提醒使用了非传统的赋值操作符。 +misc-uniqueptr-reset-release:建议使用 reset() 替代 release() 来释放 std::unique_ptr。 +modernize-avoid-bind:建议使用 lambda 表达式代替 std::bind。 +modernize-concat-nested-namespaces:提示合并嵌套的命名空间,以提高代码的可读性。 +modernize-deprecated-headers 和 modernize-deprecated-ios-base-aliases:识别并提醒使用了已弃用的头文件和 I/O 流别名。 +modernize-loop-convert:建议使用现代化的循环语法替代传统的循环语句。 +modernize-make-shared 和 modernize-make-unique:建议使用 std::make_shared 和 std::make_unique 来创建智能指针。 +modernize-pass-by-value:建议将按值传递的函数参数修改为按引用传递,以避免不必要的拷贝。 +modernize-raw-string-literal:建议使用原始字符串字面量(raw string literals)来提高字符串的可读性。 +modernize-redundant-void-arg:警告冗余的 void 参数。 +modernize-replace-auto-ptr:建议将已弃用的 std::auto_ptr 替换为更安全的智能指针。 +modernize-replace-disallow-copy-and-assign-macro:建议使用 delete 关键字禁用拷贝和赋值操作,而不是宏。 +modernize-replace-random-shuffle:建议使用 std::shuffle 替代 std::random_shuffle。 +modernize-return-braced-init-list:建议使用大括号初始化列表(braced-init-list)来返回对象,以提高代码的清晰度和一致性。 +cert-dcl21-cpp:避免不正确的使用逗号运算符分隔的声明。 +cert-dcl58-cpp:确保不同的成员变量使用不同的类型。 +cert-err34-c:避免使用不存在的指针。 +cert-err52-cpp:避免将一个标量赋值给一个不兼容的类型。 +cert-err60-cpp:在空语句块中使用注释来提醒代码的维护者。 +cert-flp30-c:避免使用函数指针执行非函数类型的对象。 +cert-msc50-cpp 和 cert-msc51-cpp:关于 C++ 中对象的析构和构造的安全性准则。 +cert-str34-c:避免在字符串拷贝函数中出现缓冲区溢出。 +cppcoreguidelines-interfaces-global-init:警告全局初始化的接口。 +cppcoreguidelines-narrowing-conversions:避免窄化转换。 +cppcoreguidelines-pro-type-member-init:建议在构造函数中对所有成员变量进行初始化。 +cppcoreguidelines-pro-type-static-cast-downcast:建议使用静态转换来进行向下转型。 +cppcoreguidelines-slicing:提示有可能出现对象切割(slicing)的地方。 +google-default-arguments 和 google-explicit-constructor:关于 Google C++ 编码规范中默认参数和显式构造函数的规则。 +google-runtime-operator:Google C++ 编码规范中关于运算符的规则。 +hicpp-exception-baseclass 和 hicpp-multiway-paths-covered:关于异常类基类和多路径覆盖的 HIC++ 规则。 +misc-misplaced-const:警告误放的 const。 +bugprone-sizeof-container 和 bugprone-sizeof-expression:在容器或表达式上使用 sizeof 可能导致 bug 的检测。 +bugprone-spuriously-wake-up-functions:检测可能误唤醒线程的函数。 +bugprone-string-constructor 和 bugprone-string-integer-assignment:检测字符串构造函数和整数赋值可能带来的潜在问题。 +bugprone-string-literal-with-embedded-nul:发现在字符串字面值中嵌入空字符可能带来问题的情况。 +bugprone-suspicious-enum-usage:检测可疑的枚举使用情况。 +bugprone-suspicious-include:发现不合适的头文件引入。 +bugprone-suspicious-memset-usage 和 bugprone-suspicious-memory-comparison:检测可能有问题的 memset 使用和内存比较。 +bugprone-suspicious-missing-comma 和 bugprone-suspicious-semicolon:检测可能缺少逗号或分号的地方。 +bugprone-suspicious-string-compare:发现可疑的字符串比较。 +bugprone-suspicious-realloc-usage:检测可能不正确使用 realloc 的地方。 +bugprone-swapped-arguments:检测参数错误排序的情况。 +bugprone-terminating-continue 和 bugprone-throw-keyword-missing:检测不良的 continue 使用和可能缺少 throw 关键字的情况。 +bugprone-too-small-loop-variable 和 bugprone-undefined-memory-manipulation:发现循环变量过小和潜在未定义的内存操作。 +bugprone-undelegated-constructor:检测未委托的构造函数。 +bugprone-unhandled-self-assignment:检测可能未处理的自赋值操作。 +bugprone-unused-raii 和 bugprone-unused-return-value:发现未使用的 RAII 对象和返回值。 +bugprone-use-after-move 和 bugprone-virtual-near-miss:检测移动后使用和潜在的虚函数近似错误。 +bugprone-argument-comment:发现参数注释可能不正确的情况。 +bugprone-assert-side-effect:检测断言中可能引起副作用的代码。 +bugprone-bad-signal-to-kill-thread:发现线程杀死信号可能有问题的情况。 +bugprone-branch-clone:发现可能会造成冗余分支的代码。 +bugprone-copy-constructor-init:检测复制构造函数中可能的初始化错误。 +bugprone-dangling-handle:发现悬空的句柄或引用。 +bugprone-dynamic-static-initializers:检测可能会引发静态初始化问题的动态初始化。 +bugprone-fold-init-type:发现在初始化中可能导致折叠类型的情况。 +bugprone-forward-declaration-namespace:检测可能导致前置声明命名空间的情况。 +bugprone-forwarding-reference-overload 和 bugprone-move-forwarding-reference:检测传递引用相关的错误。 +bugprone-inaccurate-erase:发现可能不准确的 erase() 操作。 +bugprone-incorrect-roundings 和 bugprone-integer-division:检测不正确的舍入和整数除法。 +bugprone-lambda-function-name:警告 lambda 表达式中未命名的函数。 +bugprone-macro-parentheses 和 bugprone-macro-repeated-side-effects:检测宏使用中可能存在的问题。 +bugprone-misplaced-operator-in-strlen-in-alloc 和 bugprone-misplaced-pointer-arithmetic-in-alloc:检测在分配内存时可能存在的字符串长度或指针算术错误。 +bugprone-misplaced-widening-cast:发现可能放置不当的宽化转换。 +bugprone-multiple-statement-macro:发现多个语句的宏。 +bugprone-no-escape 和 bugprone-not-null-terminated-result:检测逃逸问题和可能未以空字符结尾的结果。 +bugprone-parent-virtual-call:发现可能会出现问题的父类虚函数调用。 +bugprone-posix-return 和 bugprone-reserved-identifier:检测 POSIX 返回错误和保留标识符使用的问 \ No newline at end of file diff --git a/csharp.txt b/csharp.txt new file mode 100644 index 0000000..9d60434 --- /dev/null +++ b/csharp.txt @@ -0,0 +1,11 @@ +1.多选文件夹 +using Microsoft.WindowsAPICodePack.Dialogs; + +CommonOpenFileDialog dia = new CommonOpenFileDialog(); +dia.IsFolderPicker = true; +dia.Multiselect = true; + +if (dia.ShowDialog() == CommonFileDialogResult.Ok) +{ + var data = dia.FileNames.ToList(); +} \ No newline at end of file diff --git a/database.txt b/database.txt new file mode 100644 index 0000000..9e49306 --- /dev/null +++ b/database.txt @@ -0,0 +1,44 @@ +///////////////////// mysql /////////////////////////// +《环境Debian系列安装mariadb》 +sudo apt install mariadb-server +这条命令可以初始化mysql,删除匿名用户,设置root密码等等.... +sudo mysql_secure_installation + +1.输入当前密码,初次安装后是没有密码的,直接回车 +2.询问是否使用 'unix_socket' 进行身份验证: n +3.为 root 设置密码:y +4.输入 root 的新密码: root +5.确认输入 root 的新密码: root +6.是否移除匿名用户,这个随意,建议删除: y +7.拒绝用户远程登录,这个建议开启:n +8.删除 test 库,可以保留:n +9.重新加载权限表:y + +【远程配置】 +use mysql; +检索用户 +select host,user from user; +创建一个远程用户,可以直接给Root用户开远程,但是不建议生产环境这么干 +create user '远程用户账户'@'%' identified by '密码'; +grant all on *.* to '远程用户账户'@'%'; +select host,user from user;再次检索用户 +flush privileges;刷新权限 + +【检查是否仅本地访问】 +netstat -an | grep 3306 +如果是127.0.0.1:3306即为仅本地 +vim /etc/mysql/mysql.conf.d/mysqld.cnf/50-server.cnf +或者 +vim /etc/mysql/mariadb.conf.d/50-server.cnf +将127.0.0.1那行注释。 + +《MacOS安装Mysql》 +mac上的mysql安装不要用命令行安装,很多问题,去官网下载安装。 +密码重置: +(1)先停止mysql服务(在设置中)也可以sudo /usr/local/mysql/support-files/mysql.server stop +(2)cd /usr/local/mysql/bin +(3)sudo su +(4)./mysqld_safe --skip-grant-tables & +(5)再开一个窗口cd到同样位置 sudo su,然后 ./mysql +(6)ALTER USER 'root'@'localhost' IDENTIFIED BY '你的新密码'; +(7) FLUSH PRIVILEGES; \ No newline at end of file diff --git a/librarycompile.txt b/librarycompile.txt new file mode 100644 index 0000000..99655c9 --- /dev/null +++ b/librarycompile.txt @@ -0,0 +1,79 @@ +1.Boost自行编译: +b2.exe link=shared runtime-link=shared threading=multi debug release --build-type=complete --prefix=C:\Bin\Boost address-model=64 install +或者:--layout=tagged +需要 -fPIC 项的,在 tools/build/src/tools/gcc.jam 大致 400 行位置, 加一个 static。 + +2.Qt6 +configure.bat -prefix G:\QT6.5.3_x64\ -debug-and-release -opensource -skip qtwebengine -skip qtdoc +编译文档 Qt6文档编译后直接在源码下的doc中,不需要安装命令,使用:ninja docs + +Qt5: + +1.vs2019 +2.qt源码 +3.python3 +4.perl https://download.qt.io/development_releases/prebuilt/perl/ +5.qt的预编译llvm(编译文档)https://download.qt.io/development_releases/prebuilt/libclang/ + +编译 +1.打开 vs2019 开发环境 cmd。 +2.设置上面的 libclang 的环境变量,注意二进制的目录也要加上(成功过,第二次用clang17.0的没成功,不清楚为什么)。 +set PATH=%PATH%;E:/libclang/bin; +set LLVM_INSTALL_DIR=E:/libclang +set QDOC_USE_STATIC_LIBCLANG=1 +3.配置选项 +configure -debug-and-release -confirm-license -opensource -platform win32-msvc -prefix "G:\\vs2019_Pro_dev\\3rd\\qt5.15.12" -qt-sqlite -qt-pcre -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -opengl dynamic -skip qtwebengine -nomake tests -no-compile-examples -mp + +3.编译错误处理: +(3.1)编译报错E2512 功能测试宏的参数必须是简单标识符 的解决方法(qcompilerdetection.h) +参考链接:https://www.bilibili.com/read/cv7477923/ +替换成如下内容: +#if defined(__cplusplus) +#if defined(__clang__) +#if QT_HAS_CPP_ATTRIBUTE(clang::fallthrough) +# define Q_FALLTHROUGH() [[clang::fallthrough]] +#endif +#elif defined(__GNUC__) +#if QT_HAS_CPP_ATTRIBUTE(gnu::fallthrough) +# define Q_FALLTHROUGH() [[gnu::fallthrough]] +#endif +#elif QT_HAS_CPP_ATTRIBUTE(fallthrough) +# define Q_FALLTHROUGH() [[fallthrough]] +#endif +#endif +(3.2)E1097未知特性 "no_init_all" +参考链接:https://blog.csdn.net/tiao_god/article/details/128691159 +在 +#if (_MSC_VER >= 1915) +#pragma warning(disable:4845) // __declspec(no_init_all) used but d1initall not set +#endif +(这一代码块是微软工程师用于在旧版本的VS中消除该错误提示的预编译头 +虽然微软的工程师们宣称他们在最新的VS2019中已经修复了该错误,但是仍有很多人受到了该错误的困扰。) +后面添加: +#if (_MSC_VER >= 1915) +#define no_init_all deprecated +#endif + +4.OpenSSL +https://strawberryperl.com/ +https://www.nasm.us + +perl Configure VC-WIN32 no-shared no-asm --debug --prefix=C:\menv\openssl-3.2.1\debug +如果是64位就是VC-WIN64A,no-shared不写就是动态库。 + +编译出来debug lib默认位MDd版,release lib默认为MT版 +如果想把debug修改为MTd版本,执行完perl Configure命令后,修改openssl根目录下的makefile和configdata.pm文件, +把里面的/MDd 替换成 /MTd就OK了 +原文链接:https://blog.csdn.net/skyf1y/article/details/107632975 + +5.OpenCV4.8.1 +【32位环境】 +set http_proxy=http://127.0.0.1:7890 +set https_proxy=http://127.0.0.1:7890 +set PATH=%PATH%;C:\menv\compileenv\nasm-2.16.01-win32\nasm-2.16.01; +cmake .. -G "Visual Studio 15 2017" -A win32 -DCMAKE_INSTALL_PREFIX:PATH=C:\menv\opencv2\v4.8.1 +【64位环境】 +set http_proxy=http://127.0.0.1:7890 +set https_proxy=http://127.0.0.1:7890 +set PATH=%PATH%;C:\menv\compileenv\nasm-2.16.01-win64\nasm-2.16.01; +cmake .. -G "Visual Studio 15 2017" -A x64 -DCMAKE_INSTALL_PREFIX:PATH=C:\menv\opencv2\v4.8.1 diff --git a/linux.txt b/linux.txt new file mode 100644 index 0000000..de9c1c7 --- /dev/null +++ b/linux.txt @@ -0,0 +1,22 @@ +1.ssh配置免访问文件:authorized_keys +2.apt设置临时代理: +sudo apt-get -o Acquire::http::proxy="socks5h://192.168.0.102:7890/" install mariadb-server +3.CentOS7 升级GCC +(3.1) rpm -q gcc +(3.2) rpm -e [第二步查到的版本号] +如果 +error: Failed dependencies: + gcc = 4.4.7-23.el6 is needed by (installed) gcc-c++-4.4.7-23.el6.x86_64 + gcc = 4.4.4 is needed by (installed) libtool-2.2.6-15.5.el6.x86_64 +rpm -e gcc-c++-4.4.7-23.el6.x86_64 +rpm -e libtool-2.2.6-15.5.el6.x86_64 +验证卸载: +[root@123 /]# gcc -v +-bash: /usr/bin/gcc: No such file or directory +[root@123 /]# g++ -v +-bash: /usr/bin/g++: No such file or directory +yum install centos-release-scl +yum install -y devtoolset-11-gcc devtoolset-11-gcc-c++ +scl enable devtoolset-11 bash +vim /etc/profile +PATH=$PATH::/opt/rh/devtoolset-11/root/usr/bin \ No newline at end of file diff --git a/nsis/RTM_Pack_V2.nsi b/nsis/RTM_Pack_V2.nsi new file mode 100644 index 0000000..36ce384 --- /dev/null +++ b/nsis/RTM_Pack_V2.nsi @@ -0,0 +1,187 @@ + +!define VERSION_NUM "v1.12.1" + +!define DRIVE_D "G:" +!define SECOND_LEVEL_NAME "APack" +!define RUN_ENVIRONMENT_DIR "${DRIVE_D}\${SECOND_LEVEL_NAME}\pack\Environment" +!define INSTALL_NAME "RTM_x64" +!define INSTALL_DIR "C:\ZOYON\RTM" +!define SPLIT_TOOL_DIR "${DRIVE_D}\${SECOND_LEVEL_NAME}\pack\зֹ20230606\зֹ20230606" +!define RTM_CAPTURE_DIR "${DRIVE_D}\${SECOND_LEVEL_NAME}\pack\ReleaseXML5" +!define RTM_CAPTURE_XML "${DRIVE_D}\${SECOND_LEVEL_NAME}\pack\XML" +!define RTM_XML_CONFIG_DIR "${DRIVE_D}\${SECOND_LEVEL_NAME}\pack\RTMConfiger" +!define RTM_CHANNEL_SHOW_DIR "${DRIVE_D}\${SECOND_LEVEL_NAME}\pack\ChannelShow" +!define MONITOR_DIR "${DRIVE_D}\${SECOND_LEVEL_NAME}\pack\Monitor_RealseV20.12.1" +!define RTM_VERSION_DIR "${DRIVE_D}\${SECOND_LEVEL_NAME}\pack" + +; Build Unicode installer +Unicode True +; The default installation directory +InstallDir "${INSTALL_DIR}" +; Registry key to check for directory (so if you install again, it will +; overwrite the old one automatically) +InstallDirRegKey HKLM "Software\${INSTALL_NAME}" "${INSTALL_DIR}" +LoadLanguageFile "${NSISDIR}\Contrib\Language files\SimpChinese.nlf" +LangString Name ${LANG_SIMPCHINESE} "Simplified Chinese" +Name "${INSTALL_NAME}" +OutFile "x64ɼװ${VERSION_NUM}.exe" + +RequestExecutionLevel admin +!include "${NSISDIR}\Contrib\Modern UI\System.nsh" +Page license +Page components +Page directory +Page instfiles + +UninstPage uninstConfirm +UninstPage instfiles + + ; ָֹͣWindows +Function un.StopService + ; ʹSystem plug-innsExecִ + ; nsExec::ExecToLog 'net stop "CaptProcMgr"' + nsExec::Exec 'net stop "CaptProcMgr"' + nsExec::Exec 'net stop "CaptWarnMgr"' + Sleep 1000 +FunctionEnd +Function StopService + ; ʹSystem plug-innsExecִ + nsExec::Exec 'net stop "CaptProcMgr"' + nsExec::Exec 'net stop "CaptWarnMgr"' + Sleep 1000 +FunctionEnd + +; ָֹͣĽ +Function un.StopProcess + ; ʹSystem plug-innsExecִ + nsExec::ExecToLog 'taskkill /F /IM "Web.Master.exe"' + nsExec::ExecToLog 'taskkill /F /IM "NavExe.exe"' +FunctionEnd +Function StopProcess + ; ʹSystem plug-innsExecִ + nsExec::ExecToLog 'taskkill /F /IM "Web.Master.exe"' + nsExec::ExecToLog 'taskkill /F /IM "NavExe.exe"' +FunctionEnd + +Section "жس" + SectionIn RO + Call StopProcess + Call StopService + WriteUninstaller "$INSTDIR\Uninstall.exe" +SectionEnd + +; 趨Эı +LicenseData "${RTM_VERSION_DIR}\license.txt" + +Section "и" + SetOutPath "$INSTDIR\Tool" + File /nonfatal /r "${SPLIT_TOOL_DIR}\*.*" + CreateShortCut "$DESKTOP\зֹ.lnk" $INSTDIR\Tool\SplitTaskApp.exe "" \ + "$INSTDIR\Tool\Kid Mac Os.ico" 0 SW_SHOWNORMAL "" "Split Tool" +SectionEnd + +Section "RTMù" + SetOutPath "$INSTDIR\RTMConfiger" + File /nonfatal /r "${RTM_XML_CONFIG_DIR}\*.*" + CreateShortCut "$DESKTOP\RTM.lnk" $INSTDIR\RTMConfiger\RTMConfiger.exe "" \ + "$INSTDIR\RTMConfiger\RTMConfiger.exe" 0 SW_SHOWNORMAL "" "ɼRTMļ޸Ĺߡ" +SectionEnd + +Section "س" + Delete "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\Web.Master.lnk" + Delete "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\NavExe.lnk" + Delete "$STARTMENU\Web.Master.lnk" + Delete "$STARTMENU\NavExe.lnk" + Delete "$SMSTARTUP\Web.Master.lnk" + Delete "$SMSTARTUP\NavExe.lnk" + SetOutPath "$INSTDIR\Monitor" + File /nonfatal /r "${MONITOR_DIR}\*.*" + File "/oname=$INSTDIR\Monitor\dotnet-sdk-3.1.404-win-x64.exe" \ + "${RUN_ENVIRONMENT_DIR}\dotnet-sdk-3.1.404-win-x64.exe" + SetOutPath "$INSTDIR\Monitor\Service" + CreateShortCut "$DESKTOP\Web.Master.lnk" $INSTDIR\Monitor\Service\Web.Master.exe "" \ + "$INSTDIR\Monitor\Service\Web.Master.exe" 0 SW_SHOWNORMAL "" "Webط" + ;$STARTMENU + CreateShortCut "$SMSTARTUP\Web.Master.lnk" $INSTDIR\Monitor\Service\Web.Master.exe "" \ + "$INSTDIR\Monitor\Service\Web.Master.exe" 0 SW_SHOWNORMAL "" "Webط" + SetOutPath "$INSTDIR\Monitor\MainFrame" + CreateShortCut "$DESKTOP\ZyFrame.lnk" $INSTDIR\Monitor\MainFrame\App.ZyMainFrame.exe "" \ + "$INSTDIR\Monitor\MainFrame\App.ZyMainFrame.exe" 0 SW_SHOWNORMAL "" "Webؽ档" + ; CreateShortCut "$DESKTOP\ZyMain.lnk" $INSTDIR\Monitor\MainFrame\ZyLaunch.exe "" \ + ; "$INSTDIR\Monitor\MainFrame\ZyLaunch.exe" 0 SW_SHOWNORMAL "" "Webؽ档" + SetOutPath "$INSTDIR\Monitor\NavUIExe" + CreateShortCut "$SMSTARTUP\NavExe.lnk" $INSTDIR\Monitor\NavUIExe\NavExe.exe "" \ + "$INSTDIR\Monitor\NavUIExe\NavExe.exe" 0 SW_SHOWNORMAL "" "NavExe " + + nsExec::Exec 'sc stop CaptWarnMgr' + nsExec::Exec 'sc delete CaptWarnMgr' + nsExec::Exec 'sc create CaptWarnMgr binPath="$INSTDIR\Monitor\Warn\WNS.Detection.exe" start=auto' +SectionEnd + +Section "RTMɼ" + Delete "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\Web.Master.lnk" + Delete "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\NavExe.lnk" + SetOutPath "$INSTDIR" + File /nonfatal /r "${RTM_CAPTURE_DIR}\*.*" + CreateDirectory "$INSTDIR\Plugin" + File "/oname=$INSTDIR\Plugin\mysql-connector-odbc-8.0.29-winx64.msi" \ + "${RUN_ENVIRONMENT_DIR}\mysql-connector-odbc-8.0.29-winx64.msi" + File "/oname=$INSTDIR\Plugin\ǿƹرձвɼ.bat" \ + "${RUN_ENVIRONMENT_DIR}\ǿƹرձвɼ.bat" + File "/oname=$INSTDIR\Plugin\Dalsa޳.bat" \ + "${RUN_ENVIRONMENT_DIR}\Dalsa޳.bat" + ; File "/oname=$INSTDIR\Plugin\Basler޳.bat" \ + ; "${RUN_ENVIRONMENT_DIR}\Basler޳.bat" + ExecWait "$INSTDIR\BUS.RegisterPC.exe" + + ; CreateDirectory "$INSTDIR\RTM_Version" + ; File "/oname=$INSTDIR\RTM_Version\version.txt" \ + ; "${RTM_VERSION_DIR}\version.txt" + + ; Write the installation path into the registry + WriteRegStr HKLM SOFTWARE\${INSTALL_NAME} "$INSTDIR" "$INSTDIR" + + ; Write the uninstall keys for Windows + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${INSTALL_NAME}" "DisplayName" "${INSTALL_NAME}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${INSTALL_NAME}" "UninstallString" '"$INSTDIR\uninstall.exe"' + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${INSTALL_NAME}" "NoModify" 1 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${INSTALL_NAME}" "NoRepair" 1 + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${INSTALL_NAME}" "Publisher" "ZOYON" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${INSTALL_NAME}" "DisplayVersion" "${VERSION_NUM}" + WriteUninstaller "$INSTDIR\Uninstall.exe" +SectionEnd + +Section "ɼXMLļ" + SetOutPath "$INSTDIR" + File /nonfatal /r "${RTM_CAPTURE_XML}\*.*" +SectionEnd + +Section "ͨ鿴" + SetOutPath "$INSTDIR\ChannelShow" + File /nonfatal /r "${RTM_CHANNEL_SHOW_DIR}\*.*" + CreateShortCut "$DESKTOP\ͨ鿴.lnk" $INSTDIR\ChannelShow\ChannelDataShow.exe "" \ + "$INSTDIR\ChannelShow\ChannelDataShow.exe" 0 SW_SHOWNORMAL "" "ɼͨ鿴ߡ" +SectionEnd + +Section "Uninstall" + ; жǰֹͣͽ + Call un.StopService + Call un.StopProcess + RMDir /r /REBOOTOK "$INSTDIR" + Delete "$SMSTARTUP\Web.Master.lnk" + Delete "$SMSTARTUP\NavExe.lnk" + Delete "$DESKTOP\зֹ.lnk" + Delete "$DESKTOP\RTM.lnk" + Delete "$DESKTOP\ͨ鿴.lnk" + Delete "$DESKTOP\Web.Master.lnk" + Delete "$STARTMENU\Web.Master.lnk" + Delete "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\Web.Master.lnk" + Delete "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\NavExe.lnk" + Delete "$STARTMENU\Web.Master.lnk" + Delete "$STARTMENU\NavExe.lnk" + Delete "$DESKTOP\ZyFrame.lnk" + Delete "$DESKTOP\ZyMain.lnk" + Delete "$INSTDIR\Uninstall.exe" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${INSTALL_NAME}" + DeleteRegKey HKLM SOFTWARE\${INSTALL_NAME} +SectionEnd diff --git a/nsis/SimpleInstaller.nsi b/nsis/SimpleInstaller.nsi new file mode 100644 index 0000000..c33bb9a --- /dev/null +++ b/nsis/SimpleInstaller.nsi @@ -0,0 +1,44 @@ + +!define VERSION_NUM "v1.0.0" + +!define PACK_DIR "G:\0516\pack\2" +!define INSTALL_NAME "sx-calendar" +!define INSTALL_DIR "$PROFILE\AppData\Local" + +Unicode True +InstallDir "${INSTALL_DIR}" +LoadLanguageFile "${NSISDIR}\Contrib\Language files\SimpChinese.nlf" +LangString Name ${LANG_SIMPCHINESE} "Simplified Chinese" +Name "${INSTALL_NAME}" +OutFile "${INSTALL_NAME}_installer_${VERSION_NUM}_x64.exe" + +RequestExecutionLevel user +!include "${NSISDIR}\Contrib\Modern UI\System.nsh" +Page license +Page components +Page directory +Page instfiles + +UninstPage uninstConfirm +UninstPage instfiles + +Section "Uninstaller" + SectionIn RO + WriteUninstaller "$INSTDIR\sx-calendar\Uninstall.exe" +SectionEnd + +; 趨Эı +LicenseData "${PACK_DIR}\license\LICENSE" + +Section "sx-calendar" + SetOutPath "$INSTDIR\sx-calendar" + File /nonfatal /r "${PACK_DIR}\*.*" + CreateShortCut "$DESKTOP\sx-calendar.lnk" $INSTDIR\sx-calendar\sx-calendar.exe "" \ + "$INSTDIR\sx-calendar\sx-calendar.exe" 0 SW_SHOWNORMAL "" "sx-calendar" +SectionEnd + +Section "Uninstall" + Delete "$DESKTOP\sx-calendar.lnk" + RMDir /r /REBOOTOK "$INSTDIR" + Delete "$INSTDIR\Uninstall.exe" +SectionEnd diff --git a/qtuse.txt b/qtuse.txt new file mode 100644 index 0000000..eed45df --- /dev/null +++ b/qtuse.txt @@ -0,0 +1,58 @@ +1.Qmake配置说明 +# 变量说明 +$$PWD: 是 xx.pro 所在的目录。 +$PWD: 是 exe,即可执行程序所在目录。 +$$(PWD): 添加括号后,为家目录。 + + +# moc、rcc、ui、obj泽文件的输出路径 +Debug:MOC_DIR = $$PwD/tmp/debug +Debug:RCC_DIR = $$PWD/tmp/debug +Debug:UI_DIR = $$PwD/tmp/debug +Debug:OBJECTS_DIR = $$PWD/tmp/debug + +Release:MOC_DIR = $$PwD/tmp/release +Release:RCC_DIR = $$PWD/tmp/release +Release:UI_DIR = $$PwD/tmp/release +Release:OBJECTS_DIR = $$PWD/tmp/release + +# 应用程序输出路径 +Debug:DESTDIR = $$PWD/bin/debug +Release:DESTDIR =$$PWD/bin/release + +#动态库的依赖 + +Debug: LIBS += $$PWD/bin/debug/SerialPort.lib +Release:LIBS += $$PWD/bin/release/SerialPort.lib + +INCLUDEPATH += $$PWD/component/SerialPortLib +Debug:LIBS += $$PWD/bin/debug/CommonDll.lib +Release:LIBS += $$PWD/bin/release/CommonDll.lib +INCLUDEPATH += $$PWD/component/CommonDLl + +# 判断 32 或者 64 位 +contains(DEFINES, WIN64) { + CONFIG(debug, debug|release) { + LIBS += -L$$PWD/lib/tools/opencv/x64 -lopencv_world3410dJelsefLIBS + } else { + LIBS += -L$$PWD/lib/tools/libtiff -ltiff + } +} else { + LIBS += -L$$PWD/lib/tools/opencv/x86-lopencv_core3410dl + CONFIG(debug, debug|release) { + LIBS += -L$$PWD/lib/tools/opencv/x86-lopencv_core3410dl + } else { + LIBS += -L$$PWD/lib/tools/opencv/x86-lopencv_core3410 + } +} + +# 平台相关性处理 +win32 { + !win32-g++: {} +} + +linux { +} + +INCLUDEPATH += $$PWD/3rd/log4cpp/include/ +LIBS += -L$$PWD/3rd/log4cpp/lib -llog4cpp diff --git a/svn.txt b/svn.txt new file mode 100644 index 0000000..f41aa5c --- /dev/null +++ b/svn.txt @@ -0,0 +1,26 @@ +1.类Unix系统下SVN Server的配置 +安装subversion +anon-access = read 匿名用户的访问级别 +auth-access = write 授权用户的访问级别 +password-db = passwd 用户账号与密码的文件位置 +authz-db = authz 指定权限配置文件的位置 +realm = realm-name 指定版本库的认证域 + +authz:权限配置文件 +passwd:账号密码的配置 +svnserve.conf:svn服务器配置文件 + +创建一个目录:svnadmin create A +cd A +vim passwd 配置账号密码 +vim authz 配置权限: +anon-access = none +auth-access = write +authz-db = authz +password-db = passwd + +group下面给权限 +[/] +xxx=rw + + diff --git a/vcpkg.txt b/vcpkg.txt new file mode 100644 index 0000000..59fd1fe --- /dev/null +++ b/vcpkg.txt @@ -0,0 +1,65 @@ +x.安装 +git clone https://github.com/microsoft/vcpkg +cd vcpkg +./bootstrap-vcpkg.bat (其他平台用对应的脚本) + +x.如何更新 +git pull +重新./bootstrap-vcpkg.bat + +x.查询有哪些库 https://vcpkg.io/en/index.html + +在 triplets/下面设置 +.\vcpkg.exe install openssl --triplet x86-windows +--triplet 后面的内容就是triplets/下的列表 +set(VCPKG_PLATFORM_TOOLSET v141) +有效设置 + Visual Studio 2022 平台工具集为 v143。 + Visual Studio 2019 平台工具集为 v142。 + Visual Studio 2017 平台工具集为 v141。 + Visual Studio 2015 平台工具集为 v140。 + +x.安装库 +vcpkg install spdlog (默认x86) +vcpkg install spdlog:x64-windows +vcpkg install spdlog:x64-windows-static + +x.更新库 +vcpkg update 或者 vcpkg upgrade 列出 +upgrade 会列出,但是不升级,使用 -no-dry-run + +vcpkg upgrade spdlog:x64-windows --no-dry-run +可以指定多个库参数 + +x.查询库 +vcpkg search spdlog + +x.列出已安装的库 +vcpkg list + +x.导出一个库 +vcpkg export spdlog:x64-windows --zip or --7zip +–raw 以不打包的目录格式导出 +–nuget 以nuget包形式导出 +–ifw 我也不知道这是啥格式 +–zip 以zip压缩包形式导出 +–7zip 以7z压缩包形式导出 + +导出位置在 vcpkg 目录下 + +x.集成到 visual studio (全局) +vcpkg integrate install +vcpkg integrate remove + +x.集成到 visual studio (某个项目) +vcpkg integrate project 生成 nuget 配置文件,同时会给一个安装命令。 +在 vs 中打开[工具]->nuget->控制台,输入安装命令。 + +x.集成到 CMake +设置 CMAKE_TOOLCHAIN_FILE {vcpkg_root}/scripts/buildsystems/vcpkg.cmake + +x.例如 VSCode 编辑器 +settings.json中: +"cmake.configureSettings": { + "CMAKE_TOOLCHAIN_FILE": "${env:VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" +}, diff --git a/vs.txt b/vs.txt new file mode 100644 index 0000000..1fd4ccd --- /dev/null +++ b/vs.txt @@ -0,0 +1,9 @@ +【vs_buildtools】 +参考链接: +https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022 + +[vs_buildtools] +.\vs_BuildTools.exe --passive --wait --layout E:\vs2022\data --lang en-US --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --add Microsoft.VisualStudio.Component.VC.ATL Microsoft.VisualStudio.Component.VC.ATLMFC + +[vs] +VisualStudioSetup.exe --layout D:\Data\cplusplus_development_complete_vs2017_2024\data --lang zh-CN --add Microsoft.VisualStudio.Workload.NativeCrossPlat --includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --add Microsoft.VisualStudio.Workload.ManagedDesktop --includeRecommended --add Microsoft.VisualStudio.Component.VC.ATL Microsoft.VisualStudio.Component.VC.ATLMFC Microsoft.VisualStudio.Component.VC.CLI.Support \ No newline at end of file diff --git a/web.txt b/web.txt new file mode 100644 index 0000000..7d69595 --- /dev/null +++ b/web.txt @@ -0,0 +1,26 @@ +1.如何设置nginx代理,包括https。 +nginx 在 http 下设置如下内容 +server { + listen 443 ssl; + server_name ww.sinxmiao.cn; + client_max_body_size 500m; 这里不设置,大一点的仓库不能push + ssl_certificate/root/ssl/sinxmiao.crt; + ssl_certificate_key /root/ssl/sinxmiao.key; + location / { + proxy_pass http://localhost:3000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header x-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } +} +nginx http 强制重定向到https +新建一个server: +server { + listen 80; + server_namewww.sinxmiao.cn; + rewrite ^(.*)$ https://$host$1 permanent; + +} +2.网页中插入一个备案号示例: +xx号-1