Spring Boot Architecture and Workflow

Spring Boot Architecture: Spring Publishing is a sophisticated variant or job from the Spring framework. Together with the Spring framework, in addition, it is made up of third party libraries and Embedded HTTP servers. It easily produces a production-grade, more time consuming, and standalone applications dependent on the Spring framework

The goal of Spring Hack would be to completely get rid of the usage of XML-based and annotation-based settings in the software. By default, it provides the majority of the items, like functions, processes, etc. 

OAuth2 Bearer Token Usage

I have immersed myself in the digital identity space for the past few years. A good chunk of this work involves reading (and sometimes creating) specifications, as you can imagine. It is critical that they be written in such a way that two independent parties can build interoperable implementations without relying on each other’s code. With this in mind, let’s have a brief chat about OAuth2 Bearer Token Usage with a focus on the token’s encoding.

But first, let’s have a brief talk about what OAuth2 is.

Framer Motion Tutorials: Make More Advanced Animations

Framer Motion is a relatively new and popular open-source React animation library, aimed at creating production-ready animation. Framer Motion is Pose’s animation library next-in-line. It possesses a low-level declarative API and can be used irrespective of platform, for the web as well as for mobile apps. Its other advantage valued by the software developers is that it’s also possible to get it as a separate package for use in React apps.

Framer’s documentation provides enough tutorials on how to do the simplest gestures and motion. However, if you are working with more sophisticated cases, there’s too little information on the web in this respect. So it makes no sense to delve into the simplest examples, they can be done according to the documentation. There are also articles on this topic (albeit not very many of them) on the web. Let’s tinker with more complex Framer animations instead.

How to Integrate HUAWEI ML Kit’s Image Super-Resolution Capability

Have you ever been sent compressed images that have poor definition? Even when you zoom in, the image is still blurry. I recently received a ZIP file of travel photos from a trip I went on with a friend. After opening it, I found to my dismay that each image was either too dark, too dim, or too blurry. How am I going to show off with such terrible photos? So, I sought help from the Internet, and luckily, I came across HUAWEI ML Kit's image super-resolution capability. The amazing thing is that this SDK is free of charge and can be used with all Android phones. 

Background

ML Kit's image super-resolution capability is backed by a deep neural network and provides two super-resolution capabilities for mobile apps:

5 Cybersecurity Tips to Protect Yourself While Shopping Online

Christmas has always been a time when people stay away from work, relax, travel, and do a great deal of shopping, but 2020 has come with a difference. The first and second waves of COVID-19 have made it almost impossible for people to move around and shop at will. What people have to recourse to is online shopping. In 2019, according to a recent study, 93.4% of American consumers bought Christmas gifts, and the average consumer who bought Christmas gifts spent $928.76.

Most of these gifts were bought online. Buying from an eCommerce store, among other things, removes geographical limitations, reduces costs, and enhances comparison shopping. It also enables deals, bargains, coupons, group-buying in real-time and creates room for targeted communication. However, this comes with many cybersecurity risks. Cybercriminals catch in on the volume of data and personal information that have to be ferried during Christmas to wreak serious havoc.

What Is Transcoding? Why Is Transcoding Important for Streaming?

If you are in the streaming industry or have some interest, you may have heard the word transcoding a lot. You may know a little about what transcoding is, or you may be wondering what this word you hear all the time. However, regardless of your situation, after this blog post, you will have full control of the transcoding process. Let’s not forget that the video transcoding process is very important for live broadcasts, especially if you want to use adaptive streaming in live streams to reach more audiences. We will find an answer to the question of what is transcoding.

But… To really understand what transcoding is and how it affects the success of your streams, firstly, we need to talk about encoding and need to understand what encoding is. We cannot talk about transcoding without talking about encoding.

Understanding the Query Block and Its Importance in Site Editing

I really don’t understand this Query block even though it’s been mentioned in several Tavern posts. My eyes seem to gloss over when reading about it – ha!

Is it important that regular WordPress users understand this block, or is it really a block for developers?

Marcus

I have given the Query block a lot of attention as of late. On occasion, I may have even called it one of the largest hurdles the Gutenberg development team has needed to jump before block-based themes become a reality. However, the “query” WordPress term is not something all users or Tavern readers are familiar with. It is a concept as old as WordPress and generally something that only developers needed to familiarize themselves with. When Full Site Editing lands in WordPress, the new block will expose the Query to far more users as part of the site editor interface.

It is a block that is currently a part of the Gutenberg plugin but not WordPress core. However, at some point in 2021, more and more end-users and developers will be working with it.

In WordPress terminology, we are really talking about two things, the Query and the Loop. The Query is defined by a set of arguments or options that determine what posts to display. The Loop is the part of the machine that “loops” through the queried posts and displays them, one after another. The Query asks for posts; the Loop cycles through them.

Traditionally, theme authors were responsible for adding the Loop code to their templates, which used the global Query that WordPress supplied. Themes could also create custom queries, such as adding a posts list widget, categorized homepage post sections, or anything. And, “posts” can be anything from normal blog posts to WooCommerce products to the latest topics from the bbPress plugin.

The Query may be one of the single most important aspects of WordPress. In essence, it is the engine behind displaying the content of every page on the site. Without it, all WordPress sites would simply be a header and a footer.

The Gutenberg plugin provides two blocks for the Query:

  • Query: The outer block for setting the options for which posts will show.
  • Query Loop: The inner block, which is automatically added when using Query.

Currently, users can select between four fairly standard variations when first adding the Query block. They are combinations of the post featured image, title, date, and excerpt.

Initial Query block variations in the WordPress editor.
Query block variations.

These can be further customized via the block options panel in the sidebar. Users can also find “view” options in the toolbar for selecting between List and Grid views. The List view is the traditional list of posts flowing vertically down the page. The Grid view displays posts in two to six columns.

Grid view of the Query block in the WordPress editor.
Grid view of posts while using the Query block.

The Query block has a basic set of options for which post types to display and how to order them. It has filters for categories, tags, authors, and keywords. The block is not as robust as what is possible with code yet. It is missing some basic options like a post number limit and nearly all of the more advanced parameters. However, it is a promising starting point.

The more exciting aspects of this feature for end-users may not be the Query block at all. It is customizing the blocks that go inside, which display things like the featured image, post title, and more.

As a former theme author, I cannot count the number of times users have asked me about customizing some aspect of the posts layout. Having them dive into code to make minor changes, such as removing the post author name or displaying the category in a different place, was not an ideal experience. The site editor will put this power directly into each user’s hands.

Customized version of the Query block while in grid view.
Adding post-related blocks to the Query block in Grid view.

The comment by Marcus was on the Tavern’s post covering Gutenberg 9.6. The latest version of the plugin introduced global query inheritance for the Query block. This means that theme authors can now replicate the content layer in block-based themes. Previously, pages like archives and search results would simply display the latest posts when a theme used the Query block. Now, each of those pages can display the correct posts.

However, the Query block is so much more than that. In the hands of users, it can be a powerful tool for creating custom output on a homepage — think newspaper-style categorized sections. Users can also create post lists in a sidebar, such as the latest forum replies or products. Theme authors can offer templates or block patterns with unique designs or as starting points for end-users to modify. There is no shortage of possibilities.

CSS Individual Transform Properties in Safari Technology Preview

In CSS, some properties have shorthand. One property that takes separated values. Syntactic sugar, as they say, to make authoring easier. Take transition, which might look something like:

.element {
  transition: border 0.2s ease-in-out;
}

We could have written it like this:

.element {
  transition-property: border;
  transition-duration: 0.2s;
  transition-timing-function: ease-in-out;
}

Every “part” of the shorthand value has its own property it maps to. But that’s not true for everything. Take box-shadow:

.element {
  box-shadow: 0 0 10px #333;
}

That’s not shorthand for other properties. There is no box-shadow-color or box-shadow-offset.

That’s where Custom Properties come to save us!

We could set it up like this:

:root {
  --box-shadow-offset-x: 10px;
  --box-shadow-offset-y: 2px;
  --box-shadow-blur: 5px;
  --box-shadow-spread: 0;
  --box-shadow-color: #333;
}

.element {
  box-shadow:
    var(--box-shadow-offset-x)
    var(--box-shadow-offset-y)
    var(--box-shadow-blur)
    var(--box-shadow-spread)
    var(--box-shadow-color);
}

A bit verbose, perhaps, but gets the job done.

Now that we’ve done that, remember we get some uniquely cool things:

  1. We can change individual values with JavaScript. Like:
    document.documentElement.style.setProperty("--box-shadow-color", "green");
  2. Use the cascade, if we need to. If we set --box-shadow-color: blue on any selector more specific than the :root, we’ll override that color.

Fallbacks are possible too, in case the variable isn’t set at all:

.element {
  box-shadow:
    var(--box-shadow-offset-x, 0)
    var(--box-shadow-offset-y, 0)
    var(--box-shadow-blur, 5px)
    var(--box-shadow-spread, 0)
    var(--box-shadow-color, black);
}

How about transforms? They are fun because they take a space-separated list of values, so each of them could be a custom property:

:root {
  --transform_1: scale(2);
  --transform_2: rotate(10deg);
}

.element{
  transform: var(--transform_1) var(--transform_2);
}

What about elements that do have individual properties for their shorthand, but also offer comma-separated multiple values? Another great use-case:

:root {
  --bgImage: url(basic_map.svg);
  --image_1_position: 50px 20px;
  --image_2_position: bottom right;
}

.element {
  background: 
    var(--bgImage) no-repeat var(--image_1_position),
    var(--bgImage) no-repeat var(--image_2_position);
}

Or transitions?

:root {
  --transition_1_property: border;
  --transition_1_duration: 0.2s;
  --transition_1_timing_function: ease;
  
  --transition_2_property: background;
  --transition_2_duration: 1s;
  --transition_2_timing_function: ease-in-out;
}

.element {
  transition: 
    var(--transition_1_property) 
    var(--transition_1_duration) 
    var(--transition_1_timing_function),
    var(--transition_2_property) 
    var(--transition_2_duration) 
    var(--transition_2_timing_function),
}

Dan Wilson recently used this kind of thing with animations to show how it’s possible to pause individual animations!


Here’s browser support:

This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and up.

Desktop

ChromeFirefoxIEEdgeSafari
4931No169.1

Mobile / Tablet

Android ChromeAndroid FirefoxAndroidiOS Safari
8783819.3


The post CSS Individual Transform Properties in Safari Technology Preview appeared first on CSS-Tricks.

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

December Update: COVID-19 Exposure Apps In the USA

In the final two months of 2020, national attention turned to election results and the final FDA approval of vaccines. Today in medical facilities, the cries for preventative measures still ring out as ICUs have reached critical mass with COVID-19 patients, and vaccines have begun the nascent stages of rollout. This article covers state-sponsored COVID-19 exposure and contact-tracing apps launched in the US during November/December 2020.

Headless Browsers: A Stepping Stone Towards Developing Smarter Web Applications

Web development has grown at a tremendous pace with lots of automation testing frameworks coming in for both front-end and backend development. Websites have become smarter and so have the underlying tools and frameworks. With a significant surge in the web development area, browsers have also become smarter. Nowadays, you can find headless browsers, where users can interact with the browser without a GUI. You can even scrape websites in headless browsers using packages like Puppeteer and Node.js.

Efficient web development hugely relies on a testing mechanism for quality assessment before we can push code to production environments. Headless browsers can perform end-to-end testing, smoke testing, etc. at a faster speed, as it is free from overhead memory space required for the UI. Moreover, studies have proved that headless browsers generate more traffic than the non-automated ones. Popular browsers like Chrome can even help in debugging web pages in real-time, analyze performance, notify devs of memory consumption, enable developers to tweak their code and analyze performance in real-time, etc.

How to Test SaaS Platforms

SaaS platforms have been on the rise for some time now. From professional endeavors to leisure activities, more of our experiences are shifting towards a virtual delivery. And because immediate access from any location makes the shortlist for any software system, consumers often choose SaaS applications over on-premise software systems.

Then again, not all SaaS is alike. When not properly tested, SaaS platforms can fail to achieve the convenient, fast, and quality experience that users expect.

Novel Points: Exploit the Heap Overflow Bug *CTF 2019 oob-v8

1. Contents

2. Many Heap Overflow Bugs Can Be Exploited in a Similar Way

I have introduced a v8 heap overflow bug before: V8 Array Overflow Exploitation: 2019 KCTF Problem 5 小虎还乡 – Pwn By Kenny. This is another one: *CTF 2019 oob-v8. The interesting things I’m going to show you in this post are: 1) This bug only allows you to read or overwrite specific 8 bytes. But you can use it to achieve arbitrary reads and writes. 2) This is a different heap overflow bug. But you can exploit it in a very similar way to the 2019 KCTF Problem 5. In fact, many heap overflow bugs can all be exploited in such a similar way. To show you this, I will use the same headings as the 2019 KCTF Problem 5 post. Feel free to compare the two posts!

3. PoC of the V8 Heap Overflow Vulnerability – *CTF 2019 oob-v8

PoC code is what triggers a bug. For this *CTF 2019 oob-v8 bug, we are able to read out-of-bounds with “JSArray.oob();”, and write out-of-bounds with “JSArray.oob(value);”. JSArray is a v8 object used to represent an array. For example, if you write code like “var arr = [1.1];”, you will have a JSArray object in the memory. And “arr.oob();” allows you to read the next 8 bytes beyond the array’s element area. “arr.oob(2.2);” allows you to overwrite the 8 bytes with 2.2. For more information about JSArray, please visit V8 Objects and Their Structures – Pwn By Kenny

How to Use ObjectStore in Mule

1. Introduction 

Object stores are used to store an object. Mule uses object stores whenever it needs to persist data  for later retrieval. Mule uses object stores internally by utilizing a key value pair combination. It is already available in the Mule palette – from there we can directly use it. If it is not available in your Mule palette, you can get it from the Mule Exchange Portal.

2. Operations Available 

An object store contains the following operations in the form of connectors in the Mule palette:

How to Use Thread.sleep() in Java With Selenium

Automating a web application optimizes work flow, helps minimize errors, and makes the product robust. An automated suite will be successful when a system's behavior is predictable. If a system is not predictable, there will be many automation hurdles that need to be handled carefully. Sometimes while automating a web application, we may face an exception, NoSuchElementException, which is thrown when the element that is being interacted with is not found. This may look weird when you can actually see the element on the webpage, but it has vanished during Selenium test automation.

The principal cause of this exception is that the element we're trying to interact with actually exists on the page but takes time to load and display itself to the user. As you can imagine, this can turn out to be a major issue during automation and can lead our scripts astray. This is where Thread.sleep() in Selenium Java comes into play. Before we look into the effective use of the Thread.sleep() Java function, let's take a look at the basics about Thread.sleep() in Selenium.