'Tip & Tips' 카테고리의 다른 글
| Mac에서 Windows 공유 폴더 연결하기 (0) | 2011/01/17 |
|---|---|
| PNG File 에 대한 간략 정리 (0) | 2009/09/07 |
| Twitter API 사용하기 (0) | 2009/07/18 |
| INTEL 칩셋 패치 유틸리티 v9.0.0.1012 (0) | 2009/01/29 |
| Mac에서 Windows 공유 폴더 연결하기 (0) | 2011/01/17 |
|---|---|
| PNG File 에 대한 간략 정리 (0) | 2009/09/07 |
| Twitter API 사용하기 (0) | 2009/07/18 |
| INTEL 칩셋 패치 유틸리티 v9.0.0.1012 (0) | 2009/01/29 |
VirtualBox 4.0.0 (released 2010-12-22)
This version is a major update. The following major new features were added:
In addition, the following items were fixed and/or added:
| Virtual Box 4.0 Released (1) | 2010/12/25 |
|---|---|
| VirtualBox 3.0.2 Released (4) | 2009/07/12 |
| 선 마이크로 시스템의 VirtualBox ver 2.1.2 설치 (2) (0) | 2009/02/14 |
| 선 마이크로 시스템의 VirtualBox ver 2.1.2 설치 (1) (0) | 2009/02/02 |
| Bytes | Purpose |
|---|---|
| 89 | Has the high bit set to detect transmission systems that do not support 8 bit data and to reduce the chance that a text file is mistakenly interpreted as a PNG, or vice versa. |
| 50 4E 47 | In ASCII, the letters "PNG", allowing a person to identify the format easily if it is viewed in a text editor. |
| 0D 0A | A DOS style line ending (CRLF) to detect DOS-UNIX line ending conversion of the data. |
| 1A | A byte that stops display of the file under DOS when the command type has been used—the end-of-file character |
| 0A | A UNIX style line ending (LF) to detect UNIX-DOS line ending conversion. |
' Open a Stream and decode a PNG image
Dim imageStreamSource As New FileStream("smiley.png", FileMode.Open, FileAccess.Read, FileShare.Read)
Dim decoder As New PngBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)
Dim bitmapSource As BitmapSource = decoder.Frames(0)
' Draw the Image
Dim myImage As New Image()
myImage.Source = bitmapSource
myImage.Stretch = Stretch.None
myImage.Margin = New Thickness(20)
Dim width As Integer = 128
Dim height As Integer = 128
Dim stride As Integer = width
Dim pixels(height * stride) As Byte
' Define the image palette
Dim myPalette As BitmapPalette = BitmapPalettes.Halftone256
' Creates a new empty image with the pre-defined palette
Dim image As BitmapSource = System.Windows.Media.Imaging.BitmapSource.Create( _
width, height, 96, 96, PixelFormats.Indexed8, myPalette, pixels, stride)
Dim stream As New FileStream("new.png", FileMode.Create)
Dim encoder As New PngBitmapEncoder()
Dim myTextBlock As New TextBlock()
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString()
encoder.Interlace = PngInterlaceOption.On
encoder.Frames.Add(BitmapFrame.Create(image))
encoder.Save(stream)
| Mac에서 Windows 공유 폴더 연결하기 (0) | 2011/01/17 |
|---|---|
| PNG File 에 대한 간략 정리 (0) | 2009/09/07 |
| Twitter API 사용하기 (0) | 2009/07/18 |
| INTEL 칩셋 패치 유틸리티 v9.0.0.1012 (0) | 2009/01/29 |
| Mac에서 Windows 공유 폴더 연결하기 (0) | 2011/01/17 |
|---|---|
| PNG File 에 대한 간략 정리 (0) | 2009/09/07 |
| Twitter API 사용하기 (0) | 2009/07/18 |
| INTEL 칩셋 패치 유틸리티 v9.0.0.1012 (0) | 2009/01/29 |
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 | ||
| Virtual Box 4.0 Released (1) | 2010/12/25 |
|---|---|
| VirtualBox 3.0.2 Released (4) | 2009/07/12 |
| 선 마이크로 시스템의 VirtualBox ver 2.1.2 설치 (2) (0) | 2009/02/14 |
| 선 마이크로 시스템의 VirtualBox ver 2.1.2 설치 (1) (0) | 2009/02/02 |
최근에 프로젝트에 ExtJS를 비록하여 몇가지 JavaScript 프레임워크를 검토한 적이 있다. Delete function will get the selected id(s) and create JSON data and send JSON data to Java server-side for handle. And delete parameter to server side with JSON data like this: delData=[{"id":"5"},{"id":"6"}]
내부적으로 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
/************************************************************
* 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}});
}
}
위 예제를 보면, 서버로 데이터를 요청할 때, 파라메터로 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를 이용하여 총 페이지 수와 인덱스를 찾는 로직이 필요한데, 이미 많이 사용되는 코드라 쉽게 찾고, 만들수 있을 거라 생각된다.
두번째는 페이지 네이션을 모두 서버에서 담당하는 것이다. 이 경우는 동시에 사용자들이 수정 추가 삭제에 대해 부분도 충분히 고려되어 질 수 있다. 이에 필요한 계산 로직은 위의 첫번째 방법과 별로 다르지는 않고 단지 책임에 대한 부분만 책임을 지면된다. 이때는 서버에 현재 페이지의 첫번째 인덱스 번호를 서버로 보내주는 것이 바람직하다.
이를 이용하여 서버에서는 전제 개수와 페이지를 계산하고 마지막 페이지가 존재하지 않는 경우 이전 페이지의 목록을 보내주면 되기 때문이다.
| ExtJS의 그리드 기능 간단 분석 (0) | 2009/04/11 |
|---|---|
| Pro Javascript Techniques(4): Using the DOM and Events (0) | 2009/03/05 |
| Pro Javascript Techniques(3): Anonymous Functions (0) | 2009/02/17 |
| Pro Javascript Techniques(2): Javascript Variable Scope (0) | 2009/02/08 |
| Pro Javascript Techniques(1): Javascript DataType 체크 (0) | 2009/02/06 |
| <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> |
| ExtJS의 그리드 기능 간단 분석 (0) | 2009/04/11 |
|---|---|
| Pro Javascript Techniques(4): Using the DOM and Events (0) | 2009/03/05 |
| Pro Javascript Techniques(3): Anonymous Functions (0) | 2009/02/17 |
| Pro Javascript Techniques(2): Javascript Variable Scope (0) | 2009/02/08 |
| Pro Javascript Techniques(1): Javascript DataType 체크 (0) | 2009/02/06 |
| // 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 ); }; })(); } |
| ExtJS의 그리드 기능 간단 분석 (0) | 2009/04/11 |
|---|---|
| Pro Javascript Techniques(4): Using the DOM and Events (0) | 2009/03/05 |
| Pro Javascript Techniques(3): Anonymous Functions (0) | 2009/02/17 |
| Pro Javascript Techniques(2): Javascript Variable Scope (0) | 2009/02/08 |
| Pro Javascript Techniques(1): Javascript DataType 체크 (0) | 2009/02/06 |
| Virtual Box 4.0 Released (1) | 2010/12/25 |
|---|---|
| VirtualBox 3.0.2 Released (4) | 2009/07/12 |
| 선 마이크로 시스템의 VirtualBox ver 2.1.2 설치 (2) (0) | 2009/02/14 |
| 선 마이크로 시스템의 VirtualBox ver 2.1.2 설치 (1) (0) | 2009/02/02 |
어떤 사람들은 믿지 않겠지만, Javascript도 Object Oriented Programming을 지원하는 Language이다. 이전에 자바 스크립트가 출현하 지난 10년동안 언어적인 측면과 사용적인 측면에서 많은 변화가 있었지만, 실제로 개발자들은 굉장히 소극적으로 이를 사용했었다. 따라서 별도의 Javascript 함수들을 모은 ".js" 파일을 이용하기도 했지만, 이는 단지 함수들을 재 사용하는 측명에서 였다. 이유는 코드를 고치거나 수정하기 어렵다는 것인데, 자바 스크립트가 가지고 있는 기본적인 속성들을 몰라서 일지도 모른다.
많은 사람들이 Javascript를 다시 보기된 계기는 Google의 Application들이 이를 이용해서 사람들에 자신들의 Application을 제공하기 시작했기 때문이라 생각하는데, 이어서 나온 Yahoo의 YUI도 내게 많은 놀라움을 주었다. 그리고 다른 오픈 소스 라이브러리들 역시 놀라운 정도의 편리함과 쉬운 사용법을 내세우고 개발자들의 쉴 틈(?)을 만들어 주고 있다.
그러나, 남의 것을 사용할 때도, 기본적이고 기초적인 것은 알아야 덜 고생한다.
세상에는 날로 먹을 만한 것이 그리 많지 않다.
오늘은 내가 잘 이해하지 못했던 Javascript의 Scope에 대해 설명할 거다.
자바스크립트는 기본적으로 웹브라우져의 페이지별로 실행된다. 그래서 대부분이 함수를 만들어서 그안에서 지역 변수를 생성하거나, 전역으로 생성해서 사용한다.
일반적으로 사용할때는 별 문제가 없겠지만, Java, C#, C/C++과는 Scope의 영향범위가 다르므로 주의해야 한다.
아래는 셈플 코드인데, 전역으로 foo 변수를 생성했고, 이어서 if 문안에 생성했고, 마지막으로
function 문 안에서 생성하였다.
| ExtJS의 그리드 기능 간단 분석 (0) | 2009/04/11 |
|---|---|
| Pro Javascript Techniques(4): Using the DOM and Events (0) | 2009/03/05 |
| Pro Javascript Techniques(3): Anonymous Functions (0) | 2009/02/17 |
| Pro Javascript Techniques(2): Javascript Variable Scope (0) | 2009/02/08 |
| Pro Javascript Techniques(1): Javascript DataType 체크 (0) | 2009/02/06 |
댓글을 달아 주세요