带你人工识别C#开源库BarcodeLib生成的一维码Code128

news2024/11/26 0:29:05

我们是做HIS系统开发的,前段时间发现某些处方的一维码出现无法识别的情况。看了一下一维码生成的逻辑,使用到了BarcodeLib库,经过反复确认,我们程序是没有问题的。后面不得不反编译看一下BarcodeLib生成一维码的逻辑。最后调整一维码的宽度解决了问题。而且发现它的编码和通信领域的编码思想有神奇的相似之处。编码格式类型:开始位+数据位+检查校验位+STOP停止位+11。总的来说是解密和编码都是查表法,如要把数字69进行编码,通过查表可以知道编码的结果为:10110010000。 解密就是逆过程,如知道编码为10110010000,通过查表,也可以知道编码前的数字为69

这里简单介绍一下BarcodeLib库Code128一维码的编码过程:

1   先把数字如:6986081进行编码,两个数字作为一组进行编码,这里数字69一组,86一组,08一组,剩下一个1就比较特别,源码看得不是很懂,有特殊的规则进行编码

2  把两位数字通过查表法进行编码,编码为11位的0或1数字。如数字69编码为10110010000

3  通过C#的绘图类Graphics的画线方法.DrawLine进行绘制线,如要绘制10110010000编码,碰到1就纵向绘制一定宽度的直线,碰到0就不绘制直线。

下面我们一起来分析一下这个一维码:

先告知一下这个一维码的值为:6986081

通过上图的分析,上图的编码可以编码为:

1101001110010110010000111101001001000110010011101011110
10011100110100010001101100011101011

按照11位进行分组整理后如下:

11010011100
10110010000
11110100100 
10001100100
11101011110
10011100110
10001000110 
11000111010 
11

通过编码11010011100查找本文后面的编码表得到的数值为START_C

通过编码10110010000查找本文后面的编码表得到的数值为69

通过编码10001100100查找本文后面的编码表得到的数值为08

通过编码11101011110查找本文后面的编码表得到的数值为CODE_A

通过编码10011100110 查找本文后面的编码表得到的数值为17,但前面有一个CODE_A,应该编码为1

通过编码10001000110查找本文后面的编码表得到的数值为C,则为检查校验位

通过编码11000111010查找本文后面的编码表得到的数值为STOP,则为停止位

最后两位11应该也是校验位吧。

最后汇总如下:

11010011100    START_C 开始  
10110010000    69
11110100100    86
10001100100    08
11101011110    CODE_A
10011100110    这个是编1而不是17
10001000110    检查校验位
11000111010    STOP停止位
11

最后一维码的解码结果为:6986081

补充说明:

BarcodeLib库Code128编码表如下,偷懒一点,就直接贴源码了


private void init_Code128()
{
			this.C128_Code.CaseSensitive = true;
			this.C128_Code.Columns.Add("Value", typeof(string));
			this.C128_Code.Columns.Add("A", typeof(string));
			this.C128_Code.Columns.Add("B", typeof(string));
			this.C128_Code.Columns.Add("C", typeof(string));
			this.C128_Code.Columns.Add("Encoding", typeof(string));
			this.C128_Code.Rows.Add(new object[]
			{
				"0",
				" ",
				" ",
				"00",
				"11011001100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"1",
				"!",
				"!",
				"01",
				"11001101100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"2",
				"\"",
				"\"",
				"02",
				"11001100110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"3",
				"#",
				"#",
				"03",
				"10010011000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"4",
				"$",
				"$",
				"04",
				"10010001100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"5",
				"%",
				"%",
				"05",
				"10001001100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"6",
				"&",
				"&",
				"06",
				"10011001000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"7",
				"'",
				"'",
				"07",
				"10011000100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"8",
				"(",
				"(",
				"08",
				"10001100100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"9",
				")",
				")",
				"09",
				"11001001000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"10",
				"*",
				"*",
				"10",
				"11001000100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"11",
				"+",
				"+",
				"11",
				"11000100100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"12",
				",",
				",",
				"12",
				"10110011100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"13",
				"-",
				"-",
				"13",
				"10011011100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"14",
				".",
				".",
				"14",
				"10011001110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"15",
				"/",
				"/",
				"15",
				"10111001100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"16",
				"0",
				"0",
				"16",
				"10011101100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"17",
				"1",
				"1",
				"17",
				"10011100110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"18",
				"2",
				"2",
				"18",
				"11001110010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"19",
				"3",
				"3",
				"19",
				"11001011100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"20",
				"4",
				"4",
				"20",
				"11001001110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"21",
				"5",
				"5",
				"21",
				"11011100100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"22",
				"6",
				"6",
				"22",
				"11001110100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"23",
				"7",
				"7",
				"23",
				"11101101110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"24",
				"8",
				"8",
				"24",
				"11101001100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"25",
				"9",
				"9",
				"25",
				"11100101100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"26",
				":",
				":",
				"26",
				"11100100110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"27",
				";",
				";",
				"27",
				"11101100100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"28",
				"<",
				"<",
				"28",
				"11100110100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"29",
				"=",
				"=",
				"29",
				"11100110010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"30",
				">",
				">",
				"30",
				"11011011000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"31",
				"?",
				"?",
				"31",
				"11011000110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"32",
				"@",
				"@",
				"32",
				"11000110110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"33",
				"A",
				"A",
				"33",
				"10100011000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"34",
				"B",
				"B",
				"34",
				"10001011000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"35",
				"C",
				"C",
				"35",
				"10001000110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"36",
				"D",
				"D",
				"36",
				"10110001000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"37",
				"E",
				"E",
				"37",
				"10001101000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"38",
				"F",
				"F",
				"38",
				"10001100010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"39",
				"G",
				"G",
				"39",
				"11010001000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"40",
				"H",
				"H",
				"40",
				"11000101000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"41",
				"I",
				"I",
				"41",
				"11000100010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"42",
				"J",
				"J",
				"42",
				"10110111000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"43",
				"K",
				"K",
				"43",
				"10110001110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"44",
				"L",
				"L",
				"44",
				"10001101110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"45",
				"M",
				"M",
				"45",
				"10111011000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"46",
				"N",
				"N",
				"46",
				"10111000110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"47",
				"O",
				"O",
				"47",
				"10001110110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"48",
				"P",
				"P",
				"48",
				"11101110110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"49",
				"Q",
				"Q",
				"49",
				"11010001110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"50",
				"R",
				"R",
				"50",
				"11000101110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"51",
				"S",
				"S",
				"51",
				"11011101000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"52",
				"T",
				"T",
				"52",
				"11011100010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"53",
				"U",
				"U",
				"53",
				"11011101110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"54",
				"V",
				"V",
				"54",
				"11101011000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"55",
				"W",
				"W",
				"55",
				"11101000110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"56",
				"X",
				"X",
				"56",
				"11100010110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"57",
				"Y",
				"Y",
				"57",
				"11101101000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"58",
				"Z",
				"Z",
				"58",
				"11101100010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"59",
				"[",
				"[",
				"59",
				"11100011010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"60",
				"\\",
				"\\",
				"60",
				"11101111010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"61",
				"]",
				"]",
				"61",
				"11001000010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"62",
				"^",
				"^",
				"62",
				"11110001010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"63",
				"_",
				"_",
				"63",
				"10100110000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"64",
				"\0",
				"`",
				"64",
				"10100001100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"65",
				Convert.ToChar(1).ToString(),
				"a",
				"65",
				"10010110000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"66",
				Convert.ToChar(2).ToString(),
				"b",
				"66",
				"10010000110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"67",
				Convert.ToChar(3).ToString(),
				"c",
				"67",
				"10000101100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"68",
				Convert.ToChar(4).ToString(),
				"d",
				"68",
				"10000100110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"69",
				Convert.ToChar(5).ToString(),
				"e",
				"69",
				"10110010000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"70",
				Convert.ToChar(6).ToString(),
				"f",
				"70",
				"10110000100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"71",
				Convert.ToChar(7).ToString(),
				"g",
				"71",
				"10011010000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"72",
				Convert.ToChar(8).ToString(),
				"h",
				"72",
				"10011000010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"73",
				Convert.ToChar(9).ToString(),
				"i",
				"73",
				"10000110100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"74",
				Convert.ToChar(10).ToString(),
				"j",
				"74",
				"10000110010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"75",
				Convert.ToChar(11).ToString(),
				"k",
				"75",
				"11000010010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"76",
				Convert.ToChar(12).ToString(),
				"l",
				"76",
				"11001010000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"77",
				Convert.ToChar(13).ToString(),
				"m",
				"77",
				"11110111010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"78",
				Convert.ToChar(14).ToString(),
				"n",
				"78",
				"11000010100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"79",
				Convert.ToChar(15).ToString(),
				"o",
				"79",
				"10001111010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"80",
				Convert.ToChar(16).ToString(),
				"p",
				"80",
				"10100111100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"81",
				Convert.ToChar(17).ToString(),
				"q",
				"81",
				"10010111100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"82",
				Convert.ToChar(18).ToString(),
				"r",
				"82",
				"10010011110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"83",
				Convert.ToChar(19).ToString(),
				"s",
				"83",
				"10111100100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"84",
				Convert.ToChar(20).ToString(),
				"t",
				"84",
				"10011110100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"85",
				Convert.ToChar(21).ToString(),
				"u",
				"85",
				"10011110010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"86",
				Convert.ToChar(22).ToString(),
				"v",
				"86",
				"11110100100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"87",
				Convert.ToChar(23).ToString(),
				"w",
				"87",
				"11110010100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"88",
				Convert.ToChar(24).ToString(),
				"x",
				"88",
				"11110010010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"89",
				Convert.ToChar(25).ToString(),
				"y",
				"89",
				"11011011110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"90",
				Convert.ToChar(26).ToString(),
				"z",
				"90",
				"11011110110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"91",
				Convert.ToChar(27).ToString(),
				"{",
				"91",
				"11110110110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"92",
				Convert.ToChar(28).ToString(),
				"|",
				"92",
				"10101111000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"93",
				Convert.ToChar(29).ToString(),
				"}",
				"93",
				"10100011110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"94",
				Convert.ToChar(30).ToString(),
				"~",
				"94",
				"10001011110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"95",
				Convert.ToChar(31).ToString(),
				Convert.ToChar(127).ToString(),
				"95",
				"10111101000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"96",
				Convert.ToChar(202).ToString(),
				Convert.ToChar(202).ToString(),
				"96",
				"10111100010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"97",
				Convert.ToChar(201).ToString(),
				Convert.ToChar(201).ToString(),
				"97",
				"11110101000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"98",
				"SHIFT",
				"SHIFT",
				"98",
				"11110100010"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"99",
				"CODE_C",
				"CODE_C",
				"99",
				"10111011110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"100",
				"CODE_B",
				Convert.ToChar(203).ToString(),
				"CODE_B",
				"10111101110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"101",
				Convert.ToChar(203).ToString(),
				"CODE_A",
				"CODE_A",
				"11101011110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"102",
				Convert.ToChar(200).ToString(),
				Convert.ToChar(200).ToString(),
				Convert.ToChar(200).ToString(),
				"11110101110"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"103",
				"START_A",
				"START_A",
				"START_A",
				"11010000100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"104",
				"START_B",
				"START_B",
				"START_B",
				"11010010000"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"105",
				"START_C",
				"START_C",
				"START_C",
				"11010011100"
			});
			this.C128_Code.Rows.Add(new object[]
			{
				"",
				"STOP",
				"STOP",
				"STOP",
				"11000111010"
			});
}

                                                           


 

通过阅读BarCode类生成图片的源码,如下:

private Bitmap Generate_Image()
		{
			if (this.Encoded_Value == "")
			{
				throw new Exception("EGENERATE_IMAGE-1: Must be encoded first.");
			}
			Bitmap bitmap = null;
			DateTime now = DateTime.Now;
			TYPE encoded_Type = this.Encoded_Type;
			if (encoded_Type != TYPE.ITF14)
			{
				bitmap = new Bitmap(this.Width, this.Height);
				int num = this.Width / this.Encoded_Value.Length;
				int num2 = 1;
				if (this.Encoded_Type == TYPE.PostNet)
				{
					num2 = 2;
				}
				int num3;
				switch (this.Alignment)
				{
				case AlignmentPositions.CENTER:
					num3 = this.Width % this.Encoded_Value.Length / 2;
					break;
				case AlignmentPositions.LEFT:
					num3 = 0;
					break;
				case AlignmentPositions.RIGHT:
					num3 = this.Width % this.Encoded_Value.Length;
					break;
				default:
					num3 = this.Width % this.Encoded_Value.Length / 2;
					break;
				}
				if (num <= 0)
				{
					throw new Exception("EGENERATE_IMAGE-2: Image size specified not large enough to draw image. (Bar size determined to be less than 1 pixel)");
				}
				int i = 0;
				using (Graphics graphics = Graphics.FromImage(bitmap))
				{
					graphics.Clear(this.BackColor);
					using (Pen pen = new Pen(this.BackColor, (float)(num / num2)))
					{
						using (Pen pen2 = new Pen(this.ForeColor, (float)(num / num2)))
						{
							while (i < this.Encoded_Value.Length)
							{
								if (this.Encoded_Type == TYPE.PostNet)
								{
									if (this.Encoded_Value[i] != '1')
									{
										graphics.DrawLine(pen2, new Point(i * num + num3 + 1, this.Height), new Point(i * num + num3 + 1, this.Height / 2));
									}
									graphics.DrawLine(pen, new Point(i * (num * num2) + num3 + num + 1, 0), new Point(i * (num * num2) + num3 + num + 1, this.Height));
								}
								if (this.Encoded_Value[i] == '1')
								{
									graphics.DrawLine(pen2, new Point(i * num + num3 + 1, 0), new Point(i * num + num3 + 1, this.Height));
								}
								i++;
							}
						}
					}
				}
				if (this.IncludeLabel)
				{
					this.Label_Generic(bitmap);
				}
			}
			else
			{
				bitmap = new Bitmap(this.Width, this.Height);
				int num4 = (int)((double)bitmap.Width / 12.05);
				int num5 = Convert.ToInt32((double)bitmap.Width * 0.05);
				int num = (bitmap.Width - num4 * 2 - num5 * 2) / this.Encoded_Value.Length;
				int num3 = (bitmap.Width - num4 * 2 - num5 * 2) % this.Encoded_Value.Length / 2;
				if (num <= 0 || num5 <= 0)
				{
					throw new Exception("EGENERATE_IMAGE-3: Image size specified not large enough to draw image. (Bar size determined to be less than 1 pixel or quiet zone determined to be less than 1 pixel)");
				}
				int i = 0;
				using (Graphics graphics = Graphics.FromImage(bitmap))
				{
					graphics.Clear(this.BackColor);
					using (Pen pen2 = new Pen(this.ForeColor, (float)num))
					{
						pen2.Alignment = PenAlignment.Right;
						while (i < this.Encoded_Value.Length)
						{
							if (this.Encoded_Value[i] == '1')
							{
								graphics.DrawLine(pen2, new Point(i * num + num3 + num4 + num5, 0), new Point(i * num + num3 + num4 + num5, this.Height));
							}
							i++;
						}
						pen2.Width = (float)bitmap.Height / 8f;
						pen2.Color = this.ForeColor;
						pen2.Alignment = PenAlignment.Inset;
						graphics.DrawLine(pen2, new Point(0, 0), new Point(bitmap.Width, 0));
						graphics.DrawLine(pen2, new Point(0, bitmap.Height), new Point(bitmap.Width, bitmap.Height));
						graphics.DrawLine(pen2, new Point(0, 0), new Point(0, bitmap.Height));
						graphics.DrawLine(pen2, new Point(bitmap.Width, 0), new Point(bitmap.Width, bitmap.Height));
					}
				}
				if (this.IncludeLabel)
				{
					this.Label_ITF14(bitmap);
				}
			}
			this._Encoded_Image = bitmap;
			this._EncodingTime += (DateTime.Now - now).TotalMilliseconds;
			return bitmap;
		}

影响一维码生成结果有

1   AlignmentPositions对齐方式:靠左、居中、靠右和默认

2  一维码的宽度,如果宽度不够,那就绘制的线条不全,就会出现无法识别的问题

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1167410.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Techwalk攻略 | 来北京与OpenHarmony技术大会一起技术漫游!

去北京Citywalk已经不是新鲜事&#xff1f; 不如来第二届OpenHarmony技术大会一起Techwalk&#xff01; 大会即将开幕请速速收藏以下打卡攻略↓ 点击链接&#xff0c;观看线上直播

【从瀑布模式到水母模式:ChatGPT如何赋能软件研发全流程】

你是否曾读过一本让你欲罢不能的计算机书籍&#xff1f;它可能为你打开了新的技术世界大门&#xff0c;或者是帮助你解决了棘手的编程难题。 前言&#xff1a; 计算机技术的发展和互联网的普及&#xff0c;使信息处理和传输变得更加高效&#xff0c;极大地改变了金融、商业、…

服务器搭建:从零开始创建自己的Spring Boot应用【含登录、注册功能】

当然&#xff0c;你可以先按照IDEA搭建SSM框架【配置类、新手向】完成基础框架的搭建 步骤 1&#xff1a;设计并实现服务器端的用户数据库 在这个示例中&#xff0c;我们将使用MySQL数据库。首先&#xff0c;你需要安装MySQL并创建一个数据库以存储用户信息。以下是一些基本步…

分布式事务解决方案之Atomikos

这种方式只适用于 对于真正分布式应用不适用,原因在于 Atomikos需要获得所有数据源 统一进行事务管理 JTA(Java Transaction API)被称为Java事务API,是由Java语言提供的一套解决分布式事务的API标准 XA协议 1 2 31. XA协议是JTA的基础 2. XA协议最早由Tuxedo首先提出,并交给…

ChatGPT、Llama-2等大模型,能推算出你的隐私数据!

ChatGPT等大语言模型的推理能力有多强大&#xff1f;通过你发过的帖子或部分隐私数据&#xff0c;就能推算出你的住址、年龄、性别、职业、收入等隐私数据。 瑞士联邦理工学院通过搜集并手工标注了包含520个Reddit&#xff08;知名论坛&#xff09;用户的个人资料真实数据集Pe…

MySQL导入数据库报错Error Code: 2006

Error Code: 2006 - MySQL server has gone away 因为导入的某张表数据过大导致导入中途失败 , 修改max_allowed_packet 即可解决。 SET GLOBAL max_allowed_packet 1024*1024*200;

Pytest UI自动化测试实战实例

环境准备 序号库/插件/工具安装命令1确保您已经安装了python3.x2配置python3pycharmselenium2开发环境3安装pytest库pip install pytest4安装pytest -html 报告插件pip install pytest-html5安装pypiwin32库(用来模拟按键)pip install pypiwin326安装openpyxl解析excel文件库p…

享受户外的美好时光:花园吊椅的魅力

拥有舒适的花园吊椅&#xff0c;就像在家中创造了一个度假天堂。这些轻松摇摆的座位为您提供了一个完美的地方&#xff0c;既能舒适躺卧&#xff0c;又能让您在家中的花园或庭院中感受到度假的氛围。度过美好时光的吊椅&#xff0c;将成为家庭花园的一大亮点&#xff0c;为您带…

Python某建筑平台数据, 实现网站JS逆向解密

嗨喽&#xff0c;大家好呀~这里是爱看美女的茜茜呐 环境使用: 首先我们先来安装一下写代码的软件&#xff08;对没安装的小白说&#xff09; Python 3.8 / 编译器 Pycharm 2021.2版本 / 编辑器 专业版是付费的 <文章下方名片可获取魔法永久用~> 社区版是免费的 模块…

学生成绩管理神器

在信息化时代&#xff0c;你是否还在为处理大量的学生成绩数据而烦恼&#xff1f;是否还在用传统的方式&#xff0c;手动输入和整理成绩信息&#xff1f;今天&#xff0c;我将向你展示如何利用各种代码和Excel&#xff0c;打造一个学生自助查询成绩的神器&#xff0c;让数据管理…

ClickHouse 学习之基础入门(一)

第 1 章 ClickHouse 入 门 ClickHouse 是俄罗斯的 Yandex 于 2016 年开源的列式存储数据库&#xff08;DBMS&#xff09;&#xff0c;使用 C 语言编写&#xff0c;主要用于在线分析处理查询&#xff08;OLAP&#xff09;&#xff0c;能够使用 SQL 查询实时生成分析数据报告。 …

词典查询工具django-mdict

什么是 django-mdict &#xff1f; django-mdict 不是词典软件&#xff0c;是词典查询的脚本工具&#xff0c;主要目的是解决词典数量多&#xff0c;手机容量不足的问题&#xff0c;是对其他词典软件局域网在线查询功能的补充&#xff0c;是用 django 实现的 mdict 词典查询工具…

递归与快速算法

借鉴&#xff1a; 4分钟彻底掌握递归算法、斐波那契数列、快速排序&#xff0c;不再怕面试&#xff01;_哔哩哔哩_bilibili 可直接观看借鉴里的视频 快速算法

vcruntime140.dll在哪下载?vcruntime140.dll文件说明及其下载方法

vcruntime140.dll在哪下载&#xff1f;为啥还有这样的问题&#xff1f;其实就是你电脑的vcruntime140.dll文件丢失了&#xff0c;你需要重新去下载一个vcruntime140.dll文件&#xff0c;这时候你就会想这个东西到底要去哪里下载&#xff0c;今天我们就来给大家详细的解析一下&a…

AI视频 | Runway的史诗级更新真的那么震撼吗?来看我的试用体验!

就在昨天&#xff0c;Runway&#xff0c;这个生成式AI的领头羊&#xff0c;正式在X上发布了他们史诗级更新 看下视频 【视频2】 这个确实看起来太棒了 注册个账号&#xff0c;看下效果咋样 地址百度哈&#xff0c;注册登录也比较方便 直接邮箱即可 不过我是直接google账号登录的…

从使用的角度看 ByConity 和 ClickHouse 的差异

自 ClickHouse Inc 宣布其重要新功能仅在 ClickHouse Cloud 上开放以来&#xff0c;一些关注 ByConity 开源的社区小伙伴也来询问 ByConity 后续开源规划。为回答社区疑问&#xff0c;我们将之前分享的关于 ByConity 与 ClickHouse 相关功能对比的 webinar 整理为文章&#xff…

MinIO多容器配置NGINX代理实践(docker-compose版本)

以下nginx配置 分别将本机的9001端口代理到minio1,minio2,minio3,minio4主机的9001端口。用于minio后台 分别将本机的9000端口代理到minio1,minio2,minio3,minio4主机的9000端口。用于minioApi events {worker_connections 1024; }http {upstream minio_console {server min…

Selenium元素定位之页面检测技巧

在进行web自动化测试的时候进行XPath或者CSS定位&#xff0c;需要检测页面元素定位是否正确&#xff0c;如果用脚本去检测&#xff0c;那么效率是极低的。 一般网上推选装额外的插件来实现页面元素定位检测 如&#xff1a;firebug。 其实F12开发者工具就能直接在页面上检测元…

广东厂家建筑木模板:桥梁工地施工的理想选择

广东地区一直以来都是中国建筑业的重要制造中心之一。在这个繁忙的地方&#xff0c;建筑行业的发展需要可靠且高质量的建筑材料。在众多的建筑材料中&#xff0c;建筑木模板作为一种重要的施工辅助工具&#xff0c;被广泛应用于桥梁工地的施工中。 广东厂家建筑木模板以其优质的…