예제 #1
0
 public void ThirdWeekend()
 {
     Program2.month      = 1;
     Program2.DayOfMonth = 1;
     Program2.DayOfWeek  = Program2.DayInWeek(2018);
     Assert.AreEqual((16, 1), Program2.NumOfBonusWeekend(3, 2018));
 }
예제 #2
0
 static void Main()
 {
     Console.Write("Введите 1 для сервера, другое число иначе: ");
     if (int.Parse(Console.ReadLine()) == 1)
     {
         try
         {
             Program2 A = new Program2();
             A.Start();
         }
         catch (Exception)
         {
             Console.WriteLine("Сервер не выдержал от количества сообщений!!!");
         }
     }
     else
     {
         MyThreadBr threads = new MyThreadBr(1, 15000, 1000000);
         Console.WriteLine("Послал!!!");
         Console.ReadKey();
         /*for(int i=0;i<6;i++)//можно запустить несколько программ для большей амуляции процесса
         {
             Process.Start("C:\\Users\\Александр\\Documents\\Visual Studio 2013\\Projects\\localhostDOS\\localhostDOS\\bin\\Debug\\localhostDOS.exe");
         }*/
         //MyThreadBr threads = new MyThreadBr(8000, 20000,1000);
     }
     Console.ReadKey();
 }
예제 #3
0
        internal static Assembly ResolveAssembly(object sender, ResolveEventArgs args)
        {
            if (Interlocked.CompareExchange(ref isResolveRunning, 1, 0) != 0)
            {
                return(null);
            }

            try
            {
                Program2.WriteInfo($"Resolving assembly `{args.Name}`.");
                var r = LoadFromAlternativeFolder(args.Name);
                if (r != null)
                {
                    return(r);
                }
                Program2.WriteInfo($"Assembly `{args.Name}` resolve failed.");

                //We cannot do typeof(something).Assembly, because besides the compiler there are no dlls, doing that will try to load the dll from the disk
                //which fails, so this event is called again call this event...

                return(null);
            }
            finally
            {
                isResolveRunning = 0;
            }
        }
        static void Main()
        {
            Program2.Test();

            string strUnable = "56F34";
            string strBig    = "1.29e325";

            //value is not a number in a valid format.

            try
            {
                double result1 = Convert.ToDouble(strUnable);
            }
            catch (FormatException)
            {
                Console.WriteLine("Unable to convert '{0}' to a Double.", strUnable);
            }

            //value represents a number that is less than MinValue or greater than MaxValue.

            try
            {
                double result2 = Convert.ToDouble(strBig);
            }
            catch (OverflowException)
            {
                Console.WriteLine("'{0}' is outside the range of a Double.", strBig);
            }

            Console.ReadKey();
        }
예제 #5
0
        private void Save()
        {
            if (Options.FullCompile)
            {
                var bindingsAssemblyPath = bindingCompiler.OutputFileName;
                var(builder, fields) = configuration.ServiceProvider.GetService <RefObjectSerializer>().CreateBuilder(configuration);
                bindingCompiler.AddSerializedObjects(ObjectsClassName, builder, fields);
                bindingCompiler.SaveAssembly();

                Program2.WriteInfo($"Bindings saved to {bindingsAssemblyPath}.");

                compilation = compilation.AddReferences(MetadataReference.CreateFromFile(Path.GetFullPath(bindingsAssemblyPath)));
                var compiledViewsFileName = Path.Combine(Options.OutputPath, Options.AssemblyName + "_Views" + ".dll");

                var result = compilation.Emit(compiledViewsFileName);
                if (!result.Success)
                {
                    throw new Exception("The compilation failed!");
                }
                //TODO: merge emitted assemblies
                //var merger = new ILMerging.ILMerge() {
                //    OutputFile = Path.Combine(Options.OutputPath, Options.AssemblyName + ".dll"),
                //};
                //merger.SetInputAssemblies(new[] { compiledViewsFileName, bindingsAssemblyPath });
                //merger.SetSearchDirectories(new[] { Path.GetDirectoryName(Options.WebSiteAssembly) });
                //merger.Merge();
                //File.Delete(compiledViewsFileName);
                //File.Delete(bindingsAssemblyPath);

                Program2.WriteInfo($"Compiled views saved to {compiledViewsFileName}.");
            }
        }
예제 #6
0
        public CompilationResult Execute()
        {
            Program2.WriteInfo("Initializing...");
            Init();

            Program2.WriteInfo("Compiling views...");
            foreach (var file in Options.DothtmlFiles)
            {
                try
                {
                    var viewCompilationResult = CompileFile(file);
                }
                catch (DotvvmCompilationException exception)
                {
                    result.Files.Add(file, new FileCompilationResult {
                        Errors = new List <Exception>()
                        {
                            exception
                        }
                    });
                }
            }

            if (Options.FullCompile)
            {
                Program2.WriteInfo("Emitting assemblies...");
                Save();
            }

            Program2.WriteInfo("Building compilation results...");
            return(result);
        }
예제 #7
0
        /// <summary>
        /// Tries to find and load assembly from folder specified in options and environment variable at the start of the app.
        /// </summary>
        private static bool TryLoadAssemblyFromUserFolders(string name, out Assembly loadAssemblyFromFile)
        {
            foreach (var path in Program2.assemblySearchPaths)
            {
                Program2.WriteInfo($"Searching in {path}");
                var assemblyPath = Path.Combine(path, new AssemblyName(name).Name);

                if (File.Exists(assemblyPath + ".dll"))
                {
                    {
                        loadAssemblyFromFile = LoadAssemblyFromFile(assemblyPath + ".dll");
                        Program2.WriteInfo($"Assembly found at {assemblyPath + ".dll"}");

                        return(true);
                    }
                }

                if (File.Exists(assemblyPath + ".exe"))
                {
                    {
                        loadAssemblyFromFile = LoadAssemblyFromFile(assemblyPath + ".exe");
                        Program2.WriteInfo($"Assembly found at {assemblyPath + ".exe"}");
                        return(true);
                    }
                }
            }

            loadAssemblyFromFile = null;
            return(false);
        }
예제 #8
0
 public void NewMonth()
 {
     Program2.DayOfMonth = 32;
     Program2.month      = 1;
     Program2.DayInWeek(2018);
     Assert.AreEqual(1, Program2.DayOfMonth);
     Assert.AreEqual(2, Program2.month);
 }
예제 #9
0
 private void Program1_SelectedIndexChanged(object sender, EventArgs e)
 {
     ReloadFalsePositives();
     ReloadFalseNegatives();
     ReloadOk();
     Program2.Refresh();
     Program2.ClearSelected();
 }
예제 #10
0
        public void SecondMaxOccurence()
        {
            string str      = "samshsaaha";
            char   expected = 's';
            char   actual;

            actual = Program2.SecondMaxOccurence(str);
            Assert.AreEqual(expected, actual);
        }
예제 #11
0
 private void button4_Click(object sender, EventArgs e)
 {
     comparison.DetermineCorrectMapping();
     Program1.Refresh();
     Program2.Refresh();
     ReloadAllFalseNegatives();
     ReloadCorrect();
     //            ReloadMapped();
 }
예제 #12
0
        private static void DemoCommandPattern(string[] args)
        {
            #region Logic without CommandPattern
            //Program1.Run(args);
            #endregion

            #region Logic following CommandPattern
            Program2.Run(args);
            #endregion
        }
예제 #13
0
        public void LongestPalindromeTest()
        {
            string str      = "samshsaaha"; // TODO: Initialize to an appropriate value
            string expected = "shs";        // TODO: Initialize to an appropriate value
            string actual;

            actual = Program2.LongestPalindrome(str);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
예제 #14
0
 static void Main()
 {
     CreateSpanFromArray();
     Console.WriteLine("-----");
     CreateSpanFromNativeMemory();
     Console.WriteLine("-----");
     CreateSpanFromStack();
     WorkWithSpans();
     Console.WriteLine("-----");
     Program2.WorkWithSpans();
 }
예제 #15
0
    static void Main(string[] args)
    {
        Program1 ob1 = new Program1();
        Program2 ob2 = new Program2();
        Program3 ob3 = new Program3();

        ob1.Student();
        ob2.Marks();
        ob3.Age();
        Console.ReadKey();
    }
예제 #16
0
        public void TestIsContrain5()
        {
            int[] arr1 = new int[] { 1, 2, 3, 4, 5 };
            bool  rs1  = Program2.IsContrain5(arr1);

            Assert.AreEqual(true, rs1);

            int[] arr2 = new int[] { 1, 2, 3, 4, 6 };
            bool  rs2  = Program2.IsContrain5(arr2);

            Assert.AreEqual(false, rs2);
        }
예제 #17
0
        public void TestSum()
        {
            int[] arr1 = new int[0];
            int   rs1  = Program2.Sum(arr1);

            Assert.AreEqual(0, rs1);

            int[] arr2 = new int[] { 1, 2, 3, 4, -1, 5 };
            int   rs2  = Program2.Sum(arr2);

            Assert.AreEqual(14, rs2);
        }
예제 #18
0
        public void TestIsContain5()
        {
            int[] Arr1    = new int[] { 1, 2, 3, 4, 5 };
            bool  result1 = Program2.IsContain5(Arr1);

            Assert.AreEqual(true, result1);

            int[] Arr2    = new int[] { 1, 2, 3, 4, 6 };
            bool  result2 = Program2.IsContain5(Arr2);

            Assert.AreEqual(false, result2);
        }
예제 #19
0
        public void Testcount5or6()
        {
            int[] Arr1    = new int[] { 1, 2, 3, 4, 5, 6 };
            int   result1 = Program2.count5or6(Arr1);

            Assert.AreEqual(2, result1);

            int[] Arr2    = new int[] { 1, 2, 3, 4, 7 };
            int   result2 = Program2.count5or6(Arr2);

            Assert.AreEqual(0, result2);
        }
예제 #20
0
 private void Ok_SelectedIndexChanged(object sender, EventArgs e)
 {
     int i = ((ListBox)sender).SelectedIndex;
     if (((Instruction)((ListBox)sender).SelectedItem) != null)
     {
         Program2.SetSelected(((Instruction)((ListBox)sender).SelectedItem).index, true);
     }
     if (i != -1)
     {
         falseNegatives.ClearSelected();
         falsePositives.ClearSelected();
     }
     //Ok.SelectedIndex = i;
     //Ok.SelectedIndex = i;
 }
예제 #21
0
    static void Main(string[] args)
    {
        if (executeProgram2ForEXE)
        {
            string[] arr = { };
            Program2.Main2(arr);
        }
        else
        {
            ReadFromInputFile();
            ReadDataFromOutputFile();
            if (DefectList.Any())
            {
                InsertedSerialCount = new List <string>();
                int tempBugIdAssignedEmail = 0;
                int.TryParse(DefectList.FirstOrDefault().Substring(0, 6), out tempBugIdAssignedEmail); //For Email Bug Assignments/Triage, the first 6chars will be the Bug Id.

                if (DefectList.FirstOrDefault().Contains("Work item Changed"))                         //If it is Autmated TFSIE Email, it will contain the mentioned text
                {
                    FormatOutputFileForTFSIE_EMail();
                }
                else if (tempBugIdAssignedEmail > 100000 && (DefectList.FirstOrDefault().Substring(6, 4) != "\tBug"))
                {
                    FormatOutputFileForAssignedEMail();
                }
                else
                {
                    FormatOutputFileForTFS();
                }

                if (InsertedSerialCount.Count > 0)
                {
                    Console.WriteLine(InsertedSerialCount.Count + " Record(s) Inserted with Generated Serial Count: " + string.Join(", ", InsertedSerialCount));
                }
                else
                {
                    Console.WriteLine("No Records Inserted. The Records might already exist");
                }
            }
            else
            {
                Console.WriteLine("No Records Inserted. Reverify the Input File");
            }
            //var EXEFilePath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
            //System.Diagnostics.Process.Start(EXEFilePath);
            Console.ReadLine();
        }
    }
예제 #22
0
 private void load_Click(object sender, EventArgs e)
 {
     this.Enabled = false;
     comparison   = new Comparison(program1TextBox.Text, program2TextBox.Text);
     ReloadLeft();
     Program1.Refresh();
     ReloadRight();
     ReloadAllFalseNegatives();
     ReloadCorrect();
     Program1.Refresh();
     Program2.Refresh();
     ReloadAllFalseNegatives();
     ReloadCorrect();
     ReloadScore();
     this.Enabled = true;
 }
        static void Main(string[] args)
        {
            int[] SampleNumberArray1 = new int[4];
            SampleNumberArray1[0] = 100;
            SampleNumberArray1[1] = 101;
            SampleNumberArray1[2] = 102;
            SampleNumberArray1[3] = 103;



            Program2.ParamsMethod(); //Notice that this does not shows an error, by writing params in function , writing arguments becomes optional.

            Program2.ParamsMethod(SampleNumberArray1);

            Program2.ParamsMethod(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); //Dynamic - On the fly , no aaray initiation etc. is needed for params method ,2nd use
        }
예제 #24
0
        public void TestCount5or6()
        {
            int[] arr1 = new int[] { 1, 2, 3, 4, 5 };
            int   rs1  = Program2.count5or6(arr1);

            Assert.AreEqual(1, rs1);

            int[] arr2 = new int[] { 1, 2, 3, 4 };
            int   rs2  = Program2.count5or6(arr2);

            Assert.AreEqual(0, rs2);

            int[] arr3 = new int[] { 1, 2, 5, 6, 5 };
            int   rs3  = Program2.count5or6(arr3);

            Assert.AreEqual(3, rs3);
        }
예제 #25
0
        public void TestIsContrain5and6()
        {
            int[] arr1 = new int[] { 1, 2, 3, 4, 5 };
            bool  rs1  = Program2.IsContrain5and6(arr1);

            Assert.AreEqual(false, rs1);

            int[] arr2 = new int[] { 1, 2, 3, 4, 6 };
            bool  rs2  = Program2.IsContrain5and6(arr2);

            Assert.AreEqual(false, rs2);

            int[] arr3 = new int[] { 1, 2, 3, 4, 5, 6 };
            bool  rs3  = Program2.IsContrain5and6(arr3);

            Assert.AreEqual(true, rs3);

            int[] arr4 = new int[] { 1, 2, 3, 4 };
            bool  rs4  = Program2.IsContrain5and6(arr4);

            Assert.AreEqual(false, rs4);
        }
예제 #26
0
        protected ViewCompilationResult CompileView(string fileName)
        {
            var file = fileLoader.GetMarkup(configuration, fileName);

            // parse the document
            var tokenizer = new DothtmlTokenizer();

            tokenizer.Tokenize(file.ContentsReaderFactory());
            var parser = new DothtmlParser();
            var node   = parser.Parse(tokenizer.Tokens);

            var resolvedView = (ResolvedTreeRoot)controlTreeResolver.ResolveTree(node, fileName);

            var errorCheckingVisitor = new ErrorCheckingVisitor();

            resolvedView.Accept(errorCheckingVisitor);

            foreach (var n in node.EnumerateNodes())
            {
                if (n.HasNodeErrors)
                {
                    throw new DotvvmCompilationException(string.Join(", ", n.NodeErrors), n.Tokens);
                }
            }

            var contextSpaceVisitor = new DataContextPropertyAssigningVisitor();

            resolvedView.Accept(contextSpaceVisitor);

            var styleVisitor = new StylingVisitor(configuration);

            resolvedView.Accept(styleVisitor);

            //TODO: fix usage validator
            //var validationVisitor = new ControlUsageValidationVisitor(configuration);
            //resolvedView.Accept(validationVisitor);
            //if (validationVisitor.Errors.Any())
            //{
            //    var controlUsageError = validationVisitor.Errors.First();
            //    throw new DotvvmCompilationException(controlUsageError.ErrorMessage, controlUsageError.Nodes.SelectMany(n => n.Tokens));
            //}

            DefaultViewCompilerCodeEmitter emitter = null;
            string fullClassName = null;

            if (Options.FullCompile)
            {
                var namespaceName = DefaultControlBuilderFactory.GetNamespaceFromFileName(file.FileName, file.LastWriteDateTimeUtc);
                var className     = DefaultControlBuilderFactory.GetClassFromFileName(file.FileName) + "ControlBuilder";
                fullClassName = namespaceName + "." + className;
                emitter       = new CompileTimeCodeEmitter(configuration.ServiceProvider.GetService <RefObjectSerializer>(), ObjectsClassName);
                var compilingVisitor = new ViewCompilingVisitor(emitter, configuration.ServiceProvider.GetService <IBindingCompiler>(), className);

                resolvedView.Accept(compilingVisitor);

                // compile master pages
                if (resolvedView.Directives.ContainsKey("masterPage"))
                {
                    CompileFile(resolvedView.Directives["masterPage"].Single().Value);
                }

                compilation = compilation
                              .AddSyntaxTrees(emitter.BuildTree(namespaceName, className, fileName))
                              .AddReferences(emitter.UsedAssemblies
                                             .Select(a => CompiledAssemblyCache.Instance.GetAssemblyMetadata(a.Key)));
            }

            Program2.WriteInfo($"The view { fileName } compiled successfully.");

            var res = new ViewCompilationResult {
                BuilderClassName = fullClassName,
                ControlType      = resolvedView.Metadata.Type,
                DataContextType  = emitter?.BuilderDataContextType,
                ResolvedTree     = Options.OutputResolvedDothtmlMap ? resolvedView : null
            };

            BuildFileResult(fileName, res);
            return(res);
        }
예제 #27
0
 static void Main(string[] args)
 {
     Program2.Main2(args);
 }
예제 #28
0
        private static void Main(string[] args)
        {
            Console.Title = "Lydian Spoofer 1.3.0";
            Console.SetWindowSize(72, 30);
            if (!File.Exists("Lydian Spoofer 1.3.0.exe.config"))
            {
                Console.WriteLine("[+]Downloading settings files...");
                using (WebClient webClient = new WebClient())
                {
                    webClient.DownloadFile("https://cdn.discordapp.com/attachments/698964774096076833/698965202296635402/LydianSpoofer.exe.config", "Lydian Spoofer 1.3.0.exe.config");
                }
                Thread.Sleep(500);
                FileInfo fileInfo = new FileInfo("Lydian Spoofer 1.3.0.config");
                fileInfo.Attributes = FileAttributes.Hidden;
                MessageBox.Show("Loader needs to restart");
                Environment.Exit(0);
            }
            foreach (Process process in Process.GetProcessesByName("HWIDBypass"))
            {
                process.Kill();
            }
            if (File.Exists("C:\\Users\\Default\\ERDCFVtyb\\NetFresh.kor"))
            {
                if (File.Exists("C:\\Windows\\PPKR$5\\register.xfr"))
                {
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.Write("[+]Pc is registred: ");
                    Thread.Sleep(500);
                    Console.Clear();
                    Console.WriteLine("              Welcome to Lydian Spoofer! @ Copyright 2021");
                    Thread.Sleep(1000);
                    Console.Clear();
                    Program2.startSpoof();
                }
                else
                {
                    Console.Write("[+]Press Enter: ");
                    string key = Console.ReadLine();
                    Console.Clear();
                    Console.WriteLine("[+]Cracked By Rune...");
                    {
                        {
                            SystemSounds.Beep.Play();
                            DirectoryInfo directoryInfo = new DirectoryInfo("c:\\Users\\Default\\AppData\\Local\\Temp\\Chache");
                            if (directoryInfo.Exists)
                            {
                                directoryInfo.Delete(true);
                            }
                        }
                        Console.WriteLine("              Welcome to Lydian Spoofer! @ Copyright 2020");
                        Console.ForegroundColor = ConsoleColor.Green;
                        Console.WriteLine("[+]Cracked By Rune");
                        Thread.Sleep(2000);
                        System.Diagnostics.Process.Start("https://discord.gg/knPQWhDQH8");
                        File.Delete("C:\\Windows\\AMIDEWINx64.exe");
                        File.Delete("C:\\Windows\\amifldrv64.sys");
                        Program2.startSpoof();
                    }
                }
                {
                    Console.Write("[+]Press Enter: ");
                    string key2 = Console.ReadLine();
                    Console.Clear();
                }
            }

            {
                SystemSounds.Beep.Play();
                DirectoryInfo directoryInfo2 = new DirectoryInfo("c:\\Users\\Default\\AppData\\Local\\Temp\\Chache");
                if (directoryInfo2.Exists)
                {
                    directoryInfo2.Delete(true);
                }
            }
            Console.WriteLine("              Welcome to Lydian Spoofer! @ Copyright 2020");
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("[+] Cracked By Rune");
            System.Diagnostics.Process.Start("https://discord.gg/knPQWhDQH8");
            Thread.Sleep(2000);
            File.Delete("C:\\Windows\\AMIDEWINx64.exe");
            File.Delete("C:\\Windows\\amifldrv64.sys");
            Program2.startSpoof();
        }
예제 #29
0
 static void Main(string[] args)
 {
     Program2 = new Program2();
     Console.WriteLine("the longest word is :");
     Console.WriteLine(a.MyFunctionA("Ada Lovelace wrote the first algorithm designed processing by an Analytical Engine."));
 }
예제 #30
0
 // Token: 0x0600003F RID: 63 RVA: 0x00003BD0 File Offset: 0x00001DD0
 private static void Main(string[] args)
 {
     Console.Title = "Loading...";
     Program2.startSpoof();
 }
예제 #31
0
 public static void Test()
 {
     Program2 prog2 = new Program2();
 }