공부
-
w3schools - sql exercise (1)공부/PS ( SQL) 2021. 11. 30. 01:04
SELECT * FROM Customers WHERE NOT CITY = 'Berlin' SELECT * FROM Customers ORDER BY Country, City 참고) SELECT * FROM table_name ORDER BY column1, column2 DESC column1 기준 오름차순 정렬 후 column2 기준 내림차순 정렬 INSERT Customers ( CustomerName, Address, City, PostalCode, Country ) VALUES ( 'Hekkan Burger', 'Gateveien 15', 'Sandnes', '4306', 'Norway' ) ; UPDATE Customers SET City = 'Oslo'; DELETE FROM Customers..
-
[라즈베리파이] USB 마이크를 이용해서 음성데이터를 녹음하기공부/etc 2021. 11. 8. 22:25
1. 라즈베리파이에 USB 마이크 연결 2. 마이크의 card, device 정보 가져오기 arecord -l card: 1 / device: 0 3. 스피커의 card, device 정보 가져오기 aplay -l card: 0 / device: 0 4. .asoundrc 파일 생성 nano .asoundrc pcm "hw: , " (참고) https://www.alsa-project.org/wiki/Asoundrc 5. USB 마이크 녹음 테스트 arecord -D plughw:1,0 -r 16000 -t wav -d 5 testmic.wav -D : 디바이스 이름 -r : sample rate -t : 타입 (voc, wav, raw, au) -d : 녹음할 시간(초) 참고) https://linux..
-
[git] warning: LF will be replaced by CRLF공부/etc 2021. 11. 6. 02:31
내가 git add를 한 환경은 Windows 10인데 위와 같은 warning이 떠서 검색을 해봤다. 윈도우에서는 줄바꿈 시 CRLF(\r\n) 방식을 쓰는 반면에 유닉스, 리눅스에서는 LF(\n) 방식을 써서 위와 같은 경고가 뜨는 것이라고 한다. 운영체제별로 줄바꿈 규칙이 다르기때문에 git에서 위와 같은 경고를 표시해준 것이다. 아래와 같은 명령어를 입력해서 줄바꿈 문자가 자동 변환되도록 설정해주면 된다. git config core.autocrlf true
-
[BOJ] 21608 상어 초등학교 / C++공부/PS (백준) 2021. 10. 8. 02:36
#include #include #include using namespace std; int N; struct st { int num; int friends[4]; }; struct st students[20 * 20 + 10]; int seats[20 + 10][20 + 10]; // (1, 1) ~ (N, N) int dx[4] = { -1,1,0,0 }; int dy[4] = { 0,0,-1,1 }; int cur_x, cur_y; struct cand { int x, y; int cnt_empty; int cnt_friends; }; vector candidates; bool cmp(cand &vec1, cand &vec2) { if (vec1.cnt_friends > vec2.cnt_friend..
-
[C++] struct형의 vector를 함수 인자로 넘기기공부/C, C++ 2021. 10. 8. 02:31
1. struct cand를 선언 2. cand형을 가지는 vector을 선언 (vector candidates;) 3. candidates를 정렬하기 위한 기준을 세워주는 compare 함수 정의 (bool cmp(vector &vec1, vector &vec2) 문제) cmp 함수에서 vec1의 멤버변수들이 참조가 되지 않음 해결) cmp 함수의 인자로 cand &vec1, cand &vec2를 넘겨주었더니 멤버변수들이 잘 참조되는 것을 확인함 구조체형 vector를 함수의 인자로 넘겨받고 싶을 때: 구조체 tag명 &vector 변수명
-
[HackerRank/Basic Select] Weather Observation Station 3공부/PS ( SQL) 2021. 9. 24. 01:29
https://www.hackerrank.com/challenges/weather-observation-station-3/problem Weather Observation Station 3 | HackerRank Query a list of unique CITY names with even ID numbers. www.hackerrank.com SELECT DISTINCT CITY FROM STATION WHERE ID MOD 2 = 0