- 博客(174)
- 资源 (38)
- 收藏
- 关注
原创 Docker / Podman 建立MongoDB 副本集群
Docker / Podman 建立MongoDB 副本集群Docker / Podman 建立MongoDB 副本集群建立生成Docker-compose.yaml脚本Docker 下部署:拷贝脚本到要部署的机器上登录目标机器,执行脚本建立相关目录Docker / Podman 建立MongoDB 副本集群本文介绍的MongoDB副本集群建立方法只能在Linux系统上使用,其他类Unix系统不适用于此方法。建立生成Docker-compose.yaml脚本建立mongoReplSetBuild
2020-12-18 12:56:53
1036
原创 树莓派4B连接KY008激光头
树莓派4B接KY008激光头是一个比较简单的应用。只要接线正确就能很快的跑起来。首先我们先有知道KY008激光头的每一个引脚的接法:下面是实物连接的照片然后在Raspberry Pi 4上运行下面的Python脚本就可以控制激光头了(前提是你的树莓派已经安装了Python3和RPI.GPIO模块):#!/usr/bin/python3# -*- coding:utf-8 -*-import RPi.GPIO as GPIOimport timeLaserGPIO =
2020-11-29 11:13:01
2251
1
原创 树莓派4Mode B(Raspberry Pi 4B)进行.NET Core IoT
树莓派4Mode B(Raspberry Pi 4B)进行.NET Core IoT
2020-11-28 10:21:37
820
1
原创 Vcpkg与Vcpkg_cli的安装及sqlite3库的编译
最近使用rust写程序的时候需要sqlite3库的支持。找了一下资料发现要在Windows下完成这个任务需要 vcpkg 和 vcpkg_cli 的支持。所以写这个博客来记录具体的实现过程安装vcpkg首先要从git clone https://github.com/Microsoft/vcpkg.git克隆下vcpkg的库然后确保你的Visual Studio已经安装了...
2020-05-05 13:09:59
1565
1
原创 搭建Gitolite服务及使用git-daemon
Gitolite 是一个新量级的Git服务,特别适合个人用户在网上建立自己的Git仓库。本文将描述如何建立Gitolite服务并设置 git-daemon 监听前置必要条件: Linux 系统(本文描述中使用的是CentOS 7) git(可以使用系统自带的也可以自己编译,本文描述中所提到的git是自己编译的) git-daemon(可以使用系统自带的也可以自己编...
2020-04-18 09:09:11
388
原创 使用Rusqlite操作sqlite数据库
[dependencies]rusqlite = "0.22.0"use rusqlite::{params, Connection, Result};#[derive(Debug)]struct Person { id: i32, name: String,}fn main() { let con = Connection::open_in_memo...
2020-04-13 21:05:39
3942
5
原创 rust 获取UserDefaultLocaleName
[package]name = "culture_test"version = "0.1.0"authors = ["许阳 <mksword@126.com>"]edition = "2018"# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifes...
2020-03-21 16:11:19
1043
原创 rust在Windows操作系统下获取LCID
在Linux系统下我们可以通过std::env::var(“LANG”)来获取操作系统的语言信息。但是在Windows下std::env::var("LANG")是没有值 的。这个时候就需要用到winapi了。cargo.toml:[package]name = "winapi_sample"version = "0.1.0"authors = ["许阳 <mksword@1...
2020-03-18 21:25:09
1296
原创 CentOS 8 安装Cockpit并配置证书
首先,我们创建一个用户并设置密码(我的root是不能用密码登录的)用于登录Cockpit。然后,我们给新建的用户分配sudo权限。安装lrzsz与socat。安装podman与podman-docker。新建www文件夹与nginx文件夹。向nginx文件夹下上传或手动生成一个nginx.conf。代码如下user root;worker_processes auto;e...
2020-03-14 12:56:26
5771
4
原创 Rust本地化实现 —— fluent
Fluent是一种新的I18n实现规范。在Rust中有实现fluent-rs项目。本篇介绍以这种技术实现本地化。文件结构:message.ftl:hello = 您好!世界!Cargo.toml:[package]name = "fluentSample"version = "0.1.0"authors = ["许阳 <mksword@1126.com>...
2020-03-01 21:51:47
1056
原创 用sed去除单引号和双引号的操作
sed -i 's/'"'"'\(.*\)'"'"'/\1/g' test.txtsed -i 's/"\(.*\)"/\1/g' test.txt
2020-02-24 19:50:30
3537
原创 在Sqlite中实现RowNumber功能
SELECT ROWID, ( SELECT COUNT( 1 ) FROM `Weight` b WHERE a.`Date` >= b.`Date` ) AS `ROWNUMBER`, a.* FROM `Weight` a ORDER BY a.` Date`SELECT ROWID, ( SELECT COUNT( 1 ) FROM `Weight` b W...
2020-02-24 06:32:57
2850
1
原创 关于MySql/Mariadb上UUID在C#上的处理
在C#中处理MySql/Mariadb中的UUID最简单的方法是把Guid直接转换成CHAR(36)存到MySql/Mariadb数据库中。但是,这样的话有一定局限性,那就是当数据表对大小写敏感时,查询时可能因为大小写的问题找不到正确的UUID值。在Mariadb的官方文档上推荐的是将UUID存储为Binary(16)。并给出了两个用来处理UUID的函数:DELIMITER //CREA...
2020-02-23 10:08:15
899
原创 Rust调用toml库读取toml文件
接前一期的toml文件,我这次用rust实现读取。我用的rust版本是1.41.0。程序写法可能与老的rust有差别。请使用老版本rust的读者注意。use serde_derive::Deserialize;use toml::value::*;use std::fs::File;use std::io::prelude::*;#[derive(Deserialize)]#[...
2020-02-01 21:24:20
4542
原创 Python 读取Toml文件
Toml示例文件如前一篇。代码:# -*- coding: utf-8 -*-from sys import argvfrom os.path import existsfrom toml import loadif __name__ == '__main__': if len(argv) < 2: print('缺少必要参数!') ...
2020-01-04 12:15:04
1912
原创 Tomlyn读取tom文件
TOML作为一种新的设定文件十分有用,以下是读取方法:TOML源文件:# This is a TOML document. Boom.title = "TOML Example"# Line breaks are OK when inside arrayshosts = [ "alpha", "omega"][owner]name = "Tom Preston-...
2020-01-02 20:52:29
975
2
原创 Rust判断操作系统代码
fn main() { if cfg!(target_os = "windows") { println!("Hello Windows"); }else if cfg!(target_os = "linux"){ println!("Hello Linux"); }else{ println!("Unknown os");...
2020-01-01 19:12:45
2518
原创 SqlServer死锁与阻塞检测脚本
IF EXISTS (SELECT * FROM sysobjects WHERE [name] = 'sp_Lock_Scan') DROP PROCEDURE sp_Lock_ScanGOCREATE PROCEDURE sp_Lock_ScanAS DECLARE @SPID INT DECLARE @BLK INT DECLARE @Count INT DECLARE @
2015-10-19 15:24:24
765
原创 SqlDbType与DbType这间的转换关系
SqlDbType => DbTypeSqlDbType.BigInt DbType.Int64SqlDbType.Binary DbType.BinarySqlDbType.Bit DbType.BooleanSqlDbType.Char DbType.AnsiStringFixedLengthSqlDbType.DateTime DbType.Da
2015-10-13 16:07:02
2293
原创 在Excel中创建和使用ServerDocument
ServerDocument是微软提供的一种读取Word或Excel文档级应用中CachedData的工具。本示例将向你展示如何使用用ServerDocument。 1. 创建文档级应用打开Visual Studio,新建一个Excel Workbook应用2. 创建数据模型在类库中,建产一个名为“ContractTable”的数据表。
2013-08-11 20:35:55
1348
原创 Outlook 2010中添加自定义Form并使用VB代码处理事务的示例
在Outlook中用户能在不同层次上定义一些自定义的Form来方便Outlook中的一些具有自己个性的事务的处理。本示例将重现这个开发过程。在开始重现前我们先做如下约定以保证示例能被正确理解:1. 你已经熟知Custom Form与Organizational Forms Library(企业窗体),Personal FormsLibrary(个人窗体),Outlook Fo
2013-03-23 19:11:28
2573
原创 获取Outlook的起始文件夹-VSTO
实现环境:Visual Studio 2010 Uiltmate, Office 2010using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Xml.Linq;using Outlook = Microsoft.Office.Interop.Out
2013-02-28 20:34:55
895
原创 C#汉字判断的实现
看了http://bbs.youkuaiyun.com/topics/380159364 觉得很有意思,在这是做了一些还原。在此与大家分享:/** * 作者:许阳 * 日期:2013年2月28日 * 简述: * */using System;using System.Collections.Generic;using System.Linq;using System.Text;usi
2013-02-28 20:20:17
724
原创 在控制台程序中Application.Documents.Open方法失效
这个可能跟DCOM的设定有关。请尝试以下步骤去解决它:打开dcomcnfg.exe->Computer->Local Computer->Config DOCOM->搜索Microsoft Word 97-2003 Document->Properties->Identity->把Launching User改为Interactive User
2013-02-12 16:46:38
1552
原创 Word 刚启动是写在add-in中的NewDocument事件为什么不会被触发
因为NewDocument事件结束在ThisAddIn_Startup方法之前,也就是说在NewDocument事件被订阅之前这个事件就已经执行完毕了。
2013-02-05 09:44:59
798
原创 在Excel 中存在两种ListBox
在Excel中存在着Excel.ListBox和MsForms.ListBox两种ListBox。其中Excel.ListBox是隐藏的,你在ObjectView窗体中是不可见的(如果你想看到这个类请在ObjectView窗体上点击右键选择"Show Hidden Members"/”显示隐含成员“)。在Excel的VBA项目中这个隐藏的Excel.ListBox被视为ListBox所指向的类
2013-01-31 14:53:42
2276
原创 Office 2013 PIA 组件的GUID
Primary interop assemblyOffice 2013 Component IDOffice 2013 Component ID [64 bit]Excel{C8A65ABE-3270-4FD7-B854-50C8082C8F39}{E3BD1151-B9CA-4D45-A77E-51A6E0ED322A}
2013-01-24 13:22:45
2256
原创 动态内容控件应用(一)
例程目的:在一个表格中,当选择"None"前的CheckBox后,表格中的其他CheckBox会消失(以防错选)。当取消选择后CheckBox会重新出现。如图:说明:此前必须将"None"前CheckBox的Title设定为"None"。Option ExplicitPrivate Sub Document_ContentControlOnEnter(ByVal Con
2013-01-24 13:06:33
972
原创 OpenXml获取被保护Sheet的密码并解除保护
using System;using System.Collections.Generic;using System.Linq;using System.Text;using DocumentFormat.OpenXml.Spreadsheet;using com.mksword.Net.OpenXmlTools;using com.mksword.OpenXmlUtil_log4ne
2013-01-16 08:58:08
1670
原创 调COM向Sheet1的Range("A1")添加内容
// InsertAfterSheets.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include HRESULT AutoWrap(int autoType, VARIANT *pvResult, IDispatch *pDisp, LPOLESTR ptName
2013-01-15 11:49:58
1173
原创 Office 2010下VBA Addressof的应用
在VBA中Addressof不能在Class或Form中使用,只有Module模式下才能使用Addressof以面是一个计时器的例子:Form1中代码:Private Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As LongPrivate Sub Comm
2013-01-14 10:47:27
3026
原创 C#中利用反射操作私有字段与私有方法
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;namespace ConsoleApplication14{ class Program { static void Main(string
2013-01-01 15:58:00
1338
原创 在Word 中用C#查找Wingdings符号
在Word我们通常在VBA或VB.NET环境下以如下方式查找Wingdings符号: Dim wdApp As Word.Application = Globals.ThisDocument.Application Dim wdDoc As Word.Document = wdApp.ActiveDocument Dim wdRange As Wo
2012-12-31 15:10:31
2400
原创 调用COM新建一个空白文档并加入链接
// AddHyperLinkViaCom.cpp : Defines the entry point for the console application.//#include "stdafx.h"HRESULT AutoWrap(int autoType, VARIANT *pvResult, IDispatch *pDisp, LPOLESTR ptName, int cAr
2012-12-28 09:11:32
1289
原创 调用COM接口建立一个AppointmentItem并在Body中添加链接
// Outlook_AddLink.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include HRESULT AutoWrap(int autoType, VARIANT *pvResult, IDispatch *pDisp, LPOLESTR ptName,
2012-12-27 18:54:13
1099
原创 CLR C++ Set Word CustomDocumentProperties
// WordIssue.cpp : main project file.#include "stdafx.h"using namespace System;using namespace System::Reflection;#define Office Microsoft::Office#define Word Office::Interop::Word#define Core
2012-12-04 13:43:07
1020
转载 一个调用Shell的VBA程序
这个程序很强大但是如果参数错了同样要出问题,这里提供一个示例:=ShellAndWait("cmd",1000,4,2) 结果应为0Option ExplicitOption Compare Text ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''
2012-11-28 10:36:06
3422
原创 VBA Word CustomXMLPart 中在指定的Node"前添加Node
网上我看见有人想用InsertNodeBefore来实现这个想法。代码如下:Sub HowDoesInsertNodeBeforeWork()Dim oCXPart As CustomXMLPartDim oCXNode As CustomXMLNodeDim strXML As StringstrXML = "" _ & "" _ & "Ham
2012-11-26 17:29:56
1199
用OpenXml向Word文档尾部添加text content控件
2011-12-28
用OpenXml创建一个带页码的Word文档
2011-12-27
最简单的Excel文档(OpenXml Format)
2011-12-15
Outlook的Globalization和RibbonX
2011-12-15
RibbonX动态生成ComboBox,DropDown的Item
2011-12-15
OpenXmlSDK2.0向PowerPoint2010中插入新幻灯片
2011-12-07
Word Document-Level 应用:在光标处插入文字后光标后移
2011-11-30
Outlook打开会话相关的所有邮件
2011-11-28
InsertTextToCurrentSlide
2012-06-25
Openxml 修改Excel指定单元格
2012-05-24
SlideShowNextSlideEvent
2012-04-11
Outlook Windows Forum Automation
2012-03-06
Open Shared Calendars
2012-02-24
OpenXmlAddDelTableCollumn
2012-02-01
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人