04 2023 档案
摘要:模拟游戏中相乘减伤计算 static void Test() { Calc(new double[] { 0.1,0.3,0.2,0.17,0.5 }); } static void Calc(double[] arr) { double total = 1; foreach (var d in a
阅读全文
摘要:internal class TestStruct { /// <summary> /// 结构体 /// </summary> struct StructEntity { public int ID { get; set; } public string Name { get; set; } }
阅读全文
摘要:static void Test() { int[] arr = new int[] { 1, 2, 3, 4, 5, 6 }; string str = string.Join(",", arr); //数组转拼接字符串 int[] arr_new = Array.ConvertAll(str.S
阅读全文
摘要:我有一个表,里面有2个字段,大概类似 UserID 和 Time 我有个查询语句A: select * from table where UserID=?UserID order by Time desc limit 1; 因此设置了一个联合索引 UserID_Time 又因为有根据时间查询数据的需
阅读全文
摘要:所谓KLV即Key-Length-Value,以【键-数据长度-数据】的形式将数据序列化成字节流, 这是一种高性能和强兼容性的数据序列化方案,,缺点就是用起来比较麻烦, KLV类似于 TLV(Tag-Length-Value) 和谷歌的 protobuf,相比于protobuf(protobuf是基
阅读全文