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
| void main() { | |
| IO.println("rock/paper/scissors:"); | |
| var u = IO.readln(); | |
| if (u.equals("exit")) return; | |
| var c = "rock,paper,scissors".split(","); | |
| var i = List.of(c).indexOf(u); | |
| if (i < 0) return; | |
| var j = new Random().nextInt(3); | |
| IO.println("Computer: " + c[j]); | |
| IO.println(i == j ? "Tie!" : (i == (j + 1) % 3 ? "You win!" : "Computer wins!")); |
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
| void main() { | |
| var s = """ | |
| void main() { | |
| var s = %c%c%c | |
| %s%c%c%c; | |
| IO.print(String.format(s, 34, 34, 34, s, 34, 34, 34)); | |
| }"""; | |
| IO.print(String.format(s, 34, 34, 34, s, 34, 34, 34)); | |
| } |
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
| #!/usr/bin/env bash | |
| # check-jvm-env-precedence.sh | |
| # Pairwise precedence test for: _JAVA_OPTIONS, JAVA_TOOL_OPTIONS, JDK_JAVA_OPTIONS | |
| set -euo pipefail | |
| say() { printf "%s\n" "$*"; } | |
| hr() { printf "%s\n" "----------------------------------------"; } | |
| # Tiny source-file program |
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
| [ | |
| { | |
| "id": 389291, | |
| "title": "Kotlin Multiplatform Conversions at Android Jetpack Scale", | |
| "description": "This is a case study of how we converted several Jetpack libraries to Kotlin Multiplatform as part of our ongoing experimentation with the multiplatform technology." | |
| }, | |
| { | |
| "id": 405587, | |
| "title": "Compose Multiplatform on iOS", | |
| "description": "An overview of the exciting present and future of Compose Multiplatform, including live demos and how to get started with the latest additions to the multiplatform UI framework built by JetBrains." |
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 java.lang.management.ManagementFactory; | |
| public class App { | |
| public static void main(String[] args) { | |
| long currentTime = System.currentTimeMillis(); | |
| long startTime = ManagementFactory.getRuntimeMXBean().getStartTime(); | |
| System.out.println("JVM Startup time: " + (currentTime - startTime)); | |
| } | |
| } |
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
| #!/bin/bash | |
| set -x | |
| function setenv-all-pods() { | |
| echo | |
| DEPLOYMENT_LIST=$(kubectl -n $1 get deployment -o jsonpath='{.items[*].metadata.name}') | |
| echo "Set Log4J setting for all pods by overriding LOG4J_FORMAT_MSG_NO_LOOKUPS with true." | |
| for deployment_name in $DEPLOYMENT_LIST; do | |
| kubectl -n $1 set env deployment $deployment_name LOG4J_FORMAT_MSG_NO_LOOKUPS="true" | |
| done |
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
| //DEPS org.openjfx:javafx-controls:11.0.2:${os.detected.jfxname} | |
| //DEPS org.openjfx:javafx-graphics:11.0.2:${os.detected.jfxname} | |
| import javafx.application.Application; | |
| import javafx.scene.Scene; | |
| import javafx.scene.control.Label; | |
| import javafx.scene.layout.StackPane; | |
| import javafx.stage.Stage; | |
| public class hello extends Application { |
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
| dotnet_grpc_bench.report: Average: 1.32 ms | |
| dotnet_grpc_bench.report- Requests/sec: 36510.82 | |
| dotnet_grpc_bench.report- | |
| -- | |
| dotnet_grpc_bench.report: 90 % in 1.77 ms | |
| dotnet_grpc_bench.report- 95 % in 2.10 ms | |
| dotnet_grpc_bench.report- 99 % in 3.93 ms | |
| -- | |
| go_grpc_bench.report: Average: 0.97 ms | |
| go_grpc_bench.report- Requests/sec: 49283.43 |
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
| # [toml] | |
| # version = 2 | |
| # schema = config.tosd | |
| title = "TOML Example" | |
| [owner] | |
| name = "Tom Preston-Werner" | |
| dob = 1979-05-27T07:32:00-08:00 # First class dates |
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 class ConsumeSingleton { | |
| public ConsumeSingleton() { | |
| HttpClient._.call(...); | |
| HttpClient.get.call(...); | |
| HttpClient.INSTANCE.call(...); | |
| } | |
| } |
NewerOlder