Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
fun main() { | |
val cache = Integer::class.java.declaredClasses[0] | |
val cacheField = cache.getDeclaredField("cache") | |
.apply { isAccessible = true } | |
val array = cacheField[cache] as Array<Int> | |
array[4 + 128] = 5 | |
// prints 4 | |
println(2 + 2) |
import java.lang.reflect.Field; | |
public class Main { | |
public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException { | |
final Class cache = Integer.class.getDeclaredClasses()[0]; | |
final Field cacheField = cache.getDeclaredField("cache"); | |
cacheField.setAccessible(true); | |
final Integer[] array = (Integer[]) cacheField.get(cache); | |
array[132] = 5; |
package com.wire.bots.echo; | |
import ch.qos.logback.classic.spi.ILoggingEvent; | |
import ch.qos.logback.core.CoreConstants; | |
import ch.qos.logback.core.LayoutBase; | |
import java.time.Instant; | |
import java.time.ZoneOffset; | |
import java.time.format.DateTimeFormatter; | |
import java.util.Map; |
// | |
// Wire | |
// Copyright (C) 2016 Wire Swiss GmbH | |
// | |
// This program is free software: you can redistribute it and/or modify | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation, either version 3 of the License, or | |
// (at your option) any later version. | |
// | |
// This program is distributed in the hope that it will be useful, |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
{ | |
"id": "3b958811-ffc5-4812-b3d9-0ac494f0cb6d" | |
} | |
{ | |
"id": "3b958811-ffc5-4812-b3d9-0ac494f0cb6d", | |
"age": null, | |
"comorbidities": [], | |
"complications": [], | |
"date_first_symptoms": null, | |
"disease_confirmation_date": null, |
try { | |
window.AudioContext = window.AudioContext || window.webkitAudioContext; | |
window.audioContext = new AudioContext(); | |
} catch (e) { | |
alert('Web Audio API not supported.'); | |
} | |
document.querySelector('button#control').addEventListener('click', function() { | |
audioContext.resume().then(() => { | |
console.log('Playback resumed successfully'); |
for i in range(912, 987): | |
for j in range(612, 698): | |
# contains zero | |
if((str(i) + str(j)).count('0')): | |
continue | |
# one must be even and one odd | |
if((i + j) % 2 == 0): | |
continue |
fun main() { | |
val toChange = 132 | |
val coins = listOf(50, 20, 10, 5, 2, 1).sortedDescending() | |
coins.fold(Pair(toChange, emptyList<Int>())) { (remaining, change), coin -> (remaining % coin) to (change + (remaining / coin)) } | |
.also { (remaining, change) -> | |
assert(0 == remaining) | |
print(change.zip(coins).joinToString(", ") { (change, coin) -> "$coin: ${change}x" }) | |
} | |
} |
Objektově orientované programování (zkracováno na OOP) je metodika vývoje softwaru, založená na následujících myšlenkách, koncepci: