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.util.*; | |
/** | |
* A lightweight JSON parser and printer utility class. | |
* This class provides functionality to parse JSON strings into Java objects and | |
* convert Java objects back to JSON strings. | |
* | |
* <p>The parser supports all standard JSON data types: | |
* <ul> | |
* <li>Objects ({@code Map<String, Object>})</li> |
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 jbang "$0" "$@" ; exit $? | |
//JAVA 21+ | |
//PREVIEW | |
//COMPILE_OPTIONS --add-modules=jdk.incubator.vector | |
//RUNTIME_OPTIONS --add-modules=jdk.incubator.vector | |
//DEPS dev.langchain4j:langchain4j:0.35.0 | |
//SOURCES https://github.com/mukel/llama3.java/blob/main/Llama3.java |
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.reflect.Method; | |
import java.net.URL; | |
import java.net.URLClassLoader; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; | |
import org.graalvm.polyglot.Context; | |
import org.graalvm.polyglot.Value; |
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 info.mukel.telegrambot4s.client | |
import java.nio.file.Files | |
import info.mukel.telegrambot4s.api.RequestHandler | |
import info.mukel.telegrambot4s.marshalling.JsonMarshallers | |
import info.mukel.telegrambot4s.methods.{ApiRequest, ApiRequestJson, ApiRequestMultipart, ApiResponse} | |
import info.mukel.telegrambot4s.models.InputFile | |
import scala.concurrent.{ExecutionContext, Future} |
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 info.mukel.telegrambot4s.examples | |
import akka.actor.{Actor, ActorRef, Props, Terminated} | |
import info.mukel.telegrambot4s.actors.{ActorDispatcher} | |
import info.mukel.telegrambot4s.api.{AkkaDefaults, Commands, Polling} | |
import info.mukel.telegrambot4s.models.{Message, Update} | |
class ActorBot(token: String) extends TestBot(token) with Polling with Commands with PerChatDispatcher { | |
on("/hello") { implicit msg => _ => | |
reply("Hello World!") |
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
IntRRBVector(0 until /*32^5*/33554432 : _*).foreach(_ => ()) // OK | |
IntRRBVector(0 until /*32^5 + 1*/33554433 : _*).foreach(_ => ()) // ClassCastException | |
IntRRBVector(0 until /*32^5 + 1*/33554433 : _*).apply(1024) // NPE | |
// https://github.com/nicolasstucki/scala-rrb-vector | |
RRBVector.fill(/*32^5*/33554432)(0).foreach(_ => ()) // OK | |
RRBVector.fill(/*32^5 + 1*/ 33554433)(0).apply(1024) // NPE | |
RRBVector.fill(/*32^5 + 1*/33554433)(0).foreach(_ => ()) // ClassCastException |