-
nikle
照书上写的一个小程序,已经测试过没有问题(According to the book written by a small program, no problem has been tested)
- 2011-09-28 08:43:13下载
- 积分:1
-
通用ID生成器
UKG(Unique Key Generate Server)是一个生成唯一ID的服务器, 是根据Twitter的snowflake算法写成的, 主要用于高效的生成唯一的ID, 核心就是毫秒级时间(41位)+机器ID(10位)+毫秒内序列(12位).
其原理结构如下:
00000000000 0000000000 0000000000 0000000000 0 | 00000 |00000 | 0000000000 00
---------------------------------------------- ----- ----- -------------
时间戳 | workerId | datacenterId | 毫秒内序列
UKG每秒能够
- 2022-07-27 06:05:21下载
- 积分:1
-
RobotCamDemoVBT
相机的sd刚学封装的可以看看,其中封装了两个相机,也可自行添加多相机(Two cameras are packed and multiple cameras can be added to the camera)
- 2017-11-09 10:34:59下载
- 积分:1
-
c# 扫描IP Http Header
c# 扫描IP Http Headerusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Threading;using System.IO;namespace HScan{ public partial class Form1 : Form { int _currentThreads = 0; int _maxThreads = 100; Thread main = null; Thread mt = null; List threads = new List(); public Form1() { InitializeComponent(); Control.CheckForIllegalCrossThreadCalls = false; } private void btnStart_Click(object sender, EventArgs e) { btnStart.Enabled = false; if (txtStart.Text.Trim() == "") { MessageBox.Show("起始IP不能为空."); return; } if (txtEnd.Text.Trim() == "") { MessageBox.Show("结束IP不能为空."); return; } int ts = Convert.ToInt32(txtThreads.Text); _maxThreads = ts; string startIp = txtStart.Text; string endIp = txtEnd.Text; TParameter tp=new TParameter(); tp.StartIp=startIp; tp.EndIp=endIp; tp.ThreadCount=ts; main = new Thread(new ParameterizedThreadStart(StartMe)); main.Start(tp); } protected void ThreadManage() { Thread c=null; while (true) { System.Object lockThis = new System.Object(); lock (lockThis) { for (int i = 0; i < threads.Count; i ) { if (threads[i] != null && !threads[i].IsAlive) { c = threads[i]; break; } } if (c != null) { threads.Remove(c); } } } } protected void StartMe(object ob) { mt = new Thread(new ThreadStart(ThreadManage)); mt.Start(); TParameter p = ob as TParameter; string curIp = p.StartIp; while (true) { for (int i = 0; i < _maxThreads; i ) { if (curIp != "") { if (_currentThreads >= _maxThreads) break; System.Object lockThis = new System.Object(); lock (lockThis) { _currentThreads ; if (_currentThreads > _maxThreads) _currentThreads = _maxThreads; string tip = curIp; Thread t = new Thread(new ParameterizedThreadStart(Run)); t.Start(tip); threads.Add(t); curIp = IPUtility.getLastIp(curIp, p.EndIp, 1); } } else { break; } } } } protected void Run(object ob) { string ip = ob.ToString(); SocketGetHead h = new SocketGetHead(); string ret = h.GetHtml(ip, 80); if (ret.IndexOf("DVRDVS-Webs") > 0) { ListViewItem item = new ListViewItem(); item.SubItems[0].Text = (listView1.Items.Count 1).ToString(); ListViewItem.ListViewSubItem lvSubItem = new ListViewItem.ListViewSubItem(); lvSubItem.Text = ip; item.SubItems.Add(lvSubItem); lvSubItem = new ListViewItem.ListViewSubItem(); lvSubItem.Text = "DVRDVS-Webs"; item.SubItems.Add(lvSubItem); listView1.Items.Add(item); } System.Object lockThis = new System.Object(); lock(lockThis) { lblCurIp.Text = ip; _currentThreads--; if (_currentThreads < 0) _currentThreads = 0; } } private void tsmCopy_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { string ip = listView1.SelectedItems[0].SubItems[1].Text; Clipboard.SetText(ip); } } private void tsmExport_Click(object sender, EventArgs e) { StreamWriter writer = new StreamWriter(AppDomain.CurrentDomain.BaseDirectory "\export.txt",true); foreach (ListViewItem item in listView1.Items) { string ip=item.SubItems[1].Text; writer.WriteLine(ip); writer.Flush(); } writer.Flush(); writer.Close(); MessageBox.Show("导出成功!"); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { try { if (mt != null) { mt.Interrupt(); mt.Abort(); } foreach (Thread t in threads) { t.Interrupt(); t.Abort(); } if (main != null) { main.Interrupt(); main.Abort(); } } catch { } Thread.Sleep(5000); } private void btnStop_Click(object sender, EventArgs e) { try { if (mt != null) { mt.Interrupt(); mt.Abort(); } foreach (Thread t in threads) { t.Interrupt(); t.Abort(); } if (main != null) { main.Interrupt(); main.Abort(); } } catch { } btnStart.Enabled = true; } }}
- 2014-06-23下载
- 积分:1
-
matrix
在VC中用Matlab引擎计算实对称矩阵特征值和特征向量。.mor0为矩阵输入文件,.mor位结果输出文件。(Calculated using Matlab engine in the VC real symmetric matrix eigenvalues and eigenvectors. . Mor0 matrix input files,. Mor-bit result output file.)
- 2011-09-27 15:06:37下载
- 积分:1
-
Com 端口的示例
/ * BaudRate設定列舉 * /
公共枚举 BaudRateFlag: uint
{
CBR_110 = 110,
CBR_300 = 300,
CBR_600 = 600,
CBR_1200 = 1200,
CBR_2400 = 2400、
CBR_4800 = 4800,
CBR_9600 = 9600,
CBR_14400 = 14400,
CBR_19200 = 19200,
CBR_38400 = 38400,
CBR_57600 = 57600,
CBR_115200 = 115200,
CBR_128000 = 128000,
CBR_256000 = 256000,
}
/ * DTR控制列舉 * /
公共枚举 DtrControlFlag
{
DTR_CONTROL_DISABLE = 0X00,
DTR_CONTROL_ENABLE = 0X01,
DTR_CONTROL_HANDSHAKE = 0X02,
}
/ * RTS控制列舉 * /
公共枚举 RtsControlFlag
{
RTS_CONTROL_DISABLE = 0X00,
RTS_CONTROL_ENABLE = 0X01,
RTS_CONTROL_HANDSHAKE = 0X02,
RTS_CONTROL_TOGGLE = 0X03,
}
/ * 清除通訊緩衝區列舉 * /
公共枚举 PurgeCommFlag: uint
{
PURGE_TXABORT = 0X0001,
PURGE_RXABORT = 0X0002,
PURGE_TXCLEAR = 0X0004,
PURGE_RXCLEAR = 0X0008,
}
- 2023-04-04 01:45:04下载
- 积分:1
-
C-Pocket-Reference.chm
C pocket Reference Doc
- 2012-06-29 13:45:42下载
- 积分:1
-
468457636
弹出框口,精选ios编程学习源码,很好的参考资料。(Pop up box, select learning IOS programming source code, a good reference.)
- 2013-12-07 11:17:26下载
- 积分:1
-
VideoView-
使用opencv来进行视频的播放,可以播放绝大部分格式的视频(Use opencv for video playback, you can play most of the video formats)
- 2015-06-29 13:47:45下载
- 积分:1
-
RC522-I2C(0004)
这是一个RC522的驱动程序,单片机采用STM32内部含有模块的原理图(This is a RC522 driver, microcontroller using STM32 internal module containing schematics)
- 2020-07-01 18:20:02下载
- 积分:1