Skip to content

Instantly share code, notes, and snippets.

View sangmoon's full-sized avatar
🎯
Focusing

Sangmoon Park sangmoon

🎯
Focusing
View GitHub Profile
@sangmoon
sangmoon / main.py
Created January 18, 2022 09:16
Sequence for sum of adjacent two number is all square number
from collections import defaultdict
from typing import Optional
def hamilton(G: dict[int, list[int]], size: int, pt: int, path: Optional[list] = None) -> Optional[list[int]]:
if not path:
path = []
# print('hamilton called with pt={}, path={}'.format(pt, path))
if pt not in path:
path.append(pt)
@sangmoon
sangmoon / TlsInspector.java
Created January 31, 2020 05:18
Converted TlsInspector to java
public class Config
{
public Config(Stats.Scope scope)
{
this(scope, TLS_MAX_CLIENT_HELLO);
}
//C++ TO JAVA CONVERTER NOTE: Java does not allow default values for parameters. Overloaded methods are inserted above:
//ORIGINAL LINE: Config(Stats::Scope& scope, uint max_client_hello_size = TLS_MAX_CLIENT_HELLO) : stats_({ALL_TLS_INSPECTOR_STATS((scope).counter(Envoy::statPrefixJoin("tls_inspector.", FINISH_STAT_DECL_)}), ssl_ctx_(SSL_CTX_new(TLS_with_buffers_method())), max_client_hello_size_(max_client_hello_size)
public Config(Stats.Scope scope, int max_client_hello_size)
{
@sangmoon
sangmoon / TlsInspector.cc
Created January 31, 2020 05:14
TlsInspector c++
#include "extensions/filters/listener/tls_inspector/tls_inspector.h"
#include <cstdint>
#include <string>
#include <vector>
#include "envoy/common/exception.h"
#include "envoy/common/platform.h"
#include "envoy/event/dispatcher.h"
#include "envoy/network/listen_socket.h"
@sangmoon
sangmoon / Main.java
Created December 3, 2019 09:39
equals hashcode map에 대한 과제
public class SKey {
private int value;
public SKey(int value) {
this.value = value;
}
@Override
public boolean equals(Object other) {
return false;
@sangmoon
sangmoon / settings.json
Last active October 14, 2018 11:25
visual code lint setting for django
```
// user setting
{
"python.linting.flake8Enabled": true,
"python.linting.pylintEnabled": true,
}
```
```
// user virtual environment
@sangmoon
sangmoon / Square.java
Last active June 22, 2018 10:33
Fill the number in 2d array circulating in a spiral.
package com.sangmoon.square;
public class Square {
public static void main(String arg[]){
int N = Integer.parseInt(arg[0]);
int[][] map = new int[N][N];
Square s = new Square();
@sangmoon
sangmoon / babel.txt
Created March 27, 2018 15:12
바벨 정리
stage-0 - Strawman: just an idea, possible Babel plugin.
stage-1 - Proposal: this is worth working on.
stage-2 - Draft: initial spec.
stage-3 - Candidate: complete spec and initial browser implementations.
stage-4 - Finished: will be added to the next yearly release.
@sangmoon
sangmoon / es6.txt
Last active March 27, 2018 15:11
ES6 정리
Constants
Constants
Scoping
Block-Scoped Variables
Block-Scoped Functions
Arrow Functions
Expression Bodies
Statement Bodies
Lexical this
Extended Parameter Handling