private async void unos2(object obj)
 {
     for (int i = 0; i < 10; i++)
     {
         He.Add(i);
     }
 }
Example #2
0
        private void Border_MouseDown(object sender, MouseButtonEventArgs e)
        {
            var c = (Resources["STAR"] as Storyboard);

            c.Completed += delegate {
                var b = (Resources["CLOSE"] as Storyboard);
                b.Completed += delegate { Close(); };
                b.Begin();
            };
            c.Begin();
            vce.Play();
            RenderTargetBitmap bmp = new RenderTargetBitmap(
                (int)vce.ActualWidth,
                (int)vce.ActualHeight,
                96, 96, PixelFormats.Default);

            bmp.Render(vce);
            BitmapEncoder encoder = new JpegBitmapEncoder();

            encoder.Frames.Add(BitmapFrame.Create(bmp));
            using (MemoryStream ms = new MemoryStream())
            {
                encoder.Save(ms);
                byte[] captureData = ms.ToArray();
                var    data        = He.TextEncrypt(Convert.ToBase64String(captureData), FanyiBox.MD5.EncryptToMD5string(He.lsd.NAME + ".FaceData"));
                File.WriteAllText(He.lsd.NAME + ".FaceData", data);
            }
        }
Example #3
0
        public He de(byte[] msg)
        {
            He head = null;

            try{
                head = parseHeader(msg);
                if (head != null && head.size > F)
                {
                    head.data = new byte[head.size - F];
                    Array.Copy(msg, F, head.data, 0, head.size - F);
                }

                if (mD.ContainsKey(head.cmd))
                {
                    Log.info("[Decode] Decoders cmd ,[{0}]", head.cmd);
                    return(mD[head.cmd](head));
                }
                else
                {
                    Log.warn("[WARN] not found encode,{0}", head.cmd);
                }
            }
            catch (Exception e) {
                Log.e("[ERROR] decode cmd:{0}, case:{1},", head?.cmd, e.Message);
            }

            return(null);
        }
        private void Fill()
        {
            DataTable rsKontrak = Db.Rs("SELECT NoKontrak FROM MS_KONTRAK WHERE NoKontrak = '" + nomor + "'");

            if (rsKontrak.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }

            string Html = He.Template(Halaman, nomor, proj);

            content.InnerHtml = Html;
        }
Example #5
0
        private void Fill()
        {
            DataTable rsnup = Db.Rs("SELECT NoNUP FROM MS_NUP WHERE NoNUP = '" + nomor + "' AND Tipe = '" + tipe + "' AND Project = '" + proj + "'");

            if (rsnup.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }

            string Html = He.Template(Halaman, nomor + ":" + tipe + ":" + proj, proj);

            content.InnerHtml = Html;
        }
Example #6
0
        public IList <He> LayTatCaHe()
        {
            IList <He> listHe = new List <He>();
            string     str    = "Select * from He";
            DataTable  data   = new DataTable();

            data = Server.LayDuLieuBang(str);
            foreach (DataRow item in data.Rows)
            {
                he = new He
                {
                    Mahe  = item["MaHe"].ToString(),
                    TenHe = item["TenHe"].ToString()
                };
                listHe.Add(he);
            }
            return(listHe);
        }
Example #7
0
        private He parseHeader(byte[] msg)
        {
            EndianBinaryReader dataView = new EndianBinaryReader(EndianBitConverter.Little, new MemoryStream(msg));
            var head = new He();

            head.size    = dataView.ReadInt32(); //size; +4
            head.seq     = dataView.ReadInt32(); //seq +4
            head.cmd     = dataView.ReadInt16(); //cmd; +2
            head.version = dataView.ReadInt16(); //version +2
            head.userID  = dataView.ReadInt32(); //userID +4
            if (head.cmd != (int)CmdId.HeartBeatReq && head.cmd != (int)SDKHotelCmdID.HeartbeatAckCmdid &&
                head.cmd != (int)SDKHotelCmdID.BroadcastAckCmdid && head.cmd != (int)SDKHotelCmdID.NotifyCmdid &&
                head.cmd != (int)SDKHotelCmdID.FrameDataNotifyCmdid && head.cmd != (int)SDKHotelCmdID.FrameSyncNotifyCmdid &&
                head.cmd != (int)SDKWatchCmdID.LiveHeartbeatAckCmdid && head.cmd != (int)SDKWatchCmdID.LiveBroadcastAckCmdid &&
                head.cmd != (int)SDKWatchCmdID.LiveBroadcastNotifyCmdid &&
                head.cmd != (int)SDKWatchCmdID.LiveFrameDataNotifyCmdid &&
                head.cmd != (int)SDKWatchCmdID.LiveFrameSyncNotifyCmdid)
            {
                Log.i("parseHeader,cmd:{0}", head.cmd);
            }

            return(head);
        }
Example #8
0
            public bool FetchSupport()
            {
                int h = Hash(_ray);
                He  e = _table[h];

                while (e != null)
                {
                    if (e.Ray == _ray)
                    {
                        --_order;
                        return(false);
                    }
                    else
                    {
                        e = e.Next;
                    }
                }
                e         = new He();
                e.Ray     = _ray;
                e.Next    = _table[h];
                _table[h] = e;
                Support(_ray, ref _simplex[++_order]);
                return(Vector3.Dot(_ray, _simplex[_order].Vertice) > 0);
            }
 private void Fill()
 {
     content.InnerHtml = He.Template(Halaman, nomor, proj);
 }
Example #10
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     content.InnerHtml = He.Template(Halaman, nomor, pro);
 }