Java Program for Savings Account with Main and a SavingsAccount class

Create a class named SavingsAccount and provide a method called deposit to allow a customer to deposit to his savings account, another method called withdraw to allow a customer to withdraw from his savings account, ensure that the debit amount does not exceed the savings account balance. If it does, the balance should be left unchanged and the method should print a message "Insufficient funds, available amount is ". Provide another method calculateMonthlyInterest to calculate the monthly interest by multiplying the savings balance by annualInterestRate divided by 12 this interest should be added to savings balance. Provide a static method modifyInterestRate that sets the annualInterestRate to a new value. Use a static variable annualInterestRate to store the annual interest rate for all savings account holders.

The SavingsAccount class will containg the following variables: account number, customer name, phone number, savings balance and annual interest rate.

INPUT

The input contains the account number, customer name, phone number, starting balance, amount to be deposited, annual interest rate and withdrawn amount.

OUTPUT

The new balance after the withdrawn amount followed by new monthly balance after the interest rate is applied.

SAMPLE INPUT
123456
Juan dela Cruz
09202640108
1000.0
1000.0
0.04
0.0

SAMPLE OUTPUT
Deposited 1000.00 new balance is 2000.00
Withdrawed 0.00 new balance is 2000.00
New balance after interest rate is applied 2006.67

Microsoft Bing Releases New IndexNow Plugin for WordPress

In July 2020, Bing released its first official plugin for WordPress that allowed site owners to submit URLS and get their content indexed immediately, instead of waiting for the search engine to crawl the site. The IndexNow API, which debuted in October 2021, is the next evolution of the Bing URL submissions API, created by Microsoft Bing and Yandex.

Bing Webmasters has released a new IndexNow plugin for WordPress sites to take advantage of this new protocol. It makes it possible for websites to notify participating search engines whenever content is created, updated, or deleted, so that the site is indexed faster for updated search results. The Microsoft Bing Webmaster Tools team anticipates that it will minimize the need for crawling:

IndexNow is an initiative for a more efficient Internet: By telling search engines whether an URL has been changed, website owners provide a clear signal helping search engines to prioritize crawl for these URLs, thereby limiting the need for exploratory crawl to test if the content has changed. In the future, search engines intend to limit crawling of websites adopting IndexNow.

IndexNow is also an initiative for a more open Internet: By notifying one search engine you will notify all search engines that have adopted IndexNow.

The IndexNow WordPress plugin tracks changes in content and automatically submits the URLS in the background. It comes with a few basic features and configuration options:

  • Toggle the automatic submission feature.
  • Manually submit a URL to IndexNow.
  • View list of recent URL submissions from the plugin.
  • Retry any failed submissions from the recent submissions list.
  • Download recent URL submissions for analysis.
  • Status on recent successful and failed submissions

The IndexNow protocol is supported by Microsoft Bing and Yandex. Google is testing the protocol to see if it makes sense for a more sustainable approach to indexing the web.

Bing Principal Program Manager Fabrice Canel proposed WordPress core integrate the IndexNow protocol but contributors suggested Microsoft keep it as a plugin until it’s more widely adopted by major search engines and proves that it has a positive effect on reducing the need for crawling.

“By releasing this plugin, we aim not only to benefit right away WordPress websites adopting it, but also learn, tweak as needed to someday release IndexNow in WordPress core to benefit all websites and all existing and upcoming search engines adopting IndexNow,” Canel said on the ticket.

The IndexNow plugin already has 800 active installs but it’s a long road for Microsoft to prove that its API is effective at streamlining indexing for search engines. If Google agrees to support it after testing, the protocol may gain enough momentum to attract other search engines’ support.

How to use Nuget assembly as files with visual studio community

I am starting a new coding job with a new client.
The problem I am having is that a lot of issues with namespaces that can not be found or maybe missing directives or an assembly reference. This, I think, is a common thing. So I am wondering where I can download a free DLL from Microsoft that will do the trick and get me to compile my code. The class the code is using that the compiler does not like is "GeoPoint".
A quick search online offered using nuget to install the package Azure.Core.
So, how do I do this? I am using Microsoft Visual Studio Community 2019. I am looking for some direction. Please advise.

On my work computer, I went to https://azure.microsoft.com/en-us/downloads/ in my browser but it is blocked. So, I am assuming now that I have to use visual studio itself to add new assemblies instead of using a browser. Is that right or do I have to ask my administrator for access?

The page:
https://www.nuget.org/packages/Azure.Core/
offers me another hint with "Package Manager"
I found under Project->Manage Nuget Packages..." in visual studio but when i try to uplad a package I get an error message.

So, my manager said I fist need to download an assemply.

Please advise.

Decorating Web Pages With the Grainy Gradient Block

Yesterday, Kelly Choyce-Dwan released a souped-up Spacer-type block. However, instead of just empty space on the screen, end-users can decorate the area with various gradient backgrounds.

Grainy Gradient Block is just the type of plugin that I look forward to tinkering with. It is not complex. It stays in its lane. And, it is just plain fun to use.

The block was inspired by the grainy gradient trend touted by CSS-Tricks in 2021. Now, users can use them directly in the WordPress editor.

The plugin’s single block has four variations, as shown in the following screenshot:

Two-column, two-row grid of blue/pink gradients.  In order, the first has a noisy texture, the second a horizontal line, the third vertical lines, and a wavy/blob for the last.

The variations are:

  • Default: Noisy/Grainy texture.
  • Horizontal Grain: Horizontal lines.
  • Vertical Grain: Vertical lines.
  • Blob Grain: An effect similar to lava lamps.

After far too much time attempting new design ideas with the plugin, I finally landed on something that I liked. I pulled a sunset image from WordPress Photos by Mark Westguard and used it within a cover block. Then, I applied a couple of different Grainy Gradient blocks over it.

Sunset over a lake.  The image has a grainy/noisy texture applied to it.
Grainy sunset over a lake.

The goal was to give it an old, worn painting feel. I was happy with how it and several other variations I worked through turned out.

I wanted to see what I could do with some real-world art — I had paintings on my mind at that point. So, I grabbed a photo of a piece I completed a week or two ago and began anew.

This time, I used a similar process. I wrapped everything in a Cover block and applied a duotone filter over the image. Then, I placed the Grainy Gradient block inside and switched it to the Horizontal Grain variation.

Green/Grayscale image with horizontal grain applied over the top of it.
Horizontal grain over an image.

It turned out similar to a poor photocopy of a hand-drawn piece. Essentially, it was better than my original artwork.

Do not let my imagination fool you into thinking this plugin is limited to just a handful of ideas. There are 1,000s upon 1,000s of variations users can create. For example, just dropping it in a column next to a text-heavy section can spruce up a page’s design a bit:

Blobby splotches of color in the left column.  In the right column, a heading, sub-heading, and demo text.
Blob gradient next to text column.

If I had one request, it would be to add grainy gradient backgrounds to the Group and Cover blocks. Both allow for gradients but not of the grainy variety. The effect is created via an SVG filter, which is how the duotone feature in core works. There seems to at least be some appetite for other filter types. Maybe we will see a more broad list of such options in the future.

For now, I think I will continue playing around with Grainy Gradient Block.

The development version of the plugin is also available via GitHub.

8 Interesting Typography Links for January 2022

Every now and then, I find that I’ve accumulated a bunch of links about various things I find interesting. Typography is one of those things! Here’s a list of typography links to other articles that I’ve been saving up and think are worth sharing.

A specimen of the Retail typeface, once of the typography links in the list.
An awesome new font from OH no Type Company

Do you have any interesting typography links from the past month worth sharing? Drop ’em in the comments!


8 Interesting Typography Links for January 2022 originally published on CSS-Tricks. You should get the newsletter and become a supporter.

Google Debuts Soli-Based Radar API Standard in Collaboration with Ford

9to5Google is reporting that Google has begun partnering with Ford on an open API standard for the advancement of general-purpose consumer radar integration via Soli. This new standard, names Ripple, is intended to promote more broad usage of Soli-based radar technology which tends to be lower-cost, lower-power, and cheaper than conventional radar.

The report quotes a source as stating that:

Adam Argyle’s Sick Mouse-Out CSS Hover Effect

I was killing some time browsing my CodePen feed for some eye candy and didn’t need to go past the first page before spotting a neat CSS hover effect by Adam Argyle.

I must’ve spent 10 minutes just staring at the demo in awe. There’s something about this that feels so app-like. I think it might be how contextually accurate it is in that the background color slides in from the left, then exits out through the right. It’s exactly the sort of behavior I’d expect from a mouse-in, mouse-out sort of interaction.

Whatever the case, I fired up a fresh pen and went to work recreating it. And it’s not super complex or anything, but rather a clever use of transitions and transforms paired with proper offsets. Quite elegant! I’m actually a little embarrassed how long it took me to realize how the mouse-out part works.

Here’s how I tackled it, warts and all.

“I bet that’s using a transition on a background.”

That was my first thought. Define the background-color, set the background-size and background-position, then transition the background-position. That’s how I’ve seen that “growing” background color thing done in the past. I’ve done that myself on some projects, like this:

If I could do the same thing, only from left-to-right, then all that’s left is the mouse-out, right? Nope. The problem is there’s nothing that can really make the background-position transition from left-to-right to left-to-right. I could make it do one or the other, but not both.

“Maybe it’s a transform instead.”

My next attempt was jump into transforms. The transform property provides a bunch of functions that can transition together for slightly more complex movement. For example, the background can “grow” or “shrink” by changing the element’s scale(). Or, in this case, just along the x-axis with scaleX().

But like I mentioned, there isn’t a way to isolate the element’s background to do that. Going from scaleX(0) to scaleX(1) scales the entire element, so that basically squishes the link — content and all — down to nothing, then stretches it back out to its natural size which is a totally different effect. Plus, it means starting with scaleX(0) which hides the whole dang thing by default making it unusable.

But a pseudo-element could work! It doesn’t matter if that gets squished or hidden because it isn’t part of the actual content. Gotta put the background on that instead and position it directly under the link.

a {
  /* Keeps the pseudo-element contained to the element */
  position: relative;
}

a::before {
  background: #ff9800;
  content: "";
  inset: 0; /* Logical equivalent to physical offsets */
  position: absolute;
  transform: scaleX(0); /* Hide by default */
  z-index: -1; /* Ensures the link is stacked on top */
}

“Now I need ::before to change on hover.”

I knew I could make ::before scale from 0 to 1 by chaining it to the link element’s :hover state.

a:hover::before {
  transform: scaleX(1)
}

Nice! I was onto something.

Sprinkle a little transition fairy dust on it and things start to come to life.

a::before {
  background: #ff9800;
  content: "";
  inset: 0;
  position: absolute;
  transform: scaleX(0);
  transition: transform .5s ease-in-out;
  z-index: -1;
}

“Hmm, the transition moves in both directions.”

Again, this is where I sorta got stuck. Something in my head just wasn’t clicking for some reason. As per usual, I ran over to the CSS-Tricks Almanac to see what property might’ve slipped my mind.

Ah, yes. That would be transform-origin. That allows me to set where the transform starts, which is not totally dissimilar from setting the background-position like I tried earlier. The transform could start from the left instead of its default 50% 50% position.

a::before {
  background: #ff9800;
  content: "";
  inset: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s ease-in-out;
  z-index: -1;
}

Yeah, like this:

I was already transitioning ::before to scaleX(1) on link hover. If I reversed the transform-origin from left to right at the same time, then mayyyybe the highlight goes out the opposite of how it came in when the mouse exits?

a:hover::before {
  transform: scaleX(1);
  transform-origin: right;
}

🤞

Whoops, backwards! Let’s swap the left and right values. 🙃

Gorgeous. Thank you, Adam, for the inspiration!


Adam Argyle’s Sick Mouse-Out CSS Hover Effect originally published on CSS-Tricks. You should get the newsletter and become a supporter.

Changing A Tire On A Moving Car (Or How To Improve Product Roadmaps)

Companies can often carry their products into the future with a “feed the machine” mentality. To meet customer demands they continually pack more features into a product only to find that it’s making it more and more complicated over time. In the flurry to keep feeding the demand, they side-step prudent measures to help them assess the impact of the changes they’re making.

The Maintenance Cycle (The Problem)

This can eventually lead to a backlog of customer frustration. Inevitably a company can find itself in a situation where working on anything new has to be balanced by addressing technical debt, or worse yet, any improvement they want to make is done in a “bolt-on” fashion adding debt on top of debt. I attribute this to a wide variety of reactionary cultural phenomena.

I liken it to a flat tire on your automobile. For those of us that are experienced or knowledgeable in this area (says the guy who used to be a tow truck driver in a previous life), if you have a puncture on the flat wall of the tire there’s a good chance you can plug or patch it. If it’s on the sidewall of the tire you’re going to need to replace the tire.

So say, for example, a troublesome area of your product is a gash in the sidewall of your tire. If you don’t address it quickly your product (your car… the vehicle that makes the company go) will come to a screeching halt. You’ll need to pull over, stop the car, and get it fixed. Yes, this will mean downtime, and downtime equals lost revenue. Rarely is this the case, but it can happen. Especially if your technology stack has just been hacked and set up for ransom. In that case, you just lost all four wheels and will need to wait for the tow truck.

Or let’s say that you’ve been getting numerous complaints regarding your onboarding/setup process for your product. The car continues to be operational and drive well, but the barrier to adoption is potentially equivalent to a slow leak on your flat wall. Pesky nails! Or maybe, you’ve left this area of your product to carry on without regular maintenance or pruning. You could also compare it to wearing your tire treads down until they’re bald. Again, the car is still operational, but you’re running on borrowed time. It’s only a matter of time before you have a blowout, or worse, you have an accident.

No matter your analogy, these companies can find themselves in situations where they have to keep the product going but recognize that functional and fundamental changes need to be made.

Landscapes, Not Roadmaps

If your product is the car that makes your company go, then typically you would have a roadmap that tells your car where it’s going. It may not detail how it’s going to get there but at least it’s a flattened view of the roads, intersections, and turns that will be needed in the coming future. This might be fine for a sunny afternoon cruise but it assumes many things.

For example, what if there’s construction (technical debt)? How will we reroute without it costing more time? What if we reach our destination way too early because we forgot to pick up some items for the soiree and now there’s no time to backtrack?

From my perspective, roadmaps are generally treated as a series of checkboxes.

“We did that... check!

Then we did this... check!

Now... we’ll do that thing.”

We check the boxes and forget that generally speaking some things got left behind from the desired work. Sometimes an important detail didn’t make it into scope, but we checked the box and moved on. It’s sort of like getting all the lug nuts on your wheel, but we left one a little loose.

“Sorry about that... you should be fine. If you run into a problem, let us know.”

Again… reactionary.

The problem with this approach is that the damage is done. The damage in the relationship between you and your customers is far more important than the lug nut you failed to get on properly for the 1–2pts of work it would have been to ship it a little later.

I have often found that companies do rough estimates for epics and plot those on a roadmap by time duration from the rough estimates. When the work is ready to begin they go through an epic batching process to determine the more realistic scope of the work and what’s a feasible solution within the timeframe defined by the rough estimates. It sounds reasonable, but often the details have been vague until batching. When the details bubble to the surface it turns a desirable solution into something much less which can lead to a watered-down MVP.

Worse yet, once the work is batched they insert user research that should have been done to inform the original work effort to what the real benchmark (MVP) should be. Some companies may insert a design/research spike just before the epic kicks off but it always feels reactionary and ends up being a hack shortcut. It’s like defining how you want the road to look without recognizing the terrain where the road will be built.

If you happen to be one of those companies that do “big-bang-jam-it-in-more feature” releases you may have a mountain/swamp (debt) to contend with. This approach usually assumes that since there’s a deadline you have to meet it and therefore cannot fail.

Anything that does not fit into the deadline then gets added to the backlog which further bloats the backlog and competes with new features to be worked on, i.e. the next part of the road map. Over time, as you can imagine, the wheels on the cart are getting a little wobbly and shaky. If you speed up, you’ll likely through off your car’s alignment and loosen up some other critical parts.

A company will struggle to find time to pull over and fix the wheel because their customers are depending upon them to keep the car moving.

Don’t get me wrong, roadmaps are helpful but they can be rife with barriers toward real change to your product vision.

I’d like to propose an alternative to this approach, or at least a way to change the way we look at it. An approach that Kevin Capel writes about in ‘Ditching Your Roadmap For A Product Landscape’. Roadmaps are good as long as the landscape is relatively clear of any major obstacles. However, if you’ve been feeding the machine and just getting by on those tires that have long outlived their tread life you might need to evaluate some things before you define where the road will be laid on the landscape.

We first may want to assess the landscape. Having some sort of product or “platform radar” is a great way of assessing and tracking the state of the product/platform from a 10,000-foot view.

This, in turn, helps us determine whether our tires are up for the journey or we need to be prepared to repair them or swap them out along the way. Rarely will a roadmap tell you when your tire is flat, nor the best time to fix it. If you knew the landscape you could better identify the best timing. The landscape can also be a huge help for assessing other/related opportunities to meet customer needs rather than always focusing on more features.

Where a roadmap looks at rough estimated blocks of work that are vague in detail, a landscape sees work effort from a frame of “strategic areas for improvement”. These areas are defined by strategic product vision goals, known as customer pains (that generally keep getting skipped due to backlog bloat), or internal input from multiple points of data. These areas are “identified” and not so much defined.

The areas for improvement need to be analyzed, researched, and assessed before they can truly be defined. You may come to find that these areas are very large efforts to fix (massive boulders or expansive swamp). You may find them to be easy wins which you can clearly define their value and scope.

In essence, the radar is helping you assess the landscape in a proactive way to determine the landmarks that support the direction of the roadmap. Because these areas are not “on” a roadmap, they provide you more flexibility to adjust their value and scope as the market changes or your company’s needs change. You’re essentially scanning the landscape, using lidar, to assess the path forward and where to best build the road to prepare your car for the trip.

Maybe you need to repair some potholes. Maybe you might want to pack a second spare tire. Maybe you might need to be prepared to take a detour. It fundamentally helps you plan ahead to reduce risk and reach the destination in a more efficient and effective way.

Assemble A Crew

For the strategic areas for improvement, you should define some order of priority. To help determine the priorities you can look to your company’s strategic plan, customer requests, and/or customer complaints. You don’t get this from any one area of your company so this is where you pull together a pit crew. I’m not referring to people who will actually fix/repair these areas for improvement, but rather inform and guide the process toward sound outcomes.

Some roles to consider: UX designer, UX Researcher, Product Managers, Product Owners, Support Representatives, Architects, and Engineers. You’re trying to cover your bases from the 360 degrees of the customer by finding trusted patterns in these areas and building relationships toward quality outcomes, continuous improvement, and sustainable growth.

This crew, or group of trusted advisors, can help you in a number of ways. Because this discovery work is sort of “off the radar” by being on your radar there’s low visibility to it and so probably not funded with full staffing. Your pit crew should be available for quick, pointed input. You don’t need meetings necessarily but more of a soundboard to bounce thoughts/ideas of a specialist for specifically targeted input.

Maybe you’re considering a solution that you want to run an A/B test for; you might want to bounce it off support to gauge their reaction and identify any missing factors in the design. They may identify a detail you overlooked in your solution. Maybe you’re looking to update a portal but are aware of potentially troublesome tech/plumbing you’ll need to navigate around? You might want to pull in an architect or engineer for that area to provide some guidance. The members of the crew can vary by role and frequency.

One major advantage of having a crew of this type is that you can have a shared strategy and work together toward a “north star” that meets internal and external needs — through ideation, analysis and collaboration.

You’re getting out ahead of the roadmap, connecting the dots. You’re building cases (work bundles) for areas of improvement that can be split up or batched together depending on availability. These are guerrilla tactics and lean methods that are cross-cutting the big picture. Who doesn’t like to be a part of something new or visionary?

I’ve generally seen this take two fundamental approaches. In a smaller company, our crew and approach were smaller, more lean, nimble, and organic. It was bottom-up, but we had key stakeholders at higher levels. In a larger company, we developed a charter and defined the key stakeholders, responsible individuals (RACI) as well as milestones, scope, governance, and so on.

I’ve also worked in a blend of the two approaches. It depends on your company’s situation, drive, culture, and attitude. Otherwise, you can just continue the status-quo and pray that things change by themselves... which they rarely do. Like a real-life pit crew, your crew is standing by (available when time permits) to provide some direction on logistics, fuel you up, or quickly adjust that wheel that’s been giving you some trouble. When that tire is slowing you down on the track, then you need a plan for getting it changed to get back on the track to improve your chances of winning.

One Lug Nut At A Time

So, now we need to put it into practice. We’ve sized up the terrain that’s ahead and have a pretty good idea of what our strategic areas for improvement and growth are. We have a pretty good lay of the land and have plotted a rough course for where the road (roadmap) “could” go.

Before we go further, I recognize that some would argue that in the spirit of “lean” or “agile” we should not be spending so much time analyzing things as opposed to releasing, experimenting, learning, and improving. I don’t disagree with that, and I’m not trying to be at odds with that. That being said, you can be lean and agile in different ways without following a prescribed formula that may not work for every situation or company. I am still proposing to apply lean methods and guerrilla tactics in an agile manner.

Many companies have things they want to improve on even if they have a backlog of new features/things to do. What I am proposing is another way of looking at both: improvements that you want/need to be made as well as the new strategic features you want to build.

Even tech debt is a strategic area of improvement because if you don’t address it, it will slow your car down or cause it to break down altogether. If you’ve been neglecting your product for a while with regular maintenance the roadmap won’t save you unless you plan on regular maintenance.

Many companies don’t and when they assume maintenance in some of the workstreams it may get overshadowed by new work or cut from the scope in order to get the new work completed on time. I’m proposing an incremental way toward pruning and improving your product (design and tech) so that over time the maintenance is being done; chipping away at the whole little by little.

As you assess the areas for improvement you should assess size, effort and complexity:

  • Can the work be broken into smaller pieces?
  • Can the pieces be pulled into existing workstreams?
  • Does this need to be one comprehensive block of work on the roadmap?
  • Can you lay the groundwork for future work by making small front-end improvements (CSS, HTML) or design tweaks in preparation for future additions (scale)?

We need to get the tools in place and be prepared to take off a lug nut until we get to a state that we’re ready for that quick tire swap. Another way to look at it is from a broad and cohesive user experience approach and the different levels you can approach fixing a broken user experience.

Let’s take a look at some examples of how this has been put into practice.

Building A Crew

In a smaller company where I worked, it had far fewer departmental silos than larger companies have, but it did have physical silos. Engineering was on one floor and Product and UX was on another floor. I believe the physical distancing contributed to reduced teamwork and collaboration needed to drive growth improvements.

For this company, because of the team separation, we needed to assemble a crew of key stakeholders and collaborators first. Part of that effort included leaving my personal space and sitting, physically sitting, near those I wanted to engage and partner with. I also connected with key stakeholders across the organization and began to build partnerships that we could all benefit from.

In parallel, we were working towards a radar. The groundwork had been laid to build upon, but I had moved on to another company. In a very short amount of time, we were able to stabilize the wheels and establish a design system that would be a foundation for future growth.

Landscapes And Lugnuts

For a much larger company where I worked, we were working on a massive undertaking to unify 200+ systems into one comprehensive platform. Because this was a high-profile project, it had a fully funded crew that was needed. The project struggled with establishing and maintaining a clear roadmap but that didn’t prevent us from assessing the landscape and working toward the vision.

Another landscape plus over a roadmap; more flexibility. For this project, we had a dedicated team that defined and built out the core infrastructure and global components. As we began to design and build individual modules in the system and new user scenarios came to light we needed some of our UI components to be extended to improve the efficiency of workflows.

Fortunately, we anticipated some of this with the design system we established so we had a game plan we could leverage. In some cases, we built new components to fill the need with the forward focus that we’d reuse them. In other cases, we allowed a “good-enough” solution to move forward and back-logged an item to uplift the component with the enhancements.

Over time, we were able to fit in the component enhancements and they were released to teams with little to no retrofitting. This allowed us to continue to make incremental gains and not sacrifice the big picture vision. It is important to note that each piece was carefully planned and crafted with a vision toward the whole. It took a lot of teamwork, patience, and coordination but it all paid off in the long run.

For another company I worked for, we were able to put all the pieces of the strategy together. I worked very closely with the Director of Platform. She had great foresight and vision to see the landscape and know where the strategic land markers were that we needed to address. We called it the “Platform Radar”. We mapped out the landscape and would reevaluate periodically to help us stay focused on the priorities and recalibrate the scope as we learned more.

This was also helpful for us to prepare work to be added to the roadmap. Together we forged internal partnerships to connect people and build out a pit crew. We all had a common goal for our customers as well as departmental goals through which we could support each other. Between the Platform Radar and pit crew, we would analyze the strategic opportunities and work with pit crew members to connect dots and build cases to better understand and scope the work that was needed.

Some work was just too large and complicated and required bigger discussions on how to tackle them. Other work was medium to small in size and was easy enough to just schedule it and in some cases slip it into upcoming workstreams. This company had a lot of debt to address from past years and finding creative ways to build strong cases in making large gains or small solutions for minimal gains was all part of the large strategic plan.

Conclusion

Companies with products that have been around for a while typically have some baggage. They have to continually work to improve and enhance the product to keep up with customer demand and their competitors. Over time, they leave behind artifacts/blemishes and feature dust that leave a ripple effect that will eventually need to be dealt with.

Having a loose product landscape offers a flexible way to be strategic and decisive about how to chip away at the big picture. Not dealing with can eventually leave you stranded on the roadside without a spare to keep you going. It is far better to maintain, tune, and prepare for when the time comes for that quick tire change.

A landscape is there to support your roadmap by helping you see ahead for the plan you want to make.

Just to be clear, I am not advocating you throw out your roadmap, but for the landscape to be effective, you do need to be strategic, patient, and vigilant. Always on the lookout for opportunities to hone, replace, and prune the inefficiencies. Internal partnerships, research, design systems, and regular touch bases can help make sure that your trip is a successful one.

Further Reading

JDBC Tutorial Part 2: Running SQL Queries

In Part 2 of this tutorial series, you’ll learn how to execute SELECT, INSERT, UPDATE, and DELETE statements against an SQL database using JDBC. These actions are known as CRUD operations (Create, Read, Update, Delete) which form most of the functionality in an application.

Note: We’ll continue where the previous step of the tutorial left off, which means this article assumes you have a Connection object ready. Refer to part 1 of this tutorial for more details. The source code is available on GitHub.

useRainbow()

I took a break from work and started some small, personal projects (toys). One of those small projects is potato.horse where I keep all of my doodles, visual short stories and jokes. Check it out!

However, this post is not about my break from work, other experiments, or the site itself. People seem to like one particular technique I used in the design, notably, the background effect applied that transitions between colors when the user browses the content:

Some asked me how this effect was implemented (including going as far as reading the minified code, which is very flattering).

So, here’s a quick gist, followed up with some context:

export const useRainbowBg = () =>
useEffect(() => {
  const cb = () => {
    const viewportHeight = window.innerHeight
    const contentHeight = document.body.getBoundingClientRect().height
    const viewportsPerRotation = Math.min(
      3,
      contentHeight / viewportHeight
    )
    const from = 51
    const progress =
      window.scrollY / (viewportHeight * viewportsPerRotation)
    const h = (from + 360 * progress) % 360

    document.body.style.backgroundColor = `hsl(${h}deg, 100%, 50%)`
  }
  window.addEventListener('scroll', cb, { passive: true })
  return () => window.removeEventListener('scroll', cb)
})

In short, I map the scroll position into the hue in the HSL color notation. Let’s break this down.

Color models

There are many ways of describing colors in CSS, with the two most common ones being RGB (left) and HSL (right):

RGB is an additive color palette. This means that mixing 100% of red, green and blue produces white, mixing 100% red and 100% green but 0% blue produces yellow, and so on. This is different from, say, using oil paint or the CMYK color model, where the resulting tone would be black(-ish)1.

We’re used to this approach because it’s easy to describe in code, but specifying colors in terms of hue, saturation and luminosity seems more natural, especially if you come from a design background, or… you know, are a human being using a human language.

We’ve gotten used to RGB as developers, but in spoken language, using it would feel unnatural and confusing. Façade would be very hard to use in RGB.

On the other hand, HSL can often be much more intuitive to work with. For instance, if I want to make a color slightly colder, I can just move the hue slider a bit towards blue and I should get closer to what I have in mind. With RGB, if we make the color appear colder by including more blue, the resulting tone will be a bit brighter as the blue component contributes to the overall lightness. This means that you’d have to lower the red and green values to compensate.

To see how this works in practice, try maxing out the blue color in the example below.

The first thing that stands out is that all tones are shifted towards blue and the overall brightness of the picture is increased. In the case of the effect we’re discussing, that would be undesirable.

Now, let’s try to do the same with the HSL color circle. Drag the slider to the left, by ca. 90 degrees:

In this scenario, using HSL not only turns Susan into a vampire, but also maintains a similar2 level of brightness. And that’s exactly what I’m looking for.

So, what I mean by saying this:

How does this work? In short, I map the scroll position into the hue in the HSL color notation. Rafal, 2 days earlier

…is that that every time we detect a scroll event, I try to map it to an angle on the hue circle:

I didn’t want to start with red as it would make me hungry and the base yellow fits the design a bit better, so I applied a small initial shift—hence const from = 51 set as the initial offset.

And, as far as the basic implementation goes, that’s it!

Now, there are three other areas of improvement.

useRainbow performance

We’re triggering a repaint on every scroll, so I was a bit worried that older mobile devices, or even some hi-end laptops plugged in to 4k screens might not be able to maintain solid 60fps. But, I’m happy with the results so far. Using passive event listeners provided a bit of a boost, especially on mobile.

If I realize that performance is a problem, especially with more content down the line, I’ll probably focus on:

  • removing the unnecessary call to getBoundingClientRect on every scroll handler call, and
  • deferring or throttling background color changes using requestAnimationFrame.

I expect the first improvement to have some impact, but the benefits of the second one should be negligible.

Measure before optimizing. Obsessing about the performance only makes sense when issues become noticeable, be it through a drop in framerate or battery impact. Your iPhone Pro has more computing power than many low-end laptops, so it’s a good idea to test on those devices too. It’s good to have a crappy old Android phone exacly for that purpose if you can spare a few quid.

Perceptually uniform color spaces

You might’ve noticed that in the previous illustrations some fully saturated colors seemed darker than others. That’s because the color spaces we normally use when coding don’t reflect the way the human eye works. I’ll leave the in-depth explanation to someone much more experienced than me, but suffice to say (gross oversimplification alert!) that, generally, the same amount of red/green/yellow will appear brighter than blue. This means that in some cases the text on the page will be harder to read.

For now, this isn’t an issue as I’ve just put this thing online and titles serve a secondary purpose. But there’s a solution to the problem and it’s not overly complicated: use a perceptually uniform color space. There’s a bunch of libraries that do it out of the box, both in JavaScript/TypeScript and CSS/Sass/<pick your CSS flavor here>. hsluv seems like a good starting point.

Accessiblity

Note that I’ll be focusing on the visual effect itself and not discussing the rest of the site (e.g. alt tags, document structure, etc…). I’d like to focus on contrast, color blindness and people who rely on prefers-reduced-motion. The site is a living document; there’s always so much to improve. For instance, contrast can be an issue in a few, non-critical places. I’m happy to accept feedback and implement it: hit me up!.

color blindness

I wanted to make sure that the effect doesn’t break the site completely for people with color blindness. So I focused on the most common types: deuteranomaly and protanomaly (red-green color blindness), but also ran wider tests. I used Photoshop and Colorblindly (Chrome extension) for some rudimentary checks.

prefers-reduced-motion

The prefers-reduced-motion CSS media feature is used to detect if the user has requested that the system minimize the amount of non-essential motion it uses.

MDN

This site doesn’t contain many animations (besides the Little Sausage Angels you’ll see if you hit “Share”), but I was wondering if people who rely on prefers-reduced-motion would like the background color to stay constant.

The short answer is: I don’t know. My intuition is that rotating colors don’t really qualify as motion, but my experience and understanding of the problem is, to say the least, limited. In situations like this, I’d rather depend on user research than guesses.

Luckily, the site had its five minutes of fame on Reddit which proved to be a decent opportunity to collect feedback. None of the users brought up an issue with the background effect so far. I’m also lucky enough to know a bunch of accessibility specialists, such as Sandrina Pereira. Her suggestion was that (a) background animations definitely qualify as motion, and (b) perhaps the effect feels natural because it’s a direct result of a user interaction.

Summary

The late-90s Geocities web felt playful and weird. It was fun in an uninhibited, somewhat less performative, way. I wanted to incorporate some of this look and feel in the site. But still, I didn’t want to make it feel esoteric to the point where you’d need to up your hipsterdom-level to 9000 and browse it exclusively throught Netscape 7. All of that, while listening to the new Nirvana Unplugged album.

I still wanted decent UX on mobile and desktop, and some space for easter eggs (something you can’t do when living in the strange and abusive relationship with social media we’ve grown so accustomed to).

As a kid, I had built six websites before I even got access to the Internet for the first time. Now, after being burned out for three years, even considering changing my job, it was the first time I genuinely enjoyed coding. I forgot how much fun it was!

Now, go out, pet your cat, and make stuff!


P.S. Check out Cameron’s World.

P.P.S. The code for interactive diagrams can be found on GitHub.

Footnotes

  1. Hence the K component in CMYK meaning “black.” Using B would be confusing as it means “blue” in other color models.
  2. It’s not perfect since the perceptual color space differs from what’s described using RGB/HSL.

useRainbow() originally published on CSS-Tricks. You should get the newsletter and become a supporter.

How To Decrease Risk of Presenteeism When Ending Remote Working

Absenteeism has always been considered a big problem in business workplaces, and most entrepreneurs try to deal with this to ensure that their organization remains productive. When the pandemic-led crisis forced many organizations to embrace work from home or remote work protocols, another crisis cropped up to thwart productivity. This new problem is called presenteeism.

Presenteeism means showing presence while not remaining productive enough as desired for the job role. The problem has particularly become rampant in some employees working remotely or from home. When hiring remote developers for a project, you see all the team members present on the web. Still, the output is not satisfactory, making the company doubt the work ethics of respective team members. 

How to Design a Better Decision Tree With Pruning

Decision tree (DT) analysis is a general and predictive modeling tool for machine learning. It is one of the simplest and most useful structures for machine learning. As the name indicates, DTs are trees of decisions. By using an algorithm approach for splitting data sets according to different conditions, decision trees are constructed. A decision tree is one of the commonly used and functional techniques for supervised learning. 

But before moving on to designing decision trees with pruning, let’s understand its true concept.

SQL vs NoSQL Database – A Complete Comparison

There are two main categories of databases in use in the developing world today, commonly referred to as SQL and NoSQL. In this article, we will compare an SQL vs. NoSQL database based on its pros and cons.

SQL, or Structured Query Language, is the universally known query language for relational databases. SQL databases make it simpler to work with structured data in a database through CRUD operations. CRUD stands for create, retrieve (or read), update, and delete – the primary operations for manipulating data.

How Does Machine Learning Work in Finance Automation?

Automation in finance, or any other sector for that matter, is inevitable. However, automating financial services is quite different and challenging from other business domains due to a high level of caution, concerns, and risks. 

According to the survey used for the above infographic, 73% of finance experts believe that automation boosts their function efficiency, and hence, the finance team can focus on other value-added activities. At the same time, 87% of CFOs believe that they need to be more agile to analyze their financial services and meet their targets.