public void LoadTimeGraph() { DataPull pull = new DataPull(); DataView dv = new DataView(); TimeGraph tg = new TimeGraph(); dv = pull.PullTimeGraph(); foreach (DataRowView row in dv) { if (row["timeSlot"].ToString() != string.Empty) { int timeSlot = int.Parse(row["timeSlot"].ToString()); TimeGraphInfo info = new TimeGraphInfo(); info.championId = int.Parse(row["championId"].ToString()); info.pickRate = row["pickRate"].ToString(); info.winRate = row["winRate"].ToString(); if (tg.segments[timeSlot] == null) { tg.segments[timeSlot] = new TimeGraphSegment(); } tg.segments[timeSlot].graphInfo.Add(info); } } string json = JsonConvert.SerializeObject(tg); var path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "//RitoOutput//TimeGraph.json"; File.WriteAllText(path, json); }
// GET: Home public ViewResult Index() { string[] PHASE = new string[] { "Вертикальная планировка участка плита", "Устройство щебеночного основания плита", "Устройство бетонной подготовки плита", "Армирование с установкой закладных деталей и анкерных болтов плиты", //"Установка опалубки плиты", "Бетонирование плиты", "Бетонирование покрытия плиты", "Устройство пунктов подключения", "Устройство футляров электроснабжения" }; Dictionary <string, string> phases = new Dictionary <string, string> { { "wells", "Устройство пунктов подключения" }, { "pipes", "Устройство футляров электроснабжения" }, { "rocky_ground", "Обратная засыпка скальным грунтом" }, { "planing", "Вертикальная планировка участка плита" }, { "stone_base", "Устройство щебеночного основания плита" }, { "concrete_prepare", "Устройство бетонной подготовки плита" }, { "reinforcement", "Армирование с установкой закладных деталей и анкерных болтов плиты" }, //"Установка опалубки плиты", { "concreting", "Бетонирование плиты" }, { "covering", "Бетонирование покрытия плиты" } }; DataPull dp = new DataPull("sqltest", "PMDB_EPPM", "PMDB_EPPM_privuser", "privuser123"); string date = dp.ExecuteRecalcDate("EPC.3 ИН-0748.15"); List <Pad> shipway = dp.ExecuteQuery(phases, "EPC.3 ИН-0748.15", "Бетонирование плиты"); Slipway s = new Slipway(shipway, date); return(View(s)); }
public void LoadChampInfo() { DataPull pull = new DataPull(); DataView dv = new DataView(); ChampInfo ci = new ChampInfo(); dv = pull.PullChampInfo(); foreach (DataRowView row in dv) { Champ cha = new Champ(); cha.championId = int.Parse(row["championId"].ToString()); cha.banRate = row["banRate"].ToString(); cha.pickRate = row["pickRate"].ToString(); cha.winWithItems = row["winWithItems"].ToString(); cha.winWithoutItems = row["winWithoutItems"].ToString(); cha.bestItem = row["bestItem"].ToString(); cha.AvgAssist = row["AvgAssist"].ToString(); cha.AvgDeaths = row["AvgDeaths"].ToString(); cha.AvgGoldEarned = row["AvgGoldEarned"].ToString(); cha.AvgKills = row["AvgKills"].ToString(); cha.AvgMinionsKilled = row["AvgMinionsKilled"].ToString(); cha.AvgTowerKills = row["AvgTowerKills"].ToString(); cha.AvgWardsPlaced = row["AvgWardsPlaced"].ToString(); cha.MaxAssist = row["MaxAssist"].ToString(); cha.MaxDeaths = row["MaxDeaths"].ToString(); cha.MaxGoldEarned = row["MaxGoldEarned"].ToString(); cha.MaxKills = row["MaxKills"].ToString(); cha.MaxMinionsKilled = row["MaxMinionsKilled"].ToString(); cha.MaxTowerKills = row["MaxTowerKills"].ToString(); cha.MaxWardsPlaced = row["MaxWardsPlaced"].ToString(); ci.info.Add(cha); } string json = JsonConvert.SerializeObject(ci); var path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "//RitoOutput//ChampInfo.json"; File.WriteAllText(path, json); }
public ViewResult TableSlipway() { Dictionary <string, string> phases = new Dictionary <string, string> { { "Вертикальная планировка", "Вертикальная планировка участка плита" }, { "Щебеночное основание", "Устройство щебеночного основания плита" }, { "Бетонная подготовка", "Устройство бетонной подготовки плита" }, { "Армирование плиты", "Армирование с установкой закладных деталей и анкерных болтов плиты" }, { "Установка опалубки", "Установка опалубки плиты" }, { "Бетонирование плиты", "Бетонирование плиты" }, { "Бетонирование покрытия", "Бетонирование покрытия плиты" }, { "Пункты подключения", "Устройство пунктов подключения" }, { "Футляры электроснабжения", "Устройство футляров электроснабжения" }, { "Засыпка скальным грунтом", "Обратная засыпка скальным грунтом" } }; DataPull dp = new DataPull("sqltest", "PMDB_EPPM", "PMDB_EPPM_privuser", "privuser123"); string date = dp.ExecuteRecalcDate("EPC.3 ИН-0748.15"); List <Pad> shipway = dp.ExecuteQuery(phases, "EPC.3 ИН-0748.15", "Бетонирование плиты"); Slipway s = new Slipway(shipway, date); return(View(s)); }
public static void Main(string[] args) { //WebPage page = new WebPage(new PageStructure("http://www.institutionalinvestorsalpha.com/Article/3354277/Will-Hedge-Fund-Fees-Ever-Come-Down.html", 0, new List<string>() { "class", "article", "id", "ctl00_ContentPlaceHolder1_lblTitle", "tag", "p" /*(second p)*/ }, new Uri("http://www.institutionalinvestorsalpha.com/"))); //Console.WriteLine(page.Blurb); //Console.WriteLine(page.Title); //Console.WriteLine(page.Article); ////WebPage page2 = new WebPage(new PageStructure("http://www.hedgefundintelligence.com/Article/3353537/AsiaHedge-News/SPARX-targets-growth-with-new-Japan-value-investing-strategy.html", 0, new List<string> { "class", "col_default article", "tag", "h1", "tag", "p" }, new Uri("http://www.hedgefundintelligence.com/"))); ////Console.WriteLine(page2.Blurb); ////Console.WriteLine(page2.Title); ////Console.WriteLine(page2.Article); //WebPage page3 = new WebPage(new PageStructure("http://www.finalternatives.com/node/27412", 0, new List<string> { "class", "content story ", "class", "title", "tag", "p" }, new Uri("http://www.finalternatives.com/"))); //Console.WriteLine(page3.Blurb); //Console.WriteLine(page3.Title); //Console.WriteLine(page3.Article); //WebPage page4 = new WebPage(new PageStructure("http://seekingalpha.com/article/2281813-cutting-my-dividends-by-35-percent-improving-my-dividend-growth-portfolio", 0, new List<string> { "id", "article_body", "tag", "h1", "tag", "p" }, new Uri("http://www.seekingalpha.com/"))); //Console.WriteLine(page4.Blurb); //Console.WriteLine(page4.Title); //Console.WriteLine(page4.Article); WebPage page5 = new WebPage(new PageStructure("http://www.institutionalinvestor.com/Article/3231909/Search/The-Best-Tweets-From-Delivering-Alpha.html?Keywords=grosvenor+capital+management&OrderType=1&PeriodType=4&StartDay=0&StartMonth=1&StartYear=2000&EndDay=0&EndMonth=7&EndYear=2014&ScopeIndex=0#.U7RrVfldX30", 0, new List <string> { "class", "article-body", "class", "title", "tag", "p" }, new Uri("http://institutionalinvestor.com/"))); Console.WriteLine(page5.Blurb); Console.WriteLine(page5.Title); Console.WriteLine(page5.Article); //WebPage page6 = new WebPage(new PageStructure("http://www.risk.net/risk-magazine/feature/2350848/bloomberg-sef-success-leads-to-fee-criticism", 0, new List<string> { "class", "article-description", "class", "kindle_title", "tag", "p" }, new Uri("http://risk.net/"))); //Console.WriteLine(page6.Blurb); //Console.WriteLine(page6.Title); //Console.WriteLine(page6.Article); //WebPage page6 = new WebPage("http://www.institutionalinvestorsalpha.com/FAQ.html", 0, // new List<string>() // { // "class", // "article", // "id", // "ctl00_ContentPlaceHolder1_lblTitle", // "tag", // "p" /*(second p)*/ // }, new Uri("http://www.institutionalinvestorsalpha.com/")); //Console.WriteLine(page6.Blurb); //Console.WriteLine(page6.Title); //Console.WriteLine(page6.Article); //foreach (var i in page6.Urls) //{ // Console.WriteLine(i); //} //WebPage page6 = new WebPage(new PageStructure("http://www.waterstechnology.com/waters/feature/2352343/in-spain-technology-charts-bad-bank-path", 0, new List<string> { "class", "article_descriptions new_test", "tag", "h1", "tag", "p" }, new Uri("http://www.waterstechnology.com/buy-side-technology/"))); //Console.WriteLine(page6.Blurb); //Console.WriteLine(page6.Title); //Console.WriteLine(page6.Article); var articleScore = new Dictionary <WebPage, int>(); var pull = new DataPull(); var crawler = new Crawler(); crawler.CrawlSite(); Console.WriteLine("Done Crawling"); var articles = crawler.PageRank.Keys.ToList(); var scorer = new Scorer(articles, pull); var scores = scorer.ScorePages(); foreach (var article in scores.Keys.AsEnumerable()) { Console.WriteLine(article.Title + " " + article.Blurb + "\n " + scores[article]); } //var highScore = new Dictionary<string, int>(); //foreach (var article in articles) //{ // var scorer = new Scorer(article, pull); // var score = scorer.ScorePage(); // articleScore.Add(article, score); // Console.WriteLine(article.Title + " " + article.Blurb + "\n " + score); // if (score > 1) // { // if (!highScore.Keys.ToArray().Contains(article.Title + " " + article.Blurb)) // { // highScore.Add(article.Title + " " + article.Blurb, score); // } // } //} Console.WriteLine("\n\n\n\n DONE SCORING!!!!\n\n\n\n\n\n"); //foreach (var a in highScore.Keys) //{ // Console.WriteLine(a + "\n" + highScore[a]); //} //var pull = new AthenaPull(); //var list = pull.Emms.Keys; //foreach (var word in list) //{ // Console.WriteLine(word); //} //var articleViewsModels = new ArticleViewModel(); //var f = articleViewsModels.Articles; //foreach (var q in f) //{ // Console.WriteLine(q.Url); // Console.WriteLine(q.Title); // Console.WriteLine(q.Blurb); //} //var today = DateTime.Now; //var yesterday = new DateTime(2014, 7, 8); //var substraction = new TimeSpan(5); //var x = today.AddDays(-5); //Console.WriteLine(x); //Console.WriteLine(yesterday > x); //var _keywords = new Dictionary<string, int> //{ // {"long-biased credit",2}, // {"structured credit",2}, // {"long/short credit",2}, // {"equity hedge",2}, // {"energy materials",2}, // {"equity market neutral",2}, // {"fundamental growth",2}, // {"fundamental value",2}, // {"multi-strategy",2}, // {"quantitative directional",2}, // {"short bias",2}, // {"activist",2}, // {"credit arbitrage",2}, // {"restructuring",2}, // {"distressed",2}, // {"merger arbitrage",2}, // {"Regulation D",2}, // {"special situation",2}, // {"active trading",2}, // {"commodity",2}, // {"systematic diversified",2}, // {"fixed income",2}, // {"volatility",2}, // {"yield alternatives",2}, // {"sovereign",2}, // {"corporate",2}, // {"convertible arbitrage", 2}, // {"asset backed",2}, // {"discretionary thematic",2}, // {"regulation",2}, // {"institutional",2}, // {"fund of hedge funds", 10}, // {"fund of funds", 10}, // {"alternative investment", 5}, // {"insider trading", 25}, // {"insider-trading", 25}, // {"Volcker rule", 5}, //}; //var _competitors = new Dictionary<string, int> //{ // {"Blackstone Alternative Asset Management", 5}, //Blackstone fohf // {"EnTrust Capital", 5}, // {"Pacific Alternative Asset Management", 5}, // {"Permal",5}, // {"Prisma",5}, //KKR fohf // {"Mesirow Advanced Strategies",5}, // Mesirow fohf // {"AIMS Hedge Fund Strategies",5}, //Goldman fohf // {"Alternative Investment & Manager Selection", 5}, // Goldman fohf // {"Aurora", 5}, // {"BlackRock Alternative Advisors",5}, //BlackRock fohf // {"GAM", 5}, // {"Aetos",5}, // {"Cube Capital", 5}, // {"Rock Creek",5}, // {"K2",5}, // {"Crestline",5}, // {"JP Morgan Alternative Asset Management",5}, //JP fohf // {"J.P. Morgan Alternative Asset Management",5}, //JP fohf // {"PFS Horizon",5}, //Credit Suisse fohf // {"HSBC Private Bank",5}, //HSBS fohf // {"Lyxor",5}, // {"A&Q Hedge Fund Solutions",5} //UBS fohf //}; //var connectionString = ConfigurationManager.ConnectionStrings["NewsApplicationDb"]; //var db = Database.OpenConnection(connectionString.ConnectionString); //foreach (var competitor in _competitors.Keys) //{ // db.Keywords.Insert(Keyword: competitor, Score: _competitors[competitor], Section: "Competitors"); //} //foreach (var keyword in _keywords.Keys) //{ // db.Keywords.Insert(Keyword: keyword, Score: _keywords[keyword], Section: "Industry"); //} Console.ReadKey(); }