Saturday, November 27, 2010

Cat Attack

,
Lately, there's some cats in my boarding house. I don't know where they come from. I have tried to shoo them, but they always come back several hours later. Now, one of the cat have children. They sounds weird sometimes, and it's bothering me. They even ever shocking me when I go to the bathroom at night. Ow.. God, please help me....
Read more →

Friday, November 26, 2010

KDE 4.6 Beta 1 Released

,
When I visit KDE official website today, I found an interesting news that KDE 4.6 Beta 1 has been released. It brings many improvement including search, activities and mobile device support. You can view the screenshot of KDE 4.6 beta 1 here. I really like the new dolphin interface that introduces faceted browsing. Based on the schedule, the final release for KDE 4.6 is January 26, 2011. :)
Read more →

Thursday, November 25, 2010

Showing Blogger Post Date That Done At The Same Day

,
If you have a blogger theme that only permit show the post date once a day, you can tweak it so that the date always show in each of your post. You should activate the blogger post to be displayed to your post before following this tutotial. Here's the steps :
  1. Go to the Edit HTML page under the Design Tab , Check the “Expand Widget Templates”  Option.
  2. Find this code :
    
    

    If you can't found it, search for the codes that contains data:post.dateHeader. If you found it, pay attention to the open and closing tag of this element.
  3. Replace the code with
    
    
    

  4. Save your template.

Notes : Please backup your current design code before do any of this tweak!
Read more →

Fixing Not Visible Blogger Sharing Button On Imported Template

,
If you have imported template for your blog on blogger, sometimes you cannot see the share button even you have enable it. Here's the way to fix this problem :
  1. Go to the Edit HTML page under the Design Tab , Check the “Expand Widget Templates”  Option.
  2. Search for one of this code :
    <p class='post-footer-line post-footer-line-3'> or
    <div class='post-footer-line post-footer-line-3'> or
    <data:post.body/>
  3. Place the following code below one of the code that you found in number 2.
    <div class='post-share-buttons'>
    <b:include data='post' name='shareButtons'/>
    </div>
  4. Save your current template.
Notes : Please backup your current design code before do any of this tweak!
Read more →

PDF Producer : Utility To Convert Text Files Into PDF Document

,
There's a nice little utility for you to convert text files to PDF document, called PDF Producer. This is a freeware product, so you dont have to pay anything. . It do not requires any Acrobat PDF component. So, you can install it without Acrobat. PDF producer can set the page size and angle/rotation of the PDF document. There's 3 choices type of font you can choose too. Now, PDF Producer only available on Windows. I hope the developers can port the project for Linux and Mac too. :)
Read more →

Wednesday, November 24, 2010

I Got 94 Of Nerd Test Score

,
I just take the nerd test quiz and my score is 94 (Supreme Nerd). You can take the quiz here. Try it. It's fun. :)

I am nerdier than 94% of all people. Are you a nerd? Click here to take the Nerd Test, get geeky images and jokes, and write on the nerd forum!
Read more →

Find A Tricky Way To Avoid Slow SQL Query

,
This afternoon I'm doing a task in my office, querying a massive data from mysql with PHP script. The query string contains four join statements and six expressions in the where clause. The result contain data that necessary for all student transcript. I have try querying it at once, but I think I will never get the result at all since it's never finish loading the process. So, I change my PHP script to loop the query for each student and voila!! The process runs smoothly although take a long time to finish.
Actually, I have no solution for this problem for the massive data query. I just loop the query and it works. Join statement in SQL is really use a high resource. If you have the solution, you can share it by leaving a comment on this post. Thanks! :)
Read more →

Tuesday, November 23, 2010

Install VLC on Slackware 13.1

,
I think VLC is the most powerful video application that available on Linux. Yesterday I had tried to install it on my Slackware 13.1 system, but there's an error while compiling the application due to incompatible part of libpng 1.4.x code. This problem can be solved if we use the patch of libpng 1.4.x.
In this article I will show you how I compile and install VLC on my system. Before install the VLC, I have tried to install the dependencies as many as I can get them. Here's the ordered list of the deps :
  1. a52dec
    a52dec is a test program for liba52. It decodes ATSC A/52 streams, and also includes a demultiplexer for mpeg-1 and mpeg-2 program streams. This package also includes liba52. liba52 is a free library for decoding ATSC A/52 streams.
  2. amrnb
    This library is an effort to link against the amrnb-codec, standardized by the 3GPP.
  3. amrwb
    This is library is an effort to link against the amrwb-codec, standardized by the 3GPP
  4. libdaemon
    Libdaemon is a lightweight C library that eases the writing of UNIX daemons.
  5. avahi (require libdaemon)
    Avahi is an implementation of the DNS Service Discovery and Multicast DNS specifications for Zeroconf Computing.  It uses D-BUS for communication between user applications and a system daemon.  The daemon is used to coordinate application efforts in caching replies, necessary to minimize the traffic imposed on networks.
  6. dirac
    Dirac is a open and royalty free high quality codec developed by BBC Research.
  7. enca
    Enca detects the encoding of text files, on the basis of knowledge of their language. It can also convert them to other encodings, allowing you to recode files without knowing their current encoding. It supports most of Central and East European languages, and a few Unicode variants, independently on language.
  8. mp4v2
    This library provides functions to read, create, and modify mp4 files.  This is a standalone version of mp4v2 library.
  9. faac (strongly recommend mp4v2)
    FAAC is an Advanced Audio Coder (MPEG2-AAC, MPEG4-AAC). The goal of FAAC is to explore the possibilities of AAC and exceed the quality of the currently best MP3 encoders.
  10. faad2
    Faad2 is the fastest ISO AAC audio decoder available. Faad2 correctly decodes all MPEG-4 and MPEG-2 MAIN, LC (Low Complexity), HE (High Efficiency), LTP (Long Term Prediction), LD (Low Delay), and ER (Error Resiliency) object type AAC files. Faad2 includes code for SBR (HE AAC) decoding.
  11. lame
    LAME is an educational tool to be used for learning about MP3 encoding. The goal of the LAME project is to use the open source model to improvethe psycho acoustics, noise shaping, and speed of MP3.
  12. twolame (backend only)
    TwoLAME is an optimized MPEG Audio Layer 2 (MP2) encoder. TwoLAME should be able to be used as a drop-in replacement for LAME (a MPEG Layer 3 encoder). If you want to install the frontend, you will need the libsndfile.
  13. libass
    libass is a portable subtitle renderer for the ASS/SSA (Advanced Substation Alpha/Substation Alpha) subtitle format. It is mostly compatible with VSFilter. Since I installed enca before, I pass the --enable-enca while running the configure script.
  14. libdc1394
    libdc1394 is a library that provides a complete high level application programming interface (API) for developers who wish to control IEEE 1394 based cameras that conform to the 1394-based Digital Camera Specifications(also known as the IIDC or DCAM Specifications).
  15. libdvbpsi
    libdvbpsi is a simple library designed for decoding and generation of MPEG TS and DVB PSI tables.
  16. libdvdcss
    libdvdcss is a cross-platform library for transparent DVD device access with on-the-fly CSS decryption.
  17. libdvdnav
    libdvdnav is a library that allows easy use of sophisticated DVD navigation features such as DVD menus, multiangle playback, and even interactive DVD games.
  18. libdvdread
    libdvdread provides a simple foundation for reading DVD video disks.  It provides the functionality that is required to access many DVDs.  It parses IFO files, reads NAV-blocks, and performs CSS authentication and descrambling.
  19. libmpeg2
    libmpeg2 is a free library for decoding mpeg-2 and mpeg-1 video streams.
  20. libv4l
    libv4l is a collection of libraries which adds a thin abstraction layer on top of video4linux2 devices.
  21. live555
    This code forms a set of C++ libraries for multimedia streaming, using open standard protocols (RTP/RTCP, RTSP, SIP).
  22. lua
    Lua is a free software light-weight programming language designed for extending applications.
  23. openjpeg
    The OpenJPEG library is an open-source JPEG 2000 codec.
  24. orc
    Orc is a library and set of tools for compiling and executing very simple programs that operate on arrays of data. The language is a generic assembly language that represents many of the features available in SIMD architectures, including saturated addition and subtraction, and many arithmetic operations.
  25. schroedinger
    Schrodinger is a high-speed implementation in C of the Dirac codec. It requires orc for version 1.0.9 or higher.
  26. speex
    Speex is an Open Source/Free Software patent-free audio compression
    format designed for speech.
  27. yasm
    Yasm is a complete rewrite of the NASM assembler under the "new"
    BSD License.
  28. libvpx (requires yasm)
    Libvpx is the successor of the VP3 codec, on which the Theora codec was based.
  29. x264
    x264 is a free library for encoding H264/AVC video streams.
  30. Xvidcore
    Xvid is an ISO MPEG-4 compliant video codec. Xvid claims to be the best currently available MPEG-4 video codec solution.
  31. opencore-amr
    OpenCORE Adaptive Multi Rate (AMR) speech codec library implementation. This library contains an implementation of the 3GPP TS 26.073 specification for the Adaptive Multi Rate (AMR) speech codec and an implementation for the 3GPP TS 26.173 specification for the Adaptive Multi-Rate - Wideband (AMR-WB) speech decoder.
  32. graphviz
    Graphviz is open source graph visualization software.  It has several main graph layout programs.  It also has web and interactive graphical interfaces, and auxiliary tools, libraries, and language bindings.
  33. libebml
    libebml is a C++ libary to parse EBML files. EBML (Extensible Binary
    Meta-Language library) is a simple XML like binary language for describing data in structured style.
  34. libmatroska (requires libebml)
    libmatroska is a C++ libary to parse Matroska files (.mkv and .mka).
  35. rtmpdump
    rtmpdump is a toolkit for RTMP streams. All forms of RTMP are supported, including rtmp://, rtmpt://, rtmpe://, rtmpte://, and rtmps://.
  36. gsm
    gsm contains command line utilities and libgsm, an implementation of the European GSM 06.10 provisional standard for full-rate speech transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse excitation/long term prediction) coding at 13 kbit/s.
  37. ffmpeg
    FFmpeg is a complete solution to record, convert and stream audio and video. It includes libavcodec, the leading audio/video codec library. I'm  enabling the following libraries to the configure script, since I have install it before : DC1394, DIRAC, FAAC, FAAD, GSM, JP2, LAME, OPENCORE, RTMP, SCHROEDINGER, SPEEX, VPX, X264, XVID.
  38. libdv
    The Quasar DV codec (libdv) is a software codec for DV video. DV is the encoding format used by most digital camcorders, typically those that support the IEEE 1394 (aka FireWire or i.Link) interface.
  39. libshout (requires speex)
    Libshout is a library for communicating with and sending data to an icecast server.  It handles the socket connection, the timing of the data, and prevents bad data from getting to the icecast server.
  40. libavc
    libavc1394 is a programming interface for the 1394 Trade Association AV/C (Audio/Video Control) Digital Interface Command Set.
  41. opencv
    OpenCV is a library of programming functions mainly aimed at real time computer vision.
That's all the dependencies that installed on my system before installing VLC. All this deps can be downloaded at slackbuild repository. Now, let's install VLC. I use VLC 1.0.6. Before install the VLC, we need libpng 1.4.x patch. You can copy the patch code below to your favorite text editor, and save it with the following name : libpng-1.4.patch.

diff --git a/modules/codec/png.c b/modules/codec/png.c
index 5dd4c2e..acd5694 100644
--- a/modules/codec/png.c
+++ b/modules/codec/png.c
@@ -152,7 +152,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     p_info = png_create_info_struct( p_png );
     if( p_info == NULL )
     {
-        png_destroy_read_struct( &p_png, png_infopp_NULL, png_infopp_NULL );
+        png_destroy_read_struct( &p_png, NULL, NULL );
         block_Release( p_block ); *pp_block = NULL;
         return NULL;
     }
@@ -160,7 +160,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     p_end_info = png_create_info_struct( p_png );
     if( p_end_info == NULL )
     {
-        png_destroy_read_struct( &p_png, &p_info, png_infopp_NULL );
+        png_destroy_read_struct( &p_png, &p_info, NULL );
         block_Release( p_block ); *pp_block = NULL;
         return NULL;
     }

After that, you can install the VLC using my slackbuild script :

#!/bin/sh

# Slackware build script for VLC

# Written by Budi Ariyanto (fx.budi.ariyanto@gmail.com)
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PRGNAM=vlc   
VERSION=${VERSION:-1.0.6} 
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}  

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo} 
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e # Exit on most errors

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION
chown -R root:root .
find . \
 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
 -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
 -exec chmod 644 {} \;

# patch for compatibility with libpng-1.4
patch -p1 < $CWD/libpng-1.4.patch

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --mandir=/usr/man \
  --docdir=/usr/doc/$PRGNAM-$VERSION \
  --build=$ARCH-slackware-linux \
  --enable-run-as-root \
  --enable-release \
  --enable-switcher \
  --enable-shout \
  --enable-dv \
  --enable-dvdread \
  --enable-v4l \
  --enable-vcdx \
  --enable-faad \
  --enable-twolame \
  --enable-real \
  --enable-realrtsp \
  --enable-flac \
  --enable-tremor \
  --enable-theora \
  --enable-dirac \
  --enable-csri \
  --enable-libass \
  --enable-asademux \
  --enable-xvmc \
  --enable-svg \
  --enable-snapshot \
  --enable-mga \
  --enable-omapfb \
  --enable-svgalib \
  --enable-aa \
  --enable-caca \
  --enable-lirc \
  --enable-mkv \
  --enable-xosd \
  --enable-fbosd \
  --enable-opencv

# Compile the application and install it into the $PKG directory
make
make install DESTDIR=$PKG

find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
  doc/*.txt \
  $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

You also can copy the slackbuild script, and paste it to your editor. Save it with the following name : vlc.Slackbuild. Make sure the libpng patch, slackbuild script and the vlc source are together in a directory. After that, execute the slackbuild script, wait for the process, install it and enjoy VLC! :)
Read more →

Sunday, November 21, 2010

Piping And Redirecting Standard Output

,
With linux commands, we can output the command result to the screen. Sometimes we have problem with the output on the screen. For example, the output is too long to displayed on the screen. To resolve the problem, we can pipe or redirect the output to somewhere else. You can use the | character to pipe the commands or > character to redirect it. Let's look at this command :

  1.  ls /lib | less
  2.  ls /lib > output.txt
    The command number one will pipe the output of the ls command to the less. So you can scroll the result of ls /lib. The command number two will redirect output of ls /lib to the file named output.txt. The ls /lib command won't be displayed to the screen.
    Read more →

    Saturday, November 20, 2010

    Netbeans 7.0 Beta Now Available To Download

    ,
    This morning I go to the netbeans official site, and I found a news that Netbeans 7.0 beta available for download. It seems netbeans 7.0 supports the HTML5 source editing, provide integration to the oracle database and new gridbag layout for improved Swing GUI development. It's a great improvement from previous netbeans release. I hope netbeans can support for CSS3 script editing too in the future. :)
    Read more →

    Friday, November 19, 2010

    GUI Prototyping Tools For Your Application

    ,
    Before you create your real application, it's necessary to prototyping your GUI forms to give an example or illustration to the client. Pencil is a tool that can help you to create it easily. You can grab it here. It runs underlying the Gecko engine, as a firefox plugin. So, you must have firefox first before install it. Pencil can draw the common controls of a form in several design, like GTK+, Windows XP and sketch(like you are drawing it with a real pencil).
    Read more →

    Thursday, November 18, 2010

    Back To Slackware Again

    ,
    Yesterday, I had installed fedora to my laptop replaced slackware due to hybrid VGA support problem. Slackware default kernel use version 2.6.33 that not support hybrid VGA. I have tried to compile kernel 2.6.36 that supports it, but it's useless. I don't know yet where is the problem. After install fedora 14, I realized that fedora can't play mp3 without gstreamer-plugins-ugly(used by rythmbox) or libxine(used by amarok). To install all the plugins and dependencies, I must download 99 MB size of total packages. That's impossible for me since I have very limited internet bandwith for a month. So, I revert back to use slackware as my operating system. It's better that I wait next slackware release than cannot listen to my lovely song. :)
    Read more →

    Tuesday, November 16, 2010

    Move To Fedora For A While

    ,
    Now, I'm starting to download Fedora ISO from kambing repository. I have a plan to install it to my laptop since the newest Fedora(14) has default support for hybrid VGA. Now I have Slackware 13.1 on my laptop and I have tried compiling the 2.6.36 kernel from source, turn on the VGA_SWITCHEROO option but it's useless. My NVIDIA still cannot be turned on, but the Intel.
    If the NVIDIA card can turned on in Fedora, I will not use slackware for a while until next release maybe, hope for next Slackware release(13.2) has the full support for hybrid VGA. :)
    Read more →

    Code Igniter Future Release Notes

    ,
    Based on the news on the code igniter's site, it's future release(2.0) has some notes that you should know. It has no support for PHP4 anymore because of deprecation that lead to unsufficient support for the next stable release. So, starting today, the team required at least PHP 5.1.6. Another thing that you need to know are :
    • All core class names are prefixed with “CI_”. Be careful what you extend.
    • All core classes now use the __construct convention. Update your constructor calls!
    • CI_Base has been removed, the super object now starts at CI_Controller.
    • The compat file and compatibility helper have been removed. PHP 5.1.6 supports all the functions they provided.
    The Model objects are cleaner:
    Models are no longer assigned super object class members, instead CI_Model provides a __get() method that will look them up as they’re needed. This means that you can now serialize your model objects directly. It should not affect existing code.

    Email and Validation chaining:
    Like the DB library, the Email and Form Validation libraries have been made chainable. So the email example in the documentation can be written as:
    $this->email->from('your@example.com', 'Your Name')
                ->to('someone@example.com')
                ->cc('another@another-example.com')
                ->bcc('them@their-example.com')
                ->subject('Email Test')
                ->message('Testing the email class.')
                ->send(); 
    

    It seems the Code Igniter Framework has a lot of improvement and this framework is interesting to learn indeed! :)
    Read more →

    Friday, November 12, 2010

    Let's Begin Learning HTML5, CSS3 and JQuery

    ,
    HTML5 specification from W3C seems to be done shortly. So, the time has come to learn it. There are several new element, like audio, video, iframe, canvas, param, object, etc. You can begin write a web page using your favourite editor and deploy it to your browser. All popular browser like firefox, opera, safari, chrome and IE have support HTML5 rendering, although not all element supported yet. Don't forget try write a design for your web page using CSS3. You may have a greater web page if you can combine HTML5, CSS3 and JQuery. Happy coding! :)
    Read more →

    Thursday, November 11, 2010

    Blogger With Syntax Highlighter

    ,
    After trying several times to enable syntaxhighlighter in my blog, finally it works. All you need is copy the code below

    <link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css"></link>
    <link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css"></link>
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript">
    </script>
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js" type="text/javascript">
    </script>
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js" type="text/javascript">
    </script>
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js" type="text/javascript">
    </script>
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js" type="text/javascript">
    </script>
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js" type="text/javascript">
    </script>
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js" type="text/javascript">
    </script>
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js" type="text/javascript">
    </script>
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js" type="text/javascript">
    </script>
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js" type="text/javascript">
    </script>
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js" type="text/javascript">
    </script>
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js" type="text/javascript">
    </script>
    <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js" type="text/javascript">
    </script>
    <script language="javascript">
    SyntaxHighlighter.config.bloggerMode = true;
    SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf';
    SyntaxHighlighter.all();
    </script>

    to your blogger template, and paste it just before the closing </head> tag. Save your template. Make sure you have the backup of your original template before doing this.

    Place your source code in the <pre> tag and add a class attribute, for example class = "brush: java;"(see example below). Everything written in there will be rendered as java code with syntax highlighting. You can modify the brush with another programming/scripting language like cpp, scala, php, perl, csharp, css, groovy, erlang, etc. See the complete list


    <pre class="brush: java;">public class Test {
    public static void main(String args[]) {
    System.out.println("Hello World");
    }
    }
    </pre>

    should output :

    public class Test {
       public static void main(String args[]) {
          System.out.println("Hello World");
       }
    }
    

    Thanks to Alex Gorbatchev who made this great syntax highlighter.
    Read more →

    Monday, November 1, 2010

    SQL Exclusion Join

    ,
    We know that SQL has a join syntax to query data within two tables. For example I have two tables and data like this :

    Rose
    type    |    price
    -----------------------
    Red     |      2
    White   |      6


    Lily
    type           |    price
    ------------------------------
    Bowl Shaped    |      5
    Trumpet Shaped |      6


    If we use a join, the tables must have condition to join them. But, how if we want to query data from one tables which doesn't exist in the other table? For example, I want to retrieve price of rose that not match in the lily? The answer is :
    select * from rose a where a.price not in (select b.price from lily b) 

    I hope this can help you for querying data. :D
    Read more →