Skip to content

Commit

Permalink
Generate Pelican site
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Mar 31, 2017
1 parent 6e38b96 commit 728fd10
Show file tree
Hide file tree
Showing 54 changed files with 3,201 additions and 2,821 deletions.
2 changes: 2 additions & 0 deletions archives.html
Expand Up @@ -91,6 +91,8 @@ <h1>Archives for atodorov.org</h1>
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<dl>
<dt>Sat 01 April 2017</dt>
<dd><a href="http://atodorov.org/blog/2017/04/01/building-cardboard-robots/">Building cardboard robots</a></dd>
<dt>Fri 13 January 2017</dt>
<dd><a href="http://atodorov.org/blog/2017/01/13/a-5-year-old-girl-vs-coderdojo/">A 5 year old girl vs. CoderDojo</a></dd>
<dt>Tue 03 January 2017</dt>
Expand Down
73 changes: 25 additions & 48 deletions atom.xml
@@ -1,5 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>atodorov.org</title><link href="http://atodorov.org/" rel="alternate"></link><link href="http://atodorov.org/atom.xml" rel="self"></link><id>http://atodorov.org/</id><updated>2017-01-13T09:48:00+02:00</updated><entry><title>A 5 year old girl vs. CoderDojo</title><link href="http://atodorov.org/blog/2017/01/13/a-5-year-old-girl-vs-coderdojo/" rel="alternate"></link><updated>2017-01-13T09:48:00+02:00</updated><author><name>Alexander Todorov</name></author><id>tag:atodorov.org,2017-01-13:blog/2017/01/13/a-5-year-old-girl-vs-coderdojo/</id><summary type="html">&lt;p&gt;&lt;img alt="Adi @ Hello Ruby" src="/images/adi_hello_ruby_twitter.jpg" title="Adi @ Hello Ruby" /&gt;&lt;/p&gt;
<feed xmlns="http://www.w3.org/2005/Atom"><title>atodorov.org</title><link href="http://atodorov.org/" rel="alternate"></link><link href="http://atodorov.org/atom.xml" rel="self"></link><id>http://atodorov.org/</id><updated>2017-04-01T01:08:00+03:00</updated><entry><title>Building cardboard robots</title><link href="http://atodorov.org/blog/2017/04/01/building-cardboard-robots/" rel="alternate"></link><updated>2017-04-01T01:08:00+03:00</updated><author><name>Alexander Todorov</name></author><id>tag:atodorov.org,2017-04-01:blog/2017/04/01/building-cardboard-robots/</id><summary type="html">&lt;p&gt;&lt;img alt="Adi with robots" src="/images/adi_robots.jpg" title="Adi and her robots" /&gt;&lt;/p&gt;
&lt;p&gt;My &lt;a href="http://atodorov.org/blog/2017/01/13/a-5-year-old-girl-vs-coderdojo/"&gt;previous blog post&lt;/a&gt; was about
the &lt;em&gt;Hello Ruby&lt;/em&gt; book, &lt;em&gt;Coder Dojo&lt;/em&gt; and making computers out of paper - all cool
things for a 5 year old girl. This week I have discovered the
&lt;a href="http://amzn.to/2oqEhCD"&gt;Build the Robot&lt;/a&gt; book
(&lt;a href="https://www.fiut.bg/roboti-procheti-i-sglobi.html"&gt;link to BG edition&lt;/a&gt;)!&lt;/p&gt;
&lt;p&gt;The book includes colorful pictures and some interesting facts about robots.
On the second page it talks about
&lt;a href="https://en.wikipedia.org/wiki/Six_degrees_of_freedom"&gt;degrees of freedom&lt;/a&gt;,
which I've studied at technical university during my Mechanics course.
How's that for a children's book ?&lt;/p&gt;
&lt;p&gt;The most important part of the book are cardboard models of 3 robots:
walking one (orange), dancing one (light blue) and one waving its hands (black).
The pieces are put together by friction and
all of the 3 robots use spring loaded motors for some basic movements.&lt;/p&gt;
&lt;p&gt;We did have to use some glue because one of the legs kept falling apart but
overall the print/cut quality of the Bulgarian edition was very good.&lt;/p&gt;
&lt;p&gt;From the 3 robots the walking one is the worst. I think it is too heavy for the
motor to move around. The dancing robot works most of the time. The robot which
waves his hands up and down works best!&lt;/p&gt;
&lt;p&gt;Overall a very good book, fun to build and play with and very informative!
I strongly recommend it if you have small children and want them to feel
comfortable around technology!&lt;/p&gt;
&lt;p&gt;Thanks for reading!&lt;/p&gt;</summary><category term="fedora.planet"></category></entry><entry><title>A 5 year old girl vs. CoderDojo</title><link href="http://atodorov.org/blog/2017/01/13/a-5-year-old-girl-vs-coderdojo/" rel="alternate"></link><updated>2017-01-13T09:48:00+02:00</updated><author><name>Alexander Todorov</name></author><id>tag:atodorov.org,2017-01-13:blog/2017/01/13/a-5-year-old-girl-vs-coderdojo/</id><summary type="html">&lt;p&gt;&lt;img alt="Adi @ Hello Ruby" src="/images/adi_hello_ruby_twitter.jpg" title="Adi @ Hello Ruby" /&gt;&lt;/p&gt;
&lt;p&gt;In early December'16 together with my 5 year old daughter we visited an introductory workshop
about the &lt;a href="http://amzn.to/2ijQlBD"&gt;Hello Ruby&lt;/a&gt; book and another
workshop organized by &lt;a href="http://coderdojobulgaria.com/"&gt;Coder Dojo Bulgaria&lt;/a&gt;.
Expand Down Expand Up @@ -2075,50 +2098,4 @@ he covered some basics about Agile and what it actually is. Afterwards we've sta
and talked for a good 2 hours more. I definitely would like to hear more from
him in the future.&lt;/p&gt;
&lt;p&gt;A big thanks to Questers for hosting this event and allowing me to record it.
Happy &lt;a href="https://www.youtube.com/watch?v=IX2ILL8Xq5s&amp;amp;list=PLFjlI7p-h1hxBP3cIjEqePSeoBDHud5Db&amp;amp;index=1"&gt;watching&lt;/a&gt;.&lt;/p&gt;</summary><category term="events"></category></entry><entry><title>Python 2 vs. Python 3 List Sort Causes Bugs</title><link href="http://atodorov.org/blog/2016/08/05/python-2-vs-python-3-list-sort-causes-bugs/" rel="alternate"></link><updated>2016-08-05T10:30:00+03:00</updated><author><name>Alexander Todorov</name></author><id>tag:atodorov.org,2016-08-05:blog/2016/08/05/python-2-vs-python-3-list-sort-causes-bugs/</id><summary type="html">&lt;p&gt;Can sorting a list of values crash your software? Apparently it can and is
another example of my
&lt;a href="http://atodorov.org/blog/2016/03/25/hello-world-qa-challenge/"&gt;Hello World Bugs&lt;/a&gt;.
Python 3 has simplified the
&lt;a href="https://docs.python.org/3/whatsnew/3.0.html#ordering-comparisons"&gt;rules for ordering comparisons&lt;/a&gt;
which changes the behavior of sorting lists when their contents are dictionaries.
For example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;Python&lt;/span&gt; &lt;span class="mf"&gt;2.7&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Oct&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="mi"&gt;2015&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;47&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;GCC&lt;/span&gt; &lt;span class="mf"&gt;4.8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;20140911&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Red&lt;/span&gt; &lt;span class="n"&gt;Hat&lt;/span&gt; &lt;span class="mf"&gt;4.8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;linux2&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;c&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;Python&lt;/span&gt; &lt;span class="mf"&gt;3.5&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Apr&lt;/span&gt; &lt;span class="mi"&gt;27&lt;/span&gt; &lt;span class="mi"&gt;2016&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mo"&gt;04&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;56&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;GCC&lt;/span&gt; &lt;span class="mf"&gt;4.8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;20140911&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Red&lt;/span&gt; &lt;span class="n"&gt;Hat&lt;/span&gt; &lt;span class="mf"&gt;4.8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;linux&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;c&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="n"&gt;Traceback&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;most&lt;/span&gt; &lt;span class="n"&gt;recent&lt;/span&gt; &lt;span class="n"&gt;call&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="n"&gt;File&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;lt;stdin&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="ne"&gt;TypeError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;unorderable&lt;/span&gt; &lt;span class="n"&gt;types&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The problem is that the second elements in both lists have different keys
and Python doesn't know how to compare them. In earlier Python versions
this has been special cased as
&lt;a href="http://stackoverflow.com/questions/3484293/is-there-a-description-of-how-cmp-works-for-dict-objects-in-python-2/3484456#3484456"&gt;described here&lt;/a&gt;
by Ned Batchelder (the author of Python's coverage tool) but in Python 3
dictionaries have no natural sort order.&lt;/p&gt;
&lt;p&gt;In the case of &lt;em&gt;django-chartit&lt;/em&gt; (of which I'm now the official maintainer) this
bug triggers when you want to plot data from multiple sources (models) on the same
chart. In this case the fields coming from each data series are different and the
above error is triggered.&lt;/p&gt;
&lt;p&gt;I have worked around this in
&lt;a href="https://github.com/chartit/django-chartit/commit/9d9033ecd5a8592a12872293cdf6d710cebf894f"&gt;commit 9d9033e&lt;/a&gt;
by simply disabling an iterator sort but this is sub-optimal and I'm not quite certain
what the side effect might be. I suspect you may end up with a chart where the order
of values on the X axis isn't the same for the different models, e.g. one graph plotting
the data in ascending order the other one in descending.&lt;/p&gt;
&lt;p&gt;The trouble also comes from the fact that we're sorting an iterator (a list of fields) by
telling Python to use a list of dicts to determine the sort order. In this arrangement
there is no way to tell Python how we want to compare our dicts. The only solution I
can think about is creating a custom class and implementing a custom &lt;code&gt;__cmp__()&lt;/code&gt; method
for this data structure!&lt;/p&gt;</summary><category term="QA"></category><category term="Python"></category></entry></feed>
Happy &lt;a href="https://www.youtube.com/watch?v=IX2ILL8Xq5s&amp;amp;list=PLFjlI7p-h1hxBP3cIjEqePSeoBDHud5Db&amp;amp;index=1"&gt;watching&lt;/a&gt;.&lt;/p&gt;</summary><category term="events"></category></entry></feed>

0 comments on commit 728fd10

Please sign in to comment.