Comparing Objects in Java
TLDR;
When to use == in Java
When comparing two operands. It is used to check whether two operands are equal or not.
It’s best to only use it …
In-depth guides, insights, and best practices for modern software engineering
TLDR;
== in JavaWhen comparing two operands. It is used to check whether two operands are equal or not.
It’s best to only use it …
As with many programming languages such as C, C++ and C# (known commonly as the C family), it is possible to “overload methods” (sometimes …
Read Article →The dollar-sign ($) in Javascript has for many years now been associated with jQuery.
When you see this error:
“uncaught typeerror: $ is not a …
Read Article →Let’s say that you have a Python list with the following 5 foods:
foods = ["pizza", "pasta", "steak", "chicken", …
Read Article →
This is not the first time that I created a Python3 application that spat out some output and required access to it via an HTTP server.
While there …
Read Article →Given the root node of a binary search tree, return the sum of values of all nodes with value between L and R (inclusive).
The binary search tree is …
Read Article →Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right.
Note that elements beyond …
Read Article →Python has never been the best at doing multiple things at the same time.
While there are ways to mostly resolve this, such as using the …
Read Article →If you need to replace all newline characters with a comma, or perhaps some other delimiter, then using the build-in tr utility will work very well …
If you have a busy PHP driven website and don’t want to make constant queries to the database for each user that will see the same data, then …
Read Article →You have a directory with a lot of files, and you want to delete only the files that don’t match a specific extension.
This is a simple task …
Read Article →So you are getting an error 404 or perhaps even worse, a 500!
The error in your Apache2 logs looks something like this:
***.162.245.*** - - …
Let’s say that you have an array or a list, or logs.
Each of these logs is a space-delimited string of words.
For example:
logs = ["dig1 8 …
Javascript is a powerful language, but sometimes it doesn’t always do what you expect it to.
Take the following expression for example. …
Read Article →If you are suddenly not able to perform GROUP BY statements as you used to after a MySQL/MariaDB version update, then you will have noticed the change …
A common programming interview question, and for a change, one that you will actually be able to use in the job, is that of implementing a Queue by …
Read Article →Take a string S of lowercase letters.
These letters form consecutive groupings of like characters.
Find groups with 3 or more like …
Read Article →You can ignore certain files and folders from being committed to Git by means of including a .gitignore file.
Unfortunately, you may have forgotten to …
Read Article →If you see lots of disk space quickly disappearing on your MySQL or MariaDB server, then you may want to look into the BinLog directory, it is located …
Google Colab is a fantastic environment to write Python code using Jupyter Notebooks, hosted for free by Google.
If you’ve ever used Jupyter …
Read Article →A User-Agent is a bunch of text that is sent with every HTTP and HTTPS request. The server processing this request is able to determine what type of …
So you have a table where you want to delete a bunch of rows, based on a particular column being matched in another table.
This is easily achievable …
Read Article →There are many occasions where you need to INSERT a record into a MySQL database table, but the record already exists.
INSERT INTO queue_domains …
Use the Linux/Mac tail command to provide the data:
line = subprocess.check_output(['tail', …
Read Article →