Example #1
0
        static void Main(string[] args)
        {
            //CrossJoin();
            LinqToTwitter.QueryExpression();

            //Functions.CreateTask(@"d:\temp\infile.txt", @"d:\temp\outfile.txt");
            //Tuple<string, decimal> tuple1 = new Tuple<string, decimal>("Surface Pro 4", 899M);
            //var generic = Generic.Create(new
            //{
            //    Name = "Surface Book",
            //    Price = 1349.00M
            //});
            //var generic2 = new
            //{
            //    Name = "Surface Book",
            //    Price = 1349.00M
            //};
            //var immutableDevice = new { Name = "Surface Book", Price = 1349.00M };
            ////var mapped1 = from zero in new[] { 0 } select zero; // 0
            //var mapped1 = from zero in 0 select zero; // 0
            //var mapped2 = from three in 1 + 2 select Math.Sqrt(three + 1);
            //var mapped3 = new[] { 0 }.Select(zero => zero); // 0
            //string mapped = from newGuid in Guid.NewGuid() select newGuid.ToString();
            //FluentListHandler();
            //ComposeLinq();
            //QueryMethods();

            //open a 4GB file for asynchronous reading in blocks of 64K
            //var inFile = new FileStream(@"d:\temp\4GBfile.txt",
            //            FileMode.Open, FileAccess.Read, FileShare.Read, 2 << 15, true);
            //open a file for asynchronous writing in blocks of 64K
            //var outFile = new FileStream(@"d:\temp\Encrypted.txt",
            //    FileMode.OpenOrCreate, FileAccess.Write, FileShare.None, 2 << 15, true);

            //inFile.AsyncRead(2 << 15).Select(Encrypt).WriteToStream(outFile).Subscribe(
            //    _ => Console.WriteLine("Successfully encrypted the file."),
            //    error => Console.WriteLine("An error occurred while encrypting the file: {0}", error.Message));


            //Func<double, double> sqrt = Math.Sqrt;
            //Func<double, double> abs = Math.Abs;
            //Func<double, double> log = Math.Log;

            //CallAnd();

            //var absSqrt = sqrt.Compose(abs);
            //Console.WriteLine("absSqrt = " + absSqrt(-2));

            //var absSqrtLog1 = log.Compose(sqrt).Compose(abs);
            //var absSqrtLog2 = log.Compose(sqrt.Compose(abs));

            //Console.WriteLine("absSqrtLog1 = " + absSqrtLog1(-2));
            //Console.WriteLine("absSqrtLog2 = " + absSqrtLog2(-2));



            Console.ReadKey();
        }