OpenAI currently runs ChatGPT for free at chat.openai.com. I’ve played around with it a bit and recently asked three questions. Those questions and ChatGPT’s responses are logged here.
ChatGPT is a type of language model called a transformer. It is trained using a variant of the transformer architecture called GPT-3 (Generative Pre-trained Transformer 3). This model is trained on a massive amount of text data using a technique called unsupervised learning, which means that it learns patterns in the data without any explicit labels or supervision. The model is pre-trained on a diverse set of internet text and fine-tuned on specific task by fine-tuning on smaller dataset. The model uses a deep neural network with attention mechanisms to generate human-like text. It can be fine-tuned for a wide range of natural language processing tasks, such as language translation, question answering, and text summarization.
C Spire is a telecommunications company based in Mississippi, USA. It provides a wide range of services including wireless, home phone, internet, and television services. The company is known for its focus on customer service and for offering customized plans and packages for its customers. C Spire also operates a number of retail stores in Mississippi and other states where it provides services. Additionally, it offers enterprise-level services such as cloud computing, data center, and cybersecurity services to businesses. The company is privately held and was founded in the 1990s.
Telecommunications companies operating in the United States are subject to a wide range of rules and regulations set by the federal government, including the Federal Communications Commission (FCC). Some of the basic rules that these companies are required to follow include:
- Universal Service: Telecommunications companies are required to contribute to the Universal Service Fund, which provides support for telecommunications services in rural and low-income areas.
- Interconnection: Telecommunications companies are required to interconnect with other companies to ensure that customers can reach all networks and services.
- Network Neutrality: Telecommunications companies are prohibited from discriminating against or blocking lawful internet traffic, also known as “net neutrality”
- Transparency: Telecommunications companies are required to provide accurate and timely information to customers about the prices, terms, and conditions of their services.
- Consumer protection: Telecommunications companies are required to follow rules to protect consumers from fraud, cramming and slamming, and other deceptive practices.
- Emergency Services: Telecommunications companies are required to provide 911 emergency services and meet other obligations to ensure public safety.
These are some of the basic rules that telecommunications companies operating in the United States must follow, but there are many more specific rules and regulations that apply to different types of services and different parts of the industry.
I apologize for the error in my previous response. You are correct that C Spire was founded in 1988, not the 1990s. I apologize for any confusion this may have caused.
ChatGPT is a powerful language model that can be fine-tuned for a wide range of natural language processing tasks. Some of the benefits of using ChatGPT include:
- High-quality text generation: ChatGPT is trained on a large dataset of internet text, which allows it to generate human-like text that is often difficult to distinguish from text written by a human.
- Customizable: ChatGPT can be fine-tuned on a smaller dataset to perform specific tasks, such as answering questions or generating text in a specific style or tone.
- Efficient: ChatGPT is a highly efficient model that can be run on a wide range of devices, from high-performance servers to mobile devices, making it accessible to a wide range of users.
- Versatile: ChatGPT can be used for a wide range of applications such as text completion, text generation, question answering, language translation, text summarization, and many more.
- Cost effective: ChatGPT can be used for many tasks that would otherwise require human labor, which can save time and money.
In summary, ChatGPT is a versatile and efficient model that can be used to generate high-quality text, perform natural language processing tasks, and save time and money. It can be utilized by individuals, small businesses and large companies to automate various tasks, improve customer service, or creating new content.
Check out the previous version of this post if you want to compare the differences.
Spring Boot is a powerful project from the Spring ecosystem which enables developers to maximize their leverage of Spring applications. Standalone projects can be generated at start.spring.io with any other additional dependencies of Spring project included in just a few clicks.
I have created a Spring Boot demo project available on my GitHub. I use this project to demonstrate some tasks I perform regularly in Spring Boot.
If you’ve been a follower of this blog you might recall I have previously integrated Swagger UI into a Go application (check out this blog post from October 2021).
Swagger is a suite of tools which seeks to provide OpenAPI specifications and definitions. Codebases can be generated from a Swagger doc, just as an existing codebase can be documented by adding Swagger-identifiable annotations.
In this post I will show how I to integrate Springfox Swagger UI into a Spring Boot application. I will then demonstrate integrating Springdoc as an alternative, as Springfox hasn’t been updated in a while (the last commit was Oct, 2020). Springdoc supports the latest version of Spring Boot as of writing (2.7.2).
but first…
There are three MILE MARKER sections. #1 precedes the relevant code blocks for Springfox. #2 occurs after Springfox is concluded and before Springdoc code blocks begin. #3 appears after the conclusion of Springdoc.
➡️ Springfox integration (you are here)
🔜 Springdoc integration
This configuration uses an existing Spring Boot project and integrates io.springfox/swagger-boot-starter (version 3.0.0).
Add the Springfox Spring Boot starter dependency.
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
springfox-boot-starter
provides the following artifacts from io.springfox
:
springfox-oas
springfox-data-rest
springfox-bean-validators
springfox-swagger2
springfox-swagger-ui
Wherever your Spring Boot app starts is dependent on your project. In my demo application, this is a file called DemoApplication.java
.
In this file, only two annotations need to be added to the base class:
@EnableOpenApi
@EnableSwagger2
If it doesn’t exist yet, create a new Java class called AppConfiguration.java
. The class itself will be empty but it will have a few annotations that will enable Springfox to scan the application code and identify endpoints. You could add these annotations on the main application class but I like it this way as it feels more explicit in intention.
@Configuration
@EnableWebMvc
@ComponentScan("dev.michael.demo")
public class AppConfiguration {
}
SpringConfig.java
will implement the WebMvcConfigurer
interface. It will override a couple of methods so that Spring Boot can serve Swagger UI alongside the Spring Boot app.
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.
addResourceHandler("/swagger-ui/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/")
.resourceChain(false);
}
addResourceHandlers
will enable Spring Boot to find Swagger resources.
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/swagger-ui/")
.setViewName("forward:" + "/swagger-ui/index.html");
}
addViewControllers
will enable Spring Boot to serve the main Swagger UI page.
Swagger UI will now automatically generate API documentation every time the Spring Boot application is started.
✔️ Springfox integration
➡️ Springdoc integration (you are here)
Optional: For an example migration from Springfox to Springdoc, look at this commit on my Redis hackathon repo.
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.11</version>
</dependency>
springdoc.packages-to-scan=dev.michaellamb.demo
springdoc.paths-to-match=/api/**
springdoc.swagger-ui.path=/swagger-ui.html
springdoc.swagger-ui.enabled=true
Springdoc is a bit simpler in configuration than Springfox, relying primarily on application.properties
to determine which packages to scan to document HTTP API routes for the app and without needing to override any Spring Beans to serve the frontend.
✔️ Springfox integration
✔️ Springdoc integration
Great job! 🎉
You have a Spring Boot app ready to start developing an auto-documented HTTP API.
This overview of trunk based development was created for the Customer Applications team at C Spire. The information presented represents no proprietary systems or data, and this content uses trunkbaseddevelopment.com as a primary source. The presentation was recorded using Soapbox by Wistia.
Make connections. Make waves.
Birmingham’s premier IT event is back. And it means business. Network with the brightest IT professionals and learn about the latest solutions from industry leaders at C Spire Business’s annual event.
I participated in a Redis Hackathon hosted on Dev.to which required use of the Redis Stack. Anyone familiar with Redis knows it for its primary use case as a cache, with popular adoption as a primary database because of its ease-of-use and high developer happiness as part of the ecosystem’s DX metric.
The hackathon started at the beginning of August but I started late and had to balance free time against work time. The submission deadline was August 29 at 7 PM. Though I didn’t have a finalized submission, just for participating I’ve gotten a $500 credit for Redis Stack!
The Redis Stack is a distributed system! Redis has multiple projects, meaning multiple parts of these applications can run in a distributed system to provide a single endpoint for a full-featured cache. Redis means Remote Dictionary server, which is what they call the initial redis
app which is historically compared to memcached
.
Redis Stack is made up of several components, licensed as follows:
Redis Stack Server, which combines open source Redis with RediSearch, RedisJSON, RedisGraph, RedisTimeSeries, and RedisBloom, is licensed under the Redis Source Available License (RSAL).
RedisInsight is licensed under the Server Side Public License (SSPL).
Using these combined systems, I made a microservice app which enabled me to create an endpoint to easily store some data for the michaellamb.dev Discord bot. The project I came up with involved integrating Midjourney image generation and a frontend.
The following sections will be dated entries with commits SHAs and descriptions of the changes.
1 commit
This is just the basic initialization of the app. It builds and runs. Swagger is available.
1 commit
message: creates example People repository
I’m following along with the Stack Spring tutorial here to implement some basic functionality. This includes using the skeleton app repo as a reference.
Progress here includes connecting to the Redis Stack. Of course, the password has been changed since this is open source. A future commit will rename the application.properties
file to indicate it is an example only, after another commit which adds an entry for application.properties
in .gitignore
.
3 commits
message: ignore application.properties
message: Update .gitignore
message: Rename application.properties to last-application.properties
This does the things I said in the last description.
message: migrate to springdoc
Springfox doesn’t support something in Spring 2.7.0 so I migrated the project to Springdoc.
message: replaced import
Fixed an erroneous import in the Person
domain class.
message: implement RedisDocumentRepository operations
This adds functionality around the Person objects using RedisDocumentRepository to generate boilerplate code. We can easily return an Iterable<Person>
with whatever data points we can imagine because of the power of Redis. The OM library gives us the ability to stub basic methods. We can use these to query Redis for data.
message: add controller operations
This exposes the functionality of the PeopleRepository as an API.
message: refactor Person
These chisel down some of the fields on the Person
class
message: remove loadTestData CommandLineRunner
This is tutorial code and should be removed before further development.
message: fix build
I’m not perfect.
I got a good deal of exposure to Redis OM Spring and more experience with RedisInight, the GUI used to inspect Redis databases. I ran into issues with the meta-model generation, I’m not sure if that was because VS Code doesn’t know about meta-modeling or if I was missing a Maven compilation step. Overall, Redis OM Spring seems like it’s headed in a good direction!
My code is not production ready but it’s progress.
Docker as a deployment strategy can have its shortcomings. One shortcoming I experienced recently was a breakdown in being able to make requests and receive responses from other michaellamb.dev apps and the Spring Boot demo app.
Instead of fighting with Docker (a tool I’m less familiar with) I opted to install the Spring Boot application as a service on a single node. This process could be automated using a CI/CD strategy and I may implement something using GitHub Actions in the future, but it is a more involved process than pulling a Docker image and running it as a container.
Baeldung wrote an article I used as a guide for installing the Spring Boot demo app as a service on Linux.
The first step is to enable the executable flag in the spring-boot-maven-plugin
referenced in pom.xml
<configuration>
<executable>true</executable>
</configuration>
See this change in the linked commit: update pom
The second step is to copy the source code to the node and package it for deployment.
./mvwn clean package
It may be necessary to change directory permissions to allow the app to read and write using the file system.
Using the traditional System V init, we create a symbolic link that we can use to reference as a service.
sudo ln -s /home/michael/demo/target/demo-0.1.0.jar /etc/init.d/demo
This link would need to be updated any time the jar is renamed
The app needs to be enabled by the system using the following command:
sudo systemctl enable demo
Once the system knows the app is available as a service, the service can be started.
sudo service demo start
Other commands are available using the standard service script: stop
, restart
, and status
. Moreover, logs can be viewed under var/log/demo.log
.