2009년 2월 25일 수요일

생각에 잠기다..

세상을 그렇게 많이 살아 오지도 않았지만..

짧은 생을 사람들은 참 어렵게 산다..문득 이런생각이 든다..

한평생 살다 갈꺼 멋지게 살다가 가자라는 사람이 있는가 반면에.. 다른 한 부류는 대충살다 간다라는 사람도 있다..

대충살다 간다...대충살다가 가는것을 원하는 사람이라면, 그것이 최선의 선택인 것인데..그것에 대한 사람들에

대한 의식에 따라 안좋게 작용하는거 같다..

난 사실 편한게 좋다.. 운동도 싫고, 귀찮은것도 싫다.. 하기 싫은것도 너무 많고. 하루종일 뒹굴고 싶고, 기타등등

하고 싶고 하기 싫은게 많은데..생각대로 다 이루어 지지가 않는다..

그냥 편하게,,편하게는 안되는것일까??

자정이 넘은 이시각까지 컴퓨터 를 붙잡고 해야 하는 것은 무엇이며,, 이렇게 해서 과연 행복할까??

잠시 회의에 빠져버렸다..

사실 공부로 성공의 여부를 따지는 것은 옳지 않다고 생각을 한다.

적어도 그사람의 성공은 나중에 나이가 들어서 얼마나 많은 즐거움을 가졌는가가 중요하다고 생각하는 나에게는...

하지만 난 지금 석사학위까지 따려고 집착하고 있다..

안타깝다..

2009년 2월 12일 목요일

Java libraries to read and write Postscript (PS) files

PostScript is a well-known document file format created by Adobe. The typical file extension for PostScript files is .ps (.eps, .epsf and .epsi are also in use). More on the file format: Adobe, Open Directory, Wikipedia, PostScript FAQ. A PostScript file format specification is available for free on Adobe's website.

Library / package License Description
iText Mozilla License Read PostScript files. Uses code from Sun's Java2D sample PostScript interpreter.
Java2D PostScript Text GPL, MPL Write PostScript files.
Java EPS Graphics Free for personal, educational and non-commercial use. Special license for commercial use. Provides a special implementation of Graphics which writes into EPS (Encapsulated PostScript) files.
PSGr ? Write PostScript documents. Provides subclass of Graphics and stores all drawing commands in a PostScript file so that the vector nature of the resulting picture is preserved.
PS Viewer LGPL Read PostScript files.
RiePS LGPL Write PostScript files.
Saffron Document Server Commercial Reads PostScript (.ps) documents and generates PDF, HTML, RTF, TIFF, and other formats. Configured as a server for concurrent document rendering.
Sun Java2D PostScript interpreter ? Read PostScript files.
ToastScript GPL Read Level 1 PostScript (.ps) documents.

Java libraries to read and write DVI document files

DVI (for device independent) is the standard output file format of the TeX typesetting package.

This page lists Java software that can read or write DVI files. Right now, only DVI-reading software seems to be available, and all packages are DVI viewers.

Note that there is a project to create a port of TeX in Java: ExTeX. An older port is JavaTeX.

Non-Java viewers for DVI files include xdvi and yap. More DVI-processing software can be found at the DVIWare category of the Open Directory.

You want me to update an entry on this page, or a add a new one? Please read these remarks first!

Library / package License Description
IDVI Free (?) Read DVI documents. Applet, source code available.
jDvi Free (?) Read DVI documents in an applet.
Multivalent browser Special license Viewer that reads DVI (and other) documents. Source code available

Java libraries to read and write Excel XLS document files

Microsoft Excel spreadsheet files typically have a file extension of .xls. The newer versions of this format are subtypes of the Microsoft OLE 2 compound document file format, just like its fellow office file formats Word .doc and PowerPoint .ppt.

If you don't want to read and write this rather complex file format directly, you might also be successful exchanging data with Excel from your Java application by reading and writing simple text files that contain rows with tab- or comma-separated values (.csv). Java libraries for these replacement formats can be found in the Java data formats section of the Open Directory.

Excel is also able to access spreadsheet data from tables in in HTML files.

Library / package License Description
Actuate Spreadsheet Engine Commercial, 30-day trial version available Write Excel (XLS) files.
ExcelAccessor ? Read and write Excel (XLS) files.
ExcelReader ? JavaWorld article on how to read Microsoft Excel (XLS) files, including code. Requires an installed Microsoft ODBC driver for Excel files, and Sun's ODBC-JDBC driver.
ExtenXLS Commercial, 30-day trial version available Read and write Microsoft Excel (XLS) files.
JACOB project LGPL Java COM bridge with examples to interface Excel.
Java Excel API LGPL Read Excel (XLS) 97, 98 and 2000 files.
Java to Excel conversion ? Write SYLK files, which Excel can import and export.
JExcel Commercial Swing component to integrate Excel via JNI.
jXLS LGPL Create Excel files using XLS templates.
POI Apache Software License 1.1 Read and write Microsoft OLE 2 compound document format files. This includes MS Office files (DOC, XLS, PPT) written with Office versions that were released after 1997.
Snowbound Commercial Read Excel files.
SoftArtisans OfficeWriter Commercial Write Word and Excel files.
Vista JDBC Commercial, 15-day trial version available JDBC driver to access MS Excel (XLS) files.
xlSQL GPL JDBC driver to access MS Excel (XLS) and CSV files.

Java libraries to read and write PowerPoint PPT document files

The application PowerPoint is presentation software and a part of Microsoft Office. Its native file format has a file extension of .ppt. This page lists Java software to read and write PPT files.

Library / package License Description
Davisor Offisor Commercial Read Powerpoint (PPT) files. Can convert them to XML. 100% Java.
POI Apache Software License 1.1 Read and write Microsoft OLE 2 compound document format files. This includes MS Office files (DOC, XLS, PPT) written with Office versions that were released after 1997.
Tonic Java PowerPoint Library Commercial, demo available Read, create and manipulate PowerPoint files. 100% Java. Also available is a free Java reader for PPT files.

Java libraries to read and write Word DOC files

Arguably the most popular file format for documents, simply because of the high market share of Microsoft Office. Unfortunately, the .doc file format changes with every new version of Word, so there is not a single Word file format but a number of them. Make sure to find out which version of Word your Java application will have to interface with.

Instead of dealing with the complicated Word DOC file format it is often sufficient to exchange RTF (Rich Text Format) files. RTF is more simple than DOC, well-documented and even supported in Java's standard runtime library since Java 1.2 (see the API documentation of the javax.swing.text.rtf package).

If you need to support .doc itself, here are some libraries for it.

Library / package License Description
SoftArtisans OfficeWriter Commercial Write Word and Excel files.
POI Apache Software License 1.1 Read and write DOC files (only very basic support right now). POI is already covered on the Excel page: POI.
Java Bean Word Processing Freeware Read and write Word 97 and 2000 files. Needs a driver that runs only under Windows.
Davisor Offisor Commercial Reads Word files and transform them to XML. Pure Java solution.
RasterMaster Commercial Read Word files.

2009년 2월 9일 월요일

POJO Vs JavaBean

1)POJO is an acronym for Plain Old Java Object, and is favoured by advocates
of the idea that the simpler the design, the better. The name is used to
emphasize that the object in question is an ordinary Java Object, not a special
object, and in particular not an Enterprise JavaBean (especially before EJB 3).
The term was coined by Martin Fowler, Rebecca Parsons and Josh MacKenzie in
September 2000.

2)A JavaBean is a POJO that is serializable, has a no-argument constructor,
and allows access to properties using getter and setter methods. An Enterprise
JavaBean is not a single class but an entire component model (again, EJB 3
reduces the complexity of Enterprise JavaBeans).

2009년 2월 5일 목요일

POJO란?

POJO라는 말은 풀어쓰면 Plain Old Java Object(평범하고 오래된 자바 객체)라는 말로 일반적인 레귤러(Regular)자바 객체를 가리키는 말이 되겠다.

이 말은 Rebbecca Parson, Josh MacKenzie, Martin Fowler가 2000년 어떤 컨퍼런스에서 비즈니스 로직을 에터티 빈을 사용하는 대신 레귤러 자바 객체로 인코딩하는 것이 얼마나 이로운지를 설명하면서 나온말인데, 처음에 사람들이 이 말을 귀기울여 듣지 않았으나 곰곰히 생각해 보니 사람들이 새로운 용어가 아니라서 그런 듯 해서 POJO라는 그럴듯한 새로운 용어로 부르기 시작했다고 한다.

관련내용은 Martin Fowler의 위키에 가보면 확인 할수 있다.

http://www.martinfowler.com/bliki/POJO.html

                                                                                                                                           

POJO - Plain Old Java Object

- 평범한 java Object,즉 자바개발자가 마음대로 정의 할수 있는 객체라는 뜻이다.
- EJB 컨테이너에 의존 하는 객체 처럼 복잡하지 않고 개발자가 쓰기 편한 간단한 Object를 만들어 쓰자는
  간단한 Object의 개념이다.
- Object를 간단히 수퍼클래스로 둔 보통의 평범의 그자체 순수 자바클래스 라고 봐도 괜찮다.

POJO의 필수요소

- light-weight(possibly) : 가볍게
- fiexible : 유연성
- simple : 간단 명료
- supported by separate opional components such as hiberate or spring

- 즉, Spring, Hiberate, Ibatis 등에서 객체를 가볍게, 간단히 유연하게
   어떤 Object에 대해 추상화 할수있는 객체를 만들어야한다.
(ex. DTD의 쓰임)

                                                                                                                                         

                  
POJO를 이해하려면 POJO라는 단어가 만들어진 역사적 배경을 살펴볼 필요가 있다. POJO는 마틴 파울러가 2000년 가을에 열렸던 어느 컨퍼런스의 발표를 준비하면서 처음 만들어낸 말이다.
 마틴 파울러는 EJB(Enterprise JavaBean)보다는 단순한 자바 오브젝트에 도메인 로직을 넣어 사용하는 것이 여러 가지 장점이 있는데도 왜 사람들이 그 EJB가 아닌 ‘평범한 자바 오브젝트’를 사용하기를 꺼려하는지에 대해 의문을 가졌다. 그리고 그는 단순한 오브젝트에는 EJB와 같은 그럴듯한 이름이 없어서 그 사용을 주저하는 것이라고 결론 내렸다.
 그래서 만든 단어가 POJO라는 용어인 것이다. POJO 기반의 기술을 사용한다고 말하면 왠지 첨단 기술을 사용하는 앞선 개발자인 듯한 인상을 주기 때문이다.
이 POJO라는 용어를 만들어낸 전략은 매우 성공적이었다. EJB의 문제점과 한계를 느낀 많은 개발자들은 새로운 기술처럼 보이는 POJO 프로그래밍이라는 것에 관심을 가지게 되었고, POJO 기반의 프로그래밍 기술이 EJB의 강력한 대안으로 등장하기 시작했다. POJO 기반의 프레임워크, POJO 애플리케이션을 위한 플랫폼 등이 점점 인기를 끌게 되었고, 결국 POJO가 배제하려고 했던 EJB는 POJO 기반의 기술에 밀려 이제 레거시 기술로 사라질 위기에 처했다. 그렇다면 단지 EJB를 사용하지 않으면 모두 POJO라고 할 수 있을까? 그렇지는 않다. POJO 프로그래밍이라는 개념은 단지 ‘EJB가 아닌 자바’ 이상의 특징을 가지고 있는 프로그래밍 모델이다. POJO 기반의 개발은 생각보다 단순하지 않다.
POJO를 좀더 이해하려면 EJB의 장단점을 함께 이해해야 한다. 그것은 POJO 프로그래밍이 다시 EJB 시대 이전으로 돌아가자는 것이 아니고, EJB를 넘어 그보다 더 앞으로 나아가자는 것이기 때문이다



An acronym for: Plain Old Java Object.

The term was coined while Rebecca Parsons, Josh MacKenzie and I were preparing for a talk at a conference in September 2000. In the talk we were pointing out the many benefits of encoding business logic into regular java objects rather than using Entity Beans. We wondered why people were so against using regular objects in their systems and concluded that it was because simple objects lacked a fancy name. So we gave them one, and it's caught on very nicely.

2009년 2월 4일 수요일

MySQL의 auto_increment 적용

Mysql을 사용할때, 인덱스와 같이 필요에 의해 자동으로 숫자가 증가되는 기능이 필요할 경우
auto_increment를 사용한다.

적용 방법은 다음과 같다.

mysql> create table info_contents(c_count int not null auto_increment primary key, c_type varchar(10), c_name varchar(20));

auto_increment기능을 적용할 때 초기값을 지정해서, 지정된 숫자 부터 증가값을 적용하려면 다음과 같이 초기 값을 지정한다.

mysql> create table info_contents (c_count int not null auto_increment primary key, c_type varchar(10), c_name varchar(20)) auto_increment=200;

필요에 따라 증가된 값을 초기화 하고 싶을 경우에는  alter table 명령을 사용하여 증가된 값을 변경하여 줄수가 있다.

mysql> alter table info_contents auto_increment = 0;