private void Start() { VccConnect = false; GNDConnect = false; DigitalConnect = false; start = GetComponentInChildren <StartLine>(); }
/// <summary> /// Returns the hash code for the object. /// </summary> /// <returns>The hash code for the object.</returns> public override int GetHashCode() { int hashCode = -1676728671; hashCode = hashCode * -1521134295 + StartLine.GetHashCode(); return(hashCode * -1521134295 + EndLine.GetHashCode()); }
public byte[] GetBytes(bool appendNull) { string body = mimeBodies.ToString(); // Update the Content-Length header, +1 the additional 0x00 // mimeBodylength + \r\n\0 mimeHeaders[MIMEHeaderStrings.Content_Length] = (body.Length + (appendNull ? 3 : 2)).ToString(); StringBuilder builder = new StringBuilder(512); builder.Append(StartLine.Trim()); builder.Append("\r\n"); builder.Append(mimeHeaders.ToString()); builder.Append("\r\n"); builder.Append(body); builder.Append("\r\n"); // get the bytes byte[] message = Encoding.GetBytes(builder.ToString()); // add the additional 0x00 if (appendNull) { byte[] totalMessage = new byte[message.Length + 1]; message.CopyTo(totalMessage, 0); totalMessage[message.Length] = 0x00; return(totalMessage); } else { return(message); } }
/// <summary> /// Formats the given message to include detailed file location information. /// </summary> public override string FormatErrorMessage(string message) => string.Format( ErrorMessages.LocationFileMessage, message, FileName, StartLine.ToString(), EndLine.ToString());
public override int GetHashCode() { int result = 17; unchecked { if (RuleId != default(string)) { result = (result * 31) + RuleId.GetHashCode(); } if (Rule != default(Rule)) { result = (result * 31) + Rule.GetHashCode(); } if (Guid != default(string)) { result = (result * 31) + Guid.GetHashCode(); } if (IsActive != default(bool)) { result = (result * 31) + IsActive.GetHashCode(); } if (Message != default(string)) { result = (result * 31) + Message.GetHashCode(); } if (StartLine != default(int)) { result = (result * 31) + StartLine.GetHashCode(); } if (WhenDetectedUtc != default(DateTime)) { result = (result * 31) + WhenDetectedUtc.GetHashCode(); } if (BaselineState != default(BaselineState)) { result = (result * 31) + BaselineState.GetHashCode(); } if (Properties != default(IDictionary <String, String>)) { result = (result * 31) + Properties.GetHashCode(); } if (Tags != default(IList <int>)) { result = (result * 31) + Tags.GetHashCode(); } } return(result); }
public override string ToString() { if (IsHidden) { return("IL" + IlOffset.ToString("X4") + " (hidden)"); } return("IL" + IlOffset.ToString("X4") + " (" + StartLine.ToString() + "-" + EndLine.ToString() + ") (" + StartCol.ToString() + "-" + EndCol.ToString() + ")"); }
public override int GetHashCode( ) { int hashCode = 2078777074; hashCode = (hashCode * -1521134295) + base.GetHashCode( ); hashCode = (hashCode * -1521134295) + StartLine.GetHashCode( ); hashCode = (hashCode * -1521134295) + StartColumn.GetHashCode( ); hashCode = (hashCode * -1521134295) + EndLine.GetHashCode( ); hashCode = (hashCode * -1521134295) + EndColumn.GetHashCode( ); return(hashCode); }
[TestCase("SIP/2.0 200 \r\n", (float)0)]//異常系 public void Sipバージョンの解釈(string str, float verNo) { //setup var sut = new StartLine(Encoding.ASCII.GetBytes(str)); var exception = verNo; //exercise var actual = sut.SipVer.No; //verify Assert.That(actual, Is.EqualTo(exception)); }
[TestCase("SIP/2.0 200", 0)] //異常系 public void Statusコードの解釈(string str, int statusCode) { //setup var sut = new StartLine(Encoding.ASCII.GetBytes(str)); var exception = statusCode; //exercise var actual = sut.StatusCode; //verify Assert.That(actual, Is.EqualTo(exception)); }
public void SipMethodの解釈(string str, SipMethod sipMethod) { //setup var sut = new StartLine(Encoding.ASCII.GetBytes(str)); var exception = sipMethod; //exercise var actual = sut.SipMethod; //verify Assert.That(actual, Is.EqualTo(exception)); }
public void RequestUriの解釈(string str, string requestUri) { //setup var sut = new StartLine(Encoding.ASCII.GetBytes(str)); var exception = requestUri; //exercise var actual = sut.RequestUri; //verify Assert.That(actual, Is.EqualTo(exception)); }
public override int GetHashCode() { unchecked { int hash = 17; hash *= 23 + StartLine.GetHashCode(); hash *= 23 + StartColumn.GetHashCode(); hash *= 23 + EndLine.GetHashCode(); hash *= 23 + EndColumn.GetHashCode(); return(hash); } }
public override int GetHashCode() { var hashCode = 1032872879; hashCode = hashCode * -1521134295 + EqualityComparer <ISymbol> .Default.GetHashCode(Variable); hashCode = hashCode * -1521134295 + StartLine.GetHashCode(); hashCode = hashCode * -1521134295 + EndLine.GetHashCode(); hashCode = hashCode * -1521134295 + StartColumn.GetHashCode(); hashCode = hashCode * -1521134295 + EndColumn.GetHashCode(); return(hashCode); }
private float calc_noise_core(GrInfo cod_info, StartLine startline, int l, float step) { float noise = 0; var j = startline.s; var ix = cod_info.l3_enc; if (j > cod_info.count1) { while (l-- != 0) { float temp; temp = cod_info.xr[j]; j++; noise += temp * temp; temp = cod_info.xr[j]; j++; noise += temp * temp; } } else if (j > cod_info.big_values) { var ix01 = new float[2]; ix01[0] = 0; ix01[1] = step; while (l-- != 0) { float temp; temp = Math.Abs(cod_info.xr[j]) - ix01[ix[j]]; j++; noise += temp * temp; temp = Math.Abs(cod_info.xr[j]) - ix01[ix[j]]; j++; noise += temp * temp; } } else { while (l-- != 0) { float temp; temp = Math.Abs(cod_info.xr[j]) - pow43[ix[j]] * step; j++; noise += temp * temp; temp = Math.Abs(cod_info.xr[j]) - pow43[ix[j]] * step; j++; noise += temp * temp; } } startline.s = j; return(noise); }
private void OnTriggerEnter(Collider other) { if (other.transform.tag == "Player") { startLine = FindObjectOfType <StartLine>(); startLine.counting = false; startLine.Draw(); startLine.time = 0f; } }
public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hash = 17; // Suitable nullity checks etc, of course :) hash = hash * 23 + StartLine.GetHashCode(); hash = hash * 23 + EndLine.GetHashCode(); hash = hash * 23 + (Alias ?? string.Empty).GetHashCode(); hash = hash * 23 + (Comment ?? string.Empty).GetHashCode(); hash = hash * 23 + NodeType.GetHashCode(); return(hash); } }
public override int GetHashCode() { int result = 17; unchecked { result = (result * 31) + StartLine.GetHashCode(); result = (result * 31) + StartColumn.GetHashCode(); result = (result * 31) + EndLine.GetHashCode(); result = (result * 31) + EndColumn.GetHashCode(); result = (result * 31) + Offset.GetHashCode(); result = (result * 31) + Length.GetHashCode(); } return(result); }
public int CompareTo(Span other) { var c = StartLine.CompareTo(other.StartLine); if (c != 0) { return(c); } c = StartColumn.CompareTo(other.StartColumn); if (c != 0) { return(c); } c = EndLine.CompareTo(other.EndLine); if (c != 0) { return(c); } c = EndColumn.CompareTo(other.EndColumn); return(c); }
public static List <RavenRockEntry> ParseLinesToEntries(string[] lines) { if (lines == null) { throw new ArgumentNullException(nameof(lines)); } if (lines.Length == 0) { return(new List <RavenRockEntry>(0)); } var startLineRegex = new Regex("\\] \\((?<name>[a-z]+)\\)", RegexOptions.Compiled); var foundStartLines = new List <StartLine>(); for (int i = 0; i < lines.Length; i++) { var result = startLineRegex.Match(lines[i]); if (!result.Success) { continue; } var captured = result.Groups["name"].Value; bool parsedToEntryType = Enum.TryParse <EntryType>(captured.ToUpperInvariant(), out var entryType); if (!parsedToEntryType) { throw new InvalidOperationException($"Unrecognized entry type `{captured}`"); } foundStartLines.Add(new StartLine(entryType, i)); } var parsed = new List <RavenRockEntry>(foundStartLines.Count); for (int i = 0; i < foundStartLines.Count; i++) { StartLine startLine = foundStartLines[i]; int beginLine = startLine.Line; int endLine = (i == foundStartLines.Count - 1) ? lines.Length : foundStartLines[i + 1].Line; string mashed = MashLines(lines[beginLine..endLine]);
/// <inheritdoc /> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; if (Color != null) { hashCode = hashCode * 59 + Color.GetHashCode(); } if (Smoothing != null) { hashCode = hashCode * 59 + Smoothing.GetHashCode(); } if (Title != null) { hashCode = hashCode * 59 + Title.GetHashCode(); } if (Type != null) { hashCode = hashCode * 59 + Type.GetHashCode(); } if (AutoTypeNumbers != null) { hashCode = hashCode * 59 + AutoTypeNumbers.GetHashCode(); } if (AutoRange != null) { hashCode = hashCode * 59 + AutoRange.GetHashCode(); } if (RangeMode != null) { hashCode = hashCode * 59 + RangeMode.GetHashCode(); } if (Range != null) { hashCode = hashCode * 59 + Range.GetHashCode(); } if (FixedRange != null) { hashCode = hashCode * 59 + FixedRange.GetHashCode(); } if (CheaterType != null) { hashCode = hashCode * 59 + CheaterType.GetHashCode(); } if (TickMode != null) { hashCode = hashCode * 59 + TickMode.GetHashCode(); } if (NTicks != null) { hashCode = hashCode * 59 + NTicks.GetHashCode(); } if (TickVals != null) { hashCode = hashCode * 59 + TickVals.GetHashCode(); } if (TickText != null) { hashCode = hashCode * 59 + TickText.GetHashCode(); } if (ShowTickLabels != null) { hashCode = hashCode * 59 + ShowTickLabels.GetHashCode(); } if (TickFont != null) { hashCode = hashCode * 59 + TickFont.GetHashCode(); } if (TickAngle != null) { hashCode = hashCode * 59 + TickAngle.GetHashCode(); } if (TickPrefix != null) { hashCode = hashCode * 59 + TickPrefix.GetHashCode(); } if (ShowTickPrefix != null) { hashCode = hashCode * 59 + ShowTickPrefix.GetHashCode(); } if (TickSuffix != null) { hashCode = hashCode * 59 + TickSuffix.GetHashCode(); } if (ShowTickSuffix != null) { hashCode = hashCode * 59 + ShowTickSuffix.GetHashCode(); } if (ShowExponent != null) { hashCode = hashCode * 59 + ShowExponent.GetHashCode(); } if (ExponentFormat != null) { hashCode = hashCode * 59 + ExponentFormat.GetHashCode(); } if (MinExponent != null) { hashCode = hashCode * 59 + MinExponent.GetHashCode(); } if (SeparateThousands != null) { hashCode = hashCode * 59 + SeparateThousands.GetHashCode(); } if (TickFormat != null) { hashCode = hashCode * 59 + TickFormat.GetHashCode(); } if (TickFormatStops != null) { hashCode = hashCode * 59 + TickFormatStops.GetHashCode(); } if (CategoryOrder != null) { hashCode = hashCode * 59 + CategoryOrder.GetHashCode(); } if (CategoryArray != null) { hashCode = hashCode * 59 + CategoryArray.GetHashCode(); } if (LabelPadding != null) { hashCode = hashCode * 59 + LabelPadding.GetHashCode(); } if (LabelPrefix != null) { hashCode = hashCode * 59 + LabelPrefix.GetHashCode(); } if (LabelSuffix != null) { hashCode = hashCode * 59 + LabelSuffix.GetHashCode(); } if (ShowLine != null) { hashCode = hashCode * 59 + ShowLine.GetHashCode(); } if (LineColor != null) { hashCode = hashCode * 59 + LineColor.GetHashCode(); } if (LineWidth != null) { hashCode = hashCode * 59 + LineWidth.GetHashCode(); } if (GridColor != null) { hashCode = hashCode * 59 + GridColor.GetHashCode(); } if (GridWidth != null) { hashCode = hashCode * 59 + GridWidth.GetHashCode(); } if (ShowGrid != null) { hashCode = hashCode * 59 + ShowGrid.GetHashCode(); } if (MinorGridCount != null) { hashCode = hashCode * 59 + MinorGridCount.GetHashCode(); } if (MinorGridWidth != null) { hashCode = hashCode * 59 + MinorGridWidth.GetHashCode(); } if (MinorGridColor != null) { hashCode = hashCode * 59 + MinorGridColor.GetHashCode(); } if (StartLine != null) { hashCode = hashCode * 59 + StartLine.GetHashCode(); } if (StartLineColor != null) { hashCode = hashCode * 59 + StartLineColor.GetHashCode(); } if (StartLineWidth != null) { hashCode = hashCode * 59 + StartLineWidth.GetHashCode(); } if (EndLine != null) { hashCode = hashCode * 59 + EndLine.GetHashCode(); } if (EndlineWidth != null) { hashCode = hashCode * 59 + EndlineWidth.GetHashCode(); } if (EndlineColor != null) { hashCode = hashCode * 59 + EndlineColor.GetHashCode(); } if (Tick0 != null) { hashCode = hashCode * 59 + Tick0.GetHashCode(); } if (DTick != null) { hashCode = hashCode * 59 + DTick.GetHashCode(); } if (ArrayTick0 != null) { hashCode = hashCode * 59 + ArrayTick0.GetHashCode(); } if (ArrayDTick != null) { hashCode = hashCode * 59 + ArrayDTick.GetHashCode(); } if (TickValsSrc != null) { hashCode = hashCode * 59 + TickValsSrc.GetHashCode(); } if (TickTextSrc != null) { hashCode = hashCode * 59 + TickTextSrc.GetHashCode(); } if (CategoryArraySrc != null) { hashCode = hashCode * 59 + CategoryArraySrc.GetHashCode(); } return(hashCode); } }
/// <inheritdoc /> public bool Equals([AllowNull] AAxis other) { if (other == null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Color == other.Color || Color != null && Color.Equals(other.Color) ) && ( Smoothing == other.Smoothing || Smoothing != null && Smoothing.Equals(other.Smoothing) ) && ( Title == other.Title || Title != null && Title.Equals(other.Title) ) && ( Type == other.Type || Type != null && Type.Equals(other.Type) ) && ( AutoTypeNumbers == other.AutoTypeNumbers || AutoTypeNumbers != null && AutoTypeNumbers.Equals(other.AutoTypeNumbers) ) && ( AutoRange == other.AutoRange || AutoRange != null && AutoRange.Equals(other.AutoRange) ) && ( RangeMode == other.RangeMode || RangeMode != null && RangeMode.Equals(other.RangeMode) ) && ( Equals(Range, other.Range) || Range != null && other.Range != null && Range.SequenceEqual(other.Range) ) && ( FixedRange == other.FixedRange || FixedRange != null && FixedRange.Equals(other.FixedRange) ) && ( CheaterType == other.CheaterType || CheaterType != null && CheaterType.Equals(other.CheaterType) ) && ( TickMode == other.TickMode || TickMode != null && TickMode.Equals(other.TickMode) ) && ( NTicks == other.NTicks || NTicks != null && NTicks.Equals(other.NTicks) ) && ( Equals(TickVals, other.TickVals) || TickVals != null && other.TickVals != null && TickVals.SequenceEqual(other.TickVals) ) && ( Equals(TickText, other.TickText) || TickText != null && other.TickText != null && TickText.SequenceEqual(other.TickText) ) && ( ShowTickLabels == other.ShowTickLabels || ShowTickLabels != null && ShowTickLabels.Equals(other.ShowTickLabels) ) && ( TickFont == other.TickFont || TickFont != null && TickFont.Equals(other.TickFont) ) && ( TickAngle == other.TickAngle || TickAngle != null && TickAngle.Equals(other.TickAngle) ) && ( TickPrefix == other.TickPrefix || TickPrefix != null && TickPrefix.Equals(other.TickPrefix) ) && ( ShowTickPrefix == other.ShowTickPrefix || ShowTickPrefix != null && ShowTickPrefix.Equals(other.ShowTickPrefix) ) && ( TickSuffix == other.TickSuffix || TickSuffix != null && TickSuffix.Equals(other.TickSuffix) ) && ( ShowTickSuffix == other.ShowTickSuffix || ShowTickSuffix != null && ShowTickSuffix.Equals(other.ShowTickSuffix) ) && ( ShowExponent == other.ShowExponent || ShowExponent != null && ShowExponent.Equals(other.ShowExponent) ) && ( ExponentFormat == other.ExponentFormat || ExponentFormat != null && ExponentFormat.Equals(other.ExponentFormat) ) && ( MinExponent == other.MinExponent || MinExponent != null && MinExponent.Equals(other.MinExponent) ) && ( SeparateThousands == other.SeparateThousands || SeparateThousands != null && SeparateThousands.Equals(other.SeparateThousands) ) && ( TickFormat == other.TickFormat || TickFormat != null && TickFormat.Equals(other.TickFormat) ) && ( Equals(TickFormatStops, other.TickFormatStops) || TickFormatStops != null && other.TickFormatStops != null && TickFormatStops.SequenceEqual(other.TickFormatStops) ) && ( CategoryOrder == other.CategoryOrder || CategoryOrder != null && CategoryOrder.Equals(other.CategoryOrder) ) && ( Equals(CategoryArray, other.CategoryArray) || CategoryArray != null && other.CategoryArray != null && CategoryArray.SequenceEqual(other.CategoryArray) ) && ( LabelPadding == other.LabelPadding || LabelPadding != null && LabelPadding.Equals(other.LabelPadding) ) && ( LabelPrefix == other.LabelPrefix || LabelPrefix != null && LabelPrefix.Equals(other.LabelPrefix) ) && ( LabelSuffix == other.LabelSuffix || LabelSuffix != null && LabelSuffix.Equals(other.LabelSuffix) ) && ( ShowLine == other.ShowLine || ShowLine != null && ShowLine.Equals(other.ShowLine) ) && ( LineColor == other.LineColor || LineColor != null && LineColor.Equals(other.LineColor) ) && ( LineWidth == other.LineWidth || LineWidth != null && LineWidth.Equals(other.LineWidth) ) && ( GridColor == other.GridColor || GridColor != null && GridColor.Equals(other.GridColor) ) && ( GridWidth == other.GridWidth || GridWidth != null && GridWidth.Equals(other.GridWidth) ) && ( ShowGrid == other.ShowGrid || ShowGrid != null && ShowGrid.Equals(other.ShowGrid) ) && ( MinorGridCount == other.MinorGridCount || MinorGridCount != null && MinorGridCount.Equals(other.MinorGridCount) ) && ( MinorGridWidth == other.MinorGridWidth || MinorGridWidth != null && MinorGridWidth.Equals(other.MinorGridWidth) ) && ( MinorGridColor == other.MinorGridColor || MinorGridColor != null && MinorGridColor.Equals(other.MinorGridColor) ) && ( StartLine == other.StartLine || StartLine != null && StartLine.Equals(other.StartLine) ) && ( StartLineColor == other.StartLineColor || StartLineColor != null && StartLineColor.Equals(other.StartLineColor) ) && ( StartLineWidth == other.StartLineWidth || StartLineWidth != null && StartLineWidth.Equals(other.StartLineWidth) ) && ( EndLine == other.EndLine || EndLine != null && EndLine.Equals(other.EndLine) ) && ( EndlineWidth == other.EndlineWidth || EndlineWidth != null && EndlineWidth.Equals(other.EndlineWidth) ) && ( EndlineColor == other.EndlineColor || EndlineColor != null && EndlineColor.Equals(other.EndlineColor) ) && ( Tick0 == other.Tick0 || Tick0 != null && Tick0.Equals(other.Tick0) ) && ( DTick == other.DTick || DTick != null && DTick.Equals(other.DTick) ) && ( ArrayTick0 == other.ArrayTick0 || ArrayTick0 != null && ArrayTick0.Equals(other.ArrayTick0) ) && ( ArrayDTick == other.ArrayDTick || ArrayDTick != null && ArrayDTick.Equals(other.ArrayDTick) ) && ( TickValsSrc == other.TickValsSrc || TickValsSrc != null && TickValsSrc.Equals(other.TickValsSrc) ) && ( TickTextSrc == other.TickTextSrc || TickTextSrc != null && TickTextSrc.Equals(other.TickTextSrc) ) && ( CategoryArraySrc == other.CategoryArraySrc || CategoryArraySrc != null && CategoryArraySrc.Equals(other.CategoryArraySrc) )); }
internal int calc_noise( GrInfo cod_info, float[] l3_xmin, float[] distort, CalcNoiseResult res, CalcNoiseData prev_noise) { var distortPos = 0; var l3_xminPos = 0; int sfb, l, over = 0; float over_noise_db = 0; float tot_noise_db = 0; var max_noise = -20.0f; var j = 0; var scalefac = cod_info.scalefac; var scalefacPos = 0; res.over_SSD = 0; for (sfb = 0; sfb < cod_info.psymax; sfb++) { var s = cod_info.global_gain - ((scalefac[scalefacPos++] + (cod_info.preflag != 0 ? pretab[sfb] : 0)) << (cod_info.scalefac_scale + 1)) - cod_info.subblock_gain[cod_info.window[sfb]] * 8; var noise = 0.0f; if (prev_noise != null && prev_noise.step[sfb] == s) { noise = prev_noise.noise[sfb]; j += cod_info.width[sfb]; distort[distortPos++] = noise / l3_xmin[l3_xminPos++]; noise = prev_noise.noise_log[sfb]; } else { var step = POW20(s); l = cod_info.width[sfb] >> 1; if (j + cod_info.width[sfb] > cod_info.max_nonzero_coeff) { int usefullsize; usefullsize = cod_info.max_nonzero_coeff - j + 1; if (usefullsize > 0) { l = usefullsize >> 1; } else { l = 0; } } var sl = new StartLine(j); noise = calc_noise_core(cod_info, sl, l, step); j = sl.s; if (prev_noise != null) { prev_noise.step[sfb] = s; prev_noise.noise[sfb] = noise; } noise = distort[distortPos++] = noise / l3_xmin[l3_xminPos++]; noise = Util.FAST_LOG10((float)Math.Max(noise, 1E-20)); if (prev_noise != null) { prev_noise.noise_log[sfb] = noise; } } if (prev_noise != null) { prev_noise.global_gain = cod_info.global_gain; } tot_noise_db += noise; if (noise > 0.0) { int tmp; tmp = Math.Max((int)(noise * 10 + .5), 1); res.over_SSD += tmp * tmp; over++; over_noise_db += noise; } max_noise = Math.Max(max_noise, noise); } res.over_count = over; res.tot_noise = tot_noise_db; res.over_noise = over_noise_db; res.max_noise = max_noise; return(over); }
public override int GetHashCode() => StartLine.GetHashCode() ^ (FilePath?.GetHashCode() ?? 0);
public override int GetHashCode() { return(StartLine.GetHashCode() ^ (FilePath?.GetHashCode() ?? 0)); }
public override int GetHashCode() { return(StartLine.GetHashCode() ^ FilePath.GetHashCode()); }