Skip to content

Commit 663caa8

Browse files
authored
Merge branch 'code-differently:main' into lesson_07-homework
2 parents e466f99 + b01aa8a commit 663caa8

34 files changed

+7408
-1
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check Lesson 10 Pull Request
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
paths:
7+
- "lesson_10/libraries/**"
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20.x'
23+
24+
- name: Build Lesson 10 with Node.js
25+
working-directory: ./lesson_10/libraries
26+
run: |
27+
npm ci
28+
npm run check

.github/workflows/check_push.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,13 @@ jobs:
9393
run: |
9494
npm ci
9595
npm run compile
96+
97+
- name: Build Lesson 09 with Gradle
98+
working-directory: ./lesson_09/types
99+
run: ./gradlew check
100+
101+
- name: Build Lesson 10 with Node.js
102+
working-directory: ./lesson_10/libraries
103+
run: |
104+
npm ci
105+
npm run compile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.codedifferently.lesson9.dataprovider;
2+
3+
import java.util.Map;
4+
import org.springframework.stereotype.Service;
5+
6+
@Service
7+
public class JustinEklundProvider extends DataProvider {
8+
public String getProviderName() {
9+
return "justineklund";
10+
}
11+
12+
public Map<String, Class> getColumnTypeByName() {
13+
return Map.of(
14+
"column1", Integer.class,
15+
"column2", Boolean.class,
16+
"column3", Long.class,
17+
"column4", Short.class,
18+
"column5", Float.class,
19+
"column6", String.class,
20+
"column7", Double.class);
21+
}
22+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
[
2+
{
3+
"column1": "230807907",
4+
"column2": "true",
5+
"column3": "8645227072891146240",
6+
"column4": "28551",
7+
"column5": "2.1192128E38",
8+
"column6": "ru7xl9if3mo",
9+
"column7": "1.5275217119431736E308"
10+
},
11+
{
12+
"column1": "1362138647",
13+
"column2": "true",
14+
"column3": "3072684200071159296",
15+
"column4": "28232",
16+
"column5": "3.154274E38",
17+
"column6": "f75vha",
18+
"column7": "6.968468385114055E307"
19+
},
20+
{
21+
"column1": "124161358",
22+
"column2": "false",
23+
"column3": "1037054585818667136",
24+
"column4": "8709",
25+
"column5": "1.5492957E38",
26+
"column6": "wjz9g8f5a",
27+
"column7": "4.0852455107533157E307"
28+
},
29+
{
30+
"column1": "2030985979",
31+
"column2": "true",
32+
"column3": "7250041934685317120",
33+
"column4": "2092",
34+
"column5": "5.258761E37",
35+
"column6": "atpe24mc0",
36+
"column7": "6.740296505752764E307"
37+
},
38+
{
39+
"column1": "675049065",
40+
"column2": "true",
41+
"column3": "3709042776218381824",
42+
"column4": "13619",
43+
"column5": "1.6491017E38",
44+
"column6": "tb16h25rgq",
45+
"column7": "1.114940006470573E308"
46+
},
47+
{
48+
"column1": "940064617",
49+
"column2": "false",
50+
"column3": "7065150792820614144",
51+
"column4": "141",
52+
"column5": "3.121821E38",
53+
"column6": "px8d714vjo",
54+
"column7": "3.530672982578613E307"
55+
},
56+
{
57+
"column1": "1187996364",
58+
"column2": "true",
59+
"column3": "4810281495975135232",
60+
"column4": "19994",
61+
"column5": "2.9382885E38",
62+
"column6": "obrvtsqp",
63+
"column7": "1.1624783396419216E308"
64+
},
65+
{
66+
"column1": "1696026073",
67+
"column2": "true",
68+
"column3": "3536375390439235072",
69+
"column4": "16256",
70+
"column5": "5.403852E37",
71+
"column6": "nqs5iuz",
72+
"column7": "1.2287972578428365E308"
73+
},
74+
{
75+
"column1": "635612499",
76+
"column2": "true",
77+
"column3": "4405334814620081152",
78+
"column4": "9483",
79+
"column5": "1.0899577E38",
80+
"column6": "5ionvj",
81+
"column7": "1.1828677377904305E308"
82+
},
83+
{
84+
"column1": "1262184804",
85+
"column2": "true",
86+
"column3": "2719636247843734016",
87+
"column4": "7516",
88+
"column5": "4.6609783E37",
89+
"column6": "nzlb9xugc",
90+
"column7": "7.795935895060999E307"
91+
}
92+
]

lesson_10/README.md

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

1111
## Homework
1212

13-
- TODO(anthonydmays): Finish this
13+
- [ ] Complete [Loading the Media Collection](#loading-the-media-collection) assignment.
14+
- [ ] Do pre-work for [lesson 11](/lesson_11/).
15+
16+
### Loading The Media Collection
17+
18+
For this assignment, you are tasked with writing code to load data from a set of CSV files.
19+
20+
* Use the example loader file at [libraries/src/loaders/anthony_mays_loader.ts][example-loader-file] to make your own unique copy of the loader.
21+
* Implement the `loadMediaItems` method by loading the data from the [data/media_items.csv][media-items-file] file.
22+
23+
To try out the app with your loader, you can run the following command.
24+
25+
```bash
26+
npm run compile
27+
npm start -- --loader yourLoaderNameHere
28+
```
29+
30+
Before submitting your work, be sure to run the tests.
31+
32+
```bash
33+
npm run test
34+
```
35+
36+
### Extra credit
37+
38+
For additional credit on this assignment, combine the credits with the media items you loaded by modifying the `loadData` method. You can test that you've loaded everything correctly by using this special command:
39+
40+
```bash
41+
LOADER_NAME=yourLoaderNameHere npm run test
42+
```
43+
44+
[example-loader-file]: ./libraries/src/loaders/anthony_mays_loader.ts
45+
[media-items-file]: ./libraries/data/media_items.csv

lesson_10/libraries/.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
insert_final_newline = true
9+
quote_type = single

lesson_10/libraries/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/

lesson_10/libraries/.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore artifacts:
2+
build
3+
coverage

lesson_10/libraries/.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)