Skip to content
Permalink
Browse files
Update blockquotes.
  • Loading branch information
drupol committed Sep 4, 2020
1 parent 29c369b commit 59f1f14aafa6d357280480d6a23c33d50f82ab38
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 36 deletions.
@@ -16,15 +16,13 @@ But before going further, let me remind you what are the differences between per

<!--break-->

<blockquote class="blockquote text-justify">
The notion of permutation relates to the act of arranging all the members of a set into some sequence or order.
<footer class="blockquote-footer"><cite><a href="https://en.wikipedia.org/wiki/Permutation">Wikipedia</a></cite></footer>
</blockquote>

<blockquote class="blockquote text-justify">
A combination is a way of selecting items from a collection, such that, unlike permutations, the order of selection does not matter.
<footer class="blockquote-footer"><cite><a href="https://en.wikipedia.org/wiki/Combination">Wikipedia</a></cite></footer>
</blockquote>
Definition of Permutation from [Wikipedia](https://en.wikipedia.org/wiki/Permutation):
> The notion of permutation relates to the act of arranging all the members of a set into some sequence or order.
Definition of Combination from [Wikipedia](https://en.wikipedia.org/wiki/Combination):
> A combination is a way of selecting items from a collection, such that, unlike permutations, the order of selection
> does not matter.
The formula to find the number of **permutations** of $$ n $$ items among $$ r $$ items is:

@@ -74,10 +72,11 @@ And if you have to store huge results arrays, you might end up with the infamous

This is why in order to avoid those errors, I only used [PHP Generators](https://secure.php.net/manual/en/language.generators.overview.php) and [Iterators](https://secure.php.net/manual/en/class.iterator.php) in PHPermutations.

<blockquote class="blockquote text-justify">
A generator allows you to write code that uses foreach to iterate over a set of data without needing to build an array in memory, which may cause you to exceed a memory limit, or require a considerable amount of processing time to generate. Instead, you can write a generator function, which is the same as a normal function, except that instead of returning once, a generator can yield as many times as it needs to in order to provide the values to be iterated over.
<footer class="blockquote-footer"><cite><a href="https://secure.php.net/manual/en/language.generators.overview.php">php.net</a></cite></footer>
</blockquote>
From [PHP.net](https://secure.php.net/manual/en/language.generators.overview.php):
> A generator allows you to write code that uses foreach to iterate over a set of data without needing to build an
> array in memory, which may cause you to exceed a memory limit, or require a considerable amount of processing time to
> generate. Instead, you can write a generator function, which is the same as a normal function, except that instead of
> returning once, a generator can yield as many times as it needs to in order to provide the values to be iterated over.
Moreover, the notable difference with other combinatorics library is that you can use an extra parameter $$ r $$ (_the length_), that allows you to
compute permutations and combinations of any particular size.
@@ -90,10 +90,9 @@ I requested [feedback](https://github.com/peridot-php/leo/issues/29) on the libr

As I restarted to take the train to go to work, I had some time ahead to work on this and I added some features. The first feature I added in DynamicObjects is the memoization:

<blockquote class="blockquote text-justify">
In computing, memoization is an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again.
<footer class="blockquote-footer"><cite><a href="https://en.wikipedia.org/wiki/Memoization">Wikipedia</a></cite></footer>
</blockquote>
From [Wikipedia](https://en.wikipedia.org/wiki/Memoization):
> In computing, memoization is an optimization technique used primarily to speed up computer programs by storing the
> results of expensive function calls and returning the cached result when the same inputs occur again.
I first started to include the functionality "_as-is_" in DynamicObjects and then, just like before, I made a package out of it: [PHP Memoize](https://github.com/drupol/memoize).

@@ -144,11 +144,9 @@ Unfortunately, that information is not provided by the train company neither by

After some discussion with [Pieter from iRail](https://twitter.com/pietercolpaert), we decided to extensively use [Wikidata](https://www.wikidata.org/wiki/Wikidata:Main_Page).

<blockquote class="blockquote">
Wikidata is a free and open knowledge base that can be read and edited by both humans and machines.
It acts as central storage for the structured data of its Wikimedia sister projects including Wikipedia, Wikivoyage, Wikisource, and others.
The content of Wikidata is available under a free license, exported using standard formats, and can be interlinked to other open data sets on the linked data web.
</blockquote>
> Wikidata is a free and open knowledge base that can be read and edited by both humans and machines.
> It acts as central storage for the structured data of its Wikimedia sister projects including Wikipedia, Wikivoyage, Wikisource, and others.
> The content of Wikidata is available under a free license, exported using standard formats, and can be interlinked to other open data sets on the linked data web.
As every Belgium train station are in Wikipedia and thus Wikidata, I started to add line information to these stations.

@@ -22,13 +22,11 @@ This article will explain what are traits and will try to propose, without prete

<!--break-->

Let's start with the definition of a trait.
Let's start with the [definition of a trait](http://php.net/manual/en/language.oop5.traits.php).

<blockquote class="blockquote text-justify">
Traits are a mechanism for code reuse in single inheritance languages such as PHP.
A Trait is intended to reduce some limitations of single inheritance by enabling a developer to reuse sets of methods freely in several independent classes living in different class hierarchies.
<footer class="blockquote-footer"><cite><a href="http://php.net/manual/en/language.oop5.traits.php">From php.net</a></cite></footer>
</blockquote>
> Traits are a mechanism for code reuse in single inheritance languages such as PHP.
> A Trait is intended to reduce some limitations of single inheritance by enabling a developer to reuse sets of methods
> freely in several independent classes living in different class hierarchies.
When designing a software or a library, we are often busy thinking on how to make it work properly and how it could do the job as expected.
This is already a good part of the job.
@@ -43,10 +41,9 @@ Sometimes, it's possible that you'd wish your class to inherit from multiple cla

Of course, inheritance with multiple classes can be hard to work with, it adds complexity and has issues like the [Diamond problem](https://en.wikipedia.org/wiki/Multiple_inheritance#The_diamond_problem).

<blockquote class="blockquote text-justify">
The "diamond problem" (sometimes referred to as the "deadly diamond of death") is an ambiguity that arises when two classes B and C inherit from A, and class D inherits from both B and C. If there is a method in A that B and C have overridden, and D does not override it, then which version of the method does D inherit: that of B, or that of C?
<footer class="blockquote-footer"><cite><a href="https://en.wikipedia.org/wiki/Multiple_inheritance#The_diamond_problem">From wikipedia</a></cite></footer>
</blockquote>
> The "diamond problem" (sometimes referred to as the "deadly diamond of death") is an ambiguity that arises when two
> classes B and C inherit from A, and class D inherits from both B and C. If there is a method in A that B and C have
> overridden, and D does not override it, then which version of the method does D inherit: that of B, or that of C?
But obviously, PHP is not concerned by this.

@@ -25,11 +25,9 @@ The goal of having such an amount of skills contained in one single place, is to

[EU-FOSSA](https://ec.europa.eu/info/news/eu-fossa-bug-bounties-full-force-2019-apr-05_en) stands for EU-Free and Open Source Software Auditing project, a project which is managed by the European Commission's Directorate General for Informatics, the [DIGIT](https://ec.europa.eu/info/departments/informatics_en).

<blockquote class="blockquote text-justify">
The EU-FOSSA project is organising in parallel a bug bounty for the PHP Symfony software.
Hackers can get rewards of up to EUR 15.000 for critical bugs they find.
There is even a 20% bonus added to the prize if the hackers provide a fix for the bug they report.
</blockquote>
> The EU-FOSSA project is organising in parallel a bug bounty for the PHP Symfony software.
> Hackers can get rewards of up to EUR 15.000 for critical bugs they find.
> There is even a 20% bonus added to the prize if the hackers provide a fix for the bug they report.
While the security was the focus during this weekend, [API Platform](https://api-platform.com/) and [Symfony framework](https://symfony.com/) was the main topic of this first successful hackathon.

@@ -1,3 +1,9 @@
- title: Méthodes de la théorie des fonctions d'une variable complexe
isbn: "OL4952255M"
purchase: 2020
- title: Cybernetics A to Z
isbn: "OL4952255M"
purchase: 2020
- title: Structure and Interpretation of Computer Programs
isbn: "0262510871"
purchase: 2020

0 comments on commit 59f1f14

Please sign in to comment.