본문 바로가기

All

[Play Framework2] Action composition PlayFramework에서는 Action이 뭔가 Restful 통신을 할때 반응하는 객체로 쓰여진다... 이번에는 이 Action을 활용하는 방법을 알아보자 자세한 사항은 : https://www.playframework.com/documentation/2.3.x/ScalaActionsComposition object LoggingAction extends ActionBuilder[Request] { def invokeBlock[A](request: Request[A], block: (Request[A]) => Future[Result]) = { Logger.info("Calling action") block(request) } }위와 같이LoggingAction을 만들고def index = Loggi.. 더보기
[Play Framework2] Session and Flash scopes PlayFramework에서 Session은 내부적으로 Cookie 로 사용되어지고 그래서4kb라는 제약있다.자세한 사항은 https://www.playframework.com/documentation/2.3.x/ScalaSessionFlash Ok("Welcome!").withSession( "connected" -> "user@gmail.com")위와 같이 key값으로 저장을 하고Ok("Hello World!").withSession( request.session + ("saidHello" -> "yes"))+ 통해서 session에 값을 저장하는 것이 가능하다.Ok("Theme reset!").withSession( request.session - "theme")- 도 가능하다. def index .. 더보기
[Play Framework2] Setting and discarding cookies Cookie를 사용하는 방법이다. (https://www.playframework.com/documentation/2.3.x/ScalaResults) val result = Ok("Hello world").withCookies( Cookie("theme", "blue"))Setval result2 = result.discardingCookies(DiscardingCookie("theme"))Discardingval result3 = result.withCookies(Cookie("theme", "blue")).discardingCookies(DiscardingCookie("skin"))Set & Discarding def home(name:String) = Action {request=> val prev.. 더보기
[Play Framework2] Http Routing 프로젝트 파일에서 Conf 폴더에 routes 라는 파일이 있다. 이 파일에서 모든 url을 관리하는 듯하다. (#은 주석이다.)GET /clients/all controllers.Clients.list()GET /clients/:id controllers.Clients.show(id: Long)GET /files/*name controllers.Application.download(name)(*id 표현은 GET /files/images/logo.png 와 같이 파일형식의 파라미터를 받을수있다.) GET /items/$id controllers.Items.show(id: Long)($id 로 정규화 표현을 받을 수 있다.) # Extract the page parameter from the path, .. 더보기
IOException: Cannot run program "javac": java.io.IOException: error=2, No such file or directory EC2에서 PlayFramework 2.3.8버전을 시험삼아 실행해보려고 시도를 하니 IOException: Cannot run program "javac": java.io.IOException: error=2, No such file or directory와 같은 오류가 발생하였다. 원인은 AWS에서 openJDK를 설치하였는데 javac를 지원하지 않는게 문제였다. 본인은 openjdk 1.8.0을 사용해서 yum을 통해 1.8.0-openjdk-devel 추가적으로 설치하니 정상적으로 작동이 되었다. 더보기
Git 명령어 정리 Command Line으로 Git 사용해야되는 일이 생겨서 검색하던중 정리가 잘되어진 문서가 있어서 글을 게시하였다. 원본글 : http://blog.outsider.ne.kr/572 환경 설정 git config --global --list 현재 설정정보 조회할 수 있습니다. --global옵션은 전역설정에 대한 옵션이며 현재 프로젝트에만 적용할때는 주지 않습니다. git config --global user.name "사용자명" 사용자명을 등록합니다 (필수) git config --global user.email "이메일주소" 이메일 주소를 등록합니다. (필수) git config --global color.ui “auto” 터미널에 표시되는 메시지에 칼라를 표시해줌 기본적인 명령어 git --ver.. 더보기
Mac OS 업데이트 후 Homebrew가 동작하지 않을때... /usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0 터미널에서 Brew 명령어 입력시 위와 같은 에러가 발생하였다. 해결하는 방법은... cd System/Library/Frameworks/Ruby.framework/Versions/sudo ln -s Current 1.8brew updatesudo rm 1.8 이렇게 하면 된다~! 더보기
UIPasteBoard 사용방법 기본적으로 UIPasteboard 어플리케이션에서 공유해서 사용이 가능하다. 몇가지 사용방법을 소개하자면.. UIPasteboard *appPasteBoard = [UIPasteboard generalPasteboard]; appPasteBoard.persistent = YES; [appPasteBoard setString:@"STRING TO COPY"]; UIPasteboard *appPasteBoard = [UIPasteboard generalPasteboard]; yourTextField.text = [appPasteBoard string]; UIPasteboard *appPasteBoard = [UIPasteboard pasteboardWithName:@"CopyPaste" create:YES].. 더보기
LLDB Quick Start Guide LLDB Quick Guide이다.~! po 명령어 하나면... 쉽게 디버깅이 가능하고 조금더 고급 명령어를 알고 싶다면 여기로 이동하자 더보기
Particle 효과 (CAEmitterLayer, CAEmitterCell) 게임 엔진에서는 Particle 효과가 다양하지만 iOS 네이티브에서 Particle 효과를 쓰기 위해 게임엔진을 가져오는 것은 조금은 부담이 된다. 그래서 인지 iOS에서 전용 Particle 효과 클래스를 제공해준다. 주요코드 NSString *EMITTER_CELL_ID = @"cell"; NSString *EMITTER_CELL_PATH = @"emitterCells.cell.birthRate"; m_emitterLayer = [CAEmitterLayer layer]; [m_emitterLayer setBounds:self.bounds]; [m_emitterLayer setPosition:CGPointMake(self.bounds.size.width/2, self.bounds.size.height.. 더보기