Conditional Batch File Editing
Adopted Mmark for Math Posts
Posted on May 1, 2019
(Last modified on May 11, 2019)
| 1 minutes
| Vincent Tam
|
0 comment
Problem During the adoption of Mmark for math posts on this blog, I had to insert markup: mmark at the last line of front matter of the source file of each math post.
Seek help I separated this into two SO questions
Sed conditional match and execute command with offset, and A question about AWK multiple line recognition. Solution From #1., I learnt the use of variables in AWK scripts. From #2, some users explained how these variables can be used for multi-line regex search.
[Read More]
My Intended Trigo Answer
Posted on May 1, 2019
(Last modified on February 17, 2021)
| 1 minutes
| Vincent Tam
|
0 comment
The Math.SE question $2\cos(2x) - 2\sin(x) = 0$ has attracted several
answers from high-rep users.
I am expanding @rhombic’s comment into an answer.
$$
\begin{aligned}
2\cos(2x)-2\sin(x)&=0 \\
2 - 4\sin^2(x)-2\sin(x)&=0 \\
2\sin^2(x)+\sin(x) - 1&=0 \\
(2 \sin(x) - 1)(\sin(x) +1) &= 0 \\
\sin(x) = \frac12 \text{ or } \sin(x) &= -1 \\
x = \frac{\pi}{6}, \frac{5\pi}{6} \text{ (rejected) or } & \frac{3\pi}{2}
\text{ (rejected)}
\end{aligned}
$$
Improved Integration of Hugo and $\KaTeX$
Posted on April 29, 2019
(Last modified on May 1, 2019)
| 3 minutes
| Vincent Tam
|
1 comment
Problem There’s no custom $\KaTeX$ macro in local preview since I’ve merged some recent commits from the upstream of this blog’s theme, in particular, Beautiful Hugo’s pull requests #246 and #255, which allowed self-hosting the theme’s static JS, CSS and font files. This self-hosted option is particularly useful in case of slow response from Cloudflare’s CDN.
Even they do appear on the public GitLab site, the final rendered Markdown + $\TeX$ code would be succumb to syntax errors due to their absence in the preview process.
[Read More]
JavaScript Copy Button
Posted on April 26, 2019
(Last modified on April 27, 2019)
| 3 minutes
| Vincent Tam
|
0 comment
Goal To create a copy button for my Math.SE comment template in order to save the trouble of copying and pasting.
My first attempt I put the boilerplate inside a Markdown codeblock to prevent them from getting interpreted by Hugo’s Markdown parser. Under each codeblock, I placed the copy button.
Comment boilerplate goes here ... π
Another comment boilerplate goes here ... π
…
My page’s original layout
$(document).ready(function() { $('.
[Read More]
My Dual Answer
Posted on April 26, 2019
(Last modified on April 14, 2023)
| 2 minutes
| Vincent Tam
|
1 comment
Update: The question has been reopened.
I intended to answer κΉμ’
ν’s problem on Math.SE. However, the programs in the question body aren’t typeset in MathJax. As a result, I downvoted and closed this question because found it unclear. From the proposed dual, it seems that I shouldn’t interpret the primal as a linear program. Anyways, without further clarifications from OP, I found no reason to look at this further. Here’s my intended answer:
[Read More]
Finite Population Sampling without Replacement
Personal note of finite population sampling
Posted on April 26, 2019
(Last modified on February 17, 2021)
| 2 minutes
| Vincent Tam
|
0 comment
First moment Population: $ \Omega = \{ x_1, \dots, x_N \} $
Collection of $n$-samples: $\mathcal{S} = \{ s \in \Omega^n \mid \forall i,j \in s, i \ne j \} $
Collection of $n$-samples containing $x$: $ \mathcal{S}_x = \{ s \in \mathcal{S} \mid x \in s \} $
Observe that $ |\mathcal{S}_x| = \binom{N-1}{n-1} $.
Let population mean be zero. $\mu = 0$, i.e. $ \sum_{i = 1}^N x_i = 0 $
[Read More]
Replacing Deprecated Hugo Syntax in Blog Theme
Fixing Beautiful Hugo issue #261
Posted on April 25, 2019
| 2 minutes
| Vincent Tam
|
1 comment
Problem Since the recent Hugo upgrade to v0.55.3, the following messages popped up after each local site regeneration with hugo server.
WARN 2019/04/24 18:07:00 Page's .URL is deprecated and will be removed in a futu re release. Use .Permalink or .RelPermalink. If what you want is the front matte r URL value, use .Params.url. WARN 2019/04/24 18:07:00 Page's .Hugo is deprecated and will be removed in a fut ure release. Use the global hugo function.
[Read More]
Julia Rcall Installation
Rcall.jl build failure due to missing dependencies
Posted on April 24, 2019
(Last modified on April 29, 2019)
| 5 minutes
| Vincent Tam
|
0 comment
Problem During the installation of RCall.jl, the package wasn’t successfully built due to a missing variable $R_HOME.
$ julia -q julia> Pkg.add("RCall") Resolving package versions... Installed WinReg β v0.3.1 Installed RCall ββ v0.13.2 Updating `~/.julia/environments/v1.0/Project.toml` [6f49c342] + RCall v0.13.2 Updating `~/.julia/environments/v1.0/Manifest.toml` [6f49c342] + RCall v0.13.2 [1b915085] + WinReg v0.3.1 Building RCall β `~/.julia/packages/RCall/ffM0W/deps/build.log` β Error: Error building `RCall`: β ERROR: LoadError: R_HOME is not a directory. β Stacktrace: β [1] error(::String) at .
[Read More]
Xubuntu Screen Enlargement
Posted on April 21, 2019
| 1 minutes
| Vincent Tam
|
0 comment
Tonight, the screen of Xubuntu suddenly enlarged and blurred. Typing “xubuntu
screen display enlarged” on Google, I’ve learnt that the <Alt>
key and the
mouse scroll wheel can enlarge/minify screen display from Ubuntu Forums.
Cython Can't Replace Julia
Posted on April 17, 2019
(Last modified on April 13, 2023)
| 1 minutes
| Vincent Tam
|
0 comment
This is a linklog to
Christopher Rackauckas’s article about Julia, Cython & Numba. Unluckily, I
don’t have time to read this now. Hope I can return to this later.