<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>{Complexity}</title>
	<atom:link href="http://wsjoung.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://wsjoung.wordpress.com</link>
	<description>Simple Tech Note</description>
	<lastBuildDate>Wed, 18 Jan 2012 14:06:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='wsjoung.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>{Complexity}</title>
		<link>http://wsjoung.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://wsjoung.wordpress.com/osd.xml" title="{Complexity}" />
	<atom:link rel='hub' href='http://wsjoung.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Korean fashion style following KPOP weave</title>
		<link>http://wsjoung.wordpress.com/2011/12/18/korean-fashion-style-following-kpop-weave/</link>
		<comments>http://wsjoung.wordpress.com/2011/12/18/korean-fashion-style-following-kpop-weave/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 04:20:57 +0000</pubDate>
		<dc:creator>wsjoung</dc:creator>
				<category><![CDATA[Fashion]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://wsjoung.wordpress.com/?p=96</guid>
		<description><![CDATA[Recently KPOP is getting very popular, it called KPOP weave.  It seems like that many of Korean pop singers or groups already are on the top of music chart in Asian area including China, Japan and south eastern Asia. This trends lead some of other fields like movies, TV dramas and fashion. Especially Korean clothing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=96&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently KPOP is getting very popular, it called <a href="http://en.wikipedia.org/wiki/Korean_wave">KPOP weave</a>.  It seems like that many of Korean pop singers or groups already are on the top of music chart in Asian area including China, Japan and south eastern Asia.</p>
<p>This trends lead some of other fields like movies, TV dramas and fashion. Especially <a title="Korean clothing" href="http://www.kpopsicle.com">Korean clothing</a> is getting more popular as Korean celebrities getting popular. Because people notice the style of Korean celebrities on TV show.</p>
<p><a href="http://wsjoung.files.wordpress.com/2011/12/d51.jpg"><img class="size-full wp-image-97 aligncenter" title="Korean fashion" src="http://wsjoung.files.wordpress.com/2011/12/d51.jpg?w=450&#038;h=300" alt="" width="450" height="300" /></a></p>
<p><a title="Korean fashion clothing" href="http://www.kpopsicle.com">Korean fashion clothing</a> is distinguished from others. First they are mostly for slim. sometimes it&#8217;s not make easy to find big size of clothing. Second fashion trends are changing very fast. Korea is a sort of small county, when a style is getting trends it doesn&#8217;t take that long to get spread out. The last is that they have very efficient manufacturing cycle. All these make difference on Korean fashion style.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wsjoung.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wsjoung.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wsjoung.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wsjoung.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wsjoung.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wsjoung.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wsjoung.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wsjoung.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wsjoung.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wsjoung.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wsjoung.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wsjoung.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wsjoung.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wsjoung.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=96&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wsjoung.wordpress.com/2011/12/18/korean-fashion-style-following-kpop-weave/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/640c03b759ae320c8b226a1aa4809ed0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wsjoung</media:title>
		</media:content>

		<media:content url="http://wsjoung.files.wordpress.com/2011/12/d51.jpg" medium="image">
			<media:title type="html">Korean fashion</media:title>
		</media:content>
	</item>
		<item>
		<title>Incremental backup scripts</title>
		<link>http://wsjoung.wordpress.com/2008/05/09/incremental-backup-scripts/</link>
		<comments>http://wsjoung.wordpress.com/2008/05/09/incremental-backup-scripts/#comments</comments>
		<pubDate>Fri, 09 May 2008 21:20:52 +0000</pubDate>
		<dc:creator>wsjoung</dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://wsjoung.wordpress.com/?p=92</guid>
		<description><![CDATA[#!/bin/bash # # creates backups of essential files # DATA="/home /root /usr/local/httpd" CONFIG="/etc /var/lib /var/named" LIST="/tmp/backlist_$$.txt" # mount /mnt/backup set $(date) # if test "$1" = "Sun" ; then # weekly a full backup of all data and config. settings: tar cfz "/mnt/backup/data/data_full_$6-$2-$3.tgz" $DATA rm -f /mnt/backup/data/data_diff* # tar cfz "/mnt/backup/config/config_full_$6-$2-$3.tgz" $CONFIG rm -f /mnt/backup/config/config_diff* [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=92&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre>#!/bin/bash
#
# creates backups of essential files
#
DATA="/home /root /usr/local/httpd"
CONFIG="/etc /var/lib /var/named"
LIST="/tmp/backlist_$$.txt"
#
mount /mnt/backup
set $(date)
#
if test "$1" = "Sun" ; then
        # weekly a full backup of all data and config. settings:
        tar cfz "/mnt/backup/data/data_full_$6-$2-$3.tgz" $DATA
        rm -f /mnt/backup/data/data_diff*
        #
        tar cfz "/mnt/backup/config/config_full_$6-$2-$3.tgz" $CONFIG
        rm -f /mnt/backup/config/config_diff*
else
        # incremental backup:
        find $DATA -depth -type f \( -ctime -1 -o -mtime -1 \) -print &gt; $LIST
        tar cfzT "/mnt/backup/data/data_diff_$6-$2-$3.tgz" "$LIST"
        rm -f "$LIST"
        #
        find $CONFIG -depth -type f  \( -ctime -1 -o -mtime -1 \) -print &gt; $LIST
        tar cfzT "/mnt/backup/config/config_diff_$6-$2-$3.tgz" "$LIST"
        rm -f "$LIST"
fi
#
# create sql dump of databases:
mysqldump -u root --password=mypass --opt mydb &gt; "/mnt/backup/database/mydb_$6-$2-$3.sql"
gzip "/mnt/backup/database/mydb_$6-$2-$3.sql"
#
umount /mnt/backup
</pre>
<p><a href="http://www.xs4all.nl/~voorburg/backup.html">&gt;&gt; Backup script for Linux using tar and find</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wsjoung.wordpress.com/92/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wsjoung.wordpress.com/92/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wsjoung.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wsjoung.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wsjoung.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wsjoung.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wsjoung.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wsjoung.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wsjoung.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wsjoung.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wsjoung.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wsjoung.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wsjoung.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wsjoung.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wsjoung.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wsjoung.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=92&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wsjoung.wordpress.com/2008/05/09/incremental-backup-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/640c03b759ae320c8b226a1aa4809ed0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wsjoung</media:title>
		</media:content>
	</item>
		<item>
		<title>How to attach a new hard disk to ubuntu linux</title>
		<link>http://wsjoung.wordpress.com/2008/05/08/how-to-attach-a-new-hard-disk-to-ubuntu-linux/</link>
		<comments>http://wsjoung.wordpress.com/2008/05/08/how-to-attach-a-new-hard-disk-to-ubuntu-linux/#comments</comments>
		<pubDate>Thu, 08 May 2008 14:31:37 +0000</pubDate>
		<dc:creator>wsjoung</dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[Config]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://wsjoung.wordpress.com/?p=91</guid>
		<description><![CDATA[root@server-tribeca:/etc# fdisk -l Disk /dev/sda: 40.0 GB, 40020664320 bytes 255 heads, 63 sectors/track, 4865 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x9dc96e9e Device Boot Start End Blocks Id System /dev/sda1 * 1 4689 37664361 83 Linux /dev/sda2 4690 4865 1413720 5 Extended /dev/sda5 4690 4865 1413688+ 82 Linux swap [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=91&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>root@server-tribeca:/etc# fdisk -l</strong></p>
<p>Disk /dev/sda: 40.0 GB, 40020664320 bytes<br />
255 heads, 63 sectors/track, 4865 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
Disk identifier: 0x9dc96e9e</p>
<p>Device Boot      Start         End      Blocks   Id  System<br />
/dev/sda1   *           1        4689    37664361   83  Linux<br />
/dev/sda2            4690        4865     1413720    5  Extended<br />
/dev/sda5            4690        4865     1413688+  82  Linux swap / Solaris</p>
<p>Disk /dev/sdb: 120.0 GB, 120034123776 bytes<br />
255 heads, 63 sectors/track, 14593 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
Disk identifier: 0x00a080f4</p>
<p>Device Boot      Start         End      Blocks   Id  System<br />
/dev/sdb1   *           1          13      104391   83  Linux<br />
/dev/sdb2              14       14471   116133885   83  Linux<br />
/dev/sdb3           14472       14593      979965   82  Linux swap / Solaris</p>
<p><strong>root@server-tribeca:/etc# fdisk /dev/sdb</strong></p>
<p>The number of cylinders for this disk is set to 14593.<br />
There is nothing wrong with that, but this is larger than 1024,<br />
and could in certain setups cause problems with:<br />
1) software that runs at boot time (e.g., old versions of LILO)<br />
2) booting and partitioning software from other OSs<br />
(e.g., DOS FDISK, OS/2 FDISK)</p>
<p>Command (m for help): <strong>d</strong><br />
Partition number (1-4): <strong>1</strong></p>
<p>Command (m for help): <strong>d</strong><br />
Partition number (1-4): <strong>2</strong></p>
<p>Command (m for help): <strong>d</strong><br />
Selected partition 3</p>
<p>Command (m for help): <strong>d</strong><br />
No partition is defined yet!</p>
<p>Command (m for help): <strong>n</strong><br />
Command action<br />
e   extended<br />
p   primary partition (1-4)<br />
<strong> p</strong><br />
Partition number (1-4): <strong>1</strong><br />
First cylinder (1-14593, default 1): <strong>1</strong><br />
Last cylinder or +size or +sizeM or +sizeK (1-14593, default 14593):<br />
Using default value 14593</p>
<p>Command (m for help): <strong>w</strong><br />
The partition table has been altered!</p>
<p>Calling ioctl() to re-read partition table.<br />
Syncing disks.</p>
<p><strong>root@server-tribeca:/etc# mkfs.ext3 /dev/sdb1</strong><br />
mke2fs 1.40.8 (13-Mar-2008)<br />
Filesystem label=<br />
OS type: Linux<br />
Block size=4096 (log=2)<br />
Fragment size=4096 (log=2)<br />
7331840 inodes, 29304560 blocks<br />
1465228 blocks (5.00%) reserved for the super user<br />
First data block=0<br />
Maximum filesystem blocks=0<br />
895 block groups<br />
32768 blocks per group, 32768 fragments per group<br />
8192 inodes per group<br />
Superblock backups stored on blocks:<br />
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,<br />
4096000, 7962624, 11239424, 20480000, 23887872</p>
<p>Writing inode tables: done<br />
Creating journal (32768 blocks): done<br />
Writing superblocks and filesystem accounting information: done</p>
<p>This filesystem will be automatically checked every 22 mounts or<br />
180 days, whichever comes first.  Use tune2fs -c or -i to override.</p>
<p><strong>root@server-tribeca:/etc# ls /dev/disk/by-uuid -alh</strong><br />
lrwxrwxrwx 1 root root  10 2008-05-07 17:58 753a86d9-6228-4725-a9ae-6f457c2b1824 -&gt; ../../sdb1<br />
lrwxrwxrwx 1 root root  10 2008-05-07 17:58 dbd44197-c1c5-427d-9a34-40f652b92f42 -&gt; ../../sda1<br />
lrwxrwxrwx 1 root root  10 2008-05-07 17:58 e15f5c2c-fc1f-414d-8c67-99c567f44d6a -&gt; ../../sda5</p>
<p><strong>root@server-tribeca:/etc# mkdir /disk1</strong></p>
<p><strong>root@server-tribeca:/etc# vi /etc/fstab</strong><br />
# /etc/fstab: static file system information.<br />
#<br />
# &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt;<br />
proc            /proc           proc    defaults        0       0<br />
# /dev/sda1<br />
UUID=dbd44197-c1c5-427d-9a34-40f652b92f42 /               ext3    relatime,errors=remount-ro 0       1<br />
# /dev/sda5<br />
UUID=e15f5c2c-fc1f-414d-8c67-99c567f44d6a none            swap    sw              0       0<br />
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0<br />
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0<br />
<strong> UUID=753a86d9-6228-4725-a9ae-6f457c2b1824 /disk1          ext3    defaults,errors=remount-ro 0       1</strong></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wsjoung.wordpress.com/91/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wsjoung.wordpress.com/91/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wsjoung.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wsjoung.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wsjoung.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wsjoung.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wsjoung.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wsjoung.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wsjoung.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wsjoung.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wsjoung.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wsjoung.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wsjoung.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wsjoung.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wsjoung.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wsjoung.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=91&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wsjoung.wordpress.com/2008/05/08/how-to-attach-a-new-hard-disk-to-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/640c03b759ae320c8b226a1aa4809ed0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wsjoung</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing Timezon and NTP On Ubuntu server</title>
		<link>http://wsjoung.wordpress.com/2008/05/05/changing-timezon-and-ntp-on-ubuntu-server/</link>
		<comments>http://wsjoung.wordpress.com/2008/05/05/changing-timezon-and-ntp-on-ubuntu-server/#comments</comments>
		<pubDate>Mon, 05 May 2008 22:06:00 +0000</pubDate>
		<dc:creator>wsjoung</dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[Config]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://wsjoung.wordpress.com/?p=90</guid>
		<description><![CDATA[Timezon Config dpkg-reconfigure tzdata Time Synchronisation with NTP as root, create a file /etc/cron.daily/ntpdate containing: ntpdate ntp.ubuntu.com The file /etc/cron.daily/ntpdate must also be executable sudo chmod 755 /etc/cron.daily/ntpdate<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=90&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em><strong>Timezon Config</strong></em></p>
<p>dpkg-reconfigure tzdata</p>
<p><em><strong>Time Synchronisation with NTP</strong></em></p>
<p>as root, create a file /etc/cron.daily/ntpdate  containing:<br />
ntpdate ntp.ubuntu.com<br />
The file <code>/etc/cron.daily/ntpdate</code> must also be executable<br />
sudo chmod 755 /etc/cron.daily/ntpdate</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wsjoung.wordpress.com/90/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wsjoung.wordpress.com/90/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wsjoung.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wsjoung.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wsjoung.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wsjoung.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wsjoung.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wsjoung.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wsjoung.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wsjoung.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wsjoung.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wsjoung.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wsjoung.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wsjoung.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wsjoung.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wsjoung.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=90&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wsjoung.wordpress.com/2008/05/05/changing-timezon-and-ntp-on-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/640c03b759ae320c8b226a1aa4809ed0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wsjoung</media:title>
		</media:content>
	</item>
		<item>
		<title>SwingWorker not on Java 6.0</title>
		<link>http://wsjoung.wordpress.com/2008/04/24/swingworker-not-on-java-60/</link>
		<comments>http://wsjoung.wordpress.com/2008/04/24/swingworker-not-on-java-60/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 14:15:08 +0000</pubDate>
		<dc:creator>wsjoung</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SwingWorker]]></category>

		<guid isPermaLink="false">http://wsjoung.wordpress.com/?p=84</guid>
		<description><![CDATA[SwingWorker is useful when a time-consuming task has to be performed following a user-interaction event (for example, parsing a huge XML File, on pressing a Button). The most straightforward way to do it is : This will work, but unfortunately, the loadXML() method will be called in the same thread as the main Swing thread, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=84&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SwingWorker is useful when a time-consuming task has to be performed following a user-interaction event (for example, parsing a huge XML File, on pressing a Button). The most straightforward way to do it is :</p>
<p><pre class="brush: java;">
 private Document doc;
 ...
 JButton button = new JButton(&quot;Open XML&quot;);
 button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
       doc = loadXML();
    }
 });
</pre></p>
<p>This will work, but unfortunately, the loadXML() method will be called in the same thread as the main Swing thread, so if the method needs time to perform, the GUI will freeze during this time.</p>
<p><pre class="brush: java;">
package com.wsjoung.demo;
import javax.swing.SwingUtilities;

public abstract class SwingWorker {
    // see getValue(), setValue()
    private Object value;
    private Thread thread;

    private static class ThreadVar {
        private Thread thread;
        ThreadVar(Thread t) { thread = t; }
        synchronized Thread get() { return thread; }
        synchronized void clear() { thread = null; }
    }

    private ThreadVar threadVar;

    protected synchronized Object getValue() {
        return value;
    }

    private synchronized void setValue(Object x) {
        value = x;
    }

    public abstract Object construct();

    public void finished() {
    }

    public void interrupt() {
        Thread t = threadVar.get();
        if (t != null) {
            t.interrupt();
        }
        threadVar.clear();
    }

    public Object get() {
        while (true) {
            Thread t = threadVar.get();
            if (t == null) {
                return getValue();
            }
            try {
                t.join();
            }
            catch (InterruptedException e) {
                // propagate
                Thread.currentThread().interrupt();
                return null;
            }
        }
    }

    public SwingWorker() {
        final Runnable doFinished = new Runnable() {
           public void run() { finished(); }
        };

        Runnable doConstruct = new Runnable() {
            public void run() {
                try {
                    setValue(construct());
                }
                finally {
                    threadVar.clear();
                }

              SwingUtilities.invokeLater(doFinished);
            }
        };

        Thread t = new Thread(doConstruct);
        threadVar = new ThreadVar(t);
        t.start();
    }
}
</pre></p>
<p><a href="http://java.sun.com/products/jfc/tsc/articles/threads/src/SwingWorker.java">SwingWorker.java</a></p>
<p><pre class="brush: java;">
public class Task{
  public void go() {
      current = 0;
      final SwingWorker worker = new SwingWorker() {
          public Object construct() {
              return new ActualTask();
          }
      };
  }

  class ActualTask {
      ActualTask() {
          try {
              Thread.sleep(1000);
          } catch (InterruptedException e) {}
      }
  }
}
</pre></p>
<p>Task.java</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wsjoung.wordpress.com/84/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wsjoung.wordpress.com/84/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wsjoung.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wsjoung.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wsjoung.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wsjoung.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wsjoung.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wsjoung.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wsjoung.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wsjoung.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wsjoung.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wsjoung.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wsjoung.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wsjoung.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wsjoung.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wsjoung.wordpress.com/84/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=84&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wsjoung.wordpress.com/2008/04/24/swingworker-not-on-java-60/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/640c03b759ae320c8b226a1aa4809ed0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wsjoung</media:title>
		</media:content>
	</item>
		<item>
		<title>pure-ftpd-mysql, [ERROR] Home directory not available &#8211; aborting</title>
		<link>http://wsjoung.wordpress.com/2008/04/15/pure-ftpd-mysql-error-home-directory-not-available-aborting/</link>
		<comments>http://wsjoung.wordpress.com/2008/04/15/pure-ftpd-mysql-error-home-directory-not-available-aborting/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 15:49:22 +0000</pubDate>
		<dc:creator>wsjoung</dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[Config]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://wsjoung.wordpress.com/?p=80</guid>
		<description><![CDATA[groupadd -g 2001 ftpgroup useradd -u 2001 -s /bin/false -d /bin/null -c &#8220;pureftpd user&#8221; -g ftpgroup ftpuser Instead of this dummy ftpuser account setting when they want to create real linux account. they may get this error &#8220;Home directory not available &#8211; abort&#8221; even if they set CreateHomeDir to yes. Solution: the last existing in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=80&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>groupadd -g 2001 ftpgroup<br />
useradd -u 2001 -s /bin/false -d /bin/null -c &#8220;pureftpd user&#8221; -g ftpgroup ftpuser</p>
<p>Instead of this dummy ftpuser account setting when they want to create real linux account.<br />
they may get this error &#8220;Home directory not available &#8211; abort&#8221; even if they set CreateHomeDir to yes.</p>
<p>Solution:<br />
the last existing in the home path should be own by root.<br />
for example, we want to create somebody&#8217;s home directory when he log in, /home/ftpuser/somebody<br />
then the last existing directory &#8216;ftpuer&#8217; may look like this,<br />
drwxr-xr-x 2 <strong>root</strong> ftpgroup 4096 2008-04-15 11:20 ftpuser</p>
<p><a href="http://ecartis.ausics.net/hypermail/pure-old/0171.html">[pure-ftpd] CreateHomeDir problem (&#8220;[ERROR] Home directory not available &#8211; aborting&#8221;)</a><br />
<a href="http://howtoforge.com/virtual-hosting-with-pureftpd-and-mysql-ubuntu-7.10">Virtual Hosting With PureFTPd And MySQL (Incl. Quota And Bandwidth Management) On Ubuntu 7.10 (Gutsy Gibbon)</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wsjoung.wordpress.com/80/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wsjoung.wordpress.com/80/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wsjoung.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wsjoung.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wsjoung.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wsjoung.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wsjoung.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wsjoung.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wsjoung.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wsjoung.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wsjoung.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wsjoung.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wsjoung.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wsjoung.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wsjoung.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wsjoung.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=80&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wsjoung.wordpress.com/2008/04/15/pure-ftpd-mysql-error-home-directory-not-available-aborting/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/640c03b759ae320c8b226a1aa4809ed0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wsjoung</media:title>
		</media:content>
	</item>
		<item>
		<title>what&#8217;s static?</title>
		<link>http://wsjoung.wordpress.com/2008/04/14/whats-static/</link>
		<comments>http://wsjoung.wordpress.com/2008/04/14/whats-static/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 19:31:25 +0000</pubDate>
		<dc:creator>wsjoung</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Static]]></category>

		<guid isPermaLink="false">http://wsjoung.wordpress.com/?p=79</guid>
		<description><![CDATA[First of all, the meaning of static in java is embedded or belong to a specific class not to its instance, and therefore there is no such static class. There is no such static class Embedded or belong to a specific class Global variable No need to load and create its instance Most of methods [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=79&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>First of all, the meaning of static in java is embedded or belong to a specific class not to its instance, and therefore there is no such static class.</p>
<ul>
<li>There is no such static class</li>
<li>Embedded or belong to a specific class</li>
<li>Global variable</li>
<li>No need to load and create its instance</li>
</ul>
<p>Most of methods and variables in Math class are static, because those are not need to be instanced in most of cases. we just use return value of PI or max(int a, int b).</p>
<p>class  Bicycle {</p>
<p>private static int numberOfBicycles = 0;<br />
private int id;</p>
<p>public Bicycle() {<br />
id = ++numberOfBicycles;<br />
}</p>
<p>public static int getNumberOfBicycles() {<br />
return numberOfBicycles;<br />
}<br />
public int getID() {<br />
return id;<br />
}</p>
<p>public static void main(String[] args) {<br />
Bicycle b1 = new Bicycle();<br />
Bicycle b2 = new Bicycle();</p>
<p>System.out.println(&#8220;static result    : &#8220;+getNumberOfBicycles());<br />
System.out.println(&#8220;static result : &#8220;+numberOfBicycles);<br />
System.out.println(&#8220;instance result  : &#8220;+b1.getID());<br />
System.out.println(&#8220;instance result  : &#8220;+b2.getID());<br />
}<br />
}</p>
<p>Another characteristic of static is that even if we create instance of a class, jvm does not create instance variables for static resources. in above source code, there is no difference calling b1.getNumberOfBicycles(), b2.getNumberOfBicycles() and just getNumberOfBicycles() or directly numberOfBicycles<br />
that mean we should call static variable with its class name because it&#8217;s belong to it. just like Bicycle.numberOfBicycles or in this example, getNumberOfBicycles() because we have a getter.<br />
otherwise get confused.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wsjoung.wordpress.com/79/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wsjoung.wordpress.com/79/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wsjoung.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wsjoung.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wsjoung.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wsjoung.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wsjoung.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wsjoung.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wsjoung.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wsjoung.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wsjoung.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wsjoung.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wsjoung.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wsjoung.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wsjoung.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wsjoung.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=79&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wsjoung.wordpress.com/2008/04/14/whats-static/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/640c03b759ae320c8b226a1aa4809ed0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wsjoung</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Style, Theta vs. ANSI</title>
		<link>http://wsjoung.wordpress.com/2008/04/11/theta-style-vs-ansi-style/</link>
		<comments>http://wsjoung.wordpress.com/2008/04/11/theta-style-vs-ansi-style/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 21:13:30 +0000</pubDate>
		<dc:creator>wsjoung</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://wsjoung.wordpress.com/?p=78</guid>
		<description><![CDATA[Theta Style: SELECT i.order_id, p.product_id, p.name, p.desc FROM CustomerItem i, Product p WHERE i.product_id = p.product_id AND i.order_id = 84463; ANSI Style: SELECT i.order_id, p.product_id, p.name, p.desc FROM CustomerItem i INNER JOIN Product p ON i.product_id = p.product_id WHERE i.order_id = 84463; Sometimes, it&#8217;s hard to realized whether there is other style of SQL. Obviously [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=78&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em><strong>Theta Style:</strong></em><br />
SELECT i.order_id, p.product_id, p.name, p.desc<br />
FROM CustomerItem i, Product p<br />
WHERE i.product_id = p.product_id<br />
AND i.order_id = 84463;</p>
<p><em><strong>ANSI Style:</strong></em><br />
SELECT i.order_id, p.product_id, p.name, p.desc<br />
FROM CustomerItem i<br />
INNER JOIN Product p ON i.product_id = p.product_id<br />
WHERE i.order_id = 84463;</p>
<p>Sometimes, it&#8217;s hard to realized whether there is other style of SQL. Obviously there are two different SQL style. theta is older and more obscure but many people still use it.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wsjoung.wordpress.com/78/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wsjoung.wordpress.com/78/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wsjoung.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wsjoung.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wsjoung.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wsjoung.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wsjoung.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wsjoung.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wsjoung.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wsjoung.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wsjoung.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wsjoung.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wsjoung.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wsjoung.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wsjoung.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wsjoung.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=78&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wsjoung.wordpress.com/2008/04/11/theta-style-vs-ansi-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/640c03b759ae320c8b226a1aa4809ed0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wsjoung</media:title>
		</media:content>
	</item>
		<item>
		<title>Interview questions</title>
		<link>http://wsjoung.wordpress.com/2008/02/06/amazon-interview/</link>
		<comments>http://wsjoung.wordpress.com/2008/02/06/amazon-interview/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 17:33:23 +0000</pubDate>
		<dc:creator>wsjoung</dc:creator>
				<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[Linked List]]></category>

		<guid isPermaLink="false">http://wsjoung.wordpress.com/?p=76</guid>
		<description><![CDATA[what&#8217;s difference C++ and java explain about java static is java use call by reference or call by value get the algorithm to fine nth value from the last element in single linked list, and write code all questions look pretty easy though, anyway, the last algorithm question. because it&#8217;s just one direction single linked [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=76&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<ul>
<li>what&#8217;s difference C++ and java</li>
<li>explain about java static</li>
<li>is java use call by reference or call by value</li>
<li>get the algorithm to fine nth value from the last element in single linked list, and write code</li>
</ul>
<p>all questions look pretty easy though,</p>
<p>anyway, the last algorithm question. because it&#8217;s just one direction single linked list, we should trouble from the start node to the last node. then we can figure out how many elements in that linked list when we reached the last element. then we can simply travel again from the start node to (m-n)th element. complexity is O(n).<br />
I was trying to bring up some other data structure like stack or hash table but, all those are not good  in terms of space efficiency. we do not have to wast precious resource which doesn&#8217;t increase the performance that much.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wsjoung.wordpress.com/76/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wsjoung.wordpress.com/76/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wsjoung.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wsjoung.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wsjoung.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wsjoung.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wsjoung.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wsjoung.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wsjoung.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wsjoung.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wsjoung.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wsjoung.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wsjoung.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wsjoung.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wsjoung.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wsjoung.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=76&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wsjoung.wordpress.com/2008/02/06/amazon-interview/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/640c03b759ae320c8b226a1aa4809ed0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wsjoung</media:title>
		</media:content>
	</item>
		<item>
		<title>DataSource setup on Tomcat</title>
		<link>http://wsjoung.wordpress.com/2007/09/21/datasource-setup-on-tomcat/</link>
		<comments>http://wsjoung.wordpress.com/2007/09/21/datasource-setup-on-tomcat/#comments</comments>
		<pubDate>Fri, 21 Sep 2007 20:38:24 +0000</pubDate>
		<dc:creator>wsjoung</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://wsjoung.wordpress.com/2007/09/21/datasource-setup-on-tomcat/</guid>
		<description><![CDATA[1. create META-INF/context.xml &#60;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&#62; &#60;Context docBase=&#8221;e-sports&#8221; path=&#8221;/e-sports&#8221; debug=&#8221;0&#8243; reloadable=&#8221;true&#8221; source=&#8221;org.eclipse.jst.j2ee.server:e-sports&#8221;&#62; &#60;Logger className=&#8221;org.apache.catalina.logger.FileLogger&#8221; prefix=&#8221;e-sports_log.&#8221; suffix=&#8221;.txt&#8221; timestamp=&#8221;true&#8221; /&#62; &#60;Resource name=&#8221;jdbc/myoracle&#8221; auth=&#8221;Container&#8221; type=&#8221;javax.sql.DataSource&#8221; driverClassName=&#8221;oracle.jdbc.driver.OracleDriver&#8221; factory=&#8221;org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory&#8221; url=&#8221;jdbc:oracle:thin:@127.0.0.1:1521:ORA92&#8243; username=&#8221;scott&#8221; password=&#8221;tiger&#8221; maxActive=&#8221;20&#8243; maxIdle=&#8221;10&#8243; maxWait=&#8221;-1&#8243; /&#62; &#60;/Context&#62; 2. test.jsp &#60;%@ page import=&#8221;java.sql.Connection&#8221; %&#62; &#60;%@ page import=&#8221;java.sql.ResultSet&#8221; %&#62; &#60;%@ page import=&#8221;java.sql.SQLException&#8221; %&#62; &#60;%@ page import=&#8221;java.sql.Statement&#8221; %&#62; &#60;%@ page import=&#8221;javax.naming.Context&#8221; %&#62; &#60;%@ [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=75&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. create META-INF/context.xml</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;Context docBase=&#8221;e-sports&#8221; path=&#8221;/e-sports&#8221; debug=&#8221;0&#8243; reloadable=&#8221;true&#8221;<br />
source=&#8221;org.eclipse.jst.j2ee.server:e-sports&#8221;&gt;<br />
&lt;Logger className=&#8221;org.apache.catalina.logger.FileLogger&#8221;<br />
prefix=&#8221;e-sports_log.&#8221; suffix=&#8221;.txt&#8221; timestamp=&#8221;true&#8221; /&gt;<br />
&lt;Resource name=&#8221;jdbc/myoracle&#8221;<br />
auth=&#8221;Container&#8221;<br />
type=&#8221;javax.sql.DataSource&#8221;<br />
driverClassName=&#8221;oracle.jdbc.driver.OracleDriver&#8221;<br />
factory=&#8221;org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory&#8221;<br />
url=&#8221;jdbc:oracle:thin:@127.0.0.1:1521:ORA92&#8243;<br />
username=&#8221;scott&#8221;<br />
password=&#8221;tiger&#8221;<br />
maxActive=&#8221;20&#8243;<br />
maxIdle=&#8221;10&#8243;<br />
maxWait=&#8221;-1&#8243; /&gt;<br />
&lt;/Context&gt;</p>
<p>2. test.jsp<br />
&lt;%@ page import=&#8221;java.sql.Connection&#8221; %&gt;<br />
&lt;%@ page import=&#8221;java.sql.ResultSet&#8221; %&gt;<br />
&lt;%@ page import=&#8221;java.sql.SQLException&#8221; %&gt;<br />
&lt;%@ page import=&#8221;java.sql.Statement&#8221; %&gt;<br />
&lt;%@ page import=&#8221;javax.naming.Context&#8221; %&gt;<br />
&lt;%@ page import=&#8221;javax.naming.InitialContext&#8221; %&gt;<br />
&lt;%@ page import=&#8221;javax.naming.NamingException&#8221; %&gt;<br />
&lt;%@ page import=&#8221;javax.sql.DataSource&#8221; %&gt;</p>
<p>&lt;%<br />
Context ctx = null;<br />
DataSource source = null;<br />
Connection con = null;</p>
<p>try {<br />
ctx = new InitialContext();<br />
ctx = (Context) ctx.lookup(&#8220;java:comp/env&#8221;);<br />
source = (DataSource) ctx.lookup(&#8220;jdbc/myoracle&#8221;);</p>
<p>System.out.println(&#8220;DataSource   ===========================&#8221;+ source);</p>
<p>con = source.getConnection();<br />
System.out.println(&#8220;Connection ============================&#8221;+ con);<br />
} catch (NamingException ne) {<br />
ne.printStackTrace();<br />
}<br />
%&gt;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wsjoung.wordpress.com/75/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wsjoung.wordpress.com/75/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wsjoung.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wsjoung.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wsjoung.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wsjoung.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wsjoung.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wsjoung.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wsjoung.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wsjoung.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wsjoung.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wsjoung.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wsjoung.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wsjoung.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wsjoung.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wsjoung.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wsjoung.wordpress.com&amp;blog=25269&amp;post=75&amp;subd=wsjoung&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wsjoung.wordpress.com/2007/09/21/datasource-setup-on-tomcat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/640c03b759ae320c8b226a1aa4809ed0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wsjoung</media:title>
		</media:content>
	</item>
	</channel>
</rss>
