첫 업로드

1
2
3
4
5
6
$ git init
$ git remote add origin https://github.com/Zerohertz/Hexo_Blog.git (github의 주소)
$ git add .
$ git remote -v (확인)
$ git commit -m "내용" (주석)
$ git push origin master

수정, 추가 업로드

1
2
3
$ git add .
$ git commit -m "내용"
$ git push origin master

DOM 요소의 속성 추출

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
C:\Users\OHG>python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from bs4 import BeautifulSoup
>>> soup=BeautifulSoup(
... "<p><a href='a.html'>test</a></p>",
... "html.parser")
>>> soup.prettify()
'<p>\n <a href="a.html">\n test\n </a>\n</p>'
>>> a=soup.p.a
>>> type(a.attrs)
<class 'dict'>
>>> 'href' in a.attrs
True
>>> a['href']
'a.html'
Read more »

라즈베리 파이란?

raspberry-pi

위 그림과 같이 생긴 보드이며, 아두이노의 상위 호환이라고 볼 수 있다. 특히, Linux기반의 OS가 구동이 가능하여 진짜 컴퓨터처럼 사용할 수 있다. 또한 GPIO를 통한 IOT를 만들 수 있다.

Read more »

크레인 알고리즘

1
2
3
4
5
6
7
8
9
10
11
12
13
if(IR센서가 트랜스포터를 감지){
모터로 줄을 늘임;
전자석을 킴;
모터로 줄을 당김;
모터(바퀴)로 위치를 옮김;
모터로 줄을 늘임;
전자석을 끔;
모터로 줄을 당김;
모터(바퀴)로 원위치로 돌아가게 함;
}
else{
모두 정지;
}
Read more »

변수 선언

1
2
3
4
5
6
7
8
int LED = 11;

int LED;
LED = 11;

#define LED 11 (메모리 사용 X) //define, const는 setup위에 종종 쓴다

const int LED = 11;
Read more »