2023년 8월 1일 화요일

ETC - Google form survey question auto delete

Topic - 구글폼을 활용한 설문 조사에서 문항의 답이 원하는 만큼 수집 완료시 해당 문항을 삭제하여 추가적인 답변을 수집하지 않게 하는 기능
(A function to prevent additional answers from being collected by deleting the question when the desired number of questions is collected in a survey using Google Form)


solution

Step - 1 = 구글 폼을 만들고 주소창에서 해당 폼의 id를 얻는다 -이때 꼭 다음 화면과 같이 edit화면에서 진행한다



Step - 2 = edit 화면의 주소를 메모장에 복사해 해당 form의 id를 얻는다
/d/다음부터 /edit전까지가 해당 form의 id이다

Step - 3 = 우측 상단의 메뉴를 눌러 "스크립트 편집기"를 실행한다



Step - 4 = 다음 스크립트를 복사후 저장한다

function deleteQuestionIfResponsesExceeded() {
var formId = "======="; // 구글 폼 ID
var questionIndex = 0; // 1번 문항의 인덱스 (0부터 시작)
var form = FormApp.openById(formId);
var questionItem = form.getItems(FormApp.ItemType.MULTIPLE_CHOICE)[questionIndex];

// 1번 문항의 답변 수를 확인
var responseCount = form.getResponses().length;

// 지정한 답변 수에 도달하면 해당 문항을 삭제
var maxResponseCount = 2; // 원하는 답변 수
if (responseCount >= maxResponseCount) {
form.deleteItem(questionItem);
Logger.log("1번 문항이 삭제되었습니다.");
}
}

Step - 5 = 좌측의 트리거를 눌러 추가한다


Step - 6 = 다음과 같이 설정한 후 저장 한다

2023년 6월 18일 일요일

ETC - unexpected contents print from shared printer (HP printer)

topic - unexpected contents print from shared

problem - during the printing from shared printer some unexpected contecnt printing at the same time, normally have sentence @PJL SET username=USER


solution - The connection between the PC and the printer must use the IP protocol. If use the printer add function provided by Windows, you need to be careful because the WSD protocol is automatically used.





Why is this special? - normally use add printer function by window setting menu

2023년 3월 26일 일요일

ETC - AWS Amazon EventBridge cron only weekend

Topic - AWS Amazon EventBridge cron expression only weekend

problem - When specifying a date (1=Sunday, 7=Saturday) in the scheduler, an error occurred saying that it does not match the rules.

solution - must use question mark in some field

Why is this special? - normally crontab task in unix system does not need to use question mark in any field



2023년 2월 15일 수요일

Python - Barcode make using python

python을 활용한 바코드 만들기

from barcode import EAN13
from barcode.writer import ImageWriter

code_number= '112233445566'
#12 digit for barcode number

img_code= EAN13(code_number, writer=ImageWriter())
#EAN 13 type barcode

img_code.save("bar_code2_png")
# save it with any desired name -auto png file format

EAN-13 Last digit check sum method

12-digit numbers Odd numbers multiplied by 1 and tail numbers multiplied by 3 and added together..

ex)
1 1 2 2 3 3 4 4 5 5 6 6
1 3 1 3 1 3 1 3 1 3 1 3

1 + 3 + 2 + 6 + 3 + 9 + 4 + 12 + 5 + 15 + 6 + 18 = 84

check sum= mod(10 - mod( 84 , 10), 10) = 6

full barcode number =1122334455666

ETC - Localhost to server using ngrok

 Topic = Localhost 를 임시로 서버로 만들어서 외부에서 접속이 가능한 서버로 구현하기


Step - 1 - ngrok 사이트에 접속 (링크) & 회원가입(sign-up) SSO 를 이용하면 편함


Step - 2 - Download ngrok

Step - 3 - unzip file

Step - 4 - Connect account

    다운로드 이후 실행하면 다음과 같은 prompt 가 뜬다


    Download 화면에서 스크롤을 내려서 2.Connect your account 를 복사한다

    (마킹한 붉은색은 개인 인증키이기 때문에 각자 다름)

    ngrok config add-authtoken --key--


인증정보가 저장된다



Step - 5 - Fire it up

    ngrok http 80

    을 입력하면 된다 - 이때 webserver처럼 특정 폴더를 지정해서 사용하기 위해서는

    "### ngrok.exe" http "file:///-경로-" 를 사용한다


    파란색 링크를 사용하면 접속이 가능함


    ngrok 화면에서 서버 응답도 실시간으로 나온다

    
    ngrok 대쉬보드에서도 확인이 가능하다



Step - 6 - 활용
    웹서버로 올아왔으니 링크등을 걸어서 서버를 따로 안올리고 테스트나 링크에 활용이 가능함

트랜드 코리아 2023 (Trend Korea 2023) 정리



Book Title = 트랜드 코리아 2023 (Trend Korea 2023)







책을 관통하는 키워드 - RABBIT JUMP



3가지 키워드 - 경제, 사람, 기술 - 로 나누어 보는 한국의 미래

경제
1-평균실종
==어중간하면 안된다, 심각해지는 양극화(K형 발전 - 누구는 상승 누구는 끊임없는 추락)
2-체리슈머
==알뜰한 소비자의 증가
3-뉴 디멘드 전략
=제품 서비스가 상향됨, 왠만한 서비스로는 살아 남을수 없음

사람
1-오피스 빅뱅
==대 사직 시대의 개막, 더이상 평생 직장의 개념도, 인식도 없다
2-인덱스 관계
==사람사이의 관계에 TAG를 살아 관리,(instagram 친구, ~인맥 등등)
3-디깅모멘텀
==과몰입, 취미, 연예인 등에 과몰입 하는것 aka, 덕질
4-네버랜드 신드롬
==사고방식과 가치관이 청년식 사고가 추앙 받는것
5-알파세대
==2010년 이후에 태어난 아이들이 성인이 될때를 대비해야 하는것, mz 세대가 종료된 이후 새로운 a로 시작하는 시대

기술
1-선재적 대응기술
==고객의 사용 흐름을 읽어서 서 잘 사용하기 위해 알려주는것
2-공간력
==엔데믹 시대에 오프라인을 다시 찾는 사람을 대비해야 하는것

2022년 11월 18일 금요일

ETC - 엑셀 시트별 파일저장

Topic =  엑셀 1개 파일에 시트가 여러개 있을때 따로 잘라서 파일로 저장할 필요가 있음 이때 사용하기 위한 방법



Step - 1 - Alt + F11 - Microsoft Visual Basic 열기

=좌측에 sheet확인


Step - 2 - 삽입-> 모듈 클릭


Step - 3 - 코드 입력창 확인


Step - 4 - 하단 코드입력후 F5 누름

============================

Sub Separate_Tab()



Dim Directory_Path As String

Directory_Path = Application.ActiveWorkbook.Path


Application.ScreenUpdating = False

Application.DisplayAlerts = False


For Each Tab_name In ThisWorkbook.Sheets

    Tab_name.Copy

    Application.ActiveWorkbook.SaveAs Filename:=Directory_Path & "\" & Tab_name.Name & ".xlsx"

    Application.ActiveWorkbook.Close False

Next


Application.DisplayAlerts = True

Application.ScreenUpdating = True


End Sub

===================================

Step - 5 - 파일 확인


2022년 9월 5일 월요일

Day_00. OT

수업 개요

수업 관련 문의 사항은 학교 메일로 보내기
실습시간 별도로 없음 – 자기가 알아서 진행
코딩과제는 2~3회
잠고자료는 8권
최종 Project는 term project로 진행
교재-Pdf로 진행


수업의 진행
-NLP의 기초를 진행하는 수업
시험보다 자기의 실습&해보기가 중요하다
최소 5번의 대면수업 진행 (월의 첫주 + 시작주 + 종강주(Project 발표주)


Chapter – 1 - Language and computers – 구글북스에서 책을 볼 수 있음
=언어와 writing language는 다르다 – 한국어=언어 한글-작성법, 엄연히 다른개념이다
=n-grams의 이해가 매우 중요함
=NT-Language technology
=글자 이해를 위해서는 컴퓨터의 2진수를 잘 이해해야 한다
=Python building function 으로 글자별 문자를 캐치할 수 있다





NLTK = Natural Language Toolkit = 글자를 token화 시키는 기능이 되는 package
=https://www.nltk.org/book/
=Pair로 제공되는 dataset이 잘 되어 있음
=discussion forum 에서 활동하는것도 활발하다
=수업에선 chapter 1,6 을 사용한다
=전통적 NLP Pipeline



NLP를 위한 변경 작업 4단계
=Datasets -> tokenizers -> Transformers -> datasets
핵심 keyword – 단어별 labeling 을 통한 효율의 증가



NLTK 해보기 실습





N-gram language model
=language model 은 문장의 단어에 대해 확률 분포를 둔 것
=문장에서 다음 나오는 단어 같은 경우 직전 단어에서 영향을 받아 설정된다 – Markov 가정


N-Gram 실습





Natural text 를 사용한 실습

=wiki에서 문장을 가져와서 실습한다
“Korean studies is an academic discipline that focuses on the study of Korea, which includes the Republic of Korea, the Democratic People's Republic of Korea, and diasporic Korean populations. Areas commonly included under this rubric include Korean history, Korean culture, Korean literature, Korean art, Korean music, Korean language and linguistics, Korean sociology and anthropology, Korean politics, Korean economics, Korean folklore, Korean ethnomusicology and increasingly study of Korean popular culture. It may be compared to other area studies disciplines, such as American studies and Chinese studies. Korean studies is sometimes included within a broader regional area of focus including "East Asian studies".

=수업교재에서 사용한 문장과 위키가 변경이 있었는지 결과가 다르게 나와서 올려두진 않음

-문자를 구분할때 쉼표, 반점, 마침표를 다 정리해서 "단어"로 만들어야 한다
-Train data의 특징에 따라 (정치,경제,사회 등)에 따라 가져온 문장이 다르고 이에 따른 결과가 다를수 있음