<?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>DEV Community: Laurent Abbal</title>
    <description>The latest articles on DEV Community by Laurent Abbal (@laurentabbal).</description>
    <link>https://dev.to/laurentabbal</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%2F117422%2F4f92a762-ad1f-4d26-ad08-5ffe5dbec3b0.jpg</url>
      <title>DEV Community: Laurent Abbal</title>
      <link>https://dev.to/laurentabbal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/laurentabbal"/>
    <language>en</language>
    <item>
      <title>CODE PUZZLE for Python and other languages</title>
      <dc:creator>Laurent Abbal</dc:creator>
      <pubDate>Mon, 31 Jan 2022 13:10:26 +0000</pubDate>
      <link>https://dev.to/laurentabbal/code-puzzle-for-python-and-other-languages-3eih</link>
      <guid>https://dev.to/laurentabbal/code-puzzle-for-python-and-other-languages-3eih</guid>
      <description>&lt;p&gt;&lt;a href="https://www.codepuzzl.io/en"&gt;Code Puzzle&lt;/a&gt; is a "Parsons puzzles" generator and manager.&lt;/p&gt;

&lt;p&gt;With &lt;a href="https://www.codepuzzl.io/en"&gt;Code Puzzle&lt;/a&gt; you can create, save, modify and share Parsons puzzles (or Parsons problems).&lt;/p&gt;

&lt;p&gt;According to &lt;a href="https://en.wikipedia.org/wiki/Parsons_problems"&gt;Wikipedia&lt;/a&gt; : "Parsons problems are a form of an objective assessment in which respondents are asked to select from a selection of code fragments, some subset of which comprise the problem solution. The Parsons problem format is used in the learning and teaching of computer programming. Parson's programming puzzles became known as Parsons puzzles and then Parsons problems. Parsons problems have become popular as they are easier to grade than written code while capturing the students problem solving ability shown in a code creation process."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UYKjpHX4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://www.codepuzzle.io/img/demo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UYKjpHX4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://www.codepuzzle.io/img/demo.gif" alt="example" width="784" height="344"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>code</category>
      <category>python</category>
      <category>parsons</category>
      <category>puzzle</category>
    </item>
    <item>
      <title>HOW TO ADD BEAUTIFUL SOURCE CODE IN MEDIUM ARTICLES</title>
      <dc:creator>Laurent Abbal</dc:creator>
      <pubDate>Sun, 12 May 2019 12:46:14 +0000</pubDate>
      <link>https://dev.to/laurentabbal/how-to-add-beautiful-source-code-in-medium-articles-1723</link>
      <guid>https://dev.to/laurentabbal/how-to-add-beautiful-source-code-in-medium-articles-1723</guid>
      <description>&lt;p&gt;An easy way to display neat and beautiful source code with syntax highlighting in Medium articles.&lt;br&gt;
With &lt;a href="https://www.kodeshot.net" rel="noopener noreferrer"&gt;Kodeshot&lt;/a&gt;, in three quick steps, you can include a catchy representation of your source code.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Medium restrictions
&lt;/h2&gt;

&lt;p&gt;Medium can display both inline and multi-line code blocks. But none of them supports syntax highlighting.&lt;/p&gt;

&lt;p&gt;Example :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fig = plt.figure()
ax = fig.add_axes([0, 0, 1, 1], projection='3d')
ax.axis('off')
# prepare the axes limits
ax.set_xlim((-25, 25))
ax.set_ylim((-35, 35))
ax.set_zlim((5, 55))
def lorenz_deriv(x_y_z, t0, sigma=sigma, beta=beta, rho=rho):
    """Compute the time-derivative of a Lorenz system."""
    x, y, z = x_y_z
    return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]
# Choose random starting points, uniformly distributed from -15 to 15
np.random.seed(1)
x0 = -15 + 30 * np.random.random((N, 3))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is convenient but not very pleasant to read.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The solution : kodeshot.net
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fpkp23lnz3h23i2rmd9u5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fpkp23lnz3h23i2rmd9u5.png" alt="www.kodeshot.net"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On &lt;a href="https://www.kodeshot.net" rel="noopener noreferrer"&gt;Kodeshot.net&lt;/a&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;copy your source code in the text area, customize your code and capture&lt;/li&gt;
&lt;li&gt;save the image&lt;/li&gt;
&lt;li&gt;drag and drop the image in your article&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result :&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkdeydgdlevfcozbbkage.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkdeydgdlevfcozbbkage.png" alt="souce code"&gt;&lt;/a&gt;&lt;/p&gt;
[1] Source code at the bottom of this page



&lt;p&gt;Another example :&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fliog4owzm9qnatn62su4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fliog4owzm9qnatn62su4.png" alt="souce code"&gt;&lt;/a&gt;&lt;/p&gt;
[2] Source code at the bottom of this page



&lt;p&gt;You can change the font size, the width, the style, the corners…&lt;br&gt;
This solution is quite straightforward, nicer than the solution proposed by Medium and nicer than a GitHub Gist embedded in the article.&lt;/p&gt;

&lt;p&gt;And, if you want people to be able to copy and paste the source code, you can add under the image &lt;code&gt;[x] Source code at the bottom of this page&lt;/code&gt; and, at the bottom of the article, display multi-line code blocks with your code (as I did in this article).&lt;/p&gt;



&lt;p&gt;Source code&lt;br&gt;
[1]&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fig = plt.figure()
ax = fig.add_axes([0, 0, 1, 1], projection='3d')
ax.axis('off')
# prepare the axes limits
ax.set_xlim((-25, 25))
ax.set_ylim((-35, 35))
ax.set_zlim((5, 55))
def lorenz_deriv(x_y_z, t0, sigma=sigma, beta=beta, rho=rho):
    """Compute the time-derivative of a Lorenz system."""
    x, y, z = x_y_z
    return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]
# Choose random starting points, uniformly distributed from -15 to 15
np.random.seed(1)
x0 = -15 + 30 * np.random.random((N, 3))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;[2]&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;protected function getMemcached($connectionId, array $credentials, array $options)
{
    $memcached = $this-&amp;gt;createMemcachedInstance($connectionId);
if (count($credentials) === 2) {
        $this-&amp;gt;setCredentials($memcached, $credentials);
    }
if (count($options)) {
        $memcached-&amp;gt;setOptions($options);
    }
return $memcached;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>javascript</category>
      <category>sourcecode</category>
    </item>
  </channel>
</rss>
