🙇♂️
This file contains 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 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 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 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 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 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; |
This file contains 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.client; | |
import dev.tpcoder.bffjav.model.Driver; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.codec.multipart.FilePart; | |
import org.springframework.web.bind.annotation.PathVariable; | |
import org.springframework.web.bind.annotation.PostMapping; | |
import org.springframework.web.bind.annotation.RequestBody; | |
import org.springframework.web.bind.annotation.RequestPart; | |
import org.springframework.web.service.annotation.GetExchange; |
This file contains 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.config; | |
import dev.tpcoder.bffjav.client.DriverClient; | |
import dev.tpcoder.bffjav.client.LocationClient; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.messaging.rsocket.RSocketRequester; | |
import org.springframework.messaging.rsocket.service.RSocketServiceProxyFactory; | |
import org.springframework.web.service.invoker.HttpClientAdapter; | |
import org.springframework.web.service.invoker.HttpServiceProxyFactory; |
This file contains 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.config; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.http.HttpStatusCode; | |
import org.springframework.http.codec.cbor.Jackson2CborDecoder; | |
import org.springframework.http.codec.cbor.Jackson2CborEncoder; | |
import org.springframework.messaging.rsocket.RSocketRequester; |
This file contains 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.location | |
import org.slf4j.LoggerFactory | |
import org.springframework.messaging.handler.annotation.* | |
import org.springframework.stereotype.Controller | |
import reactor.core.publisher.Flux | |
import java.time.Duration | |
@Controller | |
class LocationController { |