Categories
Linux Mastering Development

Guide on how to enable hibernation on Linux Mint 20 Cinnamon (Ubuntu 20) and prevent unwanted wakeups

This is, in a way, a memo for myself in the future. I do not understand why hibernation on linux is not a simple feature that just works and why enabling it has to be so complicated. I hope it also helps people having questions about hibernation. First, you need to make sure you have […]

Categories
Linux Mastering Development

Guide on how to enable hibernation on Linux Mint 20 Cinnamon (Ubuntu 20) and prevent unwanted wakeups

This is, in a way, a memo for myself in the future. I do not understand why hibernation on linux is not a simple feature that just works and why enabling it has to be so complicated. I hope it also helps people having questions about hibernation. First, you need to make sure you have […]

Categories
Database Development

Get missing weeks by country

I’ve got one table called "Units_Sold" which has these fields: year, month, week, country, units and another table called "Dates" which has these other fields: year, week, month The dates table has 1 entry per week/month/year The Units Sold Table has more than 1 record per week, month, year as it is multiple units sales […]

Categories
Ask Mathematics

On a characterization of twin primes in terms of the sum of divisors function and the Euler’s totient function, and related conjectures

In this post we use the definition of a twin prime as the primes $p$ such that $p+2$ is also prime. Thus this definition is the same one than the set of twin primes in the sequence A00135 Lesser of twin primes from the On-Line Encyclopedia of Integer Sequences. Thus as definition of twin prime […]

Categories
Ask Mathematics

What are all the binary matrices leading to a given Gramian matrix of non-negative integers as elements?

A real matrix $\mathbf{G}$ such that for some real matrix $\mathbf{B}$, $\mathbf{G} = \mathbf{B}\mathbf{B}^T$, is called a Gramian matrix. We are interested in a special type of $m \times m$ Gramian matrices $\mathbf{G}$, coming from what we will call a $m \times n$ “basis matrix” $\mathbf{B}$. This special Gramian matrix $\mathbf{G}$ has the following properties: […]

Categories
Ask Mathematics

What are all the binary matrices leading to a given Gramian matrix of non-negative integers as elements?

A real matrix $\mathbf{G}$ such that for some real matrix $\mathbf{B}$, $\mathbf{G} = \mathbf{B}\mathbf{B}^T$, is called a Gramian matrix. We are interested in a special type of $m \times m$ Gramian matrices $\mathbf{G}$, coming from what we will call a $m \times n$ “basis matrix” $\mathbf{B}$. This special Gramian matrix has the following properties: All […]

Categories
Ask Mathematics

What are all the binary matrices leading to a given Gramian matrix of non-negative integers as elements?

A real matrix $\mathbf{G}$ such that for some real matrix $\mathbf{B}$, $\mathbf{G} = \mathbf{B}\mathbf{B}^T$, is called a Gramian matrix. We are interested in a special type of $m \times m$ Gramian matrices $\mathbf{G}$, coming from what we will call a $m \times n$ “basis matrix” $\mathbf{B}$. This special Gramian matrix has the following properties: All […]

Categories
Development

Last day of year: code valid for any timezone

I need to get the last day of a year in ISO format, this is, the string 2020-31-12. This is not as easy as one could imagine, as, the result depends in which time zone is executed. This is the code I have. One thing must be sayed though. The commands new Date() and date.toISOString(date) […]

Categories
Development

Relying on default field initialisation – is bad programming style?

I was given a link to the official oracle documentation: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html where it is said: Default Values It’s not always necessary to assign a value when a field is declared. Fields that are declared but not initialized will be set to a reasonable default by the compiler. Generally speaking, this default will be zero or […]