Skip to content

Instantly share code, notes, and snippets.

View kakkun61's full-sized avatar
🚂
Choo-choo

Kazuki Okamoto kakkun61

🚂
Choo-choo
View GitHub Profile
{
"displayName": "鉄道模型タイムライン",
"blocks": [
{
"id": "aaadxd3yyak5k",
"type": "input",
"inputType": "firehose",
"firehoseSeconds": 604800
},
{
TARGET ?= checksym
CC ?= gcc
CFLAGS += -O -Wall
all : $(TARGET)
$(TARGET) : $(TARGET).o
$(CC) $(TARGET).o -o $(TARGET) -Wall
$(TARGET).o : $(TARGET).c
@kakkun61
kakkun61 / LICENSE
Created May 7, 2023 15:02
カトー 10-1750 特別企画品 タキ1000(後期形) 「1000号記念塗装」入 10両セット 向けに設計
CC BY 4.0
https://creativecommons.org/licenses/by/4.0/deed
1 2 3 4 5 6 7 8 9 10
1 1 8 15 22 29 36 43 50 57 64
2 71 78 85 92 99 106 113 120 127 134
3 141 148 155 162 169 176 183 301 308 315
4 322 329 336 343 350 357 364 371 378 385
5 392 511 518 525 601 CR1

kakkun61

How to use functions in Java that is exposed from package in Kotlin? Explain it with example codes.

ChatGPT

To use functions in Java that are exposed from a package in Kotlin, you need to follow a few simple steps:

  1. Import the Kotlin package in your Java code.
@kakkun61
kakkun61 / wsl-hosts.ps1
Last active August 10, 2022 02:50 — forked from MichaelBelgium/wsl2-hosts-sync.ps1
WSL v2 windows hosts sync (powershell - updates domains to wsl2 ip)
If (!(New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host 'Run this as administrator.'
$choice = Read-Host 'Do you want to re-run this as administrator? [y/N]'
if ($choice -ne 'y') {
exit 1
}
$actualScriptRoot = $PSScriptRoot
if ((Get-Item $PSCommandPath).Target) {
$actualScriptRoot = Split-Path -Parent ((Get-Item $PSCommandPath).Target)
}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
class FunctorB b where
bmap :: forall f g. (Functor f, Functor g) => (forall a. f a -> g a) -> b f -> b g
instance {-# OVERLAPPABLE #-} (FunctorT (Flip t), FunctorB a) => FunctorB (t a) where
bmap f a = runFlip $ tmap f $ Flip a
instance (FunctorT t, FunctorB a) => FunctorB (Flip t a) where
bmap f a = Flip $ tmap f $ runFlip a
class FunctorT t where
type Implicit :: (Type -> (Type -> Type) -> Type) -> (Type -> Type) -> Type
newtype Implicit a f = Implicit (a Covered f)
type ImplicitT :: ((Type -> (Type -> Type) -> Type) -> Type -> (Type -> Type) -> Type) -> (Type -> Type) -> ((Type -> Type) -> Type) -> Type
newtype ImplicitT t f a = ImplicitT (t (Explicit a) Covered f)
type Explicit :: ((Type -> Type) -> Type) -> Type -> (Type -> Type) -> Type
data family Explicit a b f
newtype instance Explicit a Covered f = Explicit (a f)
#!/usr/bin/env cabal
{- cabal:
build-depends: base
-}
main :: IO ()
main = putStrLn "Hello!"