{"id":18572788,"url":"https://github.com/truecodersio/katalogging","last_synced_at":"2025-07-12T15:34:02.199Z","repository":{"id":117009944,"uuid":"129111545","full_name":"truecodersio/KataLogging","owner":"truecodersio","description":"C# Logging and Parsing","archived":false,"fork":false,"pushed_at":"2018-08-08T23:06:32.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-15T23:11:16.143Z","etag":null,"topics":["csharp","kata"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/truecodersio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-04-11T15:02:42.000Z","updated_at":"2018-04-23T13:53:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"fdf8e26f-f28b-4893-937e-5e6ddfce6cdc","html_url":"https://github.com/truecodersio/KataLogging","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/truecodersio/KataLogging","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2FKataLogging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2FKataLogging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2FKataLogging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2FKataLogging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/truecodersio","download_url":"https://codeload.github.com/truecodersio/KataLogging/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2FKataLogging/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265013519,"owners_count":23698056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","kata"],"created_at":"2024-11-06T23:07:12.576Z","updated_at":"2025-07-12T15:34:02.192Z","avatar_url":"https://github.com/truecodersio.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LoggingKata\n\nAn exercise in geolocation, csv parsing, and logging\n\n## Kata Overview\n\nHere's what you'll need to do for this Kata:\n\n1. Clone this repo to your machine, then create a branch to accomplish your work (`git checkout -b your-branch-name`)\n2. Complete all the `TODO`s, while adding appropriate log statements along the way. You can find more details below in the Kata Details section:\n    1. Start with writing a Unit Test to Test the Parse method\n    2. Implement the Parse Method\n    3. Use the [GeoCoordinate.NetCore](https://www.nuget.org/packages/GeoCoordinate.NetCore/) NuGet package to calculate distance between two points\n3. Reduce the logging verbosity and rerun\n4. Push your changes (`git push`), create a pull request, and add request a review from your instructor.\n\n## Kata Details\n\nHere's some more details for completing the steps above.\n\n### TacoParser\n\nUpdating the `Parse` method in your `TacoParser`\n\nThis method is used to parse a single row from your CSV file as a string and return an ITrackable:\n\n```csharp\npublic ITrackable Parse(string line)\n{\n    // Take your line and use line.Split(',') to split it up into an array of strings, separated by the char ','\n    var cells = line.Split(',');\n\n    // If your array.Length is less than 3, something went wrong\n    if (cells.Length \u003c 3)\n    {\n        // Log that and return null\n    }\n\n    // grab the long from your array at index 0\n    // grab the lat from your array at index 1\n    // grab the name from your array at index 2\n\n    // Your going to need to parse your string as a `double`\n    // which is similar to parse a string as an `int`\n\n    // You'll need to create a TacoBell class\n    // that conforms to ITrackable\n\n    // Then, you'll need an instance of the TacoBell class\n    // With the name and point set correctly\n\n    // Then, return the instance of your TacoBell class\n    // Since it conforms to ITrackable\n}\n```\n\n### Program\n\nYou now have your `Parse` method working properly. Now, let's get into our Program file in our `Main` static method.\n\n```csharp\nstatic void Main(string[] args)\n{\n    // DON'T FORGET TO LOG YOUR STEPS\n    // Grab the path from the name of your file\n\n    // use File.ReadAllLines(path) to grab all the lines from your csv file\n    // Log and error if you get 0 lines and a warning if you get 1 line\n\n    // Create a new instance of your TacoParser class\n    // Grab an IEnumerable of locations using the Select command: var locations = lines.Select(line =\u003e parser.Parse(line));\n\n    // Now, here's the new code\n\n    // Create two `ITrackable` variables with initial values of `null`. These will be used to store your two taco bells that are the furthest from each other.\n    // Create a `double` variable to store the distance\n\n    // Include the Geolocation toolbox, so you can compare locations: `using GeoCoordinatePortable;`\n    // Do a loop for your locations to grab each location as the origin (perhaps: `locA`)\n    // Create a new corA Coordinate with your locA's lat and long\n\n    // Now, do another loop on the locations with the scope of your first loop, so you can grab the \"destination\" location (perhaps: `locB`)\n    // Create a new Coordinate with your locB's lat and long\n    // Now, compare the two using `origin.GetDistanceTo(distance)`, which returns a double\n    // If the distance is greater than the currently saved distance, update the distance and the two `ITrackable` variables you set above\n\n    // Once you've looped through everything, you've found the two Taco Bells furthest away from each other.\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruecodersio%2Fkatalogging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftruecodersio%2Fkatalogging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruecodersio%2Fkatalogging/lists"}