ChapGPT / CoPoliot Video "15 Surprising Examples" that are good for developers

Video has some good tips for ChatGPT using Bing.com/CoPilot that work well for Developers like us.

1:54 - Explain Command Line Parameters
2:36 - Ask What Command to Use
3:04 - Parse Unformatted Data
4:54 - Use As A Reverse Dictionary
6:16 - Finding Hard-To-Search Information
7:48 - Finding TV Show Episodes
8:37 - Multi-Language Translations
9:21 - Figuring Out the Correct Software Version
9:58 - Adding Code Comments
10:18 - Adding Debug Print Statements
10:42 - Calculate Subscription Break-Even
11:40 - Programmatic Data Processing

Channel: ThioJoe
Title: Actually, ChatGPT is INCREDIBLY Useful (15 Surprising Examples)

4 Likes

At 1:54 in the Video is “Explain Command Line Parameters”

For example on Hub we have a topic Libcurl FAQ with this curl example:

curl -u jsmith:jsmith -X POST -F "environment=TEM" -F "filename=Test" -F "[email protected]" "https://server.com/api/manifests"

Normally I would go find the Curl help and lookup each parameter. That takes a lot of time to understand the parameters one at a time, and can be tedious as I record notes about each one.


In CoPilot I enter:
Explain command curl -u jsmith:jsmith -X POST -F "environment=TEM" -F "filename=Test" -F "[email protected]" "https://server.com/api/manifests"

The reply is below and nicely pastes here as MarkDown:


Copilot

Sent by Copilot:

Sure! Here’s a breakdown of the curl command you provided:

curl -u jsmith:jsmith -X POST -F "environment=TEM" -F "filename=Test" -F "[email protected]" "https://server.com/api/manifests"

Explanation:

  • curl: The command-line tool for transferring data with URLs.
  • -u jsmith:jsmith: This option specifies the username and password for server authentication.
  • -X POST: This tells curl to use the POST method.
  • -F "environment=TEM": This sends the form field environment with the value TEM.
  • -F "filename=Test": This sends the form field filename with the value Test.
  • -F "[email protected]": This uploads the file mmabc.manifest as the form field multipartFile.
  • "https://server.com/api/manifests": The URL to which the request is sent.

Is there anything specific you’d like to know or modify about this command?



Another example on that Libcurl FAQ topic is interesting in that the reply suggests passing the data in JSON:

Explain command: curl -X POST https://server.com/v1/person -H "Content-Type: application/json" -H "Authorization: Bearer Access-Token" -d "k1=v1&k2=v2"


Copilot

Sent by Copilot:

Sure! Here’s a breakdown of the curl command you provided:

curl -X POST https://server.com/v1/person -H "Content-Type: application/json" -H "Authorization: Bearer Access-Token" -d "k1=v1&k2=v2"

Explanation:

  • curl: The command-line tool for transferring data with URLs.
  • -X POST: This tells curl to use the POST method.
  • https://server.com/v1/person: The URL to which the request is sent.
  • -H "Content-Type: application/json": This sets the Content-Type header to application/json, indicating that the data being sent is in JSON format.
  • -H "Authorization: Bearer Access-Token": This sets the Authorization header to use a Bearer token for authentication.
  • -d "k1=v1&k2=v2": This sends the data k1=v1&k2=v2 in the body of the request. Note that this format is typically used for URL-encoded data, not JSON.

If you intended to send JSON data, you would format the data differently, like this:

curl -X POST https://server.com/v1/person -H "Content-Type: application/json" -H "Authorization: Bearer Access-Token" -d '{"k1":"v1","k2":"v2"}'

This way, the data is correctly formatted as JSON.

3 Likes

Not something developer specific but fun and useful. Works for TV Series, Movies, Books, Stories … I often recall a few details and want to find the source. This is usually hard to do with normal web search.


You: What is the name of the book about creating Windows NT

Copilot

The book you’re looking for is “Showstopper!: The Breakneck Race to Create Windows NT and the Next Generation at Microsoft” by G. Pascal Zachary1. It provides an in-depth look at the development of Windows NT, focusing on the challenges and triumphs of the team led by David Cutler.


You: What is the name of the old movie where a man invents a computer that has a child with the man’s wife

Copilot

The movie you’re thinking of is likely “Demon Seed” (1977). In this film, a scientist creates an advanced computer named Proteus IV, which eventually takes control of his house and aims to impregnate his wife, Susan, to create a child


One for @John_Hickey …

You: What was the Star Trek epsiode with the white gorilla with one horn

Copilot

The episode you’re thinking of is “A Private Little War” from the original Star Trek series. The creature you’re referring to is called the Mugato. It’s a white, ape-like animal with a large horn on its head and venomous fangs12.

2 Likes

Hi Carl

Somewhere with one of the updates I saw that the copilot toolbar arrived on my desktop
and my first instinct was to get rig of it, as I did not ask for it.
So thought I would ask the question in the copilot toolbar.

This was the response:

cheers,

Johan

1 Like

I use chatGPT. I wanted to see what would happen if I uploaded my help file as a PDF, or let it go to the web help. I found it hallucinated a bunch with the html web help, but did very well with the PDF.
I use Help and Manual to create my help. I asked the author why he hadn’t implemented a way to use AI, and he had tried, but he said it was unreliable. But, I’ve found it very easy to use and so far pretty reliable using my help PDF as its knowledge base for our software.

There is Blackbox, an AI dedicated to development, with many languages…
They have an extension for VS Code (I would like one for SublimeText…).
You can create you own Agent and give it the sources (PDF and GIT repos).
I’ll try to create a Clarion Agent and give it the Clarion’s PDF help files…

1 Like

I am interested to hear how you go. Once you have done that, is it shareable to others here or only available to whoever made it?

1 Like

You can register in BlackBox.ai by simply using your gmail account.
When you create an Agent you can set is as Public or Private.
There is a button “Invite friends” which generates an URL to share with friends.
When I asked “create a global template to call a procedure in every other procedures” and it generated a python code…
After I uploaded the TemplateLanguageReference.pdf I asked the same prompt and then it generated a Clarion template code, explained the code and gave instructions on how to use the template.
Don’t know if was the better code for this situation, but it was a very good starting point…

Here’s the generated template code:

#APPLICATION('Global Template Application')

#DECLARE(%GlobalProcedureName),STRING
#SET(%GlobalProcedureName,'GlobalProcedure')

#GROUP(%GlobalProcedureCode)
%GlobalProcedureName PROCEDURE
  CODE
  MESSAGE('Global Procedure Executed')
  ! Add any other global code here
#ENDGROUP

#TEMPLATE(GlobalTemplate,'Global Template')
  #CONTEXT(%Procedure)
    #AT(%BeforeProcedure),PRIORITY(1)
      #INSERT(%GlobalProcedureCode)
    #ENDAT
    #AT(%ProcedureRoutines),PRIORITY(1)
      %GlobalProcedureName()
    #ENDAT
  #ENDCONTEXT
#ENDTEMPLATE

#UTILITY(GlobalTemplateUtility,'Global Template Utility')
  #FOR(%Procedure)
    #FIX(%Procedure,%Procedure)
    #GENERATE(%Procedure)
  #ENDFOR
#ENDUTILITY

Seems very insteresting! :slight_smile: