목록분류 전체 보기 (84)
CHIqueen

.dev 도메인이 끌려서 그냥 질러버렸다 $12 대충 15,000원이다. 원래는 Go로 서버하나 짠다음 GCP에 올려서 사용할 목적이었으나 GCP자료가 적어도 너무 적다. 그래서 포기^^ (서버 짠것도 터졌다고 말 못함) https://domains.google.com 아무튼 본론으로 Googledomains에서 DNS로 들어간다. 종합 레코드와 맞춤 리소스 레코드가 있는데 맞춤 리소스 레코드로 진행한다 ipv4칸에 27.0.236.139만 적어주면 끝난다. 왜인지 모르겠는데 CNAME으로 앞에 www붙이고 처음 시도했으나 보안접속 인증서가 7일동안 발급 대기중 이라떠서 오늘 포기하고 A로 시도했다. So clear 내가 저 발급 완료를 보려고 7일을 낭비했단 말인가 이제 chiqueen.dev로 접속이..
def isIPv4Address(s): p = s.split('.') return len(p) == 4 and all(n.isdigit() and 0 True ??? SSIBAL def isIPv4Address(s): p = s.split('.') for i in p: if len(i)>=2: if list(i)[0]=='0': return False return len(p) == 4 and all(n.isdigit() and 0
def arrayMaximalAdjacentDifference(inputArray): return max([abs(inputArray[i]-inputArray[i+1]) for i in range(len(inputArray)-1)])
def areEquallyStrong(yourLeft, yourRight, friendsLeft, friendsRight): return (yourLeft == friendsLeft or yourLeft == friendsRight) and (yourRight == friendsLeft or yourRight == friendsRight) 굉장히 쓰잘떼기 없어보이지만 통과다 return {yourLeft, yourRight} == {friendsLeft, friendsRight} 파이썬의 set을 잘 사용한 예시
def palindromeRearranging(inputString): return sum([inputString.count(i)%2 for i in set(inputString)])
Two arrays are called similar if one can be obtained from another by swapping at most one pair of elements in one of the arrays. Given two arrays a and b, check whether they are similar. def areSimilar(a, b): return sorted(a)==sorted(b) and sum([c!=d for c,d in zip(a,b)])
Given a rectangular matrix of characters, add a border of asterisks(*) to it. def addBorder(picture): a = len(picture[0]) + 2 return ["*" * a] + ["*" + i + "*" for i in picture] + ["*" * a] "*"+i+"*"말고 i.center()쓰는것도 좋은 방법이다.
Several people are standing in a row and need to be divided into two teams. The first person goes into team 1, the second goes into team 2, the third goes into team 1 again, the fourth into team 2, and so on. You are given an array of positive integers - the weights of the people. Return an array of two integers, where the first element is the total weight of team 1, and the second element is th..
스캐너 지잉지잉 너무 오래걸리고 귀찮아서 캠뭐시기 어플을 애용하고 있다. 하지만 pdf로 변환하고 나면 밑에 있는 scan by ~ 가 다른 사람한테 전달할때 좀 그래서 전에 질문을 받은적이 있다.... 그래서 이걸 없애 보려는데 다행히 스캔한거 위에 올려서 아예 이미지로 만들지 않아서 이미지랑 분리 할 수 있다. 라이브러리는 os, PyPDF2, img2pdf, PIL을 사용할 것이다. (하나로 처리하면 좋지만 자료랑 doc이 너무 구리다) import os import PyPDF2 from img2pdf import convert from PIL import Image file_pdf = PyPDF2.PdfFileReader(open("test.pdf","rb")) pages = file_pdf.ge..