내이름은빨강 그런거지 머(me2mobile me2photo) 2010-05-08 00:39:52 도서관에서 빌린 책에 남이 그어놓은 밑줄들을 보며 문득 이런저런 생각을 해본 경험들이 있을 것이다. 킨들은 특정 부분에 지금까지 몇 명의 유저가 밑줄을 그었는지까지를 이미 보여주고 있다. 우연을 통계로 바꾸는 것. 집단지성의 시대의 밑줄긋기.(me2mobile) 2010-05-08 14:47:55 이 글은 塡永님의 2010년 5월 8일의 미투데이 내용입니다.
A가 X에게 카테고리 소설 지은이 존 버거 (열화당, 2009년) 상세보기
import java.awt.*; class OpenWin extends Frame{ public OpenWin(String title){ super(title); super.setVisible(true); // 창크기 조절 super.setSize(300, 200); // 창을 화면 중앙으로 놓기.. Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); Dimension f_size = super.getSize(); int xpos = (int)(screen.getWidth()/2 - f_size.getWidth()/2); // 원래는 Double 형태.. int ypos = (int)(screen.getHeight()/2 - f_size.g..
#### 출력하기 #### /* 객체 직렬화 * : 객체의 내용을 콘솔이나 파일, 네트워크 상으로 출력하기 위해 일직선으로 나열시키는 것.. 한바이트씩 읽기 * Serializable 인터페이스 반드시 사용 */ // 객체 타입으로 파일로 저장하기!!! import java.io.*; class AAA implements Serializable{ int x = 100; int y = 200; int z = 300; } public class _4_1 { public static void main(String[] args) throws IOException{ AAA ap = new AAA(); // x, y, z라는 내용을 ap 객체라는 방식으로 직접 전송하기? FileOutputStream fos = n..
출처 : http://blog.naver.com/celestialorb?Redirect=Log&logNo=40009144868 J2SE 5.0에는 일상적 태스크를 좀 더 쉽게 구현할 수 있도록 하는 클래스와 메소드들이 추가되었다. 이번 팁에서는 새로 추가된 java.util.Scanner클래스를 이용함으로써 일반 표현문을 사용하는 스트링과 프리미티브 타입을 읽고 파싱(parsing)하는 것이 어떻게 좀 더 쉬워졌는지 알아보도록 하자. J2SE 5.0의 출시 이전에는 파일에서 텍스트를 읽으려면 다음의 TextReader 클래스 같은 코드를 작성해야했다. import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; ..
## 기본모양 1 (콘솔모드)## // Scanner Class : 입력하는 클래스.... import java.io.*; import java.util.*; public class _3_3 { public static void main(String[] args) throws IOException{ Scanner in = new Scanner(System.in); System.out.print("문자열 ="); String str = in.next(); System.out.print("숫자 = "); int x = in.nextInt(); System.out.println(str); System.out.println(x); } } ## 기본모양 2 (파일모드)## import java.io.File; i..
import java.io.*; public class _3_2 { public static void main(String[] args) throws IOException{ // 콘솔모드 InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br1 = new BufferedReader(isr); // 파일모드 FileReader fr = new FileReader(new File("ccc.txt")); BufferedReader br2 = new BufferedReader(fr); /////////////////////////////////////////////////////////////// System.out.print("문..
import java.io.*; public class _3_1 { public static void main(String[] args) throws IOException { // 콘솔 모드 // System.out : 콘솔과 연결되어 있는 1바이트 스트림. // 텍스트 기반(2바이트)의 스트림을 만들때는 1바이트짜리 스트림(Sysyem.out)을 반드시 매개변수로 써야한다. OutputStreamWriter osw1 = new OutputStreamWriter(System.out); BufferedWriter bw1 = new BufferedWriter(osw1, 1024); PrintWriter pw1 = new PrintWriter(bw1); // 파일모드 FileWriter fw2 = new Fi..
// try : 예외발생 예상지역을 묶고 // catch : 그 지역을 잠그고 // finally : 예외발생과 무관하게 실행... import java.io.*; public class _4_3 { public static void main(String[] ar) throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int su1=0, su2=0, tot=0; try{ // 예외 예상지역을 묶고... System.out.print("su1 = "); su1=Integer.parseInt(in.readLine()); System.out.print("su2 = "); su2=Integer.pa..
import java.io.*; public class _4_1 { public static void main(String[] args) throws Exception{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int su1 = 0; System.out.print("su1 = "); su1 = Integer.parseInt(in.readLine()); if(su1 > 100){ // 강제적으로 예외 발생 System.out.println("예외 발생 :"); Exception ex = new Exception(">100"); throw ex; } } }
// 여러개의 쓰레드가 한꺼번에 동작할 때... 발생하는 문제의 해결.... // 하나의 데이터 처리에 대해 쓰레드가 설정되어 있다면, 그 데이터를 관리하는 메소드는 동기화 할것.. // 하나의 메소드 내에서는 지역적으로 동기화... class K extends Thread{ private int x = 100; public void setX(int x){ this.x +=x; } public int getX(){ return x; } public synchronized void run(){ // 한사람이 이 메소드를 호출하면 다른이가 호출하지 못하도록 Lock(메소드 전체의 동기화) setX(200); System.out.println("x = " + getX()); } /* public synchro..
import java.util.*; import java.text.*; class AAA extends Thread{ public void run(){ while(true){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date d = new Date(); String str = sdf.format(d); try { Thread.sleep(1000); System.out.println("현재시간 : "+str); } catch (InterruptedException e) {} } } } public class _3_1 { public static void main(String[] args) { System.out.println(..