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
from starlette.middleware.base import BaseHTTPMiddleware | |
from starlette.responses import JSONResponse | |
class UnknownExceptionMiddleware(BaseHTTPMiddleware): # https://www.starlette.io/middleware/#basehttpmiddleware | |
def __init__(self, app): | |
super().__init__(app) |
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 QuackBehavior: | |
def quack(self): | |
pass | |
class SwimBehavior: | |
def swim(self): |
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 EndpointA: | |
def fetch(self): | |
pass | |
class EndpointB: | |
def fetch(self): | |
pass | |
class EndpointC: |
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 MyModel: | |
user_id: int = None | |
article_id: int = None | |
comment_id: int = None | |
def __init__(self, user_id, article_id=None, comment_id=None): | |
self.user_id = user_id | |
self.article_id = article_id | |
self.comment_id = comment_id |
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
from typing import Any | |
from pydantic import BaseModel | |
class User: | |
id: int | |
is_admin: bool | |
username: str | |
password: str |
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
@Getter | |
@NoArgsConstructor | |
@Entity | |
public class User { | |
@OneToMany(mappedBy = "user", fetch = FetchType.LAZY) | |
private List<PartyUser> parties = new ArrayList<>(); | |
} | |
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
@Getter | |
@NoArgsConstructor | |
@Entity | |
public class User { | |
@OneToMany(mappedBy = "user", fetch = FetchType.LAZY) | |
private List<PartyUser> parties = new ArrayList<>(); | |
} | |
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 pyaudio | |
import wave | |
chunk = 1024 # Record in chunks of 1024 samples | |
sample_format = pyaudio.paInt16 # 16 bits per sample | |
channels = 1 | |
fs = 44100 # Record at 44100 samples per second | |
seconds = 3 | |
filename = "output.wav" |
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
from copy import deepcopy | |
class Num: | |
def __init__(self, num): | |
self.num = num | |
def __repr__(self): | |
return str(self.num) |
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
public class ManualBallsGenerator { | |
Scanner scanner; | |
public ManualBallsGenerator() { | |
this.scanner = new Scanner(System.in); | |
} | |
public BaseBalls generate() { | |
System.out.println("숫자 3개 입력"); |
NewerOlder