This file contains 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
class Timeouts { | |
class Config(var postRequestTimeout: Long = 5000L) | |
companion object : ApplicationFeature<ApplicationCallPipeline, Config, Unit> { | |
override val key: AttributeKey<Unit> = AttributeKey("Timeouts") | |
override fun install(pipeline: ApplicationCallPipeline, configure: Config.() -> Unit) { | |
val postTimeout = Config().apply(configure).postRequestTimeout | |
if (postTimeout <= 0) return |
This file contains 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 org.jetbrains.kotlin.gradle.tasks.KotlinCompile | |
plugins { | |
kotlin("jvm") version "1.3.72" | |
kotlin("plugin.serialization") version "1.3.72" | |
application | |
} | |
group = "me.leonid" | |
version = "1.0-SNAPSHOT" |
This file contains 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
(function(root, factory) { | |
if (typeof define === 'function' && define.amd) | |
define(['exports', 'kotlin', 'ktor-utils', 'kotlinx-io', 'kotlinx-coroutines-core', 'ktor-http', 'kotlinx-coroutines-io'], factory); | |
else if (typeof exports === 'object') | |
factory(module.exports, require('kotlin'), require('ktor-utils'), require('kotlinx-io'), require('kotlinx-coroutines-core'), require('ktor-http'), require('kotlinx-coroutines-io')); | |
else { | |
if (typeof kotlin === 'undefined') { | |
throw new Error("Error loading module 'ktor-client-core'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'ktor-client-core'."); | |
} | |
if (typeof this['ktor-utils'] === 'undefined') { |
This file contains 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
// 4.7 | |
publishing { | |
publications { | |
foo { | |
gradleModuleMetadataFile = null | |
tasks.matching { it.name == "generateMetadataFileFor${name.capitalize()}Publication" }.all { onlyIf { false } } | |
} | |
} | |
} |
This file contains 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
int s3(int *a,int s2,int e1,int s1,int e2,int* m1,int* m2); | |
int s4(int* a,int l){ | |
int s=0, *m1=(int *)malloc(l*sizeof(int)), *m2=(int *)malloc(l*sizeof(int)); | |
if(!m1&&!m2)return -1; | |
while (s<l) { | |
int i,s1,e1,s2,e2; | |
for(i=0;(i+s-1)<(l-1);i+=2*s){ | |
s1=i; |
This file contains 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
#pragma once | |
#include <iostream> | |
#include <cstdlib> | |
class rational; | |
bool operator==(const rational &lhs, const rational &rhs); | |
bool operator!=(const rational &lhs, const rational &rhs); |
This file contains 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
// FILE: A.java | |
import kotlin.internal.*; | |
public class A { | |
public void foo(@DefaultNull Integer i) {} | |
public void bar(@DefaultNull Integer a) {} | |
public void bam(@DefaultNull Integer a) {} |
This file contains 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
// FILE: A.java | |
import kotlin.internal.*; | |
class A { | |
public void first(@DefaultValue(value = "42") int arg) { | |
} | |
} | |
// FILE: B.java | |
class B { |
This file contains 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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains 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
Atom config sync |
NewerOlder