Esempio n. 1
0
        protected ShaderAdapter(
            ComputeShader shader,
            Preset preset,
            bool writeFactors,
            Logger logger   = null,
            double[] angles = null,
            PerformanceReport performanceReport = null
            )
        {
            this.shader       = shader;
            properties        = preset.properties;
            metadata          = preset.metadata;
            this.writeFactors = writeFactors;
            if (logger != null)
            {
                SetLogger(logger);
            }
            if (performanceReport == null)
            {
                var info = PerformanceReport.InputInfo.FromPreset(preset);
                stopwatch = new PerformanceReport(info);
            }
            else
            {
                stopwatch = performanceReport;
            }
            if (angles != null)
            {
                this.angles = angles;
            }

            stopwatch.Start(PerformanceReport.TimeInterval.Category.Total);
            InitSharedFields();
        }
Esempio n. 2
0
        public void AddReport(int _ID, int _ChequeID, PerformanceReport report)
        {
            Customer customer = null;

            if (this.items.TryGetValue(_ID, out customer))
            {
                customer.AddReport(_ChequeID, report);
            }
        }
Esempio n. 3
0
 public PointModeAdapter(ComputeShader shader, Preset preset, bool writeFactors, Logger customLogger,
                         double[] angles, PerformanceReport performanceReport)
     : base(shader, preset, writeFactors, customLogger, angles, performanceReport)
 {
     if (logger == null)
     {
         SetLogger(customLogger);
     }
     logger.Log(Logger.EventType.Class, $"{nameof(PointModeAdapter)} created.");
     InitializeOtherFields();
 }
Esempio n. 4
0
        public void TestGsPerformanceReportRunningBacksWeek12()
        {
            var pr   = new PerformanceReport(season: "2012", week: 12);
            var week = new NFLWeek(seasonIn: 2012, weekIn: 12, loadGames: false);
            var gs   = new GS4Scorer(week)
            {
                ScoresOnly = true, Master = new GridStatsMaster("GridStats", "GridStats.xml")
            };

            pr.Scorer = gs;
            pr.Render(catCode: "2", sPos: "RB", leagueId: Constants.K_LEAGUE_Gridstats_NFL1, startersOnly: true);
            Assert.IsTrue(File.Exists(pr.FileOut), string.Format("Cannot find {0}", pr.FileOut));
        }
Esempio n. 5
0
        public void TestEspnPerformanceReportRunningBacksWeek5()
        {
            var pr   = new PerformanceReport(season: "2012", week: 5);
            var week = new NFLWeek(seasonIn: 2012, weekIn: 5, loadGames: false);
            var gs   = new EspnScorer(week)
            {
                ScoresOnly = true
            };

            pr.Scorer = gs;
            pr.Render(catCode: "2", sPos: "RB", leagueId: Constants.K_LEAGUE_Yahoo, startersOnly: true);
            Assert.IsTrue(File.Exists(pr.FileOut), string.Format("Cannot find {0}", pr.FileOut));
        }
Esempio n. 6
0
    public void Compute(Preset preset, Logger logger, PerformanceReport report, bool write = false,
                        double[] angles = null)
    {
        const string method = nameof(Compute);

        logger.Log(Logger.EventType.Info, $"{Scope(method)}: Shader adapter built." +
                   $" preset set to = {mainPanel.preset}");
        _shaderAdapter = _builder
                         .SetLogger(logger)
                         .SetWriteFactors(write)
                         .SetPerformanceReport(report)
                         .SetProperties(preset)
                         .SetAngles(angles)
                         .AutoSetShader()
                         .Build();
        _shaderAdapter.SetStatus(ref status);
        _shaderAdapter.Execute();
    }
Esempio n. 7
0
        static void Main(string[] args)
        {
            var authenticationServiceClient = new AuthenticationServiceClient();
            var authToken = authenticationServiceClient.ClientLogin(Environment.GetEnvironmentVariable("SIZMEK_USERNAME"), Environment.GetEnvironmentVariable("SIZMEK_PASSWORD"), Environment.GetEnvironmentVariable("SIZMEK_APP_KEY"));

            var advertiserService = new AdvertiserServiceClient();

            var paging = new AdvertiserService.ListPaging()
            {
                PageIndex = 0,
                PageSize  = 99999
            };

            var paging2 = new CampaignService.ListPaging()
            {
                PageIndex = 0,
                PageSize  = 99999
            };

            var totalCount = 0;

            var advertisers = advertiserService.GetAdvertisers(authToken, null, paging, true, out totalCount);

            foreach (var advertiser in advertisers)
            {
                var campaignService = new CampaignServiceClient();

                var campaigns = campaignService.GetCampaigns(authToken, null, paging2, true, out totalCount);

                foreach (var campaign in campaigns)
                {
                    var conversionTagFilters = new List <ConversionTagsFilter>();

                    conversionTagFilters.Add(new ConversionTagCampaignFilter()
                    {
                        CampaignID = campaign.ID
                    });

                    var conversionTags = advertiserService.GetConversionTags(authToken, (uint)advertiser.ID, conversionTagFilters, paging, true, out totalCount);

                    if (conversionTags.Count > 0)
                    {
                        var analyticsDataService = new AnalyticsDataServiceClient();
                        var report     = new PerformanceReport();
                        var reportBase = new ReportBase();

                        report.CampaignID = campaign.ID;

                        report.ReportStartDate       = new AnalyticsDataService.APIDateTime();
                        report.ReportStartDate.Day   = campaign.CampaignExtendedInfo.StartDate.Day;
                        report.ReportStartDate.Month = campaign.CampaignExtendedInfo.StartDate.Month;
                        report.ReportStartDate.Year  = campaign.CampaignExtendedInfo.StartDate.Year;

                        report.ReporEndtDate       = new AnalyticsDataService.APIDateTime();
                        report.ReporEndtDate.Day   = campaign.CampaignExtendedInfo.EndDate.Day;
                        report.ReporEndtDate.Month = campaign.CampaignExtendedInfo.EndDate.Month;
                        report.ReporEndtDate.Year  = campaign.CampaignExtendedInfo.EndDate.Year;

                        reportBase = report;

                        analyticsDataService.InitiateReportJob(authToken, ref reportBase);

                        var reportStatus = analyticsDataService.GetReportJobStatus(authToken, report);

                        while (reportStatus != JobStatus.Completed)
                        {
                            reportStatus = analyticsDataService.GetReportJobStatus(authToken, report);
                        }

                        var reportUrl = analyticsDataService.GetReportAsURL(authToken, report);
                    }
                }
            }
        }
 public static void PrintSortingReport(PerformanceReport Report)
 {
     //foreach (int singleNumber in (int[])Report.Result)
     //Console.Write("{0}\t", singleNumber);
     Console.WriteLine("Elapsed time: {0}\n", Report.ElapsedTime.TotalMilliseconds);
 }
Esempio n. 9
0
        private static void OutputToHtml(string bd, List <FileDigests> digests, List <CCR> results, PerformanceReport perfReport)
        {
            var xd = XDocument.Load("output.template.html");

            using (var sw = new StreamWriter("output.html", false, System.Text.Encoding.UTF8))
                using (var xw = XmlWriter.Create(sw, new XmlWriterSettings()
                {
                    OmitXmlDeclaration = true,
                    CheckCharacters = false
                }))
                {
                    var js = new JsonSerializer();
                    using (var aw = new StringWriter())
                    {
                        aw.Write("output(");
                        js.Serialize(aw, digests.Select(d => new { path = GetShortPath(bd, d), url = new Uri(d.fi.FullName).ToString() }));
                        aw.Write(",");
                        js.Serialize(aw, results.Select(r => new { r.i, r.j, ccr = r.m }));
                        aw.Write(",");
                        js.Serialize(aw, new { report = perfReport?.ToString() ?? "" });
                        aw.Write(")");

                        xd.Descendants("{http://www.w3.org/1999/xhtml}body").First().SetAttributeValue("onload", aw);
                    }

                    xd.Save(xw);
                }

            Process.Start("output.html");
        }
Esempio n. 10
0
        private static void OutputToConsole(string bd, List <FileDigests> digests, List <CCR> results, PerformanceReport perfReport)
        {
            foreach (var d in digests.OrderBy(d => d.fi.FullName, StringComparer.CurrentCultureIgnoreCase))
            {
                Console.WriteLine(GetShortPath(bd, d));
                Console.WriteLine(d.BitmapSourceHash);
            }
            Console.WriteLine();

            Console.WriteLine("Hit any key to continue..");
            Console.ReadKey();

            if (digests.Count > 1)
            {
                foreach (var r in results)
                {
                    var d1 = digests[r.i];
                    var d2 = digests[r.j];
                    Console.WriteLine(GetShortPath(bd, d1));
                    Console.WriteLine(GetShortPath(bd, d2));
                    Console.WriteLine(r.m.ToString("f7"));
                }
            }

            if (perfReport != null)
            {
                Console.WriteLine(perfReport.ToString());
            }

            Console.WriteLine("Hit any key to exit..");
            Console.ReadKey();
        }
Esempio n. 11
0
        private static void Main(string[] args)
        {
            #region Prototype Desing Pattern

            Car proptotype = new Car()
            {
                m_Name         = "Mercedes",
                m_Velocity     = 260,
                m_Acceleration = 10
            };

            Car copy1 = (Car)proptotype.Clone();
            copy1.m_Name         = "Audi";
            copy1.m_Velocity     = 240;
            copy1.m_Acceleration = 20;

            Car copy2 = (Car)proptotype.Clone();
            copy2.m_Name         = "Opel";
            copy2.m_Velocity     = 260;
            copy2.m_Acceleration = 5;


            CarToRace racingCars = new CarToRace()
            {
                proptotype, copy1, copy2
            };

            List <Car> result = racingCars.Race();

            #endregion Prototype Desing Pattern

            #region BuilderDesignPattern

            MessageCreator creator         = new MessageCreator();
            Message        birthdayMessage = creator.Create(new BirthdayMessageBuilder());

            #endregion

            #region Singleton Desing Pattern

            DBHelper test_1 = DBHelper.CreateDBHelper("test");

            DBHelper test_2 = DBHelper.CreateDBHelper("test_2");

            #endregion

            #region FactoryDesignPattern



            #endregion

            #region CommandDesignPattern

            //Person Kisi = new Person { PersonID = 1, Name = "Ahmet" };

            //ReceiverPerson rk1 = new ReceiverPerson(Kisi);

            //CommadPerson ckAdd = new ConcreteCommandAddPerson(rk1);
            //CommadPerson ckSil = new ConcreteCommandDelete(rk1);
            //CommadPerson ckCreate = new ConcreteCommandCreate(rk1);
            //CommadPerson ckUpdate = new ConcreteCommandUpdate(rk1);


            //InvokerPerson ik = new InvokerPerson();

            //ik.CommandList.Add(ckAdd);
            //ik.CommandList.Add(ckSil);
            //ik.CommandList.Add(ckCreate);
            //ik.CommandList.Add(ckUpdate);


            //ik.ExecuteAll();

            //System.Console.ReadKey();

            #endregion

            #region StrategyDesignPattern

            Personnel personnel = new Personnel(new CalculateEngineerSalary(), new CalculateDeptBPermit());

            int engineerSalary = personnel.m_PersonnelSalary.CalculateSalary();
            int engineerPermit = personnel.m_PersonnelPermit.CalculatePermit();

            personnel = new Personnel(new CalculateManagerSalary(), new CalculateDeptAPermit());
            int managerSalary = personnel.m_PersonnelSalary.CalculateSalary();
            int managerPermit = personnel.m_PersonnelPermit.CalculatePermit();

            #endregion

            #region ObserverDesignPattern
            //test

            #endregion

            #region BridgeDesignPattern

            Rapor rapor = new SalesReport(new DesktopFormat());

            string resultBridge = rapor.Display();

            rapor        = new PerformanceReport(new MobileFormat());
            resultBridge = rapor.Display();

            #endregion
        }
Esempio n. 12
0
 public ShaderAdapterBuilder SetPerformanceReport(PerformanceReport report)
 {
     _report = report;
     return(this);
 }