본문 바로가기

전체 글236

node.js를 이용해서 웹서버 생성하기 javascript기반으로 코드를 작성하고, node에서 지원하는 모듈을 로드(require("모듈이름")) 한다. 1234567891011var http = require("http"); http.createServer(function(request, response){ console.log("Request received."); response.writeHead(200, {"Content-Type": "text/plain"}); response.write("Hello World"); response.end();}).listen(8888); console.log("Server has started"); Colored by Color Scriptercs http에 http모듈을 로드하고, http모듈에서.. 2015. 12. 3.
apache setting 과정에서 일어나는 상황들 정리 중 환경 apache + php5.6.12 목적 유지보수를 위한 세팅(+apache 공부) 먼저 httpd.conf에서 rewrite를 설정 해당 과정에서 가장 먼저 일어난 것은 RewriteLog & RewriteLogLevel 모듈을 찾지 못하는 문제메세지 Invalid command 'RewriteLogLevel', perhaps misspelled or defined by a module not included in the server configuration 원인 : apache 최신 버전에서 사용 안되게 바뀜.해결 : 로그 방법 변경된 곳에서 설정 httpd.conf# # ErrorLog: The location of the error log file. # If you do not specify .. 2015. 12. 1.
Intent로 각종 기능 및 앱 띄우기 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145// 웹페이지 띄우기Uri uri = Uri.parse("http://www.google.com");Intent it = new.. 2015. 11. 12.
Email로 데이터 보내기 검색하면 Intent를 이용한 방법이 참 많지만... 모르겠다. 버전 업이 되서 그런가? 안돌아간다.그래서 찾다 찾다 찾은게 ShareCompat의 IntentBuilder 아래는 이를 이용해 메일을 보내는 방법이다. Chooser에서 앱을 띄우는 종류는 setType으로 결정된다. ShareCompat.IntentBuilder.from(this).setType("message/rfc822") // 핵심! .addEmailTo("메일주소") .setSubject("제목") .setText("내용") .setChooserTitle("Chooser에서 띄울 타이틀") .setStream(Uri.fromFile(new File(getDirectoryPath(), "파일명"))) // 파일 첨부!! .start.. 2015. 11. 11.
Enviroment 폴더 경로 얻기 공식 SDK 주소 https://developer.android.com/reference/android/os/Environment.html External 폴더 경로를 얻기 위해 Enviroment를 사용한 방법이다. 위 sdk문서를 보면 다양한 메소드들이 제공된다.Public Methodsstatic FilegetDataDirectory()Return the user data directory.static FilegetDownloadCacheDirectory()Return the download/cache content directory.static FilegetExternalStorageDirectory()Return the primary shared/external storage directory... 2015. 11. 11.
centOS에 apache & php 소스 컴파일로 설치하기 yum으로 패키지를 설치하는 방법이 아니라 소스버전을 직접 다운받아 설치하는 방법 사전 준비 gcc & gcc-c++ 설치기본적으로 설치되어 있는 경우도 있겠지만, 없는 경우도 있다. 아래 과정을 진행하다보면 컴파일러가 필요한데 없다는 메세지가...컴파일러는 yum으로 설치하는 방법을 사용한다.yum -y gccyum -y gcc-c++ 1. apache 설치3가지를 설치해야 한다.– apache : http://www.apache.org/dyn/closer.cgi – apr/apr-util : https://apr.apache.org – pcre : http://www.pcre.org 사이트에서 필요한 버전을 찾아 주소를 알아 놓고 터미널에서 받거나, 사이트에서 받아놔도 된다. 터미널을 이용해 받는 방.. 2015. 11. 6.
맵뷰에 어노테이션 추가/삭제 맵뷰에서 어노테이션이란, 핀을 꽃아 장소를 설정하는 것을 말한다. MKPointAnnotation() 을 이용해서 장소를 설정하고 제거한다. 1234567891011121314 @IBAction func btn2(sender: AnyObject) { // 어노테이션 설정 let point = MKPointAnnotation() point.coordinate = CLLocationCoordinate2DMake(35.1598, 129.1626) point.title = "해운대" point.subtitle = "부산" mapView.addAnnotation(point) } @IBAction func removeAnnotation(sender: AnyObject) { // 어노테이션 전체 삭제 mapView... 2015. 10. 30.
mapView 맵뷰는 MKMapView.framework을 사용한다. 기본적인 프로퍼티// 확대, 축소, 스크롤 기능var zoomEnabled : Boolvar scrollEnabled : Boolvar rotateEnabled : Boolvar pitchEnabled : Bool // 지도 출력var showsUserLocation : Boolvar showsPointsOfInterest : Boolvar showsBuildings : Boolvar showsTraffic : Bool // iOS9 위치// 지도가 표시하는 영역의 중앙 위치를 설정하거나 얻기var centerCoordinate : CLLocationCoordinate2Dfunc setCenterCoordinate(coordinate: CLLocat.. 2015. 10. 30.
동영상 재생 MPMoviewPlayerController MediaPlayerFrameWork를 이용한 동영상 재생 방법 MPMoviewPlayerController 와 MPMoviePlayerViewController 두 종류가 있다. 후자는 신을 전환해서 사용하는 방법이다.전자를 살펴보자. 제공되는 기본적인 재생 관련 함수prepareToPlay()play()pause()stop()currentPlaybackTime: NSTimeInterval { get set } // 현재 재생 시간(초 단위) 비동기로 동작한다. 동영상 속성var moviewMediaTypes : MPMovieMediaTypeMask { get } // 미디어 타입(비디오, 오디오)var movieSourceType : MpMovieSourceType // 미디어 소스(파일, 스트리밍).. 2015. 10. 29.