2009년 10월 20일 화요일

secret of name and id (1)

There are sevral checkbox with name 'chk'.





and you want to know how many chk boxes there.
if you're confuse id and name, you'll get different result.

1. ID
$("#chk_can").length
returns 1

2. NAME
$("input[name='chk_can']").length
returns 3

2009년 10월 1일 목요일

select radio button according to radio value

There're 2 radio buttons




I'd like to choose radio button and check it with jQuery accroding to DB value.
what if DB value is '10'.

>> $("input[name=FS_type]").filter('[value='10']').attr('checked',true);

It doesn't work. Any idea?

2009년 9월 22일 화요일

Jquery use get() of val()







function getTotal() {
f = $("input[name=chk]");
for(i=0;i alert(f.get(i).val()); // ---> error
}

}

How can I get value of i element ???

2009년 9월 1일 화요일

[jquery] radio button II

html;
r1
r2
r3

jquery;
_fs_type= '10';
$("input[name=FS_type]").filter('[value='+_fs_type+']').attr('checked',true);


description;
set radio button 'r1' and checked it.

2009년 8월 28일 금요일

[jquery] radio button

$("input[name='radio_name']:checked").val();

2009년 8월 25일 화요일

response.setCharacterEncoding("utf-8")

replace response.setCharacterEncoding("utf-8") with
response.setContentType("text/xml;charset=utf-8");

2009년 8월 18일 화요일

스윙



함 보시고 평가해주세요

2009년 7월 29일 수요일

jQuery - exist element?

Jquery returns its length even though it hasn't created yet.
$("#id").length = 0 means there's no element for '#id'

if($("#id").length > 0 ) {
// to do something...
}

how to exit from each loop - jQuery

"If you wish to break the each() loop at a particular iteration you can do so by making your function return false. Returning non-false is the same as a continue statement in a for loop, it will skip "

$("#element-name").each(function(i){
if(this.val() == ''){
alert("null");
return false;
}
});

if jQuery is surrounded by another function, how can you do it?
i.e

function test() {
$("#element-name").each(function(i){
if(this.val() == ''){
alert("null");
return false;
}
});


// do something more

}

probably you can't avoid below logic.
Any idea to exit at once from whole function?

2009년 7월 28일 화요일

Add this to context.xml

Resource name="poolname" auth="Container"
type="oracle.jdbc.pool.OracleDataSource"
factory="oracle.jdbc.pool.OracleDataSourceFactory"
connectionCachingEnabled="true"
user="DB" password="DB"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@192.168.100.1:1521:ORCL"
removeAbandoned="true"
removeAbandonedTimeout="30"
maxActive="20"
maxIdle="10" maxwait="-1"

getting Eclipse console encoding

If you got any problem on console message.
Add this to xxx.ini file.

I hope this will help you.

-Dfile.encoding=UTF-8

2009년 7월 21일 화요일

cvs 관리

*** create new account
1. log in as a admin
c:\> set cvsroot=:pserver:administrator@127.0.0.1/repo_name
c:\>cvs login

2. Create
c:\>cvs passwd -r admin_account -a new_name

3. try to log in with new account
c:\>set cvsroot=:pserver:new_name@127.0.0.1/repo_name
c:\>cvs login

**Delete account
1.log in with admin account
c:\>cvs login
c:\>cvs passwd -X account_name

* replace password
1.log in with admin or account
c:\>cvs login
c:\>cvs passwd user_name

2009년 7월 9일 목요일

SVN + android + code.google.com

Download & install those programs
- eclipse
- Subclipse

Register code.google.com

1. Open Eclipse and check out your project at first

2. Check out with SVN repository

















3. Choose new project











2009년 5월 5일 화요일

[Python] 파이썬 예제2

역시 환율을 가져오는 프로그램이다
첫번째 버전은 그냥 스트링을 짤랐기 때문에 아주 허접한 버전이었지만
이번 버전에서는 금액으로 값을 리턴하고자 한다 즉 원하는 결과값은
THB : 36.60

현재 문제점을 정리해 보면

1. HTML 로 되어있다
2. 정확하게 어떤 값을 긁어서 가져와야 하는지 명확하지 않다
3. minidom 이 HTML도 DOM 처럼 다룰 수 있는지 모르겠다

[Python] 파이썬 예제1

# -*- coding: utf-8 -*-
# 네이버 환율에 접속해서 환율 정보를 가져오는 프로그램
import urllib2
f = urllib2.urlopen('http://bank.naver.com/index/exchange.nhn')
#print f.read(2000)
str1 = f.read()

# 3번째 THB를 찾아라
s_point = str1.find('THB')

print str1[s_point-30:s_point+10]

2009년 5월 4일 월요일

python 시작하기

python 설치

-비스타에서 설치 시 관리자 계정이 아니면 나중에 컴파일 시 에러 발생함