Skip to content

Commit 1c86afb

Browse files
authored
feat: adds lesson_09 homework and lesson_10 pre-work (code-differently#360)
Signed-off-by: Anthony D. Mays <[email protected]>
1 parent 11e52f4 commit 1c86afb

File tree

20 files changed

+968
-1
lines changed

20 files changed

+968
-1
lines changed

lesson_09/README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,32 @@ Please review the following resources before lecture:
1010

1111
## Homework
1212

13-
- TODO(anthonydmays): Assign homework details when available.
13+
- [ ] Complete [data types exercise](#choosing-the-right-data-types).
14+
15+
### Choosing the Right Data Types
16+
17+
For this exercise, you will use your knowledge of data types to identify the appropriate type to store and process data. You will run a program to generate a unique file with sample data, then write code to provide the correct data type of each column.
18+
19+
1. Execute the app providing a unique provider name.
20+
21+
```bash
22+
cd lesson_09/types
23+
./gradlew bootRun --args="yourprovidername" # Substitute with your own value
24+
```
25+
2. Examine the file that was created for you in the [resources/data][resources-folder] folder. The file will be formatted using the [JSON][json-link] data format.
26+
3. Next, you will create a `DataProvider` implementation that will provide information about the data types for the columns in the file (e.g. `column1`, `column2`, etc.). You can view the example [AnthonyMaysProvider.java][example-file] file.
27+
4. Customize the data types map by choosing the closest appropriate data type of each column. Each data type should only be used **once**.
28+
5. Make sure to apply the formatter and run the tests to confirm that you've implemented everything correctly.
29+
```bash
30+
./gradlew spotlessApply
31+
./gradlew check
32+
```
33+
6. You are to submit a PR with your `DataProvider` implementation and the generated `.json` file that was produced for you. All build checks must pass in order to receive full credit.
34+
35+
### Stretch Assignment - Bulk Sample Generator
36+
37+
In addition to completing the above assignment, you are tasked with adding a flag to the app that will allow it to bulk generate sample files dynamically for each `DataProvider` implementation. Add a short `README.md` doc in the `types_app` folder that explains how to run the app in this custom mode.
38+
39+
[json-link]: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON
40+
[resources-folder]: ./types/types_app/src/main/resources/data/
41+
[example-file]: ./types/types_app/src/main/java/com/codedifferently/lesson9/dataprovider/AnthonyMaysProvider.java

lesson_09/types/.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+

lesson_09/types/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directory
5+
build
42.6 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

lesson_09/types/gradlew

Lines changed: 252 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)