🙇♂️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dev.tpcoder.reactivedockercompose.book.Book; | |
import dev.tpcoder.reactivedockercompose.book.BookRepository; | |
import org.springframework.boot.ApplicationRunner; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.context.annotation.Bean; | |
import reactor.core.publisher.Flux; | |
import java.util.List; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public record Book(Long id, String title, String isbn) { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.1' | |
services: | |
db: | |
image: postgres | |
environment: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: p@ssw0rd | |
POSTGRES_DB: book | |
ports: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM rust:1.68.0 as builder | |
WORKDIR /app | |
COPY ./Cargo.lock ./Cargo.lock | |
COPY ./Cargo.toml ./Cargo.toml | |
COPY ./src ./src | |
RUN cargo build --release | |
RUN rm src/*.rs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ghcr.io/graalvm/graalvm-ce:22.3.1 | |
WORKDIR /app | |
ADD . /app | |
RUN gu install native-image | |
RUN native-image --version | |
RUN ./gradlew nativeCompile | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class Circle(val radius: Double) { | |
fun getArea(): Double { | |
return Math.PI * radius * radius | |
} | |
} | |
fun main(args: Array<String>) { | |
val c = Circle(5.0) | |
println("The area of the circle is ${c.getArea()}") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define the data set | |
data = [1, 2, 2, 3, 3, 3, 4] | |
# calculate the mean | |
mean = sum(data) / len(data) | |
print("Mean:", mean) # Mean: 2.5714285714285716 | |
# calculate the median | |
data.sort() | |
if len(data) % 2 == 0: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A = [[1, 2], | |
[3, 4]] # 2 x 2 | |
B = [[5, 6], | |
[7, 8]] # 2 x 2 | |
D = [[5, 6], | |
[7, 8], | |
[9, 10]] # 2 x 3 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def order_fried_chicken(): | |
# Decide on type of chicken | |
chicken_type = input("Would you like to order chicken nuggets or a whole chicken? ") | |
# Order sides or not | |
order_sides = False | |
sides_choice = input("Would you like to order any sides with your chicken? ") | |
if sides_choice.lower() == "yes": | |
order_sides = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dev.tpcoder.bffjav; | |
import dev.tpcoder.bffjav.client.DriverClient; | |
import dev.tpcoder.bffjav.client.LocationClient; | |
import dev.tpcoder.bffjav.model.Driver; | |
import dev.tpcoder.bffjav.model.Location; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.http.MediaType; |