public async Task BotInfoCommand() { NormalEmbed Info = new NormalEmbed(); Info.Title = "Bot Information"; Info.Description = Rem.GetDescription(); Info.ThumbnailUrl = Context.Client.CurrentUser.AvatarUrl; Info.AddField(MD => { MD.Name = "Bot Version"; MD.Value = Rem.Version; MD.IsInline = true; }); Info.AddField(MD => { MD.Name = "Owner"; MD.Value = Context.Client.GetUserAsync(Context.Client.GetApplicationInfoAsync().GetAwaiter().GetResult().Owner.Id).GetAwaiter().GetResult().Username; MD.IsInline = true; }); Info.AddField(x => { x.Name = "Discriminator"; x.Value = Context.Client.CurrentUser.Discriminator; x.IsInline = true; }); Info.AddField(x => { x.Name = "Game"; if (Context.Client.CurrentUser.Game.HasValue) { x.Value = "Playing " + Context.Client.CurrentUser.Game.Value; } else { x.Value = "Not playing anything."; } x.IsInline = true; }); Info.AddField(x => { x.Name = "Status"; x.Value = "Happy serving commands!"; x.IsInline = true; }); Info.AddField(x => { x.Name = "Language"; x.Value = "C#, proudly using .NET Core."; x.IsInline = true; }); Info.AddField(x => { x.Name = "Total Servers"; x.Value = Context.Client.GetGuildsAsync().GetAwaiter().GetResult().Count.ToString(); x.IsInline = true; }); Info.Footer = (new MEmbedFooter()).WithText("Bot Information"); await Context.Channel.SendEmbedAsync(Info); }
public IActionResult Edit(Rem obj) { if (ModelState.IsValid) { _db.Rem.Update(obj); _db.SaveChanges(); return(RedirectToAction("Index")); } return(View(obj)); }
public IActionResult Create(Rem obj) { if (ModelState.IsValid) { Rem newRem = new Rem { EventDate = obj.EventDate, NoteId = obj.NoteId }; _db.Rem.Add(newRem); _db.SaveChanges(); return(RedirectToAction("Index")); } return(View(obj)); }
public static bool TryReadRem(this Scanner scanner, out IStatement result) { if (scanner.TryReadToken(Token.Rem)) { string comment; scanner.ReadToken(Token.Comment, out comment); result = new Rem(comment); return(true); } result = null; return(false); }
public Node ExprMul() { var node = ExprUnary(); while (firstOfExprMul.Contains(CurrentToken)) { switch (CurrentToken) { case TokenCategory.MULTIPLICATION: var node_mul = new Mul(); node_mul.AnchorToken = Expect(TokenCategory.MULTIPLICATION); node_mul.Add(node); node_mul.Add(ExprUnary()); node = node_mul; break; case TokenCategory.MODULO: var node_rem = new Rem(); node_rem.AnchorToken = Expect(TokenCategory.MODULO); node_rem.Add(node); node_rem.Add(ExprUnary()); node = node_rem; break; case TokenCategory.DIVIDE: var node_div = new Div(); node_div.AnchorToken = Expect(TokenCategory.DIVIDE); node_div.Add(node); node_div.Add(ExprUnary()); node = node_div; break; default: throw new SyntaxError(firstOfExprMul, tokenStream.Current); } } return(node); }
public void Visit(Rem node) { VisitChildren(node); }
public string Visit(Rem node) { return(Visit((dynamic)node[0]) + "\n\t\t" + Visit((dynamic)node[1]) + "\n\t\trem.un\n"); }
public string Visit(Rem node) { return(Visit((dynamic)node[0]) + Visit((dynamic)node[1]) + "\trem\n"); }
//check public string Visit(Rem node) { return(VisitChildren(node) + putS(Indentar() + "rem")); }
//----------------------------------------------------------- private Type Visit(Rem node, Table table) { VisitBinaryOperator("rem", node, Type.INTEGER, table); return(Type.INTEGER); }
//----------------------------------------------------------- public string Visit(Rem node, Table table) { return(VisitBinaryOperator("rem", node, table)); }
public void Visit(Rem node) { Visit((dynamic)node[0]); Visit((dynamic)node[1]); }
//This function actually creates the object associated with each Instruction by using a long switch statement. The object //created is polymorphed up to an IInstruction and then returned from the function to be stored in the encodedInstrs list. //Ugly? Very. Effective? Extremely. private IInstruction createObject(string comm, int valToUse, int currentInstruc) { IInstruction retVal = null; switch (comm) { case "exit": retVal = new Exit(valToUse) as IInstruction; break; case "swap": retVal = new Swap() as IInstruction; break; case "inpt": retVal = new Inpt() as IInstruction; break; case "nop": retVal = new Nop() as IInstruction; break; case "pop": retVal = new Pop() as IInstruction; break; case "add": retVal = new Add() as IInstruction; break; case "sub": retVal = new Sub() as IInstruction; break; case "mul": retVal = new Mul() as IInstruction; break; case "div": retVal = new Div() as IInstruction; break; case "rem": retVal = new Rem() as IInstruction; break; case "and": retVal = new And() as IInstruction; break; case "or": retVal = new Or() as IInstruction; break; case "xor": retVal = new Xor() as IInstruction; break; case "neg": retVal = new Neg() as IInstruction; break; case "not": retVal = new Not() as IInstruction; break; case "goto": retVal = new Goto(valToUse) as IInstruction; break; case "ifeq": retVal = new If1(0, valToUse, currentInstruc) as IInstruction; break; case "ifne": retVal = new If1(1, valToUse, currentInstruc) as IInstruction; break; case "iflt": retVal = new If1(2, valToUse, currentInstruc) as IInstruction; break; case "ifgt": retVal = new If1(3, valToUse, currentInstruc) as IInstruction; break; case "ifle": retVal = new If1(4, valToUse, currentInstruc) as IInstruction; break; case "ifge": retVal = new If1(5, valToUse, currentInstruc) as IInstruction; break; case "ifez": retVal = new If2(0, valToUse, currentInstruc) as IInstruction; break; case "ifnz": retVal = new If2(1, valToUse, currentInstruc) as IInstruction; break; case "ifmi": retVal = new If2(2, valToUse, currentInstruc) as IInstruction; break; case "ifpl": retVal = new If2(3, valToUse, currentInstruc) as IInstruction; break; case "dup": retVal = new Dup(valToUse) as IInstruction; break; case "print": retVal = new Print() as IInstruction; break; case "dump": retVal = new Dump() as IInstruction; break; case "push": retVal = new Push(valToUse) as IInstruction; break; } return(retVal); }
private void Employee_Load(object sender, EventArgs e) { Emp_txt.ReadOnly = true; dateTimePicker3.MinDate = DateTime.Now.AddDays(1); dateTimePicker2.MinDate = dateTimePicker3.MinDate.AddDays(1); dateTimePicker2.MaxDate = DateTime.Now.AddMonths(2); refreshSalaryTable(); combo_Month.SelectedIndex = 0; radioButton1.Enabled = true; radioButton2.Enabled = true; AddOT.TabPages.Remove(tabCheckLeaveRequests); AddOT.TabPages.Remove(tabAddOT); //AddOT.TabPages.Remove(tabCalSalary); MySqlConnection con = ConnectionOld.getConnection(); MySqlCommand sc = new MySqlCommand("select role from user_role_tab where user = @user", con); sc.Parameters.AddWithValue("@user", Connection.getUserIdFromConnectionString()); try { con.Open(); MySqlDataReader read = sc.ExecuteReader(); while (read.Read()) { string role = read.GetString("role"); switch (role) { case "HR Manager": AddNewEmp.Show(); Save.Show(); AddOT.TabPages.Remove(tabSendLeaveRequests); //AddOT.TabPages.Remove(tabViewSalary); //this.tabViewSalary.Text = "Calculate Salary"; AddOT.TabPages.Add(tabCheckLeaveRequests); AddOT.TabPages.Add(tabAddOT); //AddOT.TabPages.Add(tabCalSalary); Rem.Show(); //Emp_txt.ReadOnly = false; First_txt.ReadOnly = false; Last_txt.ReadOnly = false; //radioButton1.Enabled = true; //radioButton2.Enabled = true; dateTimePicker1.Enabled = true; Nat_txt.ReadOnly = false; NIC_txt.ReadOnly = false; Add_txt.ReadOnly = false; Mob_txt.ReadOnly = false; Email_txt.ReadOnly = false; Posi_combo.Enabled = true; textBox5.ReadOnly = false; combo_Nat.Enabled = true; break; } } } catch (MySqlException ex) { PanException.Show(this.MdiParent, ex); } finally { con.Close(); } /* first2 = Login.un.Substring(0, 2); * if (tabControl1.SelectedIndex == 0 && first2 != "HR") * { * AddNewEmp.Hide(); * Rem.Hide(); * Emp_txt.ReadOnly = true; * First_txt.ReadOnly = true; * Last_txt.ReadOnly = true; * radioButton1.Enabled = false; * radioButton2.Enabled = false; * dateTimePicker1.Enabled = false; * Nat_txt.ReadOnly = true; * NIC_txt.ReadOnly = true; * Add_txt.ReadOnly = false; * Mob_txt.ReadOnly = false; * Email_txt.ReadOnly = false; * Posi_combo.Enabled = false; * } * * if (tabControl1.SelectedIndex == 1 && first2 != "HR") * { * Calculate.Hide(); * button2.Hide(); * } * * if (first2 != "HR") * { * tabControl1.TabPages.Remove(tabPage5); * tabControl1.TabPages.Remove(tabPage2); * } * else * { * tabControl1.TabPages.Remove(tabPage3); * this.tabPage2.Text = "Calculate Salary"; * } * * if (tabPage4.Text == "Search Employees" && first2 == "HR") * { * Rem.Show(); * }*/ }
public Type Visit(Rem node) { VisitBinaryOperator("REM", node, Type.INT); return(Type.INT); }
private int EmulateInstruction(Instruction instruction, int i) { switch (instruction.OpCode.Code) { case Code.UNKNOWN1: throw new NotSupportedException(); case Code.UNKNOWN2: throw new NotSupportedException(); case Code.Add: Add.Emulate(ValueStack); break; case Code.Add_Ovf: case Code.Add_Ovf_Un: Add.Emulate_Ovf(ValueStack); break; case Code.And: And.Emulate(ValueStack); break; case Code.Arglist: throw new NotSupportedException(); case Code.Beq: case Code.Beq_S: var beqResult = Beq.Emulate(ValueStack, instruction, _instructionsToEmulate); return(beqResult == -1 ? i : beqResult); case Code.Bge: case Code.Bge_S: case Code.Bge_Un: case Code.Bge_Un_S: var bgeResult = Bge.Emulate(ValueStack, instruction, _instructionsToEmulate); return(bgeResult == -1 ? i : bgeResult); case Code.Bgt: case Code.Bgt_S: case Code.Bgt_Un: case Code.Bgt_Un_S: var bgtResult = Bgt.Emulate(ValueStack, instruction, _instructionsToEmulate); return(bgtResult == -1 ? i : bgtResult); case Code.Ble: case Code.Ble_S: case Code.Ble_Un: case Code.Ble_Un_S: var bleResult = Ble.Emulate(ValueStack, instruction, _instructionsToEmulate); return(bleResult == -1 ? i : bleResult); case Code.Blt: case Code.Blt_S: case Code.Blt_Un: case Code.Blt_Un_S: var bltResult = Blt.Emulate(ValueStack, instruction, _instructionsToEmulate); return(bltResult == -1 ? i : bltResult); case Code.Bne_Un: case Code.Bne_Un_S: var bneResult = Bne.Emulate(ValueStack, instruction, _instructionsToEmulate); return(bneResult == -1 ? i : bneResult); case Code.Box: Box.Emulate_Box(ValueStack, instruction); break; case Code.Br: case Code.Br_S: return(Br.Emulate(ValueStack, instruction, _instructionsToEmulate)); case Code.Break: break; case Code.Brfalse: case Code.Brfalse_S: var bFalseResult = BrFalse.Emulate(ValueStack, instruction, _instructionsToEmulate); return(bFalseResult == -1 ? i : bFalseResult); case Code.Brtrue: case Code.Brtrue_S: var bTrueResult = BrTrue.Emulate(ValueStack, instruction, _instructionsToEmulate); return(bTrueResult == -1 ? i : bTrueResult); case Code.Call: Call.Emulate(ValueStack, instruction, _method); break; case Code.Calli: throw new NotSupportedException(); case Code.Callvirt: CallVirt.Emulate(ValueStack, instruction, _method); break; case Code.Castclass: CastClass.Emulate(ValueStack, instruction); break; case Code.Ceq: Ceq.Emulate(ValueStack); break; case Code.Cgt: case Code.Cgt_Un: Ceq.Emulate(ValueStack); break; case Code.Ckfinite: throw new NotSupportedException(); case Code.Clt: case Code.Clt_Un: Clt.Emulate(ValueStack); break; case Code.Constrained: throw new NotSupportedException(); case Code.Conv_I: ConvI.Emulation(ValueStack); break; case Code.Conv_I1: throw new NotSupportedException(); case Code.Conv_I2: ConvI2.Emulation(ValueStack); break; case Code.Conv_I4: ConvI4.Emulation(ValueStack); break; case Code.Conv_I8: ConvI8.Emulation(ValueStack); break; case Code.Conv_Ovf_I: throw new NotSupportedException(); case Code.Conv_Ovf_I_Un: throw new NotSupportedException(); case Code.Conv_Ovf_I1: throw new NotSupportedException(); case Code.Conv_Ovf_I1_Un: throw new NotSupportedException(); case Code.Conv_Ovf_I2: throw new NotSupportedException(); case Code.Conv_Ovf_I2_Un: throw new NotSupportedException(); case Code.Conv_Ovf_I4: throw new NotSupportedException(); case Code.Conv_Ovf_I4_Un: throw new NotSupportedException(); case Code.Conv_Ovf_I8: throw new NotSupportedException(); case Code.Conv_Ovf_I8_Un: throw new NotSupportedException(); case Code.Conv_Ovf_U: throw new NotSupportedException(); case Code.Conv_Ovf_U_Un: throw new NotSupportedException(); case Code.Conv_Ovf_U1: throw new NotSupportedException(); case Code.Conv_Ovf_U1_Un: throw new NotSupportedException(); case Code.Conv_Ovf_U2: throw new NotSupportedException(); case Code.Conv_Ovf_U2_Un: throw new NotSupportedException(); case Code.Conv_Ovf_U4: throw new NotSupportedException(); case Code.Conv_Ovf_U4_Un: throw new NotSupportedException(); case Code.Conv_Ovf_U8: throw new NotSupportedException(); case Code.Conv_Ovf_U8_Un: throw new NotSupportedException(); case Code.Conv_R_Un: throw new NotSupportedException(); case Code.Conv_R4: throw new NotSupportedException(); case Code.Conv_R8: throw new NotSupportedException(); case Code.Conv_U: ConvI.UEmulation(ValueStack); break; case Code.Conv_U1: ConvI1.UEmulation(ValueStack); break; case Code.Conv_U2: ConvI2.UEmulation(ValueStack); break; case Code.Conv_U4: ConvI4.UEmulation(ValueStack); break; case Code.Conv_U8: ConvI8.UEmulation(ValueStack); break; case Code.Cpblk: throw new NotSupportedException(); case Code.Cpobj: throw new NotSupportedException(); case Code.Div: Div.Emulate(ValueStack); break; case Code.Div_Un: Div.Emulate_Un(ValueStack); break; case Code.Dup: ValueStack.CallStack.Push(ValueStack.CallStack.Peek()); break; case Code.Endfilter: throw new NotSupportedException(); case Code.Endfinally: throw new NotSupportedException(); case Code.Initblk: throw new NotSupportedException(); case Code.Initobj: ValueStack.CallStack.Pop(); break; case Code.Isinst: IsInst.Emulate_Box(ValueStack, instruction); break; case Code.Jmp: throw new NotSupportedException(); case Code.Ldarg: case Code.Ldarg_0: case Code.Ldarg_1: case Code.Ldarg_2: case Code.Ldarg_3: case Code.Ldarg_S: Ldarg.Emulate(ValueStack, instruction, _method); break; case Code.Ldarga: throw new NotSupportedException(); case Code.Ldarga_S: throw new NotSupportedException(); case Code.Ldc_I4: case Code.Ldc_I4_0: case Code.Ldc_I4_1: case Code.Ldc_I4_2: case Code.Ldc_I4_3: case Code.Ldc_I4_4: case Code.Ldc_I4_5: case Code.Ldc_I4_6: case Code.Ldc_I4_7: case Code.Ldc_I4_8: ValueStack.CallStack.Push(instruction.GetLdcI4Value()); break; case Code.Ldc_I4_M1: ValueStack.CallStack.Push(-1); break; case Code.Ldc_I4_S: ValueStack.CallStack.Push((sbyte)instruction.GetLdcI4Value()); break; case Code.Ldc_I8: ValueStack.CallStack.Push((long)instruction.Operand); break; case Code.Ldc_R4: ValueStack.CallStack.Push((float)instruction.GetOperand()); break; case Code.Ldc_R8: ValueStack.CallStack.Push((double)instruction.GetOperand()); break; case Code.Ldelem: throw new NotSupportedException(); case Code.Ldelem_I: throw new NotSupportedException(); case Code.Ldelem_I1: throw new NotSupportedException(); case Code.Ldelem_I2: throw new NotSupportedException(); case Code.Ldelem_I4: throw new NotSupportedException(); case Code.Ldelem_I8: throw new NotSupportedException(); case Code.Ldelem_R4: throw new NotSupportedException(); case Code.Ldelem_R8: throw new NotSupportedException(); case Code.Ldelem_Ref: LdelemRef.Emulate(ValueStack); break; case Code.Ldelem_U1: LdelemI1.UEmulate(ValueStack); break; case Code.Ldelem_U2: throw new NotSupportedException(); case Code.Ldelem_U4: LdelemI4.UEmulate(ValueStack); break; case Code.Ldelema: Ldelema.Emulate(ValueStack); break; case Code.Ldfld: throw new NotSupportedException(); case Code.Ldflda: throw new NotSupportedException(); case Code.Ldftn: throw new NotSupportedException(); case Code.Ldind_I: throw new NotSupportedException(); case Code.Ldind_I1: throw new NotSupportedException(); case Code.Ldind_I2: throw new NotSupportedException(); case Code.Ldind_I4: LdindI4.Emulate(ValueStack); break; case Code.Ldind_I8: throw new NotSupportedException(); case Code.Ldind_R4: throw new NotSupportedException(); case Code.Ldind_R8: throw new NotSupportedException(); case Code.Ldind_Ref: throw new NotSupportedException(); case Code.Ldind_U1: LdindI1.UEmulate(ValueStack); break; case Code.Ldind_U2: LdindI2.UEmulate(ValueStack); break; case Code.Ldind_U4: LdindI4.UEmulate(ValueStack); break; case Code.Ldlen: Ldlen.Emulate(ValueStack); break; case Code.Ldloc: case Code.Ldloc_0: case Code.Ldloc_1: case Code.Ldloc_2: case Code.Ldloc_3: case Code.Ldloc_S: Ldloc.Emulate(ValueStack, instruction, _method); break; case Code.Ldloca: case Code.Ldloca_S: Ldloc.EmulateLdloca(ValueStack, instruction, _method); break; case Code.Ldnull: ValueStack.CallStack.Push(null); break; case Code.Ldobj: Ldobj.Emulate(ValueStack, instruction); break; case Code.Ldsfld: Ldsfld.Emulate(ValueStack, instruction); break; case Code.Ldsflda: throw new NotSupportedException(); case Code.Ldstr: ValueStack.CallStack.Push(instruction.Operand.ToString()); break; case Code.Ldtoken: Ldtoken.Emulate(ValueStack, instruction); break; case Code.Ldvirtftn: throw new NotSupportedException(); case Code.Leave: case Code.Leave_S: return(LEave.Emulate(ValueStack, instruction, _instructionsToEmulate)); case Code.Localloc: Localloc.Emulate(ValueStack); break; case Code.Mkrefany: throw new NotSupportedException(); case Code.Mul: case Code.Mul_Ovf: case Code.Mul_Ovf_Un: Mul.Emulate(ValueStack); break; case Code.Neg: ValueStack.CallStack.Push(-ValueStack.CallStack.Pop()); break; case Code.Newarr: NewArr.Emulate(ValueStack, instruction); break; case Code.Newobj: throw new NotSupportedException(); case Code.Nop: break; case Code.Not: Not.Emulate(ValueStack); break; case Code.Or: Or.Emulate(ValueStack); break; case Code.Pop: ValueStack.CallStack.Pop(); break; case Code.Prefix1: throw new NotSupportedException(); case Code.Prefix2: throw new NotSupportedException(); case Code.Prefix3: throw new NotSupportedException(); case Code.Prefix4: throw new NotSupportedException(); case Code.Prefix5: throw new NotSupportedException(); case Code.Prefix6: throw new NotSupportedException(); case Code.Prefix7: throw new NotSupportedException(); case Code.Prefixref: throw new NotSupportedException(); case Code.Readonly: throw new NotSupportedException(); case Code.Refanytype: throw new NotSupportedException(); case Code.Refanyval: throw new NotSupportedException(); case Code.Rem: Rem.Emulate(ValueStack); break; case Code.Rem_Un: Rem.Emulate_Un(ValueStack); break; case Code.Ret: break; case Code.Rethrow: throw new NotSupportedException(); case Code.Shl: Shl.Emulate(ValueStack); break; case Code.Shr: Shr.Emulate(ValueStack); break; case Code.Shr_Un: Shr.Emulate_Un(ValueStack); break; case Code.Sizeof: throw new NotSupportedException(); case Code.Starg: case Code.Starg_S: Starg.Emulate(ValueStack, instruction, _method); break; case Code.Stelem: throw new NotSupportedException(); case Code.Stelem_I: throw new NotSupportedException(); case Code.Stelem_I1: StelemI1.Emulate(ValueStack); break; case Code.Stelem_I2: break; case Code.Stelem_I4: Stelem_I4.Emulate(ValueStack); break; case Code.Stelem_I8: throw new NotSupportedException(); case Code.Stelem_R4: throw new NotSupportedException(); case Code.Stelem_R8: throw new NotSupportedException(); case Code.Stelem_Ref: throw new NotSupportedException(); case Code.Stfld: throw new NotSupportedException(); case Code.Stind_I: throw new NotSupportedException(); case Code.Stind_I1: StindI1.Emulate(ValueStack); break; case Code.Stind_I2: throw new NotSupportedException(); case Code.Stind_I4: StindI4.Emulate(ValueStack); break; case Code.Stind_I8: throw new NotSupportedException(); case Code.Stind_R4: throw new NotSupportedException(); case Code.Stind_R8: throw new NotSupportedException(); case Code.Stind_Ref: throw new NotSupportedException(); case Code.Stloc: case Code.Stloc_0: case Code.Stloc_1: case Code.Stloc_2: case Code.Stloc_3: case Code.Stloc_S: Stloc.Emulate(ValueStack, instruction, _method); break; case Code.Stobj: Stobj.Emulate(ValueStack, instruction); break; case Code.Stsfld: Stsfld.Emulate(ValueStack, instruction); break; case Code.Sub: Sub.Emulate(ValueStack); break; case Code.Sub_Ovf: case Code.Sub_Ovf_Un: Sub.Emulate_Ovf(ValueStack); break; case Code.Switch: var switchResult = Switch.Emulate(ValueStack, instruction, _instructionsToEmulate); return(switchResult == -1 ? i : switchResult); case Code.Tailcall: throw new NotSupportedException(); case Code.Throw: throw new NotSupportedException(); case Code.Unaligned: throw new NotSupportedException(); case Code.Unbox: throw new NotSupportedException(); case Code.Unbox_Any: // Box.Emulate_UnBox_Any(ValueStack,instruction); break; case Code.Volatile: throw new NotSupportedException(); case Code.Xor: Xor.Emulate(ValueStack); break; default: throw new ArgumentOutOfRangeException(); } return(i); }
public AbstractValue Evaluate(Rem expr) { throw new NotImplementedException(); }