分类
- .net (22)
- adf (11)
- android (3)
- article (236)
- astronomy (1)
- block chain (8)
- C# Code (9)
- c/c++ (2)
- cache (8)
- cloud (2)
- consensus (3)
- css (2)
- cve (1)
- db (55)
- digest (1)
- english (1)
- finance (2)
- go (3)
- gps (2)
- hardware (1)
- html (2)
- http (2)
- info (19)
- iot (1)
- it (3)
- java (30)
- javascript (6)
- jsp (2)
- linux (76)
- mail (14)
- math (1)
- message (8)
- mood (4)
- mq (2)
- network (22)
- php (9)
- protocol (4)
- push/pull (2)
- python (5)
- rpc (2)
- search (4)
- servlet (1)
- space (24)
- storage (15)
- technologys (103)
- templete (1)
- virtual machine (7)
- web server (37)
- windows (12)
-
近期文章
其他操作
链接
年归档:2012年
ADO RS.OPEN
recordset.Open Source,ActiveConnection,CursorType,LockType,Options
可以写成:
rs.open SQL语句,conn对象,3(游标类型),2(锁定方法)
Source
Recordset对象可以通过Source属性来连接Command对象。Source参数可以是一个Command对象名称、一段SQL命令、一个指定的数据表名称或是一个Stored Procedure。假如省略这个参数,系统则采用Recordset对象的Source属性。
ActiveConnection
Recordset对象可以通过ActiveCon... 继续阅读
轻量级 Lock Free 线程安全的 Queue 的C#2.0实现
2.0里面又没有ConcurrentCollection的相关类
不得已,自己写了一个,
本来想用传统的lock实现的, 不过考虑到其中的操作非常轻量级...最终还是用了Lock Free
使用原子操作 InterLocked 替换掉常用的lock关键字
Try起头的方法都有尝试次数限制,超过限制以后就退出并返回false
public sealed class SafedQueue<T> { #region private Fields private int isTaked = 0; private Queue<T&g...
HTML固定表头Table 简单实现
IE:
<div style="height: 250px; overflow: auto;">
<table border=1>
<tr style="background-color:red;position:relative;top:expression(this.offsetParent.scrollTop);">
<th>
 ...
c# 四舍五入
C# 中没有四舍五入函数,程序语言都没有四舍五入函数,因为四舍五入算法不科学,国际通行的是 Banker 舍入法
Bankers rounding(银行家舍入)算法,即四舍六入五取偶。事实上这也是 IEEE 规定的舍入标准。因此所有符合 IEEE 标准的语言都应该是采用这一算法的
Math.Round 方法默认的也是 Banker 舍入法
在 .NET 2.0 中 Math.Round 方法有几个重载方法
Math.Round(Decimal, MidpointRounding)
Math.Round(Double, MidpointRounding)
Math.Round(Dec...
获取文件长度(含网络)
/// <summary> /// 获取文件长度,可为本地或网络 /// </summary> /// <param name="url"></param> protected long GetFileLength(string url) { if (string.IsNullOrEmpty(url)) return 0; long length = 0;
mongodb 操作符
条件操作符
$gt : >
$lt : <
$gte: >=
$lte: <=
$ne : !=、<>
$in : in
$nin: not in
$all: all
$not: 反匹配(1.3.3及以上版本)
继续阅读
Generating Extended Validation (EV) SSL Certificates
Just did a project for the “Innovation” team of a large corp. They wanted to see the EV SSL certificates make the IE 7 browser to go green on their test site.
To generate the EV SSL Cert request, I used the following extensions in the openssl .cnf file:
[ ev_req ]
basicConstraints = CA:FALSE
keyUsage ...
OpenSSL Command
NAME
ca - sample minimal CA application
SYNOPSIS
opensslca [-verbose] [-configfilename] [-namesection] [-gencrl] [-revokefile] [-crl_reasonreason]
[-crl_holdinstruction] [-crl_compromiset... 继续阅读
发表在 article
OpenSSL Command已关闭评论
openssl的证书格式转换
PKCS 全称是 Public-Key Cryptography Standards ,是由 RSA 实验室与其它安全系统开发商为促进公钥密码的发展而制订的一系列标准,PKCS 目前共发布过 15 个标准。 常用的有:
PKCS#7 Cryptographic Message Syntax Standard
PKCS#10 Certification Request Standard
PKCS#12 Personal Information Exchange Syntax Standard
X.509是常见通用的证书格式。所有的证书都符合为Public Key Infras...
OpenSSL 配置说明
########################
# OpenSSL 配置文件示范 #
########################
# [注意]这个示范文件并不是默认设置。 HOME = . # 默认的随机数种子文件,建议设置为 /dev/random 或 /dev/urandom
RANDFILE = $ENV::HOME/.rnd # 扩展对象定义
# 比如,OpenSSL中并未定义X.509证书的扩展项,在使用到的时候就会从下面...
OpenSSL subjectAltName
SubjectAltNames
It is possible to arrange for a certificate to apply to more than one host (or Common Name) by using a certificate extension. Doing so requires
- modifying the openssl configuration file
- supplying the extra name information.
OpenSSL configuration file
I needed two modifications for the Op...
基于 OpenSSL 的 CA 建立及证书签发
建立 CA
建立 CA 目录结构
按照 OpenSSL 的默认配置建立 CA ,需要在文件系统中建立相应的目录结构。相关的配置内容一般位于 /usr/ssl/openssl.cnf 内,详情可参见 config (1) 。在终端中使用如下命令建立目录结构:
$ mkdir -p ./demoCA/{private,newcerts}
$ touch ./demoCA/index.txt
$ echo 01 > ./demoCA/serial
产生的目录结构如下:
.
`-- demoCA/
|-- index.txt
&nbs...
Sphinx索引
Sphinx是一个基于SQL的全文检索引擎,可以结合MySQL,PostgreSQL做全文搜索,它可以提供比数据库本身更专业的搜索功能,使得应用程序更容易实现专业化的全文检索。Sphinx特别为一些脚本语言设计搜索API接口,如PHP,Python,Perl,Ruby等,同时为MySQL也设计了一个存储引擎插件。
Sphinx 单一索引最大可包含1亿条记录,在1千万条记录情况下的查询速度为0.x秒(毫秒级)。Sphinx创建索引的速度为:创建100万条记录的索引只需 3~4分钟,创建1000万条记录的索引可以在50分钟内完成,而只包含最新10万条记录的增量索引,重建一次只需几十秒。
Sphinx的...
构建实时索引
所谓事务性,本多指数据库的属性,包括ACID四个基本要素:原子性(Atomicity)、一致性(Consistency)、隔离性(Isolation)、持久性(Durability)。
我们这里主要讨论隔离性,Lucene的IndexReader和IndexWriter具有隔离性。
- 当IndexReader.open打开一个索引的时候,相对于给当前索引进行了一次snapshot,此后的任何修改都不会被看到。
- 仅当IndexReader.open打开一个索引后,才有可能看到从上次打开后对索引的修改。
- 当IndexWriter没有调用Commit的时候,其修改的内容是不能够被看到的,哪怕IndexRead...
NOTEPAD++添加右键菜单
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\Shell\Open With NotePad++]
[HKEY_CLASSES_ROOT\*\Shell\Open With NotePad++\Command]
@="\"C:\\Program Files (x86)\\Notepad++\\notepad++.exe\" \"%1\""
发表在 info
NOTEPAD++添加右键菜单已关闭评论