My mind is currently juggling a myriad of tasks. I’m in the middle of coding, I want to watch the Milanote video that Tommy sent me, and I have therapy scheduled for 2:30. I should jot everything down in my planner and choose one task to focus on. Additionally, I need to tackle some laundry; perhaps I can have Karissa handle that for me.
I’ve asked Karissa to start the laundry, which means I just need to put it away later. First, I’ll focus on my planner, so I’ll take a moment to do that now. I’ve recorded everything in my planner, and next, I’ll watch the Milanote video. Milanote is pretty impressive; it acts like a vision board that aids in planning. We’re currently using it to organize our cruise vacation, including all the notes we need for the trip. I appreciate that it’s digital and visually organized, allowing everything to be in one place. You can add pictures, edit quickly and easily, and it looks visually appealing. I might sound like I’m promoting it, but I enjoy using the app. Plus, you can download it to your phone, which means you can access all your notes from anywhere.
Naturally, the video led me to atlasobscura.com, a site that showcases unique and interesting sights to explore. I ended up spending a good half hour browsing through it. Now, it’s time for me to get back to coding.
I have been working through lunch and haven’t eaten yet, so I think I’ll take a break to find some food. I chose some leftover chicken nuggets, and they were quite good. Now that I’m not hungry anymore, I can focus better. In today’s coding session, I need to find the intersection of two arrays—essentially, I have to return a new array that contains only the elements that are present in both arrays.
We need to:
- .filter() loops through arr1 and checks if arr2.includes(element) is true.
- If the element exists in arr2, it is included in the new array.
This code here works with the console.log:
function intersection(arr1, arr2) { return arr1.filter(element => arr2.includes(element)); }
That took me a bit to figure out. The filter part was confusing to me. The console.log works:
console.log(arrayIntersection([1, 2, 3, 4], [3, 4, 5, 6])); // Output: [3, 4]
I need to devise a function that generates a random hex color code. A hex color code, or hexadecimal color code, is a six-digit (or eight-digit) representation of a color, composed of a combination of letters and numbers. Each pair of digits corresponds to the intensity of red, green, and blue (RGB) components. It seems I’ll need to conduct some research on how to effectively generate a hex color code.
A hex color code is a string that represents colors using hexadecimal notation, typically in the format #RRGGBB, where:
- RR (Red)
- GG (Green)
- BB (Blue)
Each pair is a two-digit hexadecimal number (00 to FF), which corresponds to values from 0 to 255 in decimal.
An approach involves converting a random number between 0 and 0xFFFFFF (decimal 16777215) into hex:
Hexadecimal to Decimal:
In hexadecimal, each digit represents a power of 16. The digits ‘0’ through ‘9’ represent their decimal equivalents, and ‘A’ through ‘F’ represent 10 through 15.
function getRandomHexColor() { let hex = '#' + Math.floor(Math.random() * 16777215).toString(16); return hex.padStart(7, '#0'); // Ensures the output is always 6 characters }
- Math.random() * 16777215 generates a number between 0 and 16777215 (the highest value for #FFFFFF).
- Math.floor() removes decimals.
- .toString(16) converts it to a hexadecimal string.
- .padStart(7, ‘#0’) ensures it always has 6 digits.
- The # is already counted as 1 character.
- If the hex string has less than 6 digits, .padStart(7, ‘#0’) adds one leading 0, ensuring we always get 6 digits after #.
Ok, I have to get ready for my therapy appointment now. I will be back.
Well, this is weird. Typically, I receive a text and an email reminder to check in for my therapy session about a half hour before it begins, but I didn’t receive either this time. I reached out to my therapist to let him know, as it’s possible he forgot to schedule me. I suppose I could call the office to clarify what’s going on.
It turns out I wasn’t scheduled after all. The therapist responded to my text, apologizing for the oversight. We’ve now rescheduled my therapy appointment for tomorrow at 1:30. Additionally, I need to mail the medical insurance forms tomorrow. Kel has a dentist appointment at 9, and I’m considering whether I should accompany her so I can also stop by the post office. It might be more convenient to visit the post office after her appointment. This way, I should be home with ample time to prepare for my therapy session, avoiding the wait in the dentist’s office lobby. I’m curious if she is going to her dentist appointment tomorrow. Regardless, I need to make a trip to the post office. We went there last Tuesday, but I neglected to bring the medical insurance papers that I need to mail.
I’ve started reading a new book, “Funny Story” by Emily Henry. It seems to be quite popular and has won the Goodreads Choice Award for favorite romance. So far, it’s interesting, although I’m still in the early chapters. I hope it lives up to the hype. While I’ve enjoyed some of Emily Henry’s work, there are a few of her books that didn’t resonate with me as much. However, many of her others have been truly great.
Did you know that Paris has three notable replicas of the Statue of Liberty, including one on Île aux Cygnes (Isle of Swans) and smaller versions in the Luxembourg Gardens and at the Musée des Arts et Métiers. The larger replica, a quarter-scale version of the New York statue, is located on the Île aux Cygnes, a man-made island in the Seine.
- It was a gift to France from American citizens in Paris to celebrate the centennial of the French Revolution.
- It was dedicated on July 4, 1889, and bears the inscription “IV July 1776 = XIV July 1789”.
- Originally facing the Eiffel Tower, it was later turned towards the west to face the original statue in New York.
The Musée des Arts et Métiers houses the original plaster model of the Statue of Liberty, donated by Bartholdi’s widow in 1907. Frédéric Auguste Bartholdi was a French sculptor and painter. He is best known for designing Liberty Enlightening the World, commonly known as the Statue of Liberty.
I recently watched an episode on the YouTube channel Absolute History that discussed the statues in Paris. Now, back to coding: I’m currently learning how to write a function called power(base, exponent) that calculates base raised to the power of exponent. I’m feeling a bit confused by the phrasing of the instructions, and while they don’t provide the skeleton code, I do have access to the console.log for reference.
So now I’m going to have some hot tea and read about this function I need to write.





