<?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/"
	>

<channel>
	<title>Site Articles</title>
	<atom:link href="http://sitearticles.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sitearticles.com</link>
	<description>Web Development Articles and Magazine</description>
	<lastBuildDate>Thu, 24 Feb 2011 07:40:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Glass effect</title>
		<link>http://sitearticles.com/design/glass-effect/</link>
		<comments>http://sitearticles.com/design/glass-effect/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 07:40:57 +0000</pubDate>
		<dc:creator>hristobutchvarov</dc:creator>
				<category><![CDATA[DESIGN]]></category>

		<guid isPermaLink="false">http://sitearticles.com/?p=697</guid>
		<description><![CDATA[1. Open the image. 2. Choose  Rounded Rectangle Tool (Shift+U), make a vertical rectangle with color #2E69FF. 3. Choose Blending Option of the layer with the rectangle with the folowing settings: 4. Make the transparency of the Layer (Fill) to 20%. 5. Make a new layer. Keeping Ctrl, click the left button of the layer [...]]]></description>
			<content:encoded><![CDATA[<p>1. Open the image.</p>
<p><img class="alignnone" src="http://2.bp.blogspot.com/-ENOZaP_Rc10/TWYJj5cmpyI/AAAAAAAAAJg/ur07MDJrPW8/s1600/01.jpg" alt="" width="1000" height="750" /></p>
<p>2. Choose  <strong>Rounded Rectangle Tool</strong> (<em>Shift+U</em>), make a vertical rectangle with color<em> #2E69FF</em>.</p>
<p><img class="alignnone" src="http://4.bp.blogspot.com/-WHgQboc2F-U/TWYJlAZrXaI/AAAAAAAAAJk/gzjoQEfjWrs/s1600/02.jpg" alt="" width="793" height="595" /></p>
<p>3. Choose<strong> Blending Option </strong>of the<strong> </strong>layer with the rectangle with the folowing settings:</p>
<p><img class="alignnone" src="http://2.bp.blogspot.com/-vKmR5YEkfAg/TWYJmTp5JLI/AAAAAAAAAJo/G6sg5bcejPM/s1600/03.jpg" alt="" width="626" height="488" /></p>
<p><img class="alignnone" src="http://2.bp.blogspot.com/-RwUQWuQaJdk/TWYJnYz2s2I/AAAAAAAAAJs/97nm4VRarTM/s1600/04.jpg" alt="" width="624" height="488" /></p>
<p><img class="alignnone" src="http://3.bp.blogspot.com/-M5-O2nxE9nI/TWYJodVo69I/AAAAAAAAAJw/f6ER4n9yz_w/s1600/05.jpg" alt="" width="626" height="488" /></p>
<p>4. Make the transparency of the Layer (<strong>Fill</strong>) to <em>20%</em>.</p>
<p><img class="alignnone" src="http://3.bp.blogspot.com/-uYBSmkv3SpQ/TWYJpUllvqI/AAAAAAAAAJ0/VPZfz-HwInA/s1600/06.jpg" alt="" width="254" height="242" /></p>
<p>5. Make a new layer. Keeping Ctrl, click the left button of the layer &#8220;shape&#8221;; pour selection with black and press Ctrl + D to deselect.</p>
<p><img class="alignnone" src="http://3.bp.blogspot.com/-93wGYJaukcs/TWYJw0E7JbI/AAAAAAAAAJ4/2lWccziVsTw/s1600/07.jpg" alt="" width="798" height="600" /></p>
<p>6. Go to<strong> </strong><strong>Filter &#8211; Render &#8211; Lens Flare</strong> with settings <strong>Movie Prime</strong> and <strong>Brightness</strong> around <em>180</em>, press <strong>OK</strong>.</p>
<p><img class="alignnone" src="http://3.bp.blogspot.com/-WR4RWZclULw/TWYJ0r6oGHI/AAAAAAAAAJ8/71dysrjgfAE/s1600/08.jpg" alt="" width="680" height="430" /></p>
<p><img class="alignnone" src="http://1.bp.blogspot.com/-e_5EHRP2ftE/TWYJ14jDn6I/AAAAAAAAAKA/FbL0IGJ_BF4/s1600/09.jpg" alt="" width="331" height="469" /></p>
<p>7. Place the <strong>Blending Mode</strong><strong> </strong>to <em>screen</em>.</p>
<p><img class="alignnone" src="http://2.bp.blogspot.com/-BI907PvDcTA/TWYJ3BYrdhI/AAAAAAAAAKE/0t4AyCka60k/s1600/10.jpg" alt="" width="253" height="256" /></p>
<p>8. You are ready</p>
<p><img class="alignnone" src="http://1.bp.blogspot.com/-JRRfIaHOqfY/TWYJ4WqrZpI/AAAAAAAAAKI/-Cff0rC274w/s1600/11.jpg" alt="" width="789" height="595" /></p>
<p>Made by RozerWebArt</p>
]]></content:encoded>
			<wfw:commentRss>http://sitearticles.com/design/glass-effect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add a Shadow</title>
		<link>http://sitearticles.com/design/add-a-shadow/</link>
		<comments>http://sitearticles.com/design/add-a-shadow/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 07:31:00 +0000</pubDate>
		<dc:creator>hristobutchvarov</dc:creator>
				<category><![CDATA[DESIGN]]></category>

		<guid isPermaLink="false">http://sitearticles.com/?p=693</guid>
		<description><![CDATA[1. Open the image where you want to add the shadow. 2. Select the image using the appropriate tool according to it’s complicity. 3. Copy the selected object at new layer from the Layer &#8211; New  &#8211; Layer via Copy (Ctrl+J). 4. Turn it vertiсal using Edit &#8211; Transform &#8211; Flip Vertiсal. 5. Use Move [...]]]></description>
			<content:encoded><![CDATA[<p>1. Open the image where you want to add the shadow.</p>
<p><img class="alignnone" src="http://4.bp.blogspot.com/-_VgcZzv9gqo/TWYHhwz430I/AAAAAAAAAI4/mGVE2sFqtSc/s1600/01.png" alt="" width="256" height="256" /></p>
<p>2. Select the image using the appropriate tool according to it’s complicity.</p>
<p><img class="alignnone" src="http://1.bp.blogspot.com/-HwnaoN26dns/TWYHi-k9g1I/AAAAAAAAAI8/kXpsPHmyEQY/s1600/02.jpg" alt="" width="404" height="406" /></p>
<p>3. Copy the selected object at new layer from the <strong>Layer &#8211; New  &#8211; Layer via Copy</strong> <em>(Ctrl+J)</em>.</p>
<p><img class="alignnone" src="http://3.bp.blogspot.com/-_Aw9vlK04b0/TWYHjq2ktNI/AAAAAAAAAJA/b7J984ft_T8/s1600/03.jpg" alt="" width="682" height="541" /></p>
<p>4. Turn it vertiсal<strong> </strong>using<strong> </strong><strong>Edit &#8211; Transform &#8211; Flip Vertiсal</strong>.</p>
<p><img class="alignnone" src="http://3.bp.blogspot.com/-J49yQIESBpg/TWYHkw6AqtI/AAAAAAAAAJE/gce9kATvL0A/s1600/04.jpg" alt="" width="756" height="567" /></p>
<p>5. Use <strong>Move Tool</strong> (V) to move the figure at the bottom of the page.</p>
<p><img class="alignnone" src="http://1.bp.blogspot.com/-Io0ZdKspRxk/TWYHmIaoBJI/AAAAAAAAAJI/acVZyn-vwMw/s1600/05.jpg" alt="" width="533" height="536" /></p>
<p>6. Add a <strong>Layer Mask</strong> by clicking on the third little icon at the <strong>Layers</strong><strong> </strong><strong>Panel</strong>.</p>
<p><img class="alignnone" src="http://3.bp.blogspot.com/-AsgqHTdPLMU/TWYHnDXxm3I/AAAAAAAAAJM/zE78xHs1WvY/s1600/06.jpg" alt="" width="251" height="270" /></p>
<p>7. Use <strong>Gradient Tool</strong><strong> </strong>with<strong> Linear style</strong> and colors from black to white.</p>
<p><img class="alignnone" src="http://3.bp.blogspot.com/-cnmsvAzBpfU/TWYHoOAi4sI/AAAAAAAAAJQ/Nh0IwXBsRno/s1600/07.jpg" alt="" width="539" height="217" /></p>
<p>8. Do bottom &#8211; up line by holding <strong>Shift</strong> to make a straight line.</p>
<p><img class="alignnone" src="http://1.bp.blogspot.com/-POt_fAmKwn8/TWYHpQHywNI/AAAAAAAAAJU/xhfIK13DVjs/s1600/08.jpg" alt="" width="665" height="658" /></p>
<p>9. Low down the <strong>Opacity</strong><strong> </strong>to  <em>60%</em>:</p>
<p><img class="alignnone" src="http://1.bp.blogspot.com/-Xc8rlTccPII/TWYHru7K0HI/AAAAAAAAAJc/DYiaI6w6sao/s1600/10.jpg" alt="" width="252" height="192" /></p>
<p>10. You are ready</p>
<p><img class="alignnone" src="http://2.bp.blogspot.com/-ee4d940aMoE/TWYHqnofFOI/AAAAAAAAAJY/VqQxqTKxWfo/s1600/09.jpg" alt="" width="800" height="800" /></p>
<p>Made by RozerWebArt</p>
]]></content:encoded>
			<wfw:commentRss>http://sitearticles.com/design/add-a-shadow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change Cloths Color</title>
		<link>http://sitearticles.com/opinions/change-cloths-color-2/</link>
		<comments>http://sitearticles.com/opinions/change-cloths-color-2/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 17:13:22 +0000</pubDate>
		<dc:creator>hristobutchvarov</dc:creator>
				<category><![CDATA[OPINIONS]]></category>

		<guid isPermaLink="false">http://sitearticles.com/?p=688</guid>
		<description><![CDATA[1. Open the image which color you are going to change. 2. Select the clothes which color you want to change. You can use each one of the selection tools. I will use Select - Color Range. 3. Select the color you are going to change and using the Fuzziness slider control the range of [...]]]></description>
			<content:encoded><![CDATA[<p>1. Open the image which color you are going to change.</p>
<p><img class="alignnone" src="http://4.bp.blogspot.com/-gfxtn5_yODo/TWYC4-yjfcI/AAAAAAAAAII/sPtSmhfINeg/s1600/01.jpg" alt="" width="409" height="512" /></p>
<p>2. Select the clothes which color you want to change. You can use each one of the selection tools. I will use<strong> Select </strong><strong>- </strong><strong>Color</strong><strong> </strong><strong>Range</strong><strong>.</strong></p>
<p><strong><img class="alignnone" src="http://1.bp.blogspot.com/-pE5njt24vZI/TV6ls5bQcNI/AAAAAAAAAHo/Z7Z0y-CjJLs/s1600/02.jpg" alt="" width="456" height="507" /></strong></p>
<p>3. Select the color you are going to change and using the <strong>Fuzziness</strong> slider<strong> </strong>control the range of the selection. Finish by pressing<strong> OK.</strong></p>
<p><strong><img class="alignnone" src="http://1.bp.blogspot.com/-ew8kTQbm6KQ/TWYC5gPLtGI/AAAAAAAAAIM/H2OorQ2YP58/s1600/03.jpg" alt="" width="417" height="427" /><br />
</strong></p>
<p>4. Take the <strong>Quick</strong><strong> </strong><strong>Selection </strong><strong>Tool </strong>and precise the selection where it needs.</p>
<p><img class="alignnone" src="http://4.bp.blogspot.com/-BLutoI9s8P8/TV6lvhDzdNI/AAAAAAAAAHw/GlrBD-d9pfo/s1600/04.jpg" alt="" width="146" height="208" /></p>
<p><img class="alignnone" src="http://4.bp.blogspot.com/-5BIYRjXsYXQ/TWYC6t45reI/AAAAAAAAAIQ/NjgPqsfWydQ/s1600/05.jpg" alt="" width="517" height="659" /></p>
<p>5. Go to<strong> Image</strong><strong> &#8211; </strong><strong>Image </strong><strong>Adjustments &#8211; </strong><strong>Hue</strong><strong> </strong><strong>Saturation.</strong></p>
<p><strong><img class="alignnone" src="http://3.bp.blogspot.com/-lqv4hCCW9gE/TWYC7iPnSgI/AAAAAAAAAIU/ms4yvlwpZC8/s1600/06.jpg" alt="" width="691" height="617" /><br />
</strong></p>
<p>6. You can choose the new color from the<strong> Hue</strong> slider.</p>
<p><img class="alignnone" src="http://2.bp.blogspot.com/-iocDvbc8Pyw/TV6lznxAFTI/AAAAAAAAAH8/A_PYAjdDWn0/s1600/07.jpg" alt="" width="420" height="385" /></p>
<p>7. When you are satisfied with the new color press <strong>OK</strong> and <strong>CTR</strong><strong>+</strong><strong>D </strong>to remove the selection<strong>.</strong></p>
<p>8. You are ready.</p>
<p><strong><img class="alignnone" src="http://4.bp.blogspot.com/-W3cq8O1r1jY/TWYC8k0n3EI/AAAAAAAAAIY/pK-Cg5CjDkE/s1600/08.jpg" alt="" width="409" height="512" /><br />
</strong></p>
<p>Made by rozerWebArt</p>
]]></content:encoded>
			<wfw:commentRss>http://sitearticles.com/opinions/change-cloths-color-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twisted Ends</title>
		<link>http://sitearticles.com/design/685/</link>
		<comments>http://sitearticles.com/design/685/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 17:06:20 +0000</pubDate>
		<dc:creator>hristobutchvarov</dc:creator>
				<category><![CDATA[DESIGN]]></category>

		<guid isPermaLink="false">http://sitearticles.com/?p=685</guid>
		<description><![CDATA[1. Open the photo you want to twist the ends. 2. You must first unlock the Layer. Yow will do this by double clicking on the padlock located at Layer Palette. 3. Now select the Rectangular Marquee Tool and select an object of the picture you want to apply the effect. 4. Now choose the [...]]]></description>
			<content:encoded><![CDATA[<p>1. Open the photo you want to twist the ends.</p>
<p><img class="alignnone" src="http://1.bp.blogspot.com/-I4ATpxCEnI4/TV6liiSbsxI/AAAAAAAAAHI/__moUcYP_UI/s1600/01.jpg" alt="" width="1143" height="819" /></p>
<p>2. You must first unlock the <strong>Layer</strong>. Yow will do this by double clicking on the padlock located at <strong>Layer Palette</strong>.</p>
<p><img class="alignnone" src="http://1.bp.blogspot.com/-2r3eoTbZNCM/TV6lkf5pWBI/AAAAAAAAAHM/ExysHlljSBM/s1600/02.jpg" alt="" width="252" height="195" /></p>
<p>3. Now select the <strong>Rectangular</strong> <strong>Marquee Tool</strong><strong> </strong>and select an object of the picture you want to apply the effect.</p>
<p><img class="alignnone" src="http://4.bp.blogspot.com/-FnDCK_8u30w/TV6llRGjHcI/AAAAAAAAAHQ/_35swAHjNBo/s1600/03.jpg" alt="" width="798" height="578" /></p>
<p>4. Now choose the <strong>Gradient </strong><strong>Tool</strong> and make a line from the upper right corner to bottom left. Colors must be from black to white. Remove selections with <strong>Ctr + D.</strong></p>
<p><strong><img class="alignnone" src="http://3.bp.blogspot.com/-iHg_xmvjdrQ/TV6mCDj5PhI/AAAAAAAAAIE/HkAqQy5GMpA/s1600/04.jpg" alt="" width="783" height="569" /></strong></p>
<p>5. Go to  <strong>Edit</strong><strong> –</strong><strong> Transform</strong><strong> -</strong><strong> Warp</strong>.</p>
<p><img class="alignnone" src="http://4.bp.blogspot.com/-pmMrMdusHLo/TV6lnru8r3I/AAAAAAAAAHY/k9kSg1j4B6M/s1600/05.jpg" alt="" width="607" height="774" /></p>
<p>6. Hold the bottom left corner and pull towards the middle. When you are ready press Enter.</p>
<p><img class="alignnone" src="http://3.bp.blogspot.com/-BAm7pHZdV3s/TV6loo5-tSI/AAAAAAAAAHc/8cf1_r6xU6Q/s1600/06.jpg" alt="" width="1152" height="825" /></p>
<p>7. You are ready</p>
<p><img class="alignnone" src="http://4.bp.blogspot.com/-YkhvAcbegwc/TV6lqDlYuII/AAAAAAAAAHg/SnirtDhkc2Y/s1600/07.jpg" alt="" width="1143" height="819" /></p>
<p>Made by rozerWebArt</p>
]]></content:encoded>
			<wfw:commentRss>http://sitearticles.com/design/685/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>From photo to sketch</title>
		<link>http://sitearticles.com/opinions/from-photo-to-sketch/</link>
		<comments>http://sitearticles.com/opinions/from-photo-to-sketch/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 16:34:29 +0000</pubDate>
		<dc:creator>hristobutchvarov</dc:creator>
				<category><![CDATA[OPINIONS]]></category>

		<guid isPermaLink="false">http://sitearticles.com/?p=663</guid>
		<description><![CDATA[1. Open the image which you want to turn into a sketch . 2. Select Image – Adjustment – Desaturate (Shift+Ctrl+U), to turn it into a black and white image. 3. Go to Filter &#8211; Other &#8211; High Pass and change the Radius in range of 3 to 6 pixels. Changing the radius depends on [...]]]></description>
			<content:encoded><![CDATA[<p>1. Open the image which you want to turn into a sketch .</p>
<p><img class="alignnone" src="http://3.bp.blogspot.com/-eNpBoG6H2b0/TWYGK3VuFnI/AAAAAAAAAIc/tzE7sE5kBZw/s1600/01.jpg" alt="" width="309" height="430" /></p>
<p>2. Select Image – Adjustment – Desaturate (Shift+Ctrl+U), to turn it into a black and white image.</p>
<p><img class="alignnone" src="http://1.bp.blogspot.com/-ahB2rNveNgc/TWYGMyO7nfI/AAAAAAAAAIg/AOIHYa6OOn0/s1600/02.jpg" alt="" width="693" height="620" /></p>
<p>3. Go to Filter &#8211; Other &#8211; High Pass and change the Radius in range of 3 to 6 pixels. Changing the radius depends on the depth and the size of the picture.</p>
<p><img class="alignnone" src="http://1.bp.blogspot.com/-XxQGe2a753k/TWYGONposiI/AAAAAAAAAIk/bFaMzD_w25k/s1600/03.jpg" alt="" width="640" height="594" /></p>
<p><img class="alignnone" src="http://4.bp.blogspot.com/-CT2Ugp7ajxc/TWYGPxTWnmI/AAAAAAAAAIo/8mq6bcUbsAg/s1600/04.jpg" alt="" width="320" height="336" /></p>
<p>4. Duplicate the layer (Ctrl+J) and change Blending Mode from Normal to  Color Dodge.</p>
<p><img class="alignnone" src="http://1.bp.blogspot.com/-OWBOHWZPaok/TV6e-C-TuXI/AAAAAAAAAGg/qroXJt1GDaU/s1600/05.jpg" alt="" width="251" height="152" /></p>
<p>5. You picture must look like that:</p>
<p><img class="alignnone" src="http://3.bp.blogspot.com/-L0XdBVa5ZcI/TWYGQ0C6PTI/AAAAAAAAAIs/iLHZlR1z6iQ/s1600/06.jpg" alt="" width="313" height="430" /></p>
<p>6. Go to Image &#8211; Adjustmet &#8211; Birghtness/Contrast to increase the contrast and to sharpen the contours.</p>
<p><img class="alignnone" src="http://1.bp.blogspot.com/-QWLDngUHXWU/TWYGTVK4aZI/AAAAAAAAAIw/tActiacH0WU/s1600/07.jpg" alt="" width="693" height="622" /></p>
<p><img class="alignnone" src="http://4.bp.blogspot.com/-xv-0HcdZx_A/TV6fA8aQWwI/AAAAAAAAAGs/uM6b9xfbHd4/s1600/08.jpg" alt="" width="401" height="176" /></p>
<p>7. You are ready</p>
<p><img class="alignnone" src="http://1.bp.blogspot.com/-0SAsyDlPFSk/TWYGUVjkmPI/AAAAAAAAAI0/iscrAb5FCds/s1600/09.jpg" alt="" width="313" height="430" /></p>
<p>Made by RozerWebArt</p>
]]></content:encoded>
			<wfw:commentRss>http://sitearticles.com/opinions/from-photo-to-sketch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make a sunset: Photoshop tutorial</title>
		<link>http://sitearticles.com/design/make-a-sunset-photoshop/</link>
		<comments>http://sitearticles.com/design/make-a-sunset-photoshop/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 19:22:29 +0000</pubDate>
		<dc:creator>hristobutchvarov</dc:creator>
				<category><![CDATA[DESIGN]]></category>
		<category><![CDATA[sunset]]></category>

		<guid isPermaLink="false">http://sitearticles.com/?p=590</guid>
		<description><![CDATA[1. Open the picture that you want to add a sunset on. 2. Choose Filter – Render &#8211;  LightingEffects. 3. Select for Omni for Light type, move the slider of the Intensity to 50, change the color to ff7608 by clicking on the default color (box on the right of the slider with intensity). 4. [...]]]></description>
			<content:encoded><![CDATA[<p>1. Open the picture that you want to add a sunset on.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/00.jpg"><img class="alignnone size-large wp-image-637" title="00" src="http://sitearticles.com/wp-content/uploads/2011/02/00-540x405.jpg" alt="" width="540" height="405" /></a></p>
<p>2. Choose <strong>Filter</strong><strong> – Render</strong><strong> &#8211;  LightingEffects</strong><strong>.</strong></p>
<p><strong><a href="http://sitearticles.com/wp-content/uploads/2011/02/017.jpg"><img class="alignnone size-large wp-image-638" title="01" src="http://sitearticles.com/wp-content/uploads/2011/02/017-540x342.jpg" alt="" width="540" height="342" /></a><br />
</strong></p>
<p>3. Select for <strong>Omni</strong> for <strong>Light type</strong>, move the slider of the <strong>Intensity</strong> to <em>50</em>, change the color to <em>ff7608</em> by clicking on the default color (box on the right of the slider with intensity).</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/022.jpg"><img class="alignnone size-large wp-image-639" title="02" src="http://sitearticles.com/wp-content/uploads/2011/02/022-540x528.jpg" alt="" width="540" height="528" /></a></p>
<p>4. Change the size of the light source by pulling the levers of a circle you see in the left window where image is located.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/032.jpg"><img class="alignnone size-large wp-image-640" title="03" src="http://sitearticles.com/wp-content/uploads/2011/02/032-540x528.jpg" alt="" width="540" height="528" /></a></p>
<p>5. Make a new layer.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/042.jpg"><img class="alignnone size-full wp-image-641" title="04" src="http://sitearticles.com/wp-content/uploads/2011/02/042.jpg" alt="" width="253" height="197" /></a></p>
<p>6. Take the <strong>Rectangular marquee tool</strong> and draw a rectangle at the end of the beach with color<em> </em><em>ff7608</em><strong>.</strong></p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/052.jpg"><img class="alignnone size-large wp-image-642" title="05" src="http://sitearticles.com/wp-content/uploads/2011/02/052-540x407.jpg" alt="" width="540" height="407" /></a></p>
<p><strong>7. </strong>Change  <strong>Blending Mode</strong> to <strong>Overlay</strong> and low the <strong>Opacity</strong> to <em>44%</em>.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/062.jpg"><img class="alignnone size-full wp-image-643" title="06" src="http://sitearticles.com/wp-content/uploads/2011/02/062.jpg" alt="" width="253" height="246" /></a></p>
<p>8. Choose <strong>Filter &#8211; Blur &#8211; Motion Blur</strong> and set the following values <strong>Angel</strong> – <em>45</em>, <strong>Distance</strong> – <em>129</em>.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/072.jpg"><img class="alignnone size-large wp-image-644" title="07" src="http://sitearticles.com/wp-content/uploads/2011/02/072-540x317.jpg" alt="" width="540" height="317" /></a></p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/082.jpg"><img class="alignnone size-full wp-image-645" title="08" src="http://sitearticles.com/wp-content/uploads/2011/02/082.jpg" alt="" width="323" height="386" /></a></p>
<p>9. Use <strong>Edit &#8211; Free Transform </strong>to place it the way you feel it should be.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/092.jpg"><img class="alignnone size-large wp-image-646" title="09" src="http://sitearticles.com/wp-content/uploads/2011/02/092-540x403.jpg" alt="" width="540" height="403" /></a></p>
<p>10. Your sunset is ready.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/102.jpg"><img class="alignnone size-large wp-image-647" title="10" src="http://sitearticles.com/wp-content/uploads/2011/02/102-540x405.jpg" alt="" width="540" height="405" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sitearticles.com/design/make-a-sunset-photoshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make a rainbow: Photshop tutorial</title>
		<link>http://sitearticles.com/design/make-a-rainbow-photoshop/</link>
		<comments>http://sitearticles.com/design/make-a-rainbow-photoshop/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 19:11:00 +0000</pubDate>
		<dc:creator>hristobutchvarov</dc:creator>
				<category><![CDATA[DESIGN]]></category>
		<category><![CDATA[rainbow]]></category>

		<guid isPermaLink="false">http://sitearticles.com/?p=588</guid>
		<description><![CDATA[1. Open the picture that you want to add a rainbow on. 2. Make a new layer. 3. Take the  Gradient Tool. Choose the style  Linear Gradient – TransparentRainbow. 4. While pressing down the Shift key, make short vertical stroke in the middle of the picture. The direction should be from top to bottom. 5. [...]]]></description>
			<content:encoded><![CDATA[<p>1. Open the picture that you want to add a rainbow on.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/018.jpg"><img class="alignnone size-large wp-image-650" title="01" src="http://sitearticles.com/wp-content/uploads/2011/02/018-540x405.jpg" alt="" width="540" height="405" /></a></p>
<p>2. Make a new layer.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/023.jpg"><img class="alignnone size-full wp-image-651" title="02" src="http://sitearticles.com/wp-content/uploads/2011/02/023.jpg" alt="" width="253" height="243" /></a></p>
<p>3. Take the  <strong>Gradient Tool</strong>. Choose the style  <strong>Linear Gradient </strong><strong>– TransparentRainbow</strong><strong>.</strong></p>
<p><strong><a href="http://sitearticles.com/wp-content/uploads/2011/02/033.jpg"><img class="alignnone size-large wp-image-652" title="03" src="http://sitearticles.com/wp-content/uploads/2011/02/033-540x420.jpg" alt="" width="540" height="420" /></a><br />
</strong></p>
<p>4.<strong> </strong>While pressing down the Shift key, make short vertical stroke in the middle of the picture. The direction should be from top to bottom.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/043.jpg"><img class="alignnone size-large wp-image-653" title="04" src="http://sitearticles.com/wp-content/uploads/2011/02/043-540x404.jpg" alt="" width="540" height="404" /></a></p>
<p>5. Choose  <strong>Filter </strong><strong>- Distort </strong><strong>- Polar Coordinates</strong>. Tick<strong> Rectangular to Polar</strong> and pres <strong>OK</strong>.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/053.jpg"><img class="alignnone size-large wp-image-654" title="05" src="http://sitearticles.com/wp-content/uploads/2011/02/053-540x467.jpg" alt="" width="540" height="467" /></a></p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/063.jpg"><img class="alignnone size-full wp-image-655" title="06" src="http://sitearticles.com/wp-content/uploads/2011/02/063.jpg" alt="" width="375" height="404" /></a></p>
<p>6. To move the figures use the <strong>Edit &#8211; Free Transform</strong> <em>(Ctrl + T).</em> This way you can reduce or increase its size and move it to the appropriate location according to your picture.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/073.jpg"><img class="alignnone size-large wp-image-656" title="07" src="http://sitearticles.com/wp-content/uploads/2011/02/073-540x405.jpg" alt="" width="540" height="405" /></a></p>
<p>7. Choose <strong> Filter </strong><strong>- Blur </strong><strong>- Gaussian Blur</strong> with <strong>Radius</strong>: <em>4.5px</em></p>
<p><em><a href="http://sitearticles.com/wp-content/uploads/2011/02/084.jpg"><img class="alignnone size-large wp-image-661" title="08" src="http://sitearticles.com/wp-content/uploads/2011/02/084-540x465.jpg" alt="" width="540" height="465" /></a><br />
</em></p>
<p><em><a href="http://sitearticles.com/wp-content/uploads/2011/02/093.jpg"><img class="alignnone size-full wp-image-659" title="09" src="http://sitearticles.com/wp-content/uploads/2011/02/093.jpg" alt="" width="403" height="416" /></a><br />
</em></p>
<p>8. Change  <strong>Blending Mode</strong> to <em>Screen</em> and low the <strong>Opacity</strong> to <em>80%</em>.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/103.jpg"><img class="alignnone size-large wp-image-658" title="10" src="http://sitearticles.com/wp-content/uploads/2011/02/103-540x404.jpg" alt="" width="540" height="404" /></a></p>
<p>9. Take a large soft round <strong>Brush</strong> with <strong>Hardness</strong><em> 0</em> and delete where you think it is necessary.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/112.jpg"><img class="alignnone size-large wp-image-657" title="11" src="http://sitearticles.com/wp-content/uploads/2011/02/112-540x405.jpg" alt="" width="540" height="405" /></a></p>
<p>10. Your rainbow is ready.</p>
]]></content:encoded>
			<wfw:commentRss>http://sitearticles.com/design/make-a-rainbow-photoshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Underlined animated text in Photoshop CS4</title>
		<link>http://sitearticles.com/design/underlined-animated-text-in-photoshop-cs4/</link>
		<comments>http://sitearticles.com/design/underlined-animated-text-in-photoshop-cs4/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 17:56:19 +0000</pubDate>
		<dc:creator>hristobutchvarov</dc:creator>
				<category><![CDATA[DESIGN]]></category>
		<category><![CDATA[FEATURED]]></category>
		<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://sitearticles.com/?p=536</guid>
		<description><![CDATA[1. Open a new document (Ctr+N) with the following settings. 2. Choose foreground and background color and with Gradient tool make something like this: 3. Take Type tool and write the text you want 4. Right click on text in layer palette and choose blending option. In the window that will appear make the following [...]]]></description>
			<content:encoded><![CDATA[<p>1. Open a new document <strong>(Ctr+N)</strong> with the following settings.<br />
<img src="http://sitearticles.com/wp-content/uploads/2011/02/01.jpg" alt="img1" /></p>
<p>2. Choose foreground and background color and with <strong>Gradient tool</strong> make something like<br />
this:</p>
<p><img src="http://sitearticles.com/wp-content/uploads/2011/02/02.jpg" alt="img2" /></p>
<p>3. Take Type tool and write the text you want<br />
<img src="http://sitearticles.com/wp-content/uploads/2011/02/03.jpg" alt="img3" /></p>
<p>4. Right click on text in layer palette and choose <strong>blending option</strong>. In the window that will appear make the following settings.</p>
<p><img src="http://sitearticles.com/wp-content/uploads/2011/02/04.jpg" alt="img4" /><br />
<img src="http://sitearticles.com/wp-content/uploads/2011/02/05.jpg" alt="img5" /><br />
<img src="http://sitearticles.com/wp-content/uploads/2011/02/06.jpg" alt="img6" /></p>
<p>5. Make a <strong>new layer</strong> and <strong>selection</strong> like this:</p>
<p><img src="http://sitearticles.com/wp-content/uploads/2011/02/07.jpg" alt="img7" /></p>
<p>6. Now make another gradient with <strong>gradient tool</strong> with little different colors.</p>
<p><img src="http://sitearticles.com/wp-content/uploads/2011/02/08.jpg" alt="img8" /></p>
<p>7. Press <strong>CTR+T</strong> for <strong>Free transform</strong> then right click and choose <strong>warp</strong>. From tool option choose <strong>flag</strong> and pres <strong>enter</strong> to apply the transformation.</p>
<p><img src="http://sitearticles.com/wp-content/uploads/2011/02/09.jpg" alt="img9" /></p>
<p>8. With big soft <strong>brush</strong> in low opacity delete little from both sides to soften the edges.</p>
<p><img src="http://sitearticles.com/wp-content/uploads/2011/02/10.jpg" alt="img10" /></p>
<p>9. From <strong>Window</strong> choose <strong>Animation</strong> to open the animation palette.</p>
<p><img src="http://sitearticles.com/wp-content/uploads/2011/02/11.jpg" alt="img11" /></p>
<p>10. Now move line to the left with <strong>Move tool</strong> till it hide completely and then click <strong>Duplicates selected frames</strong> button in animation palette.</p>
<p><img src="http://sitearticles.com/wp-content/uploads/2011/02/12.jpg" alt="img12" /></p>
<p>11. Move line with <strong>Move tool</strong> to the right so it hides again. Now select both frames in the animation palette (<strong>Ctr+click</strong>) and press <strong>tween</strong>.</p>
<p><img src="http://sitearticles.com/wp-content/uploads/2011/02/13.jpg" alt="img13" /></p>
<p>12. In the window that will appear make following  settings.</p>
<p><img src="http://sitearticles.com/wp-content/uploads/2011/02/14.jpg" alt="img14" /></p>
<p>13. Select all frames in animation palette (<strong>select first frame, hold Shift and click on the last frame</strong>) then choose 0 sec. for <strong>delay</strong> and click on <strong>forever</strong>.</p>
<p><img src="http://sitearticles.com/wp-content/uploads/2011/02/15.jpg" alt="img15" /></p>
<p>14. Now you are ready to save it. Choose <strong>File-Save for web and devices</strong>. In the window that will appear select <strong>Gif</strong> and press save.</p>
<p><img src="http://sitearticles.com/wp-content/uploads/2011/02/16.jpg" alt="img16" /></p>
<p>15. New window will appear. Choose where do you want to save it and for <strong>Save as type</strong> select <strong>Images only (gif).</strong></p>
<p><strong></strong> <img src="http://sitearticles.com/wp-content/uploads/2011/02/17.jpg" alt="img17" /></p>
<p>16. Open it in your web browser to see the result.</p>
<p><a href="http://sitearticles.com/wp-content/uploads/2011/02/final-result.gif"><img class="alignnone size-medium wp-image-562" title="final result" src="http://sitearticles.com/wp-content/uploads/2011/02/final-result-300x100.gif" alt="" width="300" height="100" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sitearticles.com/design/underlined-animated-text-in-photoshop-cs4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kleiner Perkins Invests $38 Million In Facebook</title>
		<link>http://sitearticles.com/news/kleiner-perkins-invests-38-million-in-facebook/</link>
		<comments>http://sitearticles.com/news/kleiner-perkins-invests-38-million-in-facebook/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 17:48:41 +0000</pubDate>
		<dc:creator>fskurt</dc:creator>
				<category><![CDATA[NEWS]]></category>

		<guid isPermaLink="false">http://sitearticles.com/?p=533</guid>
		<description><![CDATA[Storied Silicon Valley VC firm Kleiner Perkins is about to buy .0007% of Facebook for $38 million. Venture Wire first reported the deal,&#8221;The venture capital firm . . . is in the process of securing a stake in Facebook by investing $38 million from its $750 million debut digital growth fund, said two prospective investors.&#8221;]]></description>
			<content:encoded><![CDATA[<div><img class="alignleft size-full wp-image-534" title="FacebookLogo" src="http://sitearticles.com/wp-content/uploads/2011/02/FacebookLogo.jpg" alt="" width="204" height="69" />Storied Silicon Valley VC firm <a href="http://www.businessinsider.com/blackboard/kleiner-perkins">Kleiner Perkins</a> is <a href="http://twitter.com/danprimack/statuses/37167526349643776">about to buy</a> .0007% of <a href="http://www.businessinsider.com/blackboard/facebook">Facebook</a> for $38 million. <a href="https://www.fis.dowjones.com/WebBlogs.aspx?aid=DJFVW00020110214e72e0005l&amp;ProductIDFromApplication=&amp;r=wsjblog&amp;s=djfvw" target="_blank">Venture Wire</a> first reported the deal,&#8221;The venture capital firm . . . is in the process of securing a stake in Facebook by investing $38 million from its $750 million debut digital growth fund, said two prospective investors.&#8221;</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://sitearticles.com/news/kleiner-perkins-invests-38-million-in-facebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design Patterns &#8211; Part 4</title>
		<link>http://sitearticles.com/code/design-patterns-part-4/</link>
		<comments>http://sitearticles.com/code/design-patterns-part-4/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 22:50:45 +0000</pubDate>
		<dc:creator>fskurt</dc:creator>
				<category><![CDATA[CODE]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://sitearticles.com/?p=497</guid>
		<description><![CDATA[1.      Mediator: When you have two classes that are in need of each other, you might create a strong coupling between them. In other words, a simple change in one class can affect the other. This is not a good thing since one of the core concepts in object oriented programming is to reduce the [...]]]></description>
			<content:encoded><![CDATA[<p>1.      <span style="text-decoration: underline;">Mediator</span>: When you have two classes that are in need of each other, you might create a strong coupling between them. In other words, a simple change in one class can affect the other. This is not a good thing since one of the core concepts in object oriented programming is to reduce the coupling between classes. Doing so will reduce the amount of changes to the application when one of the classes does change. Having a mediator between the two classes gives us the solution we are looking for. I can ask the mediator to send some information to another class. The mediator takes care of the details. That means I do not have to know much about the other class. My only interface is the mediator. To illustrate this concept clearly, let’s create an example where the application class is sending a message to the database class. This is an easy concept to digest since we all know that there is at least one layer between the application layer and the database layer. We start first be creating the Application class and the Database class. Both of those classes inherit from the Layer class as see here:</p>
<p><span style="text-decoration: underline;"> </span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">abstract class Layer</p>
<p>{</p>
<p>protected   Mediator mediator;</p>
<p>public   Layer(Mediator m)</p>
<p>{</p>
<p>mediator = m;</p>
<p>}</p>
<p>public   abstract void   Send(string message);</p>
<p>public   abstract void   Notify(string message);</p>
<p>}</p>
<p>class Application : Layer</p>
<p>{</p>
<p>public   Application(Mediator mediator)</p>
<p>: base(mediator)</p>
<p>{ }</p>
<p>public   override void   Send(string message)</p>
<p>{</p>
<p>mediator.SendMessage(message, this);</p>
<p>}</p>
<p>public   override void   Notify(string message)</p>
<p>{</p>
<p>Console.WriteLine(&#8220;Application gets the message: {0}&#8221;,</p>
<p>message);</p>
<p>}</p>
<p>}</p>
<p>class Database : Layer</p>
<p>{</p>
<p>public   Database(Mediator mediator)</p>
<p>: base(mediator)</p>
<p>{ }</p>
<p>public   override void   Send(string message)</p>
<p>{</p>
<p>mediator.SendMessage(message, this);</p>
<p>}</p>
<p>public   override void   Notify(string message)</p>
<p>{</p>
<p>Console.WriteLine(&#8220;Database gets the message: {0}&#8221;,</p>
<p>message);</p>
<p>}</p>
<p>}</p>
<p><span style="text-decoration: underline;"> </span></td>
</tr>
</tbody>
</table>
<p><span style="text-decoration: underline;"> </span></p>
<p>We have not created the Mediator class yet, but at least we know that the Layer class has two methods to send message and notify the sender. These abstract methods are implemented in the Application and Database classes. Notice how sending the message is not happening directly, but instead it is using the mediator to do so. This is the key in this pattern. We are using the ‘this’ keyword as a second parameter to know which class is sending the message.</p>
<p>Now, let’s look at the Mediator and ConcreteMediator classes:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">abstract class Mediator</p>
<p>{</p>
<p>public   abstract void   SendMessage(</p>
<p>string   message, Layer layer);</p>
<p>}</p>
<p>class ConcreteMediator : Mediator</p>
<p>{</p>
<p>private   Application application;</p>
<p>private   Database database;</p>
<p>public   Application Application</p>
<p>{</p>
<p>set   { application = value; }</p>
<p>}</p>
<p>public   Database Database</p>
<p>{</p>
<p>set   { database = value; }</p>
<p>}</p>
<p>public   override void   SendMessage(string message, Layer layer)</p>
<p>{</p>
<p>if   (layer is Application)</p>
<p>database.Notify(message);</p>
<p>else   if (layer is Database)</p>
<p>application.Notify(message);</p>
<p>}</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>Since the mediator needs to know which classes it is mediating, we need to have instances for the Application class and the Database class. Then inside the SendMessage() method, we need to determine the type of layer to be able to send the correct notification.</p>
<p>Now that all the classes have been created, we can look at the main() method to see how the calls are taking place:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">static void Main(string[]   args)</p>
<p>{</p>
<p>ConcreteMediator   concreteMediator = new ConcreteMediator();</p>
<p>Application   application = new Application(concreteMediator);</p>
<p>Database   database = new Database(concreteMediator);</p>
<p>concreteMediator.Application =   application;</p>
<p>concreteMediator.Database =   database;</p>
<p>application.Send(&#8220;Update   the Employee table&#8221;);</p>
<p>database.Send(&#8220;Data changed; Update your window&#8221;);</p>
<p>Console.ReadLine();</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>We create instances of the three classes. We pass the mediator to the Application and the Database. We also used properties to set the application and database for the mediator. Finally, we send the messages. Here is the output:</p>
<p><img class="alignnone size-full wp-image-498" title="image002" src="http://sitearticles.com/wp-content/uploads/2011/01/image0025.jpg" alt="" width="521" height="39" /></p>
<p><span style="text-decoration: underline;"> </span></p>
<p>2.      <span style="text-decoration: underline;">Observer</span>: When developing applications, you most likely ran into cases when a change in the data store (database, xml file…) needs to be reflected in the UI. Say you have added a new account type and you need to update the account type drop down list. Or, when you are writing a game application, all the soldiers on the screen need to be aware of an enemy appearing from behind a tank. These examples have something in common: dependency. When one object changes state, other objects need to be notified to take action. This is the purpose of the observer pattern. As the name implies, an observer is an object “watching” other objects. As soon as these objects change somehow, the observer alerts the objects in its list about the change. The example we are going to tackle is about a list of employees that need to be notified when a meeting changes. So, let’s start by creating the Employee class and its interface:</p>
<p><span style="text-decoration: underline;"> </span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">interface IEmployee</p>
<p>{</p>
<p>void   Update(Meeting meeting);</p>
<p>}</p>
<p>class Employee : IEmployee</p>
<p>{</p>
<p>private   string name;</p>
<p>private   Meeting meeting;</p>
<p>public   Employee(string name)</p>
<p>{</p>
<p>this.name   = name;</p>
<p>}</p>
<p>public   Meeting Meeting</p>
<p>{</p>
<p>get   { return meeting; }</p>
<p>set   { meeting = value; }</p>
<p>}</p>
<p>public   void Update(Meeting   meeting)</p>
<p>{</p>
<p>Console.WriteLine(&#8220;{0} has been notified about the</p>
<p>meeting\n {1}&#8221;, name, meeting);</p>
<p>}</p>
<p>}</p>
<p><span style="text-decoration: underline;"> </span></td>
</tr>
</tbody>
</table>
<p><span style="text-decoration: underline;"> </span></p>
<p>As you can see, the Employee class has a Meeting class as a member (this will be declared soon).  The Update method will be called every time there is as update.</p>
<p>Here is the declaration for the Meeting class:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">class Meeting</p>
<p>{</p>
<p>private   string subject;</p>
<p>private   DateTime when;</p>
<p>private   List&lt;IEmployee&gt;   employees = new List&lt;IEmployee&gt;();</p>
<p>public   Meeting(string subject, DateTime when)</p>
<p>{</p>
<p>this.subject   = subject;</p>
<p>this.when   = when;</p>
<p>}</p>
<p>public   DateTime When</p>
<p>{</p>
<p>get   { return when; }</p>
<p>set</p>
<p>{</p>
<p>if   (when != value)</p>
<p>{</p>
<p>when = value;</p>
<p>Notify();</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>public   void Attach(IEmployee   employee)</p>
<p>{</p>
<p>employees.Add(employee);</p>
<p>}</p>
<p>public   void Detach(IEmployee   employee)</p>
<p>{</p>
<p>employees.Remove(employee);</p>
<p>}</p>
<p>public   void Notify()</p>
<p>{</p>
<p>foreach   (IEmployee employee in employees)</p>
<p>employee.Update(this);</p>
<p>Console.WriteLine();</p>
<p>}</p>
<p>public   override string   ToString()</p>
<p>{</p>
<p>return   string.Format(&#8220;Subject:   {0}, When: {1}&#8221;, subject, when);</p>
<p>}</p>
<p>}</p>
<p>class BudgetMeeting : Meeting</p>
<p>{</p>
<p>public   BudgetMeeting(string subject, DateTime when)</p>
<p>: base(subject,   when)</p>
<p>{ }</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>The key point here is that the Meeting class has a list of employees that can be notified of the change. The When property, upon a change (set), will notify this list. We can add and remove employees to be notifies using the methods Attach() and Detach(). The method Notify() will loop over the list and call the Update method. The BudgetMeeting class is nothing more than a concrete meeting.</p>
<p>Let’s see how we can use these classes:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">static void Main(string[]   args)</p>
<p>{</p>
<p>BudgetMeeting   meeting =</p>
<p>new   BudgetMeeting(&#8220;Budget   Discussion&#8221;, DateTime.Now);</p>
<p>meeting.Attach(new Employee(&#8220;James&#8221;));</p>
<p>meeting.Attach(new Employee(&#8220;Lisa&#8221;));</p>
<p>meeting.When = DateTime.Now.AddDays(2);</p>
<p>meeting.When = DateTime.Now.AddDays(7);</p>
<p>meeting.When = DateTime.Now.AddDays(12);</p>
<p>Console.ReadLine();</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>You notice that we create a meeting, attach some employees, and change the time using When. Here is how the output will look like:</p>
<p><img class="alignnone size-full wp-image-499" title="image004" src="http://sitearticles.com/wp-content/uploads/2011/01/image0045.jpg" alt="" width="468" height="181" /></p>
<p><span style="text-decoration: underline;"> </span></p>
<p><span style="text-decoration: underline;"> </span></p>
<p>3.      <span style="text-decoration: underline;">Strategy</span>: In this design pattern, you are looking at many algorithms to solve a certain problem. Any of these algorithms is a standalone solution that can be easily pluggable to get the job done. We can exchange any of these algorithms with minimal or no impact on the client that uses it. Let’s take, for example, the case of displaying students’ grades. We have different strategies on how these grades will be displayed (we can display them in ascending order, descending order, letters or numeric, and so on…). We will implement different strategies for that. Then, we will use these strategies in different contexts to get the ultimate job of displaying the grades.</p>
<p>In the first set of code, we will look at the different strategies, then the context, and finally, how to put the whole thing together in the main method. Here are the different strategies:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">abstract class GradeStrategy</p>
<p>{</p>
<p>public   abstract void   DisplayGrades(List&lt;double&gt; grades);</p>
<p>}</p>
<p>class LowestGradeFirstStrategy : GradeStrategy</p>
<p>{</p>
<p>public override   void DisplayGrades(List&lt;double&gt; grades)</p>
<p>{</p>
<p>grades.Sort();</p>
<p>grades.ForEach(g =&gt; Console.Write(g + &#8220;  &#8220;));</p>
<p>Console.WriteLine(&#8220;\n&#8221;);</p>
<p>}</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>As you can see, we start with the abstract GradeStrategy that defines the skeleton. Then we move into the strategy that displays the grades in the ascending order. We passed a lambda expression to the ForEach loop. For every g (a grade that is) we print its value on the console. We do not have to define what g is. It is understood from the context. You could simply use a for loop and print the values without using lambda expressions, of course. Then, we move into defining the other strategies:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">class HighestGradeFirstStrategy : GradeStrategy</p>
<p>{</p>
<p>public   override void   DisplayGrades(List&lt;double&gt; grades)</p>
<p>{</p>
<p>grades.Sort((x,y) =&gt;   y.CompareTo(x));</p>
<p>grades.ForEach(g =&gt; Console.Write(g + &#8220;  &#8220;));</p>
<p>Console.WriteLine(&#8220;\n&#8221;);</p>
<p>}</p>
<p>}</p>
<p>class LetterGradeStrategy : GradeStrategy</p>
<p>{</p>
<p>public   override void   DisplayGrades(List&lt;double&gt; grades)</p>
<p>{</p>
<p>List&lt;string&gt; letterGrades = grades.ConvertAll(</p>
<p>new   Converter&lt;double,   string&gt;(IntToGrade));</p>
<p>letterGrades.Sort();</p>
<p>letterGrades.ForEach(g =&gt; Console.Write(g + &#8220;  &#8220;));</p>
<p>Console.WriteLine(&#8220;\n&#8221;);</p>
<p>}</p>
<p>static   string IntToGrade(double   x)</p>
<p>{</p>
<p>if   (x &gt;= 90) return &#8220;A&#8221;;</p>
<p>else   if (x &gt;= 80) return   &#8220;B&#8221;;</p>
<p>else   if (x &gt;= 70) return   &#8220;C&#8221;;</p>
<p>else   if (x &gt;= 60) return   &#8220;D&#8221;;</p>
<p>else   return &#8220;F&#8221;;</p>
<p>}</p>
<p>}</p>
<p>class DiffFromAverageStrategy : GradeStrategy</p>
<p>{</p>
<p>public   override void   DisplayGrades(List&lt;double&gt; grades)</p>
<p>{</p>
<p>double   sum = grades.Sum();</p>
<p>double   average = sum / grades.Count;</p>
<p>Console.WriteLine(&#8220;Average is: {0}&#8221;, average);</p>
<p>grades.ForEach(g =&gt; Console.Write((g &#8211; average) + &#8220;  &#8220;));</p>
<p>Console.WriteLine(&#8220;\n&#8221;);</p>
<p>}</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>The other strategies follow the same pattern. But notice how I am using  the ConvertAll() method that takes a method that accepts number grades and covert them to letter grades.</p>
<p>After defining the strategies, we need to create a context that we can use to switch between the strategies depending on our needs. Here is how this class will look like:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">class Context</p>
<p>{</p>
<p>private   List&lt;double&gt;   grades = new List&lt;double&gt;();</p>
<p>private   GradeStrategy strategy;</p>
<p>public   void SetStrategy(GradeStrategy   strategy)</p>
<p>{</p>
<p>this.strategy   = strategy;</p>
<p>}</p>
<p>public   void Add(double   grade)</p>
<p>{</p>
<p>grades.Add(grade);</p>
<p>}</p>
<p>public   void DisplayGrades()</p>
<p>{</p>
<p>strategy.DisplayGrades(grades);</p>
<p>}</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>This class is simple. It contains a GradeStrategy that we can set, and a list of grades that we can populate. Calling DisplayGrades() will call the method of the appropriate strategy that we already set. Now, the main method will make use of the context and the strategies as follows:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">static void Main(string[]   args)</p>
<p>{</p>
<p>Context   context = new Context();</p>
<p>context.Add(80.5);</p>
<p>context.Add(92);</p>
<p>context.Add(78.5);</p>
<p>context.Add(75);</p>
<p>context.Add(98.75);</p>
<p>context.Add(45.25);</p>
<p>context.Add(50);</p>
<p>context.Add(64);</p>
<p>context.Add(88);</p>
<p>context.Add(30);</p>
<p>context.Add(79);</p>
<p>context.SetStrategy(new LowestGradeFirstStrategy());</p>
<p>context.DisplayGrades();</p>
<p>context.SetStrategy(new HighestGradeFirstStrategy());</p>
<p>context.DisplayGrades();</p>
<p>context.SetStrategy(new LetterGradeStrategy());</p>
<p>context.DisplayGrades();</p>
<p>context.SetStrategy(new DiffFromAverageStrategy());</p>
<p>context.DisplayGrades();</p>
<p>Console.ReadLine();</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>From the main method, you can notice that core concept behind this pattern: see how we can easily switch between strategies to get the job done. Finally, the output will be as such:</p>
<p><img class="alignnone size-full wp-image-500" title="image006" src="http://sitearticles.com/wp-content/uploads/2011/01/image0064.jpg" alt="" width="437" height="116" /></p>
<p><span style="text-decoration: underline;"> </span></p>
<p><span style="text-decoration: underline;"> </span></p>
<p><span style="text-decoration: underline;"> </span></p>
<p>4.      <span style="text-decoration: underline;">Visitor</span>: In this pattern, we have an operation that needs to be performed on the elements of a certain object. The terminology here is that the first object will “accept” a visitor, and the second object “visits” the first and performs some operation. The key point to keep in mind here is that you do not need the two objects to be tightly coupled. To illustrate, we look at the example of having a list of books. This list will accept a reviewer and a publisher. So, we have a book (with different variations like programming and database and such), a collection of these books, a reviewer visitor and a publisher visitor.</p>
<p>We start first by creating the books:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">abstract class Publication</p>
<p>{</p>
<p>public   abstract void   Accept(IVisitor visitor);</p>
<p>}</p>
<p>class Book : Publication</p>
<p>{</p>
<p>private   string title;</p>
<p>private   string author;</p>
<p>private   decimal price;</p>
<p>public   Book(string title, string   author, decimal price)</p>
<p>{</p>
<p>this.title   = title;</p>
<p>this.author   = author;</p>
<p>this.price   = price;</p>
<p>}</p>
<p>public   string Title</p>
<p>{</p>
<p>get   { return title; }</p>
<p>set   { title = value; }</p>
<p>}</p>
<p>public   string Author</p>
<p>{</p>
<p>get   { return author; }</p>
<p>set   { author = value; }</p>
<p>}</p>
<p>public   decimal Price</p>
<p>{</p>
<p>get   { return price; }</p>
<p>set   { price = value; }</p>
<p>}</p>
<p>public   override string   ToString()</p>
<p>{</p>
<p>return   string.Format(&#8220;Title:   {0}, Author: {1}, Price: {2}&#8221;,</p>
<p>title, author, price);</p>
<p>}</p>
<p>public   override void   Accept(IVisitor visitor)</p>
<p>{</p>
<p>visitor.Visit(this);</p>
<p>}</p>
<p>}</p>
<p>class Programming : Book</p>
<p>{</p>
<p>public   Programming() :</p>
<p>base(&#8220;C#&#8221;, &#8220;King&#8221;,   65.95m)</p>
<p>{}</p>
<p>}</p>
<p>class Database : Book</p>
<p>{</p>
<p>public   Database() :</p>
<p>base(&#8220;SQL Server&#8221;, &#8220;Johnson&#8221;,   49.99m)</p>
<p>{}</p>
<p>}</p>
<p>class Design : Book</p>
<p>{</p>
<p>public   Design() :</p>
<p>base(&#8220;Software Design&#8221;, &#8220;Smith&#8221;, 55.45m)</p>
<p>{ }</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>You notice that we create a Book, Programming, Database, and Design. The Book inherits from Publication, and accepts a Visitor (that we have not created yet). We passed ‘this’ into the Visit() method because the visitor is visiting the current class we are implementing. Everything else in the code is straightforward.</p>
<p>Before we look at the visitor classes, we need to create the book collection:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">class Books</p>
<p>{</p>
<p>private List&lt;Book&gt;   books = new List&lt;Book&gt;();</p>
<p>public   void Attach(Book   b)</p>
<p>{</p>
<p>books.Add(b);</p>
<p>}</p>
<p>public   void Detach(Book   b)</p>
<p>{</p>
<p>books.Remove(b);</p>
<p>}</p>
<p>public   void Accept(IVisitor   visitor)</p>
<p>{</p>
<p>foreach   (Book b in   books)</p>
<p>{</p>
<p>b.Accept(visitor);</p>
<p>}</p>
<p>Console.WriteLine();</p>
<p>}</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>Here, we have added the flexibility of attaching and detaching books, and also adding the Accept() method so the visitor can visit the books in the collection one at a time.</p>
<p>Next, let’s look at the visitor classes:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">interface IVisitor</p>
<p>{</p>
<p>void   Visit(Publication publication);</p>
<p>}</p>
<p>class ReviewerVisitor : IVisitor</p>
<p>{</p>
<p>public   void Visit(Publication   publication)</p>
<p>{</p>
<p>Book   b = publication as Book;</p>
<p>Console.WriteLine(&#8220;The book {0} has been reviewed&#8221;, b);</p>
<p>}</p>
<p>}</p>
<p>class PublisherVisitor : IVisitor</p>
<p>{</p>
<p>public   void Visit(Publication   publication)</p>
<p>{</p>
<p>Book   b = publication as Book;</p>
<p>Console.WriteLine(&#8220;The book {0} has been published&#8221;, b);</p>
<p>}</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>The reviewer visits the book and simulates the review process, and the publisher visits the book and simulates the publishing process.</p>
<p>The main method puts them together nicely:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="738" valign="top">static void Main(string[]   args)</p>
<p>{</p>
<p>Books   books = new Books();</p>
<p>books.Attach(new Programming());</p>
<p>books.Attach(new Database());</p>
<p>books.Attach(new Design());</p>
<p>IVisitor   reviewer = new ReviewerVisitor();</p>
<p>books.Accept(reviewer);</p>
<p>IVisitor   publisher = new PublisherVisitor();</p>
<p>books.Accept(publisher);</p>
<p>Console.ReadLine();</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>Now you can see how we attached a list of books to the books collection, and how the books collection then accepts two visitors (a reviewer and a publisher).</p>
<p><span style="text-decoration: underline;">Conclusion</span>: As the applications are getting more and more complex, the importance for design patterns is becoming more and more apparent. Every design pattern we experimented with in this article has its use in software development. As developers, we try to keep an eye on our applications and requirements to see where one of those design patterns would fit. Having said that, it is important to understand that just because these patterns are handy and well structured, it does not mean that we have to plug them all over the place. Selecting the appropriate design pattern for a specific scenario requires knowledge and experience. But when the correct pattern is used, you will definitely realize that your application is well structured and flexible to changes in user requirements to say the least.<br />
﻿
<p><a href="http://sitearticles.com/code/introduction-to-design-patterns-using-c/">Part 1</a> &#8211; <a href="http://sitearticles.com/code/design-patterns-part-2/">Part 2</a> &#8211; <a href="http://sitearticles.com/code/design-patterns-part-3/">Part 3</a> &#8211; <a href="http://sitearticles.com/code/design-patterns-part-4/">Part 4</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sitearticles.com/code/design-patterns-part-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

