几处瑕疵

1.正则表达式不适合,单价必须为整数

2.合并列处默认为4,无法配置。

 

基础类定义: 

/// <summary>
/// 商品信息类
/// </summary>
public class MerchandiseInfo
{/// 商品编号private string m_ID;public string ID{get { return m_ID; }set { m_ID = value; }}/// 商品名称private string m_Name;public string Name{get { return m_Name; }set { m_Name = value; }}/// 商品数量private int m_Number;public int Number{get { return m_Number; }set { m_Number = value; }}/// 商品分类private string m_TID;public string TID{get { return m_TID; }set { m_TID = value; }}/// 金额private decimal m_Amount;/// 金额public decimal Amount{get { return m_Amount; }set { m_Amount = value; }}/// 单价private decimal m_Price;public decimal Price{get { return m_Price; }set { m_Price = value; }}/// 备注private string m_Remark;public string Remark{get { return m_Remark; }set { m_Remark = value; }}/// 全赋值构造函数public MerchandiseInfo(string pName, decimal pPrice, int pNumber, string pTID, decimal pAmount, string pRemark){m_Name = pName;m_TID = pTID;m_Amount = pAmount;m_Price = pPrice;m_Number = pNumber;m_Remark = pRemark;}
}/// <summary>
/// 商品类型类
/// </summary>
public class MerchandiseType
{/// 商品类型名称private string m_Name;public string Name{get { return m_Name; }set { m_Name = value; }}///  商品类型IDprivate string m_ID;public string ID{get { return m_ID; }set { m_ID = value; }}/// 全参函数public MerchandiseType(string pID, string pName){m_ID = pID;m_Name = pName;}
}/// <summary>
/// 表格Cell模式创建类
/// </summary>
public class TableCellModle
{private TableCell tablecell = new TableCell();private TextBox textbox = new TextBox();private HiddenField hiField = new HiddenField();private DropDownList ddl; public TableCellModle(){ }/// <summary>/// 具有下拉列表的Cell/// </summary>/// <param name="tID">控件ID</param>/// <param name="tPoint">字体大小</param>/// <param name="twidth">控件宽度</param>/// <param name="tHeight">控件高度</param>/// <param name="lwidth">Cell宽度</param>/// <param name="lHeight">Cell高度</param>/// <param name="MTypeList">下拉框数据源</param>/// <returns></returns>public TableCell CreateCellddl(string tID, int tPoint, int twidth, int tHeight, int lwidth, int lHeight, ref IList<MerchandiseType> MTypeList){ddl = new DropDownList();ddl.DataSource = MTypeList;ddl.DataTextField = "Name";ddl.DataValueField = "ID";ddl.DataBind();ddl.AutoPostBack = false;ddl.ID = tID;ddl.Font.Size = FontUnit.Point(tPoint);ddl.Width = twidth;ddl.Height = tHeight;ddl.BorderWidth = 0;tablecell.Controls.Add(ddl);tablecell.Width = lwidth;tablecell.Height = lHeight;tablecell.BorderWidth = 1;return tablecell;}/// <summary>/// 创建表头/// </summary>/// <param name="tID">控件ID</param>/// <param name="tText">控件文本</param>/// <param name="lwidth">Cell宽度</param>/// <param name="lHeight">Cell高度</param>/// <returns></returns>public TableCell CreateHeadCell(string tID, string tText, int lwidth, int lHeight){textbox.ID = tID;textbox.Text = tText;textbox.Font.Size = FontUnit.Point(13);                textbox.Height = 20;textbox.BorderWidth = 0;textbox.Style.Add("text-align", "center");textbox.BackColor = System.Drawing.Color.Transparent;textbox.ReadOnly = true;tablecell.Controls.Add(textbox);tablecell.Width = lwidth;tablecell.Height = lHeight;tablecell.BorderWidth = 1;tablecell.VerticalAlign = VerticalAlign.Middle;tablecell.Font.Size = FontUnit.Point(13);tablecell.Font.Bold = true;tablecell.HorizontalAlign = HorizontalAlign.Center;tablecell.BorderColor = System.Drawing.Color.Black;tablecell.BackColor = System.Drawing.Color.Transparent;return tablecell;}/// <summary>/// 创建头Cell(可以配置颜色)/// </summary>/// <param name="tID">控件ID</param>/// <param name="tText">控件文本</param>/// <param name="lwidth">Cell宽度</param>/// <param name="lHeight">Cell高度</param>/// <param name="pColor">颜色</param>/// <returns></returns>public TableCell CreateHeadCellColor(string tID, string tText, int lwidth, int lHeight, System.Drawing.Color pColor){textbox.ID = tID;textbox.Text = tText;textbox.Font.Size = FontUnit.Point(13);textbox.Width = 150;textbox.Height = 20;textbox.BorderWidth = 0;textbox.BackColor = pColor;textbox.ReadOnly = true;tablecell.Controls.Add(textbox);tablecell.Width = lwidth;tablecell.Height = lHeight;tablecell.BorderWidth = 1;tablecell.VerticalAlign = VerticalAlign.Middle;tablecell.Font.Size = FontUnit.Point(13);tablecell.Font.Bold = true;tablecell.HorizontalAlign = HorizontalAlign.Center;tablecell.BorderColor = System.Drawing.Color.Black;tablecell.BackColor = pColor;return tablecell;}/// <summary>/// 创建可读写Cell/// </summary>/// <param name="tID">控件ID</param>/// <param name="tText">控件文本</param>/// <param name="tPoint">字体大小</param>/// <param name="twidth">控件宽度</param>/// <param name="tHeight">控件高度</param>/// <param name="lwidth">Cell宽度</param>/// <param name="lHeight">Cell高度</param>/// <param name="pReadOnly">是否只读</param>/// <param name="pAutoPostBack">是否自动回调</param>/// <returns></returns>public TableCell CreateCellBeRead(string tID, string tText, int tPoint, int twidth, int tHeight, int lwidth, int lHeight, bool pReadOnly, bool pAutoPostBack){textbox.ID = tID;textbox.Text = tText;textbox.Font.Size = FontUnit.Point(tPoint);textbox.Width = twidth;                textbox.Height = tHeight;textbox.BorderWidth = 0;textbox.ReadOnly = pReadOnly;textbox.AutoPostBack = pAutoPostBack;tablecell.Controls.Add(textbox);tablecell.Width = lwidth;tablecell.Height = lHeight;tablecell.BorderWidth = 1;return tablecell;}/// <summary>/// 创建隐藏文本/// </summary>/// <param name="tID">控件ID</param>/// <param name="tText">控件文本</param>/// <param name="lwidth">Cell宽度</param>/// <param name="lHeight">Cell高度</param>/// <returns></returns>public TableCell CreateCellHiField(string tID, string tText, int lwidth, int lHeight){hiField.ID = tID;hiField.Value = tText;tablecell.Controls.Add(hiField);tablecell.Width = lwidth;tablecell.Height = lHeight;tablecell.BorderWidth = 1;return tablecell;}/// <summary>/// 同时 创建带隐藏域和文本的Cell/// </summary>/// <param name="tID">控件ID</param>/// <param name="tText">控件文本</param>/// <param name="tPoint">字体大小</param>/// <param name="twidth">控件宽度</param>/// <param name="tHeight">控件宽度</param>/// <param name="lwidth">Cell宽度</param>/// <param name="lHeight">Cell高度</param>/// <param name="pTaxRate">pTaxRate</param>/// <param name="pMID"></param>/// <param name="pPrice"></param>/// <param name="pPDID"></param>/// <param name="pID"></param>/// <returns></returns>public TableCell CreateCell(string tID, string tText, int tPoint, int twidth, int tHeight, int lwidth, int lHeight, string pTaxRate, string pMID, string pPrice, string pPDID, string pID){textbox.ID = tID;textbox.Text = tText;hiField.ID = tID + "TaxRate";hiField.Value = pTaxRate;textbox.Font.Size = FontUnit.Point(tPoint);textbox.Width = twidth;textbox.Height = tHeight;textbox.BorderWidth = 0;textbox.ReadOnly = true;textbox.AutoPostBack = true;tablecell.Controls.Add(hiField);tablecell.Controls.Add(textbox);tablecell.Width = lwidth;tablecell.Height = lHeight;tablecell.BorderWidth = 1;return tablecell;}/// <summary>/// ///创建可改变行数的隐藏域和文本的Cell/// </summary>/// <param name="tID">控件ID</param>/// <param name="tText">控件文本</param>/// <param name="tPoint">字体大小</param>/// <param name="twidth">控件宽度</param>/// <param name="tHeight">控件高度</param>/// <param name="lwidth">Cell宽度</param>/// <param name="lHeight">Cell高度</param>/// <param name="ColumnSpan">合并列数</param>/// <returns></returns>public TableCell CreateCellChangeColumn(string tID, string tText, int tPoint, int twidth, int tHeight, int lwidth, int lHeight, int ColumnSpan){hiField = new HiddenField();textbox.ID = tID;textbox.Text = tText;textbox.Font.Size = FontUnit.Point(tPoint);textbox.Width = twidth;textbox.Height = tHeight;textbox.BorderWidth = 0;textbox.ReadOnly = true;textbox.AutoPostBack = true;tablecell.Controls.Add(textbox);tablecell.Width = lwidth;tablecell.Height = lHeight;tablecell.ColumnSpan = ColumnSpan;tablecell.BorderWidth = 1;tablecell.HorizontalAlign = HorizontalAlign.Center;tablecell.VerticalAlign = VerticalAlign.Middle;tablecell.BorderColor = System.Drawing.Color.Black;return tablecell;}
}/// <summary>
/// 自定义表格类
/// </summary>
public class TableList
{/// <summary>/// 生成商品表格/// </summary>/// <param name="Table1">表格</param>/// <param name="rows">表格行数</param>/// <param name="MTypeList">表格中下拉框数据源</param>public void CreateTable(Table Table1, int rows, ref IList<MerchandiseType> MTypeList){//如果行数小于(0)则返回if (rows < 0)return;TableRow tr3 = new TableRow();tr3.Cells.Add(new TableCellModle().CreateHeadCellColor("cells1" + Table1.Rows.Count, "商品名称", 150, 15, System.Drawing.Color.Azure));tr3.Cells.Add(new TableCellModle().CreateHeadCell("cells2" + Table1.Rows.Count, "单价", 150, 15));tr3.Cells.Add(new TableCellModle().CreateHeadCell("cells3" + Table1.Rows.Count, "入库数量", 75, 15));tr3.Cells.Add(new TableCellModle().CreateHeadCell("cells4" + Table1.Rows.Count, "商品类型", 150, 15));tr3.Cells.Add(new TableCellModle().CreateHeadCell("cells5" + Table1.Rows.Count, "金额", 150, 15));tr3.Cells.Add(new TableCellModle().CreateHeadCell("cells6" + Table1.Rows.Count, "备注", 150, 15));//  tr3.Cells.Add(new TableCellModle().CreateHeadCell("cells7" + Table1.Rows.Count, "隐藏域", 150, 15));Table1.Rows.Add(tr3);for (int i = 0; i < rows; i++){TableRow tr = new TableRow();tr.Cells.Add(new TableCellModle().CreateCellBeRead("cells1" + Table1.Rows.Count, "", 10, 75, 15, 75, 15, false, false));tr.Cells.Add(new TableCellModle().CreateCellBeRead("cells2" + Table1.Rows.Count, "", 10, 75, 15, 75, 15, false, false));tr.Cells.Add(new TableCellModle().CreateCellBeRead("cells3" + Table1.Rows.Count, "", 10, 75, 15, 75, 15, false, true));//ref 作用是传地址,节省空间,tr.Cells.Add(new TableCellModle().CreateCellddl("cells4" + Table1.Rows.Count, 10, 75, 15, 75, 15, ref MTypeList));tr.Cells.Add(new TableCellModle().CreateCellBeRead("cells5" + Table1.Rows.Count, "", 10, 75, 15, 75, 15, true, false));tr.Cells.Add(new TableCellModle().CreateCellBeRead("cells6" + Table1.Rows.Count, "", 10, 75, 15, 75, 15, false, false));tr.Height = 15;Table1.Rows.Add(tr);tr.VerticalAlign = VerticalAlign.Middle;tr.Font.Size = FontUnit.Point(13);tr.Font.Bold = true;tr.HorizontalAlign = HorizontalAlign.Center;tr.BorderColor = System.Drawing.Color.Black;}TableRow tr1 = new TableRow();tr1.Cells.Add(new TableCellModle().CreateCellChangeColumn("cellCount", "合计", 13, 150, 25, 150, 25, 2));tr1.Cells.Add(new TableCellModle().CreateCellChangeColumn("cellSum", "", 13, 150, 25, 150, 25, 0));tr1.Height = 20;Table1.Rows.Add(tr1);tr1.VerticalAlign = VerticalAlign.Middle;tr1.Font.Size = FontUnit.Point(13);tr1.Font.Bold = true;tr1.HorizontalAlign = HorizontalAlign.Center;tr1.BorderColor = System.Drawing.Color.Black;}/// <summary>/// 计算总价/// </summary>/// <param name="oPrice">单价</param>/// <param name="oNumber">数量</param>/// <returns></returns>public string SumAmount(string oPrice, string oNumber){decimal price = 0;int number = 0;string amonut = null;if (string.IsNullOrEmpty(oPrice)){ price = 0; }else{ price = Convert.ToDecimal(oPrice); }if (string.IsNullOrEmpty(oNumber)){ number = 0; }else{ number = Convert.ToInt32(oNumber); }amonut = Convert.ToString(price * number);return amonut;}/// <summary>/// 重写表格宽度/// </summary>/// <param name="Table1">表格</param>public void ReWrite(Table Table1){for (int r = 1; r < Table1.Rows.Count-1; r++){for (int c = 0; c < Table1.Rows[r].Cells.Count; c++){if ((Table1.Rows[r].Cells[c].FindControl("cells" + (c + 1) + r)).GetType() != typeof(TextBox)) { continue; }TextBox tb = ((TextBox)Table1.Rows[r].Cells[c].FindControl("cells" + (c + 1) + r));TableCell tc = ((TableCell)Table1.Rows[r].Cells[c]);string text = tb.Text;int coun1 = 0, textLength;ArrayList itemList = new ArrayList();CharEnumerator CEnumerator = text.GetEnumerator();Regex regex = new Regex("^[\u4E00-\u9FA5]{0,}$");while (CEnumerator.MoveNext()){if (regex.IsMatch(CEnumerator.Current.ToString(), 0))itemList.Add(CEnumerator.Current.ToString());coun1 = itemList.Count;}textLength = coun1 * 16 + (text.Length - coun1) * 8;if (textLength > 150){tb.Width = 250;}if (textLength > 250){tb.Height = 30;tb.TextMode = TextBoxMode.MultiLine;}}}}
}

 

表格实现:

protected void Page_Load(object sender, System.EventArgs e)
{// 在此处放置用户代码以初始化页面showEWETableList();
}//入库单的详细列表table
private TableList tablelist = new TableList();
//入库的详细List
private IList<MerchandiseInfo> MerchandiseList = new List<MerchandiseInfo>();private void showEWETableList()
{Table1.Rows.Clear();Table1.Controls.Clear();IList<MerchandiseType> MTypeList = new List<MerchandiseType>();MTypeList.Add(new MerchandiseType("1", "忌食品"));MTypeList.Add(new MerchandiseType("2", "毒奶粉"));MTypeList.Add(new MerchandiseType("3", "伪劣饮料"));if (string.IsNullOrEmpty(txtNumber.Text) || !Regex.IsMatch(txtNumber.Text, @"^\d+$")){this.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language = javascript>alert('错误,在行数输入非数字字符!')</script>");return;}int rows = Convert.ToInt32(txtNumber.Text);tablelist.CreateTable(Table1, rows, ref MTypeList);for (int i = 1; i <= rows; i++){//为每一个数量表加入事件((TextBox)Table1.Rows[i].Cells[2].FindControl("cells3" + i)).TextChanged += new EventHandler(tablelist_TextChanged);}
}
//输入数目改变事件
protected void tablelist_TextChanged(object sender, EventArgs e)
{//计算总价tablelist.ReWrite(Table1);Sumtablelist();
}
//计算总和
private void Sumtablelist()
{decimal amount = 0; // 订单明细一条记录数据求和decimal sum = 0;   //   对订单明细所有记录金额求总和int rows = Convert.ToInt32(txtNumber.Text);for (int i = 1; i < rows + 1; i++){string strNumber = ((TextBox)Table1.Rows[i].Cells[2].FindControl("cells3" + i)).Text;string strPrice = ((TextBox)Table1.Rows[i].Cells[1].FindControl("cells2" + i)).Text;#regionif (string.IsNullOrEmpty(strPrice) || string.IsNullOrEmpty(strNumber))if (string.IsNullOrEmpty(strNumber))break;if (!Regex.IsMatch(strPrice, @"^\d+$")){this.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language = javascript>alert('错误,在价格中输入非数字字符!')</script>");((TextBox)Table1.Rows[i].Cells[1].FindControl("cells2" + i)).Text = "0";strNumber = "0";break;}if (!Regex.IsMatch(strNumber, @"^\d+$")){this.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language = javascript>alert('错误,在数量中输入非数字字符!')</script>");((TextBox)Table1.Rows[i].Cells[2].FindControl("cells3" + i)).Text = "0";strNumber = "0";break;}#endregionstring Name = ((TextBox)Table1.Rows[i].Cells[0].FindControl("cells1" + i)).Text;if (!string.IsNullOrEmpty(Name)){string strSum = tablelist.SumAmount(strPrice, strNumber);((TextBox)Table1.Rows[i].Cells[4].FindControl("cells5" + i)).Text = "¥" + strSum;amount = Convert.ToDecimal(strSum);sum += amount;}}//最后一行是统计总价格.((TextBox)Table1.Rows[rows + 1].Cells[1].FindControl("cellSum")).Text = "¥" + Convert.ToString(sum);this.btnRead.Enabled = true;
}

数据读取

//读取数据
protected void btnRead_Click(object sender, EventArgs e)
{//因为第0行是标题所以要从第1行开始for (int i = 1; i < Convert.ToInt32(txtNumber.Text) + 1; i++){string Name = ((TextBox)Table1.Rows[i].Cells[0].FindControl("cells1" + i)).Text;string Price = ((TextBox)Table1.Rows[i].Cells[1].FindControl("cells2" + i)).Text;string strNumber = ((TextBox)Table1.Rows[i].Cells[2].FindControl("cells3" + i)).Text;string MType = ((DropDownList)Table1.Rows[i].Cells[3].FindControl("cells4" + i)).SelectedValue;string Amount = ((TextBox)Table1.Rows[i].Cells[4].FindControl("cells5" + i)).Text.Replace("¥", string.Empty);//把¥替换string Remark = ((TextBox)Table1.Rows[i].Cells[5].FindControl("cells6" + i)).Text;if (!(strNumber.Equals("0") || string.IsNullOrEmpty(strNumber) || string.IsNullOrEmpty(Price) ||string.IsNullOrEmpty(Amount) || string.IsNullOrEmpty(Name) || string.IsNullOrEmpty(MType))){MerchandiseInfo MInfo = new MerchandiseInfo(Name, Convert.ToDecimal(Price), Convert.ToInt32(strNumber), MType, Convert.ToDecimal(Amount),Remark);MerchandiseList.Add(MInfo);}}if (MerchandiseList == null || MerchandiseList.Count < 1)return;///输出所有的商品..for (int i = 0; i < MerchandiseList.Count; i++){Response.Write(" 商品名称:" + MerchandiseList[i].Name + " 单价:" + MerchandiseList[i].Price + " 入库数量: " + "商品类型ID:" + MerchandiseList[i].TID + " 金额: " +MerchandiseList[i].Amount + " 备注:" + MerchandiseList[i].Remark + "<br>");}
}

 

页面代码

<div><fieldset style="width: 80%; text-align: center;"><legend>                                            <asp:Label ID="lblMessage" runat="server" Text="附件信息"></asp:Label></legend>­<table border="0" cellpadding="0" cellspacing="0" width="80%"><tr><td align="right" nowrap="nowrap" style="height: 18px"> 附件种类:</td><td align="left" nowrap="nowrap" style="height: 18px"><asp:TextBox ID="txtNumber" runat="server" BorderWidth="0" Text="0" AutoPostBack="True"></asp:TextBox></td><td align="right" nowrap="nowrap" style="height: 18px"></td><td align="left" nowrap="nowrap" style="height: 18px"></td><td align="right" nowrap="nowrap" style="height: 18px"></td></tr>                                                        </table>                                                    <asp:Table ID="Table1" runat="server" BorderColor="black" BorderWidth="1" CellPadding="0"CellSpacing="0" Width="80%" EnableViewState="False"></asp:Table></fieldset><table border="0" cellpadding="0" cellspacing="0" width="80%"><tr><td style="width: 10%"></td><td align="left" style="text-align: center"><asp:Button ID="btnRead" runat="server" Height="33px" Text="读取数据" OnClick="btnRead_Click"  /></td></tr></table>
</div>

 

效果:

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. Java NIO(2)

    FileChannel连接到文件的通道,可以通过文件通道读写文件。始终是阻塞的,无法实现非阻塞,即不支持Selector获取FileChannel需要通过使用一个InputStream、OutputStream或RandomAccessFile来获取一个FileChannel实例。读取数据创建一个ByteChannel,然后读取数据。写入数据使用…...

    2024/4/24 19:41:14
  2. Vue的双向数据绑定原理是什么

    vue.js 是采用数据劫持结合发布者-订阅者模式的方式,通过Object.defineProperty()来劫持各个属性的setter,getter,在数据变动时发布消息给订阅者,触发相应的监听回调。具体步骤:第一步:需要observe的数据对象进行递归遍历,包括子属性对象的属性,都加上 setter和getter …...

    2024/5/2 14:03:08
  3. Cesuim镜头切换

    方法一:viewer.zoomTo(tileset);FR:徐海涛(hunk Xu) QQ技术交流群:386476712...

    2024/5/2 15:54:53
  4. 在Node.js中利用js-xlsx处理xlsx文件

    文章目录简介安装概念用法基础用法具体方法实战参考资料 简介 本文介绍用 Node.js 中的 js-xlsx 库来处理 Excel 文件。 js-xlsx 库是目前 Github 上 star 数量最多的处理 Excel 的库,功能强大,但上手难度稍大。 安装cnpm install xlsx附上cnpm的安装命令npm install -g cnpm…...

    2024/4/18 20:19:39
  5. vue input限制输入必须是数字包含小数后两位

    HTML<el-inputclass="el-ipt":clearable="true"v-on:input="clearNoNum(iSearch.consume_max_amount,2)"onkeyup="value=value.replace(/[^\d^\.]+/g,)"placeholder="请输入订单金额最小值"v-model="search_entry&q…...

    2024/4/22 4:53:46
  6. 2020-08-16 html的可替换不可替换元素 + css的第三方css的安全性 + JS的排列组合 + 软技能的主流手机分辨率

    2020-08-16 题目来源:http://www.h-camel.com/index.html[html] 可替换元素和不可替换元素有什么不同的特点?1.可替换元素:置换元素 是指标签会被代替。 包括 img object video textarea input,某些元素在特定情况下可替换,audio canvas专业定义:一个内容不受CSS视觉格式…...

    2024/5/2 16:37:19
  7. webpack打包css报错(已解决):UnhandledPromiseRejectionWarning: TypeError: this.getResolve is not a function

    初学者在学习webpack中容易踩一个版本过高的坑 这是我在使用webpack打包css时,出现的一个错误,导致css无法打包 原因是 css-loader 和 style-loader 版本过高解决方法:这是我原来的package.json的版本信息现在我手动下调了一下版本"css-loader": "^3.3.0&quo…...

    2024/3/19 16:41:37
  8. (二十四)树莓派3B+ Node.js驱动MPU6050

    在之前的博客中写过MPU6050模块。 (十四)树莓派3B+ wiringPi库的使用–硬件IIC驱动MPU6050 之前使用的wiringPi和C语言写的,现在使用Node.js操作一下。关于电路连接和MPU6050模块的介绍,这里不做说明,大家自行查看之前的文章或者百度。 树莓派驱动MPU6050 var i2c = require…...

    2024/4/27 22:41:16
  9. 文本框和按钮上下对不齐要怎么解决

    from中的文本框和按钮总会有错差,如:出现这样的情况,只需要给文本框设置一下浮动即可。...

    2024/4/29 23:30:25
  10. 分布式日志管理平台Graylog功能介绍

    分布式日志管理平台Graylog功能介绍为了让大家能够对graylog有一个完整的认识做了一个思维导图。可以看出graylog的设计是非常全面的,从日志的采集、数据分类管理、数据清洗、调用第三方API都考虑到了。而且它可以将处理后的stream发送到其他graylog集群进行二次加工,这种分布…...

    2024/5/2 11:58:30
  11. String str = i 与String str = new String(i)的区别

    String str = “i” 与String str = new String(“i”)的区别 1. 创建的对象在内存中的区别 两者都会在编译时检测常量池中是否存在"i",如果不存在则创建一个空间来存储"i"。 然后前者在**栈内存**中开辟一个名为str的空间,用来存储"i"在常量池…...

    2024/4/17 15:52:33
  12. 写出字节数据——文件存储原理、记事本打开文件原理

    具体原理如下图:...

    2024/4/26 18:18:19
  13. impala实现oracle Minus函数

    去整理别人的存储过程实现sql的时候,发现用到了oracle的Minus函数,然后就根据业务逻辑实现。sql代码如下: – 找出在A表中的数据在B表中不存在的数据 SELECT s.pro_no, nvl ( s.lsg_month, ‘209912’ ) lsg_month, s.brd_season_no FROM dws_hive.tb1 s LEFT OUTER JOIN …...

    2024/4/27 14:46:28
  14. axios-并发请求

    有时需要同时向服务端发起多个请求,这可以利用axios库提供的并发请求助手函数( axios.all(iterable), axios.spread(callback) )来实现。示例: function getUserAccount(){return axios.get(/user/1234); }function getUserPermissions() {return axios.get(/user/5678);…...

    2024/3/15 12:15:09
  15. 对象数组

    设计一个学生类Student,数据成员包括学号(num)和成绩(score),成员函数根据需要自行设计(建议配备需要的set、get函数,以及必要的输入或输出,给出的代码中也可以找到需要成员函数的线索)。在main函数中,要做到: 建立一个对象数组,通过初始化,设置5个学生的数据,要求:…...

    2024/5/2 7:59:19
  16. vi编辑器的使用

    vi工作模式基本命令a 在光标所在字符后插入A 在光标所在行尾插入i 在光标所在字符前插入I 在光标所在行行首插入o 在光标下插入新行O 在光标上插入新行显示行号:set number (set nu)关闭行号:set nonumber (set nonu)到第一行:gg到最后一行:G到第n行:nG到第n行: :…...

    2024/4/13 20:48:07
  17. linux下jenkins部署war包到tomcat

    一. 需要准备的服务器环境服务器上需要配置号jdk,tomcat,maven二. jenkins需要的环境Tomcat及用于访问tomcat/manager的账号密码配置方式 :进入tomcat的conf文件夹,找到tomcat-users.xml文件,打开后加入<role rolename="manager-script"/> #允许访问纯文本…...

    2024/4/13 18:35:32
  18. fetch简单示例笔记

    Fetch基本语句 fetch是原生js的一个api,是一种http数据请求的方式,是XMLHTTPRequest的一中替代方法,跟Ajax没关系。fetch是增的api,所以兼容性不是很好 <script>//使用fetch发送请求fetch(https://v1.hitokoto.cn/, {method: "GET"}).then(result => {c…...

    2024/4/21 0:31:14
  19. jmeter压测时线程异常停止的问题

    需要调整jmeter运行虚拟内存打开jmeter安装目录 apache-jmeter-5.2.1\bin\jmeter.bat文件在if not defined HEAP 内添加set HEAP=-Xms2g -Xmx2g -XX:MaxMetaspaceSize=512m保存启动jmeter此时显示的内存数值与设置的数值不符,需要用jconsole内存检测工具来检测在运行程序中输入…...

    2024/4/23 11:12:36
  20. JZ57 --- 二叉树的下一个结点

    题目描述: 给定一个二叉树和其中的一个结点,请找出中序遍历顺序的下一个结点并且返回。注意,树中的结点不仅包含左右子结点,同时包含指向父结点的指针。 题解: (1)输入的是二叉树中的某一结点,先遍历到二叉树的最末尾结点。 (2)树中包含指向父结点的指针,可以根据此特…...

    2024/4/18 19:49:53

最新文章

  1. react核心知识

    1. 对 React 的理解、特性 React 是靠数据驱动视图改变的一种框架&#xff0c;它的核心驱动方法就是用其提供的 setState 方法设置 state 中的数据从而驱动存放在内存中的虚拟 DOM 树的更新 更新方法就是通过 React 的 Diff 算法比较旧虚拟 DOM 树和新虚拟 DOM 树之间的 Chan…...

    2024/5/2 18:30:46
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/3/20 10:50:27
  3. axios拦截器:每次请求自动带上 token

    Step 1&#xff1a;创建Axios实例并添加拦截器 在你的Vue项目中&#xff0c;一般我们会先导入axios&#xff0c;然后创建一个axios实例。这样做是为了方便统一管理和配置。 import axios from axios; // 引入axios// 创建一个axios实例 const service axios.create();// 添加请…...

    2024/4/30 17:13:59
  4. nodeJs 实现视频的转换(超详细教程)

    前段时间拿到一个视频是4k的&#xff0c;没法播放&#xff0c;于是通过 node.js 和 ffmpeg 实现了视频的转换。在win10 系统下实现。 所需工具 node 16.19 直接安装 ffmpeg-5.1.1-essentials_build 解压后重名 ffmpeg 放到C盘 然后配置下环境变量 Git-2.42.0.2-64-bit 直接…...

    2024/5/1 12:51:06
  5. 416. 分割等和子集问题(动态规划)

    题目 题解 class Solution:def canPartition(self, nums: List[int]) -> bool:# badcaseif not nums:return True# 不能被2整除if sum(nums) % 2 ! 0:return False# 状态定义&#xff1a;dp[i][j]表示当背包容量为j&#xff0c;用前i个物品是否正好可以将背包填满&#xff…...

    2024/5/2 11:19:01
  6. 【Java】ExcelWriter自适应宽度工具类(支持中文)

    工具类 import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet;/*** Excel工具类** author xiaoming* date 2023/11/17 10:40*/ public class ExcelUti…...

    2024/5/2 16:04:58
  7. Spring cloud负载均衡@LoadBalanced LoadBalancerClient

    LoadBalance vs Ribbon 由于Spring cloud2020之后移除了Ribbon&#xff0c;直接使用Spring Cloud LoadBalancer作为客户端负载均衡组件&#xff0c;我们讨论Spring负载均衡以Spring Cloud2020之后版本为主&#xff0c;学习Spring Cloud LoadBalance&#xff0c;暂不讨论Ribbon…...

    2024/5/1 21:18:12
  8. TSINGSEE青犀AI智能分析+视频监控工业园区周界安全防范方案

    一、背景需求分析 在工业产业园、化工园或生产制造园区中&#xff0c;周界防范意义重大&#xff0c;对园区的安全起到重要的作用。常规的安防方式是采用人员巡查&#xff0c;人力投入成本大而且效率低。周界一旦被破坏或入侵&#xff0c;会影响园区人员和资产安全&#xff0c;…...

    2024/5/2 9:47:31
  9. VB.net WebBrowser网页元素抓取分析方法

    在用WebBrowser编程实现网页操作自动化时&#xff0c;常要分析网页Html&#xff0c;例如网页在加载数据时&#xff0c;常会显示“系统处理中&#xff0c;请稍候..”&#xff0c;我们需要在数据加载完成后才能继续下一步操作&#xff0c;如何抓取这个信息的网页html元素变化&…...

    2024/5/2 9:47:31
  10. 【Objective-C】Objective-C汇总

    方法定义 参考&#xff1a;https://www.yiibai.com/objective_c/objective_c_functions.html Objective-C编程语言中方法定义的一般形式如下 - (return_type) method_name:( argumentType1 )argumentName1 joiningArgument2:( argumentType2 )argumentName2 ... joiningArgu…...

    2024/5/2 6:03:07
  11. 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】

    &#x1f468;‍&#x1f4bb;博客主页&#xff1a;花无缺 欢迎 点赞&#x1f44d; 收藏⭐ 留言&#x1f4dd; 加关注✅! 本文由 花无缺 原创 收录于专栏 【洛谷算法题】 文章目录 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】&#x1f30f;题目描述&#x1f30f;输入格…...

    2024/5/2 9:47:30
  12. 【ES6.0】- 扩展运算符(...)

    【ES6.0】- 扩展运算符... 文章目录 【ES6.0】- 扩展运算符...一、概述二、拷贝数组对象三、合并操作四、参数传递五、数组去重六、字符串转字符数组七、NodeList转数组八、解构变量九、打印日志十、总结 一、概述 **扩展运算符(...)**允许一个表达式在期望多个参数&#xff0…...

    2024/5/1 11:24:00
  13. 摩根看好的前智能硬件头部品牌双11交易数据极度异常!——是模式创新还是饮鸩止渴?

    文 | 螳螂观察 作者 | 李燃 双11狂欢已落下帷幕&#xff0c;各大品牌纷纷晒出优异的成绩单&#xff0c;摩根士丹利投资的智能硬件头部品牌凯迪仕也不例外。然而有爆料称&#xff0c;在自媒体平台发布霸榜各大榜单喜讯的凯迪仕智能锁&#xff0c;多个平台数据都表现出极度异常…...

    2024/5/2 5:31:39
  14. Go语言常用命令详解(二)

    文章目录 前言常用命令go bug示例参数说明 go doc示例参数说明 go env示例 go fix示例 go fmt示例 go generate示例 总结写在最后 前言 接着上一篇继续介绍Go语言的常用命令 常用命令 以下是一些常用的Go命令&#xff0c;这些命令可以帮助您在Go开发中进行编译、测试、运行和…...

    2024/5/1 20:22:59
  15. 用欧拉路径判断图同构推出reverse合法性:1116T4

    http://cplusoj.com/d/senior/p/SS231116D 假设我们要把 a a a 变成 b b b&#xff0c;我们在 a i a_i ai​ 和 a i 1 a_{i1} ai1​ 之间连边&#xff0c; b b b 同理&#xff0c;则 a a a 能变成 b b b 的充要条件是两图 A , B A,B A,B 同构。 必要性显然&#xff0…...

    2024/5/2 9:47:28
  16. 【NGINX--1】基础知识

    1、在 Debian/Ubuntu 上安装 NGINX 在 Debian 或 Ubuntu 机器上安装 NGINX 开源版。 更新已配置源的软件包信息&#xff0c;并安装一些有助于配置官方 NGINX 软件包仓库的软件包&#xff1a; apt-get update apt install -y curl gnupg2 ca-certificates lsb-release debian-…...

    2024/5/2 9:47:27
  17. Hive默认分割符、存储格式与数据压缩

    目录 1、Hive默认分割符2、Hive存储格式3、Hive数据压缩 1、Hive默认分割符 Hive创建表时指定的行受限&#xff08;ROW FORMAT&#xff09;配置标准HQL为&#xff1a; ... ROW FORMAT DELIMITED FIELDS TERMINATED BY \u0001 COLLECTION ITEMS TERMINATED BY , MAP KEYS TERMI…...

    2024/5/2 0:07:22
  18. 【论文阅读】MAG:一种用于航天器遥测数据中有效异常检测的新方法

    文章目录 摘要1 引言2 问题描述3 拟议框架4 所提出方法的细节A.数据预处理B.变量相关分析C.MAG模型D.异常分数 5 实验A.数据集和性能指标B.实验设置与平台C.结果和比较 6 结论 摘要 异常检测是保证航天器稳定性的关键。在航天器运行过程中&#xff0c;传感器和控制器产生大量周…...

    2024/5/2 8:37:00
  19. --max-old-space-size=8192报错

    vue项目运行时&#xff0c;如果经常运行慢&#xff0c;崩溃停止服务&#xff0c;报如下错误 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 因为在 Node 中&#xff0c;通过JavaScript使用内存时只能使用部分内存&#xff08;64位系统&…...

    2024/5/2 9:47:26
  20. 基于深度学习的恶意软件检测

    恶意软件是指恶意软件犯罪者用来感染个人计算机或整个组织的网络的软件。 它利用目标系统漏洞&#xff0c;例如可以被劫持的合法软件&#xff08;例如浏览器或 Web 应用程序插件&#xff09;中的错误。 恶意软件渗透可能会造成灾难性的后果&#xff0c;包括数据被盗、勒索或网…...

    2024/5/2 9:47:25
  21. JS原型对象prototype

    让我简单的为大家介绍一下原型对象prototype吧&#xff01; 使用原型实现方法共享 1.构造函数通过原型分配的函数是所有对象所 共享的。 2.JavaScript 规定&#xff0c;每一个构造函数都有一个 prototype 属性&#xff0c;指向另一个对象&#xff0c;所以我们也称为原型对象…...

    2024/5/1 14:33:22
  22. C++中只能有一个实例的单例类

    C中只能有一个实例的单例类 前面讨论的 President 类很不错&#xff0c;但存在一个缺陷&#xff1a;无法禁止通过实例化多个对象来创建多名总统&#xff1a; President One, Two, Three; 由于复制构造函数是私有的&#xff0c;其中每个对象都是不可复制的&#xff0c;但您的目…...

    2024/5/1 11:51:23
  23. python django 小程序图书借阅源码

    开发工具&#xff1a; PyCharm&#xff0c;mysql5.7&#xff0c;微信开发者工具 技术说明&#xff1a; python django html 小程序 功能介绍&#xff1a; 用户端&#xff1a; 登录注册&#xff08;含授权登录&#xff09; 首页显示搜索图书&#xff0c;轮播图&#xff0…...

    2024/5/2 7:30:11
  24. 电子学会C/C++编程等级考试2022年03月(一级)真题解析

    C/C++等级考试(1~8级)全部真题・点这里 第1题:双精度浮点数的输入输出 输入一个双精度浮点数,保留8位小数,输出这个浮点数。 时间限制:1000 内存限制:65536输入 只有一行,一个双精度浮点数。输出 一行,保留8位小数的浮点数。样例输入 3.1415926535798932样例输出 3.1…...

    2024/5/1 20:56:20
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57