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
| public static Class<?> getBeanClass(ConfigurableListableBeanFactory factory, Class<?> requiredType) throws Exception { | |
| String[] candidateNames = factory.getBeanNamesForType(requiredType); | |
| if (candidateNames.length != 1) { | |
| throw new IllegalStateException("type: " + requiredType + " expected single bean but found " + candidateNames.length); | |
| } | |
| String candidateName = candidateNames[0]; | |
| BeanDefinition mergedBeanDefinition = factory.getMergedBeanDefinition(candidateName); |
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
| class JavaSystem | |
| { | |
| private const long NanosecsPerSec = 1_000_000_000L; | |
| private static readonly long Frequency = Stopwatch.Frequency; | |
| private static readonly bool IsHighResolution = Frequency == NanosecsPerSec; | |
| private static readonly double NanosPerCount = (double)NanosecsPerSec / Frequency; | |
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | |
| public static long NanoTime() | |
| { |
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
| const foo = (e) => { | |
| // 대충 매우 오래걸리는 작업 | |
| // IO 없이 동기로만 계산 | |
| return 1; | |
| }; | |
| const { Worker, isMainThread, parentPort } = require("worker_threads"); | |
| if (isMainThread) { | |
| const worker = new Worker(__filename); | |
| worker.on("message", (v) => { |
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 <stdio.h> | |
| const char* GUGU = "%d x %d = %d\n"; | |
| const int NEW_LINE = '\n'; | |
| int main() { | |
| __asm { | |
| mov ebx, 1; | |
| FOR_I: | |
| cmp ebx, 9; | |
| jg END_FOR_I; | |
| mov ecx, 1; |
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
| const sleep =(t) => new Promise(resolve => { | |
| setTimeout(resolve, t); | |
| }); | |
| const interval = (timeout, timerHandler, ...param) => { | |
| const k = { run: true }; | |
| (async () => { | |
| while (k.run) { | |
| try { | |
| const s = sleep(timeout); | |
| await timerHandler(...param); |
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
| // test | |
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| type ListNode struct { | |
| prev *ListNode | |
| next *ListNode |
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
| #pragma once | |
| #define TRUE 1 | |
| #define FALSE 0 | |
| #define BOOL int | |
| #define OUT | |
| #define NotNull | |
| #define Nullable | |
| #ifdef _MSC_VER |
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 <iostream> | |
| // | |
| // xoptional.h | |
| // clang | |
| // | |
| // Created by d on 2017. 4. 30.. | |
| // Copyright © 2017년 d. All rights reserved. | |
| // | |
| #ifndef xoptional_h | |
| #define xoptional_h |
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
| // ChattServer.cpp : 콘솔 응용 프로그램에 대한 진입점을 정의합니다. | |
| // | |
| #include "stdafx.h" | |
| #include "Socket.h" | |
| #include "ServerSocket.h" | |
| #include "SQLServerConnection.h" | |
| #include "NetworkStream.h" | |
| #include "MyThreadPool.h" | |
| #include "Serializer.h" |
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 "stdafx.h" | |
| #include "ServerSocket.h" | |
| #include "NetworkStream.h" | |
| #include "ReferenceObject.h" | |
| class ServerBase{ | |
| //버퍼의 길이는 30정도... 테스트용으로... 작게.. | |
| static const int BUFFER_SIZE = 30; | |
| static const int MAX_SUPPORT_CONTENTS = 512; | |
| ServerSocket mServerSocket; |
NewerOlder