<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://united-coders.com"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>united-coders.com - JSON</title>
 <link>http://united-coders.com/taxonomy/term/96/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>How many angry birds defeat how many pigs in google+?</title>
 <link>http://united-coders.com/christian-harms/how-many-angry-birds-defeat-how-many-pigs-in-google</link>
 <description>&lt;p&gt;Coding (in spare time) should be fun. Some times I change this with real gaming like the angry birds on google+. But after some days of scoring agains my friends I opened the HttpFox plugin and looked behind the normal interface.&lt;/p&gt;
&lt;p&gt;And I got a view of the JSON-data files from the angry birds game. Every level is offered in a single json-file and has count for the 1-, 2- or 3-star assessment. With some python scripting I fetched all level files from the app enginge instance of angry birds.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;python geshifilter-python&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;div style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; json, &lt;span style=&quot;color: #dc143c;&quot;&gt;urllib&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;div style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;for&lt;/span&gt; level &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;range&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;9&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;div style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;for&lt;/span&gt; stage &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;range&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;, level &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;and&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;22&lt;/span&gt; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;or&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;div style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#url is shorted to prevent copy/paste kiddies ...&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;div style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp; &amp;nbsp; lvUrl = &lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;https://r3138-dot-xxxx.appspot.com/cors/fowl/json/Level%d-%d.json&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;level, stage&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;div style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp; &amp;nbsp; data = json.&lt;span style=&quot;color: black;&quot;&gt;loads&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #dc143c;&quot;&gt;urllib&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;urlopen&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;lvUrl&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;read&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;div style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;You need %s points for 3 stars in level %d-%d.&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: monospace; font-weight: normal;&quot;&gt;&lt;div style=&quot;font-family: monospace; font-weight: normal; font-style: normal&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;data&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;scoreGold&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;, level, stage&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;That&#039;s was so easy - all work was done. &lt;/p&gt;
&lt;p&gt;And the answer to the question (for all 8 levels and the Chrome level):&lt;span class=&quot;read-more&quot;&gt;&lt;a href=&quot;/christian-harms/how-many-angry-birds-defeat-how-many-pigs-in-google&quot;&gt;&lt;strong&gt;Read more&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;!--
&lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:trackback=&quot;http://madskills.com/public/xml/rss/module/trackback/&quot;&gt;
&lt;rdf:Description rdf:about=&quot;http://united-coders.com/christian-harms/how-many-angry-birds-defeat-how-many-pigs-in-google&quot; dc:identifier=&quot;http://united-coders.com/christian-harms/how-many-angry-birds-defeat-how-many-pigs-in-google&quot; dc:title=&quot;How many angry birds defeat how many pigs in google+?&quot; trackback:ping=&quot;http://united-coders.com/trackback/107&quot; /&gt;
&lt;/rdf:RDF&gt;
--&gt;
&lt;div class=&#039;sexybookmarks-default-5853&#039;&gt;&lt;/div&gt;</description>
 <comments>http://united-coders.com/christian-harms/how-many-angry-birds-defeat-how-many-pigs-in-google#comments</comments>
 <category domain="http://united-coders.com/category/tags/angry-birds">angry birds</category>
 <category domain="http://united-coders.com/category/tags/google-games">google+ games</category>
 <category domain="http://united-coders.com/category/tags/json">JSON</category>
 <pubDate>Thu, 25 Aug 2011 11:59:05 +0000</pubDate>
 <dc:creator>Christian Harms</dc:creator>
 <guid isPermaLink="false">107 at http://united-coders.com</guid>
</item>
<item>
 <title>The art of escaping</title>
 <link>http://united-coders.com/matthias-reuter/the-art-of-escaping</link>
 <description>&lt;p&gt;Escaping is the art of transforming a text into a transport format from which it can be extracted again without any modification.&lt;/p&gt;
&lt;p&gt;That&#039;s something every developer does - to a certain level. For example take the sentence&lt;/p&gt;
&lt;blockquote&gt;&lt;div class=&quot;quote_start&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;quote_end&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Matthias says: &amp;quot;I love Javascript&amp;quot;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Now put this sentence in a Java source code:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;java geshifilter-java&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #003399;&quot;&gt;String&lt;/span&gt; s &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;Matthias says: &amp;quot;&lt;/span&gt;I love Javascript&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;.&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;If you don&#039;t complain about this, your compiler will. In Java (any many other programming languages) the quotation mark &amp;quot; has a special meaning, it defines a string. So if you have a string containing the quotation mark, you need to escape it:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;java geshifilter-java&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #003399;&quot;&gt;String&lt;/span&gt; s &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;Matthias says: &lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;I love Javascript&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;.&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;If you print out s, the original text is shown:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;java geshifilter-java&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #003399;&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;s&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// Matthias says: &amp;quot;I love Javascript&amp;quot;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class=&quot;read-more&quot;&gt;&lt;a href=&quot;/matthias-reuter/the-art-of-escaping&quot;&gt;&lt;strong&gt;Read more&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;!--
&lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:trackback=&quot;http://madskills.com/public/xml/rss/module/trackback/&quot;&gt;
&lt;rdf:Description rdf:about=&quot;http://united-coders.com/matthias-reuter/the-art-of-escaping&quot; dc:identifier=&quot;http://united-coders.com/matthias-reuter/the-art-of-escaping&quot; dc:title=&quot;The art of escaping&quot; trackback:ping=&quot;http://united-coders.com/trackback/41&quot; /&gt;
&lt;/rdf:RDF&gt;
--&gt;
&lt;div class=&#039;sexybookmarks-default-8461&#039;&gt;&lt;/div&gt;</description>
 <comments>http://united-coders.com/matthias-reuter/the-art-of-escaping#comments</comments>
 <category domain="http://united-coders.com/category/tags/escaping">escaping</category>
 <category domain="http://united-coders.com/category/tags/html">HTML</category>
 <category domain="http://united-coders.com/category/tags/java">java</category>
 <category domain="http://united-coders.com/category/tags/json">JSON</category>
 <category domain="http://united-coders.com/category/tags/php">php</category>
 <category domain="http://united-coders.com/category/tags/sql">SQL</category>
 <category domain="http://united-coders.com/category/tags/url">URL</category>
 <pubDate>Fri, 27 Nov 2009 08:47:49 +0000</pubDate>
 <dc:creator>Matthias Reuter</dc:creator>
 <guid isPermaLink="false">41 at http://united-coders.com</guid>
</item>
</channel>
</rss>


