Open-source News

CrossOver 21.2 Released With Fixes For Halo: Master Chief, Microsoft Office 365 On Linux

Phoronix - Tue, 03/22/2022 - 23:48
CodeWeavers is out today with CrossOver 21.2 as the newest version of their commercial downstream based on Wine that offers Windows application and game support across Linux, macOS, and Chrome OS...

How To Use The New AMD P-State Driver With Linux 5.17

Phoronix - Tue, 03/22/2022 - 19:39
Since the release of the Linux 5.17 kernel the leading question in my inbox has been from readers asking how to actually make use of the AMD P-State driver. Right now this driver isn't the default over ACPI CPUFreq and I haven't seen any Linux distribution vendors announce their plans to immediately default to this new driver, but over the months ahead I expect that to change. In any case, if wanting to use amd_pstate on Linux 5.17 today here is a brief how-to guide for making the transition...

Ubuntu 22.04 LTS Will Default To Wayland With NVIDIA For v510+ Driver

Phoronix - Tue, 03/22/2022 - 18:30
A change that had been expected but finally buttoned up in time for next month's Jammy Jellyfish release: Ubuntu 22.04 LTS will now default to using the GNOME Wayland session when running the NVIDIA proprietary driver. The caveat/limitation is that's only the case when using the NVIDIA 510 series driver or newer and not when using any of the older legacy driver branches...

An Exciting Btrfs Update With Encoded I/O, Fsync Performance Improvements

Phoronix - Tue, 03/22/2022 - 18:11
SUSE's David Sterba on Monday submitted the Btrfs file-system updates for the in-development Linux 5.18 kernel...

Linux 5.18 Re-Enables Intel ENQCMD Usage In Time For Sapphire Rapids

Phoronix - Tue, 03/22/2022 - 17:54
Going back to 2019 the open-source ecosystem has been working on ENQCMD/ENQCMDS support for introduction with Xeon Scalable "Sapphire Rapids" as part of the Data Streaming Accelerator work. ENQCMD support was added to the Linux kernel but last June was outright disabled for being "broken beyond repair". It's now managed to be repaired and for Linux 5.18 this instruction usage is being re-enabled...

GNU Linux-Libre 5.17 Released For Free Software Purists

Phoronix - Tue, 03/22/2022 - 17:11
GNU Linux-Libre 5.17 is out as the downstream flavor of Linux 5.17 that strips out code/support depending upon closed-source microcode or other non-free fragments as well as removing the ability to load proprietary kernel modules...

Get started with reactive programming with Kotlin on Quarkus

opensource.com - Tue, 03/22/2022 - 15:00
Get started with reactive programming with Kotlin on Quarkus Daniel Oh Tue, 03/22/2022 - 03:00 Up Register or Login to like.

Moving to the cloud with event-driven architecture raises big concerns for enterprises using multiple programming languages such as Java, C#, JavaScript, Scala, and Groovy to implement business requirements. Because enterprises need to redesign multiple architectures for container deployment separately and put more effort into optimizing production on the cloud, developers often must learn a new programming language in line with the production environment. For example, Java developers have to switch their skill sets to Node.Js to develop lightweight event-front applications.

Kotlin addresses these issues and targets various developers who deploy business applications with multiple programming languages on top of Java Virtual Machine (JVM). Kotlin handles these issues with both imperative and reactive approaches. However, there's still a hustle to catch up on Kotlin's new syntax and APIs, especially for Java developers. Luckily, the Quarkus Kotlin extension makes it easier for developers to implement Kotlin applications.

Explore the open source cloud Free online course: Developing cloud-native applications with microservices arc… eBook: Modernize your IT with managed cloud services Try for 60 days: Red Hat OpenShift Dedicated What is Kubernetes? Understanding edge computing Latest articles for IT architects Create a new Kotlin project using Quarkus CLI

I'll create a new maven project using the Quarkus command line as an example. The following command adds Quarkus extensions to enable RESTEasy Reactive, Jackson, and Kotlin extensions:

$ quarkus create app reactive-kotlin-example -x kotlin,resteasy-reactive-jackson

The output should look like this:

...
[SUCCESS] ✅  quarkus project has been successfully generated in:
--> /Users/danieloh/Downloads/demo/reactive-kotlin-example
...

Next, I'll use Quarkus Dev Mode, which enables live coding to resolve the performance issue in the inner loop development. It simplifies the development workflow from writing code to accessing the endpoint or refreshing a web browser without recompiling and redeploying cycle. Run the following commands:

$ cd reactive-kotlin-example
$ quarkus dev

The output should look like this:

...
INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, kotlin, resteasy-reactive, resteasy-reactive-jackson, smallrye-context-propagation, vertx]

--
Tests paused
Press [r] to resume testing, [o] Toggle test output, [:] for the terminal, [h] for more options>Make Kotlin behave the Quarkus way

Kotiln provides a coroutine to run a block of code concurrently, similar to a thread in Java. The coroutine can be suspended in one thread then resume in another thread. Quarkus enables developers to compose suspending functions.

Open the ReactiveGreetingResource.kt file in src/main/kotlin/org/acme directory to replace the hello() method with the following code:

@GET
@Produces(MediaType.TEXT_PLAIN)
suspend fun hello() = "Hello RESTEasy Reactive by Kotlin Suspend function"

Note: This resource file is generated automatically while you create a new Kotiln project using the Quarkus CLI.

Make sure to access the RESTful API (/hello) if the new suspend function works in the Quarkus development environment. Execute the following curl command line in your local terminal, or you can also access the endpoint URL using a web browser:

& curl localhost:8080/hello

The output should look like this:

Hello RESTEasy Reactive by Kotlin Suspend function

Great! It works well. Now I'll enable Java's Context and Dependency Injection (CDI) capability in the Kotlin application.

Enable CDI injection in the Kotlin application

Reflections and annotations in Kotlin are different from how Java initializes properties. It probably causes developers to have an issue (e.g., UninitializedPropertyAccessException). Before enabling CDI injection in code, create a new GreetingService.kt service file in the src/main/kotlin/org/acme directory:

@ApplicationScoped
class GreetingService {

    fun greeting(name: String): String {
        return "Welcome Kotlin in Quarkus, $name"
    }

}

Go back to the ReactiveGreetingResource.kt file. Add the following code to use @Inject annotation for adopting Kotlin annotation and reflection by @field: Default:

@Inject
@field: Default
lateinit var service: GreetingService

@GET
@Produces(MediaType.TEXT_PLAIN)
@Path("/{name}")
fun greeting(@PathParam("name") name: String): String {
    return service.greeting(name)
}

Access the new endpoint (/hello/{name}) if the CDI injection works. Execute the following curl command in the local terminal, or access the endpoint URL using a web browser:

& curl localhost:8080/hello/Daniel

The output should look like this:

Welcome Kotlin in Quarkus, DanielWrap up

You learned how Quarkus enables developers to keep using Kotlin programming APIs for reactive Java applications. Developers benefit from features such as dev services and live coding. They also increase the performance for the cloud environment deployment through a native executable. In another article, I'll show how to develop data transaction features using Kotlin with Quarkus.

Learn how Quarkus enables developers to keep using Kotlin programming APIs for reactive Java applications.

Image by:

Opensource.com. CC BY-SA 4.0

Java Cloud Programming Containers What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Best Lightweight Linux Distributions For Older Computers

Tecmint - Tue, 03/22/2022 - 13:13
The post Best Lightweight Linux Distributions For Older Computers first appeared on Tecmint: Linux Howtos, Tutorials & Guides .

Lightweight Linux distributions share similar characteristics with their desktop-oriented counterparts. They give us the best of both worlds, but with a slightly modified user experience. They’re easy to install and use, but offer just

The post Best Lightweight Linux Distributions For Older Computers first appeared on Tecmint: Linux Howtos, Tutorials & Guides.

Linux 5.18 Unifying Two More Portions Of AMD & Intel Code

Phoronix - Tue, 03/22/2022 - 12:00
Thanks to the nature of open-source and independently-controlled projects like the Linux kernel, there is already much code sharing among competitive hardware vendors in areas where applicable. Much of the Linux kernel's x86/x86_64 code is shared between AMD and Intel (and VIA, Centaur, and Hygon for that matter) where relevant while due to different supported features and implementation differences there is divergence at times. With Linux 5.18 there are two features currently with unique AMD and Intel code paths that are working towards more unification...

Pages