예제 #1
0
 private void H9_Tick(object sender, EventArgs e)
 {
     WriteText("^1-- ^5N^7o ^5H^7ost ^5M^7od ^5M^7enu ^5B^7y ^5M^7rNiato  ^1--\n\n^5Steady Aim\nUAV\nRed Boxes\nInvisible Gun\nLaser\nSilent Gun\n^2-->^5No Recoil");
     if (Key_IsDown.DetectKey(Key_IsDown.Key.Cross))
     {
         if (NoRecoil == false)
         {
             byte[] godmodebyte = new byte[] { 0x60, 0x00, 0x00, 0x00 };
             PS3.SetMemory(0x2290B0, godmodebyte);
             NoRecoil = true;
         }
         else if (NoRecoil == true)
         {
             byte[] godmodebyte = new byte[] { 0x4B, 0xF6, 0x03, 0xD5 };
             PS3.SetMemory(0x2290B0, godmodebyte);
             NoRecoil = false;
         }
     }
     if (Key_IsDown.DetectKey(Key_IsDown.Key.DPAD_DOWN))
     {
         H9.Stop();
         H1.Start();
     }
     if (Key_IsDown.DetectKey(Key_IsDown.Key.DPAD_UP))
     {
         H9.Stop();
         H8.Start();
     }
     if (Key_IsDown.DetectKey(Key_IsDown.Key.R3))
     {
         H9.Stop();
         HostMainMenu.Start();
     }
 }
예제 #2
0
        protected override bool TryHashFinal(Span <byte> destination, out int bytesWritten)
        {
            if (destination.Length < 16)
            {
                bytesWritten = 0;
                return(false);
            }

            var len = (uint)Length;

            // pipelining friendly algorithm
            H1 ^= len; H2 ^= len; H3 ^= len; H4 ^= len;

            H1 += (H2 + H3 + H4);
            H2 += H1; H3 += H1; H4 += H1;

            H1 = H1.FMix();
            H2 = H2.FMix();
            H3 = H3.FMix();
            H4 = H4.FMix();

            H1 += (H2 + H3 + H4);
            H2 += H1; H3 += H1; H4 += H1;

            var uintDestination = MemoryMarshal.Cast <byte, uint>(destination);

            uintDestination[0] = H1;
            uintDestination[1] = H2;
            uintDestination[2] = H3;
            uintDestination[3] = H4;
            bytesWritten       = 16;
            return(true);
        }
예제 #3
0
        protected override bool TryHashFinal(Span <byte> destination, out int bytesWritten)
        {
            if (destination.Length < 16)
            {
                bytesWritten = 0;
                return(false);
            }
            ulong len = (ulong)Length;

            H1 ^= len; H2 ^= len;

            H1 += H2;
            H2 += H1;

            H1 = H1.FMix();
            H2 = H2.FMix();

            H1 += H2;
            H2 += H1;

            var ulongDestination = MemoryMarshal.Cast <byte, ulong>(destination);

            ulongDestination[0] = H1;
            ulongDestination[1] = H2;

            bytesWritten = 16;
            return(true);
        }
예제 #4
0
        public override unsafe Memory <byte> FinalizeHash()
        {
            ulong len = (ulong)Length;

            H1 ^= len;
            H2 ^= len;

            H1 += H2;
            H2 += H1;

            H1 = H1.FMix();
            H2 = H2.FMix();

            H1 += H2;
            H2 += H1;

            var result = new Memory <byte>(new byte[16]);

            using var hMemory = result.Pin();
            var r = (ulong *)hMemory.Pointer;

            r[0] = H1;
            r[1] = H2;

            return(result);
        }
예제 #5
0
        public ReportEmail()
        {
            HtmlBody = new Body().Add <Class>("Body");

            var oTbl = new Table().Add <Class>("Header");

            HtmlBody.Append(oTbl);

            var oImgLogo = new Img()
                           .Add <Class>("Logo")
                           .Add <Src>("http://www.ezbob.com/app/themes/ezbob/images/header/ezbob_logo.png");

            var oLogoLink = new A()
                            .Add <Href>("http://www.ezbob.com/")
                            .Add <Class>("logo_ezbob")
                            .Add <Class>("indent_text")
                            .Add <ID>("ezbob_logo")
                            .Add <Title>("Fast business loans for Ebay and Amazon merchants")
                            .Add <Alt>("Fast business loans for Ebay and Amazon merchants")
                            .Append(oImgLogo);

            var oTr = new Tr();

            oTbl.Append(oTr);

            oTr.Append(new Td().Append(oLogoLink));

            Title = new H1();

            oTr.Append(new Td().Append(Title));

            ReportBody = new P().Add <Class>("Body");

            HtmlBody.Append(ReportBody);
        }         // constructor
예제 #6
0
        private void Body(ReadOnlySpan <byte> source)
        {
            if (source.Length == 0)
            {
                return;
            }

            var remainder = source.Length & 15;
            var blocks    = 2 * (source.Length / 16);

            if (blocks > 0)
            {
                var ulongSource = MemoryMarshal.Cast <byte, ulong>(source);
                for (var block = 0; block < blocks;)
                {
                    H1 ^= (ulongSource[block++] * C1).RotateLeft(31) * C2;
                    H1  = ((H1.RotateLeft(27) + H2) * 5) + 0x52dce729;

                    H2 ^= (ulongSource[block++] * C2).RotateLeft(33) * C1;
                    H2  = ((H2.RotateLeft(31) + H1) * 5) + 0x38495ab5;
                }
            }

            if (remainder > 0)
            {
                Tail(source.Slice(8 * blocks));
            }
        }
예제 #7
0
        private void Body(byte[] data, int start, int length)
        {
            int remainder     = length & 15;
            int alignedLength = start + (length - remainder);

            for (int i = start; i < alignedLength; i += 16)
            {
                uint k1 = data.ToUInt32(i),
                     k2 = data.ToUInt32(i + 4),
                     k3 = data.ToUInt32(i + 8),
                     k4 = data.ToUInt32(i + 12);

                H1 ^= (k1 * C1).RotateLeft(15) * C2;
                H1  = (H1.RotateLeft(19) + H2) * 5 + 0x561ccd1b;

                H2 ^= (k2 * C2).RotateLeft(16) * C3;
                H2  = (H2.RotateLeft(17) + H3) * 5 + 0x0bcaa747;

                H3 ^= (k3 * C3).RotateLeft(17) * C4;
                H3  = (H3.RotateLeft(15) + H4) * 5 + 0x96cd1c35;

                H4 ^= (k4 * C4).RotateLeft(18) * C1;
                H4  = (H4.RotateLeft(13) + H1) * 5 + 0x32ac3b17;
            }

            if (remainder > 0)
            {
                Tail(data, alignedLength, remainder);
            }
        }
예제 #8
0
        protected override byte[] HashFinal()
        {
            uint len = (uint)Length;

            H1 ^= len; H2 ^= len; H3 ^= len; H4 ^= len;

            H1 += (H2 + H3 + H4);
            H2 += H1; H3 += H1; H4 += H1;

            H1 = H1.FMix();
            H2 = H2.FMix();
            H3 = H3.FMix();
            H4 = H4.FMix();

            H1 += (H2 + H3 + H4);
            H2 += H1; H3 += H1; H4 += H1;

            var result = new byte[16];

            Array.Copy(BitConverter.GetBytes(H1), 0, result, 0, 4);
            Array.Copy(BitConverter.GetBytes(H2), 0, result, 4, 4);
            Array.Copy(BitConverter.GetBytes(H3), 0, result, 8, 4);
            Array.Copy(BitConverter.GetBytes(H4), 0, result, 12, 4);

            return(result);
        }
예제 #9
0
        private void Body(byte[] data, int start, int length)
        {
            int remainder = length & 15;
            int blocks    = length / 16;

            unsafe
            {
                fixed(byte *d = &data[start])
                {
                    ulong *current = (ulong *)d;

                    while (blocks-- > 0)
                    {
                        // a variant of original algorithm optimized for processor instruction pipelining
                        H1 ^= (*current++ *C1).RotateLeft(31) * C2;
                        H1  = (H1.RotateLeft(27) + H2) * 5 + 0x52dce729;

                        H2 ^= (*current++ *C2).RotateLeft(33) * C1;
                        H2  = (H2.RotateLeft(31) + H1) * 5 + 0x38495ab5;
                    }

                    if (remainder > 0)
                    {
                        Tail(d + (length - remainder), remainder);
                    }
                }
            }
        }
예제 #10
0
        protected override byte[] HashFinal()
        {
            ulong len = (ulong)Length;

            H1 ^= len; H2 ^= len;

            H1 += H2;
            H2 += H1;

            H1 = H1.FMix();
            H2 = H2.FMix();

            H1 += H2;
            H2 += H1;

            var result = new byte[16];

            unsafe
            {
                fixed(byte *h = result)
                {
                    ulong *r = (ulong *)h;

                    r[0] = H1;
                    r[1] = H2;
                }
            }

            return(result);
        }
예제 #11
0
 public void Start()
 {
     cli1_1.text = "";
     cli2_1.text = "";
     cli1_2.text = "";
     cli2_2.text = "";
     cli1_3.text = "";
     cli2_3.text = "";
     cli1_4.text = "";
     cli2_4.text = "";
     cli1_5.text = "";
     cli2_5.text = "";
     F1.SetActive(false);
     H1.SetActive(false);
     H11.SetActive(false);
     F2.SetActive(false);
     H2.SetActive(false);
     H22.SetActive(false);
     F3.SetActive(false);
     H3.SetActive(false);
     H33.SetActive(false);
     F4.SetActive(false);
     H4.SetActive(false);
     H44.SetActive(false);
     F5.SetActive(false);
     H5.SetActive(false);
     H55.SetActive(false);
 }
예제 #12
0
    /// <summary>
    /// Main function for computing Neural Network result.
    /// </summary>
    /// <param name="p">Phase value.</param>
    public void Compute(float p)
    {
        int pIndex0;

        X = (X - Xmean) / Xstd;

        switch (WeightsMode)
        {
        case Mode.constant:
            pIndex0 = (int)((p / (2 * PI)) * 50);

            // Layer 1
            H0 = (W0[pIndex0] * X) + B0[pIndex0];
            H0.ELU();

            // Layer 2
            H1 = (W1[pIndex0] * H0) + B1[pIndex0];
            H1.ELU();

            // Layer 3, network output
            Y = (W2[pIndex0] * H1) + B2[pIndex0];
            break;

        case Mode.linear:
            break;

        case Mode.cubic:
            break;
        }

        Y = (Y * Ystd) + Ymean;
    }
예제 #13
0
        public void Reset(Control host)
        {
            H1.Reset(host);
            H2.Reset(host);
            H3.Reset(host);
            H4.Reset(host);
            H5.Reset(host);
            H6.Reset(host);
            BlockQuote.Reset(host);
            P.Reset(host);
            FigCaption.Reset(host);
            Pre.Reset(host);
            Dt.Reset(host);
            Dd.Reset(host);

            Li.Reset(host);

            A.Reset(host);
            Span.Reset(host);
            Label.Reset(host);
            Q.Reset(host);
            Cite.Reset(host);
            I.Reset(host);
            Em.Reset(host);
            Mark.Reset(host);
            Time.Reset(host);
            Code.Reset(host);
            Strong.Reset(host);
        }
예제 #14
0
 private void H2_Tick(object sender, EventArgs e)
 {
     WriteText("^1-- ^5N^7o ^5H^7ost ^5M^7od ^5M^7enu ^5B^7y ^5M^7rNiato  ^1--\n\n^5Steady Aim\n^2-->^5UAV\nRed Boxes\nInvisible Gun\nLaser\nSilent Gun\nNo Recoil");
     if (Key_IsDown.DetectKey(Key_IsDown.Key.Cross))
     {
         if (UAV == false)
         {
             byte[] godmodebyte = new byte[] { 0x01 };
             PS3.SetMemory(0x1A707A, godmodebyte);
             UAV = true;
         }
         else if (UAV == true)
         {
             byte[] godmodebyte = new byte[] { 0x00 };
             PS3.SetMemory(0x1A707A, godmodebyte);
             UAV = false;
         }
     }
     if (Key_IsDown.DetectKey(Key_IsDown.Key.DPAD_DOWN))
     {
         H2.Stop();
         H3.Start();
     }
     if (Key_IsDown.DetectKey(Key_IsDown.Key.DPAD_UP))
     {
         H2.Stop();
         H1.Start();
     }
     if (Key_IsDown.DetectKey(Key_IsDown.Key.R3))
     {
         H2.Stop();
         HostMainMenu.Start();
     }
 }
        protected override byte[] HashFinal()
        {
            uint len = (uint)Length;

            // pipelining friendly algorithm
            H1 ^= len; H2 ^= len; H3 ^= len; H4 ^= len;

            H1 += (H2 + H3 + H4);
            H2 += H1; H3 += H1; H4 += H1;

            H1 = H1.FMix();
            H2 = H2.FMix();
            H3 = H3.FMix();
            H4 = H4.FMix();

            H1 += (H2 + H3 + H4);
            H2 += H1; H3 += H1; H4 += H1;

            var result = new byte[16];

            unsafe
            {
                fixed(byte *h = result)
                {
                    var r = (uint *)h;

                    r[0] = H1;
                    r[1] = H2;
                    r[2] = H3;
                    r[3] = H4;
                }
            }

            return(result);
        }
예제 #16
0
 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;
     }
 }
예제 #17
0
    public static void Run()
    {
        var disruptor = new Disruptor <SampleEvent>(() => new SampleEvent(), 1024);
        var handler1  = new H1(new SampleEventPersister());
        var handler2  = new H2();

        disruptor.HandleEventsWith(handler1).Then(handler2);
    }
예제 #18
0
        private void H1_Tick(object sender, EventArgs e)
        {
            PS3.Extension.WriteString(0x004eb39c, "^5S^7pec Ops ^5M^7od Menu ^5B^7y ^5M^7rNiato - ^5C^7redit  ^5M^7enu\n\nMango_Knife\nMakeabce\nMrNiato\niHax Team\nBoost4Ever Family");

            if (Key_IsDown((uint)0) == "R3")
            {
                H1.Stop();
                HostMenuMain.Start();
            }
        }
예제 #19
0
        public void Merge(params DocumentStyle[] styles)
        {
            if (styles != null)
            {
                foreach (var style in styles)
                {
                    Section.Merge(style.Section);
                    Article.Merge(style.Article);
                    Header.Merge(style.Header);
                    Footer.Merge(style.Footer);
                    Main.Merge(style.Main);
                    Figure.Merge(style.Figure);
                    Details.Merge(style.Details);
                    Summary.Merge(style.Summary);
                    Div.Merge(style.Div);
                    Ul.Merge(style.Ul);
                    Ol.Merge(style.Ol);
                    Dl.Merge(style.Dl);
                    Td.Merge(style.Td);

                    Table.Merge(style.Table);

                    Img.Merge(style.Img);
                    YouTube.Merge(style.YouTube);
                    Channel9.Merge(style.Channel9);

                    H1.Merge(style.H1);
                    H2.Merge(style.H2);
                    H3.Merge(style.H3);
                    H4.Merge(style.H4);
                    H5.Merge(style.H5);
                    H6.Merge(style.H6);
                    BlockQuote.Merge(style.BlockQuote);
                    P.Merge(style.P);
                    FigCaption.Merge(style.FigCaption);
                    Pre.Merge(style.Pre);
                    Dt.Merge(style.Dt);
                    Dd.Merge(style.Dd);

                    Li.Merge(style.Li);

                    A.Merge(style.A);
                    Span.Merge(style.Span);
                    Label.Merge(style.Label);
                    Q.Merge(style.Q);
                    Cite.Merge(style.Cite);
                    I.Merge(style.I);
                    Em.Merge(style.Em);
                    Mark.Merge(style.Mark);
                    Time.Merge(style.Time);
                    Code.Merge(style.Code);
                    Strong.Merge(style.Strong);
                }
            }
        }
예제 #20
0
 private void simpleButton3_Click(object sender, EventArgs e)
 {
     MainMenu.Stop();
     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");
     toolStripStatusLabel2.Text      = "Not Started !";
     toolStripStatusLabel2.ForeColor = Color.Red;
     simpleButton2.Enabled           = true;
     simpleButton3.Enabled           = false;
 }
예제 #21
0
        private void AddContent()
        {
            var pageData = new Div(Compatibility);
            var heading  = new H1(Compatibility);

            heading.Add(new SimpleHTML5Text(Compatibility)
            {
                Text = "Converter use license"
            });
            pageData.Add(heading);

            var p1 = new Paragraph(Compatibility);

            p1.Add(new SimpleHTML5Text(Compatibility)
            {
                Text = "This file was generated by Lord KiRon's FB2EPUB converter."
            });
            p1.Add(new SimpleHTML5Text(Compatibility)
            {
                Text = "(This book might contain copyrighted material, author of the converter bears no responsibility for it's usage)"
            });
            pageData.Add(p1);

            var anch = new Anchor(Compatibility);

            p1 = new Paragraph(Compatibility);
            anch.Add(new SimpleHTML5Text(Compatibility)
            {
                Text = @"http://www.fb2epub.net"
            });
            anch.HRef.Value = @"http://www.fb2epub.net";
            p1.Add(anch);
            pageData.Add(p1);


            anch = new Anchor(Compatibility);
            p1   = new Paragraph(Compatibility);
            anch.Add(new SimpleHTML5Text(Compatibility)
            {
                Text = @"https://code.google.com/p/fb2epub/"
            });
            anch.HRef.Value = @"https://code.google.com/p/fb2epub/";
            p1.Add(anch);
            pageData.Add(p1);
            Content = pageData;
        }
        private void Body(byte[] data, int start, int length)
        {
            if (length == 0)
            {
                return;
            }

            int remainder = length & 15;
            int blocks    = length / 16;

            unsafe
            {
                fixed(byte *d = &data[start])
                {
                    // grab a reference to blocks
                    uint *b = (uint *)d;

                    while (blocks-- > 0)
                    {
                        // K1 - consume first integer
                        H1 ^= (*b++ *C1).RotateLeft(15) * C2;
                        H1  = (H1.RotateLeft(19) + H2) * 5 + 0x561ccd1b;

                        // K2 - consume second integer
                        H2 ^= (*b++ *C2).RotateLeft(16) * C3;
                        H2  = (H2.RotateLeft(17) + H3) * 5 + 0x0bcaa747;

                        // K3 - consume third integer
                        H3 ^= (*b++ *C3).RotateLeft(17) * C4;
                        H3  = (H3.RotateLeft(15) + H4) * 5 + 0x96cd1c35;

                        // K4 - consume fourth integer
                        H4 ^= (*b++ *C4).RotateLeft(18) * C1;
                        H4  = (H4.RotateLeft(13) + H1) * 5 + 0x32ac3b17;
                    }

                    if (remainder > 0)
                    {
                        Tail(d + (length - remainder), remainder);
                    }
                }
            }
        }
예제 #23
0
 private void cmdCalcVert_Click(object eventSender, EventArgs eventArgs)
 {
     H1 = (float)(0.5d * Conversion.Val(txtMTR.Text) + Conversion.Val(txtMTL.Text)); // H1 is height of MHW above MLLW
     H1 = (float)(Convert.ToInt32(H1 * 10f + 0.5d) / 10d);
     VC = (float)(Conversion.Val(txtCH.Text) + H1 - Conversion.Val(txtHeight.Text));
     AC = (float)(VC - Conversion.Val(txtBH.Text));
     AC = (float)(Convert.ToInt32(AC * 10f + 0.5d) / 10d);
     DC = (float)(Conversion.Val(txtCD.Text) + Conversion.Val(txtHeight.Text) - Conversion.Val(txtDraft.Text));
     VerticalTxtBx.SelectionAlignment = HorizontalAlignment.Center;
     VerticalTxtBx.AppendText("Height of MHW above MLLW = 1/2 Mean Range + Mean Tide");
     VerticalTxtBx.AppendText(" = 1/2 (" + Conversion.Val(txtMTR.Text) + ") + " + Conversion.Val(txtMTL.Text).ToString() + " = " + H1.ToString() + Environment.NewLine);
     VerticalTxtBx.AppendText("Vertical Clearance = Charted Height + Height of MHW above MLLW - Height of Tide above MLLW");
     VerticalTxtBx.AppendText(" = " + Conversion.Val(txtCH.Text) + " + " + H1.ToString() + " - " + Conversion.Val(txtHeight.Text).ToString() + " = " + VC.ToString() + Environment.NewLine);
     VerticalTxtBx.AppendText("Actual Clearance = Vertical Clearance - Boat Height");
     VerticalTxtBx.AppendText(" = " + VC + " - " + Conversion.Val(txtBH.Text).ToString() + " = " + AC.ToString() + Environment.NewLine);
     DepthTxtBx.SelectionAlignment = HorizontalAlignment.Center;
     DepthTxtBx.AppendText("Depth Clearance (under keel) = Charted Depth + Height of Tide above MLLW - Boat's Draft");
     DepthTxtBx.AppendText(" = " + Conversion.Val(txtCD.Text) + " + " + Conversion.Val(txtHeight.Text).ToString() + " - " + Conversion.Val(txtDraft.Text).ToString() + " = " + DC.ToString());
 }
예제 #24
0
 private void OtherMenu_Tick_1(object sender, EventArgs e)
 {
     PS3.Extension.WriteString(0x004eb39c, "^5S^7pec Ops ^5M^7od Menu ^5B^7y ^5M^7rNiato - ^5M^7ain ^5M^7enu\n\n^5Host Menu\nClient 1 Menu\nReset Menu\nAccount Menu\nTeleport Menu\nVision Menu\n^2-->^5Credit Menu\n\n\n^3Client 0 : ^2" + textBox1.Text + "\n^3Client 1 : ^2" + textBox2.Text + "^5");
     if (Key_IsDown((uint)0) == "X")
     {
         H1.Start();
         OtherMenu.Stop();
     }
     if (Key_IsDown((uint)0) == "R1")
     {
         OtherMenu.Stop();
         HostMenuMain.Start();
     }
     if (Key_IsDown((uint)0) == "L1")
     {
         VisionMenu.Start();
         OtherMenu.Stop();
     }
 }
예제 #25
0
        private void Body(byte[] data, int start, int length)
        {
            int remainder     = length & 15;
            int alignedLength = start + (length - remainder);

            for (int i = start; i < alignedLength; i += 16)
            {
                H1 ^= (data.ToUInt64(i) * C1).RotateLeft(31) * C2;
                H1  = (H1.RotateLeft(27) + H2) * 5 + 0x52dce729;

                H2 ^= (data.ToUInt64(i + 8) * C2).RotateLeft(33) * C1;
                H2  = (H2.RotateLeft(31) + H1) * 5 + 0x38495ab5;
            }

            if (remainder > 0)
            {
                Tail(data, alignedLength, remainder);
            }
        }
예제 #26
0
        public override void GenerateBody()
        {
            base.GenerateBody();
            Div page = new Div(Compatibility);

            page.GlobalAttributes.Class.Value = "about";
            H1 heading = new H1(Compatibility);

            heading.Add(new SimpleHTML5Text(Compatibility)
            {
                Text = "About"
            });
            page.Add(heading);

            foreach (var text in AboutTexts)
            {
                var p1    = new Paragraph(Compatibility);
                var text1 = new SimpleHTML5Text(Compatibility)
                {
                    Text = text
                };
                p1.Add(text1);
                page.Add(p1);
            }

            foreach (var text in AboutLinks)
            {
                var p1   = new Paragraph(Compatibility);
                var anch = new Anchor(Compatibility);
                anch.HRef.Value = text;
                anch.GlobalAttributes.Title.Value = text;
                var text3 = new SimpleHTML5Text(Compatibility)
                {
                    Text = text
                };
                anch.Add(text3);
                p1.Add(anch);
                page.Add(p1);
            }

            BodyElement.Add(page);
        }
예제 #27
0
        void CompositionTarget_Rendering(object sender, EventArgs e)
        {
            //TimeSpan now = DateTime.Now.TimeOfDay;

            DateTime now; // = default(DateTime);

            now = Convert.ToDateTime("00:00:00");

            now = now.AddSeconds(time);


            // update the time
            H1.AnimateTo(now.Hour / 10);
            H2.AnimateTo(now.Hour % 10);

            M1.AnimateTo(now.Minute / 10);
            M2.AnimateTo(now.Minute % 10);

            S1.AnimateTo(now.Second / 10);
            S2.AnimateTo(now.Second % 10);
        }
예제 #28
0
        private void Body(ReadOnlySpan <byte> source)
        {
            if (source.Length == 0)
            {
                return;
            }

            var remainder = source.Length & 15;
            var blocks    = 4 * (source.Length / 16);

            if (blocks > 0)
            {
                var uintSource = MemoryMarshal.Cast <byte, uint>(source);
                var block      = 0;
                while (block < blocks)
                {
                    var k1 = uintSource[block++];
                    var k2 = uintSource[block++];
                    var k3 = uintSource[block++];
                    var k4 = uintSource[block++];

                    H1 ^= (k1 * C1).RotateLeft(15) * C2;
                    H1  = ((H1.RotateLeft(19) + H2) * 5) + 0x561ccd1b;

                    H2 ^= (k2 * C2).RotateLeft(16) * C3;
                    H2  = ((H2.RotateLeft(17) + H3) * 5) + 0x0bcaa747;

                    H3 ^= (k3 * C3).RotateLeft(17) * C4;
                    H3  = ((H3.RotateLeft(15) + H4) * 5) + 0x96cd1c35;

                    H4 ^= (k4 * C4).RotateLeft(18) * C1;
                    H4  = ((H4.RotateLeft(13) + H1) * 5) + 0x32ac3b17;
                }
            }

            if (remainder > 0)
            {
                Tail(source.Slice(4 * blocks));
            }
        }
예제 #29
0
        protected override byte[] HashFinal()
        {
            ulong len = (ulong)Length;

            H1 ^= len; H2 ^= len;

            H1 += H2;
            H2 += H1;

            H1 = H1.FMix();
            H2 = H2.FMix();

            H1 += H2;
            H2 += H1;

            var result = new byte[16];

            Array.Copy(BitConverter.GetBytes(H1), 0, result, 0, 8);
            Array.Copy(BitConverter.GetBytes(H2), 0, result, 8, 8);

            return(result);
        }
예제 #30
0
        public override unsafe Memory <byte> FinalizeHash()
        {
            uint len = (uint)Length;

            // pipelining friendly algorithm
            H1 ^= len;
            H2 ^= len;
            H3 ^= len;
            H4 ^= len;

            H1 += (H2 + H3 + H4);
            H2 += H1;
            H3 += H1;
            H4 += H1;

            H1 = H1.FMix();
            H2 = H2.FMix();
            H3 = H3.FMix();
            H4 = H4.FMix();

            H1 += (H2 + H3 + H4);
            H2 += H1;
            H3 += H1;
            H4 += H1;

            var result = new Memory <byte>(new byte[16]);

            using var hMemory = result.Pin();
            var r = (uint *)hMemory.Pointer;

            r[0] = H1;
            r[1] = H2;
            r[2] = H3;
            r[3] = H4;

            return(result);
        }