void PrintFibonacci(int maxNumb) // make a function for writing the sequence and give it a maxNumb int, this int simbolises the longest sequence number we want to display { numbers = new string[maxNumb]; //set the array Length to maxNumb BigInteger Fa = 0; // I used BigInteger, because otherwise at around 25 clicks it would go in the - BigInteger Fb = 1; BigInteger Fc; //print(Fa); //print(Fb); for (int i = 0; i < maxNumb; i++) { // make the actual sequence Fc = Fa + Fb; // calculate Fc numbers[i] = Fc.ToString(); // replace the spots with the fc integer in the array, pretty taxing function print(Fc); Fa = Fb; Fb = Fc; } }
public LinuxPlatform() { fcconfig = Fc.InitLoadConfigAndFonts(); }
public LinuxPlatform() { fcconfig = Fc.InitLoadConfigAndFonts(); fcconfig.SetCurrent(); }
private async void GetDirectLink(string link) { HttpClient httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.IfModifiedSince = new DateTimeOffset?(DateTimeOffset.get_Now()); if (PlayVideo.ChanelPlayer.typeChannel.EndsWith("TrucTiep")) { if (this._countLink > 0 && !link.Contains("m3u8")) { string stringAsync = await httpClient.GetStringAsync(string.Concat("http://winphonevn.com/server/getlinkbongda.php?url=", link)); link = stringAsync; } this._countLink = this._countLink + 1; } this.Player.Source = null; string[] strArray = null; string str = ""; this.Load.set_Visibility(0); if (link.Contains("!")) { strArray = link.Split(new char[] { '!' }); } try { if (strArray != null) { str = await httpClient.GetStringAsync(strArray[0]); } if (link.Contains("fptlive")) { string str1 = link; char[] chrArray = new char[] { '/' }; string str2 = str1.Split(chrArray)[1]; httpClient = new HttpClient(); Dictionary <string, string> dictionary = new Dictionary <string, string>(); dictionary.Add("id", str2); dictionary.Add("quality", "3"); dictionary.Add("mobile", "web"); dictionary.Add("type", "newchannel"); FormUrlEncodedContent formUrlEncodedContent = new FormUrlEncodedContent(dictionary); HttpRequestMessage httpRequestMessage = new HttpRequestMessage() { Method = HttpMethod.Post, RequestUri = new Uri("http://fptplay.net/show/getlinklivetv", 1), Content = formUrlEncodedContent }; HttpRequestMessage uri = httpRequestMessage; uri.Headers.Referrer = new Uri("http://fptplay.net/"); uri.Headers.Add("X-Requested-With", "XMLHttpRequest"); HttpResponseMessage httpResponseMessage = await httpClient.SendAsync(uri, HttpCompletionOption.ResponseContentRead); string str3 = await httpResponseMessage.Content.ReadAsStringAsync(); if (str3 != null && str3.get_Length() > 0) { string item = (string)JObject.Parse(str3)["stream"]; if (item.get_Length() > 0) { this._str = item; } } } else if (strArray != null) { Match match = (new Regex(strArray[1], 9)).Match(str); if (match.get_Success() && match.get_Groups().get_Item(1).get_Value().StartsWith("http")) { this._str = HttpUtility.UrlDecode(match.get_Groups().get_Item(1).get_Value()); } } else if (link.Contains("app.101vn")) { Dictionary <string, string> dictionary1 = new Dictionary <string, string>(); dictionary1.Add("talachua", "101vn"); dictionary1.Add("package", "duahau3"); dictionary1.Add("version", "10"); FormUrlEncodedContent formUrlEncodedContent1 = new FormUrlEncodedContent(dictionary1); HttpResponseMessage httpResponseMessage1 = await httpClient.PostAsync(link, formUrlEncodedContent1); PlayVideo playVideo = this; string str4 = playVideo._str; playVideo._str = await httpResponseMessage1.Content.ReadAsStringAsync(); playVideo = null; } else if (link.Contains("notfreeplus")) { string str5 = await(new WebClient()).DownloadStringTaskAsync(new Uri("https://api.vtvplus.vn/pro/index.php/api/v1/channel/stream/88/?ip_address=0&[email protected]&type_device=android&type_network=wifi&app_name=VTVPlus")); str = str5; ObjectPlus objectPlu = JsonConvert.DeserializeObject <ObjectPlus>(str); this._str = objectPlu.Data.get_Item(0).Url; } else if (!link.Contains("notfreemtv")) { this._str = link; } else { string[] strArray1 = link.Split(new char[] { '=' }); Random random = new Random(); Dictionary <string, string> dictionary2 = new Dictionary <string, string>(); str = await httpClient.GetStringAsync("http://api.mytvnet.vn//getToken"); JObject jObjects = JObject.Parse(str); if (jObjects == null || jObjects["tid"] == null) { return; } else { long num = Convert.ToInt64((new Fc()).DeCodeTid(jObjects["tid"].ToString())); DateTime now = DateTime.get_Now(); Fc fc = new Fc(); dictionary2.Add("tid", fc.GetTid(num, now)); Dictionary <string, string> dictionary3 = dictionary2; int num1 = random.Next(1, 10); dictionary3.Add("device_type", num1.ToString()); Dictionary <string, string> dictionary4 = dictionary2; num1 = random.Next(1, 99); dictionary4.Add("app_v", num1.ToString()); dictionary2.Add("lang", "vn"); dictionary2.Add("channel_id", strArray1[1]); dictionary2.Add("mf_code", strArray1[2]); Dictionary <string, string> dictionary5 = dictionary2; num1 = random.Next(1, 10); dictionary5.Add("profile", num1.ToString()); Dictionary <string, string> dictionary6 = dictionary2; num1 = random.Next(1, 100000); dictionary6.Add("member_id", num1.ToString()); Dictionary <string, string> dictionary7 = dictionary2; num1 = random.Next(1, 1000000); dictionary7.Add("manufacturer_id", num1.ToString()); Dictionary <string, string> dictionary8 = dictionary2; num1 = random.Next(0, 100000); dictionary8.Add("device_id", num1.ToString()); FormUrlEncodedContent formUrlEncodedContent2 = new FormUrlEncodedContent(dictionary2); HttpResponseMessage httpResponseMessage2 = await httpClient.PostAsync("http://ott.mytvnet.vn/v5/channel/mobile/url", formUrlEncodedContent2); string str6 = await httpResponseMessage2.Content.ReadAsStringAsync(); jObjects = JObject.Parse(str6); if (jObjects["result"].ToString() == "-1") { Dictionary <string, string> dictionary9 = new Dictionary <string, string>(); dictionary9.Add("tid", fc.GetTid(num, now)); num1 = random.Next(1, 10); dictionary9.Add("device_type", num1.ToString()); num1 = random.Next(1, 99); dictionary9.Add("app_v", num1.ToString()); dictionary9.Add("lang", "vn"); dictionary9.Add("channel_id", strArray1[1]); dictionary9.Add("mf_code", strArray1[2]); num1 = random.Next(1, 10); dictionary9.Add("profile", num1.ToString()); num1 = random.Next(1, 100000); dictionary9.Add("member_id", num1.ToString()); num1 = random.Next(1, 1000000); dictionary9.Add("manufacturer_id", num1.ToString()); num1 = random.Next(1, 100000); dictionary9.Add("device_id", num1.ToString()); dictionary2 = dictionary9; formUrlEncodedContent2 = new FormUrlEncodedContent(dictionary2); HttpResponseMessage httpResponseMessage3 = await httpClient.PostAsync("http://api.mytvnet.vn/v5/channel/mobile/url", formUrlEncodedContent2); string str7 = await httpResponseMessage3.Content.ReadAsStringAsync(); jObjects = JObject.Parse(str7); this._str = jObjects["data"]["url"].ToString(); } else { this._str = jObjects["data"]["url"].ToString(); } strArray1 = null; random = null; dictionary2 = null; fc = null; } } this.Player.Source = new Uri(this._str.Trim(), 0); this.Player.Play(); } catch (Exception exception1) { Exception exception = exception1; EasyTracker.GetTracker().SendException(string.Concat(this._str, " :", exception.get_Message()), false); this.Player.Source = new Uri(this._str, 0); this.Player.Play(); this.Load.set_Visibility(1); } this.Load.set_Visibility(1); }