Open-source News

Make your own music tagging framework with Groovy

opensource.com - Wed, 08/31/2022 - 15:00
Make your own music tagging framework with Groovy Chris Hermansen Wed, 08/31/2022 - 03:00 1 reader likes this 1 reader likes this

In this series, I'm developing several scripts to help in cleaning up my music collection. In the last article I wrote and tested a Groovy script to clean up the motley assembly of tag fields. In this article, I'll separate the framework I've been using into a separate class and then write a test program to exercise it.

Install Java and Groovy

Groovy is based on Java and requires a Java installation. Both a recent and decent version of Java and Groovy might be in your Linux distribution's repositories. Groovy can also be installed following the instructions on the Groovy homepage. A nice alternative for Linux users is SDKMan, which can be used to get multiple versions of Java, Groovy and many other related tools. For this article, I'm using SDK's releases of:

  • Java: version 11.0.12-open of OpenJDK 11;
  • Groovy: version 3.0.8.
Back to the problem

If you haven't read parts 1-5 of this series, do that now so you understand the intended structure of my music directory, the framework created in that article and how we pick up FLAC, MP3 and OGG files.

The framework class

As I have mentioned a number of times, because of the music directory structure, we have a standard framework to read the artist subdirectories, the album sub-subdirectories, the music, and other files contained within. Rather than copying that code into each script, you should create a Groovy class that encapsulates the general framework behavior and delegates the application-specific behavior to scripts that call it.

More on Java What is enterprise Java programming? Red Hat build of OpenJDK Java cheat sheet Free online course: Developing cloud-native applications with microservices Fresh Java articles

Here's the framework, moved into a Groovy class:

 1    public class TagAnalyzerFramework {
   
 2        // called before any data is processed
 3        Closure atBeginning
   
 4        // called for each file to be processed
 5        Closure onEachLine
   
 6        // called after all data is processed
 7        Closure atEnd
   
 8        // the full path name to the music library
 9        String musicLibraryDirName
   
10        public void processMusicLibrary() {
11            // Before we start processing...
12            atBeginning()
13            // Iterate over each dir in music library
14            // These are assumed to be artist directories
 
15            new File(musicLibraryDirName).eachDir { artistDir ->
   
16                // Iterate over each dir in artist dir
17                // These are assumed to be album directories
18                artistDir.eachDir { albumDir ->
19                    // Iterate over each file in the album directory
20                    // These are assumed to be content or related
21                    // (cover.jpg, PDFs with liner notes etc)
22                    albumDir.eachFile { contentFile ->
   
23                        // Then on each line...
24                        onEachLine(artistDir, albumDir, contentFile)
25                    }
26                }
27            }
28            // And before we finish...
29            atEnd()
30        }
31    }

Line 1 introduces the public class name.

Lines 2-7 declare the three closures that the application script uses to define the specifics of the processing needed. This is called delegation of behavior.

Lines 8-9 declare the string holding the music directory file name.

Lines 10-30 declare the method that actually handles the processing.

Line 12 calls the Closure that is run before any data is processed.

Lines 15-27 loop over the artist/album/content file structure.

Line 24 calls the Closure that processes each content file.

Line 29 calls the Closure that is run after all data is processed.

I want to compile this class before I use it, as follows:

$ groovyc TagAnalyzerFramework.groovy$

That's it for the framework.

Using the framework in a script

Here's a simple script that prints out a bar-separated value listing of all the files in the music directory:

 1  int fileCount
 
 2  def myTagAnalyzer = new TagAnalyzerFramework()
 
 3  myTagAnalyzer.atBeginning = {
 4      // Print the CSV file header and initialize the file counter
 5      println "artistDir|albumDir|contentFile"
 6      fileCount = 0
 7  }
 
 8  myTagAnalyzer.onEachLine = { artistDir, albumDir, contentFile ->
 9      // Print the line for this file
10      println "$artistDir.name|$albumDir.name|$contentFile.name"
11      fileCount++
12  }
 
13  myTagAnalyzer.atEnd = {
14      // Print the file counter value
15      System.err.println "fileCount $fileCount"
16  }
 
17  myTagAnalyzer.musicLibraryDirName = '/home/clh/Test/Music'
 
18  myTagAnalyzer.processMusicLibrary()

Line 1 defines a local variable, fileCount, used to count the number of content files. Note that this variable doesn't need to be final.

Line 2 calls the constructor for the TagAnalyzerFramework class.

Line 3 does what looks like a mistake in Java. It appears to refer to a field in a foreign class. However, in Groovy this is actually calling a setter on that field, so it's acceptable, as long as the implementing class "remembers" that it has a contract to supply a setter for this property.

Lines 3-7 create a Closure that prints the bar-separated value header and initialize the fileCount variable.

Lines 8-12 similarly define the Closure that handles the logic for processing each line. In this case,it is simply printing the artist, album and content file names. If I refer back to line 24 of TagAnalyzerFramework, I see that it calls this Closure with three arguments corresponding to the parameters shown here.

Lines 13-16 define the Closure that wraps up the processing once all the data is read. In this case, it prints a count of files to standard error.

Line 17 sets the music library directory name.

And line 18 calls the method to process the music library.

Run the script:

$ groovy MyTagAnalyzer.groovy
artistDir|albumDir|contentFile
Bombino|Azel|07_Igmayagh_Dum_1.6.16.mp3
Bombino|Azel|08_Ashuhada_1.6.16.mp3
Bombino|Azel|04_Tamiditine_Tarhanam_1.6.16.mp3
Bombino|Azel|10_Naqqim_Dagh_Timshar_1.6.16.mp3
[...]
St Germain|Tourist|04_-_St Germain_-_Land Of....flac
fileCount 55
$

Of course the .class files created by compiling the framework class must be on the classpath for this to work. Naturally, I could use jar to package up those class files.

Those who are made queasy by what looks like setting fields in a foreign class could define local instances of closures and pass those as parameters, either to the constructor or processMusicLibrary(), and achieve the same effect.

I could go back to the code samples provided in the earlier articles to retrofit this framework class. I'll leave that exercise to the reader.

Delegation of behavior

To me, the coolest thing happening here is the delegation of behavior, which requires various shenanigans in other languages. For many years, Java required anonymous classes and quite a bit of extra code. Lambdas have gone a long way to fixing this, but they still cannot refer to non-final variables outside their scope.

That's it for this series on using Groovy to manage the tags in my music library. There will be more Groovy articles in the future.

I'll separate the framework I've been using into a separate class and then write a test program to exercise it.

Image by:

Opensource.com

Java Audio and music What to read next How I analyze my music directory with Groovy My favorite open source library for analyzing music files How I use Groovy to analyze album art in my music directory Clean up unwanted files in your music directory using Groovy Clean up music tags with a Groovy script This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

How we track the community health of our open source project

opensource.com - Wed, 08/31/2022 - 15:00
How we track the community health of our open source project Ruth Cheesley Wed, 08/31/2022 - 03:00 1 reader likes this 1 reader likes this

To be an effective leader in an open source community, you need a lot of information. How do I know who the most active members in my community are? Which companies are making the most contributions? Which contributors are drifting away and becoming inactive? Who in the community is knowledgeable about a specific topic?

These were just a few of the questions I had when I started leading the Mautic community at Acquia. But the problem was not a shortage of information. On the contrary, there were so many places our community interacted and so many things to track that I was drowning in data. I could access plenty of data sources, but they were not helping me manage the community effectively or answering my questions.

Tracking all the places

I needed to find a tool to bring all of this together and give the community leadership team a centralized place to see activity everywhere we have people discussing Mautic. More importantly, we needed a tool that could accurately track who was contributing in every way that we defined contributions.

I tried several tools, but the most promising was the open source Community Relationship Manager Savannah CRM, a relative newcomer to the market. What stood out to me in Savannah was its focus on contribution as well as community health. Other tools I reviewed either did not have a clear concept of contributions or did not cover all the places we wanted to track.

I started working locally by checking out the GitHub repository for the Django-based application and quickly began to see the power of bringing all of my metrics into one place. Straight away, I could see a list of new contributors, most active community members, organizations, and even an interactive display allowing me to see how contributors were connected with each other and across the different channels we use.

Image by:

(Michael Hall, CC BY-SA 4.0)

In the early days of using Savannah, this function helped identify potential leaders for teams and initiatives. The tagging feature also meant I could quickly find out who was talking about a specific topic and where those conversations were happening in the community.

As the community matured, notifications alerting me to contributors becoming inactive started to be really helpful in prompting a personal check-in with them. Using projects to track activity and contributor funnels in specific areas of our community has helped us spot where contributions are dropping off. Having the ability to "watch" community members who previously breached the code of conduct made it much easier to keep track of their future conduct and act swiftly if there were more incidents.

Over time we have moved to a hosted plan (mainly because we don't have the contributors to manage our own infrastructure at this time) and have continued to extend how we are using this tool.

It's really at the heart of everything we do in our community, and it helps me proactively manage our community. It supports everything from my monthly recognition shout-outs to determining whether an organization has a sustained history of contributing that would entitle them to become—and remain—a Community Partner.

More great content Free online course: RHEL technical overview Learn advanced Linux commands Download cheat sheets Find an open source alternative Explore open source resources Tracking all the open source contributions

Over the last two years, we have expanded what we track as a contribution in Mautic. Currently, the list includes:

  • Authoring a blog post on mautic.org
  • Creating a community-focused podcast episode
  • Making a pull request (PR) on any of our GitHub repositories
  • Reviewing a PR on any of our GitHub repositories
  • Completing a Jira issue on any of our Jira projects
  • Providing help or feedback on Slack
  • Having an answer accepted as a solution on the Discourse forums
  • Giving help on a Reddit thread
  • Organizing or speaking at an official Mautic event
  • Organizing or speaking at a Meetup
  • Having an answer to a question accepted on Stack Exchange

Most of these are available out of the box with Savannah, but some, such as reviewing a PR or completing a Jira issue, we implemented with the application programming interface (API) and integrations with automation tools.

We also track and highlight the folks who support and engage with others before they contribute, since this often helps the individual make that contribution in the future.

Tracking progress over time

We have several publicly shared reports, including:

Any report in Savannah and any screen can be shared publicly, making it a really easy way to share things with others.

Image by:

(Ruth Cheesley, CC BY-SA 4.0)

For us, it allows folks to see what is happening within the community and also offers a public way to recognize the organizations and individuals who are consistently contributing or engaging in the community.

New features in Savannah

We have experimented with some of the newer features in Savannah, such as tracking when we send swag to contributors and whether it affects future contributions. Another feature I am excited to look into allows us to flag a potential contributor opportunity—for example, if we come across someone we would like to support with writing for the blog, creating a meetup group, or submitting a new feature. Savannah then allows us to track the nurturing of that contributor.

There are often new features being added, which is great to see. Because it is an open source project, you can, of course, make your own PR to implement new features or fix bugs you come across.

So far, Savannah has been an excellent tool for tracking our community health in the Mautic community, and it has really helped us both track and recognize contributions across our far-reaching community. I hope that you find it useful in your communities too!

Mautic chose Savannah CRM to support community building and recognition efforts.

Image by:

Opensource.com

Community management What to read next 3 metrics to measure your open source community health Analyze community health metrics with this open source tool This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Open 3D Foundation (O3DF) Announces Keynote Lineup for O3DCon—Online and In-Person in Austin, October 17-19

The Linux Foundation - Wed, 08/31/2022 - 06:14

Keynotes, workshops and sessions will explore innovations in open source 3D development and use of Open 3D Engine (O3DE) for gaming, entertainment, metaverse, AI/ML, healthcare applications and more

SAN FRANCISCO—August 30, 2022—The Open 3D Foundation (O3DF) today announced a slate of keynote speakers for O3DCon, its flagship conference, which will be held October 17-19 in Austin, Texas and online. O3DCon will bring together technology leaders, indie developers and academia to share ideas and best practices, discuss hot topics and foster the future of 3D development across a variety of industries and disciplines. The schedule is available at https://events.linuxfoundation.org/o3dcon/program/schedule/

Industry luminaries will headline the keynote sessions, including:

  • Bill Vass, vice president of engineering, Amazon Web Services
  • Bryce Adelstein Lelbach, principal architect, NVIDIA and standard C++ Library Evolution chair, “C++ Horizons”
  • Deb Nicholson, executive director, Python Software Foundation and founding board member, SeaGL (the Seattle GNU/Linux Conference), “Open Source is a Multiplier”
  • Denis Dyack, founder, Apocalypse Studios, “The Successes, Challenges and Future of O3DE”
  • Mathew Kemp, game director, Hadean, “Supercharging Gameworld Performance Using the Cloud”
  • Nithya Ruff, head, Open Source Program Office, Amazon and chair, Linux Foundation Board of Directors, “Game On! How to Be a Good Open Source Citizen” 
  • Omar Zohdi, technical ecosystem manager, Imagination Technologies, “O3DE and the Future of Mobile Graphics Development”
  • Royal O’Brien, executive director, Open 3D Foundation and general manager of Digital Media & Games, Linux Foundation, “State of the Open 3D Foundation”
  • Sheri Graner Ray, CEO and founder, Zombie Cat Studios, “How Big Is Your Dream? Rethinking the Role of Passion in Development”
  • Stephen Jacobs, director of Open@RIT and professor at the School of Interactive Games and Media, Rochester Institute of Technology, “Open in Academia, Science and Why O3DE Should Be Part of It All”

Early Bird Registration Ends September 16
Register today at https://events.linuxfoundation.org/o3dcon/register/. Organizations interested in sponsorships can contact sponsorships@linuxfoundation.org.

“After celebrating our first year in July and recognizing the immense growth of our community, we’re excited to connect with them at this year’s O3DCon,” said Royal O’Brien, executive director of O3DF. “Since O3DF’s inception, we’ve grown to 25 member companies, including Epic Games, LightSpeed Studios and Microsoft, and we’ve announced a new O3DE release. This year’s O3DCon will feature a diversity of use cases that go way beyond gaming, including metaverse, cloud, open source licensing, digital twin in healthcare and lots more. If your organization is building 3D stacks for a new generation of applications, O3DCon is an event designed to help you get there.”

The three-day O3DCon conference schedule will also include sessions, lightning talks, panel discussions and exhibits exploring innovations and best practices in open 3D development, open source licensing, interoperability across 3D engines and the benefits of using O3DE to revolutionize real-time 3D development. Sessions of note include:

Attendees can also participate in a slate of hands-on workshops and training sessions on the first day of the conference, October 17.

About the Open 3D Engine (O3DE) Project
O3DE is the flagship project managed by the O3DF. The open source project is a modular, cross-platform 3D engine built to power anything from AAA games to cinema-quality 3D worlds to high-fidelity simulations. The code is hosted on GitHub under the Apache 2.0 license. The O3D Engine community is very active, averaging up to 2 million line changes and 350-450 commits monthly from 60-100 authors across 41 repos. To learn more, please visit o3de.org and get involved and connect with the community on Discord.com/invite/o3de and GitHub.com/o3de.

About the Open 3D Foundation (O3DF)
Established in July 2021, the mission of the O3DF is to make an open source, fully-featured, high-fidelity, real-time 3D engine for building games and simulations, available to every industry. The O3DF is home to the O3DE project. To learn more, please visit o3d.foundation.

About the Linux Foundation
Founded in 2000, the Linux Foundation and its projects are supported by more than 2,950 members. The Linux Foundation is the world’s leading home for collaboration on open source software, hardware, standards and data. Linux Foundation projects are critical to the world’s infrastructure including Linux, Kubernetes, Node.js, ONAP, Hyperledger, RISC-V and more. The Linux Foundation’s methodology focuses on leveraging best practices and addressing the needs of contributors, users and solution providers to create sustainable models for open collaboration. 

For more information, please visit us at linuxfoundation.org

Media Inquiries:

pr@o3d.foundation

# # #

The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our trademark usage page: https://www.linuxfoundation.org/trademark-usage. Linux is a registered trademark of Linus Torvalds.

The post Open 3D Foundation (O3DF) Announces Keynote Lineup for O3DCon—Online and In-Person in Austin, October 17-19 appeared first on Linux Foundation.

Google Chrome 105 Released With HTML Sanitizer API, Container Queries & More

Phoronix - Wed, 08/31/2022 - 04:30
Google engineers today promoted Chrome 105 to their stable channel across Linux, macOS, Windows, and Android platforms...

Intel Meteor Lake Thunderbolt Support Slated For Linux 6.1

Phoronix - Wed, 08/31/2022 - 02:00
The latest Linux hardware enablement work to report on for Intel's Meteor Lake client platform is Thunderbolt support being queued ahead of the Linux 6.1 merge window...

LFPH Tackles the Next Frontier in Open Source Health Technology: The Rise of Digital Twins

The Linux Foundation - Tue, 08/30/2022 - 23:11

This post originally appeared on the LF Pubic Health’s blog. The author, Jim St. Clair, is the Executive Director. With the Digital Twin Consortium, Academic Medical Centers and other LF projects, Linux Foundation Public Health addresses open software for next generation modeling

Among the many challenges in our global healthcare delivery landscape, digital health plays an increasingly important role on almost a daily basis, from personal medical devices, to wearables, to new clinical technology and data exchanges. Beyond direct patient care, digital health also applies to diagnostics, drug effectiveness, and treatment delivery. These use cases are being driven by rapid growth in data modeling, artificial intelligence (AI)/machine learning (ML), and data visualization. Given the rapid digitalization of healthcare delivery, emerging digital twin technology is considered the next system that will advance further efforts in medical discoveries and improve clinical and public health outcomes.

What is a Digital Twin?

Put simply, a digital twin is a digital replica or “twin” of a physical object, process, or service. It is a virtual model (a compilation of data plus algorithms) that can dynamically pair the physical and digital worlds. The ultimate goal for digital twins, such as in manufacturing, is to iteratively model, test, and optimize a physical object in the virtual space until that model meets expected performance, at which point it is then ready to be built or enhanced (if already built) in the physical world. To create a pairing between the digital world and the real world, a digital twin leverages real time data, such as smart sensor technology, coupled with analytics, and often artificial intelligence (AI) in order to detect and prevent system failures, improve system performance, and explore innovative uses or functional models.

As mentioned, developments in smart sensor technologies and wireless networks have pushed forward the applications of the Internet of Things (IoT), and contributed to the practical applications of digital twin technology. Thanks to IoT, cloud computing and real time analytics, digital twins can now be created to collect much more real-world and real-time data from a wide range of sources, and thus can establish and maintain more comprehensive simulations of physical entities, their functionality, and changes they undergo over time.

Digital Twins in Healthcare

While the application of digital twins in healthcare is still very new, there are three general categories for their use: digital twins of a patient/person or a body system; digital twins of an organ or a smaller unit; and digital twins of an organization.

Digital twins can simulate the whole human body, as well as a particular body system or body function (e.g., the digestive system). One example of this kind of patient-sized digital twin is the University of Miami’s MLBox system, designed for the measurement of a patient’s “biological, clinical, behavioral and environmental data” to design personalized treatments for sleep issues.

Digital twins can also simulate one body organ, part of an organ or system, like the heart, and can even model subcellular (organelle/sub-organelle) functions or functions at the molecular level of interest within a cell. Dassault Systèmes’ Living Heart Project is an example of this kind of digital twin, which is designed to simulate the human heart’s reaction to implantation of cardiovascular devices.

Additionally, healthcare institutions (e.g., a hospital) can have their corresponding digital twins, such as Singapore General Hospital. This kind of simulation can be useful when determining environmental risks within institutions, such as the risks of infectious disease transmission.

The “Heart” of Health Digital Twins is Open Source – and the LF

While digital twins represent a complex and sophisticated new digital model, the building blocks of this technology—like all other software foundations—are best supported by an open-source development and governance model. The Linux Foundation sustains the nexus of open source development that underpins digital twin technology:

  • Linux Foundation Public Health (LFPH) is dedicated to advancing open source software development for digital health applications across the globe. Together with its members, LFPH is developing projects that address public health data infrastructure, improving health equity, advancing cybersecurity, and building multi-stakeholder collaboration for patient engagement and health information exchange.
  • The LF AI and Data Foundation is working to build and support an open artificial intelligence (AI) and data community, and drive open source innovation in the AI and data domains by enabling collaboration and the creation of new opportunities for all the members of the community.
  • LF Edge aims to establish an open, interoperable framework for edge computing independent of hardware, silicon, cloud, or operating system. By bringing together industry leaders, LF Edge will create a common framework for hardware and software standards and best practices critical to sustaining current and future generations of IoT and edge devices.
  • The Open 3D Foundation includes many collaborators working to make an open source, fully-featured, high-fidelity, realtime 3D engine for building games and simulations, such as digital twins, available to every industry. “The Open 3D Foundation, along with its partners and community is helping advance 3D digital twin technology by proving an open source implementation that is completely dynamic with no need to preload the media.” said General manager Royal O’Brien, “This can ensure the smallest customizable footprint possible for any device platform to meet any industry needs.”

Additionally, LFPH has established a joint membership with the Digital Twin Consortium, focused on healthcare and life sciences. “Artificial Intelligence (AI), edge computing and digital twins represent the next generation in data transformation and patient engagement,” said Jim St. Clair, Executive Director, “Developing a collaborative relationship with the Digital Twin Consortium will greatly advance the joint efforts of model development and supporting open source components to advance adoption in healthcare through multi-stakeholder collaboration.” LFPH looks forward to supporting, innovating, and driving forward an open-source vision in the critical and growing area of digital twins for healthcare.

The post LFPH Tackles the Next Frontier in Open Source Health Technology: The Rise of Digital Twins appeared first on Linux Foundation.

Fwupd 1.8.4 Supports More Hardware, Starts Allowing To Make BIOS Changes From Linux

Phoronix - Tue, 08/30/2022 - 19:35
Richard Hughes as the lead developer of the Linux Vendor Firmware Service (LVFS) and Fwupd at Red Hat announced the release this morning of Fwupd 1.8.4 as a nice update to this open-source firmware updating utility. Fwupd 1.8.4 not only adds support for some new hardware and fixes but notably begins adding the infrastructure to allow facilitating BIOS changes to the system from within Linux...

Pages