application.properties 파일에 아래와 같이 기입


server.port=8090



출처: http://cpdev.tistory.com/category/Springboot-tip [하루하나]

application.properties 파일에 아래와 같이 기입


server.port=8090



출처: http://cpdev.tistory.com/category/Springboot-tip [하루하나]

스프링 부트

정상적으로 가동시 로그에 아래와 같이 찍히며

기본 포트는 8080이다


[           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)


 그런데....

다른 Tomcat 서버를 가동중거나 다른 스프링 부트 어플리케이션을 작동하면

아래와 같이 포트중복이 난다.

Verify the connector's configuration, identify and stop any process that's listening on port 8080, or configure this application to listen on another port.

그래서 이것을 회피하려면 어플리케이션 마다 각각 포트번호를 달리주면 된다.

(한번에 한개씩 돌리면 상관없다)


application.properties 파일에 사용할 포트를 추가한다.

server.port=8090

application.properties 파일에 아래와 같이 기입

출처: http://cpdev.tistory.com/category/Springboot-tip [하루하나]
application.properties 파일에 아래와 같이 기입

출처: http://cpdev.tistory.com/category/Springboot-tip [하루하나]


728x90

Ruby에서 generate명령으로 Model을 만들면 자동으로 table관련 스크립트가 만들어진다. 이때 id 칼럼이 자동으로 추가되는데


현재 mysql version :5.7.17 에서는 primary key 체크부분에서 다음과 같은 오류가 난다

Mysql::Error: All parts of a PRIMARY KEY must be NOT NULL;
if you need NULL in a key, use UNIQUE instead:

CREATE TABLE `accounts` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY,
`
firm_id`
int(11), `firm_name` varchar(255),
`
credit_limit`
int(11)) ENGINE=InnoDB

id를 int형에 DEFAULT NULL에 자동증가, PK로 추가되는데

5.7버전에서는 오류가 난다. ㅜ.ㅜ

그래서 5.1로 다운그레이드 함. 오류 안남.

(I downgraded to mysql 5.1.3. and there's no error)

------------------------
- model은 추가되어 있으므로 다시 생성하려면 지우고 다시생성(안해도 될 것 같기는 한데 아무튼)
c:\rails destroy model Account

- 파일 다운로드 및 압축 풀기

- 환경변수 설정 변경 : MYSQL_HOME C:\mysql-5.1.72-win32

- mysqld 실행

- 최초실행시 패스워드 설정(최초에는 패스워드 없음)
C:\mysql -u root mysql

- pw 변경
mysql> update user set password = password('바꿀비밀번호') where user = 'root';
mysql> exit;

- 변경사항 반영
C:\mysqladmin -u root reload

- 비밀번호로 접속
C:\mysql -u root -p

- 데이터 베이스 생성
mysql>create database company;
mysql>exit;

- 기존데이터 복구
C:\mysql -uroot -p company < 2015_12_15.sql

-------

rails generate model Account name:string:index

rake db:migrate

==  CreateAccounts: migrating ========================================
-- create_table(:accounts)
   -> 0.0420s
-- add_index(:accounts, :name)
   -> 0.0540s
==  CreateAccounts: migrated (0.1200s) ===============================
 

성공했다 ㅎㅎㅎ

728x90

WARN  TCPServer Error: Only one usage of each socket     address (protocol/network address/port) is normally permitted. - bind(2)
Uncaught exception: Only one usage of each socket address (protocol/network  address/port) is normally permitted. - bind(2)

위와 같은 오류를 만나면

1. 작업관리자에서 관련 프로세스를 종료시킨다.

2. rails server -p 3001

   포트를 달리하여 서버를 가동시킨다.

728x90

ruby

2017. 3. 17. 00:42

rails s를 하면

C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/source/git/git_proxy.rb:225:in `allowed_in_path': The git source git://github.com/parasew/acts_as_tree.git is not yet checked out. Please run `bundle install` before trying to start your application (Bundler::GitError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/source/git/git_proxy.rb:183:in `find_local_revision'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/source/git/git_proxy.rb:63:in `revision'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/source/git.rb:220:in `revision'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/source/git.rb:88:in `install_path'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/source/path.rb:123:in `expanded_path'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/source/path.rb:150:in `load_spec_files'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/source/git.rb:193:in `load_spec_files'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/source/path.rb:97:in `local_specs'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/source/git.rb:161:in `specs'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/definition.rb:725:in `block in converge_locked_specs'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/definition.rb:714:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/definition.rb:714:in `converge_locked_specs'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/definition.rb:245:in `resolve'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/definition.rb:176:in `specs'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/definition.rb:235:in `specs_for'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/definition.rb:224:in `requested_specs'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/runtime.rb:118:in `block in definition_method'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler/runtime.rb:19:in `setup'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.14.6/lib/bundler.rb:100:in `setup'
        from C:/bori_mrk/config/boot.rb:8:in `<top (required)>'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from script/rails:5:in `<main>'



bundle install 을 실행하면

 Fetching git://github.com/parasew/acts_as_tree.git
fatal: Not a git repository (or any of the parent directories): .git

Retrying `git fetch --force --quiet --tags "C:/Ruby193/lib/ruby/gems/1.9.1/cache
/bundler/git/acts_as_tree-3c50df6a51cbd17e29090bc04f9a9b227326e9de"` due to erro
r (2/4): Bundler::Source::Git::GitCommandError Git error: command `git fetch --f
orce --quiet --tags "C:/Ruby193/lib/ruby/gems/1.9.1/cache/bundler/git/acts_as_tr
ee-3c50df6a51cbd17e29090bc04f9a9b227326e9de"` in directory C:/Ruby193/lib/ruby/g
ems/1.9.1/bundler/gems/acts_as_tree-ed52495d1671 has failed.
If this error persists you could try removing the cache directory 'C:/Ruby193/li
b/ruby/gems/1.9.1/cache/bundler/git/acts_as_tree-3c50df6a51cbd17e29090bc04f9a9b2
27326e9de'fatal: Not a git repository (or any of the parent directories): .git

Retrying `git fetch --force --quiet --tags "C:/Ruby193/lib/ruby/gems/1.9.1/cache
/bundler/git/acts_as_tree-3c50df6a51cbd17e29090bc04f9a9b227326e9de"` due to erro
r (3/4): Bundler::Source::Git::GitCommandError Git error: command `git fetch --f
orce --quiet --tags "C:/Ruby193/lib/ruby/gems/1.9.1/cache/bundler/git/acts_as_tr
ee-3c50df6a51cbd17e29090bc04f9a9b227326e9de"` in directory C:/Ruby193/lib/ruby/g
ems/1.9.1/bundler/gems/acts_as_tree-ed52495d1671 has failed.
If this error persists you could try removing the cache directory 'C:/Ruby193/li
b/ruby/gems/1.9.1/cache/bundler/git/acts_as_tree-3c50df6a51cbd17e29090bc04f9a9b2
27326e9de'fatal: Not a git repository (or any of the parent directories): .git

Retrying `git fetch --force --quiet --tags "C:/Ruby193/lib/ruby/gems/1.9.1/cache
/bundler/git/acts_as_tree-3c50df6a51cbd17e29090bc04f9a9b227326e9de"` due to erro
r (4/4): Bundler::Source::Git::GitCommandError Git error: command `git fetch --f
orce --quiet --tags "C:/Ruby193/lib/ruby/gems/1.9.1/cache/bundler/git/acts_as_tr
ee-3c50df6a51cbd17e29090bc04f9a9b227326e9de"` in directory C:/Ruby193/lib/ruby/g
ems/1.9.1/bundler/gems/acts_as_tree-ed52495d1671 has failed.
If this error persists you could try removing the cache directory 'C:/Ruby193/li
b/ruby/gems/1.9.1/cache/bundler/git/acts_as_tree-3c50df6a51cbd17e29090bc04f9a9b2
27326e9de'fatal: Not a git repository (or any of the parent directories): .git

Git error: command `git fetch --force --quiet --tags
"C:/Ruby193/lib/ruby/gems/1.9.1/cache/bundler/git/acts_as_tree-3c50df6a51cbd17e2
9090bc04f9a9b227326e9de"`
in directory
C:/Ruby193/lib/ruby/gems/1.9.1/bundler/gems/acts_as_tree-ed52495d1671 has
failed.
If this error persists you could try removing the cache directory
'C:/Ruby193/lib/ruby/gems/1.9.1/cache/bundler/git/acts_as_tree-3c50df6a51cbd17e2
9090bc04f9a9b227326e9de'


git status를 하면

On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   Gemfile
        modified:   Gemfile.lock
        modified:   config/database.yml

no changes added to commit (use "git add" and/or "git commit -a")


당췌 뭐가 문제인거야?

며칠전에 분명 됐었는데... ㅜ.ㅜ

-----

해결방법

bundle install했을 때

Fetching git://github.com/parasew/acts_as_tree.git 이런식으로

안되면
GemFile 에 다음과 같이 정의되어 있을 것이다.
gem "acts_as_tree" , :git => 'git://github.com/parasew/acts_as_tree.git'

이것에서 git 을 바라보지 않게 #으로 뒷부분을 주석처리하거나

gem "acts_as_tree" #, :git => 'git://github.com/parasew/acts_as_tree.git'

또는 아예 지워버리면 된다

gem "acts_as_tree"


휴~~. 다시 되니 반갑네 ㅋ


728x90

제대로 키랑 입력 다했는데

로그인하면 화면이 리프레시 되면서 그대로다...


혹시 몰라서 개발자도구를 실행시켜 보니...


암호 입력 필드가 안전하지 않은(http://) 페이지에 있습니다. 로그인 정보 도난 같은 보안 위험성이 있습니다.


소셜로그인은 https 로 암호화되어있는데 내 홈페이지는 그냥 http라서 보안상 위험하다라는 알림을 받았다...

일단은 그럼 https설정할 때까지는 해당 소셜로그인은 못쓰네...

아. 어렵당...




또. 로그인 설정에서 사이트주소를 www를 넣냐 않넣냐에 따라 달라지는데

www를 넣은 뒤에

사이트 소스에서 무조건 www가 붙도록 수정 


<script language="Javascript" type="text/javascript"> 
var host = location.host.toLowerCase(); 
var currentAddress = location.href; 
if (host.indexOf("www")== -1) 

currentAddress = currentAddress.replace("//","//www."); 
location.href = currentAddress; 

</script> 

728x90

mysql에는 문자열을 암호화하는 함수가 있다. Password() 함수인데..


insert into member (id, pw) values ( 'abc', password('aaa'));

하고 commit을 확실히 하고


select *

from member

where pw = password('aaa')

를 했을 때 결과를 못 가져오는 경우가 발생한다.


가장 먼저 확인 해 볼 것은.... pw칼럼의 길이이다.

password('aaa')를 했을 때 길이보다 컬럼의 길이가 작으면


insert 할 때 값이 잘린다.

따라서 잘린 값과 password()함수의 결과값이 결코 같을 수 없다.


넉넉하게 pw칼럼을 vachar 50으로 주던가

긴 문장을 password()함수에 넣어서 길이를 보던가


조회 전 pw의 길이를 체크하던가 해야한다.


간만에 또 만졌더니... 며칠을 소비했던가 ㅠ.ㅠ

728x90

jstl에서 연산을 할 때(특히 나눗셈) 소수점이 제대로 안찍히고 자동으로 반올림이 되는 경우가 있다.


아무리 핸들링 하려고 해도 안됐지만 결국 해결


해결방법은 받아온 Data를 바로 쓰지 않고 포맷을 바꾼상태에서 사용해야 한다.


ex) result.SUM_ANSWER1이 70, result.SUM_ANSWER2가 1일 때

구성비율은

result.SUM_ANSWER1/(result.SUM_ANSWER1 + result.SUM_ANSWER2) 와

result.SUM_ANSWER2/(result.SUM_ANSWER1 + result.SUM_ANSWER2)

이다.


이것을 jstl로 표현하면

<c:set var="a" value="${result.SUM_ANSWER1/(result.SUM_ANSWER1 + result.SUM_ANSWER2)}"/>

<c:set var="b" value="${result.SUM_ANSWER2/(result.SUM_ANSWER1 + result.SUM_ANSWER2)}"/>

인데 결과는

a = 100, b=0 이 나온다.


해결방법은

<fmt:formatNumber var="sumAnswer1" value="${result.SUM_ANSWER1}" pattern="#.##"/>

<fmt:formatNumber var="sumAnswer2" value="${result.SUM_ANSWER2}" pattern="#.##"/>


<c:choose>

<c:when test="${sumAnswer1> 0}">

<fmt:formatNumber var="calAnswer1" value="${sumAnswer1/(sumAnswer1+sumAnswer2)}"/>


</c:when>

</c:choose>


받아 온 값이 int 형이면 연산을 해도 int 이기 때문에

포맷을 소수점있게 바꾼다음 연산해야 소수점연산이 제대로 된다.

728x90

호텔 이용객으로서 사용한 영어는 몇 가지 되지 않지만 자꾸 까먹어서 나중을 위해 기록하기

(특히 heat it up ㅋㅋ)

호텔 스텝이 알아들었으나 잘못된 표현이 있을 수 있다 ㅎ

거의 대부분 can I ~ 와 I'd like to



체크인 :
나 : I'd like to check in
직원 : passport please
나 : (여권준다)



한국어로 말하고 싶을 때
나 : Can I talk to a Korean staff?


방에서 물 가져 달라고 할 때
나 : Can I get some water?
직원 :  how many?
나 : two bottle please
직원 : two bottle water?
나 : yes

음식 데워달라고 할 때

( 용기에 담은 음식을 내밀며)
나 : Could you heat this up?
직원 : heat it up? how long?
나 : two minute(2분) / one and half minute(1분 30초) please.


호텔에서 계산할 때 방값에 포함해 달라고
나 : room charge please(정확한 표현은 잘 모르겠음 ㅎ)

물시킬 때 1
나 : can i get a glass of water(물 한잔)/ can I get two glasses of water(물 2잔)

물시킬 때 2
나 : can I get a bottle water?(물 한 병)
직원 : (물이 탄산수, 생수 등 여러 종류가 있으면 어떤거로 할껀지 물어봄)
나 : Perrie please

음식 주문할 때
나 : can I get a menu?(메뉴 보여 달라)
직원 : sure. (wait a second : 가지러 감)
나 : can I order later(나중에 주문할께요)
나 : (메뉴에서 사진 찍으며) one xxx stake, one xxx salad and  two sprite(음료수)

take out 하고 싶을 때
나 : I'd like to take them out.

영수증 받고 싶을 때
나 : Can I get a receipt
직원 : (주기 싫을 때) the paper is out of order (종이가 없다)

수영장에서 타올 빌릴 때
나 : can I get a towel?
직원 : sure. what's your room number?
나 : twelve fourty-five(1245호)
나 : how to get this towel back?(어떻게 가져다 놓으면 되는지?)

수영장에서 카바나 빌리고 싶을 때
나 : Can I use a cabana?

카바나 연장하고 싶을 때
나 : Can I extend time?
직원 : sure( 이렇게 하면)
나 : thank you very much.(하면서 엄지손가락을 척)

베드가드 빌릴 때
나 : Can I use bed guards?

공항에서 저울 쓰고 싶을 때
나 : Can I use the scale?


계산할 때 계산전에 보통 email 어쩌고 하면

no thanks 하면 된다.

(메일주소 알려주면 뉴스레터 보내준다는 이야기임)

혹시 영화보게 되면
나 : two tickets for 어벤저스(어벤저스 2장)

자리있는지 물어볼 때
나 : is this taken?



내가 없을 때 사람들이 아내에게 말을 걸 때

'No English'로 무심결에 많이 얘기 했는데

I can not speak in English 하면 된다.


728x90

이번에 여행가는데 12개월 된 아기있어서 호텔에 베드가드를 요청해야 하는데

뭐라고 할까?


그냥 We need a bed guard 라고 보냈는데

좀 찾아보니... a bed guard(단수) 가 아니라 bed guards(복수)로 써야했구만?


아래 예제문장은 구글에서 찾은건데 대~충 해석하면

토들러(영아)를 위한 베드가드가 호텔에서 제공이 되느냐?

아니면 애기용침대(Cot:보통 간이침대를 말함)는 어떻게 요청하느냐?

Jet 2(여아 2명)이 있으다는 것을 알릴만한 옵션을 찾을 수 없다.(이 문장은 맞는지 불확실함)

그리고 저층을 원한다.


Does the hotel provide bed guards for young toddlers?
Or how do you request a cot ?
I can't see an option to make a request with Jet 2 ?
I also wanted to request one of the lower floors,



뭐 호텔 사정에 따라 없을 수도 있다고 하니 어쩔 수 없지만

예약할 때 먼저 얘기해놓는게 좋으니...


아기 침대는 유료인 경우가 많지만 베드가드는 대부분 무료임.

우리는 같이자니까 별도로 애기침대를 추가할 필요 없이

베드가드만 요청 함.


까먹지 말고 체크인 할 때 한 번 더 저렇게 물어봐야 겠구만.

728x90

태그 라이브러리 사용할 때

<c:if test="${not empty abcde|">

${fn:replace(abcde, '\r\n', '<br/>')}

</c:if>


를 짧게 한줄로 쓰려고


${not empty abcde ? fn:replace(abcde , '\r\n', '<br/>') : "empty" }

위와 같이 썼는데 에러난다...

? : 안에서는 역슬래쉬(\)가 제대로 먹지 않는다


728x90
BLOG main image
"그게 뭐 어쨌다는 거냐?" 늘 누가 나에게 나에대한 말을할 때면 이말을 기억해라. by nobang

카테고리

nobang이야기 (1933)
Life With Gopro (7)
Life With Mini (79)
Diary (971)
너 그거 아니(do you know) (162)
난 그래 (159)
Study (290)
속지말자 (10)
Project (34)
Poem (15)
Song (0)
Photo (113)
낙서장 (45)
일정 (0)
C.A.P.i (2)
PodCast (0)
nobang (27)
고한친구들 (4)
recieve (0)
History (0)
android_app (2)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

Total :
Today : Yesterday :