<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Komentarze do Blog IT - Mateusz Mrozewski</title>
	<atom:link href="http://tech.mrozewski.pl/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.mrozewski.pl</link>
	<description>my technical notes</description>
	<lastBuildDate>Fri, 21 Oct 2011 06:34:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>Skomentuj Server failure, którego autorem jest matipl</title>
		<link>http://tech.mrozewski.pl/2011/10/17/server-failure/comment-page-1/#comment-513</link>
		<dc:creator>matipl</dc:creator>
		<pubDate>Fri, 21 Oct 2011 06:34:57 +0000</pubDate>
		<guid isPermaLink="false">http://tech.mrozewski.pl/?p=548#comment-513</guid>
		<description>:(</description>
		<content:encoded><![CDATA[<p> <img src='http://tech.mrozewski.pl/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Skomentuj How to deploy Grails application on Google App Engine, którego autorem jest jed</title>
		<link>http://tech.mrozewski.pl/2011/09/14/how-to-deploy-grails-application-on-google-app-engine/comment-page-1/#comment-507</link>
		<dc:creator>jed</dc:creator>
		<pubDate>Tue, 20 Sep 2011 13:17:21 +0000</pubDate>
		<guid isPermaLink="false">http://tech.mrozewski.pl/?p=545#comment-507</guid>
		<description>To Ci pozwalają się w grailsy w robocie bawić, czy to może &quot;hobbystycznie&quot; w domciu po nocach ? :)</description>
		<content:encoded><![CDATA[<p>To Ci pozwalają się w grailsy w robocie bawić, czy to może &#8222;hobbystycznie&#8221; w domciu po nocach ? <img src='http://tech.mrozewski.pl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Skomentuj Python for Java developers: list comprehension, którego autorem jest links for 2011-07-03 &#171; Stand on the shoulders of giants</title>
		<link>http://tech.mrozewski.pl/2011/06/30/python-for-java-developers-list-comprehension/comment-page-1/#comment-490</link>
		<dc:creator>links for 2011-07-03 &#171; Stand on the shoulders of giants</dc:creator>
		<pubDate>Mon, 04 Jul 2011 06:50:51 +0000</pubDate>
		<guid isPermaLink="false">http://tech.mrozewski.pl/?p=518#comment-490</guid>
		<description>[...] Python for Java developers: list comprehension (tags: java list_comprehension need_to_know via:zite) [...]</description>
		<content:encoded><![CDATA[<p>[...] Python for Java developers: list comprehension (tags: java list_comprehension need_to_know via:zite) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Skomentuj Python for Java developers: list comprehension, którego autorem jest mati</title>
		<link>http://tech.mrozewski.pl/2011/06/30/python-for-java-developers-list-comprehension/comment-page-1/#comment-488</link>
		<dc:creator>mati</dc:creator>
		<pubDate>Sun, 03 Jul 2011 09:02:44 +0000</pubDate>
		<guid isPermaLink="false">http://tech.mrozewski.pl/?p=518#comment-488</guid>
		<description>@mystilleef: Just one more thing - I use dictionaries quite often to handle/pass around some simpler hierarchical data and I think Python&#039;s dictionaries are very flexible and useful and easy to use.</description>
		<content:encoded><![CDATA[<p>@mystilleef: Just one more thing &#8211; I use dictionaries quite often to handle/pass around some simpler hierarchical data and I think Python&#8217;s dictionaries are very flexible and useful and easy to use.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Skomentuj Python for Java developers: list comprehension, którego autorem jest mati</title>
		<link>http://tech.mrozewski.pl/2011/06/30/python-for-java-developers-list-comprehension/comment-page-1/#comment-487</link>
		<dc:creator>mati</dc:creator>
		<pubDate>Sun, 03 Jul 2011 08:59:34 +0000</pubDate>
		<guid isPermaLink="false">http://tech.mrozewski.pl/?p=518#comment-487</guid>
		<description>@mystilleef: It this simple example we could use dictionary instead of a class and in Java samples I could use a Map instead of class. It should be enough to show what list comprehensions is about.

However, I think that the choice of a data structure should be driven more by an overall programming style - if you do full OOP, prefer a class. If you do procedural/functional/scripting style programming, simpler data structures might be better indeed. To choice is up to developer and there is no silver bullet.

Also, using a dictionary instead of a class might lead to &lt;a href=&quot;http://en.wikipedia.org/wiki/Anemic_Domain_Model&quot; rel=&quot;nofollow&quot;&gt;anemic domain model&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>@mystilleef: It this simple example we could use dictionary instead of a class and in Java samples I could use a Map instead of class. It should be enough to show what list comprehensions is about.</p>
<p>However, I think that the choice of a data structure should be driven more by an overall programming style &#8211; if you do full OOP, prefer a class. If you do procedural/functional/scripting style programming, simpler data structures might be better indeed. To choice is up to developer and there is no silver bullet.</p>
<p>Also, using a dictionary instead of a class might lead to <a href="http://en.wikipedia.org/wiki/Anemic_Domain_Model" rel="nofollow">anemic domain model</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Skomentuj Python for Java developers: list comprehension, którego autorem jest mystilleef</title>
		<link>http://tech.mrozewski.pl/2011/06/30/python-for-java-developers-list-comprehension/comment-page-1/#comment-486</link>
		<dc:creator>mystilleef</dc:creator>
		<pubDate>Sat, 02 Jul 2011 17:43:44 +0000</pubDate>
		<guid isPermaLink="false">http://tech.mrozewski.pl/?p=518#comment-486</guid>
		<description>It looks very good.

However, in Python I&#039;d use a dictionary to represent the People object instead of a class. Classes really should only be used for complex state management where encapsulation is absolutely necessary. 

I think this needs to be emphasized to Java developers coming to Python.

def new_person(firstname=&quot;&quot;, lastname=&quot;&quot;): return {&quot;firstname&quot;:firstname, &quot;lastname&quot;:lastname}

persons = [new_person(&quot;Jake&quot;, &quot;Blake&quot;),  new_person(&quot;James&quot;, &quot;Smith&quot;)]

firstnames = [person[&quot;firstname&quot;] for person in persons]

The last data structure of choice should always be classes. If you can get away using dictionaries, list and tuples, then use them first.</description>
		<content:encoded><![CDATA[<p>It looks very good.</p>
<p>However, in Python I&#8217;d use a dictionary to represent the People object instead of a class. Classes really should only be used for complex state management where encapsulation is absolutely necessary. </p>
<p>I think this needs to be emphasized to Java developers coming to Python.</p>
<p>def new_person(firstname=&#8221;", lastname=&#8221;"): return {&#8222;firstname&#8221;:firstname, &#8222;lastname&#8221;:lastname}</p>
<p>persons = [new_person("Jake", "Blake"),  new_person("James", "Smith")]</p>
<p>firstnames = [person["firstname"] for person in persons]</p>
<p>The last data structure of choice should always be classes. If you can get away using dictionaries, list and tuples, then use them first.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Skomentuj Python for Java developers: list comprehension, którego autorem jest mrbox</title>
		<link>http://tech.mrozewski.pl/2011/06/30/python-for-java-developers-list-comprehension/comment-page-1/#comment-484</link>
		<dc:creator>mrbox</dc:creator>
		<pubDate>Thu, 30 Jun 2011 21:24:23 +0000</pubDate>
		<guid isPermaLink="false">http://tech.mrozewski.pl/?p=518#comment-484</guid>
		<description>There is one more topic similar to list-comprehensions- generators. Looks almost the same as list comprehensions but they are more efficient and has lower memory usage.

For example:
x = (i**2 for i in xrange(0,5)) - it won&#039; t produce a list(x[3] will produce a TypeError) and store it in memory but you can loop over x and sum it&#039; s elements and every element will be generated while beeing iterated over:
y = sum(x)
print y
&gt;&gt; 30 #because sum(x) == 0^2 + 1^2 + 2^2 + 3^2 + 4^2

And the more info is here: http://wiki.python.org/moin/Generators</description>
		<content:encoded><![CDATA[<p>There is one more topic similar to list-comprehensions- generators. Looks almost the same as list comprehensions but they are more efficient and has lower memory usage.</p>
<p>For example:<br />
x = (i**2 for i in xrange(0,5)) &#8211; it won&#8217; t produce a list(x[3] will produce a TypeError) and store it in memory but you can loop over x and sum it&#8217; s elements and every element will be generated while beeing iterated over:<br />
y = sum(x)<br />
print y<br />
&gt;&gt; 30 #because sum(x) == 0^2 + 1^2 + 2^2 + 3^2 + 4^2</p>
<p>And the more info is here: <a href="http://wiki.python.org/moin/Generators" rel="nofollow">http://wiki.python.org/moin/Generators</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Skomentuj Python for Java developers: list comprehension, którego autorem jest mati</title>
		<link>http://tech.mrozewski.pl/2011/06/30/python-for-java-developers-list-comprehension/comment-page-1/#comment-483</link>
		<dc:creator>mati</dc:creator>
		<pubDate>Thu, 30 Jun 2011 20:48:35 +0000</pubDate>
		<guid isPermaLink="false">http://tech.mrozewski.pl/?p=518#comment-483</guid>
		<description>Thanks Jakub. I wanted to keep the clarity but indeed it was not a good example.</description>
		<content:encoded><![CDATA[<p>Thanks Jakub. I wanted to keep the clarity but indeed it was not a good example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Skomentuj Python for Java developers: list comprehension, którego autorem jest mrbox</title>
		<link>http://tech.mrozewski.pl/2011/06/30/python-for-java-developers-list-comprehension/comment-page-1/#comment-482</link>
		<dc:creator>mrbox</dc:creator>
		<pubDate>Thu, 30 Jun 2011 20:42:32 +0000</pubDate>
		<guid isPermaLink="false">http://tech.mrozewski.pl/?p=518#comment-482</guid>
		<description>Please, do not teach Java developers to concatenate strings in Python like
self.fname + &quot; &quot; + self.lname

It could be that:
&quot;%s %s&quot; % (self.fname, self.lname)

Or
&quot;{fname} {lname}&quot;.format(fname=self.fname,lname=self.lname)</description>
		<content:encoded><![CDATA[<p>Please, do not teach Java developers to concatenate strings in Python like<br />
self.fname + &#8221; &#8221; + self.lname</p>
<p>It could be that:<br />
&#8222;%s %s&#8221; % (self.fname, self.lname)</p>
<p>Or<br />
&#8222;{fname} {lname}&#8221;.format(fname=self.fname,lname=self.lname)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Skomentuj Private inner class hacking, którego autorem jest jed</title>
		<link>http://tech.mrozewski.pl/2010/09/07/private-inner-class-hacking/comment-page-1/#comment-389</link>
		<dc:creator>jed</dc:creator>
		<pubDate>Mon, 24 Jan 2011 14:55:32 +0000</pubDate>
		<guid isPermaLink="false">http://tech.mrozewski.pl/?p=485#comment-389</guid>
		<description>what up ? coś dawno matixo nic nie pisałeś :-)</description>
		<content:encoded><![CDATA[<p>what up ? coś dawno matixo nic nie pisałeś <img src='http://tech.mrozewski.pl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

