Esempio n. 1
0
        private void addTimeButtonClick(object sender, EventArgs e)
        {
            if (addWeekdayCombobox.SelectedIndex == 0)
            {
                var time = addTimeTimePicker.Value.TimeOfDay;

                // täglich
                for (int i = 0; i < 7; i++)
                {
                    var weekDay = (DayOfWeek)((i + 1) % 7);

                    PublishTime publishTime = new PublishTime()
                    {
                        DayOfWeek = weekDay, Time = time
                    };
                    current.PublishTimes.Add(publishTime);
                }
            }
            else
            {
                var weekDay = (DayOfWeek)(addWeekdayCombobox.SelectedIndex % 7);
                var time    = addTimeTimePicker.Value.TimeOfDay;

                PublishTime publishTime = new PublishTime()
                {
                    DayOfWeek = weekDay, Time = time
                };
                current.PublishTimes.Add(publishTime);
            }

            RefillTimesListView();
        }
Esempio n. 2
0
 public void MergeFrom(PubsubMessage other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Data.Length != 0)
     {
         Data = other.Data;
     }
     attributes_.Add(other.attributes_);
     if (other.MessageId.Length != 0)
     {
         MessageId = other.MessageId;
     }
     if (other.publishTime_ != null)
     {
         if (publishTime_ == null)
         {
             PublishTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         PublishTime.MergeFrom(other.PublishTime);
     }
     if (other.OrderingKey.Length != 0)
     {
         OrderingKey = other.OrderingKey;
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Esempio n. 3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Data.Length != 0)
            {
                hash ^= Data.GetHashCode();
            }
            hash ^= Attributes.GetHashCode();
            if (MessageId.Length != 0)
            {
                hash ^= MessageId.GetHashCode();
            }
            if (publishTime_ != null)
            {
                hash ^= PublishTime.GetHashCode();
            }
            if (OrderingKey.Length != 0)
            {
                hash ^= OrderingKey.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 4
0
        /// <summary>
        /// 最后用抽取
        /// </summary>
        static void Main_FINAL(string[] args)
        {
            Logger = new StreamWriter("Log.log");
            //实体属性器日志设定
            EntityProperty.Logger = Logger;
            //全局编码
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            //结巴分词的地名修正词典
            PosNS.ImportNS("Resources" + Path.DirectorySeparatorChar + "ns.dict");

            if (!Directory.Exists("/home/118_4/submit"))
            {
                Directory.CreateDirectory("/home/118_4/submit");
            }
            Console.WriteLine("Start To Extract Info Contract TRAIN");
            StreamWriter ResultCSV = new StreamWriter(@"/home/118_4/submit/hetong.txt", false, utf8WithoutBom);

            Run <Contract>(@"/home/data/hetong", @"/home/118_4/temp/hetong", ResultCSV);
            Console.WriteLine("Complete Extract Info Contract");

            Console.WriteLine("Start To Extract Info StockChange TRAIN");
            Console.WriteLine("读取增减持信息:" + "/home/data/zengjianchi/zengjianchi_public.csv");

            var sr = new StreamReader("/home/data/zengjianchi/zengjianchi_public.csv");

            sr.ReadLine();  //Skip Header
            while (!sr.EndOfStream)
            {
                var line        = sr.ReadLine().Split(",");
                var numbers     = RegularTool.GetNumberList(line[0]);
                int year        = int.Parse(numbers[0]);
                int month       = int.Parse(numbers[1]);
                int day         = int.Parse(numbers[2]);
                var AnnouceDate = new DateTime(year, month, day);
                PublishTime.Add(line[1], AnnouceDate);
                //Console.WriteLine("ID:" + line[1] + " Date:" + AnnouceDate.ToString("yyyy-MM-dd"));
            }
            sr.Close();
            Console.WriteLine("读取增减持信息:" + PublishTime.Count);

            ResultCSV = new StreamWriter(@"/home/118_4/submit/zengjianchi.txt", false, utf8WithoutBom);
            Run <StockChange>(@"/home/data/zengjianchi", @"/home/118_4/temp/zengjianchi", ResultCSV);
            Console.WriteLine("Complete Extract Info StockChange");

            Console.WriteLine("Start To Extract Info Reorganization TRAIN");
            //替代训练结果
            Console.WriteLine("加载替代训练结果");
            ReOrganizationTraning.EvaluateMethodList = new string[] {
                "收益法", "资产基础法", "市场法", "市场比较法", "估值法", "成本法", "现金流折现法", "现金流折现法", "剩余法",
                "内含价值调整法", "可比公司市净率法", "重置成本法", "收益现值法", "基础资产法", "假设清偿法",
                "成本逼近法", "单项资产加和法", "成本加和法", "基准地价修正法", "收益还原法", "现金流量法", "单项资产加总法", "折现现金流量法", "基准地价系数修正法"
            }.ToList();
            Console.WriteLine("加载替代训练结果:" + ReOrganizationTraning.EvaluateMethodList.Count);
            ResultCSV = new StreamWriter(@"/home/118_4/submit/chongzu.txt", false, utf8WithoutBom);
            Run <Reorganization>(@"/home/data/chongzu", "", ResultCSV);
            Console.WriteLine("Complete Extract Info Reorganization");

            Logger.Close();
        }
Esempio n. 5
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ (Title != null ? Title.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Account != null ? Account.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ PublishTime.GetHashCode();
         hashCode = (hashCode * 397) ^ ModifyTime.GetHashCode();
         hashCode = (hashCode * 397) ^ (Image != null ? Image.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Text != null ? Text.GetHashCode() : 0);
         return(hashCode);
     }
 }
Esempio n. 6
0
 protected bool Equals(Note other)
 {
     return(base.Equals(other) && UserId == other.UserId && Equals(Account, other.Account) &&
            Title == other.Title && Text == other.Text && Equals(Image, other.Image) &&
            PublishTime.Equals(other.PublishTime) && ModifyTime.Equals(other.ModifyTime));
 }