Categories
Mastering Development

ggplot – Centralize facet_grid title and appear only once

I’ve created a graph in ggplot with two variables inside facet_grid. I want the title of each facet to repeat only once and in the center of the facet. For example, the zeros and ones in the first raw (upper facet), will appear only once and in the middle. Sample data: df <- head(mtcars, 5) […]

Categories
Mastering Development

Why many Linux distros use setuid instead of capabilities?

capabilities(7) are a great way for not giving all root privileges to a process and AFAIK can be used instead of setuid(2). According to this and many others, “Unfortunately, still many binaries have the setuid bit set, while they should be replaced with capabilities instead.” As a simple example, on Ubuntu, $ ls -l `which […]

Categories
Mastering Development

How to create add an array to a multidimensional array

I’m trying to merge an array into another. If a business is a child of it’s sector. My aim is to create a array that looks like this: [0] => Array ( [sector] => 198 [business] => Array ( [0] => 201 ) ) [1] => Array ( [sector] => 178 [business] => Array ( […]

Categories
Mastering Development

How to insert content inside tinymce editor using vue js?

I want to insert content like <span class=”some-class”>text</span> inside tinymce editor using a button in vue js template. How could I accomplish that using the tinymce-vue wrapper? Here’s the code: <template> <tinymce-editor api-key=”my-api-key-here” /> <button @click=”addContent”>button</button> </template> import Editor from ‘@tinymce/tinymce-vue’ export default { components: { tinymceEditor: Editor }, methods: { addContent () { tinymce.activeEditor.setContent(‘<span […]

Categories
Mastering Development

Is it possible to setup CORS Anywhere on localhost?

I am building a web scraper as a small project (using CodeIgniter). Due to CORS policy, I am not allowed to get data from some sites. To bypass that, I am using Rob Wu’s CORS Anywhere. I’m prepending the cors_url to the URL I’m scraping data off of. Everything works fine until I hit the […]

Categories
Ask Mathematics

If $0\leq x\leq \frac{2π}{9}$, prove that $\sin^{\sin(x)}(x)

If $0\leq x\leq \frac{2\pi}{9}$, prove that $\sin^{\sin(x)}(x)<\cos(x)$.

Categories
Ask Mathematics

General way to compute the orthogonal random measure in the stochastic integral

We know that for a centered wide-sense stationary process $X_{t}$, it has a spectral representation that $$X_{t}=\int_{\mathbb{R}}e^{i\lambda t}Z(d\lambda),$$ where $Z$ is an orthogonal random measure with structure measure $\rho$ that is the spectral density measure corresponding to the covariance function in Bochner Thoerem I have no problem with how to compute $\rho$: you only need […]

Categories
Ask Mathematics

question on proof in propositional logic

I am trying to show the following: $ ~\{( A \lor B) \to C \} \vdash A \to C $ I have done the below, but my goal is to do this proof without using the distributive law. $~$ $ \neg ( A \lor B) \lor C ~~~~~ definition \to$ $ (\neg A \land \neg […]

Categories
Ask Mathematics

Can you factor any composite number with a formula $F(n)$ such that $\gcd(F(n), n) \notin \{1, n\}$ without already “knowing how to”?

Factoring algorithms often use $\gcd$ function to check if a divisor can be had since computing $\gcd$ is relatively easy. See special number field sieve. Anyway, the question is can you come up with a formula $F(n)$ for factoring a given composite $n$, i.e. $\gcd(F(n), n) \notin \{1, n\}$ without already “knowing the answer”. By […]

Categories
Ask Mathematics

Deducing self-adjointness from given $2\times 2$ matrix

Can the following matrix $A=\begin{pmatrix} 0 & 1 \\ 2 & 1 \end{pmatrix}$ be a matrix of self-adjoint operator in inner product space in some (not necessarily orthonormal) basis? My approach: It is easy to check that eigenvalues of this operator are $2,-1$. And we can easily find eigenspaces in each case, namely $V_{-1}=\langle (-1,1)\rangle$ […]