출처: http://khie74.tistory.com/1169521335

일단 windows에서 유닉스 환경을 사용하기 위해 cygwin을 설치.

다음은 출처의 내용을 따른다.

설치할 때 다음의 패키지를 추가한다.

gcc-core:C compiler
gcc-g++:C++ compiler(C++도 함께 사용하는 경우에)
gcc-objc:ObjC compiler

테스트해보기

에디터로 다음의 hello.h와 hello.m을 작성한다.

// hello.h
#import <objc/Object.h>

@interface Hello : Object
-(void)print;
@end

// hello.m
#import <stdio.h>
#import "hello.h"

@implementation Hello
-(void)print
{
  printf("Hello world\n");
}
@end

int main()
{
  id obj = [Hello alloc];
  [obj print];
  return 0;
}

자~ 이제 컴파일을 해보자~

gcc -v -o hello hello.m -lobjc
(옵션 -v는 컴파일 과정 출력  -0는 출력파일명지정 -lobjc는 Objective-C라이브러리 사용)

컴파일이 성공한 후, 생성된 실행파일을 실행하면 아래와 같이 "Hello world"가 콘솔에 출력된다.


http://wisdom.sakura.ne.jp/programming/objc/index.html
http://cocoadev.tistory.com/10

'프로그래밍 > iPhone Dev' 카테고리의 다른 글

[Objective C] 03 Class Level Access  (0) 2009.10.27
[Objective C] 02 Access Privledges  (0) 2009.10.27
[Objective C] 01 Creating Classes  (0) 2009.10.27
[Objective C] 환경설정  (0) 2009.10.27
[Objective C] 튜토리얼  (0) 2009.10.14

[Utils] Paros 사용법

프로그래밍/Library 2009. 9. 6. 15:20 Posted by galad

[java] 소스 분석

프로그래밍/Java 2009. 9. 6. 15:19 Posted by galad
public static void setAllowedTypes(FileUploadInfo info, SubContentInfo sinfo) throws ContentException {
        log.debug("<< setAllowedTypes >> START");
       
        Class cls = info.getClass();
        Class scls = sinfo.getClass();
        Method[] mtd = cls.getDeclaredMethods();
        Pattern p = Pattern.compile("get_fileUpload_(\\d+)FileName");
        Matcher m = null;
        String mStr = null;
        String mType = null;
        String defExt = null;
        int i;
       
        for(i = 0; i < mtd.length; i++) {
            m = p.matcher(mtd[i].getName());
            if(m.find()) {
                try {
                    // 파일명이 존재하는 경우만
                    mStr = FileUploadInfo.getValueOfMethod(info, m.group());
                    if(mStr != null) {
                        mType = FileUploadInfo.getValueOfMethod(info, "get_fileUpload_" + m.group(1) + "ContentType");
                        // 기본 확장자 지정
                        defExt = "";
                        if(mType != null) {
                            defExt = mStr.substring(mStr.lastIndexOf(".") + 1);
                            defExt = defExt.toLowerCase().trim();
                           
                            log.debug("defExt = " + defExt);
                           
                            if("jpg".equals(defExt) ||
                               "gif".equals(defExt) ||
                               "xml".equals(defExt) ||
                               "xmp".equals(defExt) ||
                               "png".equals(defExt) ||
                               "zip".equals(defExt) ) {
                                // 진행
                            }else {
                                // 오류 발생
                                throw new ContentException("지원하지 않는 파일입니다.");
                            }
                        }
                       
                        Class[] cParam = new Class[]{String.class};
                        Method cMtd = cls.getMethod("set_fileUpload_" + m.group(1) + "FileName", cParam);
                        Object[] oParam = new Object[]{mStr};
                        // FileUploadInfo에 등록
                        cMtd.invoke(info, oParam); // 마찬가지로 첫번째 인자는 실행시킬 메소드를 갖고 있는 obj, 두번째는 실제 메소드의 파라미터
                        // SubContentInfo에 등록
                        // 1. FileUPloadInfo의 FieldName을 찾는다.
                        cMtd = cls.getMethod("get_fileUpload_" + m.group(1) + "FieldName", null);
                        String tmpFieldName = (String)cMtd.invoke(info, null);
                        // 2. SubContentInfo의 의 1번의 Method에 등록한다.
                        cMtd = scls.getMethod("set" + tmpFieldName.substring(0, 1).toUpperCase() + tmpFieldName.substring(1)  , cParam);
                        cMtd.invoke(sinfo, oParam);

                    }
                }
                catch (ContentException e) {
                    log.debug("지원하지 않는 파일 예외 발생", e);
                    throw e;
                }
                catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
       
    }
   
public static String getValueOfMethod(Object obj, String methodName) throws SecurityException, NoSuchMethodException,                               IllegalArgumentException, IllegalAccessException, InvocationTargetException {
        String str = "";
        Class cls = obj.getClass(); // obj의 클래스 종류를 얻고
        Method mtd = cls.getMethod(methodName, null); // 위에서 얻은 클래스의 어떤 메소드를 얻는데, 메소드명을 인자로 받음
        str = (String)mtd.invoke(obj, null); // 위에서 얻은 메소드를 실행하는데, 그 메소드를 갖고 있는 obj를 인자로 받음?
        return str;
    }

[servlet] servlet

프로그래밍/Web 2009. 9. 4. 14:22 Posted by galad

'프로그래밍 > Web' 카테고리의 다른 글

[json] json 사용법  (0) 2009.12.15
[html] html 특수기호  (3) 2009.09.08
[jQuery] jQuery 예제 02  (0) 2009.09.04
[javascript] IE6.0 프레임 - 가로 스크롤바 버그  (0) 2009.08.21
[ajax] 소스  (0) 2009.08.19

[jQuery] jQuery 예제 02

프로그래밍/Web 2009. 9. 4. 14:22 Posted by galad
참조: http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html

로컬에서 톰캣이 https 를 처리할 수 있게 설정하기

self-signed 인증키 생성
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA
이 때, 비밀번호는
changeit
으로 하기. 이게 톰캣 디폴트. 변경 시에는 아래 설정에서 변경해줘야 함.
인증키 생성 시 나오는 질문에 적당히 대답하고(국가코드 82(한국)), 마지막 비번은 그냥 엔터. 위의 비번과 동일하게 설정됨.

톰캣의 server.xml에서

<-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<!--
<Connector
port="8443" minProcessors="5" maxProcessors="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true";
clientAuth="false" sslProtocol="TLS"/>
-->
주석 제거.

https://localhost:8443
로 테스트.

안될때는 인증키 생성 시 만들어지는 .keystore 파일 위치를 바꿔볼 것(톰캣에서 읽을 수 있는 곳으로).

'프로그래밍 > Server' 카테고리의 다른 글

[Shell Script] Shell Script 문법  (0) 2009.10.14
[Shell Script] PATH추가  (0) 2009.10.14
[unix] vi명령어  (0) 2009.04.16
[Tomcat] 톰캣, JSP 등등 버전 에러 시  (0) 2009.04.07
[Tomcat] Quoting in attributes  (0) 2009.04.07
출처: http://afterdan.kr/40

다른 건 스스로 조사해보지 않아서 잘 모르겠으나,
한비야 씨가 자기과시욕이 많다는 건 알겠다.
책을 둘째치고 최근에 방송한 무릎팍도사에서의 행동거지가 딱이었다...

첨부터 끝까지 나는 뭐해서 뭐해서 뭐해서 뭐했다... 더만.

월드비전이 800억 넘게 돈모아서 정작 구호에는 18억 쓴다는게 사실일까?
사실이면 대박인데...
대국민사기극에 한비야 씨도 동참하는 거잖아...