[JAVA] ch02-08. 강제 형변환2
·
JAVA/예제
public class Ex08 {//강제형변환 public static void main(String[] args){ byte b = 10; int i = b; System.out.println("i=" + i); // i=10 System.out.println("b=" + b); // b=10 int i2 = 300; byte b2 = (byte) i2; System.out.println("i2=" + i2); // i2=300 System.out.println("b2=" + b2); // b2=44 } }
[JAVA] ch02-07. 강제 형변환
·
JAVA/예제
public class Ex07 { //double 출력값, int 출력값, 강제형변환 public static void main(String[] args){ double d = 100.0; int i = 100; int result = i + (int) d; System.out.println(d); // 100.0 System.out.println(i); // 100 System.out.println(result); //200 } }
[JAVA] ch02-06. float와 double
·
JAVA/예제
public class Ex06 {//float와 double public static void main(String[] args){ float f = 1.2345678901234567890f; // 끝에 f붙어서 float타입으로 적용하길바라는구나.. 4비트초과 반올림처리 double d = 1.2345678901234567890;//16자리 초과해서 오버플로우됨 float f2 = 0.100000001f; double d2 = 0.100000001; double d3 = 0.1000000000000001; double d4 = 1.2e10; //10의10승 System.out.println(f); System.out.println(d); System.out.println(f2); System.out...
[JAVA] ch02-05. byte 부호 출력가능 문자열
·
JAVA/예제
public class Ex05 {//byte 부호 출력가능 문자열 public static void main(String[] args){ byte b = 0; // byte 부호는 -2의7승~2의7-1 -128 ~ 127 int i = 0; for(int x = 0; x
[JAVA] ch02-04. 공란 활용
·
JAVA/예제
public class Ex04 { // 공란 활용 public static void main(String[] args){ String a = 7 + " "; String b = " " + 7; String c = 7 +""; String d = "" + 7; String e = "" + ""; String f = 7 + 7 +""; String g = "" + 7 + 7; System.out.println(a); System.out.println(b); System.out.println(c); System.out.println(d); System.out.println(e); System.out.println(f); System.out.println(g); } }
[JAVA] ch02-03. 문자, 문자열 안에 " " (따옴표) or / (슬래시) 넣기
·
JAVA/예제
public class Ex03 { //문자, 문자열안에 따옴표or슬래쉬 넣기. public static void main(String[] args){ char single = '\''; String dblQuote = "\"Hello\""; String root = "c:\\"; System.out.println(single); //' System.out.println(dblQuote); // "Hello" System.out.println(root); // c:\ 특수문자 앞에 \(역슬래쉬)를 쓰면 출력되지 않던 특수문자도 출력된다. } }
[JAVA] ch02-02. 알파벳 유니코드값과 타입변환
·
JAVA/예제
public class Ex02 {//알파벳 유니코드값 public static void main(String[] args){ int code = 65; // int code ='A';와 같은 의미 유니코드 65의 값은 A char ch = (char) code; //char ch = code;로 코딩할 경우 타입불일7치로 인한 에러발생 큰수->작은수 //바꿀때는 버려지는 자릿수가 있어서 JVM(Java Virture Machine)이 건들이지않는데 System.out.println(code); // 65 System.out.println(ch); // A System.out.println((char)0x0041); // Int타입[0x0041]은 16진수라 65로 출력되지만 //앞에 캐스팅연사자 (ch..
[JAVA] ch02-01. 알파벳 유니코드값
·
JAVA/예제
public class Ex01 { //알파벳 유니코드값 public static void main(String[] args){ char ch = 'A'; //char ch = 65;와 같은 의미 (A의 유니코드값 65) int code = ch; // ch값 변경이 아닌 ch값인 A값을 바꾸는 것 System.out.println(ch); // A ()
[JAVA] ch01. hello
·
JAVA/예제
public class Hello { //출력 public static void main(String[] args){ System.out.println("Hello"); System.out.print("Hello"); System.out.print("Hello\r"); System.out.print("Hello\n"); } }
[Python] 36. [Scraping] 이미지 처리와 텍스트 인식
·
빅데이터 프로그래밍/Python
[01] 이미지 처리와 텍스트 인식 1. Pillow 설치 - 이미지처리 기본 기능을 지원하며 사용이 쉬움.- http://pillow.readthedocs.org C:\Users\soldesk>pip install pillow Collecting pillow Downloading Pillow-4.1.0-cp36-cp36m-win_amd64.whl (1.5MB) 100% ■■■■■■■■■■■■■■■■■■■■ 1.5MB 211kB/s Collecting olefile (from pillow) Downloading olefile-0.44.zip (74kB) 100% ■■■■■■■■■■■■■■■■■■■■ 81kB 5.3MB/s Installing collected packages: olefile, pillow..
[Python] 35. [Scraping] Open API를 활용한 데이터 수집, MySQL 서버로 수집된 데이터의 저장
·
빅데이터 프로그래밍/Python
[01] Open API를 활용한 데이터 수집- IE -> https://data.seoul.go.kr -> 회원 가입 -> 로그인 -> 오픈 데이터 -> 오픈 API -> '지하철 승하차 인원' 검색 -> '서울시 지하철호선별 역별 승하차 인원 정보' 접속 -> Open API -> 인증키 신청 -> 4d79514946696e753739665a4f5979 1. 하나의 날짜에대한 지하철 승하차 인원 정보 [실행 화면] 1호선 종각 loading_date: 20170423 일요일 url: http://openapi.seoul.go.kr:8088/4d79514946696e753739665a4f5979/xml/CardSubwayStatsNew/1/549/20170423 승차 : 22966 하차 : 19138 ..
[Python] 34. [MySQL] JDBC 드라이버설정, Eclipse Data Source Explorer의 MySQL 설정
·
빅데이터 프로그래밍/Python
[01] JDBC 드라이버(connector) 다운로드 1. MySQL 드라이버 Download: http://www.mysql.com - Community Downloads 클릭 - MySQL Connectors 다운로드 - Connector/J 클릭 - [Download] 버튼 클릭 - 여기선 로그인안하고 다운로드만 합니다.2. 압축 풀기- 압축이 풀리면 jar 파일이 출력됩니다.- jar 파일을 복사하여 사용합니다.[02] Eclipse Data Source Explorer의 MySQL 설정- MySQL 서버를 먼저 실행합니다.- MySQL Driver 준비 C:/홈 폴더/mysql-connector-java-5.1.40-bin.jar1. Window -> Show View -> Other... 클..