Posted
Filed under Linux
linux에서 특정 문자열을 치환하는방법에는 여러가지가 있는데 

나는 다음과 같은 명령어로 해보았다.

(치환 결과를 다른 파일에 저장해야 할 때)

$ cat {SOURCE_FILE_NAME} | sed 's/{ORIGINAL}/{CHANGE}/g' > {NEW_FILE_NAME}

(치환 결과를 원본에 저장할때)

$ sed -i 's/{ORIGINAL}/{CHANGE}/g' {FILE_NAME}


{ORIGINAL} : 원본 문자열
{CHANGE}  : 바뀔 문자열


p.s {} 는 보기 편하라고 넣은거지 진짜로 저 괄호로 감싸서 넣지 마라.
2010/11/19 05:14 2010/11/19 05:14
Posted
Filed under Htm&Javascript
[원문] - http://www.mcfedries.com/javascript/timer.asp

<SCRIPT LANGUAGE = "JavaScript"> <!-- var secs var timerID = null var timerRunning = false var delay = 1000 function InitializeTimer() { // Set the length of the timer, in seconds secs = 10 StopTheClock() StartTheTimer() } function StopTheClock() { if(timerRunning) clearTimeout(timerID) timerRunning = false } function StartTheTimer() { if (secs==0) { StopTheClock() // Here's where you put something useful that's // supposed to happen after the allotted time. // For example, you could display a message: alert("You have just wasted 10 seconds of your life.") } else { self.status = secs secs = secs - 1 timerRunning = true timerID = self.setTimeout("StartTheTimer()", delay) } } //--> </SCRIPT>
To use this script, copy everything between and including the <SCRIPT> and </SCRIPT> tags and insert it on your page between the </HEAD> and <BODY> tags.

The following line sets the length, in seconds, of the timer:

secs = 10

The code decreases the "secs" variable by 1 each second. When "secs" gets to 0, the clock is stopped and that's when you do whatever it is you want to do once the timer is done (such as display a message or send the user to another page).

In the example above, I use a simple form button to start the timer (it also displays the countdown in the status bar). You could also start the timer (that is, run the InitializeTimer() function) automatically by adding the following to the <BODY> tag:

onLoad="InitializeTimer()"

2010/11/15 01:46 2010/11/15 01:46
Posted
Filed under Htm&Javascript

microsoft jquery cdn

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>


<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js" type="text/javascript"></script>

2010/11/15 01:16 2010/11/15 01:16
Posted
Filed under asp,asp.net

[원문] - http://flashcafe.org/?document_srl=3809

이번 시간엔 배열에 관해 살펴보도록 하겠습니다.


VBScript에서도 다른 언어와 배열을 선언하여 사용할 수가 있습니다. 보통 하나의 변수에 하나의 값을 할당하여 이용하게 되는데 배열은 같은 변수에 하나 이상의 값을 저장하고자 할 때 사용하는 것입니다. 즉, 하나의 변수에 둘 이상의 값을 가질 수도 있는데 이러한 경우 배열을 이용하게 됩니다. 이러한 배열의 값에 접근하는 경우에는 변수명(지수)과 같은 형태로 개별적인 값에 접근하게 됩니다.


배열은 1차원 배열 뿐 아니라 2차원, 3차원 배열도 이용할 수 있습니다. 하지만, 3차원 이상만 되어도 이해하기 힘드므로 특별한 이유가 아니라면 너무 높은 다차원 배열의 이용은 피하는 것이 좋습니다. (사실 다차원 배열 만들다보면 만든 사람 본인도 헷갈린다고 합니다. ^^)


배열은 변수를 선언할 때와 마찬가지로 Dim문을 이용하여 선언하고 변수명 뒤에 배열의 크기를 지정해주면 됩니다. 또한, 스크립트의 실행 도중에 배열의 크기와 내용을 변경할 수 있는데 이 때는 ReDim문도 함께 사용하여 선언합니다. 이러한 경우 이전의 배열 내용을 보존하여 추가로 공간을 확장하고자 할 때는 Preserve 문을 이용합니다. 설명만 들자니 좀 밋밋하죠? 자, 그럼 배열 예제를 보면서 다시 한번 되집어보죠.






<% @LANGUAGE = VBScript %>
<%
Dim jewel()
ReDim jewel(3)

jewel(0) = "pearl"
jewel(1) = "crystal"
jewel(2) = "jade"
jewel(3) = "sapphire"
%>
<html>
<head><title>배열 이해하기</title>
</head>
<body>
** 배열 jewel(3)의 내용 ** <br>
<% =jewel(0) %>, <% =jewel(1) %>, <% =jewel(2) %>, <% =jewel(3) %>


<%
ReDim Preserve jewel(5)
jewel(4) = "emerald"
jewel(5) = "diamond"
%>
<br>
** 기존의 배열에 내용을 추가한 jewel(5)의 내용 ** <br>
<% =jewel(0) %>, <% =jewel(1) %>, <% =jewel(2) %>, <% =jewel(3) %> <br>
<% =jewel(4) %>, <% =jewel(5) %>
</body>
</html>







위 예제를 보면 Dim 문과 ReDim 문으로 배열 jewel을 선언하고 각각의 저장소에 값을 할당했습니다. jewel(3)이라고 선언했기 때문에 0부터 3까지 4개의 저장 공간이 할당되죠. 새로운 내용을 추가하고 싶을 때는 ReDim Preserve 문을 통해 기존의 배열 jewel에 두 개의 저장 공간이 추가되었습니다.


예제를 보니까 이해가 쉽지 않나요? 참고로 한가지만 더 얘기하자면 VB 스크립트에서는 가변형 변수를 지원하기 때문에 배열에 있어서도 가변 형태의 테이터 타입을 가진 배열을 이용할 수 있답니다. 예를 들어 다음과 같이 여러가지 데이터 타입을 혼용한 배열을 이용할 수 있습니다.







Dim varArray(3)


varArray(0) = "asp"
varArray(1) = 100
varArray(2) = True
varArray(3) = 123.456






지금까지 변수와 연산자, 그리고 배열에 관해 알아보았습니다. 그럼 요걸 바탕으로 해서 제어문에 들어가 보도록 하죠. 즐거운 하루 되세요!!!

2010/11/11 04:16 2010/11/11 04:16
Posted
Filed under asp,asp.net
 [출처] - http://mutant.tistory.com/78

"응답 개체 오류 'ASP 0251 : 80004005'

Response 버퍼 제한 초과됨 test.asp, 줄 0

ASP 페이지를 실행하여 Response 버퍼의 구성된 제한이 초과되었습니다."


1.       인터넷 정보서비스 (IIS) 관리자를 실행 합니다.

2.       IIS에 컴퓨터 이름(로컬 컴퓨터)에서 속성을 누릅니다.

3.       인터넷 정보 서비스 탭에 메타베이스 직접 편집 허용에 체크하고 확인 합니다.

4.       C:\Windows\System32\Inetsrv폴더에 Metabase.xml파일을 메모장으로 엽니다.

5.       AspBufferingLimit 값을 수정합니다. (기본 4메가로 되어 있습니다. 이때 단위는 바이트 단위 입니다.) <= 다운로드 관련

6.       AspMaxRequestEntityAllowed 값을 수정 합니다. (기본 200kb로 되어 있습니다. 이때 단위는 바이트 단위 입니다.) <= 업로드 관련

7.       저장한 뒤 3번에 체크한 부분을 체크해제 하고 확인 합니다.

8.   인터넷 정보서비스(IIS) 를 재시작 합니다.

2010/11/11 04:14 2010/11/11 04:14
Posted
Filed under Htm&Javascript
function CheckValidUrl(strUrl)
{
        var RegexUrl = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
        return RegexUrl.test(strUrl);
}
2010/11/08 02:52 2010/11/08 02:52
Posted
Filed under Htm&Javascript
function trim(str) {
 return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
String.prototype.trim = function() {
    return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
2010/11/08 02:51 2010/11/08 02:51
Posted
Filed under PHP

in_array

(PHP 4, PHP 5)

in_array값이 배열 안에 존재하는지 확인

설명

bool in_array ( mixed $needle , array $haystack [, bool $strict ] )

haystack 에서 needle 을 찾습니다.

인수

needle

찾을 값.

Note: needle 이 문자열이면, 대소문자를 구분하여 비교합니다.

haystack

배열.

strict

세번째 인수 strictTRUE로 설정하면, in_array() 함수는 haystack 안에서 needle자료형도 확인합니다.

반환값

needle 을 배열에서 찾으면 TRUE를, 아니면 FALSE를 반환합니다.

변경점

버전 설명
4.2.0 needle 이 배열일 수 있습니다.

예제

Example #1 in_array() 예제

<?php
$os
= array("Mac", "NT", "Irix", "Linux");
if (
in_array("Irix", $os)) {
    echo
"Got Irix";
}
if (
in_array("mac", $os)) {
    echo
"Got mac";
}
?>

in_array()가 대소문자를 구분하므로 두번째 조건은 실패하고, 위 프로그램은 다음을 출력합니다:

Got Irix

Example #2 in_array()에 strict 예제

<?php
$a
= array('1.10', 12.4, 1.13);

if (
in_array('12.4', $a, true)) {
    echo
"'12.4' found with strict check\n";
}

if (
in_array(1.13, $a, true)) {
    echo
"1.13 found with strict check\n";
}
?>

위 예제의 출력:

1.13 found with strict check

Example #3 in_array()에 needle로 배열

<?php
$a
= array(array('p', 'h'), array('p', 'r'), 'o');

if (
in_array(array('p', 'h'), $a)) {
    echo
"'ph' was found\n";
}

if (
in_array(array('f', 'i'), $a)) {
    echo
"'fi' was found\n";
}

if (
in_array('o', $a)) {
    echo
"'o' was found\n";
}
?>

위 예제의 출력:

  'ph' was found
  'o' was found
2010/11/08 02:43 2010/11/08 02:43
Posted
Filed under PHP
ErrorDocument 404 /404.php
2010/11/08 01:00 2010/11/08 01:00