- Upon accessing the “Create Chat Completion” API link, the following information regarding endpoint, request, and response is visible.
- Endpoint: POST https://api.openai.com/v1/chat/completions
- Go to Playgroud and type any message e.g. “What is spring boot?”
20 novembro 2023
ChatGPT Integration with Spring Boot Application
OpenAI ChatGPT APIs
API (POST https://api.openai.com/v1/chat/completions) to generate responses to a prompt.
What we need to send to invoke the OpenAI API?
https://platform.openai.com/api-keys
Source: levelup.gitconnected.com
25 outubro 2023
07 setembro 2023
Create API request in parallel using Spring Webflux + Rest Template + Completablefuture
- Spring Webflux
- Spring Completablefuture function
- Rest Template
22 maio 2023
CompletableFuture and ExecutorService
CompletableFuture and ExecutorService
Source: medium.com/@anil.java.story
ExecutorService
public static void main(String[] args) throws ExecutionException, InterruptedException { ExecutorService executor = Executors.newFixedThreadPool(3); FutureCompletableFuturefutureResult = executor.submit(new Add(10, 20)); // 1 Integer intermediateResult = futureResult.get(); // 2 Future finalResult = executor.submit(new Multiply(intermediateResult)); // 3 System.out.println(finalResult.get()); executor.shutdown(); }
public static void main(String[] args) throws ExecutionException, InterruptedException { Integer finalResult = CompletableFuture.supplyAsync(() -> add(10, 20)) .thenApplyAsync(result -> multiply(result)) .get(); System.out.println(finalResult); } public static Integer add(int a, int b) { return a + b; } public static Integer multiply(int result) { return result * 15; }
11 abril 2023
Android: Update activity with android:exported
I have this error in my Android Apllication and I found this solution......
I’ve got every activity, service, and receiver setting the android:exported attribute and I’m still seeing the same error
This also happened to me.
Source: cafonsomota.medium.com
25 março 2023
Android Studio error "Installed Build Tools revision 31.0.0 is corrupted"
First of all, I faced this issue in Android Studio 4.2.2 and you do not need to downgrade the SDK build tool from 31 to 30 or change compile SDK version.
The main problem is the two files missing in SDK build tool 31 that are:
- dx.bat
- dx.jar
The solution is that these files are named d8 in the file location so changing their name to dx will solve the error.
The steps are below.
For Windows
go to the location
"C:\Users\user\AppData\Local\Android\Sdk\build-tools\31.0.0"
find a file named d8.bat. This is a Windows batch file.
rename d8.bat to dx.bat.
in the folder lib ("C:\Users\user\AppData\Local\Android\Sdk\build-tools\31.0.0\lib")
rename d8.jar to dx.jar
Remember AppData is a hidden folder. Turn on hidden items to see the AppData folder.
For macOS or Linux
Run the following in the Terminal:
# change below to your Android SDK path
cd ~/Library/Android/sdk/build-tools/31.0.0 \
&& mv d8 dx \
&& cd lib \
&& mv d8.jar dx.jar
Now run your project.
17 fevereiro 2023
15 fevereiro 2023
31 janeiro 2023
16 janeiro 2023
Data Ingestion In Plain Java
- build simple data ingestion design that will be using simple Java SDK
- We will Read data from remote sources and write to Database.
13 janeiro 2023
11 janeiro 2023
Spring Boot 3 + Spring Security 6 - JWT Authentication and Authorisation
Spring Boot 3 + Spring Security 6 - JWT Authentication and Authorisation
Source: @amigoscode
09 janeiro 2023
Using CachedRowSet in JDBC
Understanding RowSet
A row set contains all data from a result set, but it can be disconnected from the database. A row set may make a connection with a database and keep the connection open during its life cycle, in which case it is called connected row set.
A CachedRowSet object is a container for rows of data that caches its rows in memory, which makes it possible to operate (scroll and update) without keeping the database connection open all the time.
A CachedRowSet object makes use of a connection to the database only briefly: while it is reading data to populate itself with rows, and again while it is committing changes to the underlying database. So the rest of the time, a CachedRowSet object is disconnected, even while its data is being modified. Hence it is called disconnected row set.
Subscrever:
Mensagens (Atom)