public MainPage() { InitializeComponent(); Entry1.Completed += (sender, args) => { Entry2.IsEnabled = true; if (string.IsNullOrEmpty(Entry2.Text)) { Entry2.Focus(); } }; Entry2.Completed += (sender, args) => { Entry3.IsEnabled = true; if (string.IsNullOrEmpty(Entry3.Text)) { Entry3.Focus(); } }; Entry1.Unfocused += async(sender, args) => { if (string.IsNullOrEmpty(Entry1.Text)) { await DisplayAlert("Atenção", "Digite a mensagem!", "Ok"); Entry1.Focus(); } else { Entry1.SendCompleted(); } }; Entry2.Unfocused += async(sender, args) => { if (string.IsNullOrEmpty(Entry2.Text)) { await DisplayAlert("Atenção", "Digite a mensagem!", "Ok"); Entry2.Focus(); } else { Entry2.SendCompleted(); } }; Entry3.Unfocused += async(sender, args) => { if (string.IsNullOrEmpty(Entry3.Text)) { await DisplayAlert("Atenção", "Digite a mensagem!", "Ok"); Entry3.Focus(); } }; }
public void ParseTypeConverterTest() { Entry2 entry = (Entry2)TypeConverter.ConvertValue("A,B", typeof(Entry2), XamlNamespaces.Empty); Assert.AreEqual("A", entry.Value1); Assert.AreEqual("B", entry.Value2); }
private IEnumerable <SetCardRequest> SetCardRequestPaging(int?page) { if (page == null) { ViewBag.CardSerialNumberSortParm = SortOrder2 == "CSN" ? "CSN_desc" : "CSN"; ViewBag.CategorySortParm = SortOrder2 == "Category" ? "Category_desc" : "Category"; ViewBag.EventSortParm = SortOrder2 == "Event" ? "Event_desc" : "Event"; ViewBag.DatetimeProcessedSortParm = SortOrder2 == "DatetimeProcessed" ? "DatetimeProcessed_desc" : "DatetimeProcessed"; ViewBag.StatusSortParm = SortOrder2 == "Status" ? "Status_desc" : "Status"; } switch (SortOrder2) { case "Date": Entry2 = Entry2.OrderBy(s => s.CardSerialNumber); break; case "Date_desc": Entry2 = Entry2.OrderByDescending(s => s.CardSerialNumber); break; case "Category_desc": Entry2 = Entry2.OrderByDescending(s => s.Category); break; case "Category": Entry2 = Entry2.OrderBy(s => s.Category); break; case "Event_desc": Entry2 = Entry2.OrderByDescending(s => s.Event); break; case "Event": Entry2 = Entry2.OrderBy(s => s.Event); break; case "DatetimeProcessed": Entry2 = Entry2.OrderBy(s => s.DatetimeProcessed); break; case "Status_desc": Entry2 = Entry2.OrderByDescending(s => s.Status); break; case "Status": Entry2 = Entry2.OrderBy(s => s.Status); break; default: Entry2 = Entry2.OrderByDescending(s => s.DatetimeProcessed); break; } ViewBag.CurrentSort2 = SortOrder2; return(Entry2); }
public ArticleModel FeedToArticleModel(Entry2 nfa, FeedModel scm) { if (nfa == null) { return(null); } return(ExecuteSafe(() => { if (nfa.articleType == "standard-article") { var lowkicker = nfa.kicker.ToLower().Trim(); if (lowkicker.EndsWith("quiz") || nfa.kicker.Contains("test")) { return null; } var blockedIds = new[] { "6979480", //persönlichkeitstest "6974764", //Quiz "6948896", //Europa Quiz "6979480", //persönlichkeitstest "6979480", //persönlichkeitstest }; if (blockedIds.Any(i => i == nfa.contentId)) { return null; } var a = ConstructArticleModel(scm); a.PublishDateTime = DateTime.Parse(nfa.timestamp); a.Title = nfa.kicker; a.SubTitle = nfa.headline; a.Teaser = nfa.teaser; if (nfa.images != null && nfa.images.Count > 3) { a.LeadImage = new ImageContentModel() { Url = nfa.images[3].src } } ; a.LogicUri = scm.Source.LogicBaseUrl + nfa.contentId + ".json"; a.PublicUri = scm.Source.PublicBaseUrl + nfa.contentId; return a; } return null; })); }
public MainPage() { InitializeComponent(); Entry1.Completed += (sender, args) => { Entry2.IsEnabled = true; Entry2.Focus(); }; Entry2.Completed += (sender, args) => { Entry3.IsEnabled = true; Entry3.Focus(); }; }
private async void ButtonFacebook_Clicked(object sender, System.EventArgs e) { await Task.WhenAny(Label1.FadeTo(0, AnimationSpeed, Easing.SinIn), Task.Delay(80)); await Task.WhenAny(Entry1.FadeTo(0, AnimationSpeed, Easing.SinIn), Task.Delay(80)); await Task.WhenAny(Label2.FadeTo(0, AnimationSpeed, Easing.SinIn), Task.Delay(80)); await Task.WhenAny(Entry2.FadeTo(0, AnimationSpeed, Easing.SinIn), Task.Delay(80)); await Task.WhenAny(buttonSubmit.FadeTo(0, AnimationSpeed, Easing.SinIn), Task.Delay(80)); await buttonFacebook.FadeTo(0, AnimationSpeed, Easing.SinIn); }
public static float[] CalculateFast(int[] hand, int handLength, SdKind sdKind) { Debug.Assert(handLength >= 0 && handLength <= 7); if (handLength == 7) { // SdKind.SdPlus1 will throw an exception, this is exactly what we want. return(Calculate(hand, handLength, sdKind == SdKind.SdPlus1 ? 4 : 3)); } if (_lut2 == null) { LoadLuts(); } float[] hssd = new float[2]; int round = HeHelper.HandSizeToRound[handLength]; CardSet pocket = StdDeck.Descriptor.GetCardSet(hand, 0, 2); CardSet board = StdDeck.Descriptor.GetCardSet(hand, 2, handLength - 2); NormSuit se = new NormSuit(); CardSet sePocket = se.Convert(pocket); CardSet seBoard = se.Convert(board); if (round == 2) { Entry2 keyEntry = new Entry2(HePocket.CardSetToKind(sePocket), seBoard); int idx = Array.BinarySearch(_lut2, keyEntry); if (idx < 0) { ThrowNoEntryException(sePocket, seBoard); } hssd[0] = _lut2[idx].Hs; // For turn, there is no difference between SD kinds. hssd[1] = _lut2[idx].SdPlus1; } else { Entry01 keyEntry = new Entry01(HePocket.CardSetToKind(sePocket), seBoard); int idx = Array.BinarySearch(_lut01[round], keyEntry); if (idx < 0) { ThrowNoEntryException(sePocket, seBoard); } // For turn, there is no difference between SD kinds. hssd[0] = _lut01[round][idx].Hs; hssd[1] = sdKind == SdKind.SdPlus1 ? _lut01[round][idx].SdPlus1 : _lut01[round][idx].Sd3; } return(hssd); }
protected override async void OnAppearing() { base.OnAppearing(); await Task.WhenAny(Label1.ScaleTo(1, AnimationSpeed, Easing.SinIn), Task.Delay(80)); await Task.WhenAny(Entry1.ScaleTo(1, AnimationSpeed, Easing.SinIn), Task.Delay(80)); await Task.WhenAny(Label2.ScaleTo(1, AnimationSpeed, Easing.SinIn), Task.Delay(80)); await Task.WhenAny(Entry2.ScaleTo(1, AnimationSpeed, Easing.SinIn), Task.Delay(80)); await Task.WhenAny(buttonSubmit.ScaleTo(1, AnimationSpeed, Easing.SinIn), Task.Delay(80)); await buttonFacebook.ScaleTo(1, AnimationSpeed, Easing.SinIn); }
public List <Entry2> Sample(int size) { double cumReward = 0.0; List <Entry2> l = new List <Entry2> (size); int[] arr = GetRandomIndices(size); foreach (int i in arr) { Entry2 e = Entries [i]; e.nextState = Entries [i + 1].state; e.reward = ComputeReward(e, Entries[i + 1]); l.Add(e); cumReward += e.reward; } Debug.Log("Reward: " + cumReward / size); return(l); }
public double ComputeReward(Entry2 current, Entry2 next) { double speedDiff = next.speed - current.speed; double distDiff = next.dist_surroundings - current.dist_surroundings; //System.Math.Max(next.dist - euclideanDistance, 0.0); // double cubeDistDiff = next.dist_to_cube; // double b = (cubeDistDiff >= 3 && cubeDistDiff <= 4) ? 2.0 : 0.0; //to map 0.5 to 1 // if (cubeDistDiff > 3.5) { // cubeDistDiff = 0.5 - (cubeDistDiff - 3.5); // } else { // cubeDistDiff = 0.5 - (3.5 - cubeDistDiff); // } // Debug.Log ("Cube Dist Diff: " + cubeDistDiff); // double s = next.speed < 0.2 ? (next.speed - 1) : 0.0; // s = next.speed > 0.5 ? next.speed : 0.0; return(speedDiff * r_alphas [0] + distDiff * r_alphas [1]); // + b*cubeDistDiff * r_alphas[2]; }
public void Enqueue(Matrix <double> s, int action, double speed, double dist_surroundings, double dist_to_cube) { Entry2 e = new Entry2(); e.state = s; e.action = action; e.speed = speed; e.dist_to_cube = dist_to_cube; e.dist_surroundings = dist_surroundings; Entries.Add(e); count++; while (count > Limit) { Entries.RemoveAt(0); count--; } }
private void setViewBags() { if (!String.IsNullOrEmpty(InstitutionID)) { ViewBag.Program = PROGRAM_ID.UPASS; // ni.ProgramId; var ni = Logs.GetNCSInfo(InstitutionID); if (ni != null) { ViewBag.Name = ni.Name; ViewBag.OrganizationId = ni.OrganizationId; ViewBag.ShortName = ni.ShortName; } } ViewBag.InstitutionID = InstitutionID; ViewBag.GUID = GUID; ViewBag.SetEligibilityRequest = Entry1.ToPagedList(Page1, pageSize); ViewBag.SetCardRequest = Entry2.ToPagedList(Page2, pageSize); ViewBag.SetBenefitRequest = Entry3.ToPagedList(Page3, pageSize); }
public ActionResult Index(string institutionID, string guid, string tsid) { if (!string.IsNullOrEmpty(institutionID)) { InstitutionID = institutionID; Session["InstitutionID"] = InstitutionID; } if (!string.IsNullOrEmpty(guid)) { GUID = guid; } if (!string.IsNullOrEmpty(tsid)) { TSID = tsid; } // Get current Server from which EventLog is being monitored and display SetCurrentServer(); // Get total memory used so far and set and display SetCurrentProcessMemorySize(); Page1 = Page2 = Page3 = 1; Entry1 = GenListSetEligibilityRequest(); ViewBag.SetEligibilityRequest = Entry1.ToPagedList(Page1, pageSize); Entry2 = GenListSetCardRequest(); ViewBag.SetCardRequest = Entry2.ToPagedList(Page2, pageSize); Entry3 = GenListSetBenefitRequest(); ViewBag.SetBenefitRequest = Entry3.ToPagedList(Page3, pageSize); setViewBags(); return(View()); }
public void Run() { int i = 0; while (true) { Console.WriteLine("Echo imput:"); if (i == 0) { Entry = Console.ReadLine(); //calls set method calling event i = 1; } else { Entry2 = Console.ReadLine(); //calls set method calling event i = 0; } if (Entry.Equals("q") || Entry2.Equals("q")) { return; } } }
private void Entry6_OnCompleted(object sender, EventArgs e) { Entry2.Focus(); }
public Entry2 Add(Entry2 it) { Entry2List.Add(it); return(it); }
private void button2_clicked(object sender, EventArgs e) { Entry2.Focus(); }
static void OnPrecalculateBoard(ref CardSet board, PrecalculationContext d) { NormSuit sei = new NormSuit(d.pocketSei); CardSet seBoard = sei.Convert(board); List <Entry01> list01 = null; List <Entry2> list2 = null; UInt32 key = GetKey((int)d.pocketKind, seBoard); bool addNew = false; // A key will be either present in the table or go to the end (greater than the rest). // This is due to the order of dealt boards in CardEnum if (d.Round < 2) { list01 = (List <Entry01>)d.list; addNew = list01.Count == 0 || list01[list01.Count - 1].Key < key; } else { list2 = (List <Entry2>)d.list; addNew = list2.Count == 0 || list2[list2.Count - 1].Key < key; } if (addNew) { List <int> pocketIdxs = StdDeck.Descriptor.GetIndexesAscending(d.pocket); List <int> boardIdxs = StdDeck.Descriptor.GetIndexesAscending(seBoard); int[] hand = new int[pocketIdxs.Count + boardIdxs.Count]; int h = 0; for (int i = 0; i < pocketIdxs.Count; ++i) { hand[h++] = pocketIdxs[i]; } for (int i = 0; i < boardIdxs.Count; ++i) { hand[h++] = boardIdxs[i]; } float[] sdhs; if (d.Round < 2) { Entry01 newEntry = new Entry01 { Key = key }; sdhs = Calculate(hand, d.Round + 1); newEntry.Hs = sdhs[0]; newEntry.SdPlus1 = sdhs[1]; sdhs = Calculate(hand, 3); newEntry.Sd3 = sdhs[1]; list01.Add(newEntry); } else { Entry2 newEntry = new Entry2 { Key = key }; sdhs = Calculate(hand, d.Round + 1); newEntry.Hs = sdhs[0]; newEntry.SdPlus1 = sdhs[1]; list2.Add(newEntry); } } d.count++; }