블로그 이미지
Leeway is... the freedom that someone has to take the action they want to or to change their plans.
maetel

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

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
  • total
  • today
  • yesterday

Category

2010. 2. 9. 01:34 Computation/Language
Google C++ Style Guide
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml    informed by jinho

C++ coding standards: 101 rules, guidelines, and best practices  By Herb Sutter, Andrei Alexandrescu

Code Complete by Steven C. McConnell
http://cc2e.com/


Code Craft: the practice of writing excellent code By Pete Goodliffe
http://oreilly.com/catalog/9781593271190   informed by neuralix



'Computation > Language' 카테고리의 다른 글

windows.h  (0) 2008.09.10
Communications Functions (Windows)  (0) 2008.08.14
visual c++ solution - dsw  (0) 2008.08.12
16진수 10진수로 변환 strtol()  (0) 2008.08.12
numeric library  (0) 2008.03.18
posted by maetel
2008. 9. 10. 22:08 Computation/Language
http://en.wikipedia.org/wiki/Windows.h

a Windows-specific header file for the C programming language which contains all the function declarations in the API, as well as declarations for all the common macros used by windows programmers, and all the data types used by the various functions and subsystems.

http://en.wikibooks.org/wiki/Windows_Programming



'Computation > Language' 카테고리의 다른 글

C++ Style  (2) 2010.02.09
Communications Functions (Windows)  (0) 2008.08.14
visual c++ solution - dsw  (0) 2008.08.12
16진수 10진수로 변환 strtol()  (0) 2008.08.12
numeric library  (0) 2008.03.18
posted by maetel
2008. 8. 14. 14:23 Computation/Language

'Computation > Language' 카테고리의 다른 글

C++ Style  (2) 2010.02.09
windows.h  (0) 2008.09.10
visual c++ solution - dsw  (0) 2008.08.12
16진수 10진수로 변환 strtol()  (0) 2008.08.12
numeric library  (0) 2008.03.18
posted by maetel
2008. 8. 12. 20:41 Computation/Language
http://www.winapi.co.kr/clec/cpp1/2-2-2.htm

프로젝트는 하나의 실행 파일을 제작하는데 필요한 관련 파일의 집합이다.

비주얼 C++은 프로젝트보다 더 상위의 개념인 솔루션(Solution)까지 지원한다. 솔루션(비주얼 C++ 6.0에서는 워크 스페이스)이란 여러 개의 프로젝트를 모아 놓은 것이다.

솔루션 파일은 확장자 sln(6.0에서는 dsw)을 가지며 프로젝트 파일은 확장자 vcproj(6.0에서는 dsp)를 가진다.



http://wi-fizzle.com/howtos/vc-stl/templates.htm

'Computation > Language' 카테고리의 다른 글

windows.h  (0) 2008.09.10
Communications Functions (Windows)  (0) 2008.08.14
16진수 10진수로 변환 strtol()  (0) 2008.08.12
numeric library  (0) 2008.03.18
Python tutorials  (0) 2008.02.24
posted by maetel
2008. 8. 12. 04:17 Computation/Language

'Computation > Language' 카테고리의 다른 글

Communications Functions (Windows)  (0) 2008.08.14
visual c++ solution - dsw  (0) 2008.08.12
numeric library  (0) 2008.03.18
Python tutorials  (0) 2008.02.24
Using Python for CGI programming  (0) 2007.07.11
posted by maetel
2008. 3. 18. 23:24 Computation/Language
C, 자바, 포트란으로 만들어진 산업 표준 IMSL 수치 라이브러리
http://www.vni.co.kr/products/imsl/documentation/index.html


'Computation > Language' 카테고리의 다른 글

visual c++ solution - dsw  (0) 2008.08.12
16진수 10진수로 변환 strtol()  (0) 2008.08.12
Python tutorials  (0) 2008.02.24
Using Python for CGI programming  (0) 2007.07.11
classes in Python  (0) 2007.07.11
posted by maetel
2008. 2. 24. 01:40 Computation/Language
아니 뭐 이런 천사 같은 사람들이 이렇게 많아...

http://www.diveintopython.org/


1
How to Think Like a Computer Scientist
Learning with Python (2nd Edition)
by Jeffrey Elkner, Allen B. Downey and Chris Meyers
illustrated by Udit Bhatnager and Chris Schmeelk

-> 너무나 친절한 설명. 컴퓨터 프로그래밍 언어에 대한 개념을 처음 잡을 때 힘들게 정리했던 것들이 1장에 깔끔하게 요약되어 있고. @.@ 진도 진짜 천천히 나간다. 자연계라면 좀 지루할 정도. 손 놓고 있는 동안 다 잊어 버렸을까 걱정했는데 이거 한 번 보면 될 듯. 파이썬 아니, 코딩 처음 공부할 때 여기 알았으면 진짜 편했을텐데. ㅜㅜ

2
Python Tutorial
Guido van Rossum
Python Software Foundation

-> 지금 보면 좀 나으려나? 설명이 압축적이라 막상 코딩을 짤 때에는 의외로 큰 도움이 되지 못했었다. 코딩에 대한 것이 아니라 언어 자체에 대한 설명이기 때문이다. 나한텐 어렵다. 내겐 필요 없는 내용도 많다. 그래도 필독. 일종의 사전이라고 생각한다. (사전 본다고 글이 써지는 건 아니잖아? ^^;)

3
Penzilla.net's Python Tutorial


4
O'Reilly Python Center

-> 그래도 중급 이상 되기 전에는 안 사. ㅋ 오호. Jython이라...
Jython is an implementation of the Python programming language written in Java, allowing Python programs to integrate seamlessly with any Java code.



Python에서의 프로그래밍, Part 1



etc.

Text Processing in Python
by David Mertz -- published by Addison Wesley

-> 나중에 유용할 날이 있을 듯한 예감.


http://coreapython.hosting.paran.com/

'Computation > Language' 카테고리의 다른 글

16진수 10진수로 변환 strtol()  (0) 2008.08.12
numeric library  (0) 2008.03.18
Using Python for CGI programming  (0) 2007.07.11
classes in Python  (0) 2007.07.11
Python  (0) 2007.06.26
posted by maetel
2007. 7. 11. 21:10 Computation/Language
Using Python for CGI programming

Author: Guido van Rossum
Email: guido@python.org
Home Page: http://www.python.org/~guido/


Subclasses
class Stack:
    "A well-known data structure..."
    def __init__(self):
        self.items = []
    def push(self, x):
        self.items.append(x)
    def pop(self):
        x = self.items[-1]
        del self.items[-1]
        return x
    def empty(self):
        return len(self.items) == 0
   
#x = Stack()
#x.empty()
#x.push(1)
#x.empty()
#x.push("hello")
#x.pop()
#print x.items
#x.push("hello")
#print x.items
   
class FancyStack(Stack):
    "stack with added ability to inspect inferior stack items"
   
    def peek(self, n):
        "peek(0) returns top; peek(-1) returns item below that; etc."
        size = len(self.items)
        assert 0 <= n < size
        return self.items[size-1-n]
       

class LimitedStack(FancyStack):
    "fancy stack with limit on stack size"
   
    def __init__(self, limit):
        self.limit = limit
        FancyStack.__init__(self)
       
    def push(self, x):
        assert len(self.items) < self.limit
        FancyStack.push(self, x)

> Instance variable rules
- Use via instace (self.x), search order: (1) instance, (2) class, (3) base classes
- assignment via instace (self.x = ...) always makes an instacne variable
- Class variables "default" for instance variables  


'Computation > Language' 카테고리의 다른 글

numeric library  (0) 2008.03.18
Python tutorials  (0) 2008.02.24
classes in Python  (0) 2007.07.11
Python  (0) 2007.06.26
features of object-oriented programming  (0) 2007.06.20
posted by maetel
2007. 7. 11. 14:34 Computation/Language
ref. Python tutorial 9. Classes

The class inheritance mechanism allows multiple base classes, a derived class can override any methods of its base class or classes, and a method can call the method of a base class with the same name. Objects can contain an arbitrary amount of private data.

In Python, all data types are objects.

A namespace is a mapping from names to objects. Name spaces are created at different moments and have different lifetimes.
The word attribute is for any name following a dot. Attributes may be read-only or writable.
A scope is a textual region of a Python program where a namespace is directly accessible.

Assignments always go into the innermost scope. Assignments do not copy data -- they just bind names to objects.

A class object is basically a wrapper around the contents of the namespace created by the class definition.

Class objects support two kinds of operations: attribute references and instantiation.
Attribute references
use the standard syntax used for all attribute references in Python: obj.name.
Class instantiation uses function notation. Just pretend that the class object is a parameterless function that returns a new instance of the class.

The only operations understood by instance objects are attribute references. There are two kinds of valid attribute names, data attributes and methods.
Data attributes
correspond to "instance variables'' in Smalltalk, and to "data members'' in C++.
A method is a function that "belongs to'' an object. The special thing about methods is that the object is passed as the first argument of the function.

Any function object that is a class attribute defines a method for instances of that class.

The global scope associated with a method is the module containing the class definition. (The class itself is never used as a global scope!) Functions and modules imported into the global scope can be used by methods, as well as functions and classes defined in it. Usually, the class containing the method is itself defined in this global scope.



ref. 이강성 <열혈강의 파이썬(Python)> 개정판 Ver.2: 12 클래스, 프리렉

파이썬의 클래스는 새로운 이름 공간을 지원하는 단위이다. 이 이름 공간에는 함수와 변수가 포함될 수 있다. 클래스는 하나 이상의 인스턴스 객체를 생성하는 틀과 같다.
(클래스 자체가 이름 공간을 가지지만, 각각의 인스턴스도 독립적인 이름 공간을 가진다. ->) 동적으로 클래스 외부에서 멤버를 생성할 수 있다.

Class : class 문으로 정의되며, 멤버와 메쏘드를 가지는 객체
Class Object
Class Instance : 클래스를 호출하여 만들어지는 객체
Class Instance Object
Member : 클래스가 갖는 변수
Method : 클래스 내에 정의된 함수
Attribute : 멤버와 메쏘드 전체. 즉, 이름 공간의 이름 전체.
Super Class = Base Class
Sub Class = Derived Class

> Features of Classes in OOP
Inheritance 상속: (A 클래스를 수퍼 클래스로 하는 클래스 B를 생성하였다면 B 'is-a' A 관계라고 함.)
Multiple Inheritance 다중 상속: 두 개 이상의 수퍼 클래스로부터 상속받는 것
Polymorphism 다형성: 상속 관계 내의 다른 클래스의 인스턴스들이 같은 멤버 함수 호출에 대해 각각 다르게 반응하도록 하는 기능
Encapsulation 정보 은닉: 메쏘드와 멤버를 클래스 내에 포함시키고 외부에서 접근 가능하도록 인터페이스만을 공개하고 다른 속성들은 내부에 숨기는 것
Composition 합성: 어떤 객체가 다른 객체에 포함되어 활용되는 것 (x라는 객체가 클래스 A안에 포함되어 A의 각종 메쏘드를 구현하는데 사용된다면, A가 x를 포함하므로 'has-a'관계라고 함.)

self: 메쏘드를 정의할 때 사용하는 첫 인수. 자신의 인스턴스 객체를 가리키는 레퍼런스이다.
- 모든 메쏘드는 반드시 self를 첫 인수로 받아야 한다. (이 self를 이용하여 클래스의 이름 공간에 접근해야 하기 때문이다.)
- 지역(local) 이름은 함수가 종료되면 리턴과 동시에 없어지므로 객체 이름 공간에 값을 저장해 두지 않으면 나중에 사용할 수 없다.
- 메쏘드를 인스턴스 객체를 통하여 직접 호출할 때는 첫번째 인수인 self는 없다고 생각하면 된다.
- 클래스의 멤버나 메쏘드를 참조하려면 언제나 self를 이용해야 한다.

Unbound Class Method 호출: 클래스 객체를 이용하여 메쏘드를 호출하는 것
Bound Instance Method 호출: 인스턴스를 통하여 자동으로 self인수를 전달하는 방식

Static Method 정적 메쏘드: 인스턴스 객체를 생성하지 않고도, 또는 인스턴스 객체를 이용하지 않고도 클래스 이름을 이용하여 직접 호출할 수 있는 메쏘드
Class Method

Class Member - 메쏘드 바깥에 정의된다.
Instance Member - 메쏘드 내부에서 self를 이용하여 정의된다.

Constructor 생성자: 인스턴스 객체가 생성될 때 초기화를 위해서 자동적으로 불려지는 초기화 함수
Destructor 소멸자: 인스턴스 객체가 사용이 끝나서 메모리에서 해체될 때 자원 해제를 위해서 자동으로 호출되는 함수

Reserved Words 예약어: 미리 어떤 기능이 정의된 경우
    eg1. __init__
    eg2. __del__







'Computation > Language' 카테고리의 다른 글

Python tutorials  (0) 2008.02.24
Using Python for CGI programming  (0) 2007.07.11
Python  (0) 2007.06.26
features of object-oriented programming  (0) 2007.06.20
내 컴퓨터에서 Processing의 source code 보기  (0) 2007.04.19
posted by maetel
2007. 6. 26. 11:00 Computation/Language
posted by maetel
2007. 6. 20. 19:39 Computation/Language
Object-oriented programming (OOP) is a programming paradigm that uses "objects" to design applications and computer programs. It uses several techniques from previously established paradigms, including inheritance, modularity, polymorphism, and encapsulation.
Object-oriented programming may be seen as a collection of cooperating objects, as opposed to a traditional view in which a program may be seen as a list of instructions to the computer. In OOP, each object is capable of receiving messages, processing data, and sending messages to other objects. Each object can be viewed as an independent little machine with a distinct role or responsibility.

#
In object-oriented programming, inheritance is a way to form new classes (instances of which are called objects) using classes that have already been defined. The new classes, known as derived classes, take over (or inherit) attributes and behavior of the pre-existing classes, which are referred to as base classes (or ancestor classes). It is intended to help reuse existing code with little or no modification.

#
In object-oriented programming, a class is a programming language construct that is used to group related instance variables and methods. A method, called a function in some languages, is a set of instructions that are specific to a class. Depending on the language, classes may support multiple inheritance or may require the use of interfaces to extend other classes. A class may indicate either specifically or abstractly what methods exist when the program is executed. The latter is known as an 'abstract class'. A class must be defined with a constructor if it is to be used as an object, that is, instantiated. However some classes, especially those containing factory methods, are defined as static classes with no constructor merely to organize data hierarchically (e.g. the Math class may contain the static constant PI and the static method abs).

'Computation > Language' 카테고리의 다른 글

classes in Python  (0) 2007.07.11
Python  (0) 2007.06.26
내 컴퓨터에서 Processing의 source code 보기  (0) 2007.04.19
<HeadFirst Java> 클래스와 객체  (0) 2007.03.16
Java tutorials  (0) 2007.02.28
posted by maetel
2007. 4. 19. 03:29 Computation/Language
processing.org 홈페이지의 http://dev.processing.org/source/가 아닌 내 컴퓨터의 하드에서 Processing의 source code를 보자.
(cp. Index of /trunk/processing/core/src/processing/core)


1. source code 받기

기본으로는 소스코드를 받지 않고 바로 실행모듈을 받는 거니까 지금 내 컴퓨터에는 소스코드가 없다. 그래서 우선 소스코드를 따로 받아야 한다.

1) 우선 CVS 프로그램을 설치해야 한다.
terminal에서 'cvs'라고 쳤더니 Usage가 나왔다. 컴퓨터에 CVS가 설치되어 있다는 뜻이다.
cf. CVS란? Concurrent Versions System -> def. and Gnu's intro
(공동 버전 시스템: 각종 소스의 버전을 관리할 수 있도록 도와주는 도구. 공동으로 진행하는 프로젝트 수행자들에게 편리한 도구로, Apache, Mozilla 등의 공개 프로젝트에서 사용되어 그 효능을 입증하였고, 우리나라에서도 KLDP(Korean Linux Documentation Project), JS Board 등의 공동 개발 작업에서 사용되고 있다.)

2) 그리고 SVN (Subversion) 프로그램을 설치해야 한다.
ref. http://dev.processing.org/build/
terminal에서 'svn'이라고 쳤더니 에러 메시지가 떴다. 컴퓨터에 SVN이 없기 때문이므로 여기에서 다운 받았다.

3) source code를 받는다.
terminal에서 'svn co svn://processing.org/trunk/processing'을 입력한다. svn://processing.org/trunk/processing 의 코드트리를 check-out (co) 하라는 명령이다.


2. 명령어 배우기

0) pwd - "print working directory"라고 지금 터미널이 어느 디렉토리(폴더)에 있는지 보여 주는 명령
eg. terminal에서 'pwd'를 쳤더니 /Users/lym라고 나왔다는 것은 지금 홈 디렉토리에 있다는 뜻이다.

1) grep - 텍스트 검색 명령
파일 (리스트) 에서 "PATTERN"을 찾는다. 특정한 파일에서 주어진 문장을 검색하는 기능인데 파일 뿐만 아니라 디렉토리를 통째로 검색할 수 있다.
옵션 중에 -R (recursive) 옵션을 쓰면 디렉토리 밑으로 끝까지 찾아 들어간다.
bzgrep, zgrep 등은 압축된 파일에서 찾을 때 쓴다.
eg. 'grep -R constrain processing'이라고 치면, processing 디렉토리 밑의 모든 파일에서 "constrain"이라는 문자열을 찾아 그 파일과 문자열이 있는 줄을 보여 준다.

2) man - 모든 명령과 프로그램의 매뉴얼 페이지를 보여 준다.
eg. 'man grep'이라 치면, grep이 구체적으로 뭘 하는 프로그램이며 어떻게 써 먹는지를 볼 수 있다.

3) apropos - 이 매뉴얼 페이지 중 한줄 요약 리스트를 검색한다.
뭔가 필요한 기능이 있는데 명령이나 프로그램을 모르면 apropos로 원하는 기능을 가진 명령이 있는지 찾아 보고, 있으면 man 으로 그 매뉴얼을 봐서 쓰면 된다.
eg. 뭔가를 검색하고 싶다면 일단 'apropos search'라고 하자. 그러면 매뉴얼 요약 중에 'search'라는 단어가 있는 명령어는 모두 보여 준다.

Tip. apropos 의 출력이 너무 많으면 grep으로 한번 더 "필터링"을 할 수 있다.
예로 다시 grep을 들면, search 외에 file 이라는 키워드도 생각할 수 있겠다.
그럼 'apropos search | grep file'이라고 하면 apropos 의 출력 중에 "file"이라는 단어가 있는 줄만 보여 준다.
cf. ' | ' 는 'pipe'라고 해서 유닉스의 기본 기능 중 하나인데 파이프 왼쪽의 출력을 오른쪽의 입력으로 돌리는 것이다.

4) h 또는 ? 또는 ctrl-C - help


'Computation > Language' 카테고리의 다른 글

Python  (0) 2007.06.26
features of object-oriented programming  (0) 2007.06.20
<HeadFirst Java> 클래스와 객체  (0) 2007.03.16
Java tutorials  (0) 2007.02.28
The Java™ Tutorials  (0) 2007.02.28
posted by maetel
2007. 3. 16. 10:16 Computation/Language
61p
객체 마을로의 여행

constructor(생성자), method(함수), property(변수, 객체)
    cf. instance

절차 지향/객체 지향

 
 procedure
"프로그램이라는 것은 결국은 프로시저를 모아놓은 것"
= Subroutine or method (computer science)
(1) Same as routine, subroutine, and function. A procedure is a section of a program that performs a specific task.
(2) An ordered set of tasks for performing some action.
   
     subroutine http://en.wikipedia.org/wiki/Subroutine
    a portion of code within a larger program, which performs a specific task and is relatively independent of the remaining code.   

 object
Generally, any item that can be individually selected and manipulated. This can include shapes and pictures that appear on a display screen as well as less tangible software entities. In object-oriented programming, for example, an object is a self-contained entity that consists of both data and procedures to manipulate the data.
http://en.wikipedia.org/wiki/Object_%28computer_science%29
http://java.sun.com/docs/books/tutorial/java/concepts/object.html

 method
 In object-oriented programming, a procedure that is executed when an object receives a message. A method is really the same as a procedure, function , or routine in procedural programming languages. The only difference is that in object-oriented programming, a method is always associated with a class.

 instance
(1) 일반적으로 어떤 집합에 대해서, 그 집합의 개별적인 요소. 객체 지향 프로그래밍(OOP)에서, 어떤 등급에 속하는 각 객체를 인스턴스라고 한다. 예를 들면 ‘목록(list)’이라는 등급을 정의하고 그 다음에 ‘본인 목록(my list)’이라는 객체를 생성(기억 장치 할당)하면 그 등급의 인스턴스가 생성된다. 또한 변수가 포함되어 있는 어떤 논리식의 변수에 구체적인 값을 대입하여 식을 만들면 원래 식의 인스턴스가 만들어진다. 이런 의미에서 인스턴스를 실현치라고 한다.
(2) 프로그램 작성 언어 에이다(Ada)에서 매개 변수를 사용해서 절차를 일반적으로 정의한 범용체(generic package)에 대해, 그것으로부터 도출한 구체적인 실체.

 constructor 생성자 生成子
객체 지향 프로그래밍(OOP:objective-oriented programming)에서 쓰이는 객체 초기화 함수. 객체의 생성 시에만 호출되어 메모리 생성과 동시에 객체의 데이터를 초기화하는 역할을 한다.
: 객체를 처음 생성할 때 자동으로 만들어지는 함수.
<=
class의 속성을 정의해 주는 것이 constructor(생성자)이다.



'Computation > Language' 카테고리의 다른 글

features of object-oriented programming  (0) 2007.06.20
내 컴퓨터에서 Processing의 source code 보기  (0) 2007.04.19
Java tutorials  (0) 2007.02.28
The Java™ Tutorials  (0) 2007.02.28
The Java Technology  (0) 2007.02.28
posted by maetel
2007. 2. 28. 12:55 Computation/Language

'Computation > Language' 카테고리의 다른 글

내 컴퓨터에서 Processing의 source code 보기  (0) 2007.04.19
<HeadFirst Java> 클래스와 객체  (0) 2007.03.16
The Java™ Tutorials  (0) 2007.02.28
The Java Technology  (0) 2007.02.28
<HeadFirst Java>  (0) 2006.07.13
posted by maetel
2007. 2. 28. 04:27 Computation/Language

'Computation > Language' 카테고리의 다른 글

<HeadFirst Java> 클래스와 객체  (0) 2007.03.16
Java tutorials  (0) 2007.02.28
The Java Technology  (0) 2007.02.28
<HeadFirst Java>  (0) 2006.07.13
Java  (0) 2006.05.17
posted by maetel
2007. 2. 28. 01:15 Computation/Language

'Computation > Language' 카테고리의 다른 글

Java tutorials  (0) 2007.02.28
The Java™ Tutorials  (0) 2007.02.28
<HeadFirst Java>  (0) 2006.07.13
Java  (0) 2006.05.17
object-oriented programming  (0) 2006.05.01
posted by maetel
2006. 7. 13. 19:57 Computation/Language
Head First Java: 뇌 회로를 자극하는 자바 학습법(개정판)

http://wickedlysmart.com/


http://www.javaranch.com/



 codeKitchensTiger



 J2SE(TM) Development Kit Documentation 5.0 docs


UML = Unified Modeling Language
http://en.wikipedia.org/wiki/Unified_Modeling_Language


PATH 환경 변수에 메인 자바 디렉토리 밑에 있는 /bin 디렉토리(자바 바이너리 파일이 들어 있음)를 추가해야 한다.
bin 디렉토리를 PATH 변수에 추가하면 된다.
그러면 명령행에서 "% javac" 명령을 입력했을 때 터미널에서 javac라는 자바 컴파일러를 바로 실행시킬 수 있다.

44p
main method 메소드
: 컴퓨터로 하여금 어떤 일을 하게 만드는 모든 일반적인 지시사항을 담고 있다


코드 -  선언문/순환문/분기문

45p
표준 순환 구조 - while, do-while, for

순환문 while
> 조건 테스트
> 부울 값 boolean ; 조건 테스트의 결과 ; true 또는 false
> 비교 연산자(<, >, ==)를 이용하여 변수의 값을 확인함으로써 간단한 부울 테스트 가능
   cf. == ; 동치 연산자 / = ; 대입 연산자
* 조건 테스트를 직접 할 수 있는 변수는 부울 변수 뿐.
* 부울 테스트는 괄호 안에 들어간다.
   eg. while (x==4) { }

 조건에 따른 분기문 if




'Computation > Language' 카테고리의 다른 글

The Java™ Tutorials  (0) 2007.02.28
The Java Technology  (0) 2007.02.28
Java  (0) 2006.05.17
object-oriented programming  (0) 2006.05.01
프로그래밍 언어 개론  (0) 2006.03.31
posted by maetel
2006. 5. 17. 12:19 Computation/Language
Java Technology      http://java.sun.com/
http://50001.com/sub/yopark.html


1. 자바란?

http://www.javastudy.co.kr/docs/yopark/chap01/chap01.html#1_1


journaled pic.png


사용자 삽입 이미지


Java Compiler 자바 컴파일러
: 자바 언어로 작성된 자바 프로그램을 중간 언어(intermediate language) 형태인 자바 바이트코드로 컴파일함


Java Byte code 자바 바이트코드
: 컴퓨터는 CPU 따라 서로 다른 기계어를 갖는다. 자바 바이트코드는 이러한 플랫폼에 상관없이 자바 가상머신에 의해 실행될 있도록 정의된 중간코드이다. (, 자바 가상머신에서 실행되는 기계어라고 생각하면 된다.) 따라서 자바 바이트코드로 컴파일되기만 하면, 자바 인터프리터인 자바 가상머신이 설치되어 있는 곳이면 어디에서든 실행시켜 있다. 

자바 바이트코드는 "write once, run anywhere"라는 말을 가능하게 준다. , 자바 언어를 사용하여 작성한 자바 프로그램을 플랫폼에 맞게 제공되는 자바 컴파일러를 통해서 바이트코드로 컴파일 있고, 바이트코드는 자바 가상머신이 있는 어떤 곳에서도 실행될 있다.


Java Interpreter 자바 인터프리터 또는 Java Virtual Machine 자바 가상머신
: 자바 바이트코드 명령어를 해석하고, 이를 자바 인터프리터가 설치되어 있는 플랫폼(윈도우, 유닉스, 매킨토시 ) 맞게 실행시켜 준다. 자바 인터프리터는 자바 바이트코드를 실행시켜 주기 위한 기능을 명세하고 있는 자바 가상머신을 구현해 놓은 것으로서 자바 가상머신과 같은 의미로 사용되며, 주로 자바 가상머신으로 많이 사용된다.


Java Virtual Machine = Java VM 자바 가상머신

: 자바 플랫폼의 기반을 이루며, 다양한 하드웨어 기반 플랫폼에 포팅porting 된다. 자바 가상머신은 기존의 운영체제들 또는 웹브라우저 여러 가지 플랫폼에 설치되어 사용될 있으며, 사용자는 자바 바이트코드로 컴파일된 자바 프로그램을 실행시키기 위해서 자바 가상머신을 이용하면 된다.

자바 가상머신은 JDK(Java Development Kit) 포함되어 있을 수도 있고, 자바 호환 브라우저 내에 내장되어 있을 수도 있으며, 또는 자바 칩과 같이 하드웨어에 직접 구현될 수도 있다.


Java Application Programming Interface = 자바 API

: 자바 API 운영체제에서 제공해 주는 라이브러리와 같은 것으로, 자바 프로그램을 개발하기 위해 사용할 있는 라이브러리 또는 클래스들이다. 자바 API 서로 관련된 클래스들을 묶어서 패키지 단위로 제공된다.


사용자 삽입 이미지


port

(v.) To move a program from one type of computer to another. To port an application, you need to rewrite sections that are machine dependent, and then recompile the program on the new computer. Programs that can be ported easily are said to be portable.


portable

(adj.) (1) When used to describe hardware, portable means small and lightweight. A portable computer is a computer small enough to carry. Portable computers include notebook and subnotebook computers, hand-held computers, palmtops, and PDAs.
(2) When used to describe software, portable means that the software has the ability to run on a variety of computers. Portable and machine independent mean the same thing—that the software does not depend on a particular type of hardware. 



Java 장점>
- 객체 지향적 Object-Oriented
자바는 C++와는 달리 처음부터 객체지향 개념을 기반으로 하여 설계되었고, 객체지향 언어가 제공해 주어야 하는 추상화(abstraction), 상속(inheritance), 다형성(polymorphism) 등과 같은 특성들을 모두 완벽하게 제공해 주고 있다. 자바의 이러한 객체지향적 특성은 분산 환경, 클라이언트/서버 기반 시스템이 갖는 요구사항도 만족시켜 있다.

- Architecture-neutral and Portable 아키텍처 중립적이고 이식성이 높다.


ref.

Gamelan     http://www.developer.com/java/

Javalobby   http://www.javalobby.org/

Focus on Java   http://java.about.com/  

Jars: Java Review Service    http://www.jars.com/

JavaBoutique   http://javaboutique.internet.com/

JavaWorld     http://www.javaworld.com/



Is Apple's OS X The Best (or even A Good) Platform for Java Development?


Getting Started with Java on Mac


Java Development Guide for Mac OS X

http://developer.apple.com/documentation/Java/Conceptual/Java14Development/index.html#//apple_ref/doc/uid/TP30001142



'Computation > Language' 카테고리의 다른 글

The Java™ Tutorials  (0) 2007.02.28
The Java Technology  (0) 2007.02.28
<HeadFirst Java>  (0) 2006.07.13
object-oriented programming  (0) 2006.05.01
프로그래밍 언어 개론  (0) 2006.03.31
posted by maetel
2006. 5. 1. 16:20 Computation/Language
*   Object-Oriented Programming Concepts

 object-oriented design
: A software design method that models the characteristics of abstract or real objects using classes and objects.

 Object
: a software bundle of related variables and methods. (Software objects are often used to model real-world objects you find in everyday life.)
A software object can represent real-world objects and abstract concepts like an event.
> what the software object knows is 'state' and what it can do is 'behavior'.

사용자 삽입 이미지


     variable
    : an item of data named by an identifier. Each variable has a type, such as int or Object, and a scope
    컴퓨터 프로그래밍 언어에서의 변수의 의미는, 컴퓨터 기억 장소를 가리키는 추상적인 표현방법입니다. 즉, 기억 장소의 주소를 상징화한 것입니다. 변수에 대한 정의가 아직까지 정확하게 이해되지 않는 분들이 많으시리라 생각됩니다.
다른 예에 빗대자면 이렇습니다. '동경 135˚, 북위 37.5˚'가 메모리 주소라면, '한국(Korea)'은 이를 나타내는 변수(정확히 변수의 이름)가 되는 것입니다.
변수는 다음과 같은 속성을 가지고 있습니다.

  이름(Name)
  변수의 호칭입니다.

 주소(Address)
  변수와 연결되는 메모리의 위치를 말합니다. 이 때, 변수가 나타내는 메모리 위치는 항상 동일하지 않습니다. 즉, 동일한 이름을 가진 변수라도 이 변수가 각기 다른 용도로 쓰일 때에는 서로 독립적인 개체로 보고, 이들 변수가 가리키는 주소도 서로 다르게 됩니다. 변수의 주소를 가끔 'l-value'라고도 하는데, 이는 할당문에서 변수가 좌변에 위치한다는 사실에 기인한 것입니다.

 값(Value)
  변수의 값은 변수와 연결된 메모리 위치에 담겨 있는 내용을 말합니다. 'Apple'이라는 이름을 가진 변수의 메모리 주소가 '00DE'이고, 이 공간에 저장된 내용이 실수 '3.41'라고 하면, 이것이 바로 변수의 값이 되는 것입니다. 변수의 값을 가리켜 'r-value'라고도 합니다.
 
 자료형(Type)  
  변수의 자료형은 변수가 가질 수 있는 값의 범위와 적용 가능한 연산자의 집합을 결정합니다. 예를 들어, C 언어에서 'int' 자료형은 -32768~32767 까지의 범위에 해당하는 값을 가질 수 있으며, 사칙연산 및 라이브러리 함수로 제공되는 연산자를 사용할 수 있습니다.
             scope
            :     
         class variable
        : A data item associated with a particular class as a whole--not with particular instances of the class. Class variables are defined in class definitions. = static field
         instance variable
        : Any item of data that is associated with a particular object. Each instance of a class has its own copy of the instance variables defined in the class.
             field
            : A data member of a class. Unless specified otherwise, a field is not static.

    - 수명에 따라
        정적 변수(Static Variable)
        스택 기반 동적 변수(Stack-Dynamic Variable)
        명시적 힙 기반 동적 변수(Explicit Heap-Dynamic Variable)
        묵시적 동적 변수(Implicit Dynamic Variable)
 
    - 실효 범위(:변수의 값을 참조할 수 있는 범위, 즉 변수가 사용되는 문장의 범위)에 따라
         local variable
        : A data item known within a block, but inaccessible to code outside the block. For example, any variable defined within a method is a local variable and can't be used outside the method.
        지역 변수는 변수가 선언된 프로그램 단일체나 함수 혹은 블록 안에서만 사용할 수 있는 변수
        cf. 스택 기반 동적 변수(Static Dynamic Variable)는 선언문이 실행될 때 저장 장소 바인딩이 이루어지고, 그에 대한 자료형은 정적으로 바인딩 됩니다. 다시 말해서, 변수가 프로그램 시작 시에 바인딩 되는 것이 아니라, 프로그램을 한 줄 한 줄 수행하고 있는 동안, 변수를 선언하는 코드 부분이 나오면 그제서야 변수에 대한 저장 장소가 할당되고, 바인딩이 이루어지는 것입니다. 이러한 함수에서 선언되는 변수들을 지역 변수(Local Variable)라고 하는데, 지역 변수들에 대한 기억 장소가 바로 이 때 할당되며 함수의 수행이 모두 끝나면 반환됩니다.  
         non-local variable
        : 비지역 변수는 전체 프로그램에 걸쳐 사용 가능한 변수를 말합니다.

         pointer variable
        : 포인터 변수는 저장 장소의 주소값과 그 저장 장소에 들어 있는 값을 모두 나타낼 수 있는 변수

     method
    : a function (subroutine) associated with an object. A function defined in a class. Unless specified otherwise, a method is not static.
         instance method
        : Any method that is invoked with respect to an instance of a class.
         class method
        : A method that is invoked without reference to a particular object. Class methods affect the class as a whole, not a particular instance of the class. = static method


Message
Software objects interact and communicate with each other using messages.

Class
: a blueprint or prototype that defines the variables and the methods common to all objects of a certain kind.

Inheritance
A class inherits state and behavior from its superclass. Inheritance provides a powerful and natural mechanism for organizing and structuring software programs.

Interface

: a contract in the form of a collection of method and constant declarations. When a class implements an interface, it promises to implement all of the methods declared in that interface.

'Computation > Language' 카테고리의 다른 글

The Java™ Tutorials  (0) 2007.02.28
The Java Technology  (0) 2007.02.28
<HeadFirst Java>  (0) 2006.07.13
Java  (0) 2006.05.17
프로그래밍 언어 개론  (0) 2006.03.31
posted by maetel
2006. 3. 31. 02:26 Computation/Language



'Computation > Language' 카테고리의 다른 글

The Java™ Tutorials  (0) 2007.02.28
The Java Technology  (0) 2007.02.28
<HeadFirst Java>  (0) 2006.07.13
Java  (0) 2006.05.17
object-oriented programming  (0) 2006.05.01
posted by maetel