Exemplo n.º 1
0
 public void MergeFrom(MetricDescriptorMetadata other)
 {
     if (other == null)
     {
         return;
     }
     if (other.LaunchStage != global::Google.Api.LaunchStage.Unspecified)
     {
         LaunchStage = other.LaunchStage;
     }
     if (other.samplePeriod_ != null)
     {
         if (samplePeriod_ == null)
         {
             SamplePeriod = new global::Google.Protobuf.WellKnownTypes.Duration();
         }
         SamplePeriod.MergeFrom(other.SamplePeriod);
     }
     if (other.ingestDelay_ != null)
     {
         if (ingestDelay_ == null)
         {
             IngestDelay = new global::Google.Protobuf.WellKnownTypes.Duration();
         }
         IngestDelay.MergeFrom(other.IngestDelay);
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Exemplo n.º 2
0
                public override int GetHashCode()
                {
                    int hash = 1;

                    if (LaunchStage != global::Google.Api.LaunchStage.Unspecified)
                    {
                        hash ^= LaunchStage.GetHashCode();
                    }
                    if (samplePeriod_ != null)
                    {
                        hash ^= SamplePeriod.GetHashCode();
                    }
                    if (ingestDelay_ != null)
                    {
                        hash ^= IngestDelay.GetHashCode();
                    }
                    if (_unknownFields != null)
                    {
                        hash ^= _unknownFields.GetHashCode();
                    }
                    return(hash);
                }
Exemplo n.º 3
0
                public override int GetHashCode()
                {
                    int hash = 1;

                    if (LaunchStage != 0)
                    {
                        hash ^= LaunchStage.GetHashCode();
                    }
                    if (samplePeriod_ != null)
                    {
                        hash ^= SamplePeriod.GetHashCode();
                    }
                    if (ingestDelay_ != null)
                    {
                        hash ^= IngestDelay.GetHashCode();
                    }
                    if (_unknownFields != null)
                    {
                        hash ^= _unknownFields.GetHashCode();
                    }
                    return(hash);
                }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            int factorme = 15;  //note: trying to factor 21 takes abt 10 minutes per attempt on my PC.

            using (var sim = new QuantumSimulator())
            {
                while (true)
                {
                    var testradix = ChooseRandomCoprime(factorme);

                    Console.WriteLine("Starting Quantum Routine: radix = {0}, modulus = {1}", testradix, factorme);
                    long res = SamplePeriod.Run(sim, testradix, factorme).Result;
                    Console.WriteLine("Result {0}", res);
                    if ((res != 1) && (res != factorme - 1) && (res * res % factorme == 1))
                    {
                        Console.WriteLine("Factors Found: {0} x {1} = {2}", Gcd(res + 1, factorme), Gcd(res - 1, factorme), factorme);
                        Console.WriteLine("Press any key to continue...");
                        Console.ReadKey();
                        break;
                    }
                }
            }
        }