'프로그래밍 언어'에 해당되는 글 52건


key_str = "";
var str_in:String = "";
key_array = new Array();
data_array = [];
str = "";
function analysis (space:String, obj:XML)
{
        var n:Number = 0;
 
        space += "\t";
        while (obj.childNodes[n])
        {
   if (obj.childNodes[n].attributes.depth != "" && obj.childNodes[n].attributes.depth != null)
   {
    trace(space + "depth : " + obj.childNodes[n].attributes.depth);

    if (obj.childNodes[n].attributes.id != "" && obj.childNodes[n].attributes.id != null)
    {
     key_array[obj.childNodes[n].attributes.depth] = obj.childNodes[n].attributes.id;
     trace (space + "id : " + obj.childNodes[n].attributes.id);
     str_in = joinId(obj.childNodes[n].attributes.depth);
     data_array[str_in] = [];
     trace(space + "in : " + str_in);
    }
   }
   
   if (obj.childNodes[n].nodeName != "" && obj.childNodes[n].nodeName != null)
   {
    if (obj.childNodes[n].firstChild.nodeValue != "" && obj.childNodes[n].firstChild.nodeValue != null)
    {
     trace(obj.childNodes[n].attributes.depth + " k1");
     var nname:String = obj.childNodes[n].nodeName;
     data_array[str_in][nname] = obj.childNodes[n].firstChild.nodeValue;
     trace("data : " + str_in + " - " + nname + " - " + data_array[str_in][nname]);
    }
   }

            trace (space + obj.childNodes[n].nodeName + " - " + obj.childNodes[n].firstChild.nodeValue);
            str +=space + obj.childNodes[n].attributes.id +"\n"
            if (obj.childNodes[n])
            {
             analysis (space, obj.childNodes[n]);
     }
            n++;
        }
}

function joinId(n)
{
 var iid = "";
 for (i = 0; i <= n; i++)
 {
  if (key_array[i])
  {
   if (i != n)
   {
    iid += key_array[i] + "_";
   }
   else
   {
    iid += key_array[i];
   }
  }
 }
 return iid;
}

//
// recursive function to print out the contents of an array similar to the PHP print_r() funciton
//
function print_a( obj, indent ) {
 if (indent == null) indent = "";
 var out = "";
 for ( item in obj ) {
  if (typeof( obj[item] ) == "object" )
   out += indent+"[" + item + "] => Object\n";
  else
   out += indent+"[" + item + "] => " + obj[item]+"\n";
  out += print_a( obj[item], indent+"   " );
 }
 return out;
}

function display( obj, indent ) {
 if (indent == null) indent = "";
 var out = "";
 var iname = "";
 for ( item in obj ) {
  if (typeof( obj[item] ) == "object" )
  {
   iname = item;
   trace("this is first : " + iname.substring(0, 1));
   if (obj[iname]["enabled"] == "true")
   {   
    _root[iname].gotoAndPlay(2);
    //_root[iname]._alpha = 100;
    trace(item + " hi " + obj[iname]["enabled"]);
   }
   else
   {
    _root[iname].gotoAndStop(1);
    //_root[iname]._alpha = 10;
    //_root["S_0_0_0_0"]._alpha = 100;
    trace(iname + " bye " + obj[iname]["enabled"]);
   }
  }
  out += print_a( obj[item], indent+"   " );
 }
 trace("");
 trace(out);
}

var menu_xml:XML = new XML ();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function (success)
{
 if (success)
 {
        analysis ("", this.childNodes[0]);
  //trace(this.childNodes[0]);
  //trace(data_array.length);
  //trace( print_a( data_array) );
  //trace(data_array["S_0_0_0"]["title"]);

  display(data_array);
 }
};
menu_xml.load ("tree3.xml");

'프로그래밍 언어 > FLASH, FLEX' 카테고리의 다른 글

flex script source 추가  (0) 2008.04.07
FLEX 에서 스크롤  (0) 2008.04.04
Complete Flex 3 documentation  (0) 2008.04.03
.air web 설치/배포  (0) 2008.04.03
foreach 문  (0) 2007.12.27
블로그 이미지

용병

,
 // foreach
 for (var key in xmlNodeArray)
 {
  var value = xmlNodeArray[key];
  trace(key + " : " + value);
 }

'프로그래밍 언어 > FLASH, FLEX' 카테고리의 다른 글

flex script source 추가  (0) 2008.04.07
FLEX 에서 스크롤  (0) 2008.04.04
Complete Flex 3 documentation  (0) 2008.04.03
.air web 설치/배포  (0) 2008.04.03
플래쉬 임시  (0) 2007.12.31
블로그 이미지

용병

,

   // MSN 로그인시
   function ev_Login()
   {
      global $t;
   }

   // after -> receive and process a message from all the open servers
   function ev_Rock()
   {
      global $t;
   }

   // 사용자가 상태를 변경시 활성화
   function ev_StatusChange($p_who, $p_avatar)
   {
      /*
      $p_who     = $mail $nick $status
      $p_avatar  = The MSNC1 urlencoded block with the avatar

      -------------------------------------------------
      email@email.com NICK NLN
      -------------------------------------------------
      0
      -------------------------------------------------
      */
   }

   // 사용자가 문자를 보낼경우 활성화
   function ev_ChatMessage($p_session, $p_cmd, $p_message)
   {
      global $t;

      /*
      $p_session  = chat session
      $p_cmd      = the full command send by the server
      $p_message  = message received

      -------------------------------------------------
      session no
      -------------------------------------------------
      Chat Message....
      1
      -----------------------
      MSG $email $nick $byte(int)

      -----------------------
      MIME-Version: 1.0
      Content-Type: text/plain; charset=UTF-8
      X-MMS-IM-Format: FN=굴림; EF=; CO=0; CS=81; PF=32

      this is the message
      */

      /*
      echo "Chat Message....\n";
      print_r($p_session);
      echo "\n-----------------------\n";
      print_r($p_cmd);
      echo "\n-----------------------\n";
      print_r($p_message);
      echo "\n\n";
      */
   }

   // 사용자가 채팅창에 조인시
   function ev_ChatJoin($p_session, $p_session2, $p_who)
   {
      /*
      $p_session  = chat session
      $p_session2 = chat session (again)
      $p_who      = $name $mail
      */

      /*
      echo "Chat Join....\n";
      print_r($p_session);
      echo "\n-----------------------\n";
      print_r($p_who);
      echo "\n\n";
      */
   }

   // 사용자가 채팅창을 떠날경우 활성화
   function ev_ChatLeave($p_session, $p_who)
   {
      /*
      $p_session  = chat session
      $p_who      = the mail of the user leaving
      $p_cmd      = the full command sent by the server

      -------------------------------------------------
      session no
      -------------------------------------------------
      BYE email@email.com
      -------------------------------------------------
      */

      /*
      echo "Chat Leave....\n";
      print_r($p_session);
      echo "\n-----------------------\n";
      print_r($p_who);
      echo "\n\n";
      */
   }

'프로그래밍 언어 > php' 카테고리의 다른 글

파일 사이즈 형식 변경  (0) 2017.03.08
memcached 관련  (0) 2016.12.23
libcurl Emulator  (0) 2007.12.06
php header_sent  (0) 2007.11.27
array_combine php5 -> php4  (0) 2007.05.07
블로그 이미지

용병

,
php 에 curl 이 설치돼지 않았을 경우를 위한 class
http://code.blitzaffe.com/pages/phpclasses/category/52/fileid/7


Provides a pure-PHP implementation of the PHP CURL extension, for use on systems which do not already have the CURL extension installed. It emulates all of the curl_* functions normally provided by the CURL extension itself.

'프로그래밍 언어 > php' 카테고리의 다른 글

memcached 관련  (0) 2016.12.23
mzk - event  (0) 2007.12.15
php header_sent  (0) 2007.11.27
array_combine php5 -> php4  (0) 2007.05.07
배열 컬럼 정렬  (0) 2007.03.15
블로그 이미지

용병

,

설명

bool headers_sent ([ string &$file [, int &$line ]] )

Checks if or where headers have been sent.

You can't add any more header lines using the header() function once the header block has already been sent. Using this function you can at least prevent getting HTTP header related error messages. Another option is to use Output Buffering.


http://www.php.net/manual/kr/function.headers-sent.php

'프로그래밍 언어 > php' 카테고리의 다른 글

mzk - event  (0) 2007.12.15
libcurl Emulator  (0) 2007.12.06
array_combine php5 -> php4  (0) 2007.05.07
배열 컬럼 정렬  (0) 2007.03.15
php error func  (0) 2007.03.12
블로그 이미지

용병

,

gem install mysql
-----------------------------------------------------------------------------
Building native extensions.  This could take a while...
ERROR:  While executing gem ... (Gem::Installer::ExtensionBuildError)
    ERROR: Failed to build gem native extension.

ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
-----------------------------------------------------------------------------

gem install mysql -- --with-mysql-lib=/usr/local/mysql/lib/mysql/

cd /usr/local/ruby/lib/ruby/gems/1.8/gems/mysql-2.7/
ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config
make
make install
gem install mysql -- --with-mysql-lib=/usr/local/mysql/lib/mysql/

'프로그래밍 언어 > Ruby On Rails' 카테고리의 다른 글

mongrel_rails cluster start or stop  (0) 2007.05.10
gem list 보기  (0) 2007.05.09
ror  (0) 2007.05.09
블로그 이미지

용병

,
mongrel_rails cluster::start --config /설치경로/config/mongrel_cluster.yml
mongrel_rails cluster::stop
mongrel_rails cluster::restart --config /설치경로/config/mongrel_cluster.yml

'프로그래밍 언어 > Ruby On Rails' 카테고리의 다른 글

ruby + mysql  (0) 2007.05.10
gem list 보기  (0) 2007.05.09
ror  (0) 2007.05.09
블로그 이미지

용병

,
gem list | grep '^[a-zA-Z]'

'프로그래밍 언어 > Ruby On Rails' 카테고리의 다른 글

ruby + mysql  (0) 2007.05.10
mongrel_rails cluster start or stop  (0) 2007.05.10
ror  (0) 2007.05.09
블로그 이미지

용병

,

'프로그래밍 언어 > Ruby On Rails' 카테고리의 다른 글

ruby + mysql  (0) 2007.05.10
mongrel_rails cluster start or stop  (0) 2007.05.10
gem list 보기  (0) 2007.05.09
블로그 이미지

용병

,
// php < php5 array_combine 용
function array_comb($arr, $arr_to_key) {
    $i = 0;
    foreach ($arr_to_key AS $value){
        $arr_combined[$value] = $arr[$i];
        $i++;
    }

    return $arr_combined;
}

'프로그래밍 언어 > php' 카테고리의 다른 글

libcurl Emulator  (0) 2007.12.06
php header_sent  (0) 2007.11.27
배열 컬럼 정렬  (0) 2007.03.15
php error func  (0) 2007.03.12
str_word_count - 문자열에서 사용한 단어에 대한 정보 반환  (0) 2007.03.11
블로그 이미지

용병

,