If you’re wondering how to keep a list of values type as the value in a key, value pair in a HashMap data structure in Java, then you’re in the right place.
This article will go over one way to accomplish this.
Let’s say that you have the following code:
Basically, for each person listed in the 2-D array
peopleToGrades, I want to store all of their associated grades. How can we do this?
Well, one way we can do this is to store that data in a
HashMap data structure that maps a
String (the person’s name) to…
Recently, I declined a meeting in Microsoft Outlook because I could not make the time that it was scheduled.
However, my plans changed, and with that came the fact that I was able to make the meeting that I had declined.
However, the meeting had disappeared from my calendar view in Outlook once it had been declined. I was unable to click into it and then change my RSVP.
In this brief article, I will go over how you can find the invite that had been declined and how you can change the RSVP after the fact.
To find the…
In this article, we’ll go over a high-level overview of what exactly A/B testing is. The scope of this article will be mostly in defining A/B testing as well as giving some examples to really drive the definition home. We’ll leave the more sophisticated design and thought processes that go into it in major depth for another article.
Let’s say you have a website where you simply display a letter. Let’s say that letter is literally an A and then a thumbs up icon.
In Java, the
HashMap data structure is useful for a variety of reasons: constant access, constant storage, and just binding together keys and values in a logical and built-in way in general.
In an earlier article, I wrote about the useful function
getOrDefault() that comes along as a function with
HashMap in Java. If you don’t know much about that function or want a refresher, then I recommend giving it a quick read:
In a nutshell, though,
getOrDefault() basically tries to get the value of a particular key (provided via a parameter) in a
When discussing databases in the context of computer science, you probably not only have discussed things like SQL vs NoSQL but also have come across the term ACID.
But what exactly is ACID? In this article, we’ll go over a bit about what ACID means.
First of all, ACID is an acronym. It stands for Atomicity, Consistency, Isolation, and Durability.
These are all potentially desirable properties of a database in order to ensure overall data validity. A database that is ACID-compliant won’t be cause for much concern in the event of things like power failures, downtime, or transaction failures.
If you work at a company that follows agile methodologies, how long are your sprints? One week? Two? A whole month?
Ask around to some friends who may work at other companies or other software engineers online, and you may be interested to find out that there is a decent mix of answers that you may get. Anecdotally, I work in two week sprints at my company, but I’ve heard of friends and old co-workers who work in one week sprints, for example.
This article concerns that specifically, actually — are one week sprints good or bad? What are the…
If you’re looking to append a bunch of strings together separated by a certain character or characters, then there’s an easy way in Golang to do exactly that.
Let’s say you have a list of food items: pizza, pasta, sushi, pho, and tikka masala.
In Golang, that can be represented like this:
Note that we declared a slice there.
Golang’s blog describes slices as follows:
Go’s slice type provides a convenient and efficient means of working with sequences of typed data. Slices are analogous to arrays in other languages, but have some unusual properties.
Going further, a slice is…
If you work with Java’s HashMap data structure often — and you probably should be (hello, O(1) time complexity for data adds and retrievals) — then you’ll sometimes want to take advantage of the
Before we even get to the code itself and to some examples, I think it’d be helpful to understand in plain English what the function is really achieving.
Basically, you’re trying to get a certain value in the map by specifying its key (and remember that
HashMap is a mapping of key(s) to value(s). …
This is one of the most useful keyboard shortcuts I can think of when it comes to working with IntelliJ IDEA: find in files.
What that basically means is that if you’re looking for a particular word or keyword or string or substring or number in all of your project files, you can simply use the find in files feature built into the Integrated Development Environment (IDE) and then get a list of all files that match your input as well as where exactly in the code it occurs.
To put it more concisely (and colloquially), it’s awesome.
When you think of immutability in Java, there are a core set of concepts that should come to mind.
In this article, I’ll enumerate some of the major points, and hopefully you’ll have a better idea of what it takes to be immutable in Java.
Immutability in Java at a high level essentially means what it does in English. In other words, something that is immutable in Java can’t change.
In Java, that means that the content or state of an immutable object simply can’t be changed. The language won’t allow it.
The reason for this is because in Java…