Interview Question: Select only Prime numbers from table

As part of my daytime job, I conduct professional interviews for candidates. For that, I’m always on the search for good interview questions. I regard a good question if it’s not too complicated, has a number of ways to solve, and if needed, can be solved programmatically with SQL or C / C# / JAVA languages.

Now that I’m done with asking the prime number question (I need to change questions every now and then), I thought I will post the solution here.

(more…)

Calculate average time from DateTime MySql

Calculating average time from DateTime field in MySql might come in handy in cases like getting the average arrival time, departure time, service sampling etc. In my case, I have a database with records on my arrival to work, and I wanted to calculate time average time that I arrive by the office, and then calculate how much time I spend in traffic, depending on when I leave my home.

(more…)

Monitor your online devices (Make sure they’re working as expected)

Motivation for this project

Every time I add a new device (IOT, server or other) to my home network, I want to make sure that I can rely on it to do its job and keep being connected.
When a device has a critical part to play in my home or office, I want to be alerted when it fails or if it disconnects from the network/internet.
(more…)