본문 바로가기

Programming216

\n newline -> <br/> tag로 바꾸기 \n newline -> tag로 바꾸기아래와같이 css를 주면 \n 이 자동으로 줄바꿈된다. Html Some test with linebreaks Css.white-space-pre { white-space: pre-wrap; }jsfiddle https://jsfiddle.net/yk1angkz/25/ 2016. 5. 12.
java config & message & properties & MessageSourceAccessor src/main/resources/messages_ko.propertiesconfig.1 = 설정1 config.2 = 설정2 src/main/java/.../PropertyMessage.javapackage project.common; import org.springframework.context.support.MessageSourceAccessor; public class PropertyMessage { static MessageSourceAccessor messageSourceAccessor; public MessageSourceAccessor getMessageSourceAccessor() { return messageSourceAccessor; } public void setMessageSour.. 2016. 4. 22.
자바에서 String to Timestamp private Timestamp stringToTimestamp(String date){ Calendar cal; SimpleDateFormat sd = new SimpleDateFormat("yyyyMMddHHmmss"); try { sd.parse(date); } catch (ParseException e) { e.printStackTrace(); } cal = sd.getCalendar(); return new Timestamp(cal.getTime().getTime()); } 2016. 4. 12.
Angular.js controller 간 데이터 공유 분리되어 있는 ctrl 1과 ctrl 2 사이에 데이터를 공유하기 위해 factory에 'franksPizza' 추가하고각 컨트롤러에서 parmeter로 받아서 사용한다.아래 링크에서 직접 테스트 가능함. http://jsfiddle.net/oqvs8heq/4/ Javascriptvar app=angular.module('myApp', []); app.factory('franksPizza', function() { var pizzaService = {}; pizzaService.slicesLeft = 8; return pizzaService; }); function Ctrl1($scope, franksPizza) { $scope.pizza = franksPizza; $scope.pizza.toping =.. 2016. 4. 6.
vim 에서 go syntax highlight vim 에서 go syntax highlight go.vim 파일 찾기 $ mkdir ~/.vim$ mkdir ~/.vim/syntax $GOROOT/misc/vim/syntax/go.vim 에 파일 존재한다면 사용 없으면 이것 다운 파일복사$ cp .../go.vim ~/.vim/syntax/go.vim vimrc에 아래내용 추가$ vi ~/.vimrc filetype on au BufRead,BufNewFile *.go set filetype=go 2016. 4. 5.
node.js 설치 node.js 설치node.js 설치/설정$ curl -O https://nodejs.org/dist/v4.4.2/node-v4.4.2-linux-x64.tar.xz$ unxz node-v4.4.2...tar.xz$ tar -xvf node-v4.4.2...tar$ echo $PATH$ vi /etc/profileexport PATH=$PATH:/설치경로/node-v0.10.28/bin$ source /etc/profilenode.js web 서버$ vi test.jsvar http = require('http'); http.createServer(function(req,res){ res.writeHead(200,{'Content-Type':'text/plain'}); res.end('Hello Worl.. 2016. 4. 3.