react Box component 만들기 1234567891011import React from "react"; class Box extends React.Component { render() { return ( hello ) }} export default Boxcs hello가 출력되는 Box 만들기. import Box from './components/Box'이렇게 import하고 쓴다. click event만들기1234567891011121314151617181920import React from "react"; class Box extends React.Component { constructor(props) { super(props) this.handleOnClick = this.handle..
users 테이블 생성 public void createTable() throws SQLException, ClassNotFoundException { Connection c = connectionMaker.getConnection(); Statement stmt = c.createStatement(); String sql = "CREATE TABLE IF NOT EXISTS users (\n" + " id VARCHAR(45) NOT NULL,\n" + " name VARCHAR(45) NOT NULL,\n" + " password VARCHAR(45)\n" + ");"; stmt.execute(sql); } JdbcTemplate을 이용해 Table생성하기 public int createTable()..
python uuid만들기 uuid는 universal unique id 이다. 우주에서 유니크한 id라는 뜻입니다. uuid4를 많이 사용하는데요 uuid4는 완전 랜덤이라서 중복될 확률이 아주 낮기 때문입니다. import uuid print(uuid.uuid4()) # 결과 # ddb74652-440e-4d0c-b1c1-18e4e8582859 uuid1, 3, 5 등이 있는데요 uuid1은 공식 문서에 보면 아래와 같이 되어 있습니다. Generate a UUID from a host ID, sequence number, and the current time. If node is not given, getnode() is used to obtain the hardware address. If clo..
java Cache Algorithm(캐시 알고리즘) 캐싱은 데이터를 메모리 등 저장 해놓았다가 빼서 쓰는게 캐싱이다.주로 select를 많이 해야 하는 경우, 많이 타는 로직에서 캐싱을 쓴다.자바 코드에서 캐싱 로직을 둔다고 하면 Map에 넣을 수도 있고 List에 넣을 수 있을 것이다. 미국에서는 캐시 대체 알고리즘(cache replacement algorithms) 또는 캐시 대체 정책(cache replacement policies) 등으로 부른다. 캐싱 알고리즘을 어떤 것을 쓰는지에 따라서 성능이 천차만별이고 상황에 따라서 써야 하는게 다르다.일단은 캐싱의 종류에 대해서 알아보자.1.Bélády's algorithm2.First in first out (FIFO)3.Last in first o..
1.JsonNode로 만들기1234String rawJson = new String(byteBuffer.array(), "UTF-8");ObjectMapper objectMapper = new ObjectMapper(); JsonNode node = objectMapper.readTree(rawJson);cs ObjectMapper의 .readTree()를 사용한다. 2.java jackson을 이용해 json을 pojo로 바꾸기 123456789101112131415161718192021import com.fasterxml.jackson.core.JsonParser;import com.fasterxml.jackson.databind.DeserializationFeature;import com.faste..
Java8 Optional이란? 많은 존재 이유가 있지만 if(obj == null){}else{} 이 코드를 한줄로 깔끔하게 처리하기 위해 존재한다. 이걸 깔끔하게 처리 했을 때 functional programming에서 코드를 이쁘게 짤 수 있다. Optional optHello = Optional.ofNullable("hello"); System.out.println(optHello); Optional optNull = Optional.ofNullable(null); System.out.println(optNull);결과 Optional[hello] Optional.empty코드1 @Test public void optionalTest() { Optional opt = Optional.empty(..
파일에서 String읽어오기, String[]으로 읽어오기1234567891011121314public class FileStringGetter { public String getString(String location) throws IOException { byte[] data = Files.readAllBytes(Paths.get(location)); String dataString = new String(data); return dataString; } public String[] getLines(String location) throws IOException { String str = getString(location); String[] lines = str.split(System.getPrope..
12for (int i = 0; i
- Total
- Today
- Yesterday
- docker container tissue box
- 도커티슈케이스
- docker container whale
- Linux
- 개발자
- vim
- 2017 티스토리 결산
- 도커각티슈케이스
- 도커컨테이너
- docker container case
- shellscript
- docker container tissue
- Sh
- docker container
- 싱가폴
- 이직
- 도커각티슈박스
- 도커티슈박스
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |