private void buttonAdd_Click(object sender, EventArgs e) { if (!IsStart) { Method.AddRanmodProcess(); Init(); } else { if (Method.ProcessArray.Count < 10) { Eprocess p = new Eprocess(); var seed = Guid.NewGuid().GetHashCode(); Random r = new Random(seed); int Rname = r.Next(1, 10000); // 增加相同id的重新分配 int Rprimary = r.Next(50, 100); int Rtimes = r.Next(1, 50); p.status = 1; p.name = Rname; p.primary = Rprimary; p.times = Rtimes; RR.Add(new Eprocess(p.name, p.status, p.primary, p.times)); DP.Add(new Eprocess(p.name, p.status, p.primary, p.times)); SRT.Add(new Eprocess(p.name, p.status, p.primary, p.times)); SPN.Add(new Eprocess(p.name, p.status, p.primary, p.times)); } } }
public List <PlayerView> GetHighestIntrinsic(DP dataPoint, short numberOfRecords) { SearchFilterHelper filterHelper = new SearchFilterHelper(_savegame, _rater); var playersToConstruct = filterHelper.OrderByDataPoint(dataPoint).Take(numberOfRecords).ToList(); var list = _displayHelper.ConstructPlayers(playersToConstruct, _rater).ToList(); return(list.OrderByDescending(x => x.Attributes.Tackling).ToList()); }
public TilePointAI(int startDepth = 1) { for (int i = 0; i < 50; ++i) { dp[i] = new DP(); } StartDepth = startDepth; }
public AI_koushi_dx(int startDepth = 1) { for (int i = 0; i < 50; ++i) { dp[i] = new DP(); } StartDepth = startDepth; }
public AhoAI_8(int startDepth = 1) { for (int i = 0; i < 50; ++i) { dp[i] = new DP(); } StartDepth = startDepth; }
public DifferEvaluation(int startDepth = 0, int greedyMaxDepth = 0) { for (int i = 0; i < 50; ++i) { dp1[i] = new DP(); dp2[i] = new DP(); } StartDepth = startDepth; }
public AokiAI_8(int startDepth = 0) { for (int i = 0; i < 50; ++i) { dp1[i] = new DP(); dp2[i] = new DP(); } StartDepth = startDepth; }
public SingleAgentAI(int startDepth = 0, int greedyMaxDepth = 0) { for (int i = 0; i < 50; ++i) { dp1[i] = new DP(); dp2[i] = new DP(); } StartDepth = startDepth; }
public NaottiAI(int startDepth = 1, int greedyMaxDepth = 0) { for (int i = 0; i < 50; ++i) { dp1[i] = new DP(); dp2[i] = new DP(); } StartDepth = startDepth; this.greedyMaxDepth = greedyMaxDepth; }
public NegaScoutAI(int startDepth = 1, int greedyMaxDepth = 4) { for (int i = 0; i < 50; ++i) { dp1[i] = new DP(); dp2[i] = new DP(); } StartDepth = startDepth; this.greedyMaxDepth = greedyMaxDepth; }
static IconGlyphTextBlock() { DP.OverrideMetadata( TextBlock.FontFamilyProperty, new FrameworkPropertyMetadata(new FontFamily("Segoe MDL2 Assets")) { Inherits = false }); DP.OverrideMetadata(TextBlock.FontSizeProperty, new FrameworkPropertyMetadata(16.0)); }
public void Clone(RSAKey to) { to.P = P.ToArray(); to.Q = Q.ToArray(); to.PQ = PQ.ToArray(); to.DP = DP.ToArray(); to.DQ = DQ.ToArray(); to.D = D.ToArray(); to.Modulus = Modulus.ToArray(); to.Exponent = Exponent.ToArray(); }
public BeamAI(int startDepth = 1, int greedyMaxDepth = 4, int BeamWidth = 4) { for (int i = 0; i < 50; ++i) { dp1[i] = new DP(); dp2[i] = new DP(); } StartDepth = startDepth; this.greedyMaxDepth = greedyMaxDepth; this.BeamWidth = BeamWidth; }
public TestAI(int startDepth = 1, int greedyMaxDepth = 0, int KyogoTurn = 100) { for (int i = 0; i < 50; ++i) { dp[i] = new DP(); } StartDepth = startDepth; GreedyMaxDepth = greedyMaxDepth; historyStates = new List <SearchState>(); historyDecides = new List <Decided>(); this.KyogoTurn = KyogoTurn; }
private bool IsEqualRsa(JsonWebKey other) { // Public parameters if (!N.SequenceEqual(other.N)) { return(false); } if (!E.SequenceEqual(other.E)) { return(false); } // Private parameters var privateKey = HasPrivateKey(); if (privateKey && privateKey == other.HasPrivateKey()) { if (!D.SequenceEqual(other.D)) { return(false); } if (!DP.SequenceEqual(other.DP)) { return(false); } if (!DQ.SequenceEqual(other.DQ)) { return(false); } if (!QI.SequenceEqual(other.QI)) { return(false); } if (!P.SequenceEqual(other.P)) { return(false); } if (!Q.SequenceEqual(other.Q)) { return(false); } } return(true); }
/// <summary> /// 转为 RSA 参数集合。 /// </summary> /// <returns>返回 <see cref="RSAParameters"/>。</returns> public virtual RSAParameters ToParameters() { return(new RSAParameters { D = D?.FromBase64String(), DP = DP?.FromBase64String(), DQ = DQ?.FromBase64String(), Exponent = Exponent?.FromBase64String(), InverseQ = InverseQ?.FromBase64String(), Modulus = Modulus?.FromBase64String(), P = P?.FromBase64String(), Q = Q?.FromBase64String() }); }
private void bt_pesquisar_Click_1(object sender, EventArgs e) { foreach (OrientadorEmpresa DP in DE.GetListaPessoa().OfType <OrientadorEmpresa>()) { if (DP.GetNumOrientador() == Convert.ToInt32(txt_numero.Text)) { lb_erro.Visible = false; lb_nome.Text = DP.GetNome(); } else { lb_nome.Visible = false; } } }
public static MVPRetCode query_mvptree(ref MVPFile m, ref DP query, int knearest, float radius, float thresh, ref DP[] results, ref int count) { IntPtr[] points = new IntPtr[results.Length]; MVPRetCode ret = ph_query_mvptree(ref m, ref query, knearest, radius, thresh, points, ref count); int i = 0; foreach(IntPtr ptr in points) { DP dp = (DP)Marshal.PtrToStructure(ptr, typeof(DP)); results[i++] = dp; free(ptr); } return ret; }
public static MVPRetCode query_mvptree(ref MVPFile m, ref DP query, int knearest, float radius, float thresh, ref DP[] results, ref int count) { IntPtr[] points = new IntPtr[results.Length]; MVPRetCode ret = ph_query_mvptree(ref m, ref query, knearest, radius, thresh, points, ref count); int i = 0; foreach (IntPtr ptr in points) { DP dp = (DP)Marshal.PtrToStructure(ptr, typeof(DP)); results[i++] = dp; free(ptr); } return(ret); }
public void refreshLiveBeans() { SourceBind.DataSource = activeBeans.bActive.dataPacks; this.dgvSourceList.DataSource = SourceBind; SourceBind.ResetBindings(false); if (dgvSourceList.Rows.Count != 0) { foreach (DataGridViewRow liveRow in dgvSourceList.Rows) { if (liveRow.Selected == true) { DP highlightedBean = liveRow.DataBoundItem as DP; ElementBind.DataSource = highlightedBean.dataElement; } } } dgvElementList.Refresh(); }
public List <Player> OrderByDataPoint(DP dataPoint) { switch (dataPoint) { case DP.Tackling: return(_savegame.Players.OrderByDescending(x => x._player.Tackling).ToList()); case DP.Passing: return(_savegame.Players.OrderByDescending(x => x._player.Passing).ToList()); case DP.OffTheBall: return(_savegame.Players.OrderByDescending(x => x._player.OffTheBall).ToList()); case DP.Finishing: return(_savegame.Players.OrderByDescending(x => x._player.Finishing).ToList()); default: return(new List <Player>()); } }
public override void DisplayDetail(HWindow_Final window)//显示详细信息 { try { ho_Shape.Dispose(); } catch (Exception) { } Circle circlePositioned = GetShapePositioned() as Circle; ho_Shape = Func_HalconFunction.GenCircle(circlePositioned); try { DP.SetPoint(circlePositioned); } catch (Exception) { DP = new Point(circlePositioned.hv_Column, circlePositioned.hv_Row); } base.DisplayDetail(window); HOperatorSet.GenRegionPoints(out HObject ho_Point, hv_Row, hv_Column); window.DispObj(ho_Point, "red", "fill"); ho_Point.Dispose(); window.DispString(DP.hv_Column - StringHeight, DP.hv_Row, name, "orange"); }
private void selectNewPack() { if (dgvSourceList.Rows.Count != 0) { SelectedPack = dgvSourceList.Rows[0].DataBoundItem as DP; ElementBind.DataSource = SelectedPack.dataElement; dgvElementList.DataSource = ElementBind; if (dgvElementList.Rows.Count != 0)//pre-selects the first element at the top of the element list { selectedDataElement = dgvElementList.Rows[0].DataBoundItem as DE; } } ElementBind.ResetBindings(true); refreshLiveBeans(); if (dgvElementList.Rows.Count != 0) { dgvElementList.Rows[0].Selected = true; } setName(); }
public void SaveVersion <T>(T cName, int UserId) { int Version = 1; Deliverables val = (Deliverables)(object)cName; Deliverables_History DHistory = new Deliverables_History(); var result = _db.Deliverables_History.Where(i => i.DeliverableId == val.DeliverableId).OrderByDescending(x => x.Version).ToList().FirstOrDefault(); Version = (result == null) ? 1 : result.Version + 1; using (var transaction = _db.Database.BeginTransaction()) { val.CopyProperties(DHistory); DHistory.Version = Version; DHistory.ModifiedDate = DateTime.Now; DHistory.UserId = UserId; DHistory.LastSaved = val.LastModified; _db.Deliverables_History.Add(DHistory); //_db.SaveChanges(); var DClientlst = _db.DeliveryClients.Where(c => c.DeliverableId == val.DeliverableId); DeliveryClient_History DC_History = null; foreach (DeliveryClient DC in DClientlst) { DC_History = new DeliveryClient_History(); DC.CopyProperties(DC_History); DC_History.DeliverableVersion = Version; _db.DeliveryClient_History.Add(DC_History); //_db.SaveChanges(); } var DMarketlst = _db.DeliveryMarkets.Where(m => m.DeliverableId == val.DeliverableId).ToList(); DeliveryMarket_History DM_History = null; foreach (DeliveryMarket DM in DMarketlst) { DM_History = new DeliveryMarket_History(); DM.CopyProperties(DM_History); DM_History.DeliverableVersion = Version; var temp = _db.MarketDefinitions_History.Where(d => d.MarketDefId == DM.MarketDefId).OrderByDescending(x => x.Version).ToList().FirstOrDefault(); DM_History.MarketDefVersion = (temp == null) ? 1 : temp.Version; _db.DeliveryMarket_History.Add(DM_History); //_db.SaveChanges(); } var DTerritorylst = _db.DeliveryTerritories.Where(t => t.DeliverableId == val.DeliverableId).ToList(); DeliveryTerritory_History DT_History = null; foreach (DeliveryTerritory DT in DTerritorylst) { DT_History = new DeliveryTerritory_History(); DT.CopyProperties(DT_History); DT_History.DeliverableVersion = Version; var temp = _db.Territories_History.Where(t => t.TerritoryId == DT.TerritoryId).OrderByDescending(x => x.Version).ToList().FirstOrDefault(); DT_History.TerritoryVersion = (temp == null) ? 1 : temp.Version; _db.DeliveryTerritory_History.Add(DT_History); //_db.SaveChanges(); } var DThirdPartylst = _db.DeliveryThirdParties.Where(p => p.DeliverableId == val.DeliverableId).ToList(); DeliveryThirdParty_History DTP_History = null; foreach (DeliveryThirdParty DP in DThirdPartylst) { DTP_History = new DeliveryThirdParty_History(); DP.CopyProperties(DTP_History); DTP_History.DeliverableVersion = Version; _db.DeliveryThirdParty_History.Add(DTP_History); //_db.SaveChanges(); } _db.SaveChanges(); transaction.Commit(); } }
public override int GetHashCode() { return(DP.GetHashCode() ^ DQ.GetHashCode() ^ Exponent.GetHashCode() ^ Modulus.GetHashCode() ^ P.GetHashCode() ^ Q.GetHashCode() ^ PublicExponent.GetHashCode() ^ QInv.GetHashCode()); }
private void btnSave_Click(object sender, EventArgs e) { DP dP = new DP(); dP.Id = txbIdDP.Text; dP.IdContract = txbIDContract.Text; dP.IdPO = txbPOCode.Text; dP.MaKT = txbAccountance.Text; dP.DateDeliver = dtpRequest.Value.ToString("yyyy-MM-dd"); dP.DateOpen = dtpOutCap.Value.ToString("yyyy-MM-dd"); dP.Type = cbbType.Text; dP.Note = txbPurpose.Text; int ret = DP.InsertDP(dP); if (ret == 1) { MessageBox.Show("Lưu thành công"); } else { MessageBox.Show("Lưu không thành công"); } //Check ổ đĩa và tạo forder trên PC string DriveName = ""; DriveInfo[] driveInfos = DriveInfo.GetDrives(); foreach (DriveInfo driveInfo in driveInfos) { //MessageBox.Show(driveInfo.Name.ToString()); if (String.Compare(driveInfo.Name.ToString().Substring(0, 3), @"D:\") == 0 || String.Compare(driveInfo.Name.ToString().Substring(0, 3), @"E:\") == 0) { //MessageBox.Show(driveInfo.Name.ToString().Substring(0, 1)); DriveName = driveInfo.Name.ToString().Substring(0, 3); break; } } string strContractDirectory = DriveName + "OPM\\" + txbPOName.Text; Directory.CreateDirectory(DriveName + "OPM"); Directory.CreateDirectory(DriveName + "OPM" + txbPOName.Text); string strfileDP = DriveName + "OPM\\" + strContractDirectory + "\\" + txbPOName.Text; MessageBox.Show(strContractDirectory); //string strContractDirectory = dP.IdContract.Replace('/', '_'); //strContractDirectory = strContractDirectory.Replace('-', '_'); //string strfileDP = "F:\\OPM\\" + strContractDirectory + "\\" + txbPOName.Text; SiteInfo siteInfo = new SiteInfo(); siteInfo.GetSiteInfoObject(dP.IdContract, ref siteInfo); if (1 == ret) { int retex = OPM.ExcelHandler.OpmExcelHandler.FindAndReplace(@"F:\LP\DP-template1.xlsx", strfileDP, dP.Id, dP.IdContract, siteInfo.Id, dP.DateDeliver, dP.DateOpen, siteInfo.HeadquaterInfo, dP.Note, dP.MaKT, txbNumber.Text); if (retex == 0) { MessageBox.Show("file excel create false"); } else { MessageBox.Show("file excel created "); } } else { MessageBox.Show("lưu không thành công"); } }
/// <summary> /// Checks if the <see cref="g1"/> version (or subset versions) is equivalent to <see cref="g2"/>. /// </summary> /// <param name="g1">Version (set)</param> /// <param name="g2">Individual version</param> public static bool Contains(this GameVersion g1, GameVersion g2) { if (g1 == g2 || g1 == Any) { return(true); } switch (g1) { case RB: return(g2 == RD || g2 == BU || g2 == GN); case Stadium: case EventsGBGen1: case VCEvents: case RBY: return(RB.Contains(g2) || g2 == YW); case Gen1: return(RBY.Contains(g2) || g2 == Stadium || g2 == EventsGBGen1 || g2 == VCEvents); case GS: return(g2 == GD || g2 == SV); case Stadium2: case EventsGBGen2: case GSC: return(GS.Contains(g2) || g2 == C); case Gen2: return(GSC.Contains(g2) || g2 == Stadium2 || g2 == EventsGBGen2); case GBCartEraOnly: return(g2 == Stadium || g2 == Stadium2 || g2 == EventsGBGen1 || g2 == EventsGBGen2); case RS: return(g2 == R || g2 == S); case RSE: return(RS.Contains(g2) || g2 == E); case FRLG: return(g2 == FR || g2 == LG); case COLO: case XD: return(g2 == CXD); case CXD: return(g2 == COLO || g2 == XD); case RSBOX: return(RS.Contains(g2) || g2 == E || FRLG.Contains(g2)); case Gen3: return(RSE.Contains(g2) || FRLG.Contains(g2) || CXD.Contains(g2) || g2 == RSBOX); case DP: return(g2 == D || g2 == P); case HGSS: return(g2 == HG || g2 == SS); case DPPt: return(DP.Contains(g2) || g2 == Pt); case BATREV: return(DP.Contains(g2) || g2 == Pt || HGSS.Contains(g2)); case Gen4: return(DPPt.Contains(g2) || HGSS.Contains(g2) || g2 == BATREV); case BW: return(g2 == B || g2 == W); case B2W2: return(g2 == B2 || g2 == W2); case Gen5: return(BW.Contains(g2) || B2W2.Contains(g2)); case XY: return(g2 == X || g2 == Y); case ORAS: return(g2 == OR || g2 == AS); case Gen6: return(XY.Contains(g2) || ORAS.Contains(g2)); case SM: return(g2 == SN || g2 == MN); case USUM: return(g2 == US || g2 == UM); case GG: return(g2 == GP || g2 == GE || g2 == GO); case Gen7: return(SM.Contains(g2) || USUM.Contains(g2) || GG.Contains(g2)); default: return(false); } }
private async void ImportRoutine() { if (DP.GetProvidersRequest()) { var ds = new GenDS(OneBill.SettingsProvider.SqlConnectionString); DataTable dt = ds.Select("exec dbo.GetAppSettingByName '{0}'", AppSettingsFieldNames.QiwiApiUrl); if (!G.ValidateDT(dt)) { throw new InternalException(LogLevel.DATA_ERROR, TaskOwnerName, "Settings key QiwiApiUrl was not found in DB."); } HttpClient client = new HttpClient(); var stringTask = client.GetStringAsync(G._S(dt.Rows[0]["FieldValue"])); var msg = await stringTask; var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true }; Provider providerResponse = JsonSerializer.Deserialize <Provider>(msg, options); List <Provider> qiwiProviders = providerResponse.ToList(); DataTable providersFromDB = ds.Select("exec dbo._sp_Providers_GetAll"); foreach (Provider qp in qiwiProviders) { var result = ds.Select("exec dbo._sp_Providers_GetByCode '{0}'", qp.ProviderCode); if (result.Rows.Count == 0) { ds.Select("exec dbo._sp_Providers_Insert '{0}', '{1}', {2}, {3}, '{4}', {5}, {6}", qp.ProviderCode, qp.Name, qp.Payable, qp.Form, qp.Parents[0], "NULL", (int)ProviderStatus.New); } else if (result.Rows.Count == 1) { DataRow row = result.Rows[0]; if (qp.Name != G._S(row["Name"]) || (qp.Form != bool.Parse(G._S(row["Form"]))) || qp.Payable != bool.Parse(G._S(row["Payable"])) || qp.Parents[0] != G._S(row["Parents"])) { ds.Select("exec dbo._sp_Providers_Insert '{0}', '{1}', {2}, {3}, '{4}', {5}, {6}", qp.ProviderCode, qp.Name, qp.Payable, qp.Form, qp.Parents[0], "NULL", (int)ProviderStatus.ToRewiew); } } else { //ToDo if count > 1 } } var t = TTask.Run(() => { string time = DateTime.Now.Ticks.ToString(); string path = $@"d:\temp\json.{time}.txt"; using (FileStream fs = File.Create(path)) { byte[] info = new UTF8Encoding(true).GetBytes(msg); fs.Write(info, 0, info.Length); }; }); ds.exec("exec SetIsProvidersRequested 0"); } }
private static extern MVPRetCode ph_query_mvptree(ref MVPFile m, ref DP query, int knearest, float radius, float threshold, IntPtr[] results, ref int count);
public static MVPRetCode save_mvptree(ref MVPFile m, DP[] points) { IntPtr[] datapoints = new IntPtr[points.Length]; int size = Marshal.SizeOf(typeof(DP)); int i = 0; foreach(DP dp in points) { IntPtr ptr = Marshal.AllocHGlobal(size); Marshal.StructureToPtr(dp, ptr, false); datapoints[i++] = ptr; } MVPRetCode ret = ph_save_mvptree(ref m, datapoints, datapoints.Length); for(i = 0; i < datapoints.Length; ++i) Marshal.FreeHGlobal(datapoints[i]); return ret; }
static MainWindow() { DP.InitializeProperties(typeof(MainWindow)); }
public void Init(string pId, string kPhase, string sKey, string uId, string pword) { dp = new DP(pId, kPhase, sKey, uId, pword); }
public static extern float ph_hamming_distance(ref DP a, ref DP b);
public static extern float ph_hamming_distance(ref DP a, ref DP b);