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
| using System; | |
| using UnityEngine; | |
| #if UNITY_EDITOR | |
| using UnityEditor; | |
| #endif | |
| public class TitleInspectorDecorum : MonoBehaviour | |
| { | |
| #if UNITY_EDITOR | |
| [SerializeField] private string text = ""; |
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.io.File | |
| import kotlin.io.path.Path | |
| fun main(args: Array<String>) { | |
| println("Write stl path file to convert: ") | |
| val stlPath = readln() | |
| val triangles = STLParser.parseSTLFile(Path(stlPath)) | |
| val (points, connections) = trianglesToPointsAndConnections(triangles) | |
| val resultPath = "$stlPath.converted.json" | |
| val state = """ |
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
| --- table.insertAll | |
| --- @generic T | |
| --- @param a T[] | |
| --- @param b T[] | |
| function table.insertAll(a, b) | |
| for _, v in pairs(b) do | |
| table.insert(a, v) | |
| end | |
| end |
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 components | |
| import androidx.compose.desktop.ui.tooling.preview.Preview | |
| import androidx.compose.foundation.clickable | |
| import androidx.compose.foundation.layout.* | |
| import androidx.compose.foundation.lazy.LazyRow | |
| import androidx.compose.foundation.lazy.itemsIndexed | |
| import androidx.compose.material.Icon | |
| import androidx.compose.material.IconButton | |
| import androidx.compose.material.OutlinedTextField |
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 kotlin.properties.ReadOnlyProperty | |
| import kotlin.reflect.KProperty | |
| interface AnimatedSlide<in T, out Slide> : ReadOnlyProperty<T, Slide> { | |
| val currentSlide: Slide | |
| override fun getValue(thisRef: T, property: KProperty<*>) = currentSlide | |
| class VarargImpl<in T, out Slide>(private vararg val slides: Slide) : AnimatedSlide<T, Slide> { | |
| private var i = 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
| #include "ArrayList.h" | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #define INITIAL_SIZE 10 | |
| struct ArrayListImpl { | |
| struct List list; | |
| void **values; | |
| unsigned long size; |
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
| object Presenter { // presentation layer | |
| fun loadDataForList() { | |
| val dataToShow: List<UiDataShort> = DataStore.retrieveDataList() | |
| } | |
| fun loadDataForDetailedView(clickedData: UiDataShort) { | |
| val dataToShow: UIDataDetailed = DataStore.getDetails(clickedData) | |
| } | |
| } |
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
| fun <T> Iterable<T>.infiniteIterator() = iterator { | |
| while (true) yieldAll(this@infiniteIterator) | |
| } |
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 androidx.compose.foundation.background | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.defaultMinSize | |
| import androidx.compose.foundation.layout.fillMaxWidth | |
| import androidx.compose.foundation.layout.width | |
| import androidx.compose.material.Text | |
| import androidx.compose.runtime.Composable | |
| import androidx.compose.ui.Modifier | |
| import androidx.compose.ui.graphics.Color | |
| import androidx.compose.ui.layout.Layout |
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 dates2.mar11.binaryTreeTraversal | |
| fun main() { | |
| val size = readLine()!!.toInt() | |
| val pointers = Array(size) { | |
| val (value, firstChildIndex, secondChildIndex) = readLine()!! | |
| .split(" ") | |
| .map(String::toInt) | |
| Triple(value, firstChildIndex, secondChildIndex) |
NewerOlder