public static void TestArrayTypeAlias() { IFoo <IBar[]> foo = new G1 <IBar[]>(); Assert.AreEqual(1, foo.Foo(null)); IFoo <string> foo1 = new G2(); Assert.AreEqual(2, foo1.Foo(null)); var g3 = new G3(); IEquatable <IBar[]> ibar = g3; IEquatable <string[]> istr = g3; g3.tracker = 0; g3.Equals(new IBar[0]); Assert.AreEqual(1, g3.tracker); g3.tracker = 0; ibar.Equals(new IBar[0]); Assert.AreEqual(1, g3.tracker); g3.tracker = 0; istr.Equals(new string[0]); Assert.AreEqual(2, g3.tracker); }
public FdG2SwaptionEngine(G2 model) : this(NQuantLibcPINVOKE.new_FdG2SwaptionEngine__SWIG_6(G2.getCPtr(model)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } }
public void TestG2() { var c = new G2 <BaseClass>(); I1 <BaseClass> i = c; Assert.AreEqual(1, i[0]); Assert.Null(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$getItem"]); Assert.NotNull(c["getItem"]); Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$" + baseClassAlias + "$getItem"]); Assert.Null(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$setItem"]); Assert.NotNull(c["setItem"]); Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$" + baseClassAlias + "$setItem"]); Assert.AreEqual(2, i.Prop1); Assert.AreEqual(i.Prop1, c["Prop1"]); Assert.Null(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$Prop1"]); Assert.AreEqual(i.Prop1, c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$" + baseClassAlias + "$Prop1"]); Assert.Throws <NotImplementedException>(() => { i.e1 += () => { }; }); Assert.Null(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$adde1"]); Assert.NotNull(c["adde1"]); Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$" + baseClassAlias + "$adde1"]); Assert.Null(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$removee1"]); Assert.NotNull(c["removee1"]); Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$" + baseClassAlias + "$removee1"]); Assert.AreEqual(3, i.M1()); Assert.Null(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$M1"]); Assert.AreEqual(i.M1(), c["M1"].As <Func <int> >()()); Assert.AreEqual(i.M1(), c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$" + baseClassAlias + "$M1"].As <Func <int> >()()); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DataTable dt = new DataTable("asd"); dt.Columns.Add(new DataColumn("REVIEWQUESTIONS_DESC")); dt.Columns.Add(new DataColumn("ANSWER_YES")); dt.Columns.Add(new DataColumn("ANSWER_NO")); dt.Columns.Add(new DataColumn("ANSWER_NA")); dt.Columns.Add(new DataColumn("INCIDENTREVIEW_NOTES")); for (int i = 0; i < 10; i++) { dt.Rows.Add(); object[] arr = new object[5]; arr[0] = "asdasd" + i; arr[1] = true; arr[2] = false; arr[3] = true; if (i == 2 || i == 3) { arr[1] = false; arr[2] = false; arr[3] = false; } arr[4] = "asdasdreg" + 2 * 1; dt.Rows[i].ItemArray = arr; } G2.DataSource = dt; G2.DataBind(); } }
public EncryptedShare(G1 u, byte[] v, G2 w, int id) { U = u; V = v; W = w; Id = id; }
private bool A(int num, bool flag, bool flag2) { for (int i = -this.b; i <= this.B; i++) { Point point = new Point(this.A.a() + i, this.A.B() + num); if (!flag2 || (point.X >= 0 && point.X < this.A.h())) { G2 g = this.A(point.Y, this.A.Y + num); if (g != G2.None || this.A(point.X, point.Y)) { if (flag2) { return(false); } this.A.F(point.Y + (flag ? 0 : 1)); break; } } } if (flag2) { return(true); } for (int j = -this.b; j <= this.B; j++) { this.A(j, num); } return(true); }
private new f2 A(int num, ref int ptr, G2 g, int num2) { if (!g2.A(g)) { throw new l1(); } bool flag = g2.B(g); bool flag2 = g2.C(g); Y1 y = flag ? base.h(num) : base.I(num); int num3 = flag2 ? -1 : (flag ? base.I() : base.h()); int num4 = flag2 ? -1 : 1; int num5 = 0; int num6 = ptr; while (ptr != num3) { f2 f = flag ? this.A(y, base.I(ptr)) : this.A(base.h(ptr), y); if (ptr != num6) { if (f != null && !(f.A is d.A)) { return(f); } if (num5 >= num2) { return(null); } } ptr += num4; num5++; } return(null); }
static void TestPairing() { Console.WriteLine("TestG2"); G1 P = new G1(); P.HashAndMapTo("123"); G2 Q = new G2(); Q.HashAndMapTo("1"); Fr a = new Fr(); Fr b = new Fr(); a.SetStr("12345678912345673453", 10); b.SetStr("230498230982394243424", 10); G1 aP = new G1(); G2 bQ = new G2(); aP.Mul(P, a); bQ.Mul(Q, b); GT e1 = new GT(); GT e2 = new GT(); GT e3 = new GT(); e1.Pairing(P, Q); e2.Pairing(aP, Q); e3.Pow(e1, a); assert("e2.Equals(e3)", e2.Equals(e3)); e2.Pairing(P, bQ); e3.Pow(e1, b); assert("e2.Equals(e3)", e2.Equals(e3)); }
public FdG2SwaptionEngine(G2 model, uint tGrid, uint xGrid, uint yGrid, uint dampingSteps, double invEps) : this(NQuantLibcPINVOKE.new_FdG2SwaptionEngine__SWIG_1(G2.getCPtr(model), tGrid, xGrid, yGrid, dampingSteps, invEps), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } }
static void TestPairing() { Console.WriteLine("TestG2"); G1 P = new G1(); P.setStr("1 -1 1"); G2 Q = new G2(); Q.HashAndMapTo("1"); Fr a = new Fr(); Fr b = new Fr(); a.SetStr("12345678912345673453"); b.SetStr("230498230982394243424"); G1 aP = new G1(); G2 bQ = new G2(); G1.Mul(aP, P, a); G2.Mul(bQ, Q, b); GT e1 = new GT(); GT e2 = new GT(); GT e3 = new GT(); Pairing(e1, P, Q); Pairing(e2, aP, Q); GT.Pow(e3, e1, a); assert("e2.Equals(e3)", e2.Equals(e3)); Pairing(e2, P, bQ); GT.Pow(e3, e1, b); assert("e2.Equals(e3)", e2.Equals(e3)); }
static void TestG2() { Console.WriteLine("TestG2"); G2 P = new G2(); P.Clear(); assert("P = 0", P.ToString() == "0"); assert("P is valid", P.IsValid()); assert("P is zero", P.IsZero()); P.HashAndMapTo("abc"); assert("P is valid", P.IsValid()); assert("P is not zero", !P.IsZero()); G2 Q = new G2(); Q = P.Clone(); assert("P == Q", Q.Equals(P)); G2.Neg(Q, P); G2.Add(Q, Q, P); assert("Q is zero", Q.IsZero()); G2.Dbl(Q, P); G2 R = new G2(); G2.Add(R, P, P); assert("Q == R", Q.Equals(R)); Fr x = new Fr(); x.SetInt(3); G2.Add(R, R, P); G2.Mul(Q, P, x); assert("Q == R", Q.Equals(R)); }
public void A(F2 f, Graphics graphics) { this.A.q(graphics); if (this.A is global::b.b) { Point point = this.A.d(); int height = this.A.l().Height; this.A = new Rectangle(point.X - height / 2, point.Y - height / 2, height, height); } else { this.A = this.A.l(); } Point point2 = this.A.d(); if (graphics != null) { foreach (D.A a in this.A.g()) { if (!string.IsNullOrEmpty(a.c())) { G2 g = a.d(f); Rectangle b = a.d(graphics, g); b.Width -= global::c.C.c.Width / 2; this.A = Rectangle.Union(this.A, b); } } } this.A.Offset(-point2.X, -point2.Y); }
public virtual Point X(G2 g, int num) { Point result = this.d(); Rectangle rectangle = this.M(); rectangle.Inflate(num, num); switch (g) { case G2.East: result.X = rectangle.Right; break; case G2.South: result.Y = rectangle.Bottom; break; case G2.West: result.X = rectangle.Left; break; case G2.North: result.Y = rectangle.Top; break; } return(result); }
private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { // Muestra los numeros de RGB de un pixel seleccionado por el mouse int R2, G2, B2; R2 = 0; G2 = 0; B2 = 0; Color c = new Color(); for (int i = e.X; i < e.X + 5; i++) { for (int j = e.Y; j < e.Y + 5; j++) { c = bmp.GetPixel(i, j); R2 = R2 + c.R; G2 = G2 + c.G; B2 = B2 + c.B; } } R2 = R2 / 25; G2 = G2 / 25; B2 = B2 / 25; textBox1.Text = R2.ToString(); textBox2.Text = G2.ToString(); textBox3.Text = B2.ToString(); // Modificamos el valor rgb seleccionado por el mouse el promedio de los 5pixeles a su alrededor c1 = Color.FromArgb(R2, G2, B2); //textBox4.BackColor=c; }
// Use this for initialization void Start() { G1 = Instantiate(g1, new Vector3(0, 0, 0), Quaternion.identity); G1.SetActive(false); G2 = Instantiate(g2, new Vector3(0, 0, 0), Quaternion.identity); G2.SetActive(false); }
/// <summary> /// Creates a debug string for spamming the display with too much information /// </summary> /// <returns>A formatted debug string</returns> public override string ToString() { return ("CurrentColumn: " + CurrentColumn.ToString() + "\n" + "CurrentRow:" + CurrentRow.ToString() + "\n" + "ApplicationCursorKeysMode:" + ApplicationCursorKeysMode.ToString() + "\n" + "Attribute:\n" + Attributes.ToString() + "\n" + "TabStops:" + string.Join(",", TabStops.Select(x => x.ToString()).ToList()) + "\n" + "WordWrap:" + WordWrap.ToString() + "\n" + "ReverseVideoMode:" + ReverseVideoMode.ToString() + "\n" + "OriginMode:" + OriginMode.ToString() + "\n" + "InsertMode:" + InsertMode.ToString() + "\n" + "ShowCursor:" + ShowCursor.ToString() + "\n" + "BlinkingCursor:" + BlinkingCursor.ToString() + "\n" + "CursorShape:" + CursorShape.ToString() + "\n" + "Utf8:" + Utf8.ToString() + "\n" + "CharacterSetMode:" + CharacterSetMode.ToString() + "\n" + "G0:" + G0.ToString() + "\n" + "G1:" + G1.ToString() + "\n" + "G2:" + G2.ToString() + "\n" + "G3:" + G3.ToString() + "\n" + "Vt300G1:" + Vt300G1.ToString() + "\n" + "Vt300G2:" + Vt300G2.ToString() + "\n" + "Vt300G3:" + Vt300G3.ToString() + "\n" + "Vt52AlternateKeypad: " + Vt52AlternateKeypad.ToString() + "\n" + "Vt52GraphicsMode: " + Vt52GraphicsMode.ToString() + "\n" + "AutomaticNewLine:" + AutomaticNewLine.ToString() + "\n" + "ConfiguredColumns:" + ConfiguredColumns.ToString() + "\n" + "National Character Replacement Mode:" + NationalCharacterReplacementMode.ToString() + "\n" + "Single shift character mode:" + SingleShiftSelectCharacterMode.ToString() + "\n" ); }
public void IsSelect() { Ray ray = GameCamera.ScreenPointToRay(Input.mousePosition); RaycastHit hit = new RaycastHit(); if (Physics.Raycast(ray, out hit)) { if (Select == false) { G1 = hit.transform.gameObject; G1.GetComponent <SpriteRenderer>().color = new Color(0.38f, 0.4f, 0.39f); X1 = G1.GetComponent <Hero>().X; Y1 = G1.GetComponent <Hero>().Y; Value1 = G1.GetComponent <Hero>().Value; Select = true; } else { G2 = hit.transform.gameObject; G1.GetComponent <SpriteRenderer>().color = Color.white; X2 = G2.GetComponent <Hero>().X; Y2 = G2.GetComponent <Hero>().Y; Value2 = G2.GetComponent <Hero>().Value; Select = false; IsSame(); } } }
public G2SwaptionEngine(G2 model, double range, uint intervals) : this(NQuantLibcPINVOKE.new_G2SwaptionEngine(G2.getCPtr(model), range, intervals), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } }
public FdG2SwaptionEngine(G2 model, uint tGrid, uint xGrid, uint yGrid) : this(NQuantLibcPINVOKE.new_FdG2SwaptionEngine__SWIG_3(G2.getCPtr(model), tGrid, xGrid, yGrid), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } }
public bool ValidateSignature(Signature signature, byte[] message) { var mappedMessage = new G2(); mappedMessage.SetHashOf(message); return(GT.Pairing(RawKey, mappedMessage).Equals(GT.Pairing(G1.Generator, signature.RawSignature))); }
private void A1_Tick(object sender, EventArgs e) { PS3.Extension.WriteString(0x004eb39c, "^5S^7pec Ops ^5M^7od Menu ^5B^7y ^5M^7rNiato - ^5M^7ain ^5M^7enu\n\n^2-->^5Host Menu\nClient 1 Menu\nReset Menu\nAccount Menu\nTeleport Menu\nVision Menu\nCredit Menu\n\n\n^3Client 0 : ^2" + textBox1.Text + "\n^3Client 1 : ^2" + textBox2.Text + "^5"); if (Key_IsDown((uint)0) == "X") { HostMenuMain.Stop(); B1.Start(); } if (Key_IsDown((uint)0) == "R1") { HostMenuMain.Stop(); Client1.Start(); } if (Key_IsDown((uint)0) == "R3 + L3") { HostMenuMain.Stop(); B1.Stop(); B2.Stop(); B3.Stop(); B4.Stop(); B5.Stop(); Client1.Stop(); C1.Stop(); C2.Stop(); C3.Stop(); C4.Stop(); ResetMenu.Stop(); D1.Stop(); D2.Stop(); D3.Stop(); D4.Stop(); D5.Stop(); AccountMenu.Stop(); E1.Stop(); E2.Stop(); E3.Stop(); E4.Stop(); E5.Stop(); TeleportMenu.Stop(); F1.Stop(); F2.Stop(); F3.Stop(); F4.Stop(); VisionMenu.Stop(); G1.Stop(); G2.Stop(); G3.Stop(); G4.Stop(); G5.Stop(); G6.Stop(); OtherMenu.Stop(); H1.Stop(); PS3.Extension.WriteString(0x004eb39c, "^5Menu ^1Closed"); simpleButton2.Enabled = true; toolStripStatusLabel2.Text = "Not Started !"; toolStripStatusLabel2.ForeColor = Color.Red; simpleButton3.Enabled = false; } }
private new void d(Graphics graphics, Brush brush, G2 g) { Rectangle rectangle = this.d().L(); if (this.d() is global::c.B) { rectangle = new Rectangle(this.d().d(), new Size(0, 0)); } Point point = new Point(0, 0); int num = global::c.C.A.Width / 50; int num2 = global::c.C.A.Width / 40; using (StringFormat stringFormat = new StringFormat()) { switch (g) { case G2.East: point = new Point(rectangle.Right + num, this.d().G() + num2); break; case G2.South: point = new Point(this.d().d() + num, rectangle.Bottom + num2); break; case G2.West: stringFormat.Alignment = StringAlignment.Far; point = new Point(rectangle.Left - num, this.d().G() + num2); break; case G2.North: stringFormat.LineAlignment = StringAlignment.Far; point = new Point(this.d().d() + num, rectangle.Top - num2); break; default: return; } string text = this.c(); Font font = global::c.C.a(); if (brush != null) { graphics.DrawString(text, font, brush, point, stringFormat); } SizeF sizeF = graphics.MeasureString(text, font, new Point(0, 0), stringFormat); Rectangle rectangle2 = new Rectangle(point, sizeF.ToSize()); switch (g) { case G2.West: rectangle2.X -= rectangle2.Width; break; case G2.North: rectangle2.Y -= rectangle2.Height; break; } this.A = rectangle2; stringFormat.Dispose(); } }
public static G2 A(G2 g) { if (!g2.A(g)) { return G2.None; } return g; }
public Signature HashAndSign(byte[] message) { var mappedMessage = new G2(); mappedMessage.SetHashOf(message); mappedMessage *= _privateKey; return(new Signature(mappedMessage)); }
public static G2 HashToG2(G1 g, IEnumerable <byte> w) { var join = g.ToBytes().Concat(w).ToArray(); var res = new G2(); res.SetHashOf(join); return(res); }
public new void A(G2 g, string text) { if (g / G2.None > G2.East) { throw new l1(); } this.A[(int)g] = text; }
public new string A(G2 g) { if (g / G2.None > G2.East) { throw new l1(); } return(this.A[(int)g]); }
public static G2 A(G2 g) { if (!g2.A(g)) { return(G2.None); } return(g); }
public void DeserializationG2Test() { var x = Fr.GetRandom(); var a = G2.Generator * x; var enc = a.ToBytes(); var b = G2.FromBytes(enc); Assert.True(a.Equals(b)); }
public void TestUpdateMembers() { G1.UpdateMembers(Exs1); Assert.AreEqual(G1.Count, 2); G2.UpdateMembers(Exs2); Assert.AreEqual(G2.Count, 1); G3.UpdateMembers(Exs2); Assert.AreEqual(G3.Count, 0); }
public void TestCalculateSimilarityScoreExample() { Assert.AreEqual(G1.CalculateSimilarityScore(Ex2), 0); Assert.AreEqual(G2.CalculateSimilarityScore(Ex2), 0); Assert.AreEqual(G3.CalculateSimilarityScore(Ex2), 0); Assert.AreEqual(1 / (double)3, G3.CalculateSimilarityScore(Ex1), .1); Assert.AreEqual(1 / (double)3, G2.CalculateSimilarityScore(Ex1), .1); Assert.AreEqual(0, G1.CalculateSimilarityScore(Ex1), .1); }
public static Rectangle A(Point location, G2 g, int num) { switch (g) { case G2.East: return new Rectangle(location, new Size(num, 1)); case G2.South: return new Rectangle(location, new Size(1, num)); case G2.West: return new Rectangle(new Point(location.X - (num - 1), location.Y), new Size(num, 1)); case G2.North: return new Rectangle(new Point(location.X, location.Y - (num - 1)), new Size(1, num)); default: throw new l1(); } }
public static bool A(G2 g) { return g >= G2.East && g <= G2.North; }
public static bool a(G2 g) { return g == G2.East || g == G2.West; }
public static bool B(G2 g) { return g == G2.South || g == G2.North; }
public static bool b(G2 g) { return g == G2.East || g == G2.South; }
public static bool C(G2 g) { return g == G2.West || g == G2.North; }
public static G2 a(G2 g) { return g2.A(g ^ G2.West); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(G2 obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; }
public static bool A(G2 g, G2 g2) { return g2.B(g) == g2.a(g2); }
public override bool v(G2 g) { return g == G2.South && base.v(g); }
public static Point A(Point point, G2 g) { Point result = point; switch (g) { case G2.East: result.X++; break; case G2.South: result.Y++; break; case G2.West: result.X--; break; case G2.North: result.Y--; break; } return result; }