protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Islogged"] == null)
        {
            Response.Redirect("~/VisitorPages/HomeVisitor.aspx");
        }

        if (Session["IsLogged"].ToString() != "LoggingCorrectly") // more protect than Session["IsLogged] != null.
        {
            Response.Redirect("~/VisitorPages/HomeVisitor.aspx");
        }

        if (IsPostBack)
        {
            if (DocDList.Items.Count == 0)
            {
                return;
            }

            DataClassesDataContext dc = new DataClassesDataContext();
            var countOfStep           = from step in dc.WorkflowDocuments
                                        join doc in dc.Documents on step.IdDoc equals doc.IdDoc
                                        where doc.IdDoc == int.Parse(DocDList.SelectedValue)
                                        group step by step.IdDoc into NumSteps
                                        select new
            {
                countOfWorkflow = NumSteps.Count()
            };
            int count = 0;
            if (countOfStep.Count() > 0)
            {
                foreach (var v in countOfStep)
                {
                    count = v.countOfWorkflow;         // get the number of workflow.
                }
            }
            StepLabel.Text     = (count + 1).ToString();
            ViewState["Count"] = count;
        }
    }
示例#2
0
 public override string ToString() =>
 $"{NumSteps.ToString("e")},{FullTime},{HalfwayDiff.ToString("e")},{FullDiff.ToString("e")}," +
 $"{EnergyFluctuation.ToString("e")},{RadiusFluctuation.ToString("e")}";
示例#3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (BatchSize != 0)
            {
                hash ^= BatchSize.GetHashCode();
            }
            hash ^= dataAugmentationOptions_.GetHashCode();
            if (SyncReplicas != false)
            {
                hash ^= SyncReplicas.GetHashCode();
            }
            if (KeepCheckpointEveryNHours != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(KeepCheckpointEveryNHours);
            }
            if (optimizer_ != null)
            {
                hash ^= Optimizer.GetHashCode();
            }
            if (GradientClippingByNorm != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(GradientClippingByNorm);
            }
            if (FineTuneCheckpoint.Length != 0)
            {
                hash ^= FineTuneCheckpoint.GetHashCode();
            }
            if (FineTuneCheckpointType.Length != 0)
            {
                hash ^= FineTuneCheckpointType.GetHashCode();
            }
            if (FromDetectionCheckpoint != false)
            {
                hash ^= FromDetectionCheckpoint.GetHashCode();
            }
            if (LoadAllDetectionCheckpointVars != false)
            {
                hash ^= LoadAllDetectionCheckpointVars.GetHashCode();
            }
            if (NumSteps != 0)
            {
                hash ^= NumSteps.GetHashCode();
            }
            if (StartupDelaySteps != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StartupDelaySteps);
            }
            if (BiasGradMultiplier != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BiasGradMultiplier);
            }
            hash ^= updateTrainableVariables_.GetHashCode();
            hash ^= freezeVariables_.GetHashCode();
            if (ReplicasToAggregate != 0)
            {
                hash ^= ReplicasToAggregate.GetHashCode();
            }
            if (BatchQueueCapacity != 0)
            {
                hash ^= BatchQueueCapacity.GetHashCode();
            }
            if (NumBatchQueueThreads != 0)
            {
                hash ^= NumBatchQueueThreads.GetHashCode();
            }
            if (PrefetchQueueCapacity != 0)
            {
                hash ^= PrefetchQueueCapacity.GetHashCode();
            }
            if (MergeMultipleLabelBoxes != false)
            {
                hash ^= MergeMultipleLabelBoxes.GetHashCode();
            }
            if (UseMulticlassScores != false)
            {
                hash ^= UseMulticlassScores.GetHashCode();
            }
            if (AddRegularizationLoss != false)
            {
                hash ^= AddRegularizationLoss.GetHashCode();
            }
            if (MaxNumberOfBoxes != 0)
            {
                hash ^= MaxNumberOfBoxes.GetHashCode();
            }
            if (UnpadGroundtruthTensors != false)
            {
                hash ^= UnpadGroundtruthTensors.GetHashCode();
            }
            if (RetainOriginalImages != false)
            {
                hash ^= RetainOriginalImages.GetHashCode();
            }
            if (UseBfloat16 != false)
            {
                hash ^= UseBfloat16.GetHashCode();
            }
            if (SummarizeGradients != false)
            {
                hash ^= SummarizeGradients.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#4
0
        public override string SolutionTwo()
        {
            var positions = new Dictionary <Utils.CoOrd, NumSteps>();

            var pathnum = 1;

            foreach (var input in Input)
            {
                var steps = 0;
                var path  = input.Split(',');
                var pos   = new Utils.CoOrd(0, 0);
                foreach (var pathsect in path)
                {
                    var direction = pathsect.Substring(0, 1);
                    var length    = int.Parse(pathsect.Substring(1));

                    int newy;
                    int newx;
                    switch (direction)
                    {
                    case "U":
                        newy = pos.y + length;
                        for (var y = pos.y + 1; y <= newy; y++)
                        {
                            steps++;
                            var newpos = new Utils.CoOrd(pos.x, y);
                            if (!positions.ContainsKey(newpos))
                            {
                                positions.Add(newpos, new NumSteps(pathnum, steps));
                            }
                            else
                            {
                                if (positions[newpos].pathnum < pathnum)
                                {
                                    positions[newpos] = new NumSteps(positions[newpos].pathnum + pathnum, positions[newpos].steps + steps);
                                }
                            }

                            pos.y++;
                        }
                        break;

                    case "D":
                        newy = pos.y - length;
                        for (var y = pos.y - 1; y >= newy; y--)
                        {
                            steps++;
                            var newpos = new Utils.CoOrd(pos.x, y);
                            if (!positions.ContainsKey(newpos))
                            {
                                positions.Add(newpos, new NumSteps(pathnum, steps));
                            }
                            else
                            {
                                if (positions[newpos].pathnum < pathnum)
                                {
                                    positions[newpos] = new NumSteps(positions[newpos].pathnum + pathnum, positions[newpos].steps + steps);
                                }
                            }

                            pos.y--;
                        }
                        break;

                    case "R":
                        newx = pos.x + length;
                        for (var x = pos.x + 1; x <= newx; x++)
                        {
                            steps++;
                            var newpos = new Utils.CoOrd(x, pos.y);
                            if (!positions.ContainsKey(newpos))
                            {
                                positions.Add(newpos, new NumSteps(pathnum, steps));
                            }
                            else
                            {
                                if (positions[newpos].pathnum < pathnum)
                                {
                                    positions[newpos] = new NumSteps(positions[newpos].pathnum + pathnum, positions[newpos].steps + steps);
                                }
                            }

                            pos.x++;
                        }
                        break;

                    case "L":
                        newx = pos.x - length;
                        for (var x = pos.x - 1; x >= newx; x--)
                        {
                            steps++;
                            var newpos = new Utils.CoOrd(x, pos.y);
                            if (!positions.ContainsKey(newpos))
                            {
                                positions.Add(newpos, new NumSteps(pathnum, steps));
                            }
                            else
                            {
                                if (positions[newpos].pathnum < pathnum)
                                {
                                    positions[newpos] = new NumSteps(positions[newpos].pathnum + pathnum, positions[newpos].steps + steps);
                                }
                            }

                            pos.x--;
                        }
                        break;
                    }
                }

                pathnum++;
            }

            var crosses = positions.Where(p => p.Value.pathnum == 3).ToList();

            crosses = crosses.OrderBy(p => p.Value.steps).ToList();

            return((crosses[0].Value.steps).ToString());
        }