梳排序(Comb sort)是一种由Wlodzimierz Dobosiewicz于1980年所发明的不稳定排序算法,并由Stephen Lacey和Richard Box于1991年四月号的Byte杂志中推广。梳排序是改良自冒泡排序和快速排序。在冒泡排序算法中,只比较阵列中相邻的二项,即比较的二项...
分类:
其他好文 时间:
2014-10-09 02:33:07
阅读次数:
145
在剖析该问题前请看如下代码Java代码publicstaticStringbytes2HexString(byte[]b){Stringret="";for(inti=0;i<b.length;i++){Stringhex=Integer.toHexString(b[i]&0xFF);if(hex....
分类:
编程语言 时间:
2014-10-08 18:11:05
阅读次数:
216
CIPAddressCtrl m_ipCtrl;1、获取控件IP值int GetAddress(byte& byteFirst, byte& byteTwo, byte& byteThree, byte& byteFour);int GetAddress(DWORD& dwAddress);byte...
分类:
其他好文 时间:
2014-10-08 00:52:44
阅读次数:
275
#include
typedef int* int_ptr;
typedef unsigned char* byte_ptr;
void show_bytes( byte_ptr start, int len ){
int i;
for( i = 0; i < len; ++i ){
printf( " %4.2x", start[i] );
}
printf( "\n"...
分类:
其他好文 时间:
2014-10-07 13:34:43
阅读次数:
164
//c++:HANDLE(void*)----c#:System.IntPtr//c++:Byte(unsignedchar)----c#:System.Byte//c++:SHORT(short)----c#:System.Int16//c++:WORD(unsignedshort)---c#:S...
分类:
编程语言 时间:
2014-10-06 22:10:10
阅读次数:
215
一、概述JAVA中一共有8种数据类型,分别是byte short int long boolean float double char,与此相对应的,有8个类与它们分别对应:byte Byteshort Shortint Integerlong Longboolean Booleanflo...
分类:
编程语言 时间:
2014-10-05 22:32:58
阅读次数:
336
编码:
byte[]?bytes=Encoding.Default.GetBytes("要转换的字符串");
Convert.ToBase64String(bytes);
解码:
//"ztKwrsTj"是“我爱你”的base64编码
byte[]?outputb?=?Convert.FromBase64String("ztKwrsTj"...
分类:
其他好文 时间:
2014-10-05 16:56:08
阅读次数:
177
一,知道像素数和位数求图像文件的大小
每个像素为16位,图像为1600*1200像素,求容量:
1600*1200*16/8
注:16位,可以表示2^16种颜色,也就是每个点需要两个Byte(16/8)
二,知道像素数和色数求图像文件的大小
1600*1200像素,256色的图像,求容量:
1600*1200*log(256)/8
注:256,是2...
分类:
其他好文 时间:
2014-10-04 20:08:07
阅读次数:
158
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
SubmitStatus
Description
The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election cam...
分类:
其他好文 时间:
2014-10-04 18:40:57
阅读次数:
265
在串口编程中,肯定需要用到RCR验证码来判断接受到的数据是否正确,下面是百度的RCR验证码,测试正确的。 1 private void CalculateCRC(byte[] pByte, int nNumberOfBytes, out byte hi, out byte lo) 2 ...
分类:
其他好文 时间:
2014-10-04 12:42:06
阅读次数:
190