Posted
Filed under Htm&Javascript

if( navigator.appName.indexOf("Microsoft") > -1 ) // IE?

{

    if( navigator.appVersion.indexOf("MSIE 6") > -1) // IE6?

    {

        // code

   }

    else if( navigator.appVersion.indexOf("MSIE 7") > -1) // IE7?  

    {

        // code

    }

}

2010/04/16 01:41 2010/04/16 01:41
Posted
Filed under Htm&Javascript

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  

<html>  

<head>  

<title> eyes of siche </title>  

</head>  

 

<body>  
<script type="text/javascript">  

<!--  

    function setPng24(obj) {  

       obj.width=obj.height=1;  

       obj.className=obj.className.replace(/\bpng24\b/i,'');  

       obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+obj.src+"',sizingMethod='image');" 
        obj.src='';  
        return '';  

    }  

//-->  

</script>  

<style type="text/css">  

    body { background: yellow; }  

    .png24 { tmp: expression(setPng24(this)); }  

</style>  

<img src="http://eos.pe.kr/ex/png/png.png" class="png24">  

</body>  

</html>

2010/04/16 01:36 2010/04/16 01:36
Posted
Filed under Action Script


ac3.0 에서 포커스를 설정 하기 위해서 스테이지에 있는 포커스 타겟을 지정 해 줘야 한다.

stage.focus = DisplayObject

2010/04/15 14:41 2010/04/15 14:41
Posted
Filed under Action Script
[원문] http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/String.html
 actionscript 3.0작업중 trim 관련 함수를 찾아 보다 . 라이브러리에서 trim, replace  함수 구현 되어 있는
것을 발견 하게 되었음 .

package {
    import flash.display.Sprite;

    public class StringExample extends Sprite {
        public function StringExample() {
            var companyStr:String = new String("     Company X");
            var productStr:String = "Product Z Basic     ";
            var emptyStr:String = " ";
            var strHelper:StringHelper = new StringHelper();

            var companyProductStr:String = companyStr + emptyStr + productStr;
            trace("'" + companyProductStr + "'");    // '     Company X Product Z Basic     '

            companyProductStr = strHelper.replace(companyProductStr, "Basic", "Professional");
            trace("'" + companyProductStr + "'");    // '     Company X Product Z Professional     '

            companyProductStr = strHelper.trim(companyProductStr, emptyStr);
            trace("'" + companyProductStr + "'");    // 'Company X Product Z Professional'
        }
    }
}

class StringHelper {
    public function StringHelper() {
    }

    public function replace(str:String, oldSubStr:String, newSubStr:String):String {
        return str.split(oldSubStr).join(newSubStr);
    }

    public function trim(str:String, char:String):String {
        return trimBack(trimFront(str, char), char);
    }

    public function trimFront(str:String, char:String):String {
        char = stringToCharacter(char);
        if (str.charAt(0) == char) {
            str = trimFront(str.substring(1), char);
        }
        return str;
    }

    public function trimBack(str:String, char:String):String {
        char = stringToCharacter(char);
        if (str.charAt(str.length - 1) == char) {
            str = trimBack(str.substring(0, str.length - 1), char);
        }
        return str;
    }

    public function stringToCharacter(str:String):String {
        if (str.length == 1) {
            return str;
        }
        return str.slice(0, 1);
    }
}

StringHelper 클래스의 함수들이 static 타입이 아님으로 이렇게 사용 하면 오류가 발생 한다.
static타입으로 선언후 사용 하자 .



class StringHelper {
 
  public static function replace(str:String, oldSubStr:String, newSubStr:String):String {
   return str.split(oldSubStr).join(newSubStr);
  }
 
  public static function trim(str:String, char:String):String {
   return trimBack(trimFront(str, char), char);
  }
 
  public static function trimFront(str:String, char:String):String {
   char = stringToCharacter(char);
   if (str.charAt(0) == char) {
    str = trimFront(str.substring(1), char);
   }
   return str;
  }
 
  public static function trimBack(str:String, char:String):String {
   char = stringToCharacter(char);
   if (str.charAt(str.length - 1) == char) {
    str = trimBack(str.substring(0, str.length - 1), char);
   }
   return str;
  }
 
  public static function stringToCharacter(str:String):String {
   if (str.length == 1) {
    return str;
   }
   return str.slice(0, 1);
  }
 }

2010/04/15 13:08 2010/04/15 13:08
Posted
Filed under C#
사용자 삽입 이미지





















System.Diagnostics.Process.Start("shutdown.exe","-s");
optionr값 은 보고 적당히 설정 하면 된다.
2010/04/09 20:14 2010/04/09 20:14
Posted
Filed under Htm&Javascript
[원문]:http://sulfur.pe.kr/web/javasc/javas004.html

<noscript> 태그는 브라우저에서 <script> 태그가 작동하지 않을 때 대신 내보낼 내용을 담기 위해 쓰인다.

즉, 방문객이 브라우저에서 자바스크립트가 실행되도록 설정해 두었다면 자바스크립트는 실행되고 <noscript> 태그 안의 내용은 나오지 않는다. 하지만 자바스크립트 기능을 꺼두고 있다면 자바스크립트가 실행되지 않는 대신에 <noscript> 태그 안의 내용이 출력된다.


<script type="text/javascript">
document.write('안녕하십니까?')
</script>
<noscript><p>자바스크립트를 꺼두셨군요.</p></noscript>

위의 예에서, 보통은 자바스크립트가 실행되기 때문에 화면에는 다음 문장이 나올 것이다.

안녕하십니까?

하지만 자바스크립트가 실행되지 않는다면 화면에는 다음 문장이 나오게 된다.

자바스크립트를 꺼두셨군요.

브라우저에서 자바스크립트 기능을 꺼두고 쓰는 사람도 있기 때문에 자바스크립트를 쓴 곳에는 <noscript> 태그를 써서 자바스크립트가 필요하다는 걸 알려주는 게 좋다.


<p><a href="#" onclick="window.open('photo.html'; return false">사진 보기</a></p>
<noscript><p>사진 보기를 하려면 자바스크립트가 필요합니다.</p></noscript>

위 예에서는 자바스크립트를 써서 사진 보기 창을 뜨도록 하고 있으므로, 자바스크립트를 꺼두면 새 창을 뜨게 할 수 없기 때문에 사진을 볼 수 없다. 만약 <noscript> 태그를 쓰지 않는다면 모르는 사람은 왜 사진 보기가 안 되는 걸까 의아해 할지도 모른다. 하지만 <noscript> 태그를 써서, 위와 같이 사진을 보기 위해서는 자바스크립트가 필요하다는 걸 알려준다면 자바스크립트 기능을 꺼두었기 때문에 사진 보기가 안 된다는 걸 알고 사진을 보기 위해 자바스크립트 기능을 켜게 될 것이다.

위 코드의 결과는 다음과 같다. 브라우저에서 자바스크립트 기능을 꺼서 어떻게 보이는지 직접 확인해 보기 바란다.

사진 보기

참고로 photo.html 파일은 만들지 않았으므로 사진 보기를 눌러도 새 창은 뜨지 않을 것이며, <noscript> 태그 안의 글씨는 현재 이곳의 CSS 설정에 따라 크기나 색깔이 다르게 보일 수도 있다.

<noscript> 태그 안의 내용은 웹 문서의 내용과는 상관 없는 것이므로 웹 문서의 내용과는 다르게 보이도록 하는 게 좋다. 예를 들어, CSS에서 설정을 다음과 같이 해 두면 <noscript> 태그 안의 글씨는 돋움 글꼴에 본문 글씨보다 작게 녹색으로 보이게 되므로 웹 문서에 쓰인 글씨가 검은 색이면 서로 구별될 것이다.


noscript { font-family: 돋움, Dotum; 
           font-size: 75%; 
           color: green; }

끝으로 한 가지 주의사항은, <noscript> 태그는 <p> 태그를 감쌀 수 있지만 그 반대는 되지 않고, <noscript> 태그 안에 들어 있는 글씨를 <p> 같은 형님 태그로 감싸주지 않으면 웹 표준 검사에서 오류가 난다는 것이다.

2010/04/09 18:58 2010/04/09 18:58
Posted
Filed under Action Script

'allowFullScreen', 'false',

'allowScriptAccess','sameDomain',

'movie', 'passtest',

'salign', "

); //end AC code

}

</script>

<noscript>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="passtest" align="middle">

<param name="allowScriptAccess" value="sameDomain" />

<param name="allowFullScreen" value="false" />

<param name="movie" value="passtest.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="passtest.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="passtest" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

</object>

</noscript>

Assuming you want to pass the variable kittens=wonderful, because they are, this needs to be changed to (note changes in bold text):

<script language="javascript">

if (AC_FL_RunContent == 0) {

alert("This page requires AC_RunActiveContent.js.");

} else {

AC_FL_RunContent(

'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',

'width', '550',

'height', '400',

'src', 'passtest',

'quality', 'high',

'pluginspage', 'http://www.macromedia.com/go/getflashplayer',

'align', 'middle',

'play', 'true',

'loop', 'true',

'scale', 'showall',

'wmode', 'window',

'devicefont', 'false',

'id', 'passtest',

'bgcolor', '#ffffff',

'name', 'passtest',

'menu', 'true',

'allowFullScreen', 'false',

'allowScriptAccess','sameDomain',

'movie', 'passtest?kittens=wonderful',

'salign', "

); //end AC code

}

</script>

<noscript>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="passtest" align="middle">

<param name="allowScriptAccess" value="sameDomain" />

<param name="allowFullScreen" value="false" />

<param name="movie" value="passtest.swf?kittens=wonderful" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="passtest.swf?kittens=wonderful" quality="high" bgcolor="#ffffff" width="550" height="400" name="passtest" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

</object>

</noscript>

The key bit not mentioned in the documentation is the first change in the first script block. The querystring needs to be appended to the movie (not SRC) parameter, and without the .swf in the filename.

Once this is done the variable kittens will now be available as _root.kittens. You can append several variables as you would in HTML (?thisvar=that&theother=somethingelse), and all must be URL encoded.

And that's it. Normal cats photos / train company problem posts will resume immediately.

Tags: , , , ,

2010/04/09 18:52 2010/04/09 18:52
Posted
Filed under PHP

[원문] - http://blog.daum.net/_blog/BlogView.do?blogid=0NClv&articleno=62&categoryId=#ajax_history_home

===========테이블 생성===========================================

CREATE TABLE userdb (

name CHAR(8),

id VARCHAR(10) NOT NULL,

email VARCHAR(40),

sex CHAR(1),

PRIMARY KEY(id)

)


INT : 정수

CHAR (M) : 문자의 수가 M개인 문자열

VARCHAR (M) : 문자의 수가 최대 M개인 문자열

TEXT : 문자의 수가 최대 65535개인 문자열



==============테이블 복사======================================

   => 테이블 복사

CREATE TABLE userdb2 AS SELECT * FROM userdb

 

=>테이블의 지정한 필드만 복사

CREATE TABLE userdb3 AS SELECT name, id FROM userdb


2010/04/09 13:07 2010/04/09 13:07
Posted
Filed under Action Script
function closeBtn(e:Event):void {
    var request:URLRequest = new URLRequest("javascript:window.close()");
    navigateToURL(request);

    trace("close");
}
----------------------------------------------------------------------------
function closeBtn(e:Event):void {
    import flash.external.ExternalInterface;
    ExternalInterface.call("window.close","");
}

----------------------------------------------------------------------------
exit_btn.addEventListener(MouseEvent.CLICK,clickButton);

function clickButton(myevent:MouseEvent):void{
   var myurl:String="javascript:self.close()";
    var mywindow:String="self";
   ExternalInterface.call("closewindow",myurl,mywindow);
}

<script language="javascript">
function closewindow (){
self.close();
}
</script>
---------------------------------------------------------------------------------

2010/04/07 20:01 2010/04/07 20:01
Posted
Filed under PHP
[원문] - http://codeigniter-kr.org/tip/view/236/page/3/

파일업로드를 어떻게 처리할까 하다가 좀 센스있게 보이려고 SWFUpload를 쳐다봤는데요
jQuery에도 다중업로드를 지원하는 plugin들이 많이 있길래 그중 하나를 적용해봤습니다~

uploadify(http://www.uploadify.com) 라는 플러그인인데요
다중업로드를 지원하고 파일찾기 이미지 등 다양하게 커스터마이징이 간으합니다
progress bar가 적용 되어있어서 퍼센테이지로도 보여지구요

근데 CI랑 완전 독립을 시키려고 하니 문제가 좀 있던거 같아요.. 구버전은 CI해외포럼에서 연동방법들이
다양하게 있었는데 최신버전은 적용된게 없더군요

별수없이 파일 업로드만 처리하는 파일을 따로 두고(uploadify.php) 업로드만 맞겼습니다

01.<input type="file" id="letter_banner_img" />
02.  
03.$("#letter_banner_img").uploadify({
04.        'uploader'       : '/js/uploadify/uploadify.swf', // 그냥 두시면 됩니다
05.        'script'         : '/js/uploadify/uploadify.php', // 파일업로드를 실제로 처리할 php 파일입니다.
06.        'cancelImg'      : '/js/uploadify/cancel.png', // 이것도 전 그냥 쓰구요
07.        'folder'         : '/files/letter/imgs', // 파일이 업로드될 path 정보입니다
08.        'buttonImg'      : '/img/admin/file_btn.png', // 버튼이미지는 제가 만든건데 이미비를 변경하셨다면 아래 width와 height를 이미지 크기로 잡아주셔야 합니다
09.        'width'          : 80, // 버튼이미지의 가로크기
10.        'height'         : 20, // 버튼이미지의 세로크기
11.        'wmode'          : 'transparent',
12.        'queueID'        : 'letter_img2', // 큐를 보여줄 곳을 지정합니다 div id="letter_img2" 이런식으로 해두면 그 안쪽에 큐 정보를 보여줍니다(프로그래스바)
13.        'method'         : 'post', // get, post를 모두 지원하고 default는 post랍니다
14.        'scriptAccess' : 'always'
15.        'scriptData'     : {
16.                                'tid': $('#tid').val(),
17.                                'fieldName' : 'banner_img',
18.                                'already_exists' : $("#before_banner_img").val(),
19.                                'type' : 'letter_banner'
20.                            }, // 이부분은 제가 추가로 넘겨줄 변수의 키와 값입니다.. 사용할때는 uplodify.php 파일에서 $_REQUEST['tid'] 처럼 사용됩니다
21.        'fileExt'         : '*.jpg;*.jpeg;*.png;*.gif', // 허용 확장자 목록입니다
22.        'auto'           : true, // 파일을 선택하자마자 전송을 시작합니다.. false로 해두면 기다리구요 전송시켜줄 버튼과 이벤트가 필요하게 됩니다
23.        'multi'          : false, // 여러개 파일을 업로드 하고싶을때 true로 변경하시면 됩니다
24.        onComplete         : function(event, queueID, fileObj, response, data) {
25.              
26.            $.post(
27.                "/admin/letter/upload_file_input",
28.                {
29.                    'ajax' : "true",
30.                    'file_path':obj.newTargetPath,
31.                    'file_name':obj.newName,
32.                    'tid':obj.tid,
33.                    'type':obj.type
34.                },
35.                function(data){
36.  
37.                }
38.            ); // 원래는 uplodify.php에서 해야하나, 제 실력이 미흡하여 업로드 파일을 별도로 제작했더니 ci의 편의시설을 이용하지 못하게 되서.. 넘어온 값을 다시 ajax를 사용해서 db에 업데이트 합니다;
39.             
40.        },
41.        onError: function(a, b, c, d){
42.            upload_file_error(a, b, c, d);
43.        }
44.    });

uploadify.php 파일의 내용입니다 그냥 업로드 하고 각종 필요값만 json으로 반환합니다
01.<?php
02.if (!empty($_FILES)) {
03.    $tempFile = $_FILES['Filedata']['tmp_name'];
04.    $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
05.    $targetFile str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
06.      
07.    $extension = pathinfo($targetFile, PATHINFO_EXTENSION); 
08.    $new_name = $_REQUEST['fieldName']."_".$_REQUEST['tid'].".$extension";
09.    $newTargetFile str_replace('//','/',$targetPath) . $new_name;
10.      
11.    if($_REQUEST['already_exists']) unset($_REQUEST['already_exists']);
12.      
13.    move_uploaded_file($tempFile,$newTargetFile);
14.    $return['newTargetPath'] = $_REQUEST['folder'] . '/'.$new_name;
15.    $return['newName'] = $new_name;
16.    $return['tid'] = $_REQUEST['tid'];
17.    $return['type'] = $_REQUEST['type'];
18.    echo json_encode($return);
19.}
20.?>
2010/04/07 09:53 2010/04/07 09:53