RSS .92| RSS 2.0| ATOM 0.3
  • Home
  • Contact Us
  • deviantART
  • Newsletter
  • Online Booking
  • Registration
  • Tell A Friend
  •  

    Javascript: Get URL Variables

    June 24th, 2008
    <script type="text/javascript">
    // Read a page's GET URL variables and return them as an associative array.
    function getUrlVars() {
      var vars = [], hash;
      var hashes = window.location.href.slice(window.location.href.indexOf(’?') + 1).split(’&’);
      for(var i = 0; i < hashes.length; i++) {
        hash = hashes[i].split(’=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
      }
      return vars;
    }
    // Example for URL http://www.example.com/index.html?hello=bonjour&goodevening=bonsoir
    var hash = getUrlVars();
    // alert(hash['hello']); // prints ‘bonjour’
    // alert(hash['goodevening']); // prints ‘bonsoir’
    </script>
    

    Problem Flash Player 9.0r124 with SWFUpload in Linux

    June 23rd, 2008

    when using localhost, work normally
    when using internet site, work abnormally,
    especially when getting data, after upload file.
    i don’t know why till now, it’s newest version,
    but work in win32, (dunno in mac, i haven’t test yet)


    Reset Wordpress Password

    June 18th, 2008

    update wp_users set user_pass = md5(’admin’) where user_login = ‘admin’;


    Firefox 3 Ready

    June 18th, 2008

    With more than 15,000 improvements, Firefox 3 is faster, safer and smarter than ever before.
    The Web is all about innovation, and Firefox 3 sets the pace with dozens of new features, including the smart location bar, one-click bookmarking and blindingly fast performance.


    Javascript String Search

    June 17th, 2008

    object.search(regexp)

    This method is used to search for a match between a regular expression and the specified string. If a match is found, the search method returns the index of the regular expression within the string. If no match is found, a value of -1 is returned.

    The first example of code below uses the search method to look for a match between the regular expression ‘rExp’ and the characters in the ‘myString’ string object and displays the resulting value in the browser. In the second example, removing the ‘i’ (ignore case) flag from the regular expression causes the value of the search to be returned as -1

    Code:
    myString = new String(”Go to DevGuru.com”)
    rExp = /devguru.com/gi;
    results = myString.search(rExp)
    document.write(results)

    Output:
    6

    myString = new String(”Go to DevGuru.com”)
    rExp = /devguru.com/g;
    results = myString.search(rExp)
    document.write(results)

    Output:
    -1


    Fixing ffmpeg on Ubuntu

    June 17th, 2008

    Reference: https://wiki.ubuntu.com/ffmpeg
    For a litany of legal reasons, ffmpeg does not come with all of the necessary things enabled for you to encode video for the iPod Video by default. Therefore, we need to build it from source and install some other libraries and programs, as well. Make sure you have multiverse and universe enabled.

    sudo apt-get remove ffmpeg
    sudo apt-get install liba52-dev libdts-dev libgsm1-dev libvorbis-dev  libxvidcore4 \
    libxvidcore-dev libdc1394-dev libfaac-dev liblame-dev libx264-dev libfaad2-dev libtheora-dev \
    libsdl1.2-dev libmpeg4ip-dev
    wget http://ffmpeg.mplayerhq.hu/ffmpeg-export-snapshot.tar.bz2
    tar jxvf ffmpeg-export-snapshot.tar.bz2
    cd ffmpeg-export-*
    ./configure --prefix=/usr/local --disable-debug --enable-shared --enable-gpl --enable-postproc \
    --enable-swscale --enable-pthreads --enable-x11grab --enable-liba52 --enable-libdc1394 \
    --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libtheora \
    --enable-libvorbis --enable-libx264 --enable-libxvid
    make
    sudo make install

    Trying to compile ffmpeg from svn gives the following error:
    libavcodec/libx264.c: In function ‘X264_init’:
    libavcodec/libx264.c:224: error: ‘X264_ME_TESA’ undeclared (first use in this…

    Solved. Installing these two packages:
    http://www.brloh.eu/ubuntu/libx264-dev_0.svn20080408-0.0ubuntu1_i386.deb
    http://www.brloh.eu/ubuntu/libx264-59_0.svn20080408-0.0ubuntu1_i386.deb


    JW Flash Video Player

    June 17th, 2008

    Reference:
    - Flash Player
    - Example

    <div id=”flvcontainer”>
    <a href=”http://www.macromedia.com/go/getflashplayer”>Get the Flash Player</a> to see this player.</div>
    <script type=”text/javascript” src=”swfobject.js”></script>
    <script type=”text/javascript”>
    var s1 = new SWFObject(”mediaplayer.swf”,”mediaplayer”,”428″,”268″,”8″);
    s1.addParam(”allowfullscreen”,”true”);
    s1.addVariable(”width”,”428″);
    s1.addVariable(”height”,”268″);
    s1.addVariable(”file”,”pele.flv”);
    s1.write(”flvcontainer”);
    </script>


    HTML Meta Http-Equiv Refresh

    June 17th, 2008

    Specifies a delay in seconds before the browser automatically reloads the document. Optionally, specifies an alternative URL to load. E.g.

    <META HTTP-EQUIV="Refresh" CONTENT="3;URL=http://www.some.org/some.html">
    

    or (HTTP header)

    Refresh: 3;URL=http://www.some.org/some.html
    

    In Netscape Navigator, has the same effect as clicking “Reload”; i.e. issues an HTTP GET with Pragma: no-cache (and If-Modified-Since header if a cached copy exists).

    Note: If a script is executed which reloads the current document, the action of the Refresh tag may be undefined. (e.g. <body onLoad= “document.location=’otherdoc.doc’>)


    Javascript: addEventListener and attachEvent

    June 16th, 2008


    <script type=”text/javascript”>
    function addListener(el, act, func) {
    if (window.addEventListener) {el.addEventListener(act,func,false);}
    else if (window.attachEvent) {el.attachEvent (”on”+act,func);}
    else { eval(”el.on”+act+” = func;”);}
    }
    function documentOnLoad() { alert(123); }
    addListener(window, “load”, documentOnLoad);
    </script>


    RSS Example

    June 16th, 2008

    <?php
    header(’Content-Type: text/xml; charset=UTF-8′, true);
    ?>
    <?php echo ‘<?xml version=”1.0″ encoding=”UTF-8″?’.'>’; ?>
    <rss version=”0.92″>
    <channel>
    <title><?=$channel_title?></title>
    <link><?=”http://”.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF'])?></link>
    <description><?=$channel_description?></description>
    <lastBuildDate><?php echo date(’D, d M Y H:i:s +0000′); ?></lastBuildDate>
    <docs>http://backend.userland.com/rss092</docs>
    <language>id</language>

    <?php
    // begin loop
    ?>
    <item>
    <title><?=$the_title_rss?></title>
    <description><?=$the_content_rss?></description>
    <link><?=$the_permalink_rss?></link>
    </item>
    <?php
    // end loop
    ?>
    </channel>
    </rss>


    Rudy Cahayadi is Digg proof thanks to caching by WP Super Cache!