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
/* | |
* Copyright 2017 LINE Corporation | |
* | |
* LINE Corporation licenses this file to you under the Apache License, | |
* version 2.0 (the "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at: | |
* | |
* https://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
13:54:36.202 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework | |
13:54:36.214 [main] DEBUG i.n.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: true | |
13:54:36.214 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe: unavailable (io.netty.noUnsafe) | |
13:54:36.214 [main] DEBUG i.n.util.internal.PlatformDependent0 - Java version: 21 | |
13:54:36.214 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, {int,long}): unavailable | |
13:54:36.215 [main] DEBUG i.n.util.internal.PlatformDependent - maxDirectMemory: 805306368 bytes (maybe) | |
13:54:36.216 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.tmpdir: /var/folders/27/35dp_qr520d9ff2lr528z6380000gn/T (java.io.tmpdir) | |
13:54:36.216 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model) | |
13:54:36.216 [main] DEBUG i.n.util.internal.PlatformDependent - Platform: MacOS | |
13:54:36.216 [main] DEBUG i.n.util.internal.PlatformDependen |
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.linecorp.armeria.testing.junit5.server.mock; | |
import io.netty.buffer.ByteBufAllocator; | |
import io.netty.handler.ssl.OpenSsl; | |
import io.netty.handler.ssl.SslContext; | |
import io.netty.handler.ssl.SslContextBuilder; | |
import io.netty.handler.ssl.util.SelfSignedCertificate; | |
import io.netty.util.ReferenceCountUtil; | |
import org.junit.jupiter.api.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
// example/armeria/grpc/CancelledRequestsInterceptor.java | |
package example.armeria.grpc; | |
import java.util.List; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import io.grpc.ForwardingServerCallListener.SimpleForwardingServerCallListener; |
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 org.example; | |
import com.fasterxml.jackson.annotation.JsonAutoDetect; | |
import com.fasterxml.jackson.annotation.JsonInclude; | |
import com.fasterxml.jackson.annotation.PropertyAccessor; | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.fasterxml.jackson.databind.SerializationFeature; | |
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; | |
import com.fasterxml.jackson.datatype.joda.JodaModule; |
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
{ | |
"configurations": [ | |
{ | |
"name": "MergeSort (Debug)", | |
"type": "cppdbg", | |
"request": "launch", | |
"program": "${workspaceFolder}/merge-sort.exe", | |
"runtimeExecutable": "${workspaceRoot}/info.sh", | |
"args": [ | |
"${input:number_elements}", |
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 { NextApiRequest, NextApiResponse } from "next"; | |
import { withApiAuthRequired } from "@auth0/nextjs-auth0"; | |
import nc from "next-connect"; | |
// Secured api endpoint. | |
// Possible synergy between next-connect and withApiAuthRequired from nextjs-auth0. | |
const handler = withApiAuthRequired( | |
nc<NextApiRequest, NextApiResponse>() | |
.get( |
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 matplotlib.pyplot as plt | |
import numpy as np | |
from collections import Counter | |
from matplotlib.widgets import Slider | |
from functools import partial | |
(fig, ax) = plt.subplots(1, 1) | |
def gen(n): | |
ax.clear() |
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
fn make_deadlock() { | |
let a = Arc::new(Mutex::new(1u32)); | |
let aa = Arc::clone(&a); | |
let b = Arc::new(Mutex::new(1u32)); | |
let bb = Arc::clone(&b); | |
let t_a = spawn(move || loop { | |
do_locking("A".to_string(), "a".to_string(), &*a, "b".to_string(), &*b); | |
}); |