Thursday, December 19, 2013

How to access Google spreadsheet by C#?

            SpreadsheetsService myService = new SpreadsheetsService("test");
            myService.setUserCredentials("AAA@gmail.com", "password");

            SpreadsheetQuery query = new SpreadsheetQuery();
            SpreadsheetFeed feed = myService.Query(query);

            Console.WriteLine("Your spreadsheets:");
            foreach (SpreadsheetEntry entry in feed.Entries)
            {
                Console.WriteLine(entry.Title.Text);
            }
API download link:
https://code.google.com/p/google-gdata/downloads/detail?name=Google_Data_API_Setup_2.2.0.0.msi&can=2&q=

http://stackoverflow.com/questions/725627/accessing-google-spreadsheets-with-c-sharp-using-google-data-api

Data Structure Visualizations

http://www.cs.usfca.edu/~galles/visualization/Algorithms.html

Why use Tuple in C#?

1. To pass or return a group of values in single parameter
2. To create a temp record for a set of data without making a new class for it.

var population = Tuple.Create("New York", 7891957, 7781984, 7894862, 7071639, 7322564, 8008278);
Console.WriteLine("Population of {0} in 2000: {1:N0}",
                  population.Item1, population.Item7);
References:
http://msdn.microsoft.com/en-us/library/system.tuple(v=vs.110).aspx
http://stackoverflow.com/questions/3089706/what-requirement-was-the-tuple-designed-to-solve