분류가 모호한 글2009. 9. 7. 01:15
나도 언젠간 이런 안드로메다 포스팅을 할 내공이 쌓이면 좋겠다. ㅠ.ㅠ

개인적으로 흥미있는 내용은 loop unrolling 이라는 것이다.
loop unwinding / loop unrolling 이라고 부르는데

간단하게 말하자면
한줄짜리 for문을 5줄로 늘리는 것이다.
for (int x = 0; x < 100; x++)
{
    delete(x);
}
for (int x = 0; x < 100; x += 5)
{
    delete(x);
    delete(x+1);
    delete(x+2);
    delete(x+3);
    delete(x+4);
}
단점으로는 레지스터를 많이 사용하고, 코드 크기가 늘어 난다는 점이지만,
파이프라인을 많이 사용하는 요즘 CPU에서는 성능이 향상되는 장점이 있다.

[링크 : http://en.wikipedia.org/wiki/Loop_unwinding]
[링크 : http://b.mytears.org/2008/08/666]

'분류가 모호한 글' 카테고리의 다른 글

콜론, 콤마, 세미콜론 등등등  (0) 2009.11.17
URI URL URN UNC  (0) 2009.10.27
tarball  (0) 2009.07.30
cal / J(줄) 환산  (0) 2009.05.28
개발의 어려움  (4) 2009.05.13
Posted by 구차니
개소리 왈왈/영화2009. 9. 6. 00:27

솔찍히 조금의 감동은 오지만, 그래도 아주 대박이다 라는 생각은 들지 않는 영화였다.
헬렌켈러 영화화 버전같기도 하면서, 약간은 어거지스럽고...
그렇다고 해서 구성이 나쁘다는 것은 아니다.

어쩌면 먼가 이상한 영어(인도식 영어?)로 인해서 감정 이입이 쉽지 않아서 일지도 모르겠지만
생각만큼의 감동은 받지 못했다.

물론 감동을 100만배 받은 분도 있었다.
뒷줄에 앉은 커플중에 아가씨는 막판에 떠나가도록 엉엉엉 울어 버리는 -ㅁ-!

'개소리 왈왈 > 영화' 카테고리의 다른 글

디스트릭트 9 - District 9  (4) 2009.10.18
불꽃처럼 나비처럼 (2009)  (6) 2009.09.26
국가대표 (2009)  (4) 2009.08.18
영화 - 해운대 (2009)  (6) 2009.07.25
기대하지 않았던 대박 - 킹콩을 들다  (4) 2009.07.05
Posted by 구차니
프로그램 사용2009. 9. 5. 11:55
삼바 문서를 긁어 오다가 귀찮아서 한번에 받는 방법을 강구하다가, free 프로그램이 있다길래
한번 사용해 보았다.

Step 1. 실행하면 아래와 같은 화면이 나오고


Step 2. New 버튼을 누르면 아래와 같이 나오는데, URL은 받으려고 하는 페이지의 시작 주소이고
           Depth는 그 페이지의 링크를 몇단계 까지 추적해서 받아오냐는 것을 의미한다.


사용법도 간단하고, 속도도 빠르고 괜찮은 듯 하다.

[발견 : http://hompy.info/535]
[링크 : http://www.spadixbd.com/backstreet/]
Posted by 구차니
samba는 윈도우에서 파일 공유 하듯, 리눅스 - 윈도우 간에 파일 공유 하도록 해주는 녀석이다.
원래 약자로 SMB를 읽기 쉽게 s m b 가 들어가는 단어를 찾다가 samba가 되었다고 하는데...

아무튼 리눅스에서 사용하는 명령어는

smbclient 이녀석은 단일 파일을 조작하는 녀석으로 보인다.
$ smbclient //mypc/yshare "" -N -Tx backup.tar

[링크 : http://linux.die.net/man/1/smbclient]
[링크 : http://linux.die.net/man/7/samba]

$ sudo mount -t cifs //SERVERIP/ /home/me/Desktop/SERVER/ -o user=myusername,password=mypass

cifs 타입으로 마운트 해서 사용도 가능하다.
[링크 : http://ubuntuforums.org/showthread.php?t=280473]

mount시에 //SERVERIP/path가 아닌 SERVERIP/path로 할 경우 아래의 에러가 발생하니 //를 꼭 넣어주도록 하자
CIFS: UNC Path does not begin with // or \\

만약에
mount: bad address 'SERVERNAME'
이라고 에러가 발생하면 SERVERNAME대신 SERVERIP로 해주면된다.

UNC는 Unified Naming Convention 의 약자로고 한다.
[링크 : http://www.terms.co.kr/UNC.htm ]

CIFS는 Common Internet File System 의 약자라고 한다(Interface가 아니군..)
[링크 : http://www.terms.co.kr/CIFS.htm]


Posted by 구차니
개소리 왈왈2009. 9. 4. 17:16
하고 싶고 해보고 싶은건 갈수록 늘어나고
시간은 부족하고, 해야할 건 많고

갈수록 자신감도 줄어들고..

'개소리 왈왈' 카테고리의 다른 글

출장!  (4) 2009.09.08
지름신은 오셨는데 매물이 없다!  (2) 2009.09.07
2009년 8월 31일  (0) 2009.08.31
mabinogi - 비퍼잡기  (2) 2009.08.27
NVidia PhysX 제어판  (0) 2009.08.26
Posted by 구차니
Programming/Java2009. 9. 3. 22:01
java랑 안친해서 전혀 몰랐는데..
이런 충격적인 사실이 있었다니 -ㅁ-!


대충 검색해보니 unsigned - signed 변환에 예외가 많이 생기니까
차라리 전부 signed로 통일해버리면 깔끔해지기는 할듯 하다라는 이야기가 많이 나온다.

2.1.1 Primitive Data Types

Other than the primitive data types discussed here, everything in the Java programming language is an object. Even the primitive data types can be encapsulated inside library-supplied objects if required. The Java programming language follows C and C++ fairly closely in its set of basic data types, with a couple of minor exceptions. There are only three groups of primitive data types, namely, numeric types, character types, and Boolean types.

Numeric Data Types
Integer numeric types are 8-bit byte, 16-bit short, 32-bit int, and 64-bit long. The 8-bit byte data type in Java has replaced the old C and C++ char data type. Java places a different interpretation on the char data type, as discussed below.

There is no unsigned type specifier for integer data types in Java.

Real numeric types are 32-bit float and 64-bit double. Real numeric types and their arithmetic operations are as defined by the IEEE 754 specification. A floating point literal value, like 23.79, is considered double by default; you must explicitly cast it to float if you wish to assign it to a float variable.

2.1.2 Arithmetic and Relational Operators

All the familiar C and C++ operators apply. The Java programming language has no unsigned data types, so the >>> operator has been added to the language to indicate an unsigned (logical) right shift. Java also uses the + operator for string concatenation; concatenation is covered below in the discussion on strings.
[링크 : http://java.sun.com/docs/white/langenv/Simple.doc1.html]

  • byte: The byte data type is an 8-bit signed two's complement integer. It has a minimum value of -128 and a maximum value of 127 (inclusive). The byte data type can be useful for saving memory in large arrays, where the memory savings actually matters. They can also be used in place of int where their limits help to clarify your code; the fact that a variable's range is limited can serve as a form of documentation.

  • short: The short data type is a 16-bit signed two's complement integer. It has a minimum value of -32,768 and a maximum value of 32,767 (inclusive). As with byte, the same guidelines apply: you can use a short to save memory in large arrays, in situations where the memory savings actually matters.

  • int: The int data type is a 32-bit signed two's complement integer. It has a minimum value of -2,147,483,648 and a maximum value of 2,147,483,647 (inclusive). For integral values, this data type is generally the default choice unless there is a reason (like the above) to choose something else. This data type will most likely be large enough for the numbers your program will use, but if you need a wider range of values, use long instead.

  • long: The long data type is a 64-bit signed two's complement integer. It has a minimum value of -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807 (inclusive). Use this data type when you need a range of values wider than those provided by int.

  • float: The float data type is a single-precision 32-bit IEEE 754 floating point. Its range of values is beyond the scope of this discussion, but is specified in section 4.2.3 of the Java Language Specification. As with the recommendations for byte and short, use a float (instead of double) if you need to save memory in large arrays of floating point numbers. This data type should never be used for precise values, such as currency. For that, you will need to use the java.math.BigDecimal class instead. Numbers and Strings covers BigDecimal and other useful classes provided by the Java platform.

  • double: The double data type is a double-precision 64-bit IEEE 754 floating point. Its range of values is beyond the scope of this discussion, but is specified in section 4.2.3 of the Java Language Specification. For decimal values, this data type is generally the default choice. As mentioned above, this data type should never be used for precise values, such as currency.

  • boolean: The boolean data type has only two possible values: true and false. Use this data type for simple flags that track true/false conditions. This data type represents one bit of information, but its "size" isn't something that's precisely defined.

  • char: The char data type is a single 16-bit Unicode character. It has a minimum value of '\u0000' (or 0) and a maximum value of '\uffff' (or 65,535 inclusive).

Data Type Default Value (for fields)
byte 0
short 0
int 0
long 0L
float 0.0f
double 0.0d
char '\u0000'
String (or any object)   null
boolean false

[링크 : http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html ]


'Programming > Java' 카테고리의 다른 글

Java 에서 파일 목록 엳어오기  (0) 2011.10.29
netbeans 에서 코드 자동정렬  (0) 2011.10.29
Java용 폴더 다이얼로그  (0) 2011.10.28
netbeans IDE  (0) 2010.08.23
unit test - 단위 테스트  (0) 2010.08.18
Posted by 구차니


위의 옵션은 1.14.3에도 존재하는 녀석이다.
Shell - alias support를 선택해주면 된다.
Posted by 구차니
게임/마비노기2009. 9. 2. 19:49

낙시 하려고 숫자키 누르다가 반신화 변신할 때..
스킬창에 ctrl - 2,3,4,5,6,7 이런식으로 카테고리를 고르고
1,2,3,4... 로 스킬이 시전되는데

생활은 ctrl - 2
그런데 가끔 반신화 창에서 스킬보다가 창을 닫고 아무생각없이 낙시 한다고 1을 누르면.. 변신한다...

매우.. 가슴이 아프다 ㅠ.ㅠ
Posted by 구차니
Programming/C Win32 MFC2009. 9. 2. 18:09

CEdit 컨트롤의 색상을 변경하기 위해서는 WM_CTLCOLOR을 이용한다.
일단 전역변수로 CBrush COLORREF 변수를 선언해준다.
그리고 나서 클래스 위저드에서 다이얼로그 자체의 WM_CTLCOLOR을 생성해준다.

이 녀석은 그리기 전에 메시지를 가로채서 색상을 설정해주는 역활을 한다고 한다.

OnInitDialog() 에서
    m_redcolor=RGB(255,0,0);                      // red
    m_bluecolor=RGB(0,0,255);                     // blue
    m_textcolor=RGB(255,255,255);                 // white text
    m_redbrush.CreateSolidBrush(m_redcolor);      // red background
    m_bluebrush.CreateSolidBrush(m_bluecolor);    // blue background
이런식으로 브러시와 색상을 미리 설정해준다.

그 다음에, OnCtlColor에서 GetDlgCtrlID()에 의해 분기를 쳐주면서
원하는 컨트롤의 ID에 연결해주면 원하는 색상으로 그려진다.

    pDC->SetBkColor(m_bluecolor);
    pDC->SetTextColor(m_textcolor);
    hbr = (HBRUSH) m_bluebrush;

위의 내용을 사용하면되며,
    SetBKColor()은 배경색상(기본값은 흰색)
    SetTextColor()은 글씨색상(기본값은 검은색)
을 변경해주게 된다.

브러시를 리턴함으로, 이 브러시를 이용하여 실제로 변경한 색상으로 그려주게 된다.


아래는 OnCtlColor의 기본 템플릿이다.
클래스위저드가 생성하면 // TODO 사이의 내용이 없으므로 불편하다.
HBRUSH CBarcodeDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	
	// TODO: Change any attributes of the DC here
	switch(nCtlColor)
	{
		case CTLCOLOR_EDIT:
		case CTLCOLOR_MSGBOX:
			switch (pWnd->GetDlgCtrlID())
			{
				default:
					break;
			}
			break;

		case CTLCOLOR_STATIC:
			switch (pWnd->GetDlgCtrlID())
			{
				default:
					break;
			}
			break;

		default:
			break;
	}
	
	// TODO: Return a different brush if the default is not desired
	return hbr;
}


[링크 : http://www.codeguru.com/Cpp/controls/editctrl/backgroundcolor/article.php/c3929/#more]
[링크 : http://mind444.tistory.com/64]
Posted by 구차니
프로그램 사용/vi2009. 9. 2. 18:01
:set ci
혹은
/\c[검색어]

case ignore 에서 c 인가보다.
근데.. 막상해보니 case insensitive 한데?

[링크 : http://unixjunkie.blogspot.com/2006/03/ignore-case-in-vim-searches.html]



:set ignorecase
:set noignorecase

로 토글한다고 한다.

[링크 : http://www.tech-recipes.com/rx/406/perform-case-insensitive-searches-in-vi-or-vim/]




단어단위로 검색할경우(whole word match)
/\<검색어\>

[링크 : http://www.held.org.il/blog/?p=129]

'프로그램 사용 > vi' 카테고리의 다른 글

vi auto indent  (0) 2009.10.06
busybox 1.14.3 vi editor  (0) 2009.09.16
VI에 ctags 사용하기  (0) 2009.07.21
VI syntax highlight 사용하기  (0) 2009.05.26
VI - hex mode  (2) 2009.03.03
Posted by 구차니