달력

3

« 2024/3 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
2009. 7. 12. 08:06

VirtualBox 3.0.2 Released Tip & Tips/VirtualBox2009. 7. 12. 08:06

Sun에서 GPL 라이센스로 개발하고 공개하고 있는 이전에 소개한 이후로 계속 버전을 업그레이드 하고 있다.
내가 개발에 필요할 때가 아니면, 자세하게 변경 내용을 들여다 보지 않는터라 얼마나 변경되었는지 알지 못하고 있다가, 이번에 싸이트를 방문하고 나서야 벌써 3.0으로 업그레이드 되었음을 알게 되었다.

이에 대한 설치 방법은 이전에 써 놓았던 아래의 Blog를 참조하면 된다.


사실 VirualBox 2.2가 지난 4월에 나오고 얼마되지 않아 VirtualBox 3가 지난 6월 30일 나온 것은 굉장히 빨리 버전이 올라가는 있다는 것인데, 그리고 나서 7월 10일 경에 3.0.2로 업그레이드한 버전을 Release하였다는 것은 기능적으로 빠르게 추가되고 있다는 의미이기도 하지만, 내부적으로 Defact가 많다는 의미이기도 하다. 

이에 대한 기존 VirtualBox2와 3의 다른 점은 Changelog에서 확인할 수 있다.

아는 사람들은 알겠지만, 몇개월 전에 Sun과 Oracle의 기업 합병이야기가 있었고, 두 회사는 다른듯하지만 내부적으로는 서버에 관련 소프트웨어 기술들은 많은 부분 유사하고 중복되어 있다. 그 중 하나가 가상화 기술은데, 합병의 여파로 VirtualBox가 중단되지 않나하는 우려도 있었는데, 지속적으로 버전업하고 있는 것은 상당한 의미를 내표하고 있다.

VirtualBox 3는 현재 Windows, Linux 그리고 Macintoch 와 OpenSolaris에서 호스트로 도작할 수 있으며, 다음과 같은 guest OS들을 사용할 수 있다. (아래 표 참조)
현재 나와 있는 OS중에서 많이 사용되고 있는 것들은 거의 모두 사용이 가능하다. 


eam. (Page last updated 2009-06-12)


Guest OS Status Remarks
Windows family
Windows 7 RC Works, with Additions
Windows Vista Works, with Additions
Windows 2000 Works, with Additions
Windows XP Works, with Additions
Windows Server 2003 Work, with Additions
Windows NT Works, with Additions Some issues with old service packs. Recommended to install service pack 6a.
* Windows 98 Works, no Additions available
Linux family
Generally, all 2.4 and 2.6 kernels work; however, we recommend 2.6.13 or above for better performance. Kernels 2.6.18 to 2.6.18.2 contain a race condition (which was unfortunately backported to the Ubuntu 6.06 Server and 6.10 kernels) that can cause boot crashes in virtual machines.
Ubuntu 5.10/6.06 Desktop/7.04/7.10/8.04/8.10/9.04 Work, with Additions
Ubuntu 6.06 Server/6.10 Works partially, with Additions The Ubuntu 6.06 Server and 6.10 kernels suffer from the race condition mentioned above.
Debian 3.1/4.0/5.0 Work, with Additions
SUSE 9/10.0 Work, with Additions
openSUSE 10.2 Works partially, with Additions The openSUSE 10.2 kernel suffers from the race condition mentioned above.
openSUSE 10.3 Works, with Additions
openSUSE 11.0/11.1 Work, with Additions
Mandriva 2008 Works, with Additions Mandriva 2008 has the guest additions for VirtualBox 1.5 installed by default. These should be updated after installation.
Mandriva 2009.0/Mandriva 2009.1 Work, with Additions
Mandrake 10.1 Works, with Additions
*Mandrake 9.2 Works, without Additions
Fedora Core 1/4/5/6 Work, with Additions
Fedora 7, 8, 9, 10, 11 Work, with Additions
Red Hat Enterprise Linux 3, 4 and 5 Work, with Additions
* Red Hat Linux 9 Works, with Additions
* Red Hat Linux 7 Works, without Additions
* Linspire 4.5 Works, with Additions
* Slackware 10.1 Works, with Additions
* Conectiva 10 Works, with Additions
* Xandros 3 Works, no Additions available
Xandros 4 Works, with Additions
ArchLinux Works, with Additions Installation has to be booted with the ide-legacy option.
Solaris
Solaris 10 5.08 and later Works, Guest Additions available No shared folder support yet.
OpenSolaris 2008.05 and later Works, Guest Additions available No shared folder support yet.
Unices
FreeBSD Works partially FreeBSD 6.2 is known to cause problems.
* PC-BSD 1.3 Doesn't work
OpenBSD Works, no Additions available
Others
DOS Works, no Additions available Only limited testing as part of system installation processes has been performed.
OS/2 Works, with Additions Requires VT-x hardware virtualization support. Only MCP2 is reported to work reliably so far.
QNX Neutrino 6.32 Doesn't work
* Novell Netware 6.5 Doesn't work
* BeOS 5 Doesn't work
Syllable Works, no Additions available
* Visopsys Doesn't work
ReactOS Works, no Additions available
* SkyOS Works, no Additions available




:
Posted by 행복상자
2009. 4. 11. 08:53

ExtJS의 그리드 기능 간단 분석 Tip & Tips/JavaScript2009. 4. 11. 08:53

최근에 프로젝트에 ExtJS를 비록하여 몇가지 JavaScript 프레임워크를 검토한 적이 있다.
내부적으로 ExtJS를 사용하고 있지만, 결코 주변의 다른 프로젝트를 진행하고 있는 사람들에게는 적극적으로 권하지 않는다. 왜냐하면, 한국은 HTML, CCS 그리고 JavaScript를 웹 프로그램의 한 부분으로 생각하지 않고 있을 뿐더러, 그렇다고 디자이너의 역할 중의 하나라고도 생각하지 않는다. 그렇게 때문에 HTML, CSS 그리고 JavaScript의 전문가를 찾아 보기가 쉽지 않다.

ExtJS를 권하지 않는 이유는 처음 이를 사용할 때는 Windows에서나 제공할 수 있었던 많은 기능들이 컴포넌트화 되어 있어서, 사용하기 편할거라는 생각을 하는데, 이를 응용한 새로운 컴포넌트를 만들거나 제대로 기능을 사용하려면, 약 2달정도의 학습시간이 필요하기 때문이다. 개발 초기에 이를 감안한다면, 사용하는 것은 별 문제 없지만, 기존의 HTML과 CSS만을 이용할 때보다는 전체 개발시간이 늘어날 거라고 반드시 예상하고 개발 플랜을 잡아야 할 것이다.

최근에 기존에 개발되어 있던 기능을 살펴볼 일이 있었다.
개발자가 ExtJS의 코드를 그대로 가져다 써서 인지 사소한 버그가 있었다. ExtJS의 버그나 잘못은 아니라고 생각한다. Ajax와 ExtJS의 그리드 컴포넌트를 이용하였는데, 마지막 페이지에 있던 Rows를 모두 삭제하면 이전 페이지로 이동해야 하는데, 마지막 페이지 그대로를 표시하는 것이었다.

그래서, 몇가지 자료를 찾아보았더니, 관련된 예제는 아래와 같은 Link에 있었다.
그리드에 데이터 목록을 가져오고, 목록에 추가/수정/삭제에 대한 예제가 있다.

예제: Tutorial:Using Ext grid form dialog to achieve paging list, create, edit, delete function 

이중에서 delete에 대한 예제는 아래와 같았다. (아래 Delete Function 예제 참조)

 Delete function

Delete function will get the selected id(s) and create JSON data and send JSON data to Java server-side for handle.

/************************************************************
    * Action - delete
    *   start to handle delete function
    *   need confirm to delete
    ************************************************************/	
    function doDel(){
        var m = grid.getSelections();
        if(m.length > 0)
        {
        	Ext.MessageBox.confirm('Message', 'Do you really want to delete it?' , doDel2);	
        }
        else
        {
        	Ext.MessageBox.alert('Message', 'Please select at least one item to delete');
        }
    }     
 
    function doDel2(btn)
	{
       if(btn == 'yes')
       {	
			var m = grid.getSelections();
			var jsonData = "[";
	        for(var i = 0, len = m.length; i < len; i++){        		
				var ss = "{\"id\":\"" + m[i].get("id") + "\"}";
				//alert(ss);
				if(i==0)
	           		jsonData = jsonData + ss ;
			   	else
					jsonData = jsonData + "," + ss;	
				ds.remove(m[i]);								
	        }	
			jsonData = jsonData + "]";
			ds.load({params:{start:0, limit:myPageSize, delData:jsonData}});		
		}
	}

And delete parameter to server side with JSON data like this: delData=[{"id":"5"},{"id":"6"}]


위 예제를 보면, 서버로 데이터를 요청할 때, 파라메터로 start 값과 limit값을 보내줌을 알수 있다.
상기 예제 소수의 하단을 보면,    ds.load({params:{start:0, limit:myPageSize, delData:jsonData}});
라는 코드가 눈에 들어올 것이다. 이를 이용하여, 서버에서 DB에 쿼리를 수행해서 현재 페이지에서 필요로 하는 첫 번째 인텐스 값과 현재 페이지에서 표시할 수 있는 데이터의 갯수를 가져오는 것인데, 위 예제는 기본적으로 "0"번 인덱스를 서버로 보내서 매번 1페이지만 가져오는 것이다.

만약 이를 해결하려면, 두가지 방법이 있는데

첫번째는 위에서 사용했던 함수 ds.load({params:{start:0, limit:myPageSize, delData:jsonData}});
의 start 파라메터에 이전 페이지의 첫번째 인덱스를 넣어주는 것이다. 이를 위해서는 전체 Total Counter를 이용하여 총 페이지 수와 인덱스를 찾는 로직이 필요한데, 이미 많이 사용되는 코드라 쉽게 찾고, 만들수 있을 거라 생각된다.

두번째는 페이지 네이션을 모두 서버에서 담당하는 것이다. 이 경우는 동시에 사용자들이 수정 추가 삭제에 대해 부분도 충분히 고려되어 질 수 있다. 이에 필요한 계산 로직은 위의 첫번째 방법과 별로 다르지는 않고 단지 책임에 대한 부분만 책임을 지면된다. 이때는 서버에 현재 페이지의 첫번째 인덱스 번호를 서버로 보내주는 것이 바람직하다.
이를 이용하여 서버에서는 전제 개수와 페이지를 계산하고 마지막 페이지가 존재하지 않는 경우 이전 페이지의 목록을 보내주면 되기 때문이다.
 

:
Posted by 행복상자
Pro Javascript를 전체적으로 한번 흩어 보고나서는, Javascript에 대한 이해도가 무척 높아졌다. 물론 당연히 알아야 할 것들을 그동안 모르는 채 잘 지내왔을 뿐이다.
내가 알던 쉬운 자바스크립트는 지금의 것과는 너무도 많이 달랐다. 아니 자바스크립트의 가능성과 기능에 대해서 너무 간과해 왔는지도 모른다.

HTML의 DOM 구조는 개발자로 하여금 문서의 구조을 쉽게 이해할 수 있도록 도와주고, 이는 CSS와
Javascript를 통해서 쉽게 제어할 수 있어 매우 유용하다.

<html>
<head>
<title>Introduction to the DOM</title>
<script>
    // We can't manipulate the DOM until the document
    // is fully loaded
    window.onload = function(){
    // Find all the <li> elements, to attach the event handlers to them
    var li = document.getElementsByTagName("li");
    for ( var i = 0; i < li.length; i++ ) {
        // Attach a mouseover event handler to the <li> element,
        // which changes the <li>s background to blue.
        li[i].onmouseover = function() {
            this.style.backgroundColor = 'blue';
        };

        // Attach a mouseout event handler to the <li> element
        // which changes the <li>s background back to its default white
        li[i].onmouseout = function() {
            this.style.backgroundColor = 'white';
        };
    }
};
</script>
</head>
<body>
<h1>Introduction to the DOM</h1>
<p class="test">There are a number of reasons why the
DOM is awesome, here are some:</p>
<ul>
    <li id="everywhere">It can be found everywhere.</li>
    <li class="test">It's easy to use.</li>
    <li class="test">It can help you to find what you want, really quickly.</li>
</ul>
</body>
</html>

위의 코드는 "Pro Javascript"에 나오는 예제인데, HTML은 XML의 구조를 가지고 있지만, 가장 단순한 형태중에 하나로 문서를 구성하는 Object를 정의하고 있다. 이러한 구조는 "태그(Tag)"라는 형태로 정의되어지는데, 위 예제는 태그에 Event의 handler를 할당하는 코드이다.

코드에 대한 설명을 덧 붙이자면,
1. var li = document.getElementsByTagName("li");
    - 위 코드를 통해서 HTML 문서에 정의된 "li" 태그들의 리스트를 가져와서 var li에 저장한다.
    - document.getElementsByTagName 메소드는 태그 이름을 이용하여 Element를 가져오는
      함수이다.

2. li[i].onmouseover = function() {this.style.backgroundColor = 'blue'; );
   - 위 코드를 정의하기 전에, "li.length"를 통해서 리스트의 갯수를 알수 있고 이를 For 루프 문의
     통해서 반복을 시킨다.
   - 이는 동일한 이벤트를 "li"태그로 정의된 Object에 할당하기 위새서이다.
   - li[i].onmouserover 이벤트 메소드는 위와 같이 새로 정의된 메소드를 통해서 마우스가 "li"태그
     위에서 움직일 때 태그의 배경색을 "blue"로 바꾸어 준다.

3. li[i].onmouseout = function() {this.style.backgroundColor = 'white'; };
    - 이 코드는 "li" 태그의 onmouseout event 메소드를 정의하는 코드로, 마우스가 태그를 벗어날때
      태그의 배경색을 "white"로 바뀌게 만들어 준다.

위의 코드를 이해할 수 있으면, jQuery에서 얼마나 직관적으로 같은 코드를 간략하고 단순한 형태로 사용할 수 있는지 알게된다면, 깊은 인상을 받을 것이다.
:
Posted by 행복상자
원래는 책에서 Closure에 대한 설명에 대한 설명이 있는데, 나의 관심을 끈 것은 Anonymous함수의 사용에 대한 것이었다.

아래의 예제는 동일한 동작을 하는 메소드를 Event에 추가하는 예제인데, 중간 정도에 보면 난데 없이 "(function(){" 으로 시작하는 구문이 나온다. 이 부분이 Anonymoun function 이다.
이렇게 만들면 "Global"로 선언할 필요없이 임시적으로 함수 블럭의 사용이 가능하다.
구문을 닫을 경우는 "})();"를 이용하면 된다.

 // An element with an ID of main
var obj = document.getElementById("main");

// An array of items to bind to
var items = [ "click", "keypress" ];

// Iterate through each of the items
for ( var i = 0; i < items.length; i++ ) {
    // Use a self-executed anonymous function to induce scope
    (function(){
        // Remember the value within this scope
        var item = items[i];
        // Bind a function to the elment
        obj[ "on" + item ] = function() {
            // item refers to a parent variable that has been successfully
            // scoped within the context of this for loop
            alert( "Thanks for your " + item );
        };
    })();
}

사실 위의 코드는 불필요한 내용들이 많이 들어있다. 굳지 저렇게 써야하나 라는 생각이 들지도 모르지만, 이것은 단지 예제 정도록 사용하면 된다.
그래도 몇가지 건질 것이 있다면, 위의 코드에서 "id"를 이용하여 오브젝트를 가져오고, Event를 Bind하는 내용을 담고 있는데, Event명을 obj["on" + item]의 형태로 Event를 binding한다.
위의 코드는 "click" 과 "keypress"에 대한 이벤트가 발생하면 메시지를 발생시키는 예제이다.

:
Posted by 행복상자