private void btsave_Click(object sender, EventArgs e) { if (cbsodienthoai.SelectedIndex == -1) { MessageBox.Show("Chưa chọn Khách hàng "); } try { PDB.EndCurrentEdit(); daphieudatbao.Update(tbphieudatbao); tbphieudatbao.AcceptChanges(); CTDB.EndCurrentEdit(); dactdatbao.Update(tbctdatbao); tbctdatbao.AcceptChanges(); MessageBox.Show("Bạn cập nhật thành công!!!"); capnhat = false; ennablebutton(); } catch (Exception ex) { tbphieudatbao.RejectChanges(); tbctdatbao.RejectChanges(); MessageBox.Show(ex.ToString()); } }
/// <summary> /// Create Event Handlers and attach to the Rule Collection /// </summary> /// <param name="ruleCollection"></param> public void RegisterRuleList(PDB holder, RuleList ruleCollection) { this._rule_holder = holder; this._rules = ruleCollection; this.RuleAddedHandler = new RuleEventHandler(this.OnRuleAsserted); this.RuleRemovedHandler = new RuleEventHandler(this.OnRuleRetracted); this.AttachEventHandlers(this._rules); }
public async Task <IActionResult> ConfirmDeleteFromPDB_list(int?id) { if (id != null) { PDB find_part = await PartsContext.PDBs.FirstOrDefaultAsync(p => p.Id == id); return(DeleteView(find_part, "PDB_list")); } return(NotFound()); }
private void btCancel_Click(object sender, EventArgs e) { CTDB.EndCurrentEdit(); tbctdatbao.RejectChanges(); PDB.EndCurrentEdit(); tbphieudatbao.RejectChanges(); bdpdb_PositionChanged(sender, e); capnhat = false; ennablebutton(); }
public HashClusterDendrog(string dirName, string alignFile, HashCInput input, DistanceMeasures dMeasure, AglomerativeType linkageType, PDB.PDBMODE atoms, bool jury1d, string alignFileName, string profileName = null, string refJuryProfile = null):base(dirName,alignFile,input) { this.dMeasure=dMeasure; this.linkageType=linkageType; this.atoms = atoms; this.jury1d = jury1d; this.profileName = profileName; this.refJuryProfile = refJuryProfile; this.dirName = dirName; }
public async Task <IActionResult> DeletePDB_list(int?id) { if (id != null) { PDB find_part = new PDB { Id = id.Value }; await DeletePart(find_part); return(RedirectToAction("Index")); } return(NotFound()); }
private void DoOpen(string file) { try { _currentPDB = PDB.LoadPDB(file); } catch (PDBException ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); _currentPDB = null; } UpdateDisplay(); }
public PNode(string plMt, SIProlog prolog, Graph data) { this.prologEngine = prolog; this.id = plMt; prolog.KBGraph.AddNode(this); prologEngine.GraphForMT[plMt] = this; prologEngine.RegisterHomeGraph(data.BaseUri.AbsoluteUri, data, true); pdb = new PDB(true); pdb.RegisterRuleList(this); pdb.startMt = plMt; pdb.followedGenlMt = false; PrologKB.id = plMt; _rdfGraph = data; EnsureGraphPrefixes(rdfGraph); }
private void btnew_Click(object sender, EventArgs e) { PDB.AddNew(); dtpngaydat.Value = DateTime.Now; try { SqlCommand cmm = new SqlCommand("Select dbo.fn_CreateMaPDB()", model.cnn); model.cnn.Open(); tbxsophieu.Text = cmm.ExecuteScalar().ToString(); capnhat = true; ennablebutton(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } model.cnn.Close();; }
public static void Main(string[] args) { if (args.Length < 1) { Console.WriteLine("Usage: pdbdump <pdbfile>"); return; } string filename = args[0]; Console.WriteLine($"Loading PDB '{filename}'..."); PDB pdb = null; try { pdb = PDB.LoadPDB(filename); } catch (PDBException ex) { Console.WriteLine("Error: " + ex.Message); return; } Console.WriteLine("PDB Loaded... Processing Information"); var symbols = pdb.Symbols; var sources = pdb.SourceFiles; var objects = pdb.Objects; foreach (var obj in objects) { Console.WriteLine(obj.FileName); foreach (var index in obj.SymbolIndices) { Console.WriteLine(" " + symbols[(int)index]); } foreach (var index in obj.SourceFileIndices) { Console.WriteLine(" " + sources[(int)index]); } } }
public void CreateTest_DevDiv_Native() { string executablePath = Path.Combine(TestContext.TestDeploymentDir, "Microsoft.DevDiv.Native.targets"); PDB actual = PDB.Create(executablePath); string actualPdbInfo = actual.ToString(); string actualPdbInfoPath = Path.Combine(TestContext.TestDeploymentDir, "Microsoft.DevDiv.Native.targets.pdbinfo.actual"); File.WriteAllText(actualPdbInfoPath, actualPdbInfo); string expectedPdbInfoPath = Path.Combine(TestContext.TestDeploymentDir, "Microsoft.DevDiv.Native.targets.pdbinfo"); string expectedPdbInfo = File.ReadAllText(expectedPdbInfoPath); bool correctPdbGeneration = string.Equals(expectedPdbInfo, actualPdbInfo, StringComparison.Ordinal); Assert.IsTrue( correctPdbGeneration, "PDB created incorrectly: Compare {0} {1}", expectedPdbInfoPath, actualPdbInfoPath ); }
private void btdeleted_Click(object sender, EventArgs e) { try { var rows = tbctdatbao.Select("SoPhieu='" + tbxsophieu.Text + "'"); foreach (DataRow r in rows) { r.Delete(); dactdatbao.Update(tbctdatbao); tbctdatbao.AcceptChanges(); } PDB.RemoveAt(PDB.Position); daphieudatbao.Update(tbphieudatbao); tbphieudatbao.AcceptChanges(); MessageBox.Show("Xóa thành công"); } catch (Exception ex) { tbctdatbao.RejectChanges(); tbphieudatbao.RejectChanges(); MessageBox.Show(ex.ToString()); } }
internal void LocateExecutionPoint(StackFrame stackFrame, bool atStart) { // Open project file OpenSourceFile(stackFrame.ExecutablePath); // Get the RTB displaying the file TabPage tabPage = _mainWindow.OpenFilesControl.TabPages[stackFrame.ExecutablePath]; OpenFileUserControl fvUC = tabPage.Controls[0] as OpenFileUserControl; highlightedRTB = fvUC.richTextBox; // Get the symbol information and locate execution point in the source file PDB pdb = SymbolStore.Instance[stackFrame.ExecutablePath]; Point location = atStart ? stackFrame.StartLocation : stackFrame.EndLocation; // Now highlight the pos highlightedIndex = highlightedRTB.GetFirstCharIndexFromLine(location.Y - 1) + location.X - 2; highlightedRTB.SelectionStart = highlightedIndex; highlightedRTB.SelectionLength = 1; highlightedBackColor = highlightedRTB.SelectionBackColor; highlightedRTB.SelectionBackColor = Color.Yellow; highlightedRTB.SelectionLength = 0; }
public void Write(string name, string file) { ByteBuilder bb = new ByteBuilder(1024); PDB pdb = new PDB(name); string key; Puzzle puzzle; if (fileInvalid) { Environment.Exit(1); } for (int i = 0; i < list.Count; i++) { key = (string)list.GetKey(i); puzzle = (Puzzle)list.GetByIndex(i); bb.Reset(); bb.Append(1); bb.Append((byte)puzzle.width); bb.Append((byte)puzzle.height); bb.Append(key); bb.Append(0); bb.Append(puzzle.author); bb.Append(0); bb.Append(puzzle.site); bb.Append(0); bb.Append(puzzle.xAxis); bb.Append(puzzle.yAxis); Console.WriteLine("---> Adding [" + key + "] (" + puzzle.width + " x " + puzzle.height + ")"); pdb.AddRecord(bb.ToBytes()); } Console.WriteLine("---> " + list.Count + " puzzl" + ((list.Count == 1) ? "e" : "es") + " added"); pdb.Write(file); }
public PDBObject(PDB pdb, PDB.ObjectFile objectFile) { PDB = pdb; ObjectFile = objectFile; }
private DistanceMeasure CreateMeasure(string processName, string dirName,DistanceMeasures measure,PDB.PDBMODE atoms,bool jury1d,string alignFileName, string profileName=null,string refJuryProfile=null) { DistanceMeasure dist=null; switch(measure) { case DistanceMeasures.HAMMING: if (alignFileName != null) dist = new JuryDistance(alignFileName, jury1d, profileName, refJuryProfile); else dist = new JuryDistance(dirName, alignFileName, jury1d, profileName, refJuryProfile); break; case DistanceMeasures.COSINE: if (alignFileName != null) dist = new CosineDistance(alignFileName, jury1d, profileName, refJuryProfile); else dist = new CosineDistance(dirName, alignFileName, jury1d, profileName, refJuryProfile); break; case DistanceMeasures.RMSD: if (dirName == null) throw new Exception("RMSD and MAXSUB measures cannot be used for aligned profiles!"); dist = new Rmsd(dirName, alignFileName, jury1d, atoms, refJuryProfile); break; case DistanceMeasures.MAXSUB: if (dirName == null) throw new Exception("RMSD and MAXSUB measures cannot be used for aligned profiles!"); dist = new MaxSub(dirName, alignFileName, jury1d, refJuryProfile); break; case DistanceMeasures.GDT_TS: if (dirName == null) throw new Exception("RMSD and MAXSUB measures cannot be used for aligned profiles!"); dist = new GDT_TS(dirName, alignFileName, jury1d, refJuryProfile); break; } return dist; }
private DistanceMeasure CreateMeasureForDCD(DCDFile dcd, DistanceMeasures measure, PDB.PDBMODE atoms, bool jury1d, string alignFileName, string profileName = null, string refJuryProfile = null) { DistanceMeasure dist=null; switch (measure) { case DistanceMeasures.HAMMING: if (refJuryProfile == null || !jury1d) throw new Exception("Sorry but for jury measure you have to define 1djury profile to find reference structure"); else dist = new JuryDistance(dcd, alignFileName, true, profileName, refJuryProfile); break; case DistanceMeasures.RMSD: dist = new Rmsd(dcd, alignFileName, jury1d, atoms, refJuryProfile); break; case DistanceMeasures.MAXSUB: dist = new MaxSub(dcd, alignFileName, jury1d, refJuryProfile); break; case DistanceMeasures.GDT_TS: dist = new GDT_TS(dcd, alignFileName, jury1d, refJuryProfile); break; } dist.InitMeasure(); return dist; }
private void HandleLogin(object incoming) { Stopwatch sw = Stopwatch.StartNew(); var data = (byte[]) incoming; if (data[0] != ProtocolVersion) { SendKick("Invalid Protocol version!"); return; } Username = Asen.GetString(data, 1, 64).Trim(); string hash = Asen.GetString(data, 65, 32).Trim(); byte type = data[129]; Average1.Add(sw.ElapsedTicks); sw = Stopwatch.StartNew(); if (Configuration.VERIFY && _ip != "127.0.0.1") { if (PlayerHandler.Players.Count >= Configuration.MAXPLAYERS) { SendKick("Server is full!"); } if (hash != BitConverter.ToString(md5.ComputeHash(Asen.GetBytes(Configuration.ServerSalt + Username))).Replace("-", "").ToLower().TrimStart('0')) { SendKick("Account could not be verified, try again."); Server.Log(Server.HeartBeat._hash + "", LogTypesEnum.Debug); Server.Log("'" + hash + "' != '" + BitConverter.ToString(md5.ComputeHash(Asen.GetBytes(Configuration.ServerSalt + Username))).Replace("-", "").ToLower().TrimStart('0') + "'", LogTypesEnum.Debug); return; } } Average2.Add(sw.ElapsedTicks); sw = Stopwatch.StartNew(); pdb = PDB.Find(Username.Trim().ToLower()); if(pdb == null) { var dbData = new object[] {Username, "", _ip, (byte) 0, 0, false, false}; try { UID = Server.users.NewRow(dbData); } catch (Exception e) { throw new Exception("F**K"); } //UID = Server.users.NewRow(dbData); pdb = new PDB(UID, dbData); } else { UID = pdb.UID; } Average3.Add(sw.ElapsedTicks); sw = Stopwatch.StartNew(); SendGlobalMessage(Username + " Logged In."); PlayerHandler.Connections.Remove(this); UserId = FreeId(); PlayerHandler.Players.Add(UserId, this); Average4.Add(sw.ElapsedTicks); SendMap(); _isLoggedIn = true; }
private void HandleLogin(object incoming) { var data = (byte[]) incoming; if (data[0] != ProtocolVersion) { SendKick("Invalid Protocol version!"); return; } Username = Asen.GetString(data, 1, 64).Trim(); string hash = Asen.GetString(data, 65, 32).Trim(); byte type = data[129]; if (string.IsNullOrWhiteSpace(hash) || hash == "--" || hash != BitConverter.ToString(md5.ComputeHash(Asen.GetBytes(Configuration.ServerSalt + Username))).Replace("-", "").ToLower().TrimStart('0')) { SendKick("Account could not be verified, try again."); Server.Log(Server.HeartBeat._hash + "", LogTypesEnum.Debug); Server.Log("'" + hash + "' != '" + BitConverter.ToString(md5.ComputeHash(Asen.GetBytes(Configuration.ServerSalt + Username))).Replace("-", "").ToLower().TrimStart('0') + "'", LogTypesEnum.Debug); return; } pdb = PDB.Find(Username.Trim().ToLower()); if(pdb == null) { var dbData = new object[] {Username, "", _ip, (byte) 0, 0, false, false}; try { UID = Server.users.NewRow(dbData); } catch (Exception e) { throw new Exception("F**K"); } //UID = Server.users.NewRow(dbData); pdb = new PDB(UID, dbData); } else { UID = pdb.UID; } Server.Log(Username + " Logging in with hash: " + hash + " and TYPE: " + type, LogTypesEnum.Info); SendGlobalMessage(Username + " Logged In."); PlayerHandler.Connections.Remove(this); UserId = FreeId(); Server.Log(UserId + "", LogTypesEnum.Info); PlayerHandler.Players.Add(UserId, this); SendMap(); _isLoggedIn = true; }
public ProveResult TripleQuery(Term thisTerm, PartListImpl goalList, PEnv environment, PDB db, int level, reportDelegate reportFunction) { // bagof(Term, ConditionTerm, ReturnList) // PartList goalList = (PartList)goalIn; Part collect0 = value((Part)thisTerm.ArgList[0], environment); Part subgoal = value((Part)thisTerm.ArgList[1], environment); Part into = value((Part)thisTerm.ArgList[2], environment); Part collect = renameVariables(collect0, level, thisTerm); //var newGoal = new Term(subgoal.name, renameVariables(subgoal.ArgList, level, thisTerm)); Term newGoal = new Term(subgoal.fname, false, (PartListImpl)renameVariables(((PartListImpl)subgoal), level, thisTerm)); newGoal.parent = thisTerm; //var newGoals = []; //newGoals[0] = newGoal; PartListImpl newGoals = new PartListImpl(); newGoals.AddPart(newGoal); // Prove this subgoal, collecting up the environments... PartListImpl anslist = new PartListImpl(); anslist.renumber = -1; var ret = prove(newGoals, environment, db, level + 1, BagOfCollectFunction(collect, anslist)); // Turn anslist into a proper list and unify with 'into' // optional here: nil anslist -> fail? Part answers = Atom.FromSource(FUNCTOR_NIL); /* * print("Debug: anslist = ["); * for (var j = 0; j < anslist.length; j++) { * anslist[j].print(); * print(", "); * } * print("]\n"); */ for (int i = anslist.Arity; i > 0; i--) { answers = MakeList(anslist.ArgList[i - 1], answers); } //print("Debug: unifying "); into.print(); print(" with "); answers.print(); print("\n"); var env2 = unify(into, answers, environment); if (env2 == null) { //print("Debug: bagof cannot unify anslist with "); into.print(); print(", failing\n"); return(null); } // Just prove the rest of the goallist, recursively. return(prove(goalList, env2, db, level + 1, reportFunction)); }
public ProveResult ExecuteSharp(Term thisTerm, PartListImpl goalList, PEnv environment, PDB db, int level, reportDelegate reportFunction) { Term collect0 = value((Part)thisTerm.ArgList[1], environment).AsTerm(); string methodName = collect0.fname; var partObj = value((Part)thisTerm.ArgList[0], environment); object result; TextWriter warns = new StringWriter(); try { if (partObj.IsObject) { if (!CanInvokeObject(partObj.Functor0, methodName, collect0.ArgList, out result, warns)) { Warn(warns); return(new ProveResult() { Failed = true }); } } else { if (!CanInvokeObjectByName(partObj.Text, methodName, collect0.ArgList, true, out result, warns)) { Warn(warns); return(new ProveResult() { Failed = true }); } } } catch (Exception e2) { Warn(warns); throw e2; return(new ProveResult() { Failed = true }); } //print("Debug: unifying "); into.print(); print(" with "); answers.print(); print("\n"); var env2 = unify(thisTerm.ArgList[2], ObjectToPart(result), environment); if (env2 == null) { //print("Debug: bagof cannot unify anslist with "); into.print(); print(", failing\n"); return(null); } // Just prove the rest of the goallist, recursively. return(prove(goalList, env2, db, level + 1, reportFunction)); }