コード例 #1
0
 public string writeModel(string outModelPath)
 {
     outPath = outModelPath;
     using (System.IO.StreamWriter sw = new System.IO.StreamWriter(outPath))
     {
         sw.WriteLine(modelTypes.GLM.ToString());
         sw.WriteLine(InTablePath);
         sw.WriteLine(String.Join(",", IndependentFieldNames));
         sw.WriteLine(String.Join(",", DependentFieldNames));
         sw.WriteLine(String.Join(",", ClassFieldNames));
         sw.WriteLine(SampleSize.ToString());
         sw.WriteLine(NumberOfVariables.ToString());
         sw.WriteLine(Iterations.ToString());
         sw.WriteLine(DeltaC.ToString());
         sw.WriteLine(LogLikelihood);
         sw.WriteLine(LogLikelihoodratio);
         sw.WriteLine(PValue.ToString());
         sw.WriteLine(Deviance.ToString());
         sw.WriteLine(ChiSquare.ToString());
         sw.WriteLine(linkfunction.ToString());
         sw.WriteLine(String.Join(" ", (from double d in Coefficients select d.ToString()).ToArray()));
         sw.WriteLine(String.Join(" ", (from double d in StdError select d.ToString()).ToArray()));
         sw.WriteLine(String.Join(" ", (from double d in waldTestValues select d.ToString()).ToArray()));
         sw.WriteLine(String.Join(" ", (from double d in waldTestPValues select d.ToString()).ToArray()));
         sw.WriteLine(String.Join(" ", (from double d in minValues select d.ToString()).ToArray()));
         sw.WriteLine(String.Join(" ", (from double d in maxValues select d.ToString()).ToArray()));
         sw.WriteLine(String.Join(" ", (from double d in sumValues select d.ToString()).ToArray()));
         sw.Close();
     }
     return(outPath);
 }
コード例 #2
0
        public static void createiteration(string ddlmap, string NewIteration)
        {
            Iterations ipage = new Iterations();

            AppDriver.driver.FindElement(By.LinkText("Package Entities")).Click();
            AppDriver.driver.FindElement(By.LinkText("Experiments")).Click();
            AppDriver.driver.FindElement(By.LinkText("Create New")).Click();
            AppDriver.driver.FindElement(By.Name("MarketingAssetPackageId")).selectdropdowntext(ddlmap);
            ipage.ExperimentName.SendKeys(NewIteration);
            //ipage.RequiredDurationForSignificance.SendKeys("week");
            //ipage.IterationNumber.SendKeys("10");
            //ipage.StartDateTime.Clear();
            //ipage.StartDateTime.SendKeys("13/04/2017");
            //ipage.EndDateTime.Clear();
            //ipage.EndDateTime.SendKeys("16/12/2019");
            ipage.SuccessOutcome.SendKeys("10");
            ipage.FailureOutcome.SendKeys("5");
            IJavaScriptExecutor js = (IJavaScriptExecutor)AppDriver.driver;

            js.ExecuteScript("javascript:window.scrollBy(0,-250)");
            ipage.SaveExperiment.Click();
            AppDriver.driver.FindElement(By.LinkText("Back to List")).Click();

            Assert.IsTrue(AppDriver.driver.PageSource.Contains(NewIteration));
        }
コード例 #3
0
 public void getReport(double alpha)
 {
     Forms.RunningProcess.frmRunningProcessDialog rd = new Forms.RunningProcess.frmRunningProcessDialog(false);
     rd.Text               = "GLM Results";
     rd.TopLevel           = true;
     rd.pgbProcess.Visible = false;
     rd.FormBorderStyle    = System.Windows.Forms.FormBorderStyle.Sizable;
     rd.addMessage("Dependent field = " + DependentFieldNames[0]);
     rd.addMessage("Independent fields = " + String.Join(", ", IndependentFieldNames));
     rd.addMessage("Sample size = " + SampleSize.ToString());
     rd.addMessage("Iteration = " + Iterations.ToString());
     rd.addMessage("Delta Convergence " + DeltaC.ToString());
     rd.addMessage("Chi-Sqr = " + ChiSquare.ToString() + " p-value = " + PValue.ToString());
     rd.addMessage("Deviance = " + Deviance.ToString());
     rd.addMessage("Log Likelihood = " + LogLikelihood.ToString());
     rd.addMessage("Log Likelihood Ratio = " + LogLikelihoodratio.ToString() + "\n\nCoefficents and standard errors:\n");
     rd.addMessage("Param: Intercept, " + String.Join(", ", IndependentFieldNames));
     rd.addMessage("Coef:  " + string.Join(", ", (from double d in Coefficients select d.ToString()).ToArray()));
     rd.addMessage("STE:   " + string.Join(", ", (from double d in StdError select d.ToString()).ToArray()) + "\n");
     try
     {
         if (ModelHelper.chartingAvailable() && System.Windows.Forms.MessageBox.Show("Do you want to build distribution graphs?", "Graphs", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
         {
             createRegChart();
         }
     }
     catch
     {
         System.Windows.Forms.MessageBox.Show("Cannot create charts.");
     }
     rd.Show();
     rd.enableClose();
 }
コード例 #4
0
        private async void Refresh(object sender, RoutedEventArgs e)
        {
            _iterations = await Logic.GetTeamIterations(GlobalSettings.Instance.Team?.TeamId);

            Iterations.Clear();
            foreach (var iteration in _iterations)
            {
                if (iteration.Value.TimeFrame != "past")
                {
                    Iterations.Add(iteration.Value.Name);
                }
                if (iteration.Value.Attributes.TimeFrame == "current")
                {
                    CurrentIteration = iteration.Value.Name;
                }
            }

            var result = await Logic.GetWorkItemsByQuery(false);

            if (result != null)
            {
                _workItems          = result.WorkItems;
                _completedWorkItems = result.CompletedWorkItems;
                _auditIssues        = result.AuditIssues;
                OnCurrentIterationChanged();

                foreach (var completed in _completedWorkItems.Union(_workItems))
                {
                    var notes = completed.Notes;
                }
            }
        }
コード例 #5
0
        private double GetPositionX(ref Point start, double relPosition)
        {
            double resX;

            if (relPosition == 0)
            {
                resX = start.X;
            }
            else if (relPosition == 1)
            {
                resX = this.EndPoint.X;
            }
            else
            {
                var param = new IterParams()
                {
                    Length = relPosition * GetLength(ref start), StartX = start.X
                };
                Iterations.NewtonMethod(
                    delegate(double x, IterParams p)
                {
                    var l1 = EvaluateLengthIntegral(p.StartX);
                    var l2 = EvaluateLengthIntegral(x);
                    return(Math.Abs(l1 - l2) - p.Length);
                },
                    param,
                    ////EndPoint.X, ... this is for secant method
                    start.X + (relPosition * (EndPoint.X - start.X)),
                    1e-6,
                    out resX);
            }

            return(resX);
        }
コード例 #6
0
        protected override async Task <Action <AsyncCodeActivityContext> > ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken)
        {
            // Inputs
            var key        = Key.Get(context);
            var encoding   = Encoding.Get(context);
            var iterations = Iterations.Get(context);

            var inDt        = DataTable.Get(context);
            var dataColumns = DataTableHelper.IdentifyDataColumns(inDt, ColumnIndexes?.Get(context), ColumnNames?.Get(context));
            var outDt       = DataTableHelper.NewCryptoDataTable(inDt, dataColumns);

            using (var crypto = new Crypto(Algorithm, encoding, iterations))
            {
                outDt.BeginLoadData();

                AddToDataTable(inDt, outDt, dataColumns, key, crypto);

                outDt.AcceptChanges();
                outDt.EndLoadData();
            }

            var sortBy = Sort.Get(context);

            if (sortBy != null)
            {
                outDt.DefaultView.Sort = sortBy;
                outDt = outDt.DefaultView.ToTable();
            }

            // Outputs
            return((ctx) => Result.Set(ctx, outDt));
        }
コード例 #7
0
        public override bool TryParse()
        {
            if (!base.TryParse())
            {
                return(false);
            }

            // try to parse the second level report nodes, the type shall be 'iteration' for GUI test
            Iterations.Clear();
            ReportNodeType[] childNodes = Node.ReportNode;
            if (childNodes != null)
            {
                foreach (ReportNodeType node in childNodes)
                {
                    IterationReport iteration = Iterations.TryParseAndAdd(node, this.Node);
                    if (iteration != null)
                    {
                        AllStepsEnumerator.Merge(iteration.AllStepsEnumerator);
                        continue;
                    }
                }
            }
            if (Iterations.Length == 0)
            {
                // no iteration node is parsed successfully under testrun node,
                // it might because the GUI test is run with one iteration only
                // which omits the iteration node in the report Xml
                // here create a temporary iteration node so that the nodes read from the Xml
                // can be processed properly
                ReportNodeType iterationNode = new ReportNodeType
                {
                    type = "Iteration",
                    Data = new DataType
                    {
                        Name              = "Action0",
                        IndexSpecified    = true,
                        Index             = 1,
                        Result            = "Done",
                        StartTime         = Node.Data.StartTime,
                        DurationSpecified = Node.Data.DurationSpecified,
                        Duration          = Node.Data.Duration
                    },
                    ReportNode = Node.ReportNode
                };
                IterationReport iteration = Iterations.TryParseAndAdd(iterationNode, this.Node);
                if (iteration != null)
                {
                    AllStepsEnumerator.Merge(iteration.AllStepsEnumerator);
                }

                if (Iterations.Length == 0)
                {
                    // failed to parse at least one iteration, not a valid GUI test
                    return(false);
                }
            }

            return(true);
        }
コード例 #8
0
 private void Clean() {
     this.Sysid = null;
     this.Iterationsysid = null;
     this.Tag = string.Empty;
     this.Createdate = null;
     this.Active = null;
     this.Iterations = null;
 }
コード例 #9
0
        public ActionResult DeleteConfirmed(string id)
        {
            Iterations iterations = db.Iterations.Find(id);

            db.Iterations.Remove(iterations);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #10
0
 internal bool EqualsParameters(DnsResourceDataNextDomainSecure3Base other)
 {
     return(other != null &&
            HashAlgorithm.Equals(other.HashAlgorithm) &&
            Flags.Equals(other.Flags) &&
            Iterations.Equals(other.Iterations) &&
            Salt.Equals(other.Salt));
 }
コード例 #11
0
 /// <summary>
 /// Create a <see cref="For"/> with the specified <see cref="CodeObject"/> in the body.
 /// </summary>
 public For(LocalDecl initialization, Expression conditional, Expression iteration)
 {
     Initialization = initialization;
     Conditional    = conditional;
     if (iteration != null)
     {
         Iterations.Add(iteration);
     }
 }
コード例 #12
0
        public void Iterations_Factorial_Test7()
        {
            var n = 6;

            var expected = 720;
            var actual   = Iterations.Factorial(n);

            Assert.AreEqual(expected, actual);
        }
コード例 #13
0
        public void ShouldHaveDefaultInitParameters()
        {
            // given . when
            var initialConditionComponent = new Iterations <object>();

            // then
            initialConditionComponent.Items.Should().BeNull();
            initialConditionComponent.ChildContent.Should().BeNull();
        }
コード例 #14
0
 private void Clean() {
     this.Sysid = null;
     this._iterationsysid = null;
     this.Createdate = null;
     this.Lastmodifieddate = null;
     this.Description = string.Empty;
     this.Iterationnumber = string.Empty;
     this.Iterations = null;
 }
コード例 #15
0
 void engine_IterationStarting(RunContext context, uint currentIteration, uint?totalIterations)
 {
     if (context.controlIteration && context.controlRecordingIteration)
     {
         // Starting to record
         _iterations = new Iterations();
         _count      = 0;
     }
 }
コード例 #16
0
    public GameObject PastSelf; //Past character prefab passed to this script in editor

    // Use this for initialization
    void Start()
    {
        Cursor.lockState = CursorLockMode.Locked; // Hide mouse

        allRec  = new Iterations();               //Instantiate data structures
        currRec = new Iteration();

        character = this.transform.parent.gameObject; //Player Object is parent of Camera this is attached to.
    }
コード例 #17
0
 private void Clean() {
     this.Sysid = null;
     this.Publicid = null;
     this._iterationsysid = null;
     this.Keypath = string.Empty;
     this.Keyvalue = string.Empty;
     this.Active = null;
     this.Iterations = null;
 }
コード例 #18
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked {
         int hashCode = Iterations.GetHashCode();
         hashCode = (hashCode * 397) ^ Blocks.GetHashCode();
         hashCode = (hashCode * 397) ^ Parallelism.GetHashCode();
         return(hashCode);
     }
 }
コード例 #19
0
        public void IterationRegisterTest()
        {
            SprintConfiguratorCLI.CommandLineOption = SprintGeneratorOptions;
            var iteration = new Iterations(SprintGeneratorOptions);

            var result = iteration.RegisterIterations();

            Assert.IsTrue(result.Result, $"Failed to Authentication for {SprintGeneratorOptions.Url}");
        }
コード例 #20
0
ファイル: Character.cs プロジェクト: hmhall/Paraducks
    // Use this for initialization
    void Start()
    {
        Cursor.lockState = CursorLockMode.Locked; // Hide mouse

        allRec  = new Iterations();               //Instantiate data structures
        currRec = new Iteration();

        character = this.gameObject;                             //Player Object is object this script is attached to
        view      = character.GetComponentInChildren <Camera>(); //Player view, child of player object
    }
コード例 #21
0
 /// <summary>
 /// Create a <see cref="For"/> with the specified <see cref="CodeObject"/> in the body.
 /// </summary>
 public For(LocalDecl initialization, Expression conditional, Expression iteration, CodeObject body)
     : base(body, true)
 {
     Initialization = initialization;
     Conditional    = conditional;
     if (iteration != null)
     {
         Iterations.Add(iteration);
     }
 }
コード例 #22
0
        public void NothingTeamTest()
        {
            SprintGeneratorOptions.Team             = "NotExistTeam";
            SprintConfiguratorCLI.CommandLineOption = SprintGeneratorOptions;

            var iteration = new Iterations(SprintGeneratorOptions);

            var result = iteration.RegisterIterations();

            Assert.IsFalse(result.Result);
        }
コード例 #23
0
 public override string ToString()
 {
     if (Success)
     {
         return(string.Format("{0}\r\n\r\n{1}", string.Join("\r\n", Iterations.ToList()), Comment));
     }
     else
     {
         return(Comment);
     }
 }
コード例 #24
0
        public void NothingUrlTest()
        {
            SprintGeneratorOptions.Url = "https://nothing.exsample.com";
            SprintConfiguratorCLI.CommandLineOption = SprintGeneratorOptions;

            var iteration = new Iterations(SprintGeneratorOptions);

            var result = iteration.RegisterIterations();

            Assert.IsFalse(result.Result, $"Failed to Authentication for {SprintGeneratorOptions.Url}");
        }
コード例 #25
0
 /// <summary>
 /// Create a <see cref="For"/> with the specified <see cref="CodeObject"/> in the body.
 /// </summary>
 public For(Expression initialization, Expression conditional, Expression iteration)
 {
     if (initialization != null)
     {
         Initializations.Add(initialization);
     }
     Conditional = conditional;
     if (iteration != null)
     {
         Iterations.Add(iteration);
     }
 }
コード例 #26
0
        public async Task CreatePoll(params string[] Parameters)
        {
            if (Context.Message.Author.Id != 193255051807031296 &&
                (!Iterations.HasRole((SocketGuildUser)Context.User, "Mod") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Admin") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Junior Dev") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Supervisor") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Owner")))
            {
                await Context.Message.Channel.SendMessageAsync("Permission Denied.");

                return;
            }

            if (!Parameters[0].StartsWith("<"))
            {
                await Context.Channel.SendMessageAsync("You must surround the parameters of this command in <> to ensure the bot can insert the full Poll Name and Poll Options!");
            }

            List <string> arguments = new List <string>();

            StringBuilder temp = new StringBuilder();

            foreach (string arg in Parameters.ToList())
            {
                if (arg.EndsWith(">"))
                {
                    temp.Append(arg);

                    arguments.Add(temp.ToString().Replace("<", "").Replace(">", ""));

                    temp.Clear();
                }
                else
                {
                    temp.Append(arg + " ");
                }
            }

            string PollName         = arguments[0];
            string PollOptionString = "";

            int index = 1;

            foreach (string PollOption in arguments.GetRange(1, (arguments.Count - 1)))
            {
                PollOptionString += (index++) + ": " + PollOption + "\n";
            }

            polls.Add(new Poll((polls.Count + 1), PollName, arguments.GetRange(1, (arguments.Count - 1)).ToArray()));

            await Context.Channel.SendMessageAsync("Poll Created: " + "ID: " + polls.Count + " Name: " + PollName + "\n" + PollOptionString);
        }
コード例 #27
0
        /// <summary>
        /// Password-Based Key Derivation Function 2
        /// https://github.com/defuse/password-hashing
        /// </summary>
        public override void Execute()
        {
            Verified = false;

            if (Salt != null && !string.IsNullOrEmpty(HashAlgorithm))
            {
                var passwordHash = GetHash(
                    Login,
                    Password,
                    Salt,
                    HashAlgorithm,
                    Iterations,
                    PasswordHashLength);

                Hash = string.Join(DELIMITER.ToString(), new string[]
                {
                    HashAlgorithm,
                    Iterations.ToString(),
                    PasswordHashLength.ToString(),
                    Convert.ToBase64String(Salt),
                    Convert.ToBase64String(passwordHash)
                });
            }
            else
            {
                Hash = null;
            }

            if (!string.IsNullOrEmpty(ToVerify) /*&& !string.IsNullOrEmpty(Login)*/ && !string.IsNullOrEmpty(Password))
            {
                var split = ToVerify.Split(DELIMITER);
                var hash  = Convert.FromBase64String(split[PASSWORD_HASH_INDEX]);

                var storedHashSize = Int32.Parse(split[PASSWORD_HASH_BYTES_INDEX]);
                if (storedHashSize == hash.Length)
                {
                    var computedHash = GetHash(
                        Login,
                        Password,
                        Convert.FromBase64String(split[SALT_INDEX]),
                        split[HASH_ALGORITHM_INDEX],
                        Int32.Parse(split[PBKDF2_ITERATIONS_INDEX]),
                        hash.Length);

                    Verified = SlowEquals(hash, computedHash);
                }
            }
            else
            {
                Verified = false;
            }
        }
コード例 #28
0
 public override string[] GetInputs()
 {
     return(new string[]
     {
         $"{ nameof(Login) }:{ Login }",
         $"{ nameof(Password) }:{ Password }",
         $"{ nameof(Iterations) }:{ Iterations.ToString() }",
         $"{ nameof(PasswordHashLength) }:{ PasswordHashLength.ToString() }",
         // Salt,
         $"{ nameof(Salt) }.Length:{ (Salt?.Length ?? 0).ToString() }",
         $"{ nameof(ToVerify) }:{ ToVerify }",
     });
 }
コード例 #29
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            for (int i = 0; i < Iterations.GetFirstValue(payload.Data); i++)
            {
                Counter.SetValue(i, payload.Data);

                var iterator = Router.TransmitAll(payload);
                while (iterator.MoveNext())
                {
                    yield return(null);
                }
            }
        }
コード例 #30
0
 public ActionResult Create([Bind(Include = "IterationID,IterationName,IterationDescription,IterationStartDate,IterationEndDate,IterationProjectID")] Iterations iterations)
 {
     iterations.IterationID = Guid.NewGuid().ToString();
     if (ModelState.IsValid && Overlap(iterations) == false)
     {
         db.Iterations.Add(iterations);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Projects = GetProjects();
     ModelState.AddModelError("", "Dates overlapping one or more current iterations.");
     return(View(iterations));
 }
コード例 #31
0
        protected override void Execute(NativeActivityContext context)
        {
            var exitBookmark = context.CreateBookmark(OnExit, BookmarkOptions.NonBlocking);

            context.Properties.Add(Exit.Bookmark, exitBookmark);

            var nextBookmark = context.CreateBookmark(OnNext, BookmarkOptions.MultipleResume | BookmarkOptions.NonBlocking);

            context.Properties.Add(Next.Bookmark, nextBookmark);

            _totalIterations = Iterations.Get(context);

            ExecuteNext(context);
        }
コード例 #32
0
        private async Task GetIterationsAsync()
        {
            Iterations.Clear();
            var iterations = await _training.GetTrainedIterationsAysnc();

            foreach (var i in iterations)
            {
                Iterations.Add(i);
            }


            SelectedIteration = (Iterations.Count > 0) ? Iterations[0] : null;
            DownloadModel.RaiseCanExecuteChanged();
        }
コード例 #33
0
        // GET: Iterations/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Iterations iteration = db.Iterations.Find(id);

            if (iteration == null)
            {
                return(HttpNotFound());
            }
            return(View(iteration));
        }
コード例 #34
0
 public static Iterations Load(System.Nullable<int> SysId) {
     resourceSchema.Dal.Iterations dbo = null;
     try {
         dbo = new resourceSchema.Dal.Iterations();
         System.Data.DataSet ds = dbo.Iterations_Select_One(SysId);
         Iterations obj = null;
         if (GlobalTools.IsSafeDataSet(ds)) {
             if ((ds.Tables[0].Rows.Count > 0)) {
                 obj = new Iterations();
                 obj.Fill(ds.Tables[0].Rows[0]);
             }
         }
         return obj;
     }
     catch (System.Exception ) {
         throw;
     }
     finally {
         if ((dbo != null)) {
             dbo.Dispose();
         }
     }
 }
コード例 #35
0
 public static IterationsCollection GetAll() {
     resourceSchema.Dal.Iterations dbo = null;
     try {
         dbo = new resourceSchema.Dal.Iterations();
         System.Data.DataSet ds = dbo.Iterations_Select_All();
         IterationsCollection collection = new IterationsCollection();
         if (GlobalTools.IsSafeDataSet(ds)) {
             for (int i = 0; (i < ds.Tables[0].Rows.Count); i = (i + 1)) {
                 Iterations obj = new Iterations();
                 obj.Fill(ds.Tables[0].Rows[i]);
                 if ((obj != null)) {
                     collection.Add(obj);
                 }
             }
         }
         return collection;
     }
     catch (System.Exception ) {
         throw;
     }
     finally {
         if ((dbo != null)) {
             dbo.Dispose();
         }
     }
 }
コード例 #36
0
 private void Clean() {
     this.Sysid = null;
     this.Publicid = null;
     this._parentiterationsysid = null;
     this._childiterationsysid = null;
     this.Linkpath = string.Empty;
     this.Createdate = null;
     this.Lastmodifieddate = null;
     this.Active = null;
     this.Iterations = null;
     this.Iterations2 = null;
 }