Michel Caradec

@mcaradec

Joined on Jul 1, 2019

  • Time Collisions In his awesome book "Designing Data-Intensive Applications" :heart:, Martin Kleppmann explains and demonstrates the dangerousness of relying on timestamps to synchronize events (section "Relying on Synchronized Clocks", p.291). :clock10: Whoever uses timestamps to generate (expected) unique identifiers :id: will be exposed to the same issues. Even if it seems obvious, some people still refuse to admit it [^1]. :confused: In order to demonstrate that timestamp-based identifiers generation inevitably leads to collisions :collision:, I wrote a simple program in R beloved :heart_eyes: language. The full code can be found at the end of the post.
     Like  Bookmark
  • Hash Function Distribution After examining distributed systems sharding [^1] strategies [^2], I wanted to verify if hash computation follows a uniform distribution [^3]. :nerd_face: TL;DR: Yes it does. :sweat_smile: When it comes to solve such problems, R is my best friend. :heart_eyes: Pseudo code: Generate a set of M random values
     Like  Bookmark
  • PHP, array_map vs foreach About array_map: array_map ( callable $callback , array $array1 [, array $... ] ) : array Applies the callback to the elements of the given arrays. array_map() returns an array containing the results of applying the callback function to the corresponding index of array1 (and ... if more arrays are provided) used as arguments for the callback. The number of parameters that the callback function accepts should match the number of arrays passed to array_map(). Source: https://www.php.net/manual/en/function.array-map.php.
     Like  Bookmark
  • About cURL (for Client URL): PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. Source: https://www.php.net/manual/en/intro.curl.php. Any cURL session must be: Initialized by a call to curl_init(). Closed by a call to curl_close() in order to free up system resources.
     Like  Bookmark