结果显示:marc显示:

卡片显示:

程序一个类:

public class MARC
{
#region 界面上要显示的元素

public string ztm = "";//正题名
public string ftm = "";//副题名
public string fcm = "";//分册(辑)名
public string fch = "";//分册(辑)号
public string dyzrsm = "";//第一责任说明

public string zyzrz_1_lb = "";//主要责任者1,类别,个人/团体/会议
public string zyzrz_1_mc = "";//主要责任者1,名称
public string zyzrz_1_zzfs = "";//主要责任者1,著作方式

public string zyzrz_2_lb = "";//主要责任者2,类别,个人/团体/会议
public string zyzrz_2_mc = "";//主要责任者2,名称
public string zyzrz_2_zzfs = "";//主要责任者2,著作方式

public string cyzrz_1_lb = "";//次要责任者1,类别,个人/团体/会议
public string cyzrz_1_mc = "";//次要责任者1,名称
public string cyzrz_1_zzfs = "";//次要责任者1,著作方式

public string cyzrz_2_lb = "";//次要责任者2,类别,个人/团体/会议
public string cyzrz_2_mc = "";//次要责任者2,名称
public string cyzrz_2_zzfs = "";//次要责任者2,著作方式

public string bc = "";//版次
public string isbn = "";//ISBN
public string zz = "";//装帧
public string dj = "";//单价
public string yzdm = "";//语种代码
public string csm = "";//丛书名/丛编题名
public string cb_jcbs = "";//丛编_卷册标识
public string fcbmc = "";//分丛编名称
public string cbd = "";//出版地
public string cbz = "";//出版者
public string cbrq = "";//出版日期
public string ys = "";//页数
public string tu = "";//图
public string cc = "";//尺寸
public string fj = "";//附件
public string fzx = "";//附注项
public string flh = "";//分类号,可能有多个,文本框中只显示第一个
public string zch = "";//种次(著者)号
public string jqh = "";//卷期号
public string ndh = "";//年代号
public string pjqf = "";//排架区分
public string zy = "";//摘要
public string ztc = "";//主题词,可能有多个
public string bgdm = "";//本馆代码
public string rdrq = "";//入档日期
public string sbmy = "";//首编目员
//这个要传回来
public string dlh = "";//登录号,可能有多个

#endregion 显示MARC

private string GetIndexChar(int index)
{
switch (index)
{
case 0:
return "①";
case 1:
return "②";
case 2:
return "③";
case 3:
return "④";
case 4:
return "⑤";
case 5:
return "⑥";
case 6:
return "⑦";
case 7:
return "⑧";
case 8:
return "⑨";
case 9:
return "⑩";
}
return "";
}
/// <summary>
/// 卡片显示
/// </summary>
/// <param name="marcStr"></param>
/// <returns></returns>
public Bitmap GetMarcPic()
{

//this.pic_KP.Image = null;
Bitmap bmpTemp = new Bitmap(474, 283 * 2);
Graphics g = Graphics.FromImage(bmpTemp);
//画背景
g.FillRectangle(Brushes.White, new Rectangle(0, 0, bmpTemp.Width, bmpTemp.Height));
//分类号
g.DrawString(flh.Split(' ')[0], new Font("宋体", 10, FontStyle.Bold), Brushes.Black, new Point(20, 40));//只画第一个分卷号
//种次号
g.DrawString(zch, new Font("宋体", 10, FontStyle.Bold), Brushes.Black, new Point(20, 56));
//卷期号
g.DrawString(jqh, new Font("宋体", 9), Brushes.Black, new Point(20, 72));
//段落1
string strToDraw = " " + ztm;//正题名
strToDraw += ftm == "" ? "" : ("." + ftm);//副题名
strToDraw += fcm == "" ? "" : ("." + fcm);//分册名
strToDraw += fch == "" ? "" : ("." + fch);//分册号
strToDraw += dyzrsm == "" ? "" : ("/" + dyzrsm);//第一责任说明
strToDraw += bc + cbd == "" ? "" : (".—" + bc);//出版地
strToDraw += bc + cbd == "" ? "" : ("." + cbd);//出版地
strToDraw += cbz == "" ? "" : (":" + cbz);//出版者
strToDraw += cbrq == "" ? "" : ("." + cbrq);//出版日期
//段落2
strToDraw += "\r\n " + ys;//页数
strToDraw += tu == "" ? "" : (":" + tu);//图
strToDraw += cc == "" ? "" : (";" + cc);//尺寸
strToDraw += fj == "" ? "" : (";" + fj);//附件
if (csm != "")
{
strToDraw += ".—(" + csm;//丛编题名
strToDraw += cb_jcbs == "" ? "" : ("." + cb_jcbs);//丛编_卷册标识
strToDraw += fcbmc == "" ? "" : ("." + fcbmc);//分丛编名称
strToDraw += ")";
}
//段落3
strToDraw += "\r\n\r\n\r\n\r\n";
if (zy != "")
{
strToDraw += " " + zy + "\r\n\r\n";//摘要
}
if (isbn != "")
{
strToDraw += " ISBN: " + isbn;//ISBN
if (dj != "")
{
strToDraw += ":" + dj;//单价
}
strToDraw += "\r\n\r\n";
}
//段落4
strToDraw += " ";
if (ztm != "")//主题名
{
strToDraw += "Ⅰ." + ztm.Replace("(", "").Replace("(", "").Replace("《", "").Substring(0, 1) + "... ";
}
//作者
List<string> allWriter = new List<string>();
if (zyzrz_1_mc != "")
{
allWriter.Add(zyzrz_1_mc);
}
if (zyzrz_2_mc != "")
{
allWriter.Add(zyzrz_2_mc);
}
if (cyzrz_1_mc != "")
{
allWriter.Add(cyzrz_1_mc);
}
if (cyzrz_2_mc != "")
{
allWriter.Add(cyzrz_2_mc);
}
if (allWriter.Count == 1)
{
strToDraw += "Ⅱ.";
strToDraw += allWriter[0].Replace("(", "").Replace("(", "").Replace("《", "").Substring(0, 1) + "... ";//只有1个作者
}
else if (allWriter.Count > 1)
{
strToDraw += "Ⅱ.";
//多个作者,给出编号
for (int i = 0; i < allWriter.Count; i++)
{
strToDraw += GetIndexChar(i) + allWriter[i].Replace("(", "").Replace("(", "").Replace("《", "").Substring(0, 1) + "... ";
}
}
//主题词
List<string> ztcList = ztc.Split(new char[] { (char)29 }, StringSplitOptions.RemoveEmptyEntries).ToList();
if (ztcList.Count == 1)
{
strToDraw += "Ⅲ.";
strToDraw += ztcList[0].ToString() + " ";//只有1个主题词
}
else if (ztcList.Count > 1)
{
strToDraw += "Ⅲ.";
//多个主题词,给出编号
for (int i = 0; i < ztcList.Count; i++)
{
strToDraw += GetIndexChar(i) + ztcList[i] + " ";
}
}
//分类号
List<string> flhList = flh.Split(new char[] { (char)29 }, StringSplitOptions.RemoveEmptyEntries).ToList();
if (flhList.Count == 1)
{
strToDraw += "Ⅳ.";
strToDraw += flhList[0].ToString();//只有分类号
}
else if (flhList.Count > 1)
{
strToDraw += "Ⅳ.";
//多个分类号,给出编号
for (int i = 0; i < flhList.Count; i++)
{
strToDraw += GetIndexChar(i) + flhList[i] + " ";
}
}
//登录号
int dlcount = 0;
Font font = new Font("新宋体", 9, FontStyle.Bold);
foreach (string dl in dlh.Split(new char[] { (char)29 }, StringSplitOptions.RemoveEmptyEntries))
{
if (dl.Trim() == "")
{
continue;
}
g.DrawString(dl, font, Brushes.Black, new Point(20, 124 + dlcount * 16));
dlcount++;
}
//底部圆圈
g.DrawEllipse(Pens.Black, new Rectangle(bmpTemp.Width / 2 - 4, bmpTemp.Height / 2 - 24, 16, 16));
//画卡片详细
StringFormat sf = new StringFormat();
sf.FormatFlags = StringFormatFlags.MeasureTrailingSpaces | StringFormatFlags.DisplayFormatControl;
sf.Trimming = StringTrimming.EllipsisCharacter;
//sf.FormatFlags = StringFormatFlags.MeasureTrailingSpaces;
//sf.FormatFlags = StringFormatFlags.MeasureTrailingSpaces | StringFormatFlags.DisplayFormatControl;
//SizeF sizef = g.MeasureString(strToDraw, this.Font, 300, sf);
int charactersFitted = 0;//能容纳的字符数
int linesFilled = 0;//能容纳的行数,最多16行
SizeF sizef = g.MeasureString(strToDraw, font, new SizeF(300, 220), sf, out charactersFitted, out linesFilled);

if (charactersFitted < strToDraw.Length)
{
//需要分页
g.DrawString("1/2", font, Brushes.Black, new Point(360, 13));
g.DrawString("2/2", font, Brushes.Black, new Point(360, 13 + bmpTemp.Height / 2));
g.DrawString("(见次卡)", font, Brushes.Black, new Point(325, 260));

g.DrawEllipse(Pens.Black, new Rectangle(bmpTemp.Width / 2 - 4, bmpTemp.Height - 24, 16, 16));
g.DrawLine(Pens.Black, new Point(0, bmpTemp.Height / 2), new Point(bmpTemp.Width, bmpTemp.Height / 2));

g.DrawString(strToDraw.Substring(0, charactersFitted + 1), font, Brushes.Black, new RectangleF(new Point(120, 40), g.MeasureString(strToDraw, font, 300, sf)), sf);
g.DrawString(strToDraw.Substring(charactersFitted + 1), font, Brushes.Black, new RectangleF(new Point(120, 40 + bmpTemp.Height / 2), g.MeasureString(strToDraw, font, 300, sf)), sf);

//this.pic_KP.Image = bmpTemp;
return bmpTemp;
}
else
{
g.DrawString(strToDraw, font, Brushes.Black, new RectangleF(new Point(120, 40), sizef), sf);
Bitmap picToShow = new Bitmap(bmpTemp.Width, bmpTemp.Height / 2);
Graphics gp = Graphics.FromImage(picToShow);
gp.DrawImageUnscaled(bmpTemp, 0, 0, bmpTemp.Width, bmpTemp.Height / 2);
return picToShow;
//this.pic_KP.Image = picToShow;
}
}

/// <summary>
/// MARC显示
/// </summary>
/// <param name="marcStr"></param>
/// <param name="todgv"></param>
public void ShowMarcTable(string marcStr, DataGridView todgv)
{
if (string.IsNullOrWhiteSpace(marcStr))
{
return;
}
DBUtility.SQuery sq = DBUtility.SQuery.Create("SELECT * FROM MARC数据字典 WHERE MARC类型=1 ORDER BY 标识符");//MARC类型=1为CNMARC,0为USMARC
DataTable dt = DBUtility.DbHelper.ExecuteDataTable(sq.ToString());
DataTable marcTable = new DataTable();
marcTable.Columns.Add("字段名称");
marcTable.Columns.Add("标识");
marcTable.Columns.Add("指");
marcTable.Columns.Add("字段内容");
List<string> arr = marcStr.Split((char)30).ToList();
if (arr.Count == 0)
{
throw new Exception("MARC无效");
}
marcTable.Rows.Add("头标区", "", "", arr[0].Trim());
arr.RemoveAt(0);
//这里要进行筛选,把空的元素直接删除,因为在进行直接操作删除时候会报错
if (arr[arr.Count - 1].ToString() == "")
{
arr.RemoveAt(arr.Count-1);
}
foreach (string str in arr)
{
if (str == "")
{
continue;
}
string key = str.Substring(0, 3);
DataRow[] dr = dt.Select(string.Format("标识符='{0}'", key));
if (dr.Length > 0)
{
int len = int.Parse(dr[0]["固定长度"].ToString());
if (len > 0)
{
//判断是否包含特殊字符
if (str.Contains((char)31))
{
marcTable.Rows.Add(dr[0]["名称缩写"].ToString(), key,
"", str.Substring(str.IndexOf((char)31)).Trim().Replace((char)31, '■'));
}
else
{
marcTable.Rows.Add(dr[0]["名称缩写"].ToString(), key, "", str.Substring(3).Trim());//原来的没把特殊字符转化为■
}
if (key == "005")//处理日期特殊处理
{
rdrq = str.Substring(3, 8);//国定长度,无子项
}
}
else
{
if (str.IndexOf((char)31) == -1)
{
marcTable.Rows.Add(dr[0]["名称缩写"].ToString(), key, "", str.Substring(3).Trim());
continue;
}
marcTable.Rows.Add(dr[0]["名称缩写"].ToString(), key,
str.Split((char)31)[0].Substring(3).Trim(), str.Substring(str.IndexOf((char)31)).Trim().Replace((char)31, '■'));

string[] subArray = str.Substring(str.IndexOf((char)31)).Trim().Split(new char[] { (char)31 }, StringSplitOptions.RemoveEmptyEntries);
switch (key)
{
//case "005"://处理时间,固定长度,特殊处理
// rdrq = subArray[0].Substring(0, 8);//国定长度,无子项
// break;
case "010"://ISBN
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a"://ISBN
isbn = subStr.Substring(1);
break;
case "b"://装帧
zz = subStr.Substring(1);
break;
case "d"://单价
dj = subStr.Substring(1);
break;
}
}
break;
case "101"://作品语种
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a"://语种代码
yzdm = subStr.Substring(1);
break;
}
}
break;
case "200"://题名责任
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a"://正题名
ztm = subStr.Substring(1);
break;
case "e"://副题名
ftm = subStr.Substring(1);
break;
case "i"://分册(辑)名
fcm = subStr.Substring(1);
break;
case "h"://分册(辑)号
fch = subStr.Substring(1);
break;
case "f"://第一责任说明
dyzrsm = subStr.Substring(1);
break;
}
}
break;
case "205"://版次
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a"://版本说明
bc = subStr.Substring(1);
break;
}
}
break;
case "210"://出版发行
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a"://出版地
cbd = subStr.Substring(1);
break;
case "c"://出版者
cbz = subStr.Substring(1);
break;
case "d"://出版日期
cbrq = subStr.Substring(1);
break;
}
}
break;
case "215"://载体形态
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a"://页数
ys = subStr.Substring(1);
break;
case "c"://图
tu = subStr.Substring(1);
break;
case "d"://尺寸
cc = subStr.Substring(1);
break;
case "e"://附件
fj = subStr.Substring(1);
break;
}
}
break;
case "225"://丛编项
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a"://丛书名
csm = subStr.Substring(1);
break;
case "v"://丛编_卷册标识
cb_jcbs = subStr.Substring(1);
break;
case "i"://分丛编名称
fcbmc = subStr.Substring(1);
break;
}
}
break;
case "300"://一般附注
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a"://附注
fzx = subStr.Substring(1);
break;
}
}
break;
case "330"://提要文摘
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a"://摘要
zy = subStr.Substring(1);
break;
}
}
break;
case "606"://普通主题
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a"://主题词,可能有多个,用空格隔开
ztc += subStr.Substring(1) + (char)29;
break;
}
}
break;
case "690"://中图分类
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a"://分类号,可能有多个,用空格隔开
flh += subStr.Substring(1) + (char)29;
break;
}
}
break;
case "701"://人名等同
case "711"://团体等同
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a":
if (zyzrz_1_mc == "")
{
if (key == "701")
{
zyzrz_1_lb = "个人";
}
else
{
string zhi = str.Split((char)31)[0].Substring(3).Trim();
zyzrz_1_lb = zhi.Length > 0 && zhi[0].ToString() == "1" ? "会议" : "团体";//"指"的第一位为1表示会议,否则为团体
}
zyzrz_1_mc = subStr.Substring(1);
}
else
{
if (key == "701")
{
zyzrz_2_lb = "个人";
}
else
{
string zhi = str.Split((char)31)[0].Substring(3).Trim();
zyzrz_2_lb = zhi.Length > 0 && zhi[0].ToString() == "1" ? "会议" : "团体";//"指"的第一位为1表示会议,否则为团体
}
zyzrz_2_mc = subStr.Substring(1);
}
break;
case "4":
if (zyzrz_1_mc != "" && zyzrz_1_zzfs == "")
{
zyzrz_1_zzfs = subStr.Substring(1);
}
else
{
zyzrz_2_zzfs = subStr.Substring(1);
}
break;
}
}
break;
case "702"://人名次要
case "712"://团体次要
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a":
if (cyzrz_1_mc == "")
{
if (key == "702")
{
cyzrz_1_lb = "个人";
}
else
{
string zhi = str.Split((char)31)[0].Substring(3).Trim();
cyzrz_1_lb = zhi.Length > 0 && zhi[0].ToString() == "1" ? "会议" : "团体";//"指"的第一位为1表示会议,否则为团体
}
cyzrz_1_mc = subStr.Substring(1);
}
else
{
if (key == "702")
{
cyzrz_2_lb = "个人";
}
else
{
string zhi = str.Split((char)31)[0].Substring(3).Trim();
cyzrz_2_lb = zhi.Length > 0 && zhi[0].ToString() == "1" ? "会议" : "团体";//"指"的第一位为1表示会议,否则为团体
}
cyzrz_2_mc = subStr.Substring(1);
}
break;
case "4":
if (cyzrz_1_mc != "" && cyzrz_1_zzfs == "")
{
cyzrz_1_zzfs = subStr.Substring(1);
}
else
{
cyzrz_2_zzfs = subStr.Substring(1);
}
break;
}
}
break;
case "830"://编目员注释
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a"://此项不确定//??
sbmy = subStr.Substring(1);
break;
}
}
break;
case "905"://馆藏信息
foreach (string subStr in subArray)
{
switch (subStr.Substring(0, 1))
{
case "a"://馆藏代码
bgdm = subStr.Substring(1);
break;
case "b"://登录号
dlh += subStr.Substring(1) + (char)29;
break;
case "c"://排架区分
pjqf = subStr.Substring(1);
break;
//case "d"://分类号
// flh += subStr.Substring(1) + (char)29; //等同于 690-a
// break;
case "e"://分种次号
zch = subStr.Substring(1);
break;
case "v"://卷期号
jqh = subStr.Substring(1);
break;
case "y"://年代号
ndh = subStr.Substring(1);
break;
}
}
break;
}
}
}
else
{
//099未识别
//throw new Exception(string.Format("未识别的MARC标记:{0}", str.Substring(0, 3)));
}
}
todgv.DataSource = marcTable;
todgv.Columns["字段名称"].Width = 80;
todgv.Columns["标识"].Width = 40;
todgv.Columns["指"].Width = 40;
todgv.Columns["字段内容"].DefaultCellStyle.WrapMode = DataGridViewTriState.True;
todgv.Columns["字段内容"].Width = Math.Max(50, todgv.Width - 80 - 40 - 40 - 20);
todgv.Columns["字段名称"].DefaultCellStyle.BackColor = Color.LightGray;
todgv.Columns["字段名称"].DefaultCellStyle.ForeColor = Color.SteelBlue;
todgv.Columns["字段名称"].DefaultCellStyle.Font = new Font("宋体", 9);

todgv.Columns["标识"].DefaultCellStyle.ForeColor = Color.Red;
todgv.Columns["指"].DefaultCellStyle.ForeColor = Color.Red;

todgv.Columns["字段内容"].DefaultCellStyle.Font = new Font("新宋体", 13);
//FontStyle fs = this.dgv_MARC.Font.Style;
//fs |= FontStyle.Bold;
//Font ft = new Font("宋体", 12, fs);

//this.dgv_MARC.Columns[3].DefaultCellStyle.Font = ft;
todgv.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders;
}

internal void ShowMarcTable(object marc_fz, DataGridView dgv_MARC)
{
throw new NotImplementedException();
}
}

C#winform解析marc显示在datagridview中以及marc卡片显示的更多相关文章

  1. Winform下让你的DataGridView控件支持点语法(即显示list中的子对象属性)

    前言: 不想看前言的直接去看正文吧!另外文末有彩蛋. DataGridView可以支持多种数据源格式,比如DataTable和List. DataTable没啥特殊的,本身就是一张二维的表,可以和Da ...

  2. DataGridView 中添加CheckBox和常用处理方式 .

    DataGridView 中添加CheckBox和常用处理方式 文章1 转载:http://blog.csdn.net/pinkey1987/article/details/5267934 DataG ...

  3. WinForm编程数据视图之DataGridView浅析

    学习C#语言的朋友们肯定或多或少地接触到了WinForm编程,在C#语言的可视化IDE中(如VS.NET中)使用设计器可以让我们轻松地完成窗体.按钮.标签.图片框等等控件的组合,我们可以轻易地做出界面 ...

  4. 读取txt文件赋值到DataGridView中

    先查看txt是每条信息之间是通过什么分割,我是通过换行符(\n)分割的, 然后再看每一条信息中字段是通过什么分割,我的字段是通过 tab键(\t)分割. 第一步 先获取到txt文件的路径: //获取绝 ...

  5. c# winform 中DataGridView绑定List<T> 不能显示数据

    遇到问题 DataGridView绑定List后,List更新后再次绑定不显示数据 datagridview 绑定数据源的时候 用List是不能显示修改内容的..要用binginglist<T& ...

  6. 关于Winform下DataGridView中实现checkbox全选反选、同步列表项的处理

    近期接手一个winform 项目,虽然之前有.net 的经验,但是对一些控件的用法还不是很熟悉. 这段时间将会记录一些在工作中遇到的坎坷以及对应的解决办法,写出来与大家分享并希望大神提出更好解决方法来 ...

  7. [Winform] DataGridView 中 DataGridViewComboBox 的可编辑

    在 DataGridView 中设置的 DataGridViewComboBox,默认是不可编辑的,即使将其列属性 DisplayStyle 设置成 ComboBox 或其他,也无法编辑: 故作如下处 ...

  8. winform窗体(六)——DataGridView控件及通过此控件中实现增删改查

    DataGridView:显示数据表,通过此控件中可以实现连接数据库,实现数据的增删改查 一.后台数据绑定:    List<xxx> list = new List<xxx> ...

  9. Datagridview中数字格式列 不显示小数点前面的0

    用代码设置DataGridView中某列为数字格式,但当小数为0.*的时候,前面的0却不显示.只显示.*. 看网上有说: 调整本地设置,控制面板-区域和语言选项,在弹出框的区域选项卡中,选择自定义,在 ...

随机推荐

  1. rest framework之APIView

    一.rest framework配置 1.安装rest framework 在django环境中安装rest-framework框架: (automatic) C:\Users\Administrat ...

  2. forEarch 和 for in

    forEarch 遍历数组,遍历的过程中不能被终止,必须每一个值遍历一遍后才能停下来,for  in遍历对象中的属性 代码: <!DOCTYPE html> <html lang=& ...

  3. leetcode-52-N皇后②

    题目描述: 方法一:回溯 class Solution: def totalNQueens(self, n: int) -> int: def backtrack(i,tmp,col,z_dia ...

  4. leetcood学习笔记-112-路径总和

    题目描述: 第一次提交: class Solution(object): def hasPathSum(self, root, sum): """ :type root: ...

  5. Kotlin Doc

    { https://www.runoob.com/kotlin/kotlin-eclipse-setup.html }

  6. FFmpeg Download

    https://ffmpeg.zeranoe.com/builds/

  7. CSS——外观样式及应用

    CSS注释  CSS规则是使用 /* 需要注释的内容 */ 进行注释的,即在需要注释的内容前使用 “/*” 标记开始注释,在内容的结尾使用 “*/”结束. 例如: p { font-size: 14p ...

  8. Dart编程判断

    条件/决策构造在执行指令之前评估条件. 下表是Dart中的条件语句 序号 声明和说明 1 if 语句 一个if语句由一个布尔表达式后跟一个或多个语句. 2 If...Else 语句 一个if可以跟一个 ...

  9. 【命令】Maven命令

    当前项目的依赖树: mvn dependency:tree -U.-B.-e -U参数: 该参数能强制让Maven检查所有SNAPSHOT依赖更新,确保集成基于最新的状态,如果没有该参数,Maven默 ...

  10. 后缀自动机求LCS——spoj-LCS

    经典题 注意匹配的时候:用t串去s串的SAM里进行匹配,和字典树一样遍历t中字符,用cur记录当前已经匹配的长度,如果能当前字符能匹配则cur++(这里不能直接用cur=len[now]),反之用li ...