Categories

UPDATE random rows

I’m working on creating a more efficient way to UPDATE random rows in a ticket allocation website we have. Currently, we pre populate the tickets table with ticket numbers in subsequent order, i.e 1,2,4 etc. Each ticket number being a row. When a customer then places their order we use the following SQL query to […]

Categories

When will an interval cron execute the first time? (Ex: */3 days)

tl;dr: Does cron use the numerical value of an interval compared to the numerical value of the day to determine its time of execution or is it literally "every 3 days" at the prescribed time from creation? Question: If I add the following job with crontab -e will it run at midnight tomorrow for the […]

Categories

comparison of magnitudes of exponential and trigonometric Fourier transforms

A rectangular pulse function which has unit height, i.e. \$1\$, and lasts from \$-\pi\$ to \$\pi\$ has the following Fourier transform: $$\frac{2\sin\omega\pi}{\omega}$$ or it could be written as $$\frac{2\pi\sin\omega\pi}{\omega\pi}$$ where \$-\infty\lt\omega\lt\infty\$. Magnitude of the above FT: $$\sqrt{\left(\frac{2\pi\sin\omega\pi}{\omega\pi}\right)^2}=\left|\frac{2\pi\sin\omega\pi}{\omega\pi}\right|$$ The most used form of FT is the exponential one and it uses both negative and positive frequencies. […]

Categories

ActiveRecord and Filtered Subquery

I have two models: model Agent has_many :backups end model Backup belongs_to :agent # verification_status, :boolean end Each Backup represents a performed backup job. The log may contain a verification status. Either the verification Failed (stored as false) or Succeeded (stored as true). But not every backup email includes a verification status** (stored as null). […]