Easy and Fast Adjustment of Kubernetes CPU and Memory

Assigning and managing CPU and memory resources in the Kubernetes can be tricky and easy at the same time. Having done this task for numerous customers, I have decided to create a framework zone. I will show you what Kubernetes resources and limits are and how to manage them.

The framework contains the following steps.

  • Infographic Guide shows what algorithms to follow to determine and assign the resources and limits.
  • Code templates allow applying those algorithms with minimal adaptation.
  • Algorithms and tools to gather the metrics about resource consumption and set up the limits.
  • Links to the official documentation where you can quickly grab some examples and read more detailed information.

What This Article Doesn't Contain

My goal here is simplicity. So you won't find detailed descriptions of how resources, limit ranges, and quotas work. There are plentiful articles written about it, as well as Kubernetes thorough documentation. Instead, here you will find information on how to quickly start adjusting Kubernetes resources in your projects.

How to Quickly Integrate Cloud Functions of AppGallery Connect Into Cocos-Based App

1. Environment

2. Enabling and Configuring Cloud Functions in AppGallery Connect

Note: Currently, Cloud Functions is still under beta. To use the service, you need to send an email for application. For details, check here.

1. Create an app first and add it to a project, or select an app from the project list on the My projects page in AppGallery Connect. 

A Case Study on Spring Framework

The Spring Framework is a great application framework and inversion of control container for the Java platform. It is also a great example of high-quality software. Spring Framework is the foundation for all Spring projects. Collectively, the Spring Framework and the family of Spring projects is often referred to simply as "Spring." Spring provides everything required beyond the Java programming language for creating enterprise applications for a wide range of scenarios and architectures. It has been developed over 17 years.

We analyzed the Spring Framework with CodeMR. CodeMR is an architectural software quality and static code analysis tool. You can find  analysis report generated with CodeMR at: https://www.codemr.co.uk/case-reports/spring-framework/html/html_report_spring-core/htmlx/lbd/dashboard.html.

Manipulating Geo Coordinate Data Using DAO Design Pattern in Jedis

In this article, we are going to learn how to add geocoordinate data and retrieve it using the DAO design pattern. The DAO pattern is implemented as a layer between the client application and the database.

The data being stored in the Redis database is modeled as a domain object (POJO class). It will have only getter and setter methods. The client application knows only the domain object and high-level API.

Scrollbars on Hover

First, scrollbars are a usability and accessibility thing. Second, a rule of thumb: if an area scrolls, it should have a visible scrollbar. But the web is a big place and I like tricks, so I’m going to cover the idea of only revealing them on hover. Even macOS itself¹ hides scrollbars by default, revealing them contextually and on interaction. Same on iOS, leading to confusing momements.

All that aside, here’s a way to hide scrollbars by default, only revealing them when the element is hovered. It was created by Thomas Gladdines, who also emailed me about it:

In quick testing on my machine, it works across Chrome, Firefox, and Safari, regardless of my macOS settings. So pretty robust.

The trick is that mask covers the scrollbar! So, if you create a mask that is exactly as wide as the scrollbar (here, I’m just guessing that 17px will cover it) and super duper tall (both of which should probably be calculated by a script), it can perfectly cover the scrollbar. You can even transition the position of the mask, faking a fading in/out effect. Very clever.

Notably, this is the real scrollbar of the element, and not a faked one. Faking one could be another approach. Ben Nadel covered how Slack does that. Their trick is to force the scrollbar to render in an area hidden by overflow, and make a virtual scrollbar that mimics the native one (which you’d then have more direct control over). It’s not forcing the scrollbar either, which is something else you can do if so motivated. And nothing about this prevents you from styling the scrollbar, which might actually have some benefits like specifying the exact width of it.

  1. As I write: If your device allows gestures, scroll bars are hidden until you start scrolling. Otherwise, they’re visible. ↩️

The post Scrollbars on Hover appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

React Native vs. Flutter: Which Is Best for Your New App?

These days, customers expect an app for your service. It needs to give them full access to your services while being easy to use. There's more ways to build apps than ever before, but Flutter and React Native are becoming the big names in app development. Which one should you use?

What Are React Native and Flutter?

Before we get into anything, you need to know what both of these services are. React Native is a framework that has been developed by Facebook. It's a JS cross-platform framework that allows you to use both React and JavaScript together in your programming, making it very flexible. 

Biden White House Sticks with WordPress for Website Relaunch

President Joe Biden took office today and unveiled a new whitehouse.gov that has been relaunched on WordPress. The previous administration switched from Drupal to WordPress in 2017, and technologists working with the Biden administration decided to stick with the same CMS.

In keeping with the multilingual and accessibility features implemented on the Biden-Harris transition team website, whitehouse.gov launched with toggles for contrast and font size, along with a Spanish language switcher. The relaunched site also includes an accessibility statement with a commitment from the administration to work towards conforming to the Web Content Accessibility Guidelines (WCAG) version 2.1, level AA criteria.

Much of the content and design from the transition website has been preserved. The transition site now forwards to whitehouse.gov, while links to the previous administration’s pages land on a 404 page with a link to archived presidential websites.

Savvy observers might notice that the typography has been updated from the transition site, flipping the Mercury and Decimal typefaces. Hoefler&Co, the typeface design firm that created these typefaces for Biden’s 2020 campaign, tweeted about how “the serif Mercury felt more like the voice of the institution.” The sans-serif Decimal functions more in a supporting role on the site.

Web professionals kicked the tires a bit and noticed the site is putting up fairly decent Lighthouse scores.

Under the hood, code snoopers noticed an advertisement for the U.S. Digital Service (USDS), the group of technologists who maintain many of the federal government’s public-facing digital services.

In addition to the message from USDS, the site’s source code includes a link to the US government’s analytics program at analytics.usa.gov. Tim Lowden, who manages the federal government’s aggregated web analytics initiative, said this data has been made available for the first time since late 2017.

The analytics service records more than 2.5 billion pageviews across federal government websites each month. The data is available to the public, but it does not track individuals, and anonymizes the IP addresses of visitors. It shows information for visitors’ devices, browsers, operating systems, and location broken down into cities and countries. Many of those visiting the site today are from countries other than the U.S.

RPA With Open Source

We humans are lazy and were habitually attempting to do more with less. For thousands of years, we have built machines to perform arduous tasks for us. In the era of computerization and software, a new terminology emerges in automation – Robotic Process Automation (RPA).

While automation has a broad connotation of any labor-saving technique or technology, RPA is a specialized application for business process and workflow automation. RPA is particularly aimed at mimicking essential human actions for business development. The goal of RPA is to reduce the use of human labor for mundane tasks, thus making it possible to reuse their capabilities towards gainful business activities.

Defining Polyglot Programming: Podcast With Neal Ford

Polyglot programming, whilst not a new concept, is becoming increasingly relevant to full-stack developers and to microservice architectures. That’s because it allows a developer to mix and match programming languages to suit their personal preference, expertise, or the functional requirements of the project.

ThoughtWorks Director and Software Architect Neal Ford joins me and David Brown in this episode as he discusses the benefits of polyglot programming, a phrase he originated himself. He also shares how developers can use this practice in making application development more efficient, and how the concept of low-code is relevant in all of this.

First Round of the FSE Outreach Program Concludes, Identifies Template-Editing Mode Problems

The Full Site Editing (FSE) Outreach Program has now concluded its first round of testing. Its first focus area was centered on the template-editing mode introduced in Gutenberg 9.6. The volunteers involved with the project identified several pain points.

Gutenberg 9.6 added a new button that allows end-users, provided they are using a block-based theme, to switch between editing their post and the template that displays the post. As Josepha Haden said last year, the ultimate goal is to “consolidate down to just one beautiful, intuitive interface.” Essentially, this new feature merges content and design in a way we have not seen in core WordPress before. It is a step toward that lofty goal.

Traditionally, WordPress has always separated content from design. However, these two aspects of websites are continually merging together. There is a desire for this. The adoption of page builders over the last half-decade or so has made it abundantly clear.

The biggest issue with this new template mode is that users need a working knowledge of the WordPress template system to understand the ramifications of their edits. One of the primary questions of the focus area was whether it was clear that the user was making large-scale changes to all posts when switching to the template-editing mode.

“I believe it was not clear enough how those changes could impact the site,” wrote Héctor Prieto in response. “If you don’t already know how templates, template parts, and global blocks like Site Title work, you might not understand how your editing will affect the rest of the site.”

Switching modes does create a quick popup at the bottom left of the screen that reads:

Editing template. Changes made here affect all posts and pages that use the template.

It is easy to miss before it fades away. There is a ticket to stick this message on the screen and allow the user to dismiss it. There is also another ticket for clarifying when a user is editing a template vs. content.

Gutenberg template editing mode from within the post editor.
Entering template-editing mode from the post editor.

Gutenberg’s current method is different than what you might see in a typical page builder. When switching to template-editing mode, the user is no longer editing that single post’s front-end output. Instead, they are making global edits. A page builder would generally save any customizations to that page alone. If this remains the same, it could be a hurdle for the average user to clear.

A template creation feature needs to be a part of this new mode. Users should be able to fork or clone their existing single post template and save it as a new template specific to that post. Or, maybe hand them a way to save it as a reusable template (i.e., “page” template). Paal Joachim Romdahl shared a similar thought, likening it to the “Save As…” feature commonly found in computer programs.

I do question whether users should be able to edit global templates while editing a single post. The two are only related insofar as the template displays the post content on the front end. WordPress should explore any type of design work from the post-editing screen as, first and foremost, specific to that post.

The volunteers also identified other issues. Applying changes to the template and saving drops the user back into the post editor. The “cancel” button is tough to find — it is in a different location than where the user clicked to go into template-editing mode.

Switching between post and template editing feels like an FSE 2.0 type of thing. The development team has enough issues on its plate with the normal site editor. It is a far cry from being a viable, production-ready product. The team’s focus should be on working the kinks out of that system before merging it with the post editor. Crawl before you walk. Walk before you run.

However, I am willing to be pleasantly surprised. In the long run, it will probably be a good thing that we are getting an early look at what these two different pieces of WordPress will look like working in conjunction.

This is also why participation in the FSE Outreach Program is vital. The community needs this more formal type of process to identify areas that need improvement.

How to Convert a Price from USD to EUR in Java

Over the past year, we’ve seen an abundance of changes that influence the way we do business, and with the roll out of lightning-quick broadband and 5G as well, the world is more connected and reliant on the internet than ever. This global culture has led to more business with international clients via websites and programs, and converting prices to the proper currency is an integral piece of meeting standards across the board. However, between keeping up with exchange rates and processing manual calculations, price conversion has the potential to become quite the time-consuming task. If we want to ensure the most accurate and efficient user experience, automation can be a key addition to our approach.

Enter the Cloudmersive Currency Conversion API; this innovative solution can be utilized to simplify the currency conversion process by leveraging continuously updated currency exchange rate data to produce an instant result. The goal of this article is to walk you through how to install and use this feature in Java to simultaneously improve customer satisfaction and system processing by taking a price in any source currency and converting it to a destination currency.

How to Be a Terrible Project Maintainer

Hey, you! Yeah, you. Are you a software engineer? Do you have ownership over a particular repository at your company? Do you want to ensure that working with your repo is a constant source of frustration for your fellow developers? Great! Then read on for these tips on how to be a terrible project maintainer.

Don't Write Good Documentation

Especially on how to do local development or how to contribute to the repo. You want to keep people guessing. Running your project locally should be a puzzle that only the greatest minds can solve. If you want to be even more cryptic, consider including outdated or incorrect instructions that reference non-existent scripts meant to run the app.

Shopify Modifies Partner and Checkout APIs

Shopify, an e-commerce solutions and API provider, has recently announced several updates to its Partner and Checkout APIs that are intended to protect merchant privacy while also providing access to a robust collection of data that ensures improved productivity for partners.

Diving Deep Into Databases With Joe Karlsson

NoSQL databases are known to provide agility and flexibility when compared to traditional SQL databases. They can be scaled across a myriad of servers, making them well suited for working with large sets of data. This equips organizations with the ability to embrace big data, analytics projects, and further work their digital transformation efforts.

Joe Karlsson, a Developer Advocate at MongoDB joins David Brown in this episode as he shares his insights on NoSQL databases, relational databases, and how SQL and NoSQL, in some cases, cross each other’s boundaries.

Getting Started With Ubuntu and Bash Shell

Introduction

Ubuntu is a free, open-source operating system that you can install on your laptop or desktop. It comes in desktop and server versions. Ubuntu is easy to install, simple to use, safe, secure, fast, and massively powerful.

Ubuntu is a distribution of Linux. The Linux kernel is at the core of the operating system and it does all the essential low-level stuff.

APIs Over IPAs: Mike Amundsen [Podcast]

Moesif’s Podcast Network: Providing actionable insights for API product managers and other API professionals.

In episode number 4 we have the well known author and speaker Mike Amundsen. He’s a prolific writer on all things APIs and recently released his latest book entitled Design and Build Great Web APIs: Robust, Reliable, and Resilient. When he’s not writing, Mike helps companies capitalize on opportunities in APIs, Microservices, and Digital Transformation.

Mike shares his perspectives on why organizations think about APIs in three levels, how AWS’s Werner Vogel does deprecation, what the future holds for API automation tools, and many more knowledgeable insights .

PHP: Inserting records from a table to another using check boxes

Hi guys

I am after a pre written PHP script or a tutorial which displays records from a table each with a checkbox. ( I have worked to this part)

When the check box is ticked and the submit button is pressed, the records with a checkbox get inserted into another table.

Any tutorial or script or webpage to guide me would be greatly appreciated.

I am not a coder but can study scripts and adapt and apply to my personal projects.