Python - AES 양방향 암호화
·
Programming/Python
모듈 설치 $ pip install pycryptodome 예제 코드 import base64 from Crypto import Random from Crypto.Cipher import AES class AES256(): def __init__(self, key): self.bs = 128 self.key = key.encode('utf-8') self.key = AES256.str_to_bytes(key) @staticmethod def str_to_bytes(data): u_type = type(b''.decode('utf8')) if isinstance(data, u_type): return data.encode('utf8') return data def _pad(self, s): return s..
Python - ModuleNotFoundError : No module named
·
Programming/Python
pip install로 해당 package를 다운 받았지만 ModuleNotFoundError 에러가 나올 때 설치한 패키지의 directory가 python실행시 포함되는지 확인 $ cat test.py import sys print(sys.path) $ python test.py ['', '/usr/lib/python3.6', '/usr/lib/python3.6/plat-x86_64-linux-gnu', ...'/usr/lib/python3.6/dist-packages'] python shell에서도 확인 $ python >>> import sys >>> print(sys.path) >>> ['', '/usr/lib/python3.6', '/usr/lib/python3.6/plat-x86_64-lin..
Scala - Case Class에 대하여
·
Programming/Scala
스칼라는 케이스 클래스 개념을 지원하는데 특징은 아래와 같다. 불변 패턴매칭을 통해 분해가능 레퍼런스가 아닌 구조적인 동등성으로 비교 초기화와 운영이 간결 예제 Notification.scala이라는 case class스칼라 파일을 생성 abstract class Notification case class Email(sourceEmail: String, title: String, body: String) extends Notifica case class SMS(sourceNumber: String, message: String) extends Notification case class VoiceRecording(contactName: String, link: String) extends Notificat..
Scala - 스칼라 프로젝트 IntelliJ 설정
·
Programming/Scala
[ IntelliJ ] 1. File->settings->plugin 에서 scala검색 후 설치 2. File->New Project->Maven->Next->설정값입력 후 Maven프로젝트 생성 3. pom.xml에 아래와 같이 추가 org.scala-lang scala-library 2.12.4 org.scala-lang.modules scala-xml_2.12 1.0.6 org.apache.spark spark-core_2.12 2.4.7 org.apache.spark spark-sql_2.12 2.4.7 4. 프로젝트 우클릭 -> Add Framework Support... -> scala SDK다운 및 적용 5. 특정폴더에 hadoop/bin 만들고 winutils.exe넣기 -> window..
JS 알고리즘 100일 챌린지 문법 정리
·
Programming/JavaScript
Javascript 알고리즘 100일 챌린지를 통해 기본적인문제 풀이시 몰랐던 문법요소 정리 유튜브 참고 : https://www.youtube.com/watch?v=RMmOU2u-_as&list=PLkfUwwo13dlWZxOdbvMhkzhAowaiEjuGS Array값에 요소값 채우기 (fill & map) let arr = Array(10).fill().map((_,i)=> i); //[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 누적값 구하기 (reduce) const initialValue = 0; const sumWithInitial = [1,2,3,4,5].reduce( (accumulator, currentValue) => accumulator + currentValue, initi..
wave35
'Programming' 카테고리의 글 목록 (5 Page)