<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Lorenzo Mele</title>
    <description>The latest articles on Forem by Lorenzo Mele (@greenkey).</description>
    <link>https://forem.com/greenkey</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F11886%2F2916541.jpeg</url>
      <title>Forem: Lorenzo Mele</title>
      <link>https://forem.com/greenkey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/greenkey"/>
    <language>en</language>
    <item>
      <title>RecruiterBot - a collaborative presentation</title>
      <dc:creator>Lorenzo Mele</dc:creator>
      <pubDate>Mon, 17 Apr 2017 19:02:34 +0000</pubDate>
      <link>https://forem.com/greenkey/recruiterbot---a-collaborative-presentation</link>
      <guid>https://forem.com/greenkey/recruiterbot---a-collaborative-presentation</guid>
      <description>&lt;p&gt;It's been a while I'm attending a meetup in Milan about chatbots.&lt;/p&gt;

&lt;p&gt;The topic is very interesting and fast growing, furthermore, the meetup is always full of interesting people with very different skills.&lt;/p&gt;

&lt;p&gt;For the April date, Paolo Montrasio (the meetup organiser) asked if someone had an idea to talk about.&lt;br&gt;
I proposed to talk about a RecruiterBot and this post is the report of my presentation/brainstorm - if you understand Italian, you can see &lt;a href="https://youtu.be/OqkqPmpyyBE"&gt;the video of it&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  PersonalBot, CompanyBot, AgentBot?
&lt;/h2&gt;

&lt;p&gt;The first idea came in my mind after the Nth head-hunter asking me the same questions: do you have experience in X? Do you prefer big or small companies? What is your salary expectation? Etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q9ZXLMk2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/cwco9itwgcud4tqnrh5l.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q9ZXLMk2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/cwco9itwgcud4tqnrh5l.jpg" alt="Automate all the things" title="Automate all the things"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm one of those freaks who wants to automate everything, so I thought that a bot answering the usual questions would be a fair time saver.&lt;/p&gt;

&lt;p&gt;My first idea was a bot programmed by a person seeking for a job, used by companies and recruiters looking for a candidate. Let's call it a &lt;strong&gt;Personal Bot&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When I first talked other people about the idea, it was clear to me that it wasn't enough.&lt;br&gt;
To someone, it would be even better to reverse the game: a bot programmed by someone offering a job, used by the people trying to apply for it. A &lt;strong&gt;Company Bot&lt;/strong&gt;.&lt;br&gt;
This is possibly a more interesting bot because companies are more likely to pay that a person.&lt;/p&gt;

&lt;p&gt;Someone suggested me also a third type of bot, something that could stay in the middle, chatting both with seekers and offerers, an &lt;strong&gt;Agent Bot&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Presentation
&lt;/h2&gt;

&lt;p&gt;My presentation to the audience was very short, it was just a presentation of myself (always put a &lt;em&gt;Who Am I&lt;/em&gt; slide in your presentations!) and a brief introduction. The goal was to let the audience talk after all.&lt;/p&gt;

&lt;p&gt;Right after the presentation I opened a &lt;a href="https://trello.com/b/4xHTPOGv/chatbot-per-recruitment"&gt;Trello board&lt;/a&gt; set for the occasion, with the following columns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Out of scope - Ideas that are not interesting at the moment&lt;/li&gt;
&lt;li&gt;Strenghts - What differentiate this Bot from other solutions?&lt;/li&gt;
&lt;li&gt;For Companies - Ideas for the CompanyBot&lt;/li&gt;
&lt;li&gt;For Candidates - Ideas for the PersonalBot&lt;/li&gt;
&lt;li&gt;For Recruiter - Ideas for the AgentBot&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then I let the audience talk.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some general considerations
&lt;/h2&gt;

&lt;p&gt;Before going in depth of each bot's ideas, I find something interesting during the brainstorming.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Bot should immediately state its nature.&lt;/strong&gt;&lt;br&gt;
It's like the message on the voicemail, the first thing you always hear is "&lt;em&gt;Hi, we're not at home right now...&lt;/em&gt;".&lt;br&gt;
Once, I set this message on my answering machine: "&lt;em&gt;Hello? -pause- Oh, sorry, I'm not at home now, please leave a message.&lt;/em&gt;"&lt;br&gt;
It was fun until they started insulting me.&lt;/p&gt;

&lt;h2&gt;
  
  
  Out Of Scope
&lt;/h2&gt;

&lt;h4&gt;
  
  
  It's not a crawler
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://www.fastcompany.com/3069166/i-built-a-bot-to-apply-to-thousands-of-jobs-at-once-heres-what-i-learned"&gt;Someone already tried&lt;/a&gt; to use a bot to automatically reply to job offers. That guy learnt a lot about recruiting but the bot didn't help him finding a job. &lt;/p&gt;

&lt;h2&gt;
  
  
  Strength
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Straight to the point
&lt;/h4&gt;

&lt;p&gt;We're tired to read tons of content to find the one that interests us (down with websites and CV).&lt;br&gt;
With a bot in front of you you could ask questions in random order, without roundabout expressions, you can even be harsh (but not too much, someone could read the logs!).&lt;/p&gt;

&lt;h4&gt;
  
  
  Time saving
&lt;/h4&gt;

&lt;p&gt;Imagine to make a 20 minutes call in which we talk about our experience, our skills, the team's activity, the role needed and then the question: "&lt;em&gt;Are you willing to relocate in Iceland?&lt;/em&gt;".&lt;/p&gt;

&lt;h2&gt;
  
  
  Ideas for Companies - CompanyBot
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Skim
&lt;/h4&gt;

&lt;p&gt;One of the greatest need for a company is to make a shortlist of all the candidates.&lt;br&gt;
A bot could be programmed to ask some question in order to understand if the candidate has all the requirements.&lt;/p&gt;

&lt;h4&gt;
  
  
  Clustering
&lt;/h4&gt;

&lt;p&gt;If the bot's decision tree is well made, the candidates can be grouped into clusters or categories, so that the company will be able to identify the right person, maybe for other positions.&lt;/p&gt;

&lt;h4&gt;
  
  
  Pre-evaluate
&lt;/h4&gt;

&lt;p&gt;You can set the bot to make technical questions about the position.&lt;br&gt;
You can exchange files too! So why not using it to ask examples of the candidate's works? &lt;br&gt;
For a programmer could be possible to propose a problem and then ask for the output file (I'm thinking about problems like the ones in &lt;a href="https://code.google.com/"&gt;Google Code Jam&lt;/a&gt;).&lt;/p&gt;

&lt;h4&gt;
  
  
  A job post is too short
&lt;/h4&gt;

&lt;p&gt;A job post cannot be too long and cannot contain all the of information.&lt;br&gt;
A candidate could ask a bot all the data not present in the job post: "&lt;em&gt;You wrote Java but are you using some specific framework?&lt;/em&gt;", "&lt;em&gt;What type of insurance is included in tha package?&lt;/em&gt;"&lt;/p&gt;

&lt;h2&gt;
  
  
  Ideas for Candidates - PersonalBot
&lt;/h2&gt;

&lt;h4&gt;
  
  
  A CV is too short
&lt;/h4&gt;

&lt;p&gt;A ResumÃ© cannot be too long and cannot contain all the information.&lt;br&gt;
A company could ask a bot all the data not present in the resumÃ©: "&lt;em&gt;You wrote Java but are you using some specific framework?&lt;/em&gt;", "&lt;em&gt;Can you show me an example of your works?&lt;/em&gt;"&lt;/p&gt;

&lt;h4&gt;
  
  
  Time matters
&lt;/h4&gt;

&lt;p&gt;Sometimes you find the perfect CV for a position, but it's 2 years old. You could ask the bot information like the availability (maybe they're not interested in a new position now) or the latest version of the CV.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ideas for Recruiters - AgentBot
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Interview simulator
&lt;/h4&gt;

&lt;p&gt;This could be a service for a not-experienced candidate who wants to understand what type of question will face.&lt;br&gt;
Also, the bot could record the answers and identify some interesting profiles.&lt;/p&gt;

&lt;h4&gt;
  
  
  Agent
&lt;/h4&gt;

&lt;p&gt;This is a very broad concept, the idea is to have a personal assistant, always updated to the latest experience and always in contact with companies looking for candidates.&lt;br&gt;
The agent could notify the person about a new job offer, but it could also notify the company about a new skill of a candidate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusions
&lt;/h2&gt;

&lt;p&gt;I'm letting all these information to the whole world, I'm not sure is the right thing to do, I don't know if I'm going to develop it.&lt;br&gt;
Maybe these ideas will be massively used by more and more people, turning a purely human process in a completely automated one, making artificial intelligences drive our career and our life choiches, ending in a world in which we humans have nothing to do but follow what &lt;em&gt;they&lt;/em&gt; say...&lt;/p&gt;

&lt;p&gt;So now I can either write that bot or write a sci-fi novel.&lt;/p&gt;

</description>
      <category>chatbot</category>
    </item>
    <item>
      <title>my solution of Tidy Number (Google Code Jam) </title>
      <dc:creator>Lorenzo Mele</dc:creator>
      <pubDate>Tue, 11 Apr 2017 00:00:00 +0000</pubDate>
      <link>https://forem.com/greenkey/my-solution-of-tidy-number-google-code-jam</link>
      <guid>https://forem.com/greenkey/my-solution-of-tidy-number-google-code-jam</guid>
      <description>

</description>
      <category>programming</category>
      <category>python</category>
      <category>googlecodejam</category>
    </item>
    <item>
      <title>Oversized Pancake Flipper - Google Code Jam</title>
      <dc:creator>Lorenzo Mele</dc:creator>
      <pubDate>Mon, 10 Apr 2017 12:43:37 +0000</pubDate>
      <link>https://forem.com/greenkey/oversized-pancake-flipper---google-code-jam</link>
      <guid>https://forem.com/greenkey/oversized-pancake-flipper---google-code-jam</guid>
      <description>

&lt;h2&gt;
  
  
  Google Code Jam
&lt;/h2&gt;

&lt;p&gt;If you're a programmer and you don't know &lt;a href="https://code.google.com"&gt;Google Code Jam&lt;/a&gt;, you should definitely go and check that. It's basically a coding competition, I like to call it "the programming olympics".&lt;/p&gt;

&lt;p&gt;It's about 4 or 5 years I'm participating, I love it because it challenges my coding skills, and I'm not talking about "making a for loop".&lt;/p&gt;

&lt;p&gt;This year I want to share my solutions of the problems, let's start with the first and the easiest one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://code.google.com/codejam/contest/3264486/dashboard#s=p0"&gt;Here the complete problem text&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You have a row of pancakes and a strange flipper, you have to find the right combination to make them show their &lt;em&gt;happy side&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;At first I thought it could be easy: just flip the &lt;em&gt;unhappy&lt;/em&gt; pancakes and see what happens.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"This is a competition, the solution can't be so simple!"&lt;/em&gt; - my inner voice said. So I proceeded to the other problem to see if they were simpler, after those I came back.&lt;/p&gt;

&lt;h2&gt;
  
  
  The solution
&lt;/h2&gt;

&lt;p&gt;Facing the problem again, I had no other ideas but the first one. I decided to give it a try.&lt;/p&gt;

&lt;p&gt;You can find the code &lt;a href="https://gist.github.com/greenkey/1fd7a44c0b110ec9cd6f69b99b000adf"&gt;here&lt;/a&gt;, but let me explain some part of it.&lt;/p&gt;

&lt;p&gt;To ease the following steps, I get the first part of the input &lt;code&gt;line.split()[0]&lt;/code&gt; and I convert the pancake row in a list of binary items.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;span class="n"&gt;pancake_row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;'+'&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The list comprehension says something like &lt;em&gt;"for every character in the string, create an item with &lt;code&gt;True&lt;/code&gt; value if the character equals &lt;code&gt;+&lt;/code&gt;, False otherwise"&lt;/em&gt;&lt;br&gt;
List comprehension are very powerful, here is the code without it:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;pancake_row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="n"&gt;pancake_row&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;'+'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Then i go through the list looking for a pancake to flip, now that every item is a boolean, I can check them with a simple &lt;code&gt;if&lt;/code&gt;:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;span class="n"&gt;pan_size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&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="c1"&gt;# ...
&lt;/span&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pancake_row&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;pan_size&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="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;pancake_row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
&lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now I put the flipper starting from the first &lt;em&gt;unhappy pancake&lt;/em&gt; and then flip.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pancakes: ---+-++-
flipper:  ***
flipped:  ++++-++-
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;To make it in the code, I just have to &lt;code&gt;not&lt;/code&gt; the items: &lt;code&gt;not False == True&lt;/code&gt;:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pancake_row&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;pan_size&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="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;pancake_row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;pan_size&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="n"&gt;pancake_row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;pancake_row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I think I could have done it using &lt;em&gt;slicing&lt;/em&gt;:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pancake_row&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;pan_size&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="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;pancake_row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
        &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;pan_size&lt;/span&gt;
        &lt;span class="n"&gt;pancake_row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pancake_row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Going on with the example, the pancake row evolution should be the following:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---+-++-
***
++++-++-
    ***
+++++---
     ***
++++++++
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;With this example we're lucky, because at the end all the pancakes are &lt;em&gt;happy&lt;/em&gt;. We can check it using a special Python function (you don't have to reinvent the wheel):&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;span class="nb"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pancake_row&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://docs.python.org/2/library/functions.html#all"&gt;&lt;code&gt;all()&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Return &lt;code&gt;True&lt;/code&gt; if all elements of the iterable are true&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If the pancakes are not all on the happy side, we can argue that it's impossible: the &lt;em&gt;unhappy&lt;/em&gt; pancake should be at the end of the row, there's no way flip them without flipping the previous pancakes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learnt
&lt;/h2&gt;

&lt;p&gt;My intuition was right... &lt;em&gt;I&lt;/em&gt; was right! (not my inner voice).&lt;/p&gt;

&lt;p&gt;So next time I could give it a try sooner.&lt;/p&gt;


</description>
      <category>programming</category>
      <category>python</category>
      <category>googlecodejam</category>
    </item>
    <item>
      <title>Learn Django the right away</title>
      <dc:creator>Lorenzo Mele</dc:creator>
      <pubDate>Fri, 17 Mar 2017 22:41:54 +0000</pubDate>
      <link>https://forem.com/greenkey/learn-django-the-right-away</link>
      <guid>https://forem.com/greenkey/learn-django-the-right-away</guid>
      <description>&lt;p&gt;I wanted a guide to start using Django.&lt;/p&gt;

&lt;p&gt;I also wanted a guide with a good approach, something that could give me a good understanding of some methodology like TDD.&lt;/p&gt;

&lt;p&gt;I found &lt;a href="http://www.obeythetestinggoat.com/"&gt;Test-Driven Development with Python&lt;/a&gt;, aka &lt;em&gt;Obey the Testing Goat!&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It is awesome. not only it introduces you to Django one step at a time, but it does it using &lt;a href="https://en.wikipedia.org/wiki/Test-driven_development"&gt;TDD&lt;/a&gt;, something I cannot anything without anymore.&lt;/p&gt;

&lt;p&gt;Read it, and let me know what you think!&lt;/p&gt;

</description>
      <category>prorgamming</category>
      <category>python</category>
      <category>django</category>
      <category>tdd</category>
    </item>
  </channel>
</rss>
