ProgrammingPro #11: OpenAI’s New Generative Features, JupyterLab 4.0, Python for Finance, and Low-Code Tools
Bite-sized actionable content, practical tutorials, and resources for programmers.
Hi,
I hope you have been doing well! Welcome to this week’s issue of the ProgrammingPro newsletter where we detail the most relevant industry insights, practical tutorials, and useful resources for developers and engineers. Let’s jump into it.
In today’s issue you will look at Stack Overflow’s 2023 Developer Survey and OpenAI’s New Generative Features and Reduced Pricing. We also have an assortment of the most relevant industry insights, including the JupyterLab 4.0 announcement, a fun tutorial called What’s the Zen of Python, and a post exploring Low-Code and No-Code Development Tools.
Also, in today’s issue:
TechWave: News and Analysis
Secret Knowledge: Learning Resources
HackerHub: Tools and Launches
Tutorial: Behavioral Design Patterns in Java
My promise with this newsletter is to act as your personal assistant and help you navigate and keep up-to-date with what's happening in the world of software development. What did you think of today's newsletter? Please consider taking the short survey below to share your thoughts and you will get a free PDF of the “Flutter Projects” eBook upon completion.
Thanks for reading.
Kartikey Pandey
Editor-in-Chief
Tell Us What You Think, Get a Packt eBook Free!
⚡ TechWave: News and Analysis
JupyterLab 4.0 is Here: The Jupyter community have announced JupyterLab 4.0. This post shows you some of the new features, including performance improvements, editor upgrades, better search, and more.
Meta Unveils I-JEPA, a Model that Learns Like Humans: The computer visiion model is able to learn internal models of how the world works (which could help it to learn faster), plan how to accomplish complex tasks, and readily adapt to unfamiliar situations.
Python 3.11.4, 3.10.12, 3.9.17, 3.8.17, 3.7.17 & 3.12.0 Beta 2 are Now Available: Time for another combined release of six separate versions of Python! Head over to the post to know more about these security releases and updates.
GitHub’s Survey Reveals AI’s Impact on Developer Experience: GitHub takes a deep dive into how AI is impacting the developer experience. Through both surveys and quantitative metrics, they found that AI helps developers enter a flow state while coding and increases their productivity. AI reduces the time spent on writing boilerplate code while allowing engineers to focus more on solution design.
Microsoft and OpenAI’s Awkward Partnership: Despite being considered a smart move on Microsoft’s part, the relationship with OpenAI has produced confusion behind the scenes for Microsoft. For example, people within Microsoft have complained about diminished spending on its in-house AI and that OpenAI doesn’t allow most Microsoft employees access to the inner workings of its technology.
Stack Overflow’s 2023 Developer Survey: The results of Stack Overflow’s annual developer survey are out. JavaScript is the most used programming language, displacing Python. The baseline for salary growth in 2023 was 10% over last year.
📚 Secret Knowledge: Learning Resources
What’s the Zen of Python? In this tutorial, you’ll explore the Zen of Python, a collection of nineteen guiding principles for writing idiomatic Python. You’ll find out how they originated and whether you should follow them. Along the way, you’ll uncover several inside jokes associated with this humorous poem.
Mastering Coding Interviews with 20 Coding Patterns: By understanding and implementing these patterns, you can develop a robust problem-solving mindset. Whether it’s a startup or big tech companies like Google, Facebook, Amazon, or Microsoft, a candidate’s ability to solve problems efficiently is what interviewers look for. Coding interviews are not about memorizing solutions; they are about problem-solving, critical thinking, and, above all, the correct approach.
Native JSON Output From GPT-4: When integrating LLMs in your products, you often want to generate structured data, like JSONs. With the help of function calling (released June 13th 2023), this process has become much simpler! This post explores the new API.
Flask Authentication Guide: This guide will help you learn how to secure a Flask web application using token-based authentication.
Python for Finance: Pandas Resample, Groupby, and Rolling: When working with time series data such as financial information, the resample, grouping, and rolling features of Pandas can make your life easier. Read on to find out how.
ChatGPT, Wardley Maps, and Go: This post covers a lot of mixed ideas: how to create a ChatGPT plugin, serve an API from Go, the basics of Wardley maps (a type of business strategy diagram), and handling SVG images.
🔍 HackerHub: Tools & Launches
OpenAI Intros New Generative Features and Reduces Pricing: As the competition in the generative AI space grows fiercer, OpenAI is upgrading its text-generating models while reducing pricing. OpenAI announced the release of new versions of GPT-3.5-turbo and GPT-4, the latter being its latest text-generating AI, with a capability called function calling. This will allow developers to describe programming functions to GPT-3.5-turbo and GPT-4 and have the models create code to execute those functions.
Low-Code and No-Code Development Tools: As the demand for software apps grow, the pressure on developers to deliver high-quality solutions has increased exponentially. As a result, no-code and low-code development tools have become popular. This post explores low-code and zero-code development tools, benefits, key features, use cases, challenges, and the future.
Rapid 1.0: Property-Based Testing Library: Rapid is a Go library for property-based testing. It checks that properties you define hold for a large number of automatically generated test cases. If a failure is found, Rapid automatically minimizes the failing test case before presenting it.
Miller 6.8: A Go-Powered Textual Data File Swiss Army Knife: Like awk, sed, cut, join, and sort, all in a single place, for data formats such as CSV, TSV, and JSON. Think jq but for CSV.
detrex - Benchmarking Detection Transformers: detrex is an open-source toolbox that provides state-of-the-art Transformer-based detection algorithms. It is built on top of Detectron2 and its module design is partially borrowed from MMDetection and DETR.
✨ Tutorial: Behavioral Design Patterns in Java
Code maintainability plays a key role in applications across the spectrum of the industry, but it’s not fair to stop there and look no further. This means skipping over code behavior at runtime, which has an impact on physical and virtual memory usage.
The primary motivation for using behavior patterns is transparent communication between objects, or in other words, the efficient usage of memory allocation for this communication. Utilizing behavioral patterns improves the flexibility of communication and helps complete a task with a single object or multiple objects exchanging information with each other. Structural design patterns can sometimes seem close to behavioral ones, but the purpose is slightly different.
Handling events using the chain of responsibility pattern
The chain of responsibility pattern helps avoid tying the handler logic to the sender that fired the event.
Motivation
The program receives an initial triggered event. Each chained handler decides whether to process the request or pass it on to the next handler without responding. A pattern can consist of command objects that are processed by a series of handler objects. Some handlers can act as dispatchers, capable of sending commands in different directions to form a responsibility tree.
The chain of responsibility pattern allows you to build a chain of implementations in which a certain action is performed before or after calling the next handler in the chain.
Finding it in the JDK
The java.logging module includes the java.util.logging package, which contains a Logger class, intended for recording application component messages. Loggers can be chained and the logged message is only processed by the desired Logger instances.
Another example provided in the JDK is the DirectoryStream class, which comes with the java.base module and is located in the java.nio package. This class is responsible for iterating over entire directories and contains a nested filter interface. The interface provides an accept method. The actual representation of the chained filter differentiates depending on whether the directory is to be processed or excluded.
Sample code
Let us examine an example of how the chain of responsibility design pattern can be used to respond to a trigger event from the driver system:
System.out.println("Pattern Chain of Responsibility, vehicle
system initialisation");
var engineSystem = new EngineSystem();
var driverSystem = new DriverSystem();
var transmissionSystem = new TransmissionSystem();
driverSystem.setNext(transmissionSystem);
transmissionSystem.setNext(engineSystem);
driverSystem.powerOn();
}
Here’s the output:
Pattern Chain of Responsibility, vehicle system initialisation
DriverSystem: activated
TransmissionSystem: activated
EngineSystem, activated
The behavior of the system chain created is transparent, and the logic is properly encapsulated by each system. The provided generic abstract VehicleSystem instance defines the functionality, what function each element must fulfill, and how the following elements should be chained.
sealed abstract class VehicleSystem permits DriverSystem,
EngineSystem, TransmissionSystem {
...
protected VehicleSystem nextSystem;
protected boolean active;
...
void setNext(VehicleSystem system){
this.nextSystem = system;
}
void powerOn(){
if(!this.active){
activate();
}
if(nextSystem != null){
nextSystem.powerOn();
}
}
}
Conclusion
The chain of responsibility pattern showed that an incoming event that affects the runtime behavior of a program can result in the creation of multiple objects. The manipulators are encapsulated and the logic is properly isolated according to SOLID principles. Using this pattern, the client gets the opportunity to dynamically decide which handlers should be involved in the event process. Therefore, it is a hot candidate for security frameworks or similar.
This tutorial is a chapter extract from the book Practical Design Patterns for Java Developers written by Miroslav Wengner and published by Packt Publishing.