2011. 12. 1. 16:39

[이클립스팁] 파일의 폴더 경로 소스 상단에 보여주기


단축키 : ALT + SHIFT + B

메뉴 경로  : Navigate -> Show In BreadCrumb

적용 후

'-=-= 컴퓨터 =-=- > 프로그래밍' 카테고리의 다른 글

이클립스 컬러 테마  (0) 2012.05.31
이클립스 콘솔 한글 깨짐  (0) 2012.05.11
이클립스 한글 깨짐 해결  (0) 2011.08.24
문자열인 "____" 안에 " 추가하기  (0) 2011.07.25
struts DOCTYPE  (0) 2011.07.09
2011. 11. 25. 16:45

[이클립스 플러그인] 자바스크립트 디버거

2011. 11. 7. 15:40

메모장 관리 프로그램

메모를 트리 노드별로 관리하고 html지원

http://jwfreenote.tistory.com/

  
2011. 10. 26. 12:23

버추얼박스 UUID 변경


C:\Program Files\Oracle\VirtualBox> 이동후

VBoxManage.exe internalcommands sethduuid "d:\vbox image\xpsp3_ie9.vdi"

결과 : UUID changed to: c0fd6af3-3302-442d-94fe-2b43267a8413

http://angeleyes.tistory.com/235
2011. 10. 19. 17:21

[JAVASCRIPT] 개월수 및 일수 윤년 포함 계산

윤년을 포함하여 개월수 정확하게 계산
아래 소스를 모두 복사후 시작날짜 와 끝나는 날짜를 YYYYMMDD 방식으로 던져주면된다.
함수 리턴은 재귀함수를 이용하므로 꼭 필요하다.
http://som2day.com/138

소스
/**
 * @ author : [insom*nia] (blue1769@naver.com)
 *      Homepage(BloG): http://som2day.com/
 * @ date  : 2010-01-06
 * @ descript : JavaScripts Date Functions
 */

function isLeapYear(year)
{
 // parameter가 숫자가 아니면 false
 if (isNaN(year))
  return false;
 else  {
  var nYear = eval(year);

  // 4로 나누어지고 100으로 나누어지지 않으며 400으로는 나눠지면 true(윤년)
  if (nYear % 4 == 0 && nYear % 100 != 0 || nYear % 400 == 0)
   return true;
  else
   return false;
 }
}

// start, end format: yyyymmdd
function getDifMonths(start, end)
{
 var startYear = start.substring(0, 4);
 var endYear = end.substring(0, 4);
 var startMonth = start.substring(4, 6) - 1;
 var endMonth = end.substring(4, 6) - 1;
 var startDay = start.substring(6, 8);
 var endDay = end.substring(6, 8);

 // 연도 차이가 나는 경우
 if (eval(startYear) > eval(endYear)) {
  // 종료일 월이 시작일 월보다 수치로 빠른 경우
  if (eval(startMonth) > eval(endMonth)) {
   var newEnd = startYear + "1231";
   var newStart = endYear + "0101";

   return (eval(getDifMonths(start, newEnd)) + eval(getDifMonths(newStart, end))).toFixed(2);
  // 종료일 월이 시작일 월보다 수치로 같거나 늦은 경우
  } else         {
   var formMonth = eval(startMonth) + 1;
   if (eval(formMonth) < 10) formMonth = "0" + formMonth;

   var newStart = endYear + "" + formMonth + "" + startDay;
   var addMonths = (eval(endYear) - eval(startYear)) * 12;

   return (eval(addMonths) + eval(getDifMonths(newStart, end))).toFixed(2);
  }
 } else         { 
  // 월별 일수차 (30일 기준 차이 일수)
  var difDaysOnMonth = new Array(1, -2, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1);
  var difDaysTotal = getDifDays(start, end);

  for (i = startMonth; i < endMonth; i++) {
   if (i == 1 && isLeapYear(startYear)) difDaysTotal -= (difDaysOnMonth[i] + 1);
   else         difDaysTotal -= difDaysOnMonth[i];
  }

  // because view this function
  window.alert("- run getDifMonths()\n- " + start + " ~ " + end + " => " + (difDaysTotal / 30).toFixed(2));
  
  return (difDaysTotal / 30).toFixed(2);
  }
}

// start, end format: yyyymmdd
function getDifDays(start, end)
{
 var dateStart = new Date(start.substring(0, 4), start.substring(4, 6) - 1, start.substring(6, 8));
 var dateEnd = new Date(end.substring(0, 4), end.substring(4, 6) - 1, end.substring(6, 8));
 var difDays = (dateEnd.getTime() - dateStart.getTime()) / (24 * 60 * 60 * 1000);

 // because view this function
 window.alert("- run getDifDays()\n- " + start + " ~ " + end + " => " + Math.ceil(difDays));

 return Math.ceil(difDays);
}

---------------------------------------------------------------------------------------------
다른버전
function getDiffDays(pStartDate, pEndDate, pType){
 //param : pStartDate - 시작일
 //param : pEndDate  - 마지막일
 //param : pType       - 'D':일수, 'M':개월수
 var strSDT = new Date(pStartDate.substring(0,4),pStartDate.substring(4,6)-1,pStartDate.substring(6,8));
 var strEDT = new Date(pEndDate.substring(0,4),pEndDate.substring(4,6)-1,pEndDate.substring(6,8));
 var strGapDT = 0;
 
 if(pType == 'D') {  //일수 차이
     strGapDT = (strEDT.getTime()-strSDT.getTime())/(1000*60*60*24);
 } else {            //개월수 차이
     //년도가 같으면 단순히 월을 마이너스 한다.
     if(pEndDate.substring(0,4) == pStartDate.substring(0,4)) {
         strGapDT = pEndDate.substring(4,6) * 1 - pStartDate.substring(4,6) * 1;
     } else {
         strGapDT = ((strEDT.getTime()-strSDT.getTime())/(1000*60*60*24*365.25/12)).toFixed(2);
     }
 }
 return strGapDT;
}
----------------------------------------------------------------------------------------
function getPrevDateValidate(yyyymmdd, term){
 var yyyy = yyyymmdd.substring(0, 4);
 var mm   = yyyymmdd.substring(4, 6);
 var dd   = yyyymmdd.substring(6, 8);

 myDate = new Date();
 myDate.setFullYear(yyyy);
 myDate.setMonth(mm-1);
 myDate.setDate(dd);
 

 if(term.charAt(term.length-1) == 'd'){
  term = term.substring(0, term.length-1); 
  myDate.setDate(dd - eval(term) +1 );
 }

 if(term.charAt(term.length-1) == 'm'){
  term = parseInt(term.substring(0, term.length-1), 10);

  myDate.setMonth(mm - eval(term) -1);
  myDate.setDate(myDate.getDate()+1);
 }

 yyyy = myDate.getYear();
 mm   = myDate.getMonth()+1;
 dd   = myDate.getDate();

 dd = (dd<10)?'0'+dd:dd;
 mm = (mm<10)?'0'+mm:mm;
 
 return yyyy+'-'+mm+'-'+dd;
}

function IsValidCheckDate(from_date, to_date, astr){
 if(astr != ""){
  to_date = ClearDelimit(to_date, "-");
  var temp_day   = getPrevDateValidate(to_date, astr);
  temp_day       = ClearDelimit(temp_day, "-");
  from_date = ClearDelimit(from_date, "-");
  if(astr.indexOf("m") != -1){
      var tempstring = astr.split("m");
      var tempchar   = "개월";
  }
  if(astr.indexOf("d") != -1){
      var tempstring = astr.split("d");
      var tempchar   = "일";
  }
  if(parseInt(from_date,10) < parseInt(temp_day,10)){
   alert("조회단위가 초과되었습니다. 본 서비스는 "+tempstring[0]+ tempchar +" 단위로만 조회가 가능합니다.");
   return true;
  }
 }
}

function ClearDelimit(str,serchar){
   var reStr ="";
   var seStr ="";
   var i = 0;
   seStr=str;
   reStr='';
   for (i=0;i <seStr.length; i++){
      reStr += (seStr.charAt(i) != serchar ?seStr.charAt(i) : '');
   }

   return reStr;
}

2011. 10. 17. 23:17

안드로이드 adhoc 기능 추가

사전 wifi 모듈 끄기 , 루팅 필수

Wifi 시스템 파일 버전 확인 명령어
- wpa_supplicant -v
참조 : http://misomaru.tistory.com/41

wpa_supplicant 파일 백업
- root_explorer 어플로 백업 추천
프로요용

wpa6_adhoc-signed.zip

진저브레드용

wpa_supplicant_adhoc_fix_v0.6.10ah_update.zip

 


버전 0.6.10 이상일 경우 상위 파일을 압축을 풀고 이하는 다른버전 사용

sdcard로 이동 /system/bin 폴더에 wpa_supplicant 파일  /system/bin에 복사 후 퍼미션 변경

퍼미션 755
owner    rwx
group    re
other    re

또는 

adb shell에서

 - chmod 755 wpa_supplicant

meta-inf 파일 /system/bin에 복사

wpa_supplicant 그룹, 오너 변경

- chown root.shell wpa_supplicant

----------------------------------------------
다른방법

/etc/wifi/wpa_supplicant.conf
ap_scan=1 -> ap_scan=2 로 수정
/data/misc/wifi/wpa_supplicant.conf
update_config=1 밑에
ap_scan=2 를 추가

 

==========================================================

ip 설정

 

2011. 10. 17. 17:37

오라클 휴지통 테이블 지우기(10g)


휴지통 보기 명령어
 - SHOW RECYCLEBIN

휴지통 테이블 선택 삭제
- PURGE TABLE TABLE_NAME;

휴지통 비우기
- PURGE RECYCLEBIN

테이블 삭제 휴지통 거치지 않고 바로 삭제

CASCADE CONSTRAINTS PURGE 추가
2011. 10. 7. 09:00

input box 한글/영문 선택입력하기

INPUT BOX에 한글 또는 영문만 입력하고 싶을때

style="ime-mode:disabled"  <--영문만 입력가능

참조주소 : http://itislord.tistory.com/300
2011. 10. 1. 17:52

Win7 Oracle 10g 설치전 설정


다운로드


환경설정 파일수정
[  ..\db\Disk1\install\oraparam.ini   ]
[Certified Versions]
#You can customise error message shown for failure, provide value for CERTIFIED_VERSION_FAILURE_MESSAGE
#Windows=5.0,5.1,5.2,6.0,6.1        <-- 추가

 
[  ..\db\Disk1\stage\prereq\db\refhost.xml     ] 
<OPERATING_SYSTEM>
      <VERSION VALUE="6.0"/>
    </OPERATING_SYSTEM>
 <!--Microsoft Windows 7-->         <--- 추가
 <OPERATING_SYSTEM>
  <VERSION VALUE="6.1"/>
 </OPERATING_SYSTEM>  
[ ..db\Disk1\stage\prereq\db_prereqs\db\refhost.xml  ]
 <!--Microsoft Windows 7-->
    <OPERATING_SYSTEM>
      <VERSION VALUE="6.1"/>
    </OPERATING_SYSTEM>
2011. 9. 24. 22:02

클래스변수 인스턴스 변수 사용


public class exClass {
public static void main(String[] args){
System.out.println("클래스메서드"+    TestData.retInt(10,20)   );
System.out.println("클래스변수"+     TestData.classVar       );
TestData test = new TestData();
System.out.println("인스턴스변수"+  test.instanceVar       );
System.out.println("인스턴스메서드"+    test.retInt2(50, 60)      );
}
}

class TestData{
int instanceVar = 2000;
static int classVar = 100;
public static int retInt(int a, int b){
int result = 0; //지역변수
result = a+b;
return result;
}
public int retInt2(int a, int b){
int result = 0;
result = a+b;
return result;
}
}

//결과
클래스메서드30
클래스변수100
인스턴스변수2000
인스턴스메서드110
=================================================================
클래스 변수는  static 영역
인스턴스 변수는 heap 영역

클래스변수는 인스턴스 생성 불필요 클래스 이름.변수이름으로 접근가능
인스턴스변수는 인스턴스 생성후 사용가능 
2011. 9. 21. 15:08

자바스크립트 replace

str.replace(",","");    콤마를 공백으로 변경함.

str.replace(/,/gi, "");   
replaceAll의 효과를 보려면 정규식을 사용해야함. ""를 /로 대체


원문 : http://blog.naver.com/banhong?Redirect=Log&logNo=116519480

2011. 9. 8. 22:40

크롬 마우스제스쳐 플러그인 Smooth Gestures

2011. 9. 8. 16:28

SELECT Box 값, 텍스트 가져오기


 
var startTypeValue = document.frm.startType.options[document.frm.startType.options.selectedIndex].value; //체크박스 선택되어진 값 가져오기
 var startTypeText = document.frm.startType.options[document.frm.startType.options.selectedIndex].text; //체크박스 선택되어진 텍스트 가져오기



<select id="seledtBox" onchange="alert(this.options[this.selectedIndex].text)">
<option id="0">value1</option>
<option id="1">value2</option>
<option id="2">value3</option>
<option id="3">value4</option>
<option id="4">value5</option>
</select>



참고주소 : http://cafe.naver.com/specialj.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=2246&
http://godpage.tistory.com/entry/select%EB%B0%95%EC%8A%A4%EC%9D%98-onchange%EC%97%90%EC%84%9C-thisvalue-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0
2011. 9. 5. 11:02

request 데이터 가져오는 우선순위


DB에서 바인딩 변수를 가져올때 우선순위

1. getParameter
2. getAttribute

이름을 동일하게 할경우 파라미터를 먼저 가져오므로 문제가 생긴다.
파리미터와 어트리뷰트와 이름을 서로 다르게 사용하는 습관 필요
2011. 8. 24. 13:28

이클립스 한글 깨짐 해결


프로젝트 속성가서

1. Text File Encoding -> MS949 방식


2. 이클립스  Window -> Preferences -> Content Types -> Text -> Default Encoding -> MS949  -> UPDATE  -> OK ->  프로젝트 닫기 후 재열기

그래도 깨지면 특정파일이 인코딩 방식을 걸어놓은 경우다..

파일에서 속성가서 인코딩 방식 변경하면된다.

글꼴은 한글지원 필수
2011. 8. 20. 11:42

SQL상태에서 임시로 쉘로 빠져나가기


쿼리를 날리다가 임시로 명령어 모드로 나가고 싶다.

ex)

SQL> host                   ---> 쉘모드로 변경
[oracle@oracledb ~]$ exit   --> 쉘모드 종료 ->SQL로 변경
exit

SQL>

2011. 8. 18. 21:11

리눅스 사용자 변경 명령어

#su kim (쉘적용 x)
$su - kim (쉘적용 o)
$su -        (root)로그인시
2011. 8. 18. 21:09

loading shared libraries: libsqlplus.so: cannot open shared object file


[kim@oracledb ~]$ sqlplus /nolog
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory

해결방법
[kim@oracledb ~]$ chmod -R a+rX $ORACLE_HOME

$ sudo chmod -R a+rX $ORACLE_HOME (관리자권한으로 실행)

# chmod -R a+rX /u01/app/oracle/product/10.2.0/db_1/bin/oracle (직접 실행)

관련파일
vi /etc/group
vi /etc/passwd

http://forums.oracle.com/forums/thread.jspa?threadID=347531
2011. 8. 17. 15:08

java.math.BigDecimal 형변환 오류


맵에있는 숫자를 가져와서 Int형으로 변환할려니 오류가 난 상황이다.

String.valueof(Obj j) 메소드로 해결..

객체인 맵을 스트링으로 바꾸려니 오류가 남.

참조 : http://blog.naver.com/0131v?Redirect=Log&logNo=110114319053


형변환 모음
http://itbruce.tistory.com/44
2011. 8. 16. 12:48

[JAVASCRIPT] 팝업에서 부모페이지 변수 접근하기 및 함수 호출

[부모페이지]

(form)
<input type='hidden' name="modelCall" value="true"> 히든으로 from에다 변수 생성

(function)
document.frm.modelCall.value="false";

[팝업페이지]
var openerCall = opener.document.frm.modelCall.value; //부모페이지 상태값 체크
     
 if(openerCall=="true"){
     opener.modelAddRowIn(chk[i].value, name[i].value);
 }

예제는 상위페이지 변수 상태가 변경되면 팝업페이지 함수 호출을 중단하는 소스이다.

참조 : http://kamjum.tistory.com/entry/JavaScript-%ED%8C%9D%EC%97%85%EC%B0%BD%EC%97%90%EC%84%9C-%EB%B6%80%EB%AA%A8-%EC%B0%BD%EC%9D%98-hidden-%EB%B3%80%EC%88%98%EC%97%90-%EB%94%B0%EB%9D%BC-%EA%B0%92-%EC%84%A4%EC%A0%95-%EC%9C%84%EC%B9%98-%EB%B3%80%EA%B2%BD
2011. 8. 10. 09:41

스트러츠1 액션이동시 파라미터 넘기는 법

1. 직접 주소에다 파라미터를 넘기는 경우

"/settlement/Rebate.do?method=main_page&PLCY_NO=1111111

2. 액션 리다이렉트 클래스를 활용하는법

  ActionRedirect redirect = new ActionRedirect( "/settlement/Rebate.do?method=main_page" );
    redirect.addParameter("PLCY_NO", plcyno);
  return redirect;

1번과 2번이 같은거라고 생각됨..


참고주소 : http://gurchin.tistory.com/56?srchid=BR1http%3A%2F%2Fgurchin.tistory.com%2F56

2011. 7. 25. 16:27

IE8에서 IE7 호환 메타태그


<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
2011. 7. 25. 09:09

문자열인 "____" 안에 " 추가하기


문자열안에 ""을 추가하는 방법

ex) "abcd""  ->  "abcd\"\" "

역슬래쉬 추가한후 하면된다. 한자에 하나씩......

두번해야하면 두번다 해야함.
2011. 7. 14. 14:48

[css] padding 과 _padding의 차이

브라우저 버전에 따라 다르게 적용하기 위해서임.

_padding은 ie6 이하버전에서 사용할때

http://blog.naver.com/PostView.nhn?blogId=yunjodan&logNo=60105434677



padding 과 .padding   -<css>

.padding   < ie 7이하>

padding   <ie8이상>

2011. 7. 9. 11:39

struts DOCTYPE

org.xml.sax.SAXParseException 에러시 추가

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">

 
출처 : http://fastutle.tistory.com/2

2011. 7. 9. 11:36

오라클 10g 한글깨짐 (UTF-8 변경)


환경

Cent OS 5.5 / Oracle 10g
------------------------------------------------------------------------------

SELECT * FROM sys.props$ where name='NLS_CHARACTERSET';  //캐릭터셋 확인


1. 프로파일 수정
export NLS_LANG=KOREAN_KOREA.UTF-8

export NLS_LANG=KOREAN_KOREA.KO16MSWIN949


2. 캐릭터셋 변경

C:\>sqlplus /nolog;

sql>conn /as sysdba;

 

변경하고자하는 캐릭터셋을 수정

== UTF-8 ==
sql>update sys.props$ set value$='UTF8' where name='NLS_CHARACTERSET';

sql>update sys.props$ set value$='UTF8' where name='NLS_NCHAR_CHARACTERSET';

sql>update sys.props$ set value$='KOREAN_KOREA.UTF8' where name='NLS_LANGUAGE';

= KO16MSWIN949 = //한글확장
sql>update sys.props$ set value$='KO16MSWIN949' where name='NLS_CHARACTERSET';

sql>update sys.props$ set value$='KO16MSWIN949' where name='NLS_NCHAR_CHARACTERSET';

sql>update sys.props$ set value$='KOREAN_KOREA.KO16MSWIN949' where name='NLS_LANGUAGE';

sql>commit;

 

재시작

sql>shutdown immediate;

sql>startup mount;

sql>alter system enable restricted session;

sql>alter system set job_queue_processes=0;

sql>alter system set aq_tm_processes=0;

sql>alter database open;

sql>alter database character set UTF8;

or  alter database character set KO16MSWIN949;

sql>shutdown immediate;

sql>startup;





참고 주소 : http://blog.stylegold.info/45
2011. 6. 24. 14:21

VirtualBox Installation failed! ERROR:123 해결 방법


압축을 풀어서 사용하면된다.

VirtualBox-3.2.8-64453-Win.exe -x -p C:\VBOX



참고주소 : http://freeimage.kr/bbs/?id=ipad_dev%2C7

2011. 6. 3. 14:50

스트러츠 이전버전

2011. 6. 3. 13:30

톰캣 + 서블릿 환경설정

 

톰캣 환경변수 설정   ( 자바설정 한 후 할것.)

환경변수 이름 :   CATALINA_HOME

변수값    :   C:\Program Files\Apache Software Foundation\Tomcat 6.0



톰캣폴더 lib 내에 있는 servlet-api.jar 를 자바( JRE, JDK ) 폴더에 LIB로 복사

경로 : C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar


톰캣폴더 Conf 폴더 내의 context.xml 수정 (독점 클래스 해제)

경로 : C:\Program Files\Apache Software Foundation\Tomcat 6.0\Conf\context.xml
<Context>  -> <Context privileged="true">


톰캣폴더 Conf 폴더 내의 web.xml 수정 (Invoker 활성)
경로 : C:\Program Files\Apache Software Foundation\Tomcat 6.0\Conf\web.xml
<!--                                                       <-- 주석해제
    <servlet>
        <servlet-name>invoker</servlet-name>
        <servlet-class>
          org.apache.catalina.servlets.InvokerServlet
        </servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>
-->                                                       <-- 주석해제

<!--                                                      <-- 주석해제
    <servlet-mapping>
        <servlet-name>invoker</servlet-name>
        <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>

-->                                                      <-- 주석해제

주의 :  위의 주석해제한 소스는 프로젝트내의 web.xml과 동시에 있을경우 구동오류


매핑을 통하여 서블릿을 호출해야함.(보안)

서블릿 기본 예제


호출 주소
http://localhost:8080/ServletExam/CallServ





참고주소 :  http://skynaver.tistory.com/entry/JAVA-java%ED%99%98%EA%B2%BD%EB%B3%80%EC%88%98-Tomcat%ED%99%98%EA%B2%BD%EB%B3%80%EC%88%98-Servlet-%EC%84%A4%EC%A0%95

'-=-= 컴퓨터 =-=- > 프로그래밍' 카테고리의 다른 글

struts DOCTYPE  (0) 2011.07.09
스트러츠 이전버전  (0) 2011.06.03
톰캣 + JDBC 연동 후 드라이버 찾기 실패시  (0) 2011.05.19
갈릴레오 SVN 설치  (0) 2011.05.13
이클립스 웹로직 플러그인 주소  (0) 2011.05.13
2011. 5. 19. 10:37

톰캣 + JDBC 연동 후 드라이버 찾기 실패시



ojdbc14.jar 을

톰캣 홈 디렉토리 lib폴더에 저장하기

'-=-= 컴퓨터 =-=- > 프로그래밍' 카테고리의 다른 글

스트러츠 이전버전  (0) 2011.06.03
톰캣 + 서블릿 환경설정  (0) 2011.06.03
갈릴레오 SVN 설치  (0) 2011.05.13
이클립스 웹로직 플러그인 주소  (0) 2011.05.13
이클립스 JDBC 오라클 연동  (0) 2011.05.04