출처 : http://ggaman.com/tt/896

유니코드란?

unicode는 모든 문자에 index를 줘 놓은 것이다. 더 이상도 아니고, 더 이하도 아니다.
이 index를 code point라고 부르는데, 그냥 index라고 칭하도록 하자.

'A'라는 글자는 0x0041 이라는 index를 가진다.
'a'라는 글자는 0x0061 이라는 index를 가진다.
'가'라는 글자는 0xac00 이라는 index를 가진다.
( 더 많은 글자와 index를 보려면 http://www.unicode.org/charts/  를 참고하자 )




표현방법

저렇게 정해져 있는 index를 표시하는 방법에는 UTF와 UCS두가지 종류가 있다.
( UTF - Unicode Transformation Format ,    UCS - Universal Character Set )

UCS
UCS는 몇바이트로 index를 표현할 수 있느냐를 나타낸다.
즉 UCS-2는 2byte로 index를 나타낼꺼고 UCS-4는 4byte를 이용해서 index를 나타낼거라는거다.

UTF
UTF는 몇 비트단위로사용해서 index를 나타낼것인가를 말한다.
UTF-8은 8bit씩 늘려가며 index를 나타낼꺼라는거고,
UTF-16은 16bit씩 index를 나타낼꺼고, UTF-32는 32bit씩 index를 나타낼꺼라는거다.
( 실상 UTF-16과 UCS-2는 같다고 볼 수 있다. 마찬가지로 UTF-32와 UCS-4도 마찬가지다. )





UTF-16

원래 처음에 unicode의 index는 2byte로 나타낼 수 있었다.
그랬는데, unicode 가 버젼업되어 4.0이 나왔을때에는 0x10FFFF 까지의 index가 생겼다.

처음에는 UTF-16으로 모든 문자를 나타낼 수 있었으나,
( 2byte로 표현할 수 있는 index를 가진 문자 목록을 BMP Basic Multilingual Plane 라고 부른다. )
유니코드 4.0이 나오면서, 2byte로는 0x10FFFF 같은 값을 가리킬 수 없게 되었다.

그래서 UTF-16으로는 BMP에 있는 문자들은 2byte로 처리하고, 
BMP보다 더 높은 index를 가지는 놈들은 4byte로 처리 한다.
문자 index 0x0000 부터 0xFFFF 까지는 2byte로 처리 하고
문자 index 0x10000 부터 0x1FFFF 까지는 4byte로 처리 된다.





UTF-32

UTF-32는 기본적으로 4byte를 사용하기 때문에, 위와 같은 짓을 하지 않아도 된다.





UTF-8

영어권에 있는 사람들은 UTF-16을 쓰면 손해다.
모든 영어는 1byte만 있으면 256개를 표현할 수 있으므로, 모든 문자를 넣을 수 있기 때문이다.

그래서 나온게 UTF-8이다.
영어권은 1byte로 표현하고, 그것보다 높은 index를 가지는것은 2byte 혹은 3byte 혹은 4byte ..
요렇게 늘려 가면서 쓰도록 되어 있다.





서로간의 변환

UTF-8, UTF-16, UTF-32, UCS-2, UCS-4 는
모두 unicode의 문자 index를 나타내기 위한 방법이기 때문에,
서로간의 변환은 당연히 잘 된다.




글자처리

우리가 글자 "가"를 쓴다고 해 보자.  글자 "가"는 1글자이다.
그러므로 "가"를 나타내는 index가 있다. 물론 "나"를 나타내는 index도 있다.

한글로 표현할 수 있는 글자는 매우 많다.
그 많은 글자 모두에게 index를 줄 수가 없다.

현재 사용하고 있는 모든 글자에 index를 준다고 해도,
시간이 지나서 새로운 글자가 추가 되어 index가 모자르게 된다면 어떻게 할것인가?

그래서 유니코드는 완전한 글자를 제공해 주기도 하지만,
글자를 조립할 수 있도록 조립가능한 글자를 제공해 준다.

다시 "가"를 쓴다고 해 보다.
"가"라는 글자는 1개이지만, 실제로는 초성 "ㄱ"과 중성"ㅏ" 가 합쳐져서 만들어진 글자이다.

그러므로 "가"를 표현하는 방법은 완성된 글자 "가"0xAC00가 될 수도 있고,
초성"ㄱ"과 중성"ㅏ"를 조립한 "가"0x1100,0x1161 로 나타낼 수도 있다.
( 초성 "ㄱ"은 0x1100 - HANGUL CHOSEONG KIYEOK )
( 중성 "ㅏ"는 0x1161 - HANGUL JUNGSEON A )

이를 조합할 수 있게 해 주는 index는 1100 부터 있다.
( Hangul Jamo - Korean combining alphabet - http://www.unicode.org/charts/PDF/U1100.pdf  )


이는 비단 한글뿐만 아니라,
일본어 역시 완성된 글자가 있기도 하고, 조합할 수 있게도 되어 있다.

영어 역시 그렇다. 영어에서 무슨 글자를 조합하냐 라고 말하겠지만, 
이력서를 나타내는 Résumé 의 경우에는 e 와 ' 의 조합으로 이루어 질 수도 있다.

Posted by 나비:D
:
http://ccrma.stanford.edu/courses/422/projects/WaveFormat/

WAVE PCM soundfile format

The WAVE file format is a subset of Microsoft's RIFF specification for the storage of multimedia files. A RIFF file starts out with a file header followed by a sequence of data chunks. A WAVE file is often just a RIFF file with a single "WAVE" chunk which consists of two sub-chunks -- a "fmt " chunk specifying the data format and a "data" chunk containing the actual sample data. Call this form the "Canonical form". Who knows how it really all works.

I use the standard WAVE format as created by the sox program:

사용자 삽입 이미지
 
Offset  Size  Name             Description

The canonical WAVE format starts with the RIFF header: 0 4 ChunkID Contains the letters "RIFF" in ASCII form (0x52494646 big-endian form). 4 4 ChunkSize 36 + SubChunk2Size, or more precisely: 4 + (8 + SubChunk1Size) + (8 + SubChunk2Size) This is the size of the rest of the chunk following this number. This is the size of the entire file in bytes minus 8 bytes for the two fields not included in this count: ChunkID and ChunkSize. 8 4 Format Contains the letters "WAVE" (0x57415645 big-endian form). The "WAVE" format consists of two subchunks: "fmt " and "data": The "fmt " subchunk describes the sound data's format: 12 4 Subchunk1ID Contains the letters "fmt " (0x666d7420 big-endian form). 16 4 Subchunk1Size 16 for PCM. This is the size of the rest of the Subchunk which follows this number. 20 2 AudioFormat PCM = 1 (i.e. Linear quantization) Values other than 1 indicate some form of compression. 22 2 NumChannels Mono = 1, Stereo = 2, etc. 24 4 SampleRate 8000, 44100, etc. 28 4 ByteRate == SampleRate * NumChannels * BitsPerSample/8 32 2 BlockAlign == NumChannels * BitsPerSample/8 The number of bytes for one sample including all channels. I wonder what happens when this number isn't an integer? 34 2 BitsPerSample 8 bits = 8, 16 bits = 16, etc. 2 ExtraParamSize if PCM, then doesn't exist X ExtraParams space for extra parameters The "data" subchunk contains the size of the data and the actual sound: 36 4 Subchunk2ID Contains the letters "data" (0x64617461 big-endian form). 40 4 Subchunk2Size == NumSamples * NumChannels * BitsPerSample/8 This is the number of bytes in the data. You can also think of this as the size of the read of the subchunk following this number. 44 * Data The actual sound data.

As an example, here are the opening 72 bytes of a WAVE file with bytes shown as hexadecimal numbers:

52 49 46 46 24 08 00 00 57 41 56 45 66 6d 74 20 10 00 00 00 01 00 02 00 
22 56 00 00 88 58 01 00 04 00 10 00 64 61 74 61 00 08 00 00 00 00 00 00 
24 17 1e f3 3c 13 3c 14 16 f9 18 f9 34 e7 23 a6 3c f2 24 f2 11 ce 1a 0d 

Here is the interpretation of these bytes as a WAVE soundfile:


Notes:

  • The default byte ordering assumed for WAVE data files is little-endian. Files written using the big-endian byte ordering scheme have the identifier RIFX instead of RIFF.
  • The sample data must end on an even byte boundary. Whatever that means.
  • 8-bit samples are stored as unsigned bytes, ranging from 0 to 255. 16-bit samples are stored as 2's-complement signed integers, ranging from -32768 to 32767.
  • There may be additional subchunks in a Wave data stream. If so, each will have a char[4] SubChunkID, and unsigned long SubChunkSize, and SubChunkSize amount of data.
  • RIFF stands for Resource Interchange File Format.

General discussion of RIFF files:

Multimedia applications require the storage and management of a wide variety of data, including bitmaps, audio data, video data, and peripheral device control information. RIFF provides a way to store all these varied types of data. The type of data a RIFF file contains is indicated by the file extension. Examples of data that may be stored in RIFF files are:
  • Audio/visual interleaved data (.AVI)
  • Waveform data (.WAV)
  • Bitmapped data (.RDI)
  • MIDI information (.RMI)
  • Color palette (.PAL)
  • Multimedia movie (.RMN)
  • Animated cursor (.ANI)
  • A bundle of other RIFF files (.BND)
NOTE: At this point, AVI files are the only type of RIFF files that have been fully implemented using the current RIFF specification. Although WAV files have been implemented, these files are very simple, and their developers typically use an older specification in constructing them.

For more info see http://www.ora.com/centers/gff/formats/micriff/index.htm

References:

  1. http://netghost.narod.ru/gff/graphics/summary/micriff.htm RIFF Format Reference (good).
  2. http://www.lightlink.com/tjweber/StripWav/WAVE.html
Posted by 나비:D
:

게임 개발 SDK

2009. 8. 26. 21:24
===== 관련 링크 ===== * DirectX SDK - (November 2008) - http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=5493f76a-6d37-478d-ba17-28b1cca4865a - 다운로드 센터 : http://www.microsoft.com/downloads/en/ 에서 "DirectX SDK"로 검색 - MSDN의 Downloads : http://msdn.microsoft.com/en-us/xna/aa937788.aspx * 도움말 - Reference : http://msdn.microsoft.com/en-us/library/bb174336(VS.85).aspx - Looting : http://telnet.or.kr/sec_directx/ * DirectX.DevPak for Dev-Cpp - http://www.dgrigoriadis.net/post/2004/06/26/DirectXDevPak-for-Dev-Cpp.aspx * NVIDIA - PerfHUD 6(퍼포먼스분석) : http://developer.nvidia.com/object/nvperfhud_home.html - Texture Viewer : http://developer.nvidia.com/object/windows_texture_viewer.html - DDS Thumbnail Viewer : http://developer.nvidia.com/object/dds_thumbnail_viewer.html - Photoshop Plugin : http://developer.nvidia.com/object/photoshop_dds_plugins.html#downloads * AMD(Shader Tool) - RenderMonkey : http://developer.amd.com/gpu/rendermonkey/Pages/default.aspx#download * Viewer - scarlet : http://shimtools.com/scarlet/download.htm - xnview : http://www.xnview.com/en/downloadwin32.html * DirectX DLL - http://blog.naver.com/masque 에서 카테고리:DirectX DLL - http://blackenginewiki.bl.ohost.de/BlackSnake-Studios/index.php?option=com_content&view=article&id=6&Itemid=8 * 구형그래픽카드 정보 - http://image.dcinside.com/download.php?id=programming&no=29bcc427b48577a16fb3dab004c86b6f25381b65ff9f405849651cf9e3717be52ce87e52459153e0b1eea5c5c0de1e2902a3bebe0fc00792bc66892c6c9385a5dc1d5a3eb356&f_no=0ebcc222c6d328b520a7daa6 * 가마수트라(번역) - http://www.gitiss.org/html/knowledge/list_policy.jsp?catid=0&page=1&insid=1487&compid=7&orderby=6&keyword= * 강좌 - dhpo ware : http://www.dhpoware.com/demos/index.html - Code Sampler : http://www.codesampler.com/dx9src.htm * API Call비용 : http://msdn.microsoft.com/en-us/library/bb172234(VS.85).aspx ===== DirectX SDK를 VS에 추가하기 ===== 1. "도구:옵션:프로젝트 및 솔루션:VC++ 디렉터리:다음 파일의 디렉터리 표시"에서 2. "포함 파일"을 선택 3. 목록중 빈공간 클릭 4. ... 클릭 5. DX가 설치된곳의 "Include"선택 예) "C:\Program Files (x86)\Microsoft DirectX SDK (November 2008)\Include" 6. "라이브러리 파일" 선택 7. 목록중 빈공간 클릭 8. ... 클릭 9. DX가 설치된곳의 "Lib\x86"선택 예) "C:\Program Files (x86)\Microsoft DirectX SDK (November 2008)\Lib\x86" 10. 확인
Posted by 나비:D
:

이런.. ㅅㅂ

ORA-12154: TNS:서비스명를 해석할 수 없습니다

C#에서 오라클 연결시 이런 메시지를 자꾸 토해낸다…

TOAD 접속된다 SQLPLUS 접속 된다..

 

근데 왜 안되지 ㅅㅄㅄㅂ 하루 걸렸다

내가 삽질하다가 회사 선임님한테 도움을 요청했다 GG까지 갈뻔했다….

근데 왠걸 이런 오라클이놈이 폴더구조가 () 괄호가 있으면 안되는거였다………….

폴더 구조가..

2009DB(1) 이런식이였는데 내 폴더 구조에 오라클 니가 왜 딴지냐고!!!!!!!!!!!

주거 주거 죽어버려 오라클따위 죽어버려 ㅠ.ㅠ

Posted by 나비:D
:

JAVA에는 common-dbutils 라는 놈이 DB관련 해서 아주 유용한놈이죠?

C#에서는 SqlHelper 라는 놈이 있습니다.

아래 싸이트 가시면 자세 한 정보를 더 보실수 있습니다.

 

sqlhelper Msdn

http://msdn.microsoft.com/ko-kr/library/ms954827.aspx

 

sqlhelper download 주소

http://www.microsoft.com/downloads/details.aspx?familyid=F63D1F0A-9877-4A7B-88EC-0426B48DF275&displaylang=en

 

TAEYO.NET

아래 가시면 자세한 설명 및 사용법에 대해서도 나옵니다. 영어가 힘드신분들 저를 포함한 ㅋㅋ

http://www.taeyo.net/Columns/View.aspx?SEQ=85&PSEQ=8&IDX=0

Posted by 나비:D
:

http://cfx.codeplex.com/Wiki/View.aspx?title=All-In-One%20Code%20Framework%20Examples

VS2008, VS2010 버전으로 되있음.. 하하하하하하하하 흠..

Examples for COM

COM.png

 

Examples for Data Access

Data Access.png

 

Examples for Office

Office.png

 

Examples for Language

Language.png

 

Examples for Library

Library.png

 

 

Examples for IPC and RPC

IPC and RPC.png

 

Examples for Windows

Windows.png

 

Examples for WinForm

WinForm.png

 

Examples for WPF

WPF.png

 

Examples for XML

XML.png

 

Examples for File System

File System.png

 

Examples for Security

Security.png

 

Examples for Hook

Hook.png

 

Examples for Console

Console.png

 

Examples for Diagnostics

Diagnostics.png

Posted by 나비:D
:
http://msdn.microsoft.com/ko-kr/library/67ef8sbd(VS.80).aspx
Posted by 나비:D
:

class CAL

{

public CAL(int a = 10)

{

         // TODO

}

}

 

public CAL(int a = 10) 문법이 허용되지 않내욤 ㅡㅡ;;

흠.. 이것도 삽질인가 ㅎㅎ

함수(메소드) 오버라이딩 해서 쓰래요!

쩝쩝 나름 좋은 기능인데 ㅋㅋ

Posted by 나비:D
:

출처 : 네이버 지식 선생뉨

class MainApp
{
    static void Main(string[] args)
    {

        byte[] bin_data = ToBytes("Hello"); // 임의로 byte[]을 얻기 위한 부분, 실제 파일에서 읽어들인 byte[]형 값으로 대체하면 됩니다.
        Console.WriteLine(ToHex(bin_data));
    }

    // byte[] 형을 hex 값의 문자열로 출력한다.

static public string ToHex(byte[] bin_data)
    {
        string result = "";
        foreach (byte ch in bin_data)
        {
            result += string.Format("{0:x2} ", ch); // 2자리의 16진수로 출력, [참고] 링크 읽어볼 것
        }

        return result;
    }

    // 문자열을 byte[] 형으로 전환해준다. 테스트를 위해 임의의 byte[]형 데이터를 얻기 위한 메소드

static public byte[] ToBytes(string arg)
    {
        System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
        return encoding.GetBytes(arg);
    }
}

Posted by 나비:D
:

TheDarkSide + bitstream vera mono 합쳐서 셋팅 해놓은 파일이삼~

코딩할때 원츄 폰트 ㅠ.ㅠ 감격

배경도 검은색 배경

ㅋㅋㅋ


Tistory 태그:
Posted by 나비:D
:

BLOG main image
by 나비:D

공지사항

카테고리

분류 전체보기 (278)
Programming? (0)
---------------------------.. (0)
나비의삽질 (5)
Application (177)
SQL (51)
Web (27)
etc. (14)
Omnia (0)
---------------------------.. (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

달력

«   2024/05   »
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
Total :
Today : Yesterday :