아래와 같은 배열에서 각 요소의 건 수를 카운트해서 출력해 보자. ["손오공", "사오정", "토마토", "손오공", "저팔계", "삼장법사", "손오공", "저팔계"] 물론 for문과 if문을 사용하기 말고 해야한다면....? 아래 2가지 방법을 소개했다. import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; public class Hash01 { public static void main(String[] args) { String[] participant = {"손오공", "사오정", "토마토", ..
sort() vs sorted() sort()함수는 리스트를 직접 정렬하고, None을 반환, List에서만 사용할 수 있다. sorted() 함수는 리스트 뿐만 아니라 문자열, 튜플, 딕션너리등 반복 가능한 자료형에 모두 사용 가능하다.sorted() 함수는 기존 리스트를 복하해서 새로 만들어 반환하기 때문에 sort() 보다 느리고, 기존의 리스트에 영향을 주지 않는다. %%timeit sort_li = [10, 9, 4, 6, 1] sort_li.sort() sort_li 567 ns ± 68.3 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) >>[1, 4, 6, 9, 10] %%timeit sorted_li = [10, 9, 4, 6,..

출판사 : 디스커버리미디어 지은이 : 전익진 제1강 집계와분석 데이터로 할 수 있는 것 데이터>정보>지식>지혜 제2장 시장분석 목표 시장을 선정하라 기본 데이터셋 : 대상, 연령별,비율,잠재 고객비율, 평균구매주기, 평균구매비용 -> 추가 : 연간 구매 횟수(365/평균구매주기), 대상고객수(대상*비율*잠재고객비율), -> 추가산출 : 지역의 연령대별 시장크기 : 연간구매횟수*대상고객수*평균구매비용 지역의 연령대별 총합 시장이 전체 시장이며, 이 전체 시장이 목표시장이 된다. 제3장 시장 점유율 분석 시장에서의 지위를 파악하라 시장 점유율을 확인하는 목적 : 시장에서의 생존을 판단하는 잣대로 활용 경쟁업체의 매출액은 구하기 쉽지 않으며 이때, 전체 시장 규모를 여러 통계 사이트에서 구함으로 자사의 시장 ..
자바스크립트에서는 객체를 생성하는 방법이 다양하다. 아래 내용을 객체를 이용해서 출력해보자. hi I'm akami. 1. Object() 생성자 var user = new Object(); user.name = 'akami' user.interests = ['Sleeping', 'Swimming']; user.greeting = function(){ console.log('hi I\'m '+user.name+'.'); } user.greeting(); 2. 객체 리터럴 var user = new Object(); var user = { name : 'akami', interests : ['Sleeping','Swimming'], greeting : function(){ console.log('hi I\..

bootstrap과 jqgrid 만 잘 구성하면, 디자이너와 퍼블리셔없이 백앤드 개발자가 직접 디자인이 어느정도 가능하다. 1. http://guriddo.net/?page_id=103292 접속해서 최신 버전을 다운 받는다. Guriddo » Download DownloadDownload Guriddo products Download Unzip the zip package and read the install instructions. Note: Guriddo Suito PHP and Guriddo jqGrid.Mobile JS has a 30 day trial. Guriddo Suito includes all PHP products and demos: Gurido jqGrid PHP, TreeGrid ..
1. 인스턴스를 사용하는 객체와 그렇지 않은 객체 생성방법 차이 //#1 String s = new String("Hello, World"); //#2 String s = "Hello, World" 1번 코드와 2번 코드의 역할은 같지만, 성능상의 차이는 존재한다. String 은 immutable 객체 즉, 한번 선언되면 변할 수 없다. 이때, 1번 코드로 for 문을 여러번 돌리면 인스턴스가 그 수만큼 발생한다. 그러나 2번의 코드는 해당 인스턴스 값을 그대로 사용한다. 2. 때로는 값비싼 객체를 재사용해 선능을 개선할 수 있다. //#1 static boolean isRomanNumber(String s){ return s.matches("^(?=.)M*(C[MD]|D?C{0,3})(X[CL]|L?..
1. 컴파일을 하기 위한 기본 패키지를 설치한다. #https://github.com/pyenv/pyenv/wiki/Common-build-problems sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \ libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ xz-utils tk-dev libffi-dev liblzma-dev python-openssl git 2. pyenv 설치 파일 다운 받기 #물론 내외망에 열려있어야한다. #임의의 폴더를 만들어서 컴파일할 파일을 다운 받는다. xxx@test:~$git clone https:..
find 명령어로 여러파일을 or 조건으로 검색할때는 아래와 같이 한다. find . -iname '*.py' -o -iname '*.ipynb' | xargs tar -cvzf src.tar.gz -o 는 or 조건과 같다. #mp3가 아닌 폴더만 찾기 find . ! -iname '*.mp3' -type d #mp3, mpc, flac가 아닌 and 조건의 파일만 찾기 find . -type f ! -iname *.mp3 ! -iname *.mpc ! -iname *.flac
맥에서 Mongodb를 설치할때는 homebew를 이용한다. 1. 패키지 저장소 추가하기 brew tap mongodb/brew 2. 설치하기 brew install mongodb-community #특정 버전 지정 brew install mongodb-community@4.2 3. 서비스 등록하기 #서비스 등록하기 brew services start mongodb-community #서비스 중단하기 $ brew services stop mongodb-community 참고 https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/ Install MongoDB Community Edition on macOS — MongoDB Manual docs..
- Total
- Today
- Yesterday
- Restore
- Selenium
- zsh
- covid19
- 동적클래스생성
- pip freeze #패쇄망 #wheel
- backup
- jqgrid
- docker
- gitlab
- 호스트와 시간맞추기
- redmine plugin
- python의 Reflection
- inspect.py
- importlib
- jupyter lab
- virturalenv
- MAC
- anaconda env
- pyenv
- sorted
- jqzip
- Lodash
- __code__
- conda init
- bootrap
- HashMap.getOrDefault
- vscode
- selenium #chromedriver
- elasticsearch
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |