基于C#的BarCode 39实现
一、39条码简介
39码是1974年发展出来的条码系统,是一种可供使用者双向扫瞄的分散式条码,也就是说相临两资料码之间,必须包含一个不具任何意义的空白(或细白,其逻辑值为0),且其具有支援文字的能力,故较一般一维条码应用广泛,由于CODE 39支持0~9、A~Z等,目前较主要用于,通常运用于资产管理、会员卡、店内码管理、产品卷标等。
标准的39码是由起始安全空间、起始码、资料码、可忽略不计的检查码、终止安全空间及终止码所构成。
二、39码编码
39码的每一个字元编码方式,都是由九条不同排列的线条编码而得。可区分成如表之四种类型:
表1 39码的字元编码方式
(1)英文字母部分
26个英文字母所对应的39码逻辑值如表所示。
字元 |
逻辑型态 |
字元 |
逻辑型态 |
A |
110101001011 |
N |
101011010011 |
B |
101101001011 |
O |
110101101001 |
C |
110110100101 |
P |
101101101001 |
D |
101011001011 |
Q |
101010110011 |
E |
110101100101 |
R |
110101011001 |
F |
101101100101 |
S |
101101011001 |
G |
101010011011 |
T |
101011011001 |
H |
110101001101 |
U |
110010101011 |
I |
101101001101 |
V |
100110101011 |
J |
101011001101 |
W |
110011010101 |
K |
110101010011 |
X |
100101101011 |
L |
101101010011 |
Y |
110010110101 |
M |
110110101001 |
Z |
100110110101 |
(2)数字与特殊符号部分
39码也可表示数字0~9以及特殊符号,其对应的逻辑值如表所示。
字元 |
逻辑型态 |
字元 |
逻辑型态 |
0 |
101001101101 |
+ |
100101001001 |
1 |
110100101011 |
- |
100101011011 |
2 |
101100101011 |
* |
100101101101 |
3 |
110110010101 |
/ |
100100101001 |
4 |
101001101011 |
% |
101001001001 |
5 |
110100110101 |
$ |
100100100101 |
6 |
101100110101 |
. |
110010101101 |
7 |
101001011011 |
空白 |
100110101101 |
8 |
110100101101 |
|
|
9 |
101100101101 |
|
(3)39码的检查码查询表
三、39码编码算法
(1)移除输入待编码内容Value to Code中的*,得到Value;
(2)将Value逐位按“二”中的的检查码查询表计算检查码的和sum,计算检查码 checkcode=sum%43,再以checkcode在检查码中查询对应的编码字元checkChar
(3)将Value与checkChar拼接后,前后加上'*'再逐位按“二”中的对应的编码+‘0’进行编码,将最后一个0去掉后得到Code;
(4)按表1对Code进行绘图。
四、基于C#的算法实现
(1)UI设计
(2)算法代码
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Drawing.Drawing2D; namespace BarCode
{
/// <summary>
/// 39 barcode
/// </summary>
public class BarCode
{
private string _rawData;
private bool _enableChecksum;
private int _height;
private int _width;
private bool _includeLabel;
private string _code;
private enum LabelPositions : int { TOPLEFT, TOPCENTER, TOPRIGHT, BOTTOMLEFT, BOTTOMCENTER, BOTTOMRIGHT }; private LabelPositions _labelPosition;
private Color _ForeColor = Color.Black;
private Color _BackColor = Color.White;
private string Code
{
get
{
if (string.IsNullOrEmpty(this._code))
{
this._code = Encode();
}
return this._code;
}
}
private Image _encodedImage;
public Image EncodedImage
{
get{return _encodedImage;}
set{this._encodedImage=value;}
}
private Hashtable C39_Code = new Hashtable(); //is initialized by init_Code39()
private Hashtable ExtC39_Translation = new Hashtable();
/// <summary>
/// Encodes with Code39.
/// </summary>
/// <param name="input">Data to encode.</param>
/// <param name="AllowExtended">Allow Extended Code 39 (Full Ascii mode).</param>
/// <param name="EnableChecksum">Whether to calculate the Mod 43 checksum and encode it into the barcode</param>
public BarCode(string input, bool enableChecksum, int height, int width,bool includeLabel)
{
_rawData = input;
_enableChecksum = enableChecksum;
_height = height;
_width = width;
_includeLabel=includeLabel;
_labelPosition=LabelPositions.BOTTOMCENTER;
} /// <summary>
/// Encode the raw data using the Code 39 algorithm.
/// </summary>
private string Encode()
{
this.init_Code39();
this.init_ExtendedCode39(); string strNoAstr = this._rawData.Replace("*", "");
string strFormattedData = "*" + strNoAstr + (this._enableChecksum ? getChecksumChar(strNoAstr).ToString() : String.Empty) + "*"; string result = "";
//foreach (char c in this.FormattedData)
foreach (char c in strFormattedData)
{
try
{
result += C39_Code[c].ToString();
result += "";//whitespace
}//try
catch
{
throw new Exception("EC39-1: Invalid data. (Try using Extended Code39)");
}//catch
}//foreach result = result.Substring(, result.Length-); //clear the hashtable so it no longer takes up memory
this.C39_Code.Clear(); return result;
}//Encode_Code39
private void init_Code39()
{
C39_Code.Clear();
C39_Code.Add('', "");
C39_Code.Add('', "");
C39_Code.Add('', "");
C39_Code.Add('', "");
C39_Code.Add('', "");
C39_Code.Add('', "");
C39_Code.Add('', "");
C39_Code.Add('', "");
C39_Code.Add('', "");
C39_Code.Add('', "");
C39_Code.Add('A', "");
C39_Code.Add('B', "");
C39_Code.Add('C', "");
C39_Code.Add('D', "");
C39_Code.Add('E', "");
C39_Code.Add('F', "");
C39_Code.Add('G', "");
C39_Code.Add('H', "");
C39_Code.Add('I', "");
C39_Code.Add('J', "");
C39_Code.Add('K', "");
C39_Code.Add('L', "");
C39_Code.Add('M', "");
C39_Code.Add('N', "");
C39_Code.Add('O', "");
C39_Code.Add('P', "");
C39_Code.Add('Q', "");
C39_Code.Add('R', "");
C39_Code.Add('S', "");
C39_Code.Add('T', "");
C39_Code.Add('U', "");
C39_Code.Add('V', "");
C39_Code.Add('W', "");
C39_Code.Add('X', "");
C39_Code.Add('Y', "");
C39_Code.Add('Z', "");
C39_Code.Add('-', "");
C39_Code.Add('.', "");
C39_Code.Add(' ', "");
C39_Code.Add('$', "");
C39_Code.Add('/', "");
C39_Code.Add('+', "");
C39_Code.Add('%', "");
C39_Code.Add('*', "");
}//init_Code39
private void init_ExtendedCode39()
{
ExtC39_Translation.Clear();
ExtC39_Translation.Add(Convert.ToChar().ToString(), "%U");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$A");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$B");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$C");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$D");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$E");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$F");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$G");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$H");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$I");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$J");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$K");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$L");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$M");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$N");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$O");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$P");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$Q");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$R");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$S");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$T");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$U");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$V");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$W");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$X");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$Y");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "$Z");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "%A");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "%B");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "%C");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "%D");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "%E");
ExtC39_Translation.Add("!", "/A");
ExtC39_Translation.Add("\"", "/B");
ExtC39_Translation.Add("#", "/C");
ExtC39_Translation.Add("$", "/D");
ExtC39_Translation.Add("%", "/E");
ExtC39_Translation.Add("&", "/F");
ExtC39_Translation.Add("'", "/G");
ExtC39_Translation.Add("(", "/H");
ExtC39_Translation.Add(")", "/I");
ExtC39_Translation.Add("*", "/J");
ExtC39_Translation.Add("+", "/K");
ExtC39_Translation.Add(",", "/L");
ExtC39_Translation.Add("/", "/O");
ExtC39_Translation.Add(":", "/Z");
ExtC39_Translation.Add(";", "%F");
ExtC39_Translation.Add("<", "%G");
ExtC39_Translation.Add("=", "%H");
ExtC39_Translation.Add(">", "%I");
ExtC39_Translation.Add("?", "%J");
ExtC39_Translation.Add("[", "%K");
ExtC39_Translation.Add("\\", "%L");
ExtC39_Translation.Add("]", "%M");
ExtC39_Translation.Add("^", "%N");
ExtC39_Translation.Add("_", "%O");
ExtC39_Translation.Add("{", "%P");
ExtC39_Translation.Add("|", "%Q");
ExtC39_Translation.Add("}", "%R");
ExtC39_Translation.Add("~", "%S");
ExtC39_Translation.Add("`", "%W");
ExtC39_Translation.Add("@", "%V");
ExtC39_Translation.Add("a", "+A");
ExtC39_Translation.Add("b", "+B");
ExtC39_Translation.Add("c", "+C");
ExtC39_Translation.Add("d", "+D");
ExtC39_Translation.Add("e", "+E");
ExtC39_Translation.Add("f", "+F");
ExtC39_Translation.Add("g", "+G");
ExtC39_Translation.Add("h", "+H");
ExtC39_Translation.Add("i", "+I");
ExtC39_Translation.Add("j", "+J");
ExtC39_Translation.Add("k", "+K");
ExtC39_Translation.Add("l", "+L");
ExtC39_Translation.Add("m", "+M");
ExtC39_Translation.Add("n", "+N");
ExtC39_Translation.Add("o", "+O");
ExtC39_Translation.Add("p", "+P");
ExtC39_Translation.Add("q", "+Q");
ExtC39_Translation.Add("r", "+R");
ExtC39_Translation.Add("s", "+S");
ExtC39_Translation.Add("t", "+T");
ExtC39_Translation.Add("u", "+U");
ExtC39_Translation.Add("v", "+V");
ExtC39_Translation.Add("w", "+W");
ExtC39_Translation.Add("x", "+X");
ExtC39_Translation.Add("y", "+Y");
ExtC39_Translation.Add("z", "+Z");
ExtC39_Translation.Add(Convert.ToChar().ToString(), "%T"); //also %X, %Y, %Z
}
private void InsertExtendedCharsIfNeeded(ref string FormattedData)
{
string output = "";
foreach (char c in FormattedData)
{
try
{
string s = C39_Code[c].ToString();
output += c;
}//try
catch
{
//insert extended substitution
object oTrans = ExtC39_Translation[c.ToString()];
output += oTrans.ToString();
}//catch
}//foreach FormattedData = output;
}
private char getChecksumChar(string strNoAstr)
{
//checksum
string Code39_Charset = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%";
InsertExtendedCharsIfNeeded(ref strNoAstr);
int sum = ; //Calculate the checksum
for (int i = ; i < strNoAstr.Length; ++i)
{
sum = sum + Code39_Charset.IndexOf(strNoAstr[i].ToString());
} //return the checksum char
return Code39_Charset[sum % ];
} /// <summary>
/// Gets a bitmap representation of the encoded data.
/// </summary>
/// <returns>Bitmap of encoded value.</returns>
public Bitmap GenerateCodeImage(ref string codeValue)
{
if (Code == "") throw new Exception("EGENERATE_IMAGE-1: Encode Error.");
Bitmap b = null; DateTime dtStartTime = DateTime.Now; b = new Bitmap(this._width, this._height);
int iBarWidth = this._width / Code.Length;
int shiftAdjustment = (this._width % Code.Length) / ;
int iBarWidthModifier = ; if (iBarWidth <= )
{
throw new Exception("EGENERATE_IMAGE-2: Image size specified not large enough to draw image. (Bar size determined to be less than 1 pixel)");
} //draw image
int pos = ;
int halfBarWidth = (int)(iBarWidth * 0.5); using (Graphics g = Graphics.FromImage(b))
{
//clears the image and colors the entire background
g.Clear(this._BackColor); //lines are fBarWidth wide so draw the appropriate color line vertically
using (Pen backpen = new Pen(_BackColor, iBarWidth / iBarWidthModifier))
{
using (Pen pen = new Pen(_ForeColor, iBarWidth / iBarWidthModifier))
{
while (pos < Code.Length)
{
if (Code[pos] == '')
{
g.DrawLine(pen, new Point(pos * iBarWidth + shiftAdjustment + halfBarWidth, ), new Point(pos * iBarWidth + shiftAdjustment + halfBarWidth, this._height));
}
pos++;
}//while
}//using
}//using if (this._includeLabel)
{
GenerateCodeLabel((Image)b);
}//if EncodedImage = (Image)b;
codeValue=Code;
return b;
}
} /// <summary>
/// Saves an encoded image to a specified file and type.
/// </summary>
/// <param name="Filename">Filename to save to.</param>
/// <param name="FileType">Format to use.</param>
public void SaveImage(string Filename)
{
try
{
if (this.Code != null)
{
string FileType = Filename.Substring(Filename.LastIndexOf('.') + ).ToUpper();
System.Drawing.Imaging.ImageFormat imageformat;
switch (FileType)
{
case "BMP": imageformat = System.Drawing.Imaging.ImageFormat.Bmp; break;
case "GIF": imageformat = System.Drawing.Imaging.ImageFormat.Gif; break;
case "JPG": imageformat = System.Drawing.Imaging.ImageFormat.Jpeg; break;
case "PNG": imageformat = System.Drawing.Imaging.ImageFormat.Png; break;
case "TIFF": imageformat = System.Drawing.Imaging.ImageFormat.Tiff; break;
default: imageformat = System.Drawing.Imaging.ImageFormat.Png; break;
}//switch
((Bitmap)this.EncodedImage).Save(Filename, imageformat);
}//if
}//try
catch (Exception ex)
{
throw new Exception("ESAVEIMAGE-1: Could not save image.\n\n=======================\n\n" + ex.Message);
}//catch
}//SaveImage(string, SaveTypes) private Image GenerateCodeLabel(Image img)
{
try
{
System.Drawing.Font font =new Font("Microsoft Sans Serif", , FontStyle.Bold); using (Graphics g = Graphics.FromImage(img))
{
g.DrawImage(img, (float), (float)); g.SmoothingMode = SmoothingMode.HighQuality;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.CompositingQuality = CompositingQuality.HighQuality; StringFormat f = new StringFormat();
f.Alignment = StringAlignment.Near;
f.LineAlignment = StringAlignment.Near;
int LabelX = ;
int LabelY = ; switch (this._labelPosition)
{
case LabelPositions.BOTTOMCENTER:
LabelX = img.Width / ;
LabelY = img.Height - (font.Height);
f.Alignment = StringAlignment.Center;
break;
case LabelPositions.BOTTOMLEFT:
LabelX = ;
LabelY = img.Height - (font.Height);
f.Alignment = StringAlignment.Near;
break;
case LabelPositions.BOTTOMRIGHT:
LabelX = img.Width;
LabelY = img.Height - (font.Height);
f.Alignment = StringAlignment.Far;
break;
case LabelPositions.TOPCENTER:
LabelX = img.Width / ;
LabelY = ;
f.Alignment = StringAlignment.Center;
break;
case LabelPositions.TOPLEFT:
LabelX = img.Width;
LabelY = ;
f.Alignment = StringAlignment.Near;
break;
case LabelPositions.TOPRIGHT:
LabelX = img.Width;
LabelY = ;
f.Alignment = StringAlignment.Far;
break;
}//switch //color a background color box at the bottom of the barcode to hold the string of data
g.FillRectangle(new SolidBrush(this._BackColor), new RectangleF((float), (float)LabelY, (float)img.Width, (float)font.Height)); //draw datastring under the barcode image
g.DrawString(this._rawData, font, new SolidBrush(this._ForeColor), new RectangleF((float), (float)LabelY, (float)img.Width, (float)font.Height), f); g.Save();
}//using
return img;
}//try
catch (Exception ex)
{
throw new Exception("ELABEL_GENERIC-1: " + ex.Message);
}//catch
}//Label_Generic }
}
private void btnEncode_Click(object sender, EventArgs e)
{
string input = this.txtInput.Text.Trim();
string txtwidth = this.txtWidth.Text.Trim();
string txtheight = this.txtHeight.Text.Trim();
if (!string.IsNullOrEmpty(input) && !string.IsNullOrEmpty(txtwidth) && !string.IsNullOrEmpty(txtheight))
{
this._width = Int32.Parse(txtwidth);
this._height = Int32.Parse(txtheight);
barCode = new BarCode(input, true, this._height, this._width, true);
string codeValue = string.Empty;
pb.Image = barCode.GenerateCodeImage(ref codeValue);
//reposition the barcode image to the middle
pb.Location = new Point((this.pb.Location.X + this.pb.Width / ) - this.pb.Width / , (this.pb.Location.Y + this.pb.Height / ) - pb.Height / ); //txtEncoded.Text = codeValue;
}
else
{
MessageBox.Show("请输入完整信息");
}
}
/// <summary>
/// 打印生成的条形码
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPrint_Click(object sender, EventArgs e)
{
PrintDialog printDialog = new PrintDialog();
printDialog.Document = printDocument;
if (printDialog.ShowDialog(this) == DialogResult.OK) //到这里会出现选择打印项的窗口
{
printDocument.Print(); //到这里会出现给文件命名的窗口,点击确定后进行打印并完成打印
}
}
/// <summary>
/// 使用PrintDocument,并且设置相应的事件监听
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
try
{
if (pb.Image != null)
{
Rectangle rect = new Rectangle(, , this._width, this._height);//设置打印起始位置和大小
e.Graphics.DrawImage(pb.Image,rect);//确定要打印的图片及其打印起始位置和大小
e.HasMorePages = false;
}
}
catch (Exception ex)
{
MessageBox.Show("请先生成条形码!");
}
} private void btnSaveAsImg_Click(object sender, EventArgs e)
{
SaveFileDialog saveFdlg = new SaveFileDialog();
saveFdlg.Filter = "*.png|*.jpg";
if (saveFdlg.ShowDialog() == DialogResult.OK)
{
string fileName = saveFdlg.FileName;
barCode.SaveImage(fileName);
}
}
(3)效果图
基于C#的BarCode 39实现的更多相关文章
- .NET平台开源项目速览(16)C#写PDF文件类库PDF File Writer介绍
1年前,我在文章:这些.NET开源项目你知道吗?.NET平台开源文档与报表处理组件集合(三)中(第9个项目),给大家推荐了一个开源免费的PDF读写组件 PDFSharp,PDFSharp我2年前就看过 ...
- C#写PDF文件类库PDF File Writer介绍
.NET平台开源项目速览(16)C#写PDF文件类库PDF File Writer介绍 阅读目录 1.PDF File Writer基本介绍 2.一个简单的使用案例 3.资源 1年前,我在文章:这 ...
- [转]【基于zxing的编解码实战】精简Barcode Scanner篇
通过<[搞定条形码]zxing项目源码解读(2.3.0版本,Android部分)>的分析,现在可以实现最终目标了:精简Barcode Scanner并将其中的编码和解码分离为两个独立的部分 ...
- 支持单色条码图像生成的条形码控件Barcode Professional
Barcode Professional for .NET Windows Forms条形码控件是一款灵活和强大的.NET组件(.NET DLL 类库),它让您轻松地添加条码生成和打印功能到您的.NE ...
- python 全栈开发,Day132(玩具管理页面,控制玩具通讯录,基于请求的好友关系建立)
先下载github代码,下面的操作,都是基于这个版本来的! https://github.com/987334176/Intelligent_toy/archive/v1.5.zip 注意:由于涉及到 ...
- Barcode.js功能强大的条码生成jQuery插件
本文转载自http://www.uedsc.com/barcode-js.html Barcode.js是一个基于jQuery库的插件,用于绘制条形码或者二维码,能够生成基于DIV+CSS或者Canv ...
- 【转】39个让你受益的HTML5教程
闲话少说,本文作者为大家收集了网上学习HTML5的资源,期望它们可以帮助大家更好地学习HTML5. 好人啊! 不过,作者原来说的40个只有39个,因为第5个和第8个是重复的. 原文在此! 1. 五分钟 ...
- C#开发微信门户及应用(39)--使用微信JSSDK实现签到的功能
随着微信开逐步开放更多JSSDK的接口,我们可以利用自定义网页的方式来调用更多微信的接口,实现我们更加丰富的界面功能和效果,例如我们可以在页面中调用各种手机的硬件来获取信息,如摄像头拍照,GPS信息. ...
- CRL快速开发框架系列教程二(基于Lambda表达式查询)
本系列目录 CRL快速开发框架系列教程一(Code First数据表不需再关心) CRL快速开发框架系列教程二(基于Lambda表达式查询) CRL快速开发框架系列教程三(更新数据) CRL快速开发框 ...
随机推荐
- 第三篇--Jmeter测试数据库Mysql
Jmeter模拟100用户访问Mysql数据库 1.将Mysql数据库的驱动[mysql-connector-java-5.1.15-bin.jar]放到jmeter的lib目录下,新建线程组100[ ...
- wifi pineapple 外接USB无线网卡桥接外网
0:选择USB网卡 在没有有线网络的情况下,可以外挂一个usb无线网卡来桥接上网,目前支持3070L.8187L芯片的网卡,反正linux系统都用这些芯片, 免的安装驱动, 我选择的是 WN-722N ...
- jumpserver-0.3.2 堡垒机环境搭建(图文详解)
下载安装包:https://github.com/jumpserver/jumpserver.git 解压 三.执行快速安装脚本 cd /opt/jumpserver/install pip inst ...
- 【搬运工】之——Selenium+IDEA+Maven+TestNG环境搭建(转)
Selenium+IDEA+Maven+TestNG环境搭建 第一 安装java环境. 1. 下载并安装Jdk1.7或Jdk1.8 http://www.oracle.com/technetwork/ ...
- 将git commit的默认编辑器从nano转为vim
修改系统的配置 git config --global core.editor vim 针对 git 项目修改 .git/config core 中添加 editor=vim
- nginx 安装和配置
1. 安装相关依赖 yum install readline-devel pcre-devel openssl-devel zlib-devel gcc gcc-c++ gd-devel libxml ...
- spring配置datasource三种方式
详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcytp34 spring配置datasource三种方式 1.使用org.spri ...
- 持续交付Jenkins使用
简介 Jenkins是一个独立的开源自动化服务器,可用于自动化各种任务,如构建,测试和部署软件.Jenkins可以通过本机系统包Docker安装,甚至可以通过安装Java Runtime Enviro ...
- 01-TypeScript概述
本篇文章向大家介绍新的TypeScript客户端脚本语言,主要涉及两个方面,一是传统JavaScript语言的弱点,二是TypeScript语言的优势. 一.JavaScript的弱点 1.弱类型,缺 ...
- Python Keras module 'keras.backend' has no attribute 'image_data_format'
问题: 当使用Keras运行示例程序mnist_cnn时,出现如下错误: 'keras.backend' has no attribute 'image_data_format' 程序路径https: ...