How Bokeh Secures Its Open-Source Repositories

Open-source is everywhere, it is one of the driving forces of software innovation from the academic to the enterprise world (75 percent of codebases audited by Synopsys in the 2021 OSSRA report rely on open-source components). Its prevalence in commercial software is reaching unprecedented levels, to the extent that the European Commission has recently identified it as a public good in a recent study assessing its impact on the region’s economy.

But the interstitial nature of open-source in modern software also makes it a subject of security and compliance concerns, as it is capable of exposing organizations that use it to a host of unknown risks and vulnerabilities. Most discussions we are hearing today around security in this space are focused on the identification, fixing, and remediation of vulnerabilities — all seen from the “consumer” perspective.

iOS Crystalline Blurred Backgrounds with CSS Backdrop Filters

iOS is full of cool crystalline glass effects. This effect has long been easy to do when you have easy access to graphic shaders since these can do most of the heavy lifting in terms of calculating what is underneath the layer, and blurring it into the foreground. However, for a long time, it hasn't been possible in CSS... until now.

In more recent specifications of CSS, we have finally gotten backdrop-filter. Mostly meant for modals, it also has applications on stylized dropdowns which are common across the web.

3 Reasons You Should Talk About Release Schedules More Often

Release schedules drive many of the processes for IT teams. The problem is, business teams, don’t like release schedules. Maybe it’s because they don’t understand the need for the formal process or they feel release cycles slow down the delivery of new features and fixes. 

Whatever the reason, if you work as a developer or in DevOps, talking about release schedules with your business stakeholders is important.

API Security Issue 155

This week, we have a vulnerability in the BrewDog mobile app exposing users’ PII courtesy of hard-coded bearer tokens, Cisco has announced the arrival of their APIClarity at KubeCon 2021, F5 has published a report on API attacks in Open Banking, and finally, there’s a mega-guide on API security best practices.

Vulnerability: Hard-Coded API Bearer Token in Brewdog Mobile App


My First Thoughts as an Engineering Manager

Recently, I've joined Nextail Labs as an Engineering Manager. This is my first experience working in a Software Startup and also as an Engineering Manager. I've been leading Engineers Teams most of my professional career with other roles including the following:

  • Tech Lead in a small software consultant company.
  • Solution Architect and Team Lead of consultant team of an important software vendor.
  • Team Lead and Product Owner in an important fashion retailer company.

None of these roles were focused on the people, there were always other main goals. Today, I know how different they are and how different the challenge is.

Building High-Quality Software

I have interviewed many engineers and managers lately, and one of the standard questions I ask is how to build high-quality software. Of course, I provide more context and explanations, but the gist is the same. I heard all kinds of answers. However, I was puzzled that almost none were systematic, and people immediately went into a specific pet peeve. As part of this exercise, I felt that I had to crystalize my answer to this question and write it down.

Let me start with high-level thoughts (specifically to make it systematic). First of all, I want to concentrate on software code quality (vs. larger topics, including problem definition, documentation, UX, design, etc.). High-quality software is software that has fewer bugs (and a shorter tail of fixing remaining issues). There are a bunch of other things like code readability, maintainability, debugability, and so on which can easily be swept under the quality umbrella. Let’s concentrate on the core that the product operates as expected.

Android Native – How to load alternate String resources

Introduction

If your Android app is available to a global audience, you might have wondered how to load localized Strings into your app. This tutorial will teach you how to do just that.

There are quite a few steps involved, but once you understand the concepts, it will make loading other alternate resources easier for you as well, such as drawables or fonts.

Our end goal is to have the app display Hola Mundo!, which is the Spanish equivalent of Hello World! when the Android device language setting changes to Spanish.

Goals

At the end of the tutorial, you would have learned:

  1. How to load alternate String resources on Android native.
Prerequisite Knowledge
  1. Basic Android development knowledge.
  2. Basic knowledge of the Java class Locale.
Tools Required
  1. Android Studio.
Project Setup

To follow along with the tutorial, perform the steps below:

  1. Create a new Android project with the default Empty Activity.
  2. Our project so far is pretty barebone. Android Studio created an empty TextView for us with Hello World as its content.

helloworld.png

  1. It is still a hard-coded String, so let us go ahead and use a String resource under res/values/strings.xml instead.

  2. In strings.xml, add a new <string>

    <string name="hello_world">Hello World</string>
  3. In res/layout/activity.xml, modify the TextView attribute android:text to reference the String resource that we just created previously.

     android:text="@string/hello_world"
Resource Directory and Configuration Qualifier

The first thing that we need to do when adding alternate resources is to create a Resource Directory with a Configuration Qualifier.

To create a Resource Directory, perform the steps below:

  1. Right-click on res -> New -> Android Resource Directory. You will then be presented with the New Resource Directory wizard like the screenshot below.
    New_Resource_Directory.png
  2. Keep the Directory name as values for now.
  3. Keep the Resource type as values.
  4. Under the Available qualifiers box, Android Studio provides a list of qualifiers. Each of the items in this list is officially called a Configuration Qualifier Name. Android will automatically pick the resource to use if the current Android device settings match the qualifier name. The list is also sorted from highest to lowest precedence for the qualifiers themselves. For example, if there are two resources with one matching the Country Code (retrieved from the device SIM card) and the other resource matching Locale, e.g en-rUS, then the resource matching the Country Code will be loaded because Country Code has higher precedence than Locale.
  5. Because we want to provide alternate String resources in a different Locale, select Locale and then hit the bitwise-signed-right-shift (>>) button.
  6. The window will change a little bit. The list of languages is too long to find our language, so you can highlight any language to put the focus into that box and start typing to find the language you need.
  7. After selecting your language, you might have noticed that the Region list has also been narrowed down to match the common regions for the selected language. Now you can easily select the region you want.
    7.png
  8. Now, if you pay attention to the Directory name field, the name has already been automatically changed for you as well. Android Studio automatically added the Locale configuration qualifier into the resource directory name.
  9. If you are familiar with the Java class Locale, then the r might seem odd to you. It is just a requirement on Android to prefix the region with r.
  10. Click OK to create the resource directory.

You can also create a Resource Directory without this wizard, just make sure that the language is a two-letter ISO 639-1 language code. The region code is optional. If the region code is added, it must be prefixed with the r and uses a two letter ISO 3166-1-alpha-2 region code.

To see the newly created directory, you need to switch the Project view from Android to Project.

project.png

Create the alternate String resource

To create a String resource file for the custom Locale,

  1. Right click on values-es-rMX -> New -> Values Resource File
  2. In the Enter a new file name box, type in strings.
  3. Select OK.

We can now see that the new strings.xml file has been created. Android Studio even shows the flag of the region, which will make project navigation a little bit easier.

values.png

You can now switch back to the Android view (we switched to Project view earlier).

Inside the xml file values-es-rMX/strings.xml, add a new string to it, which will translate Hello World! to Hola Mundo!

<string name="hello_world">Hola Mundo!</string>

If we switch back to the default strings.xml file under values/strings.xml, we will see red warning that says:

"app_name" is not translated in "es" (Spanish)

The code will still compile, so you can ignore that warning. There are ways to disable such warnings for the whole project or just a single instance, but that topic is out of scope for this tutorial.

For the alternate String to display, we need to change the device Locale as well.

  1. On the test device, go to Settings > System > Languages & Input > Languages.
  2. Search for Espaol > Add it to Languages.
  3. Move it on top of English.
    espanol.png
  4. In Android Studio, re-run the app.

We will now see our app displaying Hola Mundo!.

hola_mundo.png

Solution Code

values/strings.xml

<resources>
   <string name="app_name">Daniweb Android Alternate String Resource</string>
   <string name="hello_world">Hello World!</string>
</resources>

values-es-rMX/strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
   <string name="hello_world">Hola Mundo!</string>
</resources>
Summary

Congratulations, you have learned how to load alternate String resources on Android. The full project code can be found here: https://github.com/dmitrilc/DaniwebAndroidAlternateStringResource/tree/master

Android Native – How to live-debug a database

Introduction

One of the best debugging tools in Android Studio is the live database inspector. It allows developers to peek at the current state of the database and even run queries against it.

In this tutorial, we will learn how to use it to debug a local SQLite database.

Goals

At the end of the tutorial, you would have learned:

  1. How to create a SQLite Database.
  2. How to debug a SQLite Database using the Database Inspector.
Prerequisite Knowledge
  1. Basic Android development knowledge.
  2. Basic SQL knowledge.
Tools Required
  1. Android Studio.
Project Setup

To follow along with the tutorial, perform the steps below:

  1. Create a new Android project with the default Empty Activity.
Creating the SQLite database

Before learning about the database inspector, we obviously must have a database to inspect. So we will need to create the database first.

The first thing that we need to do to create a SQLite database is to define a contract. A contract is a class that specifies your schema layout. We do not need to instantiate this contract, so Android prefers for developers to put these contracts inside a Kotlin Object (Singleton).

The database used in this tutorial comprises exactly one table called student. The student table would have two columns, name and age. Let us create a Kotlin Object called StudentContract from the code below (you will need to a create new Kotlin file).

package com.example.daniwedblivedebug

object StudentContract {
}

Next, we need to add another Object representing the table student inside of StudentContract.

object Student : BaseColumns {
   const val TABLE = "student"
   const val COLUMN_NAME = "name"
   const val COLUMN_AGE = "age"
}

The Student Object also extends BaseColumns because it is recommended by Android. BaseColumns provide inheritors with a primary key field called _ID, which allows our database to work well with other Android components.

Make sure that you add the import for BaseColumns as well.

import android.provider.BaseColumns

The second step that we need to do is to create a SQL statement that will help us create our student table (DDL). Later on, we will pass this statement to a class called SQLiteOpenHelper.

Inside the StudentContract Object, add the constant below.

private const val SQL_CREATE_STUDENTS =
   "CREATE TABLE ${Student.TABLE} (" +
           "${BaseColumns._ID} INTEGER PRIMARY KEY," +
           "${Student.COLUMN_NAME} TEXT," +
           "${Student.COLUMN_AGE} INTEGER)"

Finally, the last step that we would need to do is to extend SQLiteOpenHelper. This class contains a method to create the database the first time we obtain a reference to the database through it.

Still inside the StudentContract object, add the StudentDbHelper class.

class StudentDbHelper(context: Context) : SQLiteOpenHelper(context, DATABASE_NAME, null, DATABASE_VERSION) {

   override fun onCreate(db: SQLiteDatabase) {
       db.execSQL(SQL_CREATE_STUDENTS)
   }

   override fun onUpgrade(p0: SQLiteDatabase?, p1: Int, p2: Int) {
       TODO("Not yet implemented")
   }

   companion object {
       const val DATABASE_VERSION = 1
       const val DATABASE_NAME = "Student.db"
   }
}

We are required to implement both onCreate() and onUpgrade(). Since upgrading is not in scope for this tutorial, we can just skip implementing it. In onCreate(), we told our database to execute the DDL statement we described previously to create the student table.

The companion object in StudentDbHelper contains constants for the superclass to consume. They are self-explanatory.

Trigger the table creation

As stated previously, the table creation wont be triggered until we attempt to retrieve a reference to the underlying database once, so we must add a few lines into our MainActivity code.

First, instantiate StudentDbHelper and then save it as a constant in MainActivity.

Inside MainActivity, add the dbHelper property.

private val dbHelper = StudentContract.StudentDbHelper(this)

Then, inside onCreate(), append this line of code to the method.

dbHelper.readableDatabase

By obtaining a reference to the underlying database, we have triggered the table creation, which we will be able to see in the inspector later.

Optionally, we can also close the database when the main activity is destroyed. We can do that by calling the close() method on the dbHelper reference. Inside MainActivity, override onDestroy() with the code snippet below.

override fun onDestroy() {
   dbHelper.close()
   super.onDestroy()
}
Inspect the database

It is finally time to inspect the database. Run the app using the Debug option (Shift+F9). After Hello World! is printed on the screen, switch to the App Inspection tool.

You can find the App Inspection tool at the bottom of your IDE.

inspect.png

If it is missing, then you can just go to

View > Tool Windows > App Inspection

to bring it back.

The database might not load immediately after switching to the App Inspection tool. You might have to wait a couple of seconds for it to show. Once it is loaded, you will see the database and the student table like the screenshot below.

db.png

If you are familiar with other database management consoles such as MySQL Workbench, SSMS, DBeaver, etc, then the Database Inspector should be quite easy for you to use.

Running queries

To execute statements against the database, open a New Query Tab.

queries.png

Our database currently does not have any row, so let us add one row. In the New Query tab, run the SQL statement below.

INSERT INTO student values(1, "John", 19);

To check if a student named John with age 19 has been added to the database, you do not have to run any SELECT query. You can just double click on the student table, and the database will show current rows.

student.png

You can also change how many rows can be displayed. The default is 50.

The Database Inspector also allows us to modify values directly. Double-click on Johns name and change the value to Mary.

There is no option to delete a row directly using the Database Inspector, so we must run a DELETE statement to delete the row.

DELETE FROM student WHERE _id=1;

The Database Inspector will advise that the statement was run successfully. If we refresh the student table view, we can see that the row has been deleted.

Solution Code

StudentContract.kt

package com.example.daniwedblivedebug

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
import android.provider.BaseColumns

object StudentContract {
   object Student : BaseColumns {
       const val TABLE = "student"
       const val COLUMN_NAME = "name"
       const val COLUMN_AGE = "age"
   }

   private const val SQL_CREATE_STUDENTS =
       "CREATE TABLE ${Student.TABLE} (" +
               "${BaseColumns._ID} INTEGER PRIMARY KEY," +
               "${Student.COLUMN_NAME} TEXT," +
               "${Student.COLUMN_AGE} INTEGER)"

   class StudentDbHelper(context: Context) : SQLiteOpenHelper(context, DATABASE_NAME, null, DATABASE_VERSION) {

       override fun onCreate(db: SQLiteDatabase) {
           db.execSQL(SQL_CREATE_STUDENTS)
       }

       override fun onUpgrade(p0: SQLiteDatabase?, p1: Int, p2: Int) {
           TODO("Not yet implemented")
       }

       companion object {
           const val DATABASE_VERSION = 1
           const val DATABASE_NAME = "Student.db"
       }
   }
}

MainActivity.kt

package com.example.daniwedblivedebug

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle

class MainActivity : AppCompatActivity() {

   private val dbHelper = StudentContract.StudentDbHelper(this)

   override fun onCreate(savedInstanceState: Bundle?) {
       super.onCreate(savedInstanceState)
       setContentView(R.layout.activity_main)
       dbHelper.readableDatabase
   }

   override fun onDestroy() {
       dbHelper.close()
       super.onDestroy()
   }
}
Summary

Congratulations, you have learned how to create a SQLite database and use the Database Inspector tool. The full project code can be found here: https://github.com/dmitrilc/DaniweDBLiveDebug/tree/master

Node.js Vs. Python: Pros, Cons, and Use Cases

When choosing a programming language for the backend development, your choice determines how the product will operate, scale, and fulfill user demands.

One of the most common is the dilemma of Node.js vs. Python. The two options are hugely popular and have their pros and cons. We work with both and are here to compare their advantages and disadvantages and help you to decide which one is better for your project.

How to Create High Order Components With Angular

I was working with React Projects for a long time. I have evolved a mindset that allows you to abuse HOC to make code more reusable and somewhat clean. But when I got into Angular, it felt weird at first that there is no such concept.

The Spark

At some point, I got in touch with Modals and there it was the gong that awoke the ninja in me. First, I dove again into angular.io docs and indeed found a way to pass components through @Input() and render them. But that was unsatisfying because of the directive. That could be because decorators are something new after React. Or because it splits such a simple concept as HOC into too many files.

Radio Station PRO Launches, Offers New Tools for Live Broadcasters

In June, netmix® CEO Tony Zeoli began touting the release of the company’s Radio Station PRO plugin. It would offer an upgraded experience over the free version his team had maintained since 2019. At the end of last month, the company officially launched its commercial offering, a plan that had been in the works since the beginning.

The commercial plugin was built for live audio broadcasters with a rolling show schedule. Its audience ranges from radio stations to live streamers to Clubhouse moderators. It allows listeners to browse generated show and team pages, playlists, and related information uninterrupted during a live stream. The goal is to create a more efficient scheduling and streaming system, saving broadcasters time and resources.

Nikki Blight created the original Radio Station plugin but had stopped working on it in 2015. Zeoli adopted it in 2019 and picked up Tony Hayes to handle its development.

“When I first stumbled onto Radio Station at WPVM, I saw the potential for broadcasters wrapped up in one free plugin that had been orphaned,” said Zeoli. “It just needed someone who could re-commit to it and bring it back to life. And it would surely help if they had an interest in streaming radio and broadcasting, which the other Tony and I both do. I don’t think just anyone could have taken it over. It had to be someone with a passion and interest in the space.”

The two did not launch with a free product. However, Zeoli said he realized the potential for a commercial version quickly after taking over the plugin.

PRO Plugin Upgrades

Table view of schedule and player from Radio Station PRO demo.

The team had several features they had wanted to improve over the free version. The first order of business was improving the scheduling experience. For the free plugin, the team created a conflict catcher. However, they built a front-end visual schedule editor for the commercial version.

“Another issue we needed to resolve was the audio player experience,” said Zeoli. “Radio Station free has a simple audio player widget that we created earlier this year. What really sets the PRO version apart here is the addition of a persistent (or ‘sticky’) header or footer player, so when the listener navigates the website while the stream is activated, playback is not interrupted.”

Hayes created a second plugin called Teleporter to handle the persistent player. The free, WordPress.org-hosted extension is baked into Radio Station PRO, but it is open for other developers in their applications.

The team also tried to tackle time zone issues in the global broadcasting world. PRO adds a switcher to help visitors set the schedule to their preferred time zone instead of performing “brain gymnastics,” as Zeoli joked.

The plugin’s widgets automatically refresh and dynamically display data, such as the next song in a playlist or a show title change. The hope is to bring this technology to the block world, but it must wait until next year. Zeoli said there is not a rush because most of their users are not there yet.

The team has added a new episodes post type alongside the plugin’s original shows and playlists. Eventually, they plan to allow broadcasters to further break that down into segments. Radio Station PRO tacks on host and producer profile pages. It also has a built-in role manager, extended scheduling period, and additional layout views.

Some of the toughest competition in the space is against the commercial theme market. There are several live-broadcasting themes, but Zeoli says these can be both cost-prohibitive in the long term and lock users into a design that users may not want in the future.

“With so much data going into the Post Types, you really don’t want to leave that in a theme if you want to switch for some reason,” he said. “Unlike SEO plugins, there are no conversion plugins for radio station themes or plugins, so it could pose a problem by being locked into a theme as opposed to having the flexibility of a theme-agnostic plugin.”

From Boston to Asheville: A Lifetime of Radio

“I’m originally from Boston, where my interest in radio evolved at an early age into a career as a nightclub and mix show DJ,” said Zeoli. “I listened to the radio all the time; news, talk, sports, and music, I was into it all. As I got older, I tuned in to college radio, and, as a senior in high school, I got the chance to intern at a local AM station and did guest mix sets on the largest commercial station, KISS 108.”

He completed a two-year degree in Radio and Television broadcasting at a small school outside New York City. Then, returned home to Boston with a focus on DJing while working at record stores. He later moved on to work at a record label and DJ remix service.

“It was the early days of the World Wide Web,” said Zeoli. “And I saw the opportunity to marry my passion for DJing with streaming media and launched my first startup, netmix.com, which was the earliest effort to stream DJ sets from popular electronic music and hip-hop DJs.”

He moved netmix® to New York City, and the company was acquired by Polyverse, Inc in 2000. The company ceased operations during the dot-com crash, but Zeoli retained the domain name for 19 years.

After bouncing between various corporations and startups, he dove deeper into WordPress. He had stumbled upon it while working on a project for the Associated Press in 2003.

“That led to launching Digital Strategy Works, a WordPress and digital strategy agency (which I still run today), founding the WordPress Westchester Meetup, and presenting at early WordCamps in NYC and Raleigh, NC.”

A chance encounter in Raleigh landed him a WordPress-specific job at the University of North Carolina at Chapel Hill. Some work at a large corporation followed, and he finally migrated to Asheville, NC.

“I got back into radio to re-engage in and merge my love of broadcasting with DJing with a new mix show, the Asheville House Music Society,” said Zeoli. “I was certainly getting back in the groove of broadcasting and streaming.”

In the spring of 2019, he had been helping with the WPVM website, which was using the original Radio Station plugin. He contacted Blight, the owner, after finding a theme conflict. He soon adopted the project, found a partner in Hayes, and had a new use for his decades-old domain.

“I just thought it was a very useful plugin and could see the groundbreaking potential for radio stations that really needed a comprehensive set of WordPress tools to help them publish search engine optimized content on their WordPress websites, but in a way that fit the station schedule formatting,” said Zeoli. “I figured, given my decades-long interest in and experience with streaming and broadcasting when combined with my agile product development experience, I could find a way to keep it going.”

New Block Plugin Displays Post Formats

Are you using post formats? Now there’s a block for that! WordPress’ post formats feature was introduced in version 3.1 as a way for themes to customize presentation of a post. It allows users to choose the way a post looks by selecting a post format from a dropdown list. WordPress has a fixed list of post formats available but not all themes support them.

Post formats have maintained a smaller cult following. While I don’t see them making a major comeback, many users who committed to using them long ago would like to continue.

WordPress Core Committer Aaron Jorbin has created a plugin called Post Format Block that will display a post format in a block-based theme. His writeup dives deeper into the technical details of how he created the plugin. The block allows users to change the color, font size and weight of the displayed post format.

Post Format Block plugin

Jorbin said he built the plugin to display post formats on his personal site and wanted to help others do the same.

“As someone that benefits greatly from Open Source, I view it as my responsibility to give back and it wasn’t much effort to build it in a way that it could be open from the start,” Jorbin said. “Plus it gave me a chance to play with codespaces and explore some parts of Gutenberg I wasn’t as familiar with.”

Are post formats relevant in the new frontier of blocks, where users have more control over the presentation of posts than ever before? They may not have a strong future in WordPress moving forward, but thanks to the plugin system, people can keep using them while using a block-based theme.

“I think Post Formats are in a weird position since looking back with hind sight, I don’t think they should have been a part of core,” Jorbin said. “But for now, they remain in core and they are useful for me in this instance. I like them since for my personal site, they make sense. But I don’t think they make sense on a lot of sites.”

If you are using post formats and you want to be able to keep using them with a block-based theme, this plugin will give you that continuity. You will want to search for it using the name of it in quotes. (Otherwise you will be scrolling a long time to try to find it.) Post Format Block is available for free in the WordPress plugin directory but it requires some code that isn’t in WordPress 5.8 to work. You will have to use the nightly build until 5.9 is released. The plugin is also available on GitHub for contribution or testing with Codespaces.

From TDD to PBT via Kotest

In this post, we see how to integrate PBT into your Kotlin tests.

Introduction

I’ve been a big fan of Property Based Testing for a number of years, based on my experiences with ScalaCheck. It’s always been an annoyance that Kotlin did not support this testing style, at least to the same extent. There was some functionality in Kotest (formerly KotlinTest), but it paled in comparison to what was available in Scala, F# and Python.

Logic Behind Software — allMatch On Empty Stream

Basically, it works this way because of the logic concept called Vacuous truth. It is a simple and short answer but because we do not like such answers, we will dive deeper. But why I even decided to write about such a niche topic. For some time, I have been interested in how mathematics affects the software engineering world directly, and I have even written an article about calculating scalability. I believe such niche topics can be quite an interesting thing for you.

We will start by shortly presenting the main problem described in today's text.

How to Build HTML Forms Right: Security

While many guides to creating forms for the web are mainly focused on the frontend, security goes beyond that. We have to consider the current user, other users, and our own security. As such, we will look at the whole application architecture from frontend to backend and beyond.

Encrypt Traffic (SSL)

Before we get too far, I will be using the term “SSL” to refer to a technology used to encrypt traffic on the internet. Technically, I mean Transport Layer Security (TLS), but “SSL” is commonly used and understood to mean the same thing. It’s what gives websites the little green lock in the URL bar and why they start with “https” instead of “http” (no “s”). 

Tutorial: How to Define SQL Functions With Presto Across All Connectors

Presto is the open-source SQL query engine for data lakes. It supports many native functions which are usually sufficient for most use cases. However, there is maybe a corner case where you need to implement your own function. To simplify this, Presto allows users to define expressions as SQL functions. These are dynamic functions separated from the Presto source code, managed by a functions namespace manager that you can set up with a MySQL database. In fact, this is one of the most widely used features of Presto at Facebook, with over 1000s of functions defined.

Function Namespace Manager

A function namespace is a special catalog.schema that stores functions in the format like mysql.test. Each catalog.schema can be a function namespace. A function namespace manager is a plugin that manages a set of these function catalog schemas. The catalog can be mapped to connectors in Presto (a connector for functions, no tables or view) and allows the Presto engine to perform actions such as creating, altering, and deleting functions.

PyTorch Lightning Tutorial: Using TorchMetrics and Lightning Flash

TorchMetrics unsurprisingly provides a modular approach to define and track useful metrics across batches and devices, while Lightning Flash offers a suite of functionality facilitating more efficient transfer learning and data handling, and a recipe book of state-of-the-art approaches to typical deep learning problems.

We’ll start by adding a few useful classification metrics to the MNIST example we started with earlier. We’ll also swap out the PyTorch Lightning Trainer object with a Flash Trainer object, which will make it easier to perform transfer learning on a new classification problem. We’ll then train our classifier on a new dataset, CIFAR10, which we’ll use as the basis for a transfer learning example to CIFAR100.