Sekai 🌐 🗺

Sekai (世界) is the kanji for “the world”. That’s a great word because of the scale that it designates.

Quels schémas à tester ?

Pour simuler les trajectoires d’une équation différentielle, le schéma le plus facile est l’un découvert par Euler.

Cependant, en espérant mettre ce que j’ai vu au cours de ma licence en pratique, j’ai cherché un peu sur des méthodes numériques pour les EDS sur Google, et je suis tombé sur un article écrit par Brian D. Ewald.

Les différences entre les schémas « forts » et « faibles » seraient-ils pertinents pour mon stage ? On va voir.

[Read More]

Borel Cantelli Exercise 2019

I intend to post this for a Borel-Cantelli lemma exercise on Math.SE.

The target event is ${\exists i_0 \in \Bbb{N} : \forall i \ge i_0, X_i = 1}$, whose complement is

$$ {\forall i_0 \in \Bbb{N} : \exists i \ge i_0, X_i > = 0} = \limsup_i {X_i = 0}. $$

To apply Borel-Cantelli, one has to determine whether $\sum_i P(X_i = 0)<+\infty$.

Mise à jour du template de lettre

Template de lettre en Xe$\LaTeX$

Contexte

J’ai publié mon template de lettre en Xe$\LaTeX$ sur mon ancien blog (hébergé sur GitHub Pages) il y a trois ans.

Problème et solution

Après le changement de l’ordi portable, il me faut l’installation du pacquetage “texlive-lang-french” sur la nouvelle version d’Ubuntu. Sinon, une erreur du pacquetage Babel se surviendra.

! Package babel Error: Unknown option `frenchb'. Either you misspelled it
(babel)                or the language definition file frenchb.ldf was not foun
d.

See the babel package documentation for explanation.
Type  H <return>  for immediate help.


l.445 \ProcessOptions*

?

A ce stade, Xe$\LaTeX$ parviendra à compiler le fichier $\TeX$ avec une remarque à propos de l’obsolescence de l’option frenchb pour le pacquetage Babel.

[Read More]

Staticman Failure on Tsalikis' Site

Use Alternative Staticman API server

After reading Hugo Comments with Staticman on Kostas Tsalikis’ web site, I tried to leave the following comment.

As far as I know, Staticman can be used only with GitHub, since it works as a GitHub bot. Obviously, not all static sites are saved in GitHub, and this may be a showstopper for someone using another service. Thanks to eduardoboucas/staticman#219, Staticman now supports GitLab. You may view my demo Hugo site on Framagit at https://staticman-gitlab-pages.frama.io/bhdemo/posts/my-second-post/ Source) as a working example.

[Read More]

Staticman Repo Setup Errors

Common Staticman Config Erorrs in Git repos

Background

Idem to Staticman on Framagit.

Besides, the build time for my Staticman + Beautiful Hugo demo on Framagit is half of that for the same project on GitLab.com.

Problem

After the setup, it’s possible that the theme shows “Sorry! There’s an error during submission.” To get an insight into this error, one has to open Web Developer ToolsNetwork and select the row corresponding to the POST request sent to the Staticman API. A side pane will pop out on the right. Select Response to view the API’s response in JSON.

[Read More]

Staticman's Encryption Mechanism

Verify encrypted content

Background

Staticman’s documentation gives a link to the public key for the public Staticman instance.

I’ve set up my own Staticman instance for testing Staticman’s native GitLab support. It’s a coincidence that the public Staticman instance has been hitting it’s API limit, as reported in Staticman issue 227. To help others, I’ve published the URL of my own Staticman instance, which is associated with the GitHub/GitLab user staticmanlab. As Node.js’s RSA library has been used in Staticman, I have the responsibility to publish the public RSA key for my Staticman instance.

[Read More]

Staticman on Framagit

It’s a pity that some GitLab users have removed Staticman from their repo. I saw demand for Staticman from Framagit users. Therefore, after two days of testing, another API instance for Framagit has been created at https://staticman-frama.herokuapp.com. (Edit: typo edited, please see my comment below.)

The default GitLab base URL is set to “https://gitlab.com”. To provide Staticman support for a self-hosted GitLab service, another Staticman API server has to be set up.

I tried applying for OpenShift, but it’s been reported on Reddit that it takes about 10–20 days to get started. Amazon requires verification by credit card. I couldn’t deploy Staticman using Zeit Now’s Node.js server builder. Finally, I turned back to Heroku.

[Read More]

Detect Missing EOF

While editing files on GitHub/Gitlab, missing an empty line at the bottom of a file in the buffer will result in no newline at the end of file. In the case of regular text files, this isn’t consistent with the POSIX standards.

for file in `git ls-files`; do
  grep -Iq . $file && if ! newline_at_eof $file; then; else echo $file; fi
done

Fred has provided a shell script for detecting EOF on Stack Overflow. I’ve replaced bash with sh because I’m using Zsh.

[Read More]
Linux 

Find Files for Rename

Background

Three years ago, I wrote Used More Bash Utilities for batch renaming files. One of my Facebook friends has pointed out that it fails for file names containing whitespace.

Problem

Recently, I would like to remove the extension name .sh of all shell scripts in ~/bin, so that which {script} will work without .sh.

Method

A for loop over $(ls) is a basic solution, but find is more correct since it’s possible that a file name contains a space character.

[Read More]
Linux 

Comparaison of Two Docker Images for Hugo

Having importing the repo for the Hugo theme Introduction from GitHub to GitLab, I added the automatically generated GitLab CI config file and I ran job #135854407.

$ cd exampleSite
$ hugo --themesDir=../.. -d ../public
hugo: /usr/lib/libstdc++.so.6: no version information available (required by hugo)
hugo: /usr/lib/libstdc++.so.6: no version information available (required by hugo)

The build succeeded with the above message. To suppress it, a switch to another CI runner will do. The associated GitLab CI config file was copied from Hugo’s documentation with some customizations for Hugo sample sites

[Read More]