<?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>Bartosz Wieczorek&#039;s blog</title>
	<atom:link href="http://bmwieczorek.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bmwieczorek.wordpress.com</link>
	<description>Some small ready solutions I find sometimes useful to reuse :-)</description>
	<lastBuildDate>Fri, 13 Jan 2012 23:07:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='bmwieczorek.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Bartosz Wieczorek&#039;s blog</title>
		<link>http://bmwieczorek.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://bmwieczorek.wordpress.com/osd.xml" title="Bartosz Wieczorek&#039;s blog" />
	<atom:link rel='hub' href='http://bmwieczorek.wordpress.com/?pushpress=hub'/>
		<item>
		<title>grep pattern inluding new line character</title>
		<link>http://bmwieczorek.wordpress.com/2012/01/13/grep-pattern-inluding-new-line-character/</link>
		<comments>http://bmwieczorek.wordpress.com/2012/01/13/grep-pattern-inluding-new-line-character/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 20:11:12 +0000</pubDate>
		<dc:creator>Bartosz Wieczorek</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bmwieczorek.wordpress.com/?p=1263</guid>
		<description><![CDATA[bawi@hp:~$ cat a.txt aaabbb cccddd dddbbb xxxxxx cccfff bawi@hp:~$ pcregrep -M 'b\nc' a.txt aaabbb cccddd bawi@hp:~$ pcregrep -M 'b(\n&#124;.)*c' a.txt aaabbb cccddd dddbbb xxxxxx cccfff bawi@hp:~$ cat b.txt 1.ERROR test1 known-pattern1 other1.1 2.DEBUG test2 some data2.1 some data2.2 3.ERROR test3 undefined other3.1 4.ERROR test4 known-pattern2 bawi@hp:~$ pcregrep -M 'ERROR .*\n' b.txt &#124; pcregrep -M -v [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1263&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre>
bawi@hp:~$ cat a.txt
aaabbb
cccddd

dddbbb
xxxxxx
cccfff
bawi@hp:~$ pcregrep -M 'b\nc' a.txt
aaabbb
cccddd
bawi@hp:~$ pcregrep -M 'b(\n|.)*c' a.txt
aaabbb
cccddd

dddbbb
xxxxxx
cccfff
</pre>
<pre>
bawi@hp:~$ cat b.txt
1.ERROR test1
known-pattern1
other1.1
2.DEBUG test2
some data2.1
some data2.2
3.ERROR test3
undefined
other3.1
4.ERROR test4
known-pattern2

bawi@hp:~$ pcregrep -M 'ERROR .*\n' b.txt | pcregrep -M -v '\nknown-pattern1' | pcregrep -M -v '\nknown-pattern2'
3.ERROR test3
undefined
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bmwieczorek.wordpress.com/1263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bmwieczorek.wordpress.com/1263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bmwieczorek.wordpress.com/1263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bmwieczorek.wordpress.com/1263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bmwieczorek.wordpress.com/1263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bmwieczorek.wordpress.com/1263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bmwieczorek.wordpress.com/1263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bmwieczorek.wordpress.com/1263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bmwieczorek.wordpress.com/1263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bmwieczorek.wordpress.com/1263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bmwieczorek.wordpress.com/1263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bmwieczorek.wordpress.com/1263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bmwieczorek.wordpress.com/1263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bmwieczorek.wordpress.com/1263/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1263&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bmwieczorek.wordpress.com/2012/01/13/grep-pattern-inluding-new-line-character/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7866f832db44f419917f572930b39618?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bartosz Wieczorek</media:title>
		</media:content>
	</item>
		<item>
		<title>maven deploy</title>
		<link>http://bmwieczorek.wordpress.com/2011/12/07/maven-deploy/</link>
		<comments>http://bmwieczorek.wordpress.com/2011/12/07/maven-deploy/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 13:48:09 +0000</pubDate>
		<dc:creator>Bartosz Wieczorek</dc:creator>
				<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://bmwieczorek.wordpress.com/?p=1259</guid>
		<description><![CDATA[mvn deploy:deploy-file -DrepositoryId=upload-releases  -DgroupId=com.bawi -DartifactId=my-project -Dversion=1.0.0-20111206 -Dpackaging=jar -DgeneratePom=true -Durl=http://maven.bawi.com/content/repositories/releases  -Dfile=my-project-1.0.0-20111206.jar &#160;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1259&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>mvn deploy:deploy-file -DrepositoryId=upload-releases  -DgroupId=com.bawi -DartifactId=my-project -Dversion=1.0.0-20111206 -Dpackaging=jar -DgeneratePom=true -Durl=http://maven.bawi.com/content/repositories/releases  -Dfile=my-project-1.0.0-20111206.jar</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bmwieczorek.wordpress.com/1259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bmwieczorek.wordpress.com/1259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bmwieczorek.wordpress.com/1259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bmwieczorek.wordpress.com/1259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bmwieczorek.wordpress.com/1259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bmwieczorek.wordpress.com/1259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bmwieczorek.wordpress.com/1259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bmwieczorek.wordpress.com/1259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bmwieczorek.wordpress.com/1259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bmwieczorek.wordpress.com/1259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bmwieczorek.wordpress.com/1259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bmwieczorek.wordpress.com/1259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bmwieczorek.wordpress.com/1259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bmwieczorek.wordpress.com/1259/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1259&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bmwieczorek.wordpress.com/2011/12/07/maven-deploy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7866f832db44f419917f572930b39618?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bartosz Wieczorek</media:title>
		</media:content>
	</item>
		<item>
		<title>mysql db setup</title>
		<link>http://bmwieczorek.wordpress.com/2011/10/19/mysql-db-setup/</link>
		<comments>http://bmwieczorek.wordpress.com/2011/10/19/mysql-db-setup/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 08:39:00 +0000</pubDate>
		<dc:creator>Bartosz Wieczorek</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://bmwieczorek.wordpress.com/?p=1247</guid>
		<description><![CDATA[sg0212148@ubuntu:~$ mysql -uroot Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 40 Server version: 5.1.41-3ubuntu12.10 (Ubuntu) Type &#8216;help;&#8217; or &#8216;\h&#8217; for help. Type &#8216;\c&#8217; to clear the current input statement. mysql&#62; create database test; Query OK, 1 row affected (0.00 sec) mysql&#62; use test; Database changed mysql&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1247&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>sg0212148@ubuntu:~$ mysql -uroot<br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 40<br />
Server version: 5.1.41-3ubuntu12.10 (Ubuntu)</p>
<p>Type &#8216;help;&#8217; or &#8216;\h&#8217; for help. Type &#8216;\c&#8217; to clear the current input statement.</p>
<p>mysql&gt; create database test;<br />
Query OK, 1 row affected (0.00 sec)</p>
<p>mysql&gt; use test;<br />
Database changed<br />
mysql&gt; create table report (student text, subject text, score int);<br />
Query OK, 0 rows affected (0.00 sec)</p>
<p>insert into report (student, subject, score) values (&#8220;st1&#8243;,&#8221;sb1&#8243;,3);<br />
insert into report (student, subject, score) values (&#8220;st2&#8243;,&#8221;sb1&#8243;,4);<br />
insert into report (student, subject, score) values (&#8220;st3&#8243;,&#8221;sb1&#8243;,5);<br />
insert into report (student, subject, score) values (&#8220;st4&#8243;,&#8221;sb2&#8243;,4);<br />
insert into report (student, subject, score) values (&#8220;st5&#8243;,&#8221;sb2&#8243;,5);<br />
insert into report (student, subject, score) values (&#8220;st6&#8243;,&#8221;sb2&#8243;,6);<br />
insert into report (student, subject, score) values (&#8220;st7&#8243;,&#8221;sb3&#8243;,5);<br />
insert into report (student, subject, score) values (&#8220;st8&#8243;,&#8221;sb3&#8243;,6);<br />
insert into report (student, subject, score) values (&#8220;st9&#8243;,&#8221;sb3&#8243;,7);<br />
mysql&gt; select * from report;<br />
+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;-+<br />
| student | subject | score |<br />
+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;-+<br />
| st1      | sb1      |     3 |<br />
| st2      | sb1      |     4 |<br />
| st3      | sb1      |     5 |<br />
| st4      | sb2      |     4 |<br />
| st5      | sb2      |     5 |<br />
| st6      | sb2      |     6 |<br />
| st7      | sb3      |     5 |<br />
| st8      | sb3      |     6 |<br />
| st9      | sb3      |     7 |<br />
+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;-+<br />
9 rows in set (0.00 sec)</p>
<p>mysql&gt;  select student,subject from report where score &gt; 4;<br />
+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+<br />
| student | subject |<br />
+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+<br />
| st3      | sb1      |<br />
| st5      | sb2      |<br />
| st6      | sb2      |<br />
| st7      | sb3      |<br />
| st8      | sb3      |<br />
| st9      | sb3      |<br />
+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+<br />
6 rows in set (0.00 sec)</p>
<p>mysql&gt; select count(subject), subject from (select subject from report where score &gt; 4) as SS group by subject;<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+<br />
| count(subject) | subject |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+<br />
|              1 | sb1      |<br />
|              2 | sb2      |<br />
|              3 | sb3      |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+<br />
3 rows in set (0.00 sec)</p>
<p>mysql&gt; select count(subject), subject from (select subject from report where score &gt; 4) as SS group by subject having count(subject)  &gt; 1;<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+<br />
| count(subject) | subject |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+<br />
|              2 | sb2      |<br />
|              3 | sb3      |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+<br />
2 rows in set (0.00 sec)</p>
<p>&#8216;<strong>where</strong>&#8216; operates on individual <strong>rows </strong>to select row that later may be use for grouping<strong> (&#8216;where&#8217;</strong> cannot be used after grouping)<strong><br />
</strong></p>
<p>&#8216;<strong>having</strong>&#8216; operate on agregate functions</p>
<p>you cannot have &#8216;having&#8217; without group by for proper results:<br />
mysql&gt; select count(subject), subject from (select subject from report where score &gt; 4) as SS having count(subject)  &gt; 1;<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+<br />
| count(subject) | subject |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+<br />
|              6 | sb1      |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bmwieczorek.wordpress.com/1247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bmwieczorek.wordpress.com/1247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bmwieczorek.wordpress.com/1247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bmwieczorek.wordpress.com/1247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bmwieczorek.wordpress.com/1247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bmwieczorek.wordpress.com/1247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bmwieczorek.wordpress.com/1247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bmwieczorek.wordpress.com/1247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bmwieczorek.wordpress.com/1247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bmwieczorek.wordpress.com/1247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bmwieczorek.wordpress.com/1247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bmwieczorek.wordpress.com/1247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bmwieczorek.wordpress.com/1247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bmwieczorek.wordpress.com/1247/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1247&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bmwieczorek.wordpress.com/2011/10/19/mysql-db-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7866f832db44f419917f572930b39618?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bartosz Wieczorek</media:title>
		</media:content>
	</item>
		<item>
		<title>Protected: Interview questions</title>
		<link>http://bmwieczorek.wordpress.com/2011/10/07/interview-questions/</link>
		<comments>http://bmwieczorek.wordpress.com/2011/10/07/interview-questions/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 16:52:35 +0000</pubDate>
		<dc:creator>Bartosz Wieczorek</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bmwieczorek.wordpress.com/?p=1243</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1243&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post is password protected. You must visit the website and enter the password to continue reading.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bmwieczorek.wordpress.com/1243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bmwieczorek.wordpress.com/1243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bmwieczorek.wordpress.com/1243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bmwieczorek.wordpress.com/1243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bmwieczorek.wordpress.com/1243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bmwieczorek.wordpress.com/1243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bmwieczorek.wordpress.com/1243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bmwieczorek.wordpress.com/1243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bmwieczorek.wordpress.com/1243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bmwieczorek.wordpress.com/1243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bmwieczorek.wordpress.com/1243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bmwieczorek.wordpress.com/1243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bmwieczorek.wordpress.com/1243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bmwieczorek.wordpress.com/1243/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1243&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bmwieczorek.wordpress.com/2011/10/07/interview-questions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7866f832db44f419917f572930b39618?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bartosz Wieczorek</media:title>
		</media:content>
	</item>
		<item>
		<title>change shell</title>
		<link>http://bmwieczorek.wordpress.com/2011/09/28/change-shell/</link>
		<comments>http://bmwieczorek.wordpress.com/2011/09/28/change-shell/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 13:39:32 +0000</pubDate>
		<dc:creator>Bartosz Wieczorek</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bmwieczorek.wordpress.com/?p=1240</guid>
		<description><![CDATA[&#8216;chsh&#8217; &#8211; changes shell<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1240&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&#8216;chsh&#8217; &#8211; changes shell</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bmwieczorek.wordpress.com/1240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bmwieczorek.wordpress.com/1240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bmwieczorek.wordpress.com/1240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bmwieczorek.wordpress.com/1240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bmwieczorek.wordpress.com/1240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bmwieczorek.wordpress.com/1240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bmwieczorek.wordpress.com/1240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bmwieczorek.wordpress.com/1240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bmwieczorek.wordpress.com/1240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bmwieczorek.wordpress.com/1240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bmwieczorek.wordpress.com/1240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bmwieczorek.wordpress.com/1240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bmwieczorek.wordpress.com/1240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bmwieczorek.wordpress.com/1240/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1240&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bmwieczorek.wordpress.com/2011/09/28/change-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7866f832db44f419917f572930b39618?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bartosz Wieczorek</media:title>
		</media:content>
	</item>
		<item>
		<title>Global state</title>
		<link>http://bmwieczorek.wordpress.com/2011/07/07/global-state/</link>
		<comments>http://bmwieczorek.wordpress.com/2011/07/07/global-state/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 08:58:47 +0000</pubDate>
		<dc:creator>Bartosz Wieczorek</dc:creator>
				<category><![CDATA[Best practices]]></category>

		<guid isPermaLink="false">http://bmwieczorek.wordpress.com/?p=1232</guid>
		<description><![CDATA[Class state (opposed to object state) is persistent to lifetime of JVM. In Global State multiple executions can produce different results for new A().doSth(); Singleton &#8211; design pattern, static object in the global space, each field in a singleton is a holds a global state since it is a global variable. Everything accessible via Singleton [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1232&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Class state (opposed to object state) is persistent to lifetime of JVM.</p>
<p>In Global State multiple executions can produce different results for new A().doSth();</p>
<p>Singleton &#8211; design pattern, static object in the global space, each field in a singleton is a holds a global state since it is a global variable. Everything accessible via Singleton instance field has a global variable. They cannot be garbage collected and are kept in JVM for its lifetime.</p>
<p>Singletons are bad for test since tests cannot fully control the state of the Singletons. If Singletons have any dependecies then tests cannot control instantiation process of these fields / dependencies.<br />
BAD: Application has method that internally calls AppSettings.getInstace.doSth(). While testing Application how do you test in doSth() was really called. When AppSettings is a Singleton (design pattern) you cannot test it.<br />
GOOD: Instead of this, design your Appsettings to have public constructor and a non-static doSth() method so that you cannot mock it. Then the Application wiil set AppSetting in the constructor and assign as instance field. Then you can verify if a call to Application method will internally call Appsettings doSth() method.</p>
<p>singleton &#8211; a single instance of an object that is intantiated once (only once was the constructor called) and is not attached to global space</p>
<p>you should ensure that objects are instantiated in the correct order and methods are called in the correct order. You can achieve it by explicitly passing the objects referenced to constructor or a method. Then, there is no hidden conversation between the objects and it is harder to make mistakes.</p>
<p>Dependency injection:<br />
- enforces the proper order of initialization at compile time<br />
- helps to define where you want to cut the dependecies boundaries so that you can mock the rest.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bmwieczorek.wordpress.com/1232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bmwieczorek.wordpress.com/1232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bmwieczorek.wordpress.com/1232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bmwieczorek.wordpress.com/1232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bmwieczorek.wordpress.com/1232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bmwieczorek.wordpress.com/1232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bmwieczorek.wordpress.com/1232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bmwieczorek.wordpress.com/1232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bmwieczorek.wordpress.com/1232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bmwieczorek.wordpress.com/1232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bmwieczorek.wordpress.com/1232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bmwieczorek.wordpress.com/1232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bmwieczorek.wordpress.com/1232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bmwieczorek.wordpress.com/1232/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1232&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bmwieczorek.wordpress.com/2011/07/07/global-state/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7866f832db44f419917f572930b39618?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bartosz Wieczorek</media:title>
		</media:content>
	</item>
		<item>
		<title>Writing code hard to test</title>
		<link>http://bmwieczorek.wordpress.com/2011/07/07/writing-code-hard-to-test/</link>
		<comments>http://bmwieczorek.wordpress.com/2011/07/07/writing-code-hard-to-test/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 08:29:31 +0000</pubDate>
		<dc:creator>Bartosz Wieczorek</dc:creator>
				<category><![CDATA[Best practices]]></category>

		<guid isPermaLink="false">http://bmwieczorek.wordpress.com/?p=1220</guid>
		<description><![CDATA[How to write code that is hard to test? - most people say: making things private, using private keyword, long methods (monolythic code) Real issues mixing &#8220;new&#8221; operator with business logic prevents you from testing things in isolation (wrong: creating new objects directly in the business logic instead of using them) looking for things business [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1220&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How to write code that is hard to test?<br />
- most people say: making things private, using private keyword, long methods (monolythic code)</p>
<p><strong>Real issues</strong></p>
<ol>
<li>mixing &#8220;new&#8221; operator with business logic prevents you from testing things in isolation (wrong: creating new objects directly in the business logic instead of using them)</li>
<li>looking for things</li>
<li>business logic in the constructor (in constructor you should ask for dependencies by constructor arguments and assign them to instance fields. Business logic should be in methods that use these dependecies but not construct them)</li>
<li>having global state</li>
<li>using static methods (which is essentialy procedural programming), it is easy to test leaf methods that do not call anybody else (Math.absolute(value)), but if a this static method has a bunch of collaborators then you cannot test this method in isolation, you cannot mock the db (cannot override static method). The worst thing is trying to test your application from the main method.</li>
<li>deep inheritance hierarchy (if your class under test extends A, B, C classes you are also testing those classes if you want or not)</li>
<li>too many conditionals (if statements &#8211; you need to prepare lots of test data to get throught the path you want)</li>
</ol>
<p><strong>Scope of tests</strong></p>
<ol>
<li>Large number of unit tests &#8211; class level tested in insolation &#8211; very fast tests</li>
<li>Many functional tests &#8211; collection of classess as subsystem &#8211; medium tests</li>
<li>Some scenario tests &#8211; for the whole system &#8211; slow tests</li>
</ol>
<p>The end to end tests are important but they take a lot of time and there are so many things that can go wrong so making sure every is set up correctly is hard and time consuming. It is hard to reproduce failures. Better test smaller portions of program and some happy path (all the things are wired up together correctly). Break the applicaion into subsystem and even invidual components and test the invidually.</p>
<p><strong></strong>For bad code it is hard to write good test.</p>
<p>In order to test classes with dependencies you should be able to have a choice to:</p>
<ol>
<li>mock dependencies or</li>
<li>stub dependencies or</li>
<li>instantiate a real class that has been alread well tested.</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bmwieczorek.wordpress.com/1220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bmwieczorek.wordpress.com/1220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bmwieczorek.wordpress.com/1220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bmwieczorek.wordpress.com/1220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bmwieczorek.wordpress.com/1220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bmwieczorek.wordpress.com/1220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bmwieczorek.wordpress.com/1220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bmwieczorek.wordpress.com/1220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bmwieczorek.wordpress.com/1220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bmwieczorek.wordpress.com/1220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bmwieczorek.wordpress.com/1220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bmwieczorek.wordpress.com/1220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bmwieczorek.wordpress.com/1220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bmwieczorek.wordpress.com/1220/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1220&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bmwieczorek.wordpress.com/2011/07/07/writing-code-hard-to-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7866f832db44f419917f572930b39618?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bartosz Wieczorek</media:title>
		</media:content>
	</item>
		<item>
		<title>Clean code</title>
		<link>http://bmwieczorek.wordpress.com/2011/05/25/clean-code/</link>
		<comments>http://bmwieczorek.wordpress.com/2011/05/25/clean-code/#comments</comments>
		<pubDate>Wed, 25 May 2011 04:05:33 +0000</pubDate>
		<dc:creator>Bartosz Wieczorek</dc:creator>
				<category><![CDATA[Best practices]]></category>

		<guid isPermaLink="false">http://bmwieczorek.wordpress.com/?p=1194</guid>
		<description><![CDATA[In order to test a instance method you need to instantiate the object, so do not put any business logic code into the constructor or static factory methods. Move the dependencies to constructor parameters so that you do not need to care how they get instantiated. We can pass in a mocked dependency or a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1194&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In order to test a instance method you need to instantiate the object, so do not put any business logic code into the constructor or static factory methods.</p>
<p>Move the dependencies to constructor parameters so that you do not need to care how they get instantiated. We can pass in a mocked dependency or a real object.</p>
<p>Having dependencies defined in constructor argumeters makes the API more clear.</p>
<p>That makes testing much more easier since mock all the dependencies.</p>
<p>Write many small tests for business logic and create a one happy path test that everything is wired together correctly.</p>
<p>In constructor we should be asking what we need but not creating it ourselves, should not create and use any Factories inside constructor/method code.</p>
<p>Ideally, you would have only field assignments in your constructor.</p>
<p>Tests about instantiating small pieces of your application.</p>
<p>You could use service locator (aka context or registry) to create an object for you instead of creating it yourself. However, in order to get the mocked object you would have to override the service locator methods which can be hard sometimes (looking into source code etc&#8230;)</p>
<p>When there are multiples constructor parameters and you want to test behavior based on the first paramter, then you can make the other null in tests, meaning that do not take part in the test.</p>
<p>Law of demeter: only ask for the objects that you need directly, don&#8217;t use intermediate object that will the get what you need for you.</p>
<p>If your child object needs a new parameter in its constructor, it should not be added to the as parameter parent constructor. Parent object need only to know about the child, not the children dependencies. Otherwise the parent would violate the law of demeter adding as its constuctor parameter something he doesn&#8217;t directly needs.</p>
<p>One factory plus a couple of break down factories  per object lifetime.</p>
<p>As a parameter of a constructor put objects of longer or the same lifetime. Put objects of a shorter lifecycle as method parameters.</p>
<p>For external api the will be used by other people, put validation logic into constructor. For internal api it is not suggested to use these checks since it make testing harder (need to meet extra preconditions before you really can start testing) &#8211; in this case tests are better than runtime precondition / check.</p>
<p>For production code you should return non null objects (not to get NPE). For test code passing null as a parameter makes it clear that this parameter is not important for the test.</p>
<p>For production code do not call &#8216;new&#8217; operator (do not instantiate objects directly) in constructor so that somebody can pass in you a mock in the constructor argument. You should ask for what you want instead creating it by yourself.</p>
<p>The &#8216;new&#8217; operator should be used only in tests and factories. Exception are the leaves of the application graph, there is nothing behind them, e.g.: value objects (e.g. User) or collections (new HashMap).</p>
<p>Law of demeter: only ask for the thinks that you need directly, you shouldn&#8217;t know about the objects you don&#8217;t need.</p>
<p>Objects should be divided into two categories:</p>
<p>1) business logic objects that do the logic in your application (here are most of bugs so you should make them easy to instantiate and  to test)</p>
<p>2) Pile of factories, the &#8216;new&#8217; operators, builders etc &#8230;</p>
<p>Then you can test objects instantiation and business logic separately, in isolation.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bmwieczorek.wordpress.com/1194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bmwieczorek.wordpress.com/1194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bmwieczorek.wordpress.com/1194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bmwieczorek.wordpress.com/1194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bmwieczorek.wordpress.com/1194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bmwieczorek.wordpress.com/1194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bmwieczorek.wordpress.com/1194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bmwieczorek.wordpress.com/1194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bmwieczorek.wordpress.com/1194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bmwieczorek.wordpress.com/1194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bmwieczorek.wordpress.com/1194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bmwieczorek.wordpress.com/1194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bmwieczorek.wordpress.com/1194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bmwieczorek.wordpress.com/1194/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1194&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bmwieczorek.wordpress.com/2011/05/25/clean-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7866f832db44f419917f572930b39618?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bartosz Wieczorek</media:title>
		</media:content>
	</item>
		<item>
		<title>Cygwin</title>
		<link>http://bmwieczorek.wordpress.com/2011/03/05/cygwin/</link>
		<comments>http://bmwieczorek.wordpress.com/2011/03/05/cygwin/#comments</comments>
		<pubDate>Sat, 05 Mar 2011 17:13:11 +0000</pubDate>
		<dc:creator>Bartosz Wieczorek</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://bmwieczorek.wordpress.com/?p=1141</guid>
		<description><![CDATA[~/.bash_profile: umask 022 set -o ignoreeof shopt -s cdspell histappend no_empty_cmd_completion export EDITOR="vim" #export HISTCONTROL="ignoreboth:erasedups" export HISTFILESIZE=2500 export HISTSIZE=2500 export HISTIGNORE="*shutdown*:su:[bf]g:exit:logout:rm *:sudo rm *" export PATH=$PATH:~/bin export LANG="en_US.ISO8859-1" export LC_CTYPE="pl_PL.ISO8859-2" export LC_NUMERIC="pl_PL.ISO8859-2" export LC_TIME="en_US.ISO8859-1" export LC_COLLATE="pl_PL.ISO8859-2" export LC_MONETARY="pl_PL.ISO8859-2" export LC_MESSAGES="en_US.ISO8859-1" export LC_PAPER="pl_PL.ISO8859-2" export LC_NAME="pl_PL.ISO8859-2" export LC_ADDRESS="pl_PL.ISO8859-2" export LC_TELEPHONE="pl_PL.ISO8859-2" export LC_MEASUREMENT="pl_PL.ISO8859-2" export LC_IDENTIFICATION="pl_PL.ISO8859-2" export MM_CHARSET="ISO-8859-2" export [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1141&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>~/.bash_profile:</p>
<pre>

umask 022
set -o ignoreeof
shopt -s cdspell histappend no_empty_cmd_completion

export EDITOR="vim"
#export HISTCONTROL="ignoreboth:erasedups"
export HISTFILESIZE=2500
export HISTSIZE=2500
export HISTIGNORE="*shutdown*:su:[bf]g:exit:logout:rm *:sudo rm *"
export PATH=$PATH:~/bin

export LANG="en_US.ISO8859-1"
export LC_CTYPE="pl_PL.ISO8859-2"
export LC_NUMERIC="pl_PL.ISO8859-2"
export LC_TIME="en_US.ISO8859-1"
export LC_COLLATE="pl_PL.ISO8859-2"
export LC_MONETARY="pl_PL.ISO8859-2"
export LC_MESSAGES="en_US.ISO8859-1"
export LC_PAPER="pl_PL.ISO8859-2"
export LC_NAME="pl_PL.ISO8859-2"
export LC_ADDRESS="pl_PL.ISO8859-2"
export LC_TELEPHONE="pl_PL.ISO8859-2"
export LC_MEASUREMENT="pl_PL.ISO8859-2"
export LC_IDENTIFICATION="pl_PL.ISO8859-2"
export MM_CHARSET="ISO-8859-2"
export LS_COLORS='no=00:fi=00:di=01;36:ln=01;34:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;34:*.au=00;34:*.flac=00;34:*.mid=00;34:*.midi=00;34:*.mka=00;34:*.mp3=00;34:*.mpc=00;34:*.ogg=00;34:*.ra=00;34:*.wav=00;34:';

# Bash completion
[[ -f /etc/profile.d/bash-completion ]] &amp;&amp; source /etc/profile.d/bash-completion
# CYGWIN startup directory
CYGWINDIR=c:/dev/
[[ ! -z `echo $CYGWINDIR | grep -v " "` ]] &amp;&amp; cd $CYGWINDIR

#source ./setEnv.sh

# Prompt colors
PS1='\[33[01;32m\]\w \$\[33[00m\] '

# Aliases
alias console='unset DISPLAY &amp;&amp; rxvt -e bash -login &amp;'
alias ls='ls --color'		# colors

( cd &amp;&amp; complete -W "$(echo `cat .bash_history | egrep '^ssh ' | sort | uniq | sed 's/^ssh //'`;)" ssh )
</pre>
<p>~/.bashrc without lines:</p>
<pre>
# CYGWIN startup directory
CYGWINDIR=c:/dev/
[[ ! -z `echo $CYGWINDIR | grep -v " "` ]] &amp;&amp; cd $CYGWINDIR
</pre>
<p>cygwin.bat:</p>
<pre>
@echo off

C:
chdir C:\dev\environment\bin

bash --login -i
</pre>
<p>cygwin-my-dir.bat:</p>
<pre>
@echo off

C:
chdir C:\dev\environment\bin

bash --login -i -c 'cd my-dir; bash '
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bmwieczorek.wordpress.com/1141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bmwieczorek.wordpress.com/1141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bmwieczorek.wordpress.com/1141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bmwieczorek.wordpress.com/1141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bmwieczorek.wordpress.com/1141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bmwieczorek.wordpress.com/1141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bmwieczorek.wordpress.com/1141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bmwieczorek.wordpress.com/1141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bmwieczorek.wordpress.com/1141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bmwieczorek.wordpress.com/1141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bmwieczorek.wordpress.com/1141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bmwieczorek.wordpress.com/1141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bmwieczorek.wordpress.com/1141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bmwieczorek.wordpress.com/1141/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1141&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bmwieczorek.wordpress.com/2011/03/05/cygwin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7866f832db44f419917f572930b39618?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bartosz Wieczorek</media:title>
		</media:content>
	</item>
		<item>
		<title>Eclipse plugins</title>
		<link>http://bmwieczorek.wordpress.com/2011/02/10/eclipse-plugins/</link>
		<comments>http://bmwieczorek.wordpress.com/2011/02/10/eclipse-plugins/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 21:46:51 +0000</pubDate>
		<dc:creator>Bartosz Wieczorek</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://bmwieczorek.wordpress.com/?p=1138</guid>
		<description><![CDATA[checkstyle http://eclipse-cs.sf.net/update/ crucible http://update.atlassian.com/atlassian-eclipse-plugin/e3.6 EclEmma Java Code Coverage http://update.eclemma.org/ eCobertura http://ecobertura.johoop.de/update/ FindBugs http://findbugs.cs.umd.edu/eclipse/ m2eclipse http://m2eclipse.sonatype.org/sites/m2e More Unit http://moreunit.sourceforge.net/update-site/ PMD http://pmd.sourceforge.net/eclipse Spring IDE http://springide.org/updatesite subclipse http://subclipse.tigris.org/update_1.6.x<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1138&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>checkstyle http://eclipse-cs.sf.net/update/<br />
crucible http://update.atlassian.com/atlassian-eclipse-plugin/e3.6<br />
EclEmma Java Code Coverage http://update.eclemma.org/<br />
eCobertura http://ecobertura.johoop.de/update/<br />
FindBugs http://findbugs.cs.umd.edu/eclipse/<br />
m2eclipse http://m2eclipse.sonatype.org/sites/m2e<br />
More Unit http://moreunit.sourceforge.net/update-site/<br />
PMD http://pmd.sourceforge.net/eclipse<br />
Spring IDE http://springide.org/updatesite<br />
subclipse http://subclipse.tigris.org/update_1.6.x</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bmwieczorek.wordpress.com/1138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bmwieczorek.wordpress.com/1138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bmwieczorek.wordpress.com/1138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bmwieczorek.wordpress.com/1138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bmwieczorek.wordpress.com/1138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bmwieczorek.wordpress.com/1138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bmwieczorek.wordpress.com/1138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bmwieczorek.wordpress.com/1138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bmwieczorek.wordpress.com/1138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bmwieczorek.wordpress.com/1138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bmwieczorek.wordpress.com/1138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bmwieczorek.wordpress.com/1138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bmwieczorek.wordpress.com/1138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bmwieczorek.wordpress.com/1138/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bmwieczorek.wordpress.com&amp;blog=2490042&amp;post=1138&amp;subd=bmwieczorek&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bmwieczorek.wordpress.com/2011/02/10/eclipse-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7866f832db44f419917f572930b39618?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bartosz Wieczorek</media:title>
		</media:content>
	</item>
	</channel>
</rss>
