'2009/10'에 해당되는 글 4건
Objective-C on Windows :: 2009/10/27 22:42
Objective-C는 애플의 Max OS X 어플리케이션 및 아이폰/아이팟 어플리케이션을 개발할 때 쓰이는 기본언어로 C언어를 확장한 언어이다. 보통 Mac에서 Xcode 도구를 사용하여 컴파일/빌드를 하지만, Mac 시스템이 없이 Objective-C를 배우려면 플래폼에 맞는 GNU Compiler(gcc)를 사용하면 된다.
윈도우에서 Objective-C 프로그램을 컴파일하려면 MinGW 기반의 GNUstep을 설치하여 gcc를 이용하면 된다. 다음 주소에서 GNUstep System과 GNUstep Core를 받아서 설치한다.
GNUstep Shell을 실행하여 콘솔에서 유닉스 명령을 이용해 작업을 하면 된다.

다음과 같은 Objective-C 샘플 코드(Hello.m)를 이용하여 간단한 어플리케이션을 만들어 보자. Objective-C에서는 소스 확장자를 관례적으로 .m (message에서 유래)을 사용한다.
#import <Foundation/Foundation.h>
@interface HelloWorld : NSObject
- (void) hello;
@end
@implementation HelloWorld
- (void) hello {
NSLog(@"Hello World!");
}
@end
int main(void) {
HelloWorld *hw = [[HelloWorld alloc] init];
[hw hello];
[hw release];
}1. 커맨드 라인에서 gcc를 이용하여 컴파일하기
위 Hello.m 소스를 컴파일하려면 다음과 같은 커맨드 라인 옵션을 사용하면 된다.
$ gcc -o Hello Hello.m -I /GNUstep/System/Library/Headers \ -L /GNUstep/System/Library/Libraries -lobjc -lgnustep-base \ -fconstant-string-class=NSConstantString
컴파일이 정상적이면 실행 파일이 생기며, 바로 실행해 볼 수 있다. 아래와 같은 유사한 화면을 볼 수 있을 것이다.

2. GNUstep Makefile 이용하여 컴파일하기
위의 기본 컴파일 방법 이외에 GNUstep Makefile을 이용하여 Objective-C 프로그램을 컴파일 할 수 있다. 다음과 같이 GNUmakefile 라는 파일명의 텍스트 파일을 작성한 후에 커맨드 라인에서 'make'를 실행하면 된다.
include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = Hello Hello_OBJC_FILES = Hello.m include $(GNUSTEP_MAKEFILES)/tool.make
정상적으로 실행이 되면 obj 디렉토가 생기며 그 밑이 실행 파일이 생성된다. 다음과 같은 유사한 화면을 볼 수 있다.

참조: http://blog.lyxite.com/2008/01/compile-objective-c-programs-using-gcc.html
Agile Development Process :: 2009/10/16 18:12
URL Rewrite + .htaccess :: 2009/10/15 22:27
Apache 1.3부터 지원된 mod_rewrite 모듈은 아파치 웹서버 관리자라면 꼭 알고 있어야 할 내용이다. 또한 싸이트 주소를 파라미터 가지를 없애고 이쁘게 URL을 조작할 때도 사용되는 강력하고 정교한 모듈이다. 기능이 강력한 만큼 그만한 책임도 따른다. (With great power comes great responsibility).
아파치 주 설정파일 httpd.conf에 뿐만 아니라 웹문서 디렉토리에 .htaccess 파일을 두어 설정할 수 있다. 다음은 콘텐츠 보호를 위한 몇 가지 방법이다.
1. 특정 IP 주소의 접근 방지
2. 특정 IP 주소의 접근만 허용
3. 외부로부터 콘텐츠 핫링킹 방지
4. 참고할 만한 글들
5. Java URL Rewrite Filters
아파치 주 설정파일 httpd.conf에 뿐만 아니라 웹문서 디렉토리에 .htaccess 파일을 두어 설정할 수 있다. 다음은 콘텐츠 보호를 위한 몇 가지 방법이다.
1. 특정 IP 주소의 접근 방지
RewriteCond %{REMOTE_ADDR} ^123\.456\.789\.1$ [OR]
RewriteCond %{REMOTE_ADDR} ^123\.456\.789\.2$
RewriteCond %{REQUEST_URI} !^sorry\.html
RewriteRule .* /sorry.html
2. 특정 IP 주소의 접근만 허용
RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.1$
RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.2$
RewriteCond %{REQUEST_URI} !^sorry\.html
RewriteRule .* /sorry.html3. 외부로부터 콘텐츠 핫링킹 방지
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://www\.mydomain\.com [NC]
RewriteRule \.(jpe?g|gif|png)$ - [F] 4. 참고할 만한 글들
- Apache URL Rewite Guide
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html - URL Rewriting for Beginners
http://www.addedbytes.com/apache/url-rewriting-for-beginners/ - .htaccess Tricks
http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/ - mod_rewrite Cheat Sheet
http://www.addedbytes.com/apache/mod_rewrite-cheat-sheet/
5. Java URL Rewrite Filters
JPA Implementation Patterns :: 2009/10/08 22:27
Basic patterns
- Data Access Objects
- Saving (detached) entities
- Retrieving entities
- Removing entities
- Service Facades and Data Transfers Objects
Advanced patterns
- Bidirectional assocations
- Lazy loading
- Bidirectional associations vs. lazy loading
- Using UUIDs as primary keys (guest blog by Albert Sikkema)
- Field access vs. property access
- Mapping inheritance hierarchies
- Testing
출처: http://blog.xebia.com/2009/07/13/jpa-implementation-patterns-wrap-up/


