Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var bla = TypeDescriptor.GetConverter(typeof(DateTime));


            //var rl1 = Enumerable.Empty<WorldOfficialGoldHoldingReport_Raw>();
            var rl1 = new Bla().GetWorldGoldReservesReports_UpTo2000();
            var rl2 = Enumerable.Empty <WorldOfficialGoldHoldingReport_Raw>();
            //var rl2 = new Bla().GetWorldGoldReservesReports_2000To2015();

            var           connStrSettings = ConfigurationManager.ConnectionStrings.Cast <ConnectionStringSettings>().Single(x => x.Name == "GoldReserves");
            var           connStr         = connStrSettings.ConnectionString;
            List <string> names1;

            using (var db = new GoldReservesDbContext(connStr))
            {
                names1 = (from pen in db.PoliticalEntityNames
                          select pen).ToList().Select(pen => pen.Name).ToList();
            }
            var names2 = new SortedSet <string>(rl1.SelectMany(r => r.Rows).Concat(rl2.SelectMany(r => r.Rows)).Select(r => r.Name).Distinct());

            names2.ExceptWith(names1);
            StringBuilder sb = new StringBuilder();

            foreach (var name in names2)
            {
                sb.AppendLine(name);
            }
            File.WriteAllText("bla.txt", sb.ToString());
            Console.Read();
        }
Ejemplo n.º 2
0
        void blabla()
        {
//            Bla bla;
//
            List <Bla> blas;
            TimeSpan   ts   = TimeSpan.Zero;
            TimeSpan   ts1  = TimeSpan.FromTicks(1);
            var        days = new TimeSpan().Days;

            var type = new Bla().GetType();

//            List<string> strings = new List<string>();
//
//            var type = typeof(Bla);
//
//            blas = new List<Bla>();
//
//            var bla1 = new Bla();
//
//            var x = new List<Bla>();
//
//            blas = new List<Bla>();
//            int y = blas.Count;
//            int i = 3;
//            i++;
            blas = new List <Bla>();
            _output.WriteLine(blas.ToString());
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var connStrSetting = ConfigurationManager.ConnectionStrings["GoldReserves"];
            var connStr        = connStrSetting.ConnectionString;
            var reports_raw    = new Bla().GetWorldGoldReservesReports_2000To2015();

            reports_raw.Add(new Bla().GetWorldGoldReservesReportAsync_Latest().Result);
            using (var db = new GoldReservesDbContext(connStr))
            {
                foreach (var report_raw in reports_raw)
                {
                    var report = new WorldOfficialGoldHoldingReport();
                    report.DataTimePoint    = report_raw.DataTimePoint;
                    report.PublishTimePoint = report_raw.PublishTimePoint;
                    db.WorldOfficialGoldHoldingReports.Add(report);
                    db.SaveChanges();
                    db.Entry(report).State = EntityState.Detached;
                    foreach (var reportRow_raw in report_raw.Rows)
                    {
                        var row = new WorldOfficialGoldHoldingReportRow();
                        row.ReportDataTimePoint = report.DataTimePoint;
                        row.Tons = reportRow_raw.Tons;

                        var politicalEntity = db.GetPoliticalEntity(reportRow_raw.Name);
                        if (politicalEntity == null)
                        {
                        }
                        row.PoliticalEntityId = politicalEntity.Id;
                        db.WorldOfficialGoldHoldingReportRows.Add(row);
                        db.SaveChanges();
                        db.Entry(row).State = EntityState.Detached;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            string t1 = "asd";
            string t2 = "asd";

            //Assert.AreEqual je ovo:
            if (t1.Equals(t2))
            {
                Console.WriteLine("Jednaki su!");
            }

            object oA = new object();
            object oB = new object();

            if (oA.Equals(oB))
            {
                Console.WriteLine("Objekti su jednaki!");
            }

            Bla a = new Bla();
            Bla b = new Bla();

            if (a.Equals(b))
            {
                Console.WriteLine("Bla Jednaki su!");
            }
            Console.ReadLine();
        }
Ejemplo n.º 5
0
    void Repro()
    {
        int a = -1;
        int b = 10;

        P(b, a++);

        Bla c = () => P(b, ++a);

        P(b, a++);
    }
Ejemplo n.º 6
0
	public static int Main (string [] args) {
		for (int i = 0; i < 200; ++i) {
			Bla [] x = new Bla [256];
			if (i % 10 == 0)
				blas = x;
			for (int j = 0; j < 256; ++j)
				blas [j].o = new int [32];
			blas [1] = x [1];
		}
		return 0;
	}
Ejemplo n.º 7
0
 public static int Main(string [] args)
 {
     for (int i = 0; i < 200; ++i)
     {
         Bla [] x = new Bla [256];
         if (i % 10 == 0)
         {
             blas = x;
         }
         for (int j = 0; j < 256; ++j)
         {
             blas [j].o = new int [32];
         }
         blas [1] = x [1];
     }
     return(0);
 }
Ejemplo n.º 8
0
    public static int Main()
    {
        Bla <int> d = new Bla <int>();

        d.t = 99;
        Instance();

        AppDomain domain = AppDomain.CreateDomain("test");

        try {
            domain.ExecuteAssembly("Instance.exe");
        } catch (Exception e) {
            Console.WriteLine("assembly has thrown " + e);
            return(1);
        }
        return(0);
    }
    public static int Main()
    {
        GenStruct <object> gso = new GenStruct <object> ();
        GenStruct <string> gss = new GenStruct <string> ();

        if (gso.inc(1) != 2)
        {
            return(1);
        }
        if (gss.inc(2) != 3)
        {
            return(1);
        }

        if (gso.newArr().GetType() != typeof(object []))
        {
            return(1);
        }
        if (gss.newArr().GetType() != typeof(string []))
        {
            return(1);
        }

        Gen <string> g = new Gen <string> ();

        testInterface(g);

        NonGen ng = new NonGen();

        testInterface(ng);

        Bla bla = new Bla();

        string [] arr = { "a", "b", "c" };

        if (!bla.work(arr))
        {
            return(1);
        }

        return(0);
    }
Ejemplo n.º 10
0
        public static void M1()
        {
            const string expectedTrace = @"hw.TestDump+Bla
{
    Base:hw.TestDump+Bar
    {
        Base:hw.TestDump+Foo
        {
            X=20,
            S1=""FooString""
        }
    },
    Z=17,
    S1=""BlaString""
}";

            var xxx = new Bla();
            var s = Tracer.Dump(xxx);
            Tracer.Assert(s == expectedTrace.Replace("\r", ""), () => "\n--Epected--\n" + expectedTrace + "|----\n--Found--\n" + s + "|----\n");
        }
Ejemplo n.º 11
0
        public void TypeWalker_Visit_SimpleDict()
        {
            var bla = new Bla
            {
                Blas = new Dictionary <int, Bla1>
                {
                    { 1, new Bla1 {
                          Test = "t1"
                      } }, { 2, new Bla1 {
                                 Test = "t2"
                             } }
                }
            };

            var visitor = TypeWalker <Bla> .Create().ForProperty <Bla1, string>(b1 => b1.Test, (v, m) => "visited").Build(1);


            visitor.Visit(bla, null, 1);

            Assert.IsTrue(bla.Blas[1].Test == "visited" && bla.Blas[2].Test == "visited");
        }
 public static void DontThrow() => Bla.DoNothing();
Ejemplo n.º 13
0
 public void VoerUit(Bla functie)
 {
     Console.WriteLine("Martijn voert het volgende uit:");
     functie(42);
 }
Ejemplo n.º 14
0
 static Bla()
 {
     Empty = new Bla();
 }
Ejemplo n.º 15
0
 public virtual void Foo(Bla <T> self)
 {
 }