2010년 1월 4일 월요일

java.lang.NumberFormatException.forInputString

java.lang.NumberFormatException.forInputString 오류

 

문제가 되었던 내용

펼쳐두기..


 

 

아래는 검색..

 

java.lang.NumberFormatException: For input string: ""
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)

== 이것은 자바런타임 에러로써 문법상의 에러는 없다

즉, 자바 컴파일러가 오브젝트 코드를 변환시에는 에러가 없다는 뜻

문법상 에러는 없다.

에러코드를 보면 NumberFormatException이 발생하는데, Integer.parseInt()메소드 호출시

매개변수가 숫자로 변환할 수 없는 형태의 값으로 전달되기 때문이다.

따라서 컴파일시에는 이값이 어떤게 들어갈지 모르므로 에러가 나지 않지만 실행시에 그값이

처리할 수 없는 값으로 전달되기에 에러가 발생한다.

에러의 처음라인을 보면 그매개변수가 "" 빈문자열로 들어가고 있는데 이것은 "0"과 다르다.

즉 공백문자가 들어가고 있기 때문에 숫자로 변환할  수 없는 것이다.

 

만약

String str = "";

int i = Integer.parseInt(str);

이렇게 하였다면

 

String str = ""; ----> String str="1";

이런식으로 숫자에 대응하는 문자열로 넣으면 된다.

 

 

 

 

2010년 1월 1일 금요일

옴니아 블루투스 연결시 직렬포트만 나올때

 

아 쥔짜 조낸 뻘짓한거 생각하면... 으..

 

 

 

출처: http://drkein.tistory.com/121

 

PC에서 블루투스 설정을 위한 설정이 잘 되었고

액티브싱크 에서도 COM 포트를 사용하여 연결에도 설정이 잘 되어 있는 상태인데.
pda 에서
블루투스 파트너 관계설정에
사용할 서비스 선택  항목에 ActiveSync 가 나타나지 않는다면!!!!!!

정말 뭔 짓을 해도 연결이 되지 않아서 미칠지경이 되었다면..
아래의 방법을 한번 시도해 보세요....

저도 블루투스 동글이를 다른 걸로 교체한 뒤 블투로 싱크가 되질 않아서 이틀정도 별별 뻘짓을 다해도 안되었다가..
이렇게 성공 했습니다.


1. PDA의 "HKLM\Software\Microsoft\Bluetooth\ActiveSync"  로 이동 합니다.
2. ActiveSync 아래의 서브 폴더를 삭제합니다.
3. ActiveSync 레지스트리 값 안에 "LastConnected"를 지우고, "Initialized" 값을 0 으로 변경 합니다.
4. 블루투스 관리자에 가서 페이링 되어 있는 컴퓨터들을 삭제합니다.

자... 이제
다시 한번 PC 의 ActiveSync의 연결할 com 포트가 PC의 블루투스 설정에서 active sync로 사용할 com 포트로 설정 되어 있는지 확인 하시고
pda와 다시 페어링을 해보세요..

확실히 될겁니다.


2009년 12월 28일 월요일

toad 사용자 지침서

 

옥희인가 암튼 어디서 받은건지 기억나지 않음

SpringSource Tool Suite Download

STS Downloads

Description Link Size Hash
Eclipse 3.5.1
Windows springsource-tool-suite-2.3.0.RELEASE-e3.5.1-win32-installer.exe 209MB sha1 - md5
Windows springsource-tool-suite-2.3.0.RELEASE-e3.5.1-win32.zip 349MB sha1 - md5
Windows (64bit) springsource-tool-suite-2.3.0.RELEASE-e3.5.1-win32-x86_64-installer.exe 209MB sha1 - md5
Windows (64bit) springsource-tool-suite-2.3.0.RELEASE-e3.5.1-win32-x86_64.zip 349MB sha1 - md5
Mac OS X (Carbon) springsource-tool-suite-2.3.0.RELEASE-e3.5.1-macosx-carbon-installer.dmg 210MB sha1 - md5
Mac OS X (Carbon) springsource-tool-suite-2.3.0.RELEASE-e3.5.1-macosx-carbon.tar.gz 344MB sha1 - md5
Mac OS X (Cocoa)* springsource-tool-suite-2.3.0.RELEASE-e3.5.1-macosx-cocoa-installer.dmg 210MB sha1 - md5
Mac OS X (Cocoa)* springsource-tool-suite-2.3.0.RELEASE-e3.5.1-macosx-cocoa.tar.gz 344MB sha1 - md5
Mac OS X (Cocoa, 64bit)* springsource-tool-suite-2.3.0.RELEASE-e3.5.1-macosx-cocoa-x86_64-installer.dmg 209MB sha1 - md5
Mac OS X (Cocoa, 64bit)* springsource-tool-suite-2.3.0.RELEASE-e3.5.1-macosx-cocoa-x86_64.tar.gz 344MB sha1 - md5
Linux (GTK) springsource-tool-suite-2.3.0.RELEASE-e3.5.1-linux-gtk-installer.sh 209MB sha1 - md5
Linux (GTK) springsource-tool-suite-2.3.0.RELEASE-e3.5.1-linux-gtk.tar.gz 345MB sha1 - md5
Linux (GTK, 64bit) springsource-tool-suite-2.3.0.RELEASE-e3.5.1-linux-gtk-x86_64-installer.sh 209MB sha1 - md5
Linux (GTK, 64bit) springsource-tool-suite-2.3.0.RELEASE-e3.5.1-linux-gtk-x86_64.tar.gz 345MB sha1 - md5

Update Site Installation

STS can also be installed from the following update sites:
  • Releases: http://www.springsource.com/update/e3.5
  • Milestone releases: http://www.springsource.com/milestone/e3.5
  • Nightly snapshots: http://www.springsource.com/snapshot/e3.5

Requirements

The following pre-requisites must be fulfilled in order to install STS:

  • Operating System: Microsoft Windows XP or Vista, Apple Mac OS X, Linux
  • Java Runtime: latest version of JDK 5 or 6 (a JRE will not be enough to use all STS features)
  • Hardware: 500MB free disk space, 2GB memory

Installation Instructions

Please follow this installation instructions with great care.

Windows

Download the STS executable installer (*.exe) from the list above. Once downloaded, please double-click the installer to launch the installation process. Follow the on-screen instructions to finish the installation.

If you are downloading the ZIP archive please do not use the extraction utility that comes with Windows as it has been reported that this is causing problems during extraction. Instead please use the free 7-Zip utility.

Mac OS X

Download the STS Mac OS disk image (*.dmg) from the list above. Once downloaded, please mount the disk image by double-clicking the downloaded dmg file. Open the volume named 'SpringSource' and double-click on the installer to launch the installation. Follow the on-screen instructions to finish the installation.

At this time we do not recommend to use any of the Cocoa builds for Mac OS. There a numerous open performance related problems with the Cocoa port reported at Eclipse.org.

 

Linux

Download the STS self-extracting shell script (*.sh) that matches your OS and machine architecture. Once downloaded, launch the installation by running the following command in a terminal session:

$ sh springsource-tool-suite-2.3.0.RELEASE-e3.5.1-linux-gtk-installer.sh 

*******************************************************************************
*                   SpringSource Tool Suite 2.3.0.RELEASE                     *
*                                 Installer                                   *
*******************************************************************************
preparing the installer...
... done
starting UI installer. please follow instructions on screen...

2009년 12월 18일 금요일

자바스크립트 쿠키(cookie)

자바스크립트 쿠키는 CGI의 HTTP Cookie와 내용 및 작동하는 법은 같으나 약간의 차이가 있습니다. 아래는 자바스크립트 쿠키에 대한 개요입니다.

 

  1. 자바스크립트에서 지원하는 사용자의 특정 정보를 저장하는 기법
  2. 클라이언트의 브라우저에 저장되나 서버에는 저장되지 않습니다.
  3. 일정 기간 동안만 유효하게 할 수 있고, 유효기간(만료기한)이 설정되지 않을 경우
    브라우저 종료시 자동으로 사라집니다.
  4. 클라이언트에는 브라우저가 실행중에는 메모리에, 종료될 경우 만료기한에 따라
    cookies.txt라는 파일에 저장될 수 있습니다.
  5. 웹 서버의 환경변수 HTTP_COOKIE에는 저장되지 않습니다.

 

자바스크립트 쿠키는 서버와는 무관하기 때문에 일반적으로 잘 사용하지는 않습니다. 그러나, 클라이언트 내에서는 얼마든지 쿠키의 정보유지기법을 사용할 수 있으므로 간단한 방문 기록 남기기 등에서는 쓰일 수 있습니다. 자바스크립트에서 쿠키를 참조하기 위해서는 document.cookie객체를 사용합니다.
아래는 가장 일반적으로 사용되는 쿠키 관련 자바스크립트 함수들입니다. 아래 함수의 주요 기능은 document.cookie객체의 문자열 조작을 통하여 쿠키로부터 값을 빼내는데 사용됩니다.
function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(o
Technorati 태그:
ffset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { //while open var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } //while close return null; } function SetCookie (name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (2 < argc) ? argv[2] : null; var path = (3 < argc) ? argv[3] : null; var domain = (4 < argc) ? argv[4] : null; var secure = (5 < argc) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); }
위의 함수에서 사용자가 쓸 함수는 GetCookie(), SetCookie()입니다. 사용하는 문법은 아래와 같습니다.
GetCookie
설정되어 있는 쿠키의 값을 가져옵니다.
쿠키값 = GetCookie(name) 인수 설명)
name(필수 요소)
저장된 Cookie의 이름
예)
cookieval = GetCookie('myCookie');
SetCookie
쿠키의 값을 설정한다.
SetCookie(name, value, [expires], [path], [domain], [secure]) 인수 설명)
name(필수 요소)
Cookie에 저장하고자 하는 이름
value(필수 요소)
Cookie에 저장된 이름(name)에 대한 값
expires(생략 가능)
Cookie가 설정된 후 Cookie가 무효화되는 시간이다.
(GMT Type - "Wdy, DD-Mon-YYYY HH:MM:SS GMT")
설정된 시간이 지나게 되면, 이 Cookie는 사용할 수 없게 된다. 만약 expires에 설정된 시간보다 더 일찍 브라우저가 종료될 경우, 브라우저는 자동으로 cookies.txt라는 파일을 생성하여 그 정보를 이 파일에 저장해 둡니다.
Netscape 4.x의 경우)
C:\Program Files\Netscape\Users\[Profile name]\cookies.txt
Internet Explorer 4.x의 경우)
C:\windows\Cookies\[remote user name]@[domain].txt
path(생략 가능)
문서의 경로명을 설정합니다. 설정하지 않으면 현재 Cookie를 보내는 문서의 URL상의 경로(도메인 명 제외)로 설정됩니다.
domain(생략 가능)
웹 서버의 도메인 명을 설정합니다. 설정하지 않으면 현재 Cookie를 보내는 문서가 속한 도메인 명으로 설정됩니다.
secure(생략 가능)
HTTPS Server(HTTP over SSL)와 같은 Secure Server에서 Cookie를 보낼 경우 이 값을 설정해 줍니다.
예 1) 쿠키값만 설정할 경우
SetCookie('myCookie', 1234);
예 2) 쿠키값 및 만료일을 설정할 경우
var ExpDate = new Date();
ExpDate.setTime(ExpDate.getTime() + 1000*60*60*24); SetCookie('myCookie', 1234, ExpDate); ※ 위의 예제는 만료일을 쿠키가 생성되는 현재 시간 + 1일로 설정합니다. 만약, 만료일을 쿠키가 생성된 후 1시간으로 설정하겠다면 위의 예제에서 24(시간)를 1(시간) 로 바꾸어 주면 됩니다.

아래의 예제는 쿠키값을 설정하고, 만료일을 쿠키가 설정된 후 1시간 이후로 설정하는 예제입니다.

쿠키는 설정된 후에 브라우저가 활성화 되어 있고 만료일이 경과되지 않는 한 브라우저에 따라 설정된 디렉토리 내의 cookies.txt를 지우더라도 값이 유지된다는 점을 주의하기 바랍니다. 지금까지 자바스크립트에 대해 알아 보았습니다. 물론 부족한 점이 많겠지만 지금까지 설명한 내용만 가지고도 여러분이 보다 동적이고 기능적인 홈페이지를 만드는데 많은 도움이 될 것입니다.