The Programmer News Hubb
Advertisement Banner
  • Home
  • Technical Insights
  • Tricks & Tutorial
  • Contact
No Result
View All Result
  • Home
  • Technical Insights
  • Tricks & Tutorial
  • Contact
No Result
View All Result
Gourmet News Hubb
No Result
View All Result
Home Tricks & Tutorial

Reddit – Dive into anything

admin by admin
March 9, 2023
in Tricks & Tutorial


Create UML diagrams with ChatGPT and PlantUML.

http://www.plantuml.com/plantuml/

prompt: describe how to create plantUML with ChatGPT and give an example

  • To create PlantUML with ChatGPT, you can start by providing a textual description of your diagram or flowchart. ChatGPT can then use its natural language processing capabilities to convert your description into a PlantUML code. Once you have the PlantUML code, you can render it using any of the available tools, such as an online renderer or an IDE plugin.

  • Here’s an example of how to create a simple PlantUML class diagram using ChatGPT:

  • User: Can you help me create a class diagram for a car rental system? ChatGPT: Sure, can you provide me with a description of the classes and their relationships?

  • User: Yes, we have three classes: Car, Customer, and Rental. Each customer can rent one or more cars, and each rental must be associated with a customer and a car. A rental can also have additional information such as the rental date, return date, and rental price.

  • ChatGPT: Great, here’s the PlantUML code for your class diagram:

u/startuml

class Car

class Customer

class Rental {

- rentalDate: Date

- returnDate: Date

- rentalPrice: double

+ getRentalDate()

+ setRentalDate()

+ getReturnDate()

+ setReturnDate()

+ getRentalPrice()

+ setRentalPrice()

}

Customer "1" -- "*" Car

Rental "1" -- "1" Car

Rental "1" -- "1" Customer

u/enduml

Then goto: http://www.plantuml.com/plantuml/uml/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000

and paste the code. And it generates:

another example:

  • you know the prisinors dilemma?

  • Yes, I am familiar with the Prisoner’s Dilemma. It is a classic game theory scenario that is often used to explain why two individuals might not cooperate even if it is in their best interest to do so.

  • In the Prisoner’s Dilemma, two individuals are arrested and held in separate cells. Each is given the opportunity to confess or remain silent about their alleged crime. If both remain silent, they will each serve a short sentence for a lesser offense. If one confesses and the other remains silent, the one who confesses will receive a reduced sentence while the other will receive a harsher sentence. If both confess, they will both receive a moderately harsh sentence.

  • The dilemma arises because each individual must decide whether to cooperate with the other by remaining silent or defect by confessing. While the best outcome for both is to remain silent, each individual may be tempted to defect by confessing in order to gain a reduced sentence, especially if they don’t trust the other person to remain silent.

  • The Prisoner’s Dilemma is often used to explore the tension between individual self-interest and collective cooperation.

u/startuml

title Prisoner's Dilemma

start

:Two prisoners are arrested and held in separate cells;

if (Confess) then (Both Confess)

:Both receive a moderately harsh sentence;

else if (Confess) then (Only One Confesses)

:The one who confesses receives a reduced sentence;

:The other receives a harsher sentence;

else (Both Remain Silent)

:Both receive a short sentence for a lesser offense;

endif

stop

u/enduml



Source link

Previous Post

How to Convert a Number to a String in JavaScript — SitePoint

Next Post

Software outsourcing: interesting statistics, predictions, facts, and key players

Next Post

Software outsourcing: interesting statistics, predictions, facts, and key players

Recommended

Everything You Need to Know About the Gap After the List Marker | CSS-Tricks

4 weeks ago

A guide to release automation tools

6 months ago

CSS Infinite 3D Sliders | CSS-Tricks

3 months ago

Wondershare PDFelement: A Powerful and Affordable PDF Editor

4 months ago

Google announces AppSheet databases for citizen development

5 months ago

Finding Front-End Development Scholarships | CSS-Tricks

4 months ago

© The Programmer News Hubb All rights reserved.

Use of these names, logos, and brands does not imply endorsement unless specified. By using this site, you agree to the Privacy Policy and Terms & Conditions.

Navigate Site

  • Home
  • Technical Insights
  • Tricks & Tutorial
  • Contact

Newsletter Sign Up.

No Result
View All Result
  • Home
  • Technical Insights
  • Tricks & Tutorial
  • Contact

© 2022 The Programmer News Hubb All rights reserved.