private void Tab2btnFindPeriodLC_Click(object sender, EventArgs e) { Tab2txtResult.Clear(); Application.DoEvents(); Tab2txtResult.AppendText("Starting to compute first 50000 stream output.\r\n"); for (int i = 0; i < 50000; i++) { L1.Clock(); L2.Clock(); L3.Clock(); L4.Clock(); NonlinCombOutput += NonLinearCombiner(L1.StreamOutput, L2.StreamOutput, L3.StreamOutput, L4.StreamOutput).Value.ToString(); } Tab2txtResult.AppendText("Stream has been generated.\r\nStarting to compute period.\r\n"); Application.DoEvents(); int period = LFSRTools.FindStreamPeriodExtended(NonlinCombOutput, 3 + 4 + 5 + 7); Tab2txtResult.AppendText("\r\nPeriod is " + period + ".\r\n"); int LCbound = NonLinearCombinerStar(L1.FeedbackPolynomial.Degree, L2.FeedbackPolynomial.Degree, L3.FeedbackPolynomial.Degree, L4.FeedbackPolynomial.Degree); Tab2txtResult.AppendText("\r\nLC is bounded by " + LCbound + "."); }
public void Draw(ref Graphics g, float originX, float originY, float scale, float offsetX, float offsetY, float brushSize) { L1.Draw(ref g, originX, originY, scale, offsetX, offsetY, brushSize); L2.Draw(ref g, originX, originY, scale, offsetX, offsetY, brushSize); L3.Draw(ref g, originX, originY, scale, offsetX, offsetY, brushSize); L4.Draw(ref g, originX, originY, scale, offsetX, offsetY, brushSize); }
/// <summary> /// Gets Besselian elements values for specified Juluan Day. /// </summary> /// <param name="jd">Julian Day of interest</param> /// <returns></returns> internal InstantBesselianElements GetInstantBesselianElements(double jd) { //if (jd < From || jd > To) // throw new ArgumentException($"Polynomial Besselian elements valid only for Julian Day in range [{From} ... {To}].", nameof(jd)); // difference, with t0, in step units double t = (jd - JulianDay0) / Step; return(new InstantBesselianElements() { X = X.Select((x, n) => x * Pow(t, n)).Sum(), Y = Y.Select((y, n) => y * Pow(t, n)).Sum(), L1 = L1.Select((l1, n) => l1 * Pow(t, n)).Sum(), L2 = L2.Select((l2, n) => l2 * Pow(t, n)).Sum(), D = D.Select((d, n) => d * Pow(t, n)).Sum(), Mu = To360(Mu.Select((mu, n) => mu * Pow(t, n)).Sum()), F1 = F1.Select((f1, n) => f1 * Pow(t, n)).Sum(), F2 = F2.Select((f2, n) => f2 * Pow(t, n)).Sum(), dX = Derivative(X, t), dY = Derivative(Y, t), dL1 = Derivative(L1, t), dL2 = Derivative(L2, t), dD = Derivative(D, t), dMu = Derivative(Mu, t) }); }
public Cost(CostSettings settings) { BatchCost = 0; switch (settings.RegularizationType) { case ERegularizationType.Invalid: throw new ArgumentException("Invalid Regularization Function Selected!"); case ERegularizationType.None: RegularizationFunction = new None(); break; case ERegularizationType.L1: RegularizationFunction = new L1((L1Settings)settings.RegularizationSettings); break; case ERegularizationType.L2: RegularizationFunction = new L2((L2Settings)settings.RegularizationSettings); break; default: throw new ArgumentException("Invalid Regularization Function Selected!"); } }
public override int GetHashCode() { unchecked { var hashCode = _totalBalance.GetHashCode(); hashCode = (hashCode * 397) ^ AutoSleep.GetHashCode(); hashCode = (hashCode * 397) ^ SleepThreshold.GetHashCode(); hashCode = (hashCode * 397) ^ (Login != null ? Login.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Password != null ? Password.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Role != null ? Role.GetHashCode() : 0); hashCode = (hashCode * 397) ^ LicenseExpDate.GetHashCode(); hashCode = (hashCode * 397) ^ (Status != null ? Status.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ConnectionID != null ? ConnectionID.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Sleep != null ? Sleep.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Alerts.GetHashCode(); hashCode = (hashCode * 397) ^ AllTrades.GetHashCode(); hashCode = (hashCode * 397) ^ AllTradesPro.GetHashCode(); hashCode = (hashCode * 397) ^ Chart.GetHashCode(); hashCode = (hashCode * 397) ^ Counter.GetHashCode(); hashCode = (hashCode * 397) ^ L2.GetHashCode(); hashCode = (hashCode * 397) ^ Logbook.GetHashCode(); hashCode = (hashCode * 397) ^ Trading.GetHashCode(); hashCode = (hashCode * 397) ^ FastOrder.GetHashCode(); hashCode = (hashCode * 397) ^ (Email != null ? Email.GetHashCode() : 0); hashCode = (hashCode * 397) ^ SleepThreshold.GetHashCode(); hashCode = (hashCode * 397) ^ ProfitControl.GetHashCode(); hashCode = (hashCode * 397) ^ ProfitLimit.GetHashCode(); hashCode = (hashCode * 397) ^ ProfitLossLimit.GetHashCode(); return(hashCode); } }
public eSuccessState ParseFACCHData(GSMParameters param, bool[] burstBufferC) { /* decode */ if (Deconvolution(burstBufferC) == eCorrectionResult.Failed) { ErrorMessage = "(FACCH: Error in ConvolutionalCoder, maybe encrypted)"; CryptedFrames++; return(eSuccessState.Unknown); } /* CRC check/fix */ switch (CRCCheck()) { case eCorrectionResult.Fixed: StatusMessage = "(FACCH: CRC Error recovered)"; break; case eCorrectionResult.Failed: ErrorMessage = "(FACCH: CRC Error)"; return(eSuccessState.Failed); } /* convert u[] to d[] bytes */ PackBytes(); DataBursts++; L2.Handle(param, this, L3, BurstBufferD); return(eSuccessState.Succeeded); }
private void btn_Read_Click(object sender, EventArgs e) { string L1, L2, L3; dataset.Clear(); dataset = DALFunc.QueryTable("EquipTypeSlet"); txtbox_Num.Text = dataset.Tables[0].Rows[3].ToString(); L1 = dataset.Tables[0].Rows[4].ToString(); string[] L1D = L1.Split(';'); lbox_L1.Items.Clear(); for (int i = 0; i < L1D.Count(); i++) { lbox_L1.Items.Add(L1D[i]); } L2 = dataset.Tables[0].Rows[5].ToString(); string[] L2D = L2.Split(';'); lbox_L2.Items.Clear(); for (int i = 0; i < L2D.Count(); i++) { lbox_L2.Items.Add(L2D[i]); } L3 = dataset.Tables[0].Rows[6].ToString(); string[] L3D = L3.Split(';'); lbox_L3.Items.Clear(); for (int i = 0; i < L3D.Count(); i++) { lbox_L3.Items.Add(L3D[i]); } }
public override void Update() { Total = L1.GetComponent <Levier>().ValeurL1 + L2.GetComponent <Levier>().ValeurL2 + L3.GetComponent <Levier>().ValeurL3 + L4.GetComponent <Levier>().ValeurL4; print("Valeur Solution: " + Solution); print("Valeur Levier: " + Total); if (CanOpen) { if (maxOpen < 180 && maxOpen > 0) { if (transform.localEulerAngles.y < maxOpen) { transform.Rotate(new Vector3(0, 100, 0) * Time.deltaTime); } else { base.Declencher_Etape_Suivante_Du_Scenario(); } } if (maxOpen >= 180) { if (transform.localEulerAngles.y <= 45 && transform.localEulerAngles.y > 0 || transform.localEulerAngles.y > maxOpen) { transform.Rotate(new Vector3(0, -100, 0) * Time.deltaTime); } else { base.Declencher_Etape_Suivante_Du_Scenario(); } } } }
private void button2_Click(object sender, EventArgs e) { L2 l2 = new L2(); l2.Show(); this.Hide(); }
[TestMethod] public void InFunction() { using (var l = new Lua()) { var L = luanet.getstate(l); lua.cpcall(L, L2 => { Assert.AreEqual(1, L2.Length); lua.pop(L2, 1); Assert.AreEqual(3, L.Sum(si => si.Type == LUA.T.NONE ? 0 : 1)); Assert.AreEqual(LUA.T.NONE, L2[lua.upvalueindex(1)].Type); return(0); }, default(IntPtr)); Assert.AreEqual(0, L.Length); lua.CFunction cf = L2 => { Assert.AreEqual(0, L2.Length); Assert.AreEqual(4, L2.Sum(si => si.Type == LUA.T.NONE ? 0 : 1)); Assert.AreEqual(LUA.T.BOOLEAN, L2[lua.upvalueindex(1)].Type); return(0); }; lua.pushboolean(L, true); lua.pushcclosure(L, cf, 1); lua.call(L, 0, 0); GC.KeepAlive(cf); Assert.AreEqual(0, L.Length); } }
public void Draw(SpriteBatch spriteBatch) { if (!start && !hasLost) { string hello = "Press Enter to Begin!"; spriteBatch.DrawString(myFont, hello, new Vector2(300, 300), Color.White); L3.Draw(spriteBatch); L1.Draw(spriteBatch); L2.Draw(spriteBatch); } else if (hasLost) { string lost = "You have died! Press Enter to restart."; spriteBatch.DrawString(myFont, lost, new Vector2(300, 300), Color.White); } else if (start) { foreach (SuperClass g in gameObjs) { if (g != null) { g.Draw(spriteBatch); } } foreach (Bubble bub in gameObjList.OfType <Bubble>()) { bub.Draw(spriteBatch); } string pts = "Score: " + SuperClass.score; string life = "Energy: " + Player.energy; spriteBatch.DrawString(myFont, pts, new Vector2(6, 6), Color.Yellow); spriteBatch.DrawString(myFont, life, new Vector2(800, 6), Color.Wheat); } }
/// <summary> /// The new line on which the cone should be modeled around /// </summary> /// <param name="rotation">The rotation of the cone</param> /// <param name="q">The quadrant the bone is inside</param> /// <param name="radius">The x,y radius of the cone</param> /// <returns>The new Line on which the cone should be modeled</returns> private Vector3 GetNewL(Quaternion rotation, Quadrant q, Vector2 radius) { Quaternion inverRot = Quaternion.Invert(rotation); Vector3 right = Vector3.Transform(Vector3.UnitX, inverRot); Vector3 forward = Vector3.Transform(Vector3.UnitZ, inverRot); Vector3 L2; switch (q) { case Quadrant.q1: if (radius.X > 90) { L2 = right; } else { L2 = forward; } break; case Quadrant.q2: if (radius.X > 90) { L2 = right; } else { L2 = -forward; } break; case Quadrant.q3: if (radius.X > 90) { L2 = -right; } else { L2 = -forward; } break; case Quadrant.q4: if (radius.X > 90) { L2 = -right; } else { L2 = forward; } break; default: L2 = right; break; } L2.NormalizeFast(); return(L2); }
public static void Main(string[] args) { C1 c1 = new C1(); // create instance of class that raises event L1 l1 = new L1(); // create instance of 1st class that handles event L2 l2 = new L2(); // create instande of 2nd class that handles event // no handlers are yet registered on the event try { c1.Raise(); // will crash and output exception as no handler set yet } catch (Exception ex) { Console.WriteLine(ex.Message); } c1.SafeRaise(); // safe, will print message l1.AddListener(c1); // add as listener c1.Raise(); // prints handled message l2.AddListener(c1); // add 2nd listener c1.Raise(); // both print handled message Console.ReadLine(); // stop console from closing }
/// <summary> /// Add a set of evaluation metrics to the set of observations. /// </summary> /// <param name="metrics">The observed regression evaluation metric</param> public override void Add(RegressionMetrics metrics) { L1.Add(metrics.L1); L2.Add(metrics.L2); Rms.Add(metrics.Rms); LossFn.Add(metrics.LossFn); RSquared.Add(metrics.RSquared); }
/// <summary> /// Add a set of evaluation metrics to the set of observations. /// </summary> /// <param name="metrics">The observed regression evaluation metric</param> public override void Add(RegressionMetrics metrics) { L1.Add(metrics.MeanAbsoluteError); L2.Add(metrics.MeanSquaredError); Rms.Add(metrics.RootMeanSquaredError); LossFn.Add(metrics.LossFunction); RSquared.Add(metrics.RSquared); }
public void L2Test() { const double lambda = 1.0; var reg = new L2(); var mat = new Matrix(10, 10); mat.InRandomize(); Assert.IsTrue(Math.Abs(mat.FrobeniusNorm() * lambda - reg.CalculateNorm(mat)) < 0.1, reg.Type().ToString() + " Regularization."); }
/// <summary> /// 设置精度 /// </summary> /// <param name="n1">角度保留到小数点后的位数</param> /// <param name="n2">方位角保留到小数点后的位数</param> /// <param name="n3">大地线长度保留到小数点后的位数</param> public void SetAccurate(int n1, int n2, int n3) { B1.Set_Accurate(n1); L1.Set_Accurate(n1); A12.Set_Accurate(n2); B2.Set_Accurate(n1); L2.Set_Accurate(n1); A21.Set_Accurate(n2); S = Methods.Set_Accurate(S, n3); }
public TextBook(string _userid) { InitializeComponent(); L1.AppendText(ViewModel.TextBookViewModel.UserText(_userid, 1)); L2.AppendText(ViewModel.TextBookViewModel.UserText(_userid, 2)); LK.AppendText(ViewModel.TextBookViewModel.UserText(_userid, 3)); PractZ.AppendText(ViewModel.TextBookViewModel.UserText(_userid, 4)); CourcePr.AppendText(ViewModel.TextBookViewModel.UserText(_userid, 5)); Import.AppendText(ViewModel.TextBookViewModel.UserText(_userid, 6)); UserId = _userid; }
public static List<Level> registerLevels(Texture2D playermove, Texture2D playerattack, Texture2D grass, Texture2D grassbarrier, Texture2D foamsword, Texture2D portal, Song eightbit, Song cantina_theme, Song arcade, SpriteFont normalfont, Texture2D button, Texture2D buttonhover, Texture2D tshirt, Texture2D pixel, Texture2D slimeparticle, Texture2D skyportal, Texture2D tooltiptxture, SpriteFont descriptionfont, Texture2D keytxture, Texture2D keydown) { List<Level> levellist = new List<Level>(); l1 = new L1(playermove, playerattack, grass, grassbarrier, foamsword, portal, eightbit, tooltiptxture, descriptionfont, keytxture, keydown); levellist.Add(l1); l2intro = new L2Intro(playermove, playerattack, portal, cantina_theme, normalfont, button, buttonhover, tshirt); levellist.Add(l2intro); l2 = new L2(playermove, playerattack, portal, arcade, pixel, slimeparticle, skyportal, tooltiptxture, descriptionfont, keytxture, keydown); levellist.Add(l2); return levellist; }
private void cbox_Eq_SelectedIndexChanged(object sender, EventArgs e) { if (cbox_Eq.Text.Trim() != "") { lbox_UsedAlg.Items.Clear(); //FreshLbox("EquipName", "EquipAlgSlet", "lbox_UsedAlg"); dataset.Clear(); dataset = ServiceContainer.GetService <IGasDAL>().QueryData("AlgName", "EquipAlgSlet", "EquipName", cbox_Eq.Text); int j = 0; foreach (DataRow dr in dataset.Tables[0].Rows) { lbox_UsedAlg.Items.Add(dataset.Tables[0].Rows[j][0]); j++; } lbox_Factor.Items.Clear(); lbox_UsedFact.Items.Clear(); string L1, L2, L3; dataset.Clear(); dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L1", "EquipTypeSlet", "EquipName", cbox_Eq.Text); L1 = dataset.Tables[0].Rows[0][0].ToString(); string[] L1D = L1.Split(';'); for (int i = 0; i < L1D.Count() - 1; i++) { lbox_Factor.Items.Add(L1D[i]); } dataset.Clear(); dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L2", "EquipTypeSlet", "EquipName", cbox_Eq.Text); L2 = dataset.Tables[0].Rows[0][0].ToString(); string[] L2D = L2.Split(';'); for (int i = 0; i < L2D.Count() - 1; i++) { lbox_Factor.Items.Add(L2D[i]); } dataset.Clear(); dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L3", "EquipTypeSlet", "EquipName", cbox_Eq.Text); L3 = dataset.Tables[0].Rows[0][0].ToString(); string[] L3D = L3.Split(';'); for (int i = 0; i < L3D.Count() - 1; i++) { lbox_Factor.Items.Add(L3D[i]); } } }
/// <summary> /// 创建treeview /// </summary> /// <param name="datasetALL">整表信息</param> private void FreshTree(DataSet datasetALL) { Tree_Factor.Nodes.Clear(); int j = 0; foreach (DataRow dr in datasetALL.Tables[0].Rows) { //string ii= datasetALL.Tables[0].Rows[j]["Selected"].ToString(); //if (datasetALL.Tables[0].Rows[j]["Selected"].ToString() == "True") //{} TreeNode tn = Tree_Factor.Nodes.Add(datasetALL.Tables[0].Rows[j]["EquipName"].ToString()); string L1, L2, L3; TreeNode tn1 = new TreeNode("直采数据"); tn.Nodes.Add(tn1); L1 = datasetALL.Tables[0].Rows[j]["L1"].ToString(); string[] L1D = L1.Split(';'); for (int i = 0; i < L1D.Count() - 1; i++) { TreeNode tn12 = new TreeNode(L1D[i]); tn1.Nodes.Add(tn12); } TreeNode tn2 = new TreeNode("操作数据"); tn.Nodes.Add(tn2); L2 = datasetALL.Tables[0].Rows[j]["L2"].ToString(); string[] L2D = L2.Split(';'); for (int i = 0; i < L2D.Count() - 1; i++) { TreeNode tn22 = new TreeNode(L2D[i]); tn2.Nodes.Add(tn22); } TreeNode tn3 = new TreeNode("调度数据"); tn.Nodes.Add(tn3); L3 = datasetALL.Tables[0].Rows[j]["L3"].ToString(); string[] L3D = L3.Split(';'); for (int i = 0; i < L3D.Count() - 1; i++) { TreeNode tn32 = new TreeNode(L3D[i]); tn3.Nodes.Add(tn32); } j++; } }
private void lbox_UsedAlg_SelectedIndexChanged(object sender, EventArgs e) { //lbox_UsedAlg.Items.Clear(); lbox_Factor.Items.Clear(); lbox_UsedFact.Items.Clear(); string L1, L2, L3; dataset.Clear(); dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L1", "EquipTypeSlet", "EquipName", cbox_Eq.Text); L1 = dataset.Tables[0].Rows[0][0].ToString(); string[] L1D = L1.Split(';'); for (int i = 0; i < L1D.Count() - 1; i++) { lbox_Factor.Items.Add(L1D[i]); } dataset.Clear(); dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L2", "EquipTypeSlet", "EquipName", cbox_Eq.Text); L2 = dataset.Tables[0].Rows[0][0].ToString(); string[] L2D = L2.Split(';'); for (int i = 0; i < L2D.Count() - 1; i++) { lbox_Factor.Items.Add(L2D[i]); } dataset.Clear(); dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L3", "EquipTypeSlet", "EquipName", cbox_Eq.Text); L3 = dataset.Tables[0].Rows[0][0].ToString(); string[] L3D = L3.Split(';'); for (int i = 0; i < L3D.Count() - 1; i++) { lbox_Factor.Items.Add(L3D[i]); } /* * string Factor; * dataset.Clear(); * dataset = ServiceContainer.GetService<IGasDAL>().QueryData("Factor", "EquipAlgSlet", "EquipName", cbox_Eq.Text, "AlgName", lbox_UsedAlg.SelectedItem.ToString()); * Factor = dataset.Tables[0].Rows[0][0].ToString(); * string[] FactorD = Factor.Split(';'); * for (int i = 0; i < FactorD.Count() - 1; i++) * { * lbox_UsedFact.Items.Add(FactorD[i]); * } */ }
public void Update(GameTime gameTime) { if (!start) { L1.Update(); L2.Update(); L3.Update(); } if (!start && Keyboard.GetState().IsKeyDown(Keys.Enter)) { start = true; } if (hasLost) { start = false; if (Keyboard.GetState().IsKeyDown(Keys.Enter)) { hasLost = false; Player.energy = 3; CreateLevel(); } } if (!songstart && start && !hasLost) { MediaPlayer.Play(brinstar); songstart = true; } foreach (SuperClass g in gameObjs) { if (g != null) { g.Update(gameTime); } } foreach (Bubble bub in gameObjList.OfType <Bubble>()) { bub.Update(gameTime); if (!bub.IsActive) { break; } } }
public int CreatEquipTab() { DataSet dataset = new DataSet(); dataset = dataControl.QueryData("EquipTypeSlet", "Selected", "1"); int j = 0; foreach (DataRow dr in dataset.Tables[0].Rows) { for (int i = 0; i < int.Parse(dataset.Tables[0].Rows[j]["EquipNum"].ToString()); i++) { tabControl.CreatEquipTabPart1(dataset.Tables[0].Rows[j]["ETabName"].ToString(), (i + 1).ToString()); string L1, L2, L3; L1 = dataset.Tables[0].Rows[j]["L1"].ToString(); string[] L1D = L1.Split(';'); for (int k = 0; k < L1D.Count() - 1; k++) { tabControl.AddTableColum(dataset.Tables[0].Rows[j]["ETabName"].ToString(), (i + 1).ToString() + "_L1", L1D[k]); } L2 = dataset.Tables[0].Rows[j]["L2"].ToString(); string[] L2D = L2.Split(';'); for (int k = 0; k < L2D.Count() - 1; k++) { tabControl.AddTableColum(dataset.Tables[0].Rows[j]["ETabName"].ToString(), (i + 1).ToString() + "_L2", L2D[k]); } L3 = dataset.Tables[0].Rows[j]["L3"].ToString(); string[] L3D = L3.Split(';'); for (int k = 0; k < L3D.Count() - 1; k++) { tabControl.AddTableColum(dataset.Tables[0].Rows[j]["ETabName"].ToString(), (i + 1).ToString() + "_L3", L3D[k]); } } j++; } return(0); }
} //# end of leftbump.characteristics //# new_0.11 private ParamB01 LeftSideFastScan(Bounds bounds, ISecuredNR o, SGNFnAParam A, double target, double lowerSideLimit, double h2Modeless, L1 lsStart = null, double epsilon = 1e-8, int lowerSide = 0) { //# in input bounds, the slopes (hp values) must be negative & positive, respectively //# (thus pointing towards a 'dip', or local minimum) if (lsStart == null) { lsStart = new L1(); } int higherSide = 1 - lowerSide; // correction juillet 2017 L1 dip = DipCharacteristics(bounds.Copy(), o, A, epsilon); L2 leftBump = LeftBumpCharacteristics(o, bounds.X[lowerSide], bounds.Hp[lowerSide], target, A, lowerSideLimit, h2Modeless, lsStart); double x, h, hp; bool cntn = false; if (leftBump.Converged) { bool foundSoln = leftBump.HMax > target; cntn = !foundSoln; //TODO SUIVRE LE NA if (foundSoln) { x = leftBump.X; h = leftBump.H; //TODO SUIVRE LE NA hp = Tools.NA; } else { x = dip.X; h = dip.H; hp = (bounds.X[higherSide] - h) / (bounds.X[higherSide] - x); } } else { x = lowerSideLimit; h = target; hp = Tools.NA; cntn = false; } return(new ParamB01(x, h, hp, cntn)); } //# end of leftSide.fastScan
private void btn_Read_Click(object sender, EventArgs e) { if (lbox_Equip.SelectedItems.Count != 0) { string L1, L2, L3; dataset.Clear(); dataset = ServiceContainer.GetService <IGasDAL>().QueryData("EquipNum", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString()); txtbox_Num.Text = dataset.Tables[0].Rows[0][0].ToString(); dataset.Clear(); dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L1", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString()); L1 = dataset.Tables[0].Rows[0][0].ToString(); string[] L1D = L1.Split(';'); dgv_L1.Rows.Clear(); for (int i = 0; i < L1D.Count() - 1; i++) { dgv_L1.Rows.Add(L1D[i]); } dataset.Clear(); dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L2", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString()); L2 = dataset.Tables[0].Rows[0][0].ToString(); string[] L2D = L2.Split(';'); dgv_L2.Rows.Clear(); for (int i = 0; i < L2D.Count() - 1; i++) { dgv_L2.Rows.Add(L2D[i]); } dataset.Clear(); dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L3", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString()); L3 = dataset.Tables[0].Rows[0][0].ToString(); string[] L3D = L3.Split(';'); dgv_L3.Rows.Clear(); for (int i = 0; i < L3D.Count() - 1; i++) { dgv_L3.Rows.Add(L3D[i]); } } else { MessageBox.Show("选择设备"); } }
public ControllerPS3(params int[] joystickId) { AddButton(Controls.Triangle); AddButton(Controls.Circle); AddButton(Controls.Cross); AddButton(Controls.Square); AddButton(Controls.R1); AddButton(Controls.L1); AddButton(Controls.L3); AddButton(Controls.R3); AddButton(Controls.Start); AddButton(Controls.Select); AddButton(Controls.R2); AddButton(Controls.L2); AddAxis(Controls.LStick); AddAxis(Controls.RStick); AddAxis(Controls.DPad); foreach (var joy in joystickId) { Triangle.AddJoyButton(0, joy); Circle.AddJoyButton(1, joy); Cross.AddJoyButton(2, joy); Square.AddJoyButton(3, joy); L2.AddJoyButton(4, joy); R2.AddJoyButton(5, joy); L1.AddJoyButton(6, joy); R1.AddJoyButton(7, joy); Select.AddJoyButton(8, joy); Start.AddJoyButton(9, joy); L3.AddJoyButton(10, joy); R3.AddJoyButton(11, joy); R2.AddAxisButton(AxisButton.ZMinus, joy); L2.AddAxisButton(AxisButton.ZPlus, joy); LeftStick.AddJoyAxis(JoyAxis.X, JoyAxis.Y, joy); RightStick.AddJoyAxis(JoyAxis.U, JoyAxis.R, joy); DPad.AddJoyAxis(JoyAxis.PovX, JoyAxis.PovY, joy); } }
// Update is called once per frame void Update() { countFrames++; //lava raises and stays for this long if (countFrames >= 1725 && countFrames <= 2150 && hasRaised == false) { if (countFrames % 10 == 0) { L1.SetActive(true); L2.SetActive(true); L3.SetActive(true); L4.SetActive(true); text.SetActive(true); } if (countFrames % 30 == 0) { L1.SetActive(false); L2.SetActive(false); L3.SetActive(false); L4.SetActive(false); text.SetActive(false); } } if (countFrames == 2150 && hasRaised == false) { countFrames = 0; L1.SetActive(false); L2.SetActive(false); L3.SetActive(false); L4.SetActive(false); text.SetActive(false); hasRaised = true; } //Keeps it lined up with the lava if (countFrames == 450 && hasRaised == true) { countFrames = 0; hasRaised = false; } }
////https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef public static double LuminanceRatio(Color c1, Color c2) { //(L1 + 0.05) / (L2 + 0.05) Color L1, L2; if (c1.GetBrightness() > c2.GetBrightness()) { L1 = c1; L2 = c2; } else { L1 = c2; L2 = c1; } double ratio = (L1.LuminanceValue() + 0.05) / (L2.LuminanceValue() + 0.05); return(Math.Min(ratio, 21)); }
private void button8_Click(object sender, EventArgs e) { double CGCSa = 6378137.0, CGCSf = 1 / 298.257222101; double CGCSb = CGCSa * (1 - CGCSf); double CGCSe = Math.Sqrt(CGCSa * CGCSa - CGCSb * CGCSb) / CGCSa; double CGCSe1 = Math.Sqrt(CGCSa * CGCSa - CGCSb * CGCSb) / CGCSb; double B, L, H, X, Y, Z; X = double.Parse(textBox10.Text); Y = double.Parse(textBox11.Text); Z = double.Parse(textBox12.Text); double CGCSu = Math.Atan((CGCSa * Z) / (CGCSb * Math.Sqrt(X * X + Y * Y))); B = Math.Atan((Z + CGCSe1 * CGCSe1 * CGCSb * Math.Pow(Math.Sin(CGCSu), 3)) / (Math.Sqrt(X * X + Y * Y) - CGCSe * CGCSe * CGCSa * Math.Pow(Math.Cos(CGCSu), 3))); L = Math.Atan2(Y, X); double WGSw = Math.Sqrt(1 - Math.Pow(CGCSe * Math.Sin(B), 2)); double WGSn = CGCSa / WGSw; H = Math.Sqrt(X * X + Y * Y) / Math.Cos(B) - WGSn; B = B * 180 / Math.PI; L = L * 180 / Math.PI; double B1, B2, B3; B1 = Math.Truncate(B); B2 = Math.Truncate((B - B1) * 60); B3 = ((B - B1) * 60 - B2) * 60; string strB = B1.ToString() + '.' + B2.ToString() + B3.ToString("f6"); double L1, L2, L3; L1 = Math.Truncate(L); L2 = Math.Truncate((L - L1) * 60); L3 = ((L - L1) * 60 - L2) * 60; string strL = L1.ToString() + '.' + L2.ToString() + L3.ToString("f6"); textBox4.Text = strB; textBox5.Text = strL; textBox6.Text = H.ToString("f4"); }
public confirmlanguage() { InitializeComponent(); //gets the names of the languages... then confirms that the language files are there... try { string[] lines = File.ReadAllLines(Environment.CurrentDirectory + "/translate/names.langs"); foreach (string line in lines) { try { string[] l = line.Split(':'); if (File.Exists(Environment.CurrentDirectory + "/translate/" + l[0] + ".lang")) { listBox1.Items.Add(l[1]); L2.Add(L2[0]); } } catch { } } } catch { } }