Skip to content

Commit 319f976

Browse files
authored
Merge branch 'code-differently:main' into lesson_10_homework
2 parents 928ee59 + 396507b commit 319f976

File tree

30 files changed

+7094
-2
lines changed

30 files changed

+7094
-2
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Check Lesson 11 Pull Request
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
paths:
7+
- "lesson_11/arrays_java/**"
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: Set up JDK
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '21'
23+
distribution: 'temurin'
24+
25+
- name: Build Lesson 11 with Java
26+
working-directory: ./lesson_11/arrays_java
27+
run: ./gradlew check
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check Lesson 11 Pull Request
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
paths:
7+
- "lesson_11/arrays_ts/**"
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 11 with Node.js
25+
working-directory: ./lesson_11/arrays_ts
26+
run: |
27+
npm ci
28+
npm run check

.github/workflows/check_push.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
- "lesson_06/quiz/**"
1212
- "lesson_06/expression/**"
1313
- "lesson_07/conditionals/**"
14+
- "lesson_09/types/**"
15+
- "lesson_10/libraries/**"
16+
- "lesson_11/arrays_java/**"
17+
- "lesson_11/arrays_ts/**"
1418
jobs:
1519
build:
1620
runs-on: ubuntu-latest
@@ -103,3 +107,13 @@ jobs:
103107
run: |
104108
npm ci
105109
npm run compile
110+
111+
- name: Build Lesson 11 with Java
112+
working-directory: ./lesson_11/arrays_java
113+
run: ./gradlew assemble
114+
115+
- name: Build Lesson 11 with Node.js
116+
working-directory: ./lesson_11/arrays_ts
117+
run: |
118+
npm ci
119+
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 ChanelHuttProvider extends DataProvider {
8+
public String getProviderName() {
9+
return "chanelhutt";
10+
}
11+
12+
public Map<String, Class> getColumnTypeByName() {
13+
return Map.of(
14+
"column1", Double.class,
15+
"column2", Short.class,
16+
"column3", Integer.class,
17+
"column4", String.class,
18+
"column5", Long.class,
19+
"column6", Boolean.class,
20+
"column7", Float.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": "1.731075412920716E308",
4+
"column2": "19176",
5+
"column3": "733205455",
6+
"column4": "haxpw7g",
7+
"column5": "1157940937089738496",
8+
"column6": "false",
9+
"column7": "2.459581E37"
10+
},
11+
{
12+
"column1": "2.2465348083056824E307",
13+
"column2": "21719",
14+
"column3": "1332875183",
15+
"column4": "ev5bksjy7mz3",
16+
"column5": "2433500635024735232",
17+
"column6": "false",
18+
"column7": "1.0160553E38"
19+
},
20+
{
21+
"column1": "9.114475329125451E306",
22+
"column2": "22876",
23+
"column3": "1941625523",
24+
"column4": "0umiwpak",
25+
"column5": "2117973580872942080",
26+
"column6": "false",
27+
"column7": "1.7494759E38"
28+
},
29+
{
30+
"column1": "1.228449265255592E307",
31+
"column2": "21165",
32+
"column3": "1604518885",
33+
"column4": "tnecirkhowg",
34+
"column5": "8671624959944894464",
35+
"column6": "false",
36+
"column7": "3.4007451E38"
37+
},
38+
{
39+
"column1": "3.900189719800849E307",
40+
"column2": "861",
41+
"column3": "133068872",
42+
"column4": "6yt2rpo8egs7",
43+
"column5": "2144446409450103040",
44+
"column6": "true",
45+
"column7": "2.6716434E38"
46+
},
47+
{
48+
"column1": "1.6560886655049307E308",
49+
"column2": "30429",
50+
"column3": "1200814099",
51+
"column4": "slo4b",
52+
"column5": "4165282877190061568",
53+
"column6": "false",
54+
"column7": "1.2459889E38"
55+
},
56+
{
57+
"column1": "2.3503323112186533E307",
58+
"column2": "4738",
59+
"column3": "1211063412",
60+
"column4": "39ghf5n04",
61+
"column5": "8351477286928983040",
62+
"column6": "true",
63+
"column7": "1.5175942E38"
64+
},
65+
{
66+
"column1": "1.0540459020911906E306",
67+
"column2": "5685",
68+
"column3": "1214520000",
69+
"column4": "y65w912l47",
70+
"column5": "6563929531867928576",
71+
"column6": "true",
72+
"column7": "1.7849906E38"
73+
},
74+
{
75+
"column1": "3.686407320819559E307",
76+
"column2": "28996",
77+
"column3": "1411969638",
78+
"column4": "t0jg47n1vz",
79+
"column5": "6811264016170342400",
80+
"column6": "false",
81+
"column7": "3.0525288E38"
82+
},
83+
{
84+
"column1": "7.473392367859956E307",
85+
"column2": "15836",
86+
"column3": "1137183814",
87+
"column4": "95qrap07h",
88+
"column5": "516976948379531328",
89+
"column6": "true",
90+
"column7": "7.8719054E37"
91+
}
92+
]

lesson_11/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ Please review the following resources before lecture:
99

1010
## Homework
1111

12-
- TODO(anthonydmays): Come up with something
12+
- [ ] Complete methods in [Lesson11.java](./arrays_java/arrays_app/src/main/java/com/codedifferently/lesson11/Lesson11.java) and submit PR.
13+
- [ ] Do pre-work for [lesson 12](/lesson_12/).
14+
15+
### Extra credit
16+
17+
- [ ] Complete TypeScript version of methods in [Lesson11.ts](./arrays_ts/src/lesson11.ts) and submit PR.

lesson_11/arrays_java/.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_11/arrays_java/.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
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
plugins {
2+
// Apply the application plugin to add support for building a CLI application in Java.
3+
application
4+
eclipse
5+
id("com.diffplug.spotless") version "6.25.0"
6+
id("org.springframework.boot") version "3.4.0"
7+
id("com.adarshr.test-logger") version "4.0.0"
8+
}
9+
10+
apply(plugin = "io.spring.dependency-management")
11+
12+
repositories {
13+
// Use Maven Central for resolving dependencies.
14+
mavenCentral()
15+
}
16+
17+
dependencies {
18+
// Use JUnit Jupiter for testing.
19+
testImplementation("com.codedifferently.instructional:instructional-lib")
20+
testImplementation("org.junit.jupiter:junit-jupiter:5.11.3")
21+
testImplementation("org.springframework.boot:spring-boot-starter-test")
22+
testImplementation("org.assertj:assertj-core:3.26.3")
23+
testImplementation("at.favre.lib:bcrypt:0.10.2")
24+
25+
// This dependency is used by the application.
26+
implementation("com.codedifferently.instructional:instructional-lib")
27+
implementation("com.google.guava:guava:33.3.1-jre")
28+
implementation("com.google.code.gson:gson:2.11.0")
29+
implementation("org.projectlombok:lombok:1.18.30")
30+
implementation("org.springframework.boot:spring-boot-starter")
31+
}
32+
33+
application {
34+
// Define the main class for the application.
35+
mainClass.set("com.codedifferently.lesson11.Lesson11")
36+
}
37+
38+
tasks.named<Test>("test") {
39+
// Use JUnit Platform for unit tests.
40+
useJUnitPlatform()
41+
}
42+
43+
44+
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
45+
46+
format("misc", {
47+
// define the files to apply `misc` to
48+
target("*.gradle", ".gitattributes", ".gitignore")
49+
50+
// define the steps to apply to those files
51+
trimTrailingWhitespace()
52+
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
53+
endWithNewline()
54+
})
55+
56+
java {
57+
// don't need to set target, it is inferred from java
58+
59+
// apply a specific flavor of google-java-format
60+
googleJavaFormat()
61+
// fix formatting of type annotations
62+
formatAnnotations()
63+
}
64+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.codedifferently.lesson11;
2+
3+
import java.util.List;
4+
5+
public class Lesson11 {
6+
7+
/**
8+
* Provide the solution to LeetCode 1929 here:
9+
* https://leetcode.com/problems/concatenation-of-array
10+
*/
11+
public int[] getConcatenation(int[] nums) {
12+
return null;
13+
}
14+
15+
/**
16+
* Provide the solution to LeetCode 2942 here:
17+
* https://leetcode.com/problems/find-words-containing-character/
18+
*/
19+
public List<Integer> findWordsContaining(String[] words, char x) {
20+
return null;
21+
}
22+
}

0 commit comments

Comments
 (0)