2010년 4월 8일 목요일

private 멤버는 underscore를 suffix로 주는 코딩 스타일

멤버 필드의 이름 뒤에 underscore(_)를 붙이는 네이밍 방식을 구글 코딩 스타일에서 본 적이 있는데 왜 그게 좋은지 궁금했었다. 갑자기 또 생각나서 찾아봤는데 가독성 때문이란다.

"Indicating class scope by using underscore makes it easy to distinguish class variables from local scratch variables. This is important because class variables are considered to have higher significance than method variables, and should be treated with special care by the programmer. ... (중략)... latter is recommended because it seem to best preserve the readability of the name."

출처 :
http://stackoverflow.com/questions/1630412/is-using-underscore-suffix-for-members-beneficial

2010년 4월 6일 화요일

같은 AIR 애플리케이션 여러번

살다보면 같은 AIR 앱을 여러번 띄우고 싶은 경우가 있다.

그 경우 C:\Program Files\MyApp\META-INF\AIR 에 있는 application.xml파일의 <id /> element의 text 값을 바꿔주면 된다. 새로 앱을 띄울때마다 바꿔줘야 하기 때문에 프로그래밍 코드로 처리해 주는 것이 좋은데, 다행히 MyApp 안의 디렉토리는 제어권한이 있다.

2010년 4월 3일 토요일

AS3.0 Package 외부에 클래스 정의하기

"one class in each file can be made available to code that is external to that file. In other words, only one class in each file can be declared inside a package declaration. You must declare any additional classes outside your package definition, which makes those classes invisible to code outside that source file. The name of the class declared inside the package definition must match the name of the source file."

추가적인 클래스들을 패키지 밖에 정의할 수 있고 이렇게 정의된 클래스는 소스코드 밖에서는 보이지 않게 된다.

2010년 4월 2일 금요일

Unable to load config info from /usr/local/ssl/openssl.cnf

OpenSSL을 사용하는데 다음과 같은 에러가 났다.

"Unable to load config info from /usr/local/ssl/openssl.cnf"

이는 openssl.cnf의 위치가 지정되어있지 않아서 생기는 에러다.

에러가 나는 명령 끝에 -config "openssl.cnf의 위치"를 입력하면 해결된다.