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
# Kotlin Style Guidelines | |
This document outlines the preferred coding style for Kotlin projects. | |
## General Principles | |
- **Prefer functional style** over imperative approaches when appropriate | |
- **Use immutable data structures** (`val`, immutable collections) by default | |
- **Use extension functions liberally** to enhance existing classes without inheritance | |
- Follow Kotlin's official [coding conventions](https://kotlinlang.org/docs/coding-conventions.html) |
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 os | |
import gradio as gr | |
import fitz # PyMuPDF | |
import sqlite3 | |
from datetime import datetime | |
import uuid | |
from openai import OpenAI | |
import tiktoken | |
import json | |
import logging |
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.akif.periodik | |
import dev.akif.periodik | |
import kotlinx.coroutines.* | |
import org.junit.jupiter.api.Timeout | |
import org.slf4j.Logger | |
import org.slf4j.LoggerFactory | |
import kotlin.random.Random | |
import kotlin.reflect.KProperty | |
import kotlin.test.Test |
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
1) Which code is faster? | |
You said that when project Loom is implemented in Java 21 current projects (that are using sequential code) can benefit just by upgrading to Java 21. | |
Do you mean: | |
a) This counts for all code. | |
b) This counts for all multithreaded code. | |
c) This counts for all multithreaded code after it is rewritten to the virtual thread style. | |
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
if [ $# -eq 0 ] | |
then | |
echo -n "Enter amount of cluster nodes: " | |
read NODES | |
else | |
NODES=$1 | |
fi | |
echo $NODES |
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 com.material | |
import spray.routing.Route | |
import spray.routing.HttpServiceActor | |
import akka.actor.ActorSystem | |
import spray.http.HttpCookie | |
import akka.io.IO | |
import spray.can.Http | |
import akka.actor.Props | |
import java.util.UUID |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 snippets | |
object DIExamples { | |
/* | |
* http://jonasboner.com/2008/10/06/real-world-scala-dependency-injection-di.html | |
* http://debasishg.blogspot.com/2011/03/pushing-envelope-on-oo-and-functional.html | |
* http://www.assembla.com/wiki/show/liftweb/Dependency_Injection | |
*/ | |