Writing SQL queries can be considered by some as a form of art: everyone has a different style of writing and improving them (I’m talking about complex queries). Queries can achieve the same goal while being written in various and sometimes completely different way. While improving and optimizing a query should first and foremost include making sure that everything is written correctly and there are no logical errors, I wanted to share a tool, that some of you might not know, which can help make queries more efficient in times where you’re just not sure how to improve it further.
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.
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.
First of all, what is “Cookie Hijacking”?
By Wikipedia, it’s an “exploitation of a valid computer session to gain unauthorized access to information or services in a computer system. In particular, it is used to refer to the theft of a magic cookie used to authenticate a user to a remote server”.
Which basically means, gaining access to an information system or a website without logging in, as the user that the cookie (or session) belongs to him.
If you can find the list of page templates in the page editor on WordPress try this quick fix that will probably help.
A quick and easy way to prevent specific resources to be cached by sending the correct headers in .htaccess file.
Have you ever wanted to create a copy of a database table, programmatically?
Could be a part of a stored procedure as a temporary table, or just a quick way of duplicating structure and constraints of the original one.
If so, this Transact-SQL script maybe what you’re looking for.
Sending an email is probably the most convenient way of communicating data or informing us of an event from our ESP8266. It’s cross-platform, works on every device and very reliable. It can alert us when one of the sensors detected something (PIR sensor for movement, MQ2 for air quality or any other environmental sensor).
There are a few ways to get that done, and in this post, I’ll show you my preferable way.
This seems like a topic that has a lot of cover on the internet, and many sites have code snippets for connecting ESP8266 to WiFi networks, however, after using a lot of ESP8266 in my projects I want to recommend my own take on how to achieve this.