<?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>Kostas Mamalis blog</title>
	<atom:link href="http://kmamalis.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kmamalis.wordpress.com</link>
	<description>Κώστας Μάμαλης - Code &#38; script techniques/tricks/solutions</description>
	<lastBuildDate>Wed, 20 May 2009 08:53:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='kmamalis.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Kostas Mamalis blog</title>
		<link>http://kmamalis.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://kmamalis.wordpress.com/osd.xml" title="Kostas Mamalis blog" />
	<atom:link rel='hub' href='http://kmamalis.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Can&#8217;t you find the Remote Desktop icon? no worries! that&#8217;s what Run: is there for!</title>
		<link>http://kmamalis.wordpress.com/2009/05/20/cant-you-find-the-remote-desktop-icon-no-worries-thats-what-run-is-there-for/</link>
		<comments>http://kmamalis.wordpress.com/2009/05/20/cant-you-find-the-remote-desktop-icon-no-worries-thats-what-run-is-there-for/#comments</comments>
		<pubDate>Wed, 20 May 2009 08:37:19 +0000</pubDate>
		<dc:creator>truth4all</dc:creator>
				<category><![CDATA[Windows (XP/Vista) tips & tricks]]></category>

		<guid isPermaLink="false">http://kmamalis.wordpress.com/?p=44</guid>
		<description><![CDATA[If you can&#8217;t find the remote desktop icon in the start menu of your windows then you just need to use the Start &#62; Run and type: mstsc and ta-ta! there&#8217;s your remote connection window on your screen! enjoy&#8230;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=44&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you can&#8217;t find the remote desktop icon in the start menu of your windows then you just need to use the</p>
<p>Start &gt; Run</p>
<p>and type: <strong>mstsc</strong></p>
<p>and ta-ta! there&#8217;s your remote connection window on your screen! enjoy&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kmamalis.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kmamalis.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kmamalis.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kmamalis.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kmamalis.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kmamalis.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kmamalis.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kmamalis.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kmamalis.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kmamalis.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kmamalis.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kmamalis.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kmamalis.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kmamalis.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=44&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kmamalis.wordpress.com/2009/05/20/cant-you-find-the-remote-desktop-icon-no-worries-thats-what-run-is-there-for/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccb422ecffb517a12f3b062c64d33347?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">truth4all</media:title>
		</media:content>
	</item>
		<item>
		<title>Count unique values in Excel</title>
		<link>http://kmamalis.wordpress.com/2009/05/19/count-unique-values-in-excel/</link>
		<comments>http://kmamalis.wordpress.com/2009/05/19/count-unique-values-in-excel/#comments</comments>
		<pubDate>Tue, 19 May 2009 11:41:19 +0000</pubDate>
		<dc:creator>truth4all</dc:creator>
				<category><![CDATA[Excel/VBA]]></category>

		<guid isPermaLink="false">http://kmamalis.wordpress.com/?p=39</guid>
		<description><![CDATA[Step 1: Use the following formula in a cell of your preference which will hold the unique values counter Note: replace the B2:B16 range to your cell range =SUM(IF(FREQUENCY(IF(LEN(B2:B16)&#62;0,MATCH(B2:B16,B2:B16,0),&#8221;"), IF(LEN(B2:B16)&#62;0,MATCH(B2:B16,B2:B16,0),&#8221;"))&#62;0,1)) Step 2: Don&#8217;t press Enter. Instead press Ctrl+Shift+Enter !!! and job done&#8230;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=39&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Step 1: Use the following formula in a cell of your preference which will hold the unique values counter</p>
<p>Note: replace the <em><strong>B2:B16</strong></em> range to your cell range</p>
<blockquote>
<h3><span style="color:#333399;">=SUM(IF(FREQUENCY(IF(LEN(B2:B16)&gt;0,MATCH(B2:B16,B2:B16,0),&#8221;"), IF(LEN(B2:B16)&gt;0,MATCH(B2:B16,B2:B16,0),&#8221;"))&gt;0,1))</span></h3>
</blockquote>
<p>Step 2: Don&#8217;t press Enter. Instead press Ctrl+Shift+Enter !!!</p>
<p>and job done&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kmamalis.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kmamalis.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kmamalis.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kmamalis.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kmamalis.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kmamalis.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kmamalis.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kmamalis.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kmamalis.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kmamalis.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kmamalis.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kmamalis.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kmamalis.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kmamalis.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=39&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kmamalis.wordpress.com/2009/05/19/count-unique-values-in-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccb422ecffb517a12f3b062c64d33347?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">truth4all</media:title>
		</media:content>
	</item>
		<item>
		<title>VIM commands cheat sheet</title>
		<link>http://kmamalis.wordpress.com/2009/03/30/vim-commands-cheat-sheet/</link>
		<comments>http://kmamalis.wordpress.com/2009/03/30/vim-commands-cheat-sheet/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 15:41:32 +0000</pubDate>
		<dc:creator>truth4all</dc:creator>
				<category><![CDATA[Unix/Perl/Scripting tips]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://kmamalis.wordpress.com/?p=33</guid>
		<description><![CDATA[&#60; The list of Vim commands &#62; Working with files Vim command Action :e filename Open a new file. You can use the Tab key for automatic file name completion, just like at the shell command prompt. :w filename Save changes to a file. If you don&#8217;t specify a file name, Vim saves as the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=33&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2 class="mnonsense">&lt; <strong><span class="mtitle">The list of Vim commands</span></strong> &gt;</h2>
<table class="tuxtable" border="1" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td class="tuxtitle" colspan="2"><em><strong>Working with files</strong></em></td>
</tr>
<tr>
<td class="tuxtext"><em>Vim command</em></td>
<td class="tuxtext"><em>Action</em></td>
</tr>
<tr>
<td class="tuxtext">:e filename</td>
<td class="tuxtext">Open a new file. You can use the Tab key for automatic file name completion, just like at the shell command prompt.</td>
</tr>
<tr>
<td class="tuxtext">:w filename</td>
<td class="tuxtext">Save changes to a file. If you don&#8217;t specify a file name, Vim saves as the file name you were editing. For saving the file under a different name, specify the file name.</td>
</tr>
<tr>
<td class="tuxtext">:q</td>
<td class="tuxtext">Quit Vim. If you have unsaved changes, Vim refuses to exit.</td>
</tr>
<tr>
<td class="tuxtext">:q!</td>
<td class="tuxtext">Exit Vim without saving changes.</td>
</tr>
<tr>
<td class="tuxtext">:wq</td>
<td class="tuxtext">Write the file and exit.</td>
</tr>
<tr>
<td class="tuxtext">: x</td>
<td class="tuxtext">Almost the same as :wq, write the file and exit if you&#8217;ve made changes to the file. If you haven&#8217;t made any changes to the file, Vim exits without writing the file.</td>
</tr>
<tr>
<td class="tuxtitle" colspan="2"><em><strong>Moving in the file</strong></em></td>
</tr>
<tr>
<td class="tuxtext" colspan="2">These Vim commands and keys work both in command mode and visual mode.</td>
</tr>
<tr>
<td class="tuxtext"><em>Vim command</em></td>
<td class="tuxtext"><em>Action</em></td>
</tr>
<tr>
<td class="tuxtext">j or Up Arrow</td>
<td class="tuxtext">Move the cursor up one line.</td>
</tr>
<tr>
<td class="tuxtext">k or Down Arrow</td>
<td class="tuxtext">Down one line.</td>
</tr>
<tr>
<td class="tuxtext">l or Right Arrow</td>
<td class="tuxtext">Right one character.</td>
</tr>
<tr>
<td class="tuxtext">h or Left Arrow</td>
<td class="tuxtext">Left one character.</td>
</tr>
<tr>
<td class="tuxtext">e</td>
<td class="tuxtext">To the end of a word.</td>
</tr>
<tr>
<td class="tuxtext">E</td>
<td class="tuxtext">To the end of a whitespace-delimited word.</td>
</tr>
<tr>
<td class="tuxtext">b</td>
<td class="tuxtext">To the beginning of a word.</td>
</tr>
<tr>
<td class="tuxtext">B</td>
<td class="tuxtext">To the beginning of a whitespace-delimited word.</td>
</tr>
<tr>
<td class="tuxtext">0</td>
<td class="tuxtext">To the beginning of a line.</td>
</tr>
<tr>
<td class="tuxtext">^</td>
<td class="tuxtext">To the first non-whitespace character of a line.</td>
</tr>
<tr>
<td class="tuxtext">$</td>
<td class="tuxtext">To the end of a line.</td>
</tr>
<tr>
<td class="tuxtext">H</td>
<td class="tuxtext">To the first line of the screen.</td>
</tr>
<tr>
<td class="tuxtext">M</td>
<td class="tuxtext">To the middle line of the screen.</td>
</tr>
<tr>
<td class="tuxtext">L</td>
<td class="tuxtext">To the the last line of the screen.</td>
</tr>
<tr>
<td class="tuxtext">:<em>n</em></td>
<td class="tuxtext">Jump to line number <em>n</em>. For example, to jump to line 42, you&#8217;d type :42</td>
</tr>
<tr>
<td class="tuxtitle" colspan="2"><em><strong>Inserting and overwriting text</strong></em></td>
</tr>
<tr>
<td class="tuxtext"><em>Vim command</em></td>
<td class="tuxtext"><em>Action</em></td>
</tr>
<tr>
<td class="tuxtext">i</td>
<td class="tuxtext">Insert before cursor.</td>
</tr>
<tr>
<td class="tuxtext">I</td>
<td class="tuxtext">Insert to the start of the current line.</td>
</tr>
<tr>
<td class="tuxtext">a</td>
<td class="tuxtext">Append after cursor.</td>
</tr>
<tr>
<td class="tuxtext">A</td>
<td class="tuxtext">Append to the end of the current line.</td>
</tr>
<tr>
<td class="tuxtext">o</td>
<td class="tuxtext">Open a new line below and insert.</td>
</tr>
<tr>
<td class="tuxtext">O</td>
<td class="tuxtext">Open a new line above and insert.</td>
</tr>
<tr>
<td class="tuxtext">C</td>
<td class="tuxtext">Change the rest of the current line.</td>
</tr>
<tr>
<td class="tuxtext">r</td>
<td class="tuxtext">Overwrite one character. After overwriting the single character, go back to command mode.</td>
</tr>
<tr>
<td class="tuxtext">R</td>
<td class="tuxtext">Enter insert mode but replace characters rather than inserting.</td>
</tr>
<tr>
<td class="tuxtext">The ESC key</td>
<td class="tuxtext">Exit insert/overwrite mode and go back to command mode.</td>
</tr>
<tr>
<td class="tuxtitle" colspan="2"><em><strong>Deleting text</strong></em></td>
</tr>
<tr>
<td class="tuxtext"><em>Vim command</em></td>
<td class="tuxtext"><em>Action</em></td>
</tr>
<tr>
<td class="tuxtext">x</td>
<td class="tuxtext">Delete characters under the cursor.</td>
</tr>
<tr>
<td class="tuxtext">X</td>
<td class="tuxtext">Delete characters before the cursor.</td>
</tr>
<tr>
<td class="tuxtext">dd or :d</td>
<td class="tuxtext">Delete the current line.</td>
</tr>
<tr>
<td class="tuxtitle" colspan="2"><em><strong>Entering visual mode</strong></em></td>
</tr>
<tr>
<td class="tuxtext"><em>Vim command</em></td>
<td class="tuxtext"><em>Action</em></td>
</tr>
<tr>
<td class="tuxtext">v</td>
<td class="tuxtext">Start highlighting characters. Use the normal <a href="http://www.tuxfiles.org/linuxhelp/vimcheat.html#nav">movement keys and commands</a> to select text for highlighting.</td>
</tr>
<tr>
<td class="tuxtext">V</td>
<td class="tuxtext">Start highlighting lines.</td>
</tr>
<tr>
<td class="tuxtext">The ESC key</td>
<td class="tuxtext">Exit visual mode and return to command mode.</td>
</tr>
<tr>
<td class="tuxtitle" colspan="2"><em><strong>Editing blocks of text</strong></em></td>
</tr>
<tr>
<td class="tuxtext" colspan="2">The Vim commands marked with (V) work in visual mode, when you&#8217;ve selected some text. The other commands work in the command mode, when you haven&#8217;t selected any text.</td>
</tr>
<tr>
<td class="tuxtext"><em>Vim command</em></td>
<td class="tuxtext"><em>Action</em></td>
</tr>
<tr>
<td class="tuxtext">~</td>
<td class="tuxtext">Change the case of characters. This works both in visual and command mode. In visual mode, change the case of highlighted characters. In command mode, change the case of the character uder cursor.</td>
</tr>
<tr>
<td class="tuxtext">&gt; (V)</td>
<td class="tuxtext">Shift right.</td>
</tr>
<tr>
<td class="tuxtext">&lt; (V)</td>
<td class="tuxtext">Shift left.</td>
</tr>
<tr>
<td class="tuxtext">c (V)</td>
<td class="tuxtext">Change the highlighted text.</td>
</tr>
<tr>
<td class="tuxtext">y (V)</td>
<td class="tuxtext">Yank the highlighted text. In Winblows terms, &#8220;copy the selected text to clipboard.&#8221;</td>
</tr>
<tr>
<td class="tuxtext">d (V)</td>
<td class="tuxtext">Delete the highlighted text. In Winblows terms, &#8220;cut the selected text to clipboard.&#8221;</td>
</tr>
<tr>
<td class="tuxtext">yy or :y or Y</td>
<td class="tuxtext">Yank the current line. You don&#8217;t need to highlight it first.</td>
</tr>
<tr>
<td class="tuxtext">dd or :d</td>
<td class="tuxtext">Delete the current line. Again, you don&#8217;t need to highlight it first.</td>
</tr>
<tr>
<td class="tuxtext">p</td>
<td class="tuxtext">In Winblows terms, &#8220;paste&#8221; the contents of the &#8220;clipboard&#8221;. In Vim terms, you &#8220;put&#8221; the text you yanked or deleted. Put characters after the cursor. Put lines below the current line.</td>
</tr>
<tr>
<td class="tuxtext">P</td>
<td class="tuxtext">Put characters before the cursor. Put lines above the current line.</td>
</tr>
<tr>
<td class="tuxtitle" colspan="2"><em><strong>Undo and redo</strong></em></td>
</tr>
<tr>
<td class="tuxtext"><em>Vim command</em></td>
<td class="tuxtext"><em>Action</em></td>
</tr>
<tr>
<td class="tuxtext">u</td>
<td class="tuxtext">Undo the last action.</td>
</tr>
<tr>
<td class="tuxtext">U</td>
<td class="tuxtext">Undo all the latest changes that were made to the current line.</td>
</tr>
<tr>
<td class="tuxtext">Ctrl + r</td>
<td class="tuxtext">Redo.</td>
</tr>
<tr>
<td class="tuxtitle" colspan="2"><em><strong>Search</strong></em></td>
</tr>
<tr>
<td class="tuxtext"><em>Vim command</em></td>
<td class="tuxtext"><em>Action</em></td>
</tr>
<tr>
<td class="tuxtext">/<em>pattern</em></td>
<td class="tuxtext">Search the file for <em>pattern</em>.</td>
</tr>
<tr>
<td class="tuxtext">n</td>
<td class="tuxtext">Scan for next search match in the same direction.</td>
</tr>
<tr>
<td class="tuxtext">N</td>
<td class="tuxtext">Scan for next search match but opposite direction.</td>
</tr>
<tr>
<td class="tuxtitle" colspan="2"><em><strong>Replace</strong></em></td>
</tr>
<tr>
<td class="tuxtext"><em>Vim command</em></td>
<td class="tuxtext"><em>Action</em></td>
</tr>
<tr>
<td class="tuxtext">:<em>r</em>s/<em>foo</em>/<em>bar</em>/<em>a</em></td>
<td class="tuxtext">Substitute <em>foo</em> with <em>bar</em>. <em>r</em> determines the range and <em>a</em> determines the arguments.</td>
</tr>
<tr>
<td class="tuxtext" colspan="2">The range (<em>r</em>) can be</td>
</tr>
<tr>
<td class="tuxtext">nothing</td>
<td class="tuxtext">Work on current line only.</td>
</tr>
<tr>
<td class="tuxtext">number</td>
<td class="tuxtext">Work on the line whose number you give.</td>
</tr>
<tr>
<td class="tuxtext">%</td>
<td class="tuxtext">The whole file.</td>
</tr>
<tr>
<td class="tuxtext" colspan="2">Arguments (<em>a</em>) can be</td>
</tr>
<tr>
<td class="tuxtext">g</td>
<td class="tuxtext">Replace all occurrences in the line. Without this, Vim replaces only the first occurrences in each line.</td>
</tr>
<tr>
<td class="tuxtext">i</td>
<td class="tuxtext">Ignore case for the search pattern.</td>
</tr>
<tr>
<td class="tuxtext">I</td>
<td class="tuxtext">Don&#8217;t ignore case.</td>
</tr>
<tr>
<td class="tuxtext">c</td>
<td class="tuxtext">Confirm each substitution. You can type y to substitute this match, n to skip this match, a to substitute this and all the remaining matches (&#8220;Yes to all&#8221;), and q to quit substitution.</td>
</tr>
<tr>
<td class="tuxtext" colspan="2">Examples</td>
</tr>
<tr>
<td class="tuxtext">:452s/<em>foo</em>/<em>bar</em>/</td>
<td class="tuxtext">Replace the first occurrence of the word <em>foo</em> with <em>bar</em> on line number 452.</td>
</tr>
<tr>
<td class="tuxtext">:s/<em>foo</em>/<em>bar</em>/g</td>
<td class="tuxtext">Replace every occurrence of the word <em>foo</em> with <em>bar</em> on current line.</td>
</tr>
<tr>
<td class="tuxtext">:%s/<em>foo</em>/<em>bar</em>/g</td>
<td class="tuxtext">Replace every occurrence of the word <em>foo</em> with <em>bar</em> in the whole file.</td>
</tr>
<tr>
<td class="tuxtext">:%s/<em>foo</em>/<em>bar</em>/gi</td>
<td class="tuxtext">The same as above, but ignore the case of the pattern you want to substitute. This replaces <em>foo</em>, <em>FOO</em>, <em>Foo</em>, and so on.</td>
</tr>
<tr>
<td class="tuxtext">:%s/<em>foo</em>/<em>bar</em>/gc</td>
<td class="tuxtext">Confirm every substitution.</td>
</tr>
<tr>
<td class="tuxtext">:%s/<em>foo</em>/<em>bar</em>/c</td>
<td class="tuxtext">For each line on the file, replace the first occurrence of <em>foo</em> with <em>bar</em> and confirm every substitution.</td>
</tr>
</tbody>
</table>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kmamalis.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kmamalis.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kmamalis.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kmamalis.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kmamalis.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kmamalis.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kmamalis.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kmamalis.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kmamalis.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kmamalis.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kmamalis.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kmamalis.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kmamalis.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kmamalis.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=33&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kmamalis.wordpress.com/2009/03/30/vim-commands-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccb422ecffb517a12f3b062c64d33347?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">truth4all</media:title>
		</media:content>
	</item>
		<item>
		<title>How to count elements using a specific Class to test in Selenium?</title>
		<link>http://kmamalis.wordpress.com/2008/09/23/how-to-get-elements-by-class-to-test-in-selenium/</link>
		<comments>http://kmamalis.wordpress.com/2008/09/23/how-to-get-elements-by-class-to-test-in-selenium/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 16:17:42 +0000</pubDate>
		<dc:creator>truth4all</dc:creator>
				<category><![CDATA[Fitnesse/Selenium]]></category>

		<guid isPermaLink="false">http://kmamalis.wordpress.com/?p=28</guid>
		<description><![CDATA[Sometimes it&#8217;s quite handy to count elements by Class, but&#8230; how can this be done? A good example is the following script which of course can be used in both storeEval or verifyEval functions of Selenium: javascript: { var searchClass = &#8220;name_of_class&#8221;; var tagName = &#8220;a&#8221;; //could be div, table, title etc. var pattern = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=28&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes it&#8217;s quite handy to count elements by Class, but&#8230; how can this be done? A good example is the following script which of course can be used in both storeEval or verifyEval functions of Selenium:</p>
<blockquote><p>javascript: {<br />
var searchClass = &#8220;name_of_class&#8221;;<br />
var tagName = &#8220;a&#8221;; //could be div, table, title etc.<br />
var pattern = new RegExp(&#8220;(^|\\\\s)&#8221;+searchClass+&#8221;(\\\\s|$)&#8221;);<br />
var elem;<br />
var totalElems ;<br />
var result;<br />
elem = selenium.browserbot.getCurrentWindow().document.getElementsByTagName(tagName);<br />
totalElems = elem.length;<br />
var i = 0;<br />
var counter ;<br />
for (i = 0, counter = 0; i &lt; totalElems; i++) {<br />
if ( pattern.test(elem[i].className) ) {<br />
counter++;<br />
}<br />
}<br />
result = counter; }</p></blockquote>
<p>As you can see there are 3 important variables for our DOM parsing:</p>
<ol>
<li>searchClass = should be assigned with the class name</li>
<li>tagname = that should include the tag name (e.g. div, table etc)</li>
<li>pattern = which specifies the pattern to be searched (uses searchClass variable)</li>
</ol>
<p>The result in our case is the counter of the &#8216;a&#8217; elements having class=&#8217;name_of_class&#8217;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kmamalis.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kmamalis.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kmamalis.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kmamalis.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kmamalis.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kmamalis.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kmamalis.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kmamalis.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kmamalis.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kmamalis.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kmamalis.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kmamalis.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kmamalis.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kmamalis.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=28&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kmamalis.wordpress.com/2008/09/23/how-to-get-elements-by-class-to-test-in-selenium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccb422ecffb517a12f3b062c64d33347?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">truth4all</media:title>
		</media:content>
	</item>
		<item>
		<title>How to test CSS changes due to Ajax validation?</title>
		<link>http://kmamalis.wordpress.com/2008/07/21/how-to-test-css-changes-due-to-ajax-validation/</link>
		<comments>http://kmamalis.wordpress.com/2008/07/21/how-to-test-css-changes-due-to-ajax-validation/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 15:53:14 +0000</pubDate>
		<dc:creator>truth4all</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kmamalis.wordpress.com/?p=24</guid>
		<description><![CDATA[Suppose you need to test a page that validates text fields by means of Ajax calls. In that page whenever validation takes place (e.g. on Lose Focus event) a new div appears. If validation passes that div uses .field passed CSS class, whereas for failure .field error class is used. How can we test that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=24&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Suppose you need to test a page that validates text fields by means of Ajax calls.</p>
<p>In that page whenever validation takes place (e.g. on Lose Focus event) a new div appears. If validation passes that div uses .field passed CSS class, whereas for failure .field error class is used.</p>
<p>How can we test that via Selenium?</p>
<p>The answer is simple: use css locator in our waitFor/verifyElementPresent statements:</p>
<p>As you can see <em>css= #passwordDiv.field.error</em> is referring to element with id=&#8217;<em>passwordDiv</em>&#8216; (we have to put # in front to make sure that it understands that we are using the web element id) which is using the &#8216;<em>.field error</em>&#8216; class from CSS.</p>
<table border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td>type</td>
<td>password</td>
<td>mat24</td>
</tr>
<tr>
<td>type</td>
<td>captcha</td>
<td>a</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>css=#passwordDiv.field.error</td>
<td></td>
</tr>
<tr>
<td>verifyText</td>
<td>passwordErrorMessage</td>
<td>password must be at least 7 charachters</td>
</tr>
</tbody>
</table>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kmamalis.wordpress.com/24/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kmamalis.wordpress.com/24/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kmamalis.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kmamalis.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kmamalis.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kmamalis.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kmamalis.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kmamalis.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kmamalis.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kmamalis.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kmamalis.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kmamalis.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kmamalis.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kmamalis.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kmamalis.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kmamalis.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=24&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kmamalis.wordpress.com/2008/07/21/how-to-test-css-changes-due-to-ajax-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccb422ecffb517a12f3b062c64d33347?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">truth4all</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaScript generated Unique IDs for Selenium (using timestamps)</title>
		<link>http://kmamalis.wordpress.com/2008/07/21/javascript-generated-unique-ids-for-selenium-using-timestamps/</link>
		<comments>http://kmamalis.wordpress.com/2008/07/21/javascript-generated-unique-ids-for-selenium-using-timestamps/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 15:38:16 +0000</pubDate>
		<dc:creator>truth4all</dc:creator>
				<category><![CDATA[Fitnesse/Selenium]]></category>

		<guid isPermaLink="false">http://kmamalis.wordpress.com/?p=22</guid>
		<description><![CDATA[Here is a good example on how to use unique strings to avoid failures due to repetitive execution of the same scripts. The following example makes use of the &#8216;storeEval&#8217; function which stores a timestamp preceded by a string (in our case just a single &#8216;a&#8217; character) into a variable called &#8216;timeStamp&#8217;: MyScript storeEval { [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=22&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a good example on how to use unique strings to avoid failures due to repetitive execution of the same scripts. The following example makes use of the &#8216;storeEval&#8217; function which stores a timestamp preceded by a string (in our case just a single &#8216;a&#8217; character) into a variable called &#8216;timeStamp&#8217;:</p>
<table border="1" cellspacing="1" cellpadding="1">
<thead>
<tr>
<td colspan="3">MyScript</td>
</tr>
</thead>
<tbody>
<tr>
<td>storeEval</td>
<td>{ Stamp = new Date(); year = Stamp.getYear() + 1900; month =  Stamp.getMonth(); day = Stamp.getDate(); var Hours; var Mins; var Time; Hours =  Stamp.getHours(); Mins = Stamp.getMinutes(); Secs = Stamp.getSeconds(); if (Mins  &lt; 10) { Mins = &#8220;0&#8243; + Mins; } if (Secs &lt; 10) { Secs = &#8220;0&#8243; + Secs; }  timestamp = &#8220;a&#8221; + year + month + day + Hours + Mins + Secs; }</td>
<td>timeStamp</td>
</tr>
<tr>
<td>echo</td>
<td>${timeStamp}</td>
</tr>
</tbody>
</table>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kmamalis.wordpress.com/22/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kmamalis.wordpress.com/22/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kmamalis.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kmamalis.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kmamalis.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kmamalis.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kmamalis.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kmamalis.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kmamalis.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kmamalis.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kmamalis.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kmamalis.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kmamalis.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kmamalis.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kmamalis.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kmamalis.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=22&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kmamalis.wordpress.com/2008/07/21/javascript-generated-unique-ids-for-selenium-using-timestamps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccb422ecffb517a12f3b062c64d33347?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">truth4all</media:title>
		</media:content>
	</item>
		<item>
		<title>Extend Selenium RC by means of .getEval method</title>
		<link>http://kmamalis.wordpress.com/2008/07/15/extend-selenium-rc-by-means-of-geteval-method/</link>
		<comments>http://kmamalis.wordpress.com/2008/07/15/extend-selenium-rc-by-means-of-geteval-method/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 11:49:16 +0000</pubDate>
		<dc:creator>truth4all</dc:creator>
				<category><![CDATA[Fitnesse/Selenium]]></category>

		<guid isPermaLink="false">http://kmamalis.wordpress.com/?p=21</guid>
		<description><![CDATA[One of the really cool things about Selenium Remote Control is that it gives you access to its JavaScript underpinnings using getEval. With this guy we can do something like this: public void testGetEval() throws Exception { selenium.open(TEST_PAGE_URL); //Using some JavaScript available from Selenium String childSpanTextSnippet = " {" + " var tdElem = this.page().findElement('id=theLastCell'); [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=21&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="entry">
<p>One of the really cool things about Selenium Remote Control is that it gives you access to its JavaScript underpinnings using <strong>getEval</strong>.  With this guy we can do something like this:</p>
<blockquote>
<pre>public void testGetEval()
      throws Exception
   {
      selenium.open(TEST_PAGE_URL);
      //Using some JavaScript available from Selenium
      String childSpanTextSnippet =
         " {" +
            " var tdElem = this.page().findElement('id=theLastCell'); " +
            " var tdChildSpans = tdElem.getElementsByTagName('span'); " +
            " var spanTexts = ''; " +
            " for(var i = 0; i &lt; tdChildSpans.length; i++) { " +
            "  if(i &gt; 0) spanTexts = spanTexts + ‘, ‘;   ” +
            ”  spanTexts = spanTexts + tdChildSpans.item(i).innerHTML; ” +
            ” }; ” +
            “spanTexts” +
            “}”;

      String texts = “row two, cell two”;
      assertEquals(texts, selenium.getEval(childSpanTextSnippet));
   }</pre>
</blockquote>
<p>If we place this in the test class we created in a <a href="http://www.bitmotif.com/selenium/selenium-remote-control-for-java-a-tutorial-part-2/">previous tutorial</a> and run it, we should see a green bar.  Pretty cool, eh?</p>
<p>So, what’s going on here? Basically, we are using Selenium to execute a snippit of JavaScript. What’s more, in our snippet we can use functions defined in Selenium Core, in this case <strong>findElement</strong>. The function accepts all the different types of locators to try to find an element in the DOM. After we get the element, we do some processing, and we get the results back in Java land as a String.</p>
<p>We aren’t limited to using what is provided by Selenium.  Consider the following:</p>
<blockquote>
<pre> public void testGetEval_UsePlainJavaScript()
      throws Exception
   {
      selenium.open(TEST_PAGE_URL);

      String firstTitleSnippet =
            "{" +
            " var bodyElem = document.getElementsByTagName('title')[0]; " +
            " bodyElem.innerHTML; " +
            "}";

      assertEquals("Selenium Functional Test Runner", selenium.getEval(firstTitleSnippet));
   }</pre>
</blockquote>
<p>By using a snippet of JavaScript, we actually have access to the DOM of the test runner. Once again, pretty cool.  With <strong>getEval</strong> we have a simple yet powerful way to extend Selenium’s functionality.</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kmamalis.wordpress.com/21/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kmamalis.wordpress.com/21/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kmamalis.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kmamalis.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kmamalis.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kmamalis.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kmamalis.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kmamalis.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kmamalis.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kmamalis.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kmamalis.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kmamalis.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kmamalis.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kmamalis.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kmamalis.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kmamalis.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=21&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kmamalis.wordpress.com/2008/07/15/extend-selenium-rc-by-means-of-geteval-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccb422ecffb517a12f3b062c64d33347?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">truth4all</media:title>
		</media:content>
	</item>
		<item>
		<title>How to send email with attachment in Java</title>
		<link>http://kmamalis.wordpress.com/2008/07/10/how-to-send-email-with-attachment-in-java/</link>
		<comments>http://kmamalis.wordpress.com/2008/07/10/how-to-send-email-with-attachment-in-java/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 13:56:39 +0000</pubDate>
		<dc:creator>truth4all</dc:creator>
				<category><![CDATA[Java/JSP/EJB]]></category>

		<guid isPermaLink="false">http://kmamalis.wordpress.com/?p=20</guid>
		<description><![CDATA[I got the following code from: http://it.toolbox.com/wiki/index.php/Send_Email_with_Attachments_Using_Java It&#8217;s quite useful as I had to use it modified in one of my personal projects&#8230; Enjoy: Introduction This Article will explain about sending mail with attachments using Java Mail. Kits: J2sdk, Java Mail Api, JAF API, Smtp server address Steps Create src,lib,bin folders. Src directory contains source [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=20&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I got the following code from: http://it.toolbox.com/wiki/index.php/Send_Email_with_Attachments_Using_Java</p>
<p>It&#8217;s quite useful as I had to use it modified in one of my personal projects&#8230; Enjoy:</p>
<h2><span class="mw-headline">Introduction</span></h2>
<p>This Article will explain about sending mail with attachments using Java Mail.</p>
<p>Kits: J2sdk, Java Mail Api, JAF API, Smtp server address</p>
<p><a name="Steps"></a></p>
<h2>
<div class="editsection"></div>
<p><span class="mw-headline">Steps</span></h2>
<ol>
<li>Create src,lib,bin folders. Src directory contains source java files. bin contains the compiled java files. lib contains mail.jar,activation.jar files.</li>
<li>Create a new java program.</li>
<li>Creating Mail Session with server</li>
<li>Creating Subject, Body , Attachments</li>
<li>Sending Mail</li>
<li>Handling Exceptions</li>
</ol>
<p><a name="Examples"></a></p>
<h2>
<div class="editsection"></div>
<p><span class="mw-headline">Examples</span></h2>
<p>import java.util.*; import java.io.*; import javax.mail.*; import javax.mail.internet.*; import javax.activation.*;</p>
<p>public class AttachExample {</p>
<pre> public static void main (String args[]) throws Exception {
   String host = "smtp.kar.com";
   String from = "FromAddre@kar.com";
   String to[] =  new String[]{"ABC@kar.com","XYZ@kar.com"};
   String filename = "AttachFile.txt";
   // Get system properties
   Properties props = System.getProperties();
   props.put("mail.smtp.host", host);</pre>
<pre>   Session session = Session.getInstance(props, null);
   System.out.println(session.getProperties());</pre>
<pre>   Message message = new MimeMessage(session);
   message.setFrom(new InternetAddress(from));

   InternetAddress[] toAddress = new InternetAddress[to.length];
   for (int i = 0; i &lt; to.length; i++)
     toAddress[i] = new InternetAddress(to[i]);
   message.setRecipients(Message.RecipientType.TO, toAddress);
   message.setSubject("Hello JavaMail Attachment");
   BodyPart messageBodyPart = new MimeBodyPart();
   messageBodyPart.setText("Here's the file");
   Multipart multipart = new MimeMultipart();
   multipart.addBodyPart(messageBodyPart);
   messageBodyPart = new MimeBodyPart();
   DataSource source = new FileDataSource(filename);
   messageBodyPart.setDataHandler(new DataHandler(source));
   messageBodyPart.setFileName(filename);
   multipart.addBodyPart(messageBodyPart);
   message.setContent(multipart);
  try{
       Transport.send(message);
  }
  catch(SendFailedException sfe)
   {
 	 message.setRecipients(Message.RecipientType.TO,  sfe.getValidUnsentAddresses());
 	 Transport.send(message);

   }
 }</pre>
<p>}</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kmamalis.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kmamalis.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kmamalis.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kmamalis.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kmamalis.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kmamalis.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kmamalis.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kmamalis.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kmamalis.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kmamalis.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kmamalis.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kmamalis.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kmamalis.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kmamalis.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kmamalis.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kmamalis.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=20&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kmamalis.wordpress.com/2008/07/10/how-to-send-email-with-attachment-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccb422ecffb517a12f3b062c64d33347?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">truth4all</media:title>
		</media:content>
	</item>
		<item>
		<title>IE7 security issues &#8211; how to restore IE7 under Vista</title>
		<link>http://kmamalis.wordpress.com/2008/07/10/ie7-security-issues-how-to-restore-ie7-under-vista/</link>
		<comments>http://kmamalis.wordpress.com/2008/07/10/ie7-security-issues-how-to-restore-ie7-under-vista/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 13:53:42 +0000</pubDate>
		<dc:creator>truth4all</dc:creator>
				<category><![CDATA[Windows/PC issues]]></category>

		<guid isPermaLink="false">http://kmamalis.wordpress.com/?p=19</guid>
		<description><![CDATA[I recently had issues with IE7 (i.e. it required running it as administrator to finally open a webpage) which made me curious to see what a possible fix could be. I actually came up with the following piece of advice after doing some google-ing with regards to similar issues other web users had and have: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=19&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently had issues with IE7 (i.e. it required running it as administrator to finally open a webpage) which made me curious to see what a possible fix could be.</p>
<p>I actually came up with the following piece of advice after doing some google-ing with regards to similar issues other web users had and have:</p>
<p>There&#8217;s no way to reinstall IE as such. It&#8217;s part of the OS, and the standalone installer will do nothing here. There&#8217;s two things you can try that I can think of off-hand.</p>
<p>The first is resetting IE. This is done through the Internet Options, Advanced tab, Reset button.</p>
<p>The second is running a system file check. Open an elevated (run as admin) command prompt, and run command: &#8220;sfc /scannow&#8221;. This will verify and if necessary repair all critical system files, including those of IE. It takes some time but it worked for me.</p>
<p>You know the WCS (worst-case-scenario) of reinstalling&#8230; I&#8217;m not even going to start saying about that simply because everyone knows what a big hustle is&#8230; Besides there&#8217;s firefox mates!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kmamalis.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kmamalis.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kmamalis.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kmamalis.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kmamalis.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kmamalis.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kmamalis.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kmamalis.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kmamalis.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kmamalis.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kmamalis.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kmamalis.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kmamalis.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kmamalis.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kmamalis.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kmamalis.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=19&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kmamalis.wordpress.com/2008/07/10/ie7-security-issues-how-to-restore-ie7-under-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccb422ecffb517a12f3b062c64d33347?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">truth4all</media:title>
		</media:content>
	</item>
		<item>
		<title>Selenium and Flash testing</title>
		<link>http://kmamalis.wordpress.com/2008/06/06/selenium-and-flash-testing/</link>
		<comments>http://kmamalis.wordpress.com/2008/06/06/selenium-and-flash-testing/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 14:28:41 +0000</pubDate>
		<dc:creator>truth4all</dc:creator>
				<category><![CDATA[Fitnesse/Selenium]]></category>

		<guid isPermaLink="false">http://kmamalis.wordpress.com/?p=15</guid>
		<description><![CDATA[This is a brief way of how to test flash sites/elements by means of Selenium: http://wiki.openqa.org/display/SRC/Testing+Flash+with+Selenium+RC  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=15&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a brief way of how to test flash sites/elements by means of Selenium:</p>
<p><a class="alignleft" title="Selenium + Flash testing" href="http://wiki.openqa.org/display/SRC/Testing+Flash+with+Selenium+RC" target="_blank">http://wiki.openqa.org/display/SRC/Testing+Flash+with+Selenium+RC</a></p>
<p> </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kmamalis.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kmamalis.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kmamalis.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kmamalis.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kmamalis.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kmamalis.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kmamalis.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kmamalis.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kmamalis.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kmamalis.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kmamalis.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kmamalis.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kmamalis.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kmamalis.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kmamalis.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kmamalis.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kmamalis.wordpress.com&amp;blog=3576293&amp;post=15&amp;subd=kmamalis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kmamalis.wordpress.com/2008/06/06/selenium-and-flash-testing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccb422ecffb517a12f3b062c64d33347?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">truth4all</media:title>
		</media:content>
	</item>
	</channel>
</rss>
