Programming Leftovers
-
Living with the Rust trademark
The intersection of free software and trademark law has not always been smooth. Free-software licenses have little to say about trademarks but, sometimes, trademark licenses can appear to take away some of the freedoms that free-software licenses grant. The Firefox browser has often been the focal point for trademark-related controversy; happily, those problems appear to be in the past now. Instead, the increasing popularity of the Rust language is drawing attention to its trademark policies.
When a free-software project gets a trademark, it is an indication that the name of that project has come to have some sort of value, and somebody (hopefully the people in charge of the project) want to control how it is used. They may want to prevent their project's name being used with versions that have been modified with rent-seeking or malicious features, for example. Other projects might want the exclusive right to market commercial versions of their code under the trademarked name. As a general rule, trademark licenses will restrict the changes to a project's code that can be distributed without changing the name.
As a result of those restrictions, trademark policies can appear to be a violation of free-software principles. But those restrictions apply to the trademarked name, not the code itself; any such restrictions can be avoided just by not using the name. Thus, for some time, Firefox as distributed by Debian was known as "Iceweasel" until 2016; it lacked no functionality and was entirely free software. It is worth noting that version 3 of the GNU General Public License explicitly allows the withholding of trademark rights.
-
Quick Java application setup using Kafka messaging
Apache Kafka is an open source project that supports industrial-strength data streaming in real-time. Kafka can process more than one hundred thousand messages per second. Some companies report the ability to process millions of messages per second.
Kafka is well suited for applications that coordinate rideshare activity, stream videos, and provide real-time fintech. If your application requires a continuous stream of time-sensitive data, Kafka will meet your needs and then some.
As it is with any complex technology, there is a learning curve. This technology requires a general knowledge about building containers and configuring Kafka. In addition, it is essential to learn programming language specifics because you can use Kafka with a variety of languages.
The focus of this article is on building a Java client that can produce and consume data to and from an OpenShift Kafka stream.
This article is the third in a series that delves into the uses of Kafka. A developer's guide to using Kafka with Java, Part 1 covered basic Kafka concepts such as installing Kafka and using the command-line client. The second article, How to create Kafka consumers and producers in Java, describes how to create Java code that interacts directly with a Kafka broker hosted on your local machine.
Now let's go a bit deeper into programming Kafka at the enterprise level. We will adapt the code created in the second article to work with Red Hat OpenShift Streams for Apache Kafka. This technology enables enterprises to work productively with Kafka by avoiding the tedious, detailed labor that goes into supporting a Kafka broker running at web scale.
First, I will provide an overview of OpenShift Streams for Apache Kafka. Then I will describe the mechanics of setting up a stream and demonstrate Java/Maven code that binds to a Kafka instance. This Java code includes tests that produce and consume messages to and from a stream.
-
Creating a Hello World Spring Application
First, we will create a maven project to develop Spring application. We already have covered this topic in our article in creating maven project. You can refer this to get in depth idea of creating maven project if you are not already familiar in: <editor make link for maven article>.
Let’s start with opening the Eclipse and clicking on the File menu. Then, select the maven project like this: File->New->Maven Project
After selecting, it will ask for some details such as project name, app name, version, packaging type, and etc. The packaging specifies final build bundle type of the project. If the application is web app, it should be war (Web Archive).
-
Creating Spring App Using STS
In this article, we will learn to create a spring application using Spring Tool Suit IDE. Spring Tools suit is an official IDE provided by the Spring. You can use it to create Spring application with minimum effort. This IDE is similar to your favourite IDE whether it is Eclipse, IntelliJ IDEA, or others.
When you will visit the site(spring), you will see couple of versions of IDE for different the variety of developers. You can select and download any to your local machine.
-
Managing time with Python
Although this module is always available, not all functions are available on all platforms. Most of the functions defined in this module call platform C library functions with the same name. It may be helpful to consult the platform documentation because these functions’ semantics vary among platforms.
Manage time with the python time module represents time in code, such as objects, numbers, and strings. However, it also provides functionality other than representing time, like waiting during code execution and measuring the efficiency of your code.
-
Not a Yoking Matter (Zero-Copy #1) - In Pursuit of Laziness
This is part 1 of a three-part series on interesting abstractions for zero-copy deserialization I’ve been working on over the last year. This part is about making zero-copy deserialization more pleasant to work with. Part 2 is about making it work for more types and can be found here; while Part 3 is about eliminating the deserialization step entirely and can be found here. The posts can be read in any order, though this post contains an explanation of what zero-copy deserialization is.
-
Manish Goregaokar: Zero-Copy All the Things! (Zero-Copy #2)
For the past year and a half I’ve been working full time on ICU4X, a new internationalization library in Rust being built under the Unicode Consortium as a collaboration between various companies.
There’s a lot I can say about ICU4X, but to focus on one core value proposition: we want it to be modular both in data and code. We want ICU4X to be usable on embedded platforms, where memory is at a premium. We want applications constrained by download size to be able to support all languages rather than pick a couple popular ones because they cannot afford to bundle in all that data. As a part of this, we want loading data to be fast and pluggable. Users should be able to design their own data loading strategies for their individual use cases.
See, a key part of performing correct internationalization is the data. Different locales1 do things differently, and all of the information on this needs to go somewhere, preferably not code. You need data on how a particular locale formats dates2, or how plurals work in a particular language, or how to accurately segment languages like Thai which are typically not written with spaces so that you can insert linebreaks in appropriate positions.
Given the focus on data, a very attractive option for us is zero-copy deserialization. In the process of trying to do zero-copy deserialization well, we’ve built some cool new libraries, this article is about one of them.
-
Manish Goregaokar: So Zero It's ... Negative? (Zero-Copy #3)
As mentioned in the previous posts, internationalization libraries like ICU4X need to be able to load and manage a lot of internationalization data. ICU4X in particular wants this part of the process to be as flexible and efficient as possible. The focus on efficiency is why we use zero-copy deserialization for basically everything, whereas the focus on flexibility has led to a robust and pluggable data loading infrastructure that allows you to mix and match data sources.
Deserialization is a great way to load data since it’s in and of itself quite flexible! You can put your data in a neat little package and load it off the filesystem! Or send it over the network! It’s even better when you have efficient techniques like zero-copy deserialization because the cost is low.
But the thing is, there is still a cost. Even with zero-copy deserialization, you have to validate the data you receive. It’s often a cost folks are happy to pay, but that’s not always the case.
For example, you might be, say, a web browser interested in using ICU4X, and you really care about startup times. Browsers typically need to set up a lot of stuff when being started up (and when opening a new tab!), and every millisecond counts when it comes to giving the user a smooth experience. Browsers also typically ship with most of the internationalization data they need already. Spending precious time deserializing data that you shipped with is suboptimal.
-
Laravel 9 File Upload Tutorial
Laravel validation is a way to perform a validation role. We can check the file type, file size, etc. File validation is typically used to avoid unwanted file uploads in a server or application.
Today, we will learn about file upload and storing in Laravel 9.
-
Laravel 9 Log
Laravel 9 log is an integral part of the Laravel 9 application. Basically, it is used as an application for monitoring the application activity. Laravel 9 has robust log services for converting log messages into a file. Today, we will demonstrate Laravel 9 logging. This tutorial helps you to understand your application status. What’s going on with your application. If there were an error in your software, you would see the system error message in your log file. Laravel 9 has a default logging that is based on the Laravel channel.
-
Laravel 9 Eloquent orderBy Query
Laravel 9 has an excellent feature named Eloquent. It is an ORM (object-relational mapping), and it helps users to communicate between applications to databases very easily. In Laravel 9, when we use Eloquent, it works as a “Model” and communicates with the database. It helps you get data from the table in the database.
-
Some takeaways from rstudio::conf 2022 | R-bloggers
Last week I participated in the annual RStudio conference which took place in Washington DC.
-
Rubenerd: Thanking Yee Cheng Chin for MacVim
I could feel the worry reading this. Maintainers of all stripes have to put up with angry people who demand they fix and update software, often with no financial or development assistance.
-
Using Jest toHaveBeenCalledWith for testing primitive data types and partial objects
Jest is the most used JavaScript testing framework. In this post, you will learn how to use Jest toHaveBeenCalledWith for testing various scenarios like a partial array, partial object, multiple calls, etc. Let’s get started!
-
Brooks in Reverse
Fred Brooks observed in Mythical Man Month that adding more programmers to a project often slowed it down.
[...]
Graham was observing the early effects of SaaS and web programming. No need for porting applications to different operating systems or physical releases (floppies, CDs, or software appliances). SaaS removed the dependency hell companies often found themselves in – old versions that customers refused to upgrade from that still needed to be maintained (often with backward compatibility). The downside, he said, was that you still needed to manage servers and infrastructure. A single bug could crash all users. Hardware disks could become corrupted.
-
A First-Class Language Package Manager
The history of modularization in JavaScript is a tedious one. ES Modules ("import") were introduced in 2015 and now seem to have broad support across different environments. But the precursor to ES Modules, CommonJS ("require"), is still widespread enough to require backward compatibility. And neither module system has an opinionated take on the actual package management (e.g., yarn and npm).
It seems that new languages are starting to converge on first-class language package manager as part of the spec. Rust has the crate build system and explicit module system. Go converged on first-class go modules. Both systems can be difficult to understand for beginners.
-
Two useful ways to easily run a single test using Jest
Jest has been the tool of choice for writing tests in JavaScript for years now. This guide will teach you how to run a single test using Jest. Let’s get going!