Esempio n. 1
0
 public NFLBet( string teamCodeIn, NFLGame gameIn, string reason, Confidence confidenceIn )
 {
     TeamToBetOn = teamCodeIn;
     game = gameIn;
     reasonList = new ArrayList();
     confidence = confidenceIn;
     vigorish = 0.1D;   //  the amount that is raked off the winnings
     AddReason( reason );
 }
Esempio n. 2
0
 /// <summary>Serves as the default hash function. </summary>
 /// <returns>A hash code for the current object.</returns>
 /// <filterpriority>2</filterpriority>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Symbol != null ? Symbol.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)Type;
         hashCode = (hashCode * 397) ^ (int)Direction;
         hashCode = (hashCode * 397) ^ Magnitude.GetHashCode();
         hashCode = (hashCode * 397) ^ Confidence.GetHashCode();
         hashCode = (hashCode * 397) ^ Period.GetHashCode();
         return(hashCode);
     }
 }
Esempio n. 3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Name?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ StringId?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ Lat.GetHashCode();
         hashCode = (hashCode * 397) ^ Lon.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)Type;
         hashCode = (hashCode * 397) ^ Confidence.GetHashCode();
         return(hashCode);
     }
 }
        public StartupJunkNode(StartupEntryBase entry, ApplicationUninstallerEntry application, IJunkCreator source)
            : base(application, source)
        {
            Entry = entry ?? throw new ArgumentNullException(nameof(entry));

            Confidence.Add(ConfidenceStartupMatched);

            if (entry is StartupEntry normalStartupEntry && normalStartupEntry.IsRunOnce)
            {
                // If the entry is RunOnce, give it some negative points to keep it out of automatic removal.
                // It might be used to clean up after uninstall on next boot.
                Confidence.Add(ConfidenceStartupIsRunOnce);
            }
        }
Esempio n. 5
0
        private void SelectUpTo(Confidence selectedConfidence)
        {
            objectListViewMain.BeginControlUpdate();
            objectListViewMain.BeginUpdate();

            objectListViewMain.DeselectAll();
            objectListViewMain.UncheckAll();

            objectListViewMain.CheckObjects(objectListViewMain.FilteredObjects.Cast <JunkNode>()
                                            .Where(x => x.Confidence.GetConfidence() >= selectedConfidence).ToList());

            objectListViewMain.EndUpdate();
            objectListViewMain.EndControlUpdate();
        }
Esempio n. 6
0
 public AugmentQualityResult(QualitySource source,
                             Confidence sourceConfidence,
                             int resolution,
                             Confidence resolutionConfidence,
                             Revision revision,
                             Confidence revisionConfidence)
 {
     Source               = source;
     SourceConfidence     = sourceConfidence;
     Resolution           = resolution;
     ResolutionConfidence = resolutionConfidence;
     Revision             = revision;
     RevisionConfidence   = revisionConfidence;
 }
Esempio n. 7
0
        private double[] GetSamples(double min, double mostLikely, double max, Confidence confidence)
        {
            double[] result = null;

            var pert = GetPertDistribution(min, mostLikely, max, confidence);

            if (pert != null)
            {
                result = new double[SamplesCount];
                pert.Samples(result);
            }

            return(result);
        }
        public TECParameters(TECParameters parametersSource) : this(parametersSource.Guid)
        {
            _isTaxExempt    = parametersSource.IsTaxExempt;
            _requiresBond   = parametersSource.RequiresBond;
            _requiresWrapUp = parametersSource.RequiresWrapUp;
            _hasBMS         = parametersSource.HasBMS;

            _escalation = parametersSource.Escalation;
            _subcontractorEscalation = parametersSource.SubcontractorEscalation;
            _warranty = parametersSource.Warranty;
            _shipping = parametersSource.Shipping;
            _tax      = parametersSource.Tax;
            _subcontractorWarranty = parametersSource.SubcontractorWarranty;
            _subcontractorShipping = parametersSource.SubcontractorShipping;
            _bondRate      = parametersSource.BondRate;
            _overtimeRatio = parametersSource.OvertimeRatio;
            _markup        = parametersSource.Markup;

            _desiredConfidence = parametersSource.DesiredConfidence;

            _pmCoef         = parametersSource.PMCoef;
            _pmCoefStdError = parametersSource.PMCoefStdError;
            _pmRate         = parametersSource.PMRate;

            _engCoef         = parametersSource.ENGCoef;
            _engCoefStdError = parametersSource.ENGCoefStdError;
            _engRate         = parametersSource.ENGRate;

            _commCoef         = parametersSource.CommCoef;
            _commCoefStdError = parametersSource.CommCoefStdError;
            _commRate         = parametersSource.CommRate;

            _softCoef         = parametersSource.SoftCoef;
            _softCoefStdError = parametersSource.SoftCoefStdError;
            _softRate         = parametersSource.SoftRate;

            _graphCoef         = parametersSource.GraphCoef;
            _graphCoefStdError = parametersSource.GraphCoefStdError;
            _graphRate         = parametersSource.GraphRate;

            _electricalRate              = parametersSource.ElectricalRate;
            _electricalNonUnionRate      = parametersSource.ElectricalNonUnionRate;
            _electricalSuperRate         = parametersSource.ElectricalSuperRate;
            _electricalSuperNonUnionRate = parametersSource.ElectricalSuperNonUnionRate;
            _electricalSuperRatio        = parametersSource.ElectricalSuperRatio;

            _electricalIsOnOvertime = parametersSource.ElectricalIsOnOvertime;
            _electricalIsUnion      = parametersSource.ElectricalIsUnion;
        }
Esempio n. 9
0
        protected void LoadLists()
        {
            Projects oProject = new Projects(intProfile, dsn);

            lstProjects.DataValueField = "projectid";
            lstProjects.DataTextField  = "name";
            lstProjects.DataSource     = oProject.GetActive();
            lstProjects.DataBind();
            lstProjects.Items.Insert(0, new ListItem("-- ALL --", "0"));

            //Locations oLocation = new Locations(intProfile, dsn);
            lstLocations.DataValueField = "id";
            lstLocations.DataTextField  = "fullname";
            lstLocations.DataSource     = oLocation.GetAddresssOrdered(1);
            lstLocations.DataBind();
            lstLocations.Items.Insert(0, new ListItem("-- ALL --", "0"));

            Confidence oConfidence = new Confidence(intProfile, dsn);

            lstConfidences.DataValueField = "id";
            lstConfidences.DataTextField  = "name";
            lstConfidences.DataSource     = oConfidence.Gets(1);
            lstConfidences.DataBind();
            lstConfidences.Items.Insert(0, new ListItem("-- ALL --", "0"));

            Classes oClass    = new Classes(intProfile, dsn);
            DataSet dsClasses = oClass.Gets(1);

            lstClasses.DataValueField = "id";
            lstClasses.DataTextField  = "name";
            lstClasses.DataSource     = dsClasses;
            lstClasses.DataBind();
            lstClasses.Items.Insert(0, new ListItem("-- ALL --", "0"));


            lstEnvironments.Items.Insert(0, new ListItem("-- Please select a Class --", "0"));
            lstEnvironments.Enabled = false;


            for (int i = 1; i <= 4; i++)
            {
                DropDownList ddl = this.FindControl("ddlGroup" + i.ToString()) as System.Web.UI.WebControls.DropDownList;
                ddl.Items.Insert(0, new ListItem("Confidence", "ConfidenceId"));
                ddl.Items.Insert(0, new ListItem("Environment", "EnvironmentId"));
                ddl.Items.Insert(0, new ListItem("Class", "ClassId"));
                ddl.Items.Insert(0, new ListItem("Project", "ProjectId"));
                ddl.Items.Insert(0, new ListItem("-- NONE --", "0"));
            }
        }
Esempio n. 10
0
        void BTN_3_Click(object sender, EventArgs e)
        {
            string p3 = TB_CF.Text;

            if (!string.IsNullOrEmpty(p3))
            {
                string[]   ps     = p3.Split(' ');
                int        iter   = Convert.ToInt32(ps[0]);
                double     factor = Convert.ToDouble(ps[1]);
                int        r      = Convert.ToByte(ps[2]);
                Confidence thres  = new Confidence(bmp, seed1, iter, factor, r);
                thres.ExcuteFloodFill();
                ShowResult(thres.results, PB_CF, label4);
            }
        }
Esempio n. 11
0
        public void should_return_augmented_quality(string title, Source source, Confidence sourceConfidence, int resolution, Confidence resolutionConfidence)
        {
            Mocker.GetMock <IDownloadHistoryService>()
            .Setup(s => s.GetLatestGrab(It.IsAny <string>()))
            .Returns(Builder <DownloadHistory> .CreateNew()
                     .With(h => h.SourceTitle = title)
                     .Build());

            var result = Subject.AugmentQuality(_localMovie, _downloadClientItem);

            result.Should().NotBe(null);
            result.Source.Should().Be(source);
            result.SourceConfidence.Should().Be(sourceConfidence);
            result.Resolution.Should().Be(resolution);
            result.ResolutionConfidence.Should().Be(resolutionConfidence);
        }
Esempio n. 12
0
        private void OnDataShortPhraseResponseReceivedHandler(object sender, SpeechResponseEventArgs e)
        {
            if (e.PhraseResponse.Results.Length < 1)
            {
                return;
            }

            for (int i = 0; i < 1; i++)
            {
                Confidence a = e.PhraseResponse.Results[i].Confidence;

                string textAudio = e.PhraseResponse.Results[i].DisplayText;

                textAudioGlobal += textAudio;
            }
        }
Esempio n. 13
0
        private void OnDataDictationResponseReceivedHandler(object sender, SpeechResponseEventArgs e)
        {
            if (e.PhraseResponse.Results.Length < 1)
            {
                return;
            }

            for (int i = 0; i < 1; i++)
            {
                Confidence a         = e.PhraseResponse.Results[i].Confidence;
                string     textAudio = e.PhraseResponse.Results[i].DisplayText;
                textAudioGlobal += textAudio;
                int tamText = textAudio.Length;
                NumberLenght.Add(tamText);
            }
        }
Esempio n. 14
0
		public Defect (IRule rule, IMetadataTokenProvider target, IMetadataTokenProvider location, Severity severity, Confidence confidence, string text)
		{
			if (rule == null)
				throw new ArgumentNullException ("rule");
			if (target == null)
				throw new ArgumentNullException ("target");
			if (location == null)
				throw new ArgumentNullException ("location");

			Rule = rule;
			Target = target;
			Location = location;
			Confidence = confidence;
			Severity = severity;
			Text = text;
		}
Esempio n. 15
0
        internal void Analyze(IPlayer you)
        {
            var opponentMoves = History.OpponentMoveHistory;
            if (opponentMoves.Count < 3) return;

            if (opponentMoves.Count == 3)
            {
                var firstMove = opponentMoves.First();
                if (opponentMoves.All(move => move.Equals(firstMove)))
                {
                    CurrentConfidence = Confidence.VeryConfident;
                    BestGuess = firstMove.GetWinningMove();
                }
            }
            else
                ResetConfidence();
        }
Esempio n. 16
0
 public AugmentQualityResult(Source source,
                             Confidence sourceConfidence,
                             int resolution,
                             Confidence resolutionConfidence,
                             Modifier modifier,
                             Confidence modifierConfidence,
                             Revision revision,
                             Confidence revisionConfidence)
 {
     Source               = source;
     SourceConfidence     = sourceConfidence;
     Resolution           = resolution;
     ResolutionConfidence = resolutionConfidence;
     Modifier             = modifier;
     ModifierConfidence   = modifierConfidence;
     Revision             = revision;
     RevisionConfidence   = revisionConfidence;
 }
Esempio n. 17
0
        /// <summary>
        /// Creates a new Person Contact Info request.
        /// </summary>
        /// <param name="svc">Svc.</param>
        public PersonRequest(Service svc, string value, PersonLookup type, Confidence conf = Confidence.None)
        {
            // Create the params.
            HttpParams parameters = new HttpParams
            {
                // Type param.
                { type.ToString().ToLower(), value.Trim() }
            };

            // Build the confidence section, if there is a given confidence.
            if (conf != Confidence.None)
            {
                parameters.Add("confidence", conf.ToString().ToLower());
            }

            // Execute via the base class.
            this.Execute(Endpoint.Person, svc.ApiKey, parameters);
        }
        private SpatialUnit CreateSpatialUnit(Confidence c)
        {
            switch (c)
            {
            case Confidence.F1:
                return(new F1SpatialUnit());

            case Confidence.F2:
                return(new F2SpatialUnit());

            case Confidence.F3Fuzzy:
                return(new F3FuzzySpatialUnit());

            case Confidence.F3Sharp:
                return(new F3SharpSpatialUnit());
            }

            return(null);
        }
Esempio n. 19
0
        public LanguageScore(Language language, Confidence confidence)
        {
            this.language   = language;
            this.confidence = confidence;
            switch (confidence)
            {
            case Confidence.Strong:
                this.score = 100;
                break;

            case Confidence.Intermediate:
                this.score = 50;
                break;

            case Confidence.Poor:
                this.score = 30;
                break;
            }
        }
        public bool Measure(Skeleton skeleton, string sensorId)
        {
            var id = sensorId + skeleton.TrackingId;
            Confidence conf;
            if (data.ContainsKey(id))
            {
                conf = data[id];
                conf.Update(skeleton);
            }
            else
            {
                conf = data[id] = new Confidence(skeleton);
                perDevice[sensorId] = perDevice.ContainsKey(sensorId) ? perDevice[sensorId] : new List<string>();
                perDevice[sensorId].Add(id);
            }
            update();
            var res = IsOK(conf);

            return res;
        }
Esempio n. 21
0
        public override string ToString()
        {
            string result = string.Empty;

            if (double.IsNaN(Score) && !double.IsNaN(Confidence))
            {
                result = string.Format("{0},{1}", Polarity, Confidence.ToString("F"));
            }
            else
            {
                result = string.Format("{0},{1}", Polarity, Score.ToString("F"));
            }

            if (!string.IsNullOrEmpty(ReferencePolarity))
            {
                result += string.Format(",{0}", (Polarity.Equals(ReferencePolarity) ? "agrees" : "disagrees"));
            }

            return(result);
        }
Esempio n. 22
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + ((AlertMessage == null) ? 0 : AlertMessage.GetHashCode());
         hash = hash * 23 + (Risk.GetHashCode());
         hash = hash * 23 + (Confidence.GetHashCode());
         hash = hash * 23 + ((Url == null) ? 0 : Url.GetHashCode());
         hash = hash * 23 + ((Other == null) ? 0 : Other.GetHashCode());
         hash = hash * 23 + ((Parameter == null) ? 0 : Parameter.GetHashCode());
         hash = hash * 23 + ((Attack == null) ? 0 : Attack.GetHashCode());
         hash = hash * 23 + ((Evidence == null) ? 0 : Evidence.GetHashCode());
         hash = hash * 23 + ((Description == null) ? 0 : Description.GetHashCode());
         hash = hash * 23 + ((Reference == null) ? 0 : Reference.GetHashCode());
         hash = hash * 23 + ((Solution == null) ? 0 : Solution.GetHashCode());
         hash = hash * 23 + CWEId.GetHashCode();
         hash = hash * 23 + WASCId.GetHashCode();
         return(hash);
     }
 }
Esempio n. 23
0
        private int CalculateLambda(Confidence confidence)
        {
            var result = 1;

            switch (confidence)
            {
            case Confidence.Low:
                result = 4;
                break;

            case Confidence.Moderate:
                result = 20;
                break;

            case Confidence.High:
                result = 160;
                break;
            }

            return(result);
        }
        /// <summary>
        /// Queries the Bing Maps Service with a given search query, confidence and userLocation and returns a list of locations that match the query
        /// </summary>
        /// <param name="query">Search query</param>
        /// <param name="minimumConfidence">Minimum confidence by which to filter the search results</param>
        /// <param name="userPosition">User's location that is used to improve search results</param>
        /// <returns></returns>
        public static async Task<List<Location>> GetLocationByQuery(string query, Confidence minimumConfidence, OneBusAway.Model.Point userPosition)
        {
            if (string.IsNullOrEmpty(query))
            {
                throw new ArgumentNullException(query);
            }

            Dictionary<string, string> queryParameters = Helpers.GetBasicParameters();
            queryParameters.Add(UtilitiesConstants.Parameter_Query, query);

            if (userPosition != null)
            {
                queryParameters.Add(UtilitiesConstants.Parameter_UserLocation, userPosition.Latitude + "," + userPosition.Longitude);
            }

            string url = Helpers.CreateServiceUrl(UtilitiesConstants.BingLocationServiceBaseAddress, queryParameters);

            Response response = await Helpers.GetJsonResponse<Response>(url);

            return Helpers.FilterResults<Location>(response, minimumConfidence);
        }        
Esempio n. 25
0
		public Defect (IRule rule, IMetadataTokenProvider target, IMetadataTokenProvider location, Severity severity, Confidence confidence)
			: this (rule, target, location, severity, confidence, String.Empty)
		{
		}
Esempio n. 26
0
		public Defect (IRule rule, IMetadataTokenProvider target, MethodDefinition location, Instruction ins, Severity severity, Confidence confidence, string text)
			: this (rule, target, location, severity, confidence, text)
		{
			Instruction = ins;
		}
		private void ReportBoxing (MethodDefinition method, Instruction ins, Confidence confidence)
		{
			string msg = String.Format ("Type '{0}' is being boxed.", (ins.Operand as TypeReference).FullName);
			Runner.Report (method, ins, Severity.High, confidence, msg);
		}
Esempio n. 28
0
		// We use this little helper so that we can report a better defect count to the test.
		// (The test itself can't quite manage this because it can't tell what happened
		// inside TearDown if CheckType or CheckMethod failed).
		private void ReportDefect (IMetadataTokenProvider metadata, Severity severity, Confidence confidence, string mesg)
		{
			++DefectCount;
			Log.WriteLine (this, "Defect: {0}", mesg);
			
			// We need to use the Defect Report overload because the runner's current
			// target won't be set if we land here via TearDown.
			Defect defect = new Defect (this, metadata, metadata, severity, confidence, mesg);
			Runner.Report (defect);
		}
 void Report(MethodDefinition method, Instruction ins, Confidence confidence, MemberReference call, string parameter)
 {
     string msg = String.Format (CultureInfo.InvariantCulture, "Prefer the use of: {0}('{1}'...);",
         call.Name, parameter);
     Runner.Report (method, ins, Severity.Medium, confidence, msg);
 }
Esempio n. 30
0
		public void Report (IMetadataTokenProvider metadata, Severity severity, Confidence confidence, string message)
		{
			// check here to avoid creating the Defect object
			if (!Filter (severity, confidence, metadata))
				return;

			Defect defect = new Defect (currentRule, currentTarget, metadata, severity, confidence, message);
			Report (defect);
		}
 private bool IsOK(Confidence conf)
 {
     return conf.InferredConfidence > 0.7 && conf.LengthConfidence > 0.7;
 }
Esempio n. 32
0
		public void Report (MethodDefinition method, Instruction ins, Severity severity, Confidence confidence, string message)
		{
			// check here to avoid creating the Defect object
			if (!Filter (severity, confidence, method))
				return;

			Defect defect = new Defect (currentRule, currentTarget, method, ins, severity, confidence, message);
			Report (defect);
		}
Esempio n. 33
0
 private void ResetConfidence()
 {
     CurrentConfidence = Confidence.VeryUnconfident;
     BestGuess = Moves.GetRandomMove();
 }
		bool CheckLoadInstruction (MethodDefinition method, Instruction ins, Instruction ld, Confidence confidence)
		{
			switch (ld.OpCode.Code) {
			case Code.Ldstr:
				return CheckPattern (method, ins, (string) ld.Operand, confidence);
			case Code.Ldsfld:
				FieldReference f = (FieldReference) ld.Operand;
				if (f.Name != "Empty" || !f.DeclaringType.IsNamed ("System", "String"))
					return false;
				return CheckPattern (method, ins, null, confidence);
			case Code.Ldnull:
				return CheckPattern (method, ins, null, confidence);
			}
			return true;
		}
		bool CheckPattern (MethodDefinition method, Instruction ins, string pattern, Confidence confidence)
		{
			if (string.IsNullOrEmpty (pattern)) {
				Runner.Report (method, ins, Severity.High, Confidence.High, "Pattern is null or empty.");
				return false;
			}

			try {
				new Regex (pattern);
				return true;
			} catch (Exception e) {
				/* potential set of exceptions is not well documented and potentially changes with regarts to
				   different runtime and/or runtime version. */
				string msg = String.Format (CultureInfo.InvariantCulture, 
					"Pattern '{0}' is invalid. Reason: {1}", pattern, e.Message);
				Runner.Report (method, ins, Severity.High, confidence, msg);
				return false;
			}
		}
Esempio n. 36
0
 public SpeechToTextResult(string text, Confidence confidenceLevel, object source)
 {
     this.Text = text;
     this.ConfidenceLevel = confidenceLevel;
     this.Source = source;
 }
Esempio n. 37
0
		public Defect (IRule rule, IMetadataTokenProvider target, MethodDefinition location, Instruction ins, Severity severity, Confidence confidence)
			: this (rule, target, location, ins, severity, confidence, String.Empty)
		{
		}
Esempio n. 38
0
		private bool Filter (Severity severity, Confidence confidence, IMetadataTokenProvider location)
		{
			if (!SeverityBitmask.Get (severity) || !ConfidenceBitmask.Get (confidence))
				return false;
			// for Assembly | Type | Methods we can ignore before executing the rule
			// but for others (e.g. Parameters, Fields...) we can only ignore the results
			return !IgnoreList.IsIgnored (currentRule, location);
		}