Thursday, 16 March 2023

ChatGPT - Intro - Level Up your Skills with example : Web site creation for Nataraja Temple, Chidambaram

ChatGPT is a Game Changer.

   Latest AI Tool, released in Nov 22, within 5 days, it got 5 million users.

   Large Language model to understand and answer the most in natural language.  

   It is "everything for anybody". 

   It can prepare your interview.

   It can help you whoever you are, in some way to better future.

   To become more creative.

   Use Cases:

    General Stuff : Legal, Health

    Front/Back end Development 

eg:

What are the 3 top books for learning Python.

What are the top 3 takeaways from 1st book

how do i become backend developer?

Write a bash command to find a jpg files in a particular directory?

how do i know how many lines of code i committed to the repository?

I want a make use revolutionary shopping apps. Please list them and compare the advantages?

so endless ways to make use of asking (prompting) chATGPT?

Power in Prompts.

It is now Prompt Engineering

0 Shot Prompt

1 Shot Prompt

2 Few Shots Prompting

    You tube video ideas for "How did you Teach"

Tone, Length, Structure

Chain of Prompt Engineering 

To get accurate and context sensitive and continuous

Project 1: Quiz Prompt

  1. Ask About a {title } 
  2. What should i  learning learn about from {title}
  3. Great, Can You give me Multiple Choice Question, one Question at a time and don't show the answer.
  4. Give me a hint
  5. Give your Answer
  6. Next Quiz Please

Project 2 : Audio Book

1. Ask about {Topic} 

Hello Let us know about Machine Learning. What should I start learning about from {topic}:topic = Machine Learning

2. What should i learn from {Topic}:  topic = 

3. I want you to write a concise Audio Book summary with the most important things   no know about topic: topic = deep Learning

copy and paste in synthetic window of Eleven Labs. Choose with Bella  

4. Run it eleven Labs to get Voice down load

5. Upload the mp3 to anchor .fm create signup and paste mp3 and publish as episodes

6. Listen to your summaries on your phone

How CHatGPT will become my Prompt HelpDesk? 

Prompt Generator:

We got this from the Discord app, and this may be the best prompt I've seen so far. It asks ChatGPT to revise the prompt you want to get the best possible answer. It's gonna blow your mind!

Copy and paste or type this in:

I want you to become my Prompt Creator. Your goal is to help me craft the best possible prompt for my needs. The prompt will be used by you, ChatGPT. You will follow the following process: 


Your first response will be to ask me what the prompt should be about. I will provide my answer, but we will need to improve it through continual iterations by going through the next steps.

 

Based on my input, you will generate 3 sections. a) Revised prompt (provide your rewritten prompt. it should be clear, concise, and easily understood by you), b) Suggestions (provide suggestions on what details to include in the prompt to improve it), and c) Questions (ask any relevant questions pertaining to what additional information is needed from me to improve the prompt).

 

We will continue this iterative process with me providing additional information to you and you updating the prompt in the Revised prompt section until it's complete.

Keep revising until you're happy with it, then simply copy and paste the revised prompt into a new chat. Watch the magic! You'll have some fun with this one. 


Thanks  [To 'Bret LittleField'!] 👍



For Midjourney


 Ask ChatGPT something like this in two steps. 1. "Do you have any suggestions on images that would illustrate the text above" Step 2: "Can you create a text-to-image prompt of [insert one of the image suggestions] I can use in Midjourney?" You often receive a great idea but you have to fine-tune the prompt to fit the "Midjourney Language."


Thanks [To 'Birgitta Granstorm'!] 👍

-----------------------------------------------------+++++++++++++++-------------------------------


---------------------------------------------------------------------------------------------

Prompt :

help me to create a detailed silo structure for a web site focussed on Annamalai University Distance Education.

Response:

Sure, here is an example of a silo structure for a website focused on the Nataraja Temple in Chidambaram, Tamil Nadu, India:

I. Home

  • Introduction to the Nataraja Temple
  • Overview of the website

II. About the Temple

  • History of the Nataraja Temple
  • Significance of the temple in Hinduism Architecture and design of the temple

III. Temple Timings and Ticket Information

  • Opening and closing times of the temple Information on ticket prices and types of tickets available
  • Dress code and other guidelines for visitors

IV. Temple Rituals and Festivals

  • Details about daily rituals and ceremonies at the temple Information on major festivals celebrated at the temple, such as
  • Mahashivaratri Schedule of upcoming events and festivals

V. Temple Attractions

  • Overview of the different shrines and idols within the temple complex Details about the main attraction - the Nataraja idol
  • Information on other notable features of the temple, such as the Chit Sabha
  • and Kanaka Sabha

VI. How to Reach

  • Directions to the Nataraja Temple from nearby cities and towns Information on transportation options, such as buses and trains
  • Tips for visitors, such as local accommodations and dining options

VII. Photo Gallery

  • A collection of high-quality photos of the Nataraja Temple and its various attractions Option to share photos on social media platforms

VIII. Contact Us

  • Contact information for the temple administration Feedback form for visitors to share their thoughts and suggestions

By using this silo structure, you can effectively organize the content on your website and provide a clear and user-friendly navigation system for visitors.

---------------------------------------------------------------------------------------------

Give me html code for the above home page with menu with 1. Home, 2. About 3. Timings 4. Rituals etc


Code :


<!DOCTYPE html>

<html>

<head>

<title>Nataraja Temple</title>

</head>

<body>

<header>

<h1>Nataraja Temple</h1>

<nav>

<ul>

<li><a href="#home">Home</a></li>

<li><a href="#about">About</a></li>

<li><a href="#timings">Timings</a></li>

<li><a href="#rituals">Rituals</a></li>

</ul>

</nav>

</header>

<main>

<section id="home">

<h2>Welcome to the Nataraja Temple</h2>

<p>Here you can learn about the history and significance of the temple, explore its attractions, and discover the rituals and festivals celebrated at the temple.</p>

</section>

<section id="about">

<h2>About the Temple</h2>

<p>The Nataraja Temple is one of the most famous Hindu temples in India, located in Chidambaram, Tamil Nadu. The temple is dedicated to Lord Shiva in his form as Nataraja, the Lord of Dance. It is believed to be one of the five Pancha Bootha Sthalas, representing the element of Akasha (space).</p>

</section>

<section id="timings">

<h2>Temple Timings</h2>

<p>The Nataraja Temple is open every day from 6:00am to 12:00pm and from 5:00pm to 10:00pm. Tickets can be purchased at the temple entrance for a nominal fee. Visitors are required to follow a dress code and other guidelines while inside the temple.</p>

</section>

<section id="rituals">

<h2>Temple Rituals and Festivals</h2>

<p>The Nataraja Temple is famous for its daily rituals and ceremonies, which include offerings of flowers, fruits, and other items to Lord Shiva. The temple also hosts several festivals throughout the year, including the famous Mahashivaratri festival. Visitors are welcome to participate in these rituals and festivals and experience the rich culture and traditions of Hinduism.</p>

</section>

</main>

</body>

</html>

---------------------------------------------------------------------------------------------
Prompt : can u give different css files for the above web site for different look and feel

Response :
  1. Classic Style CSS: This CSS file can be used to create a classic look and feel for the website. It can include traditional design elements such as ornate borders, decorative fonts, and muted colors.
  2. Modern Style CSS: This CSS file can be used to create a modern and sleek look and feel for the website. It can include clean and simple design elements such as minimalist fonts, bold colors, and simple shapes.
  3. Artistic Style CSS: This CSS file can be used to create an artistic and creative look and feel for the website. It can include unique design elements such as hand-drawn graphics, watercolor backgrounds, and artistic fonts.
  4. Nature Style CSS: This CSS file can be used to create a nature-inspired look and feel for the website. It can include design elements such as natural colors, organic shapes, and nature-inspired textures and patterns.
  5. Dark Style CSS: This CSS file can be used to create a dark and dramatic look and feel for the website. It can include design elements such as dark backgrounds, bold typography, and high-contrast color schemes.
  6. Light Style CSS: This CSS file can be used to create a light and airy look and feel for the website. It can include design elements such as light backgrounds, delicate typography, and soft color palettes.
---------------------------------------------------------------------------------------------
Can you compare thiruvalluvar and chanakya about "skills"

ChatGPT's Response:
Thiruvalluvar and Chanakya were both great thinkers and philosophers, and their works have had a lasting impact on their respective cultures. While they lived in different times and places, both of them had valuable insights on the topic of skills. Thiruvalluvar was a Tamil poet and philosopher who lived in the 2nd century BCE. His most famous work is the "Thirukkural," a collection of 1,330 couplets on ethics and morality. Thiruvalluvar believed that skills were an essential part of a person's life, and he emphasized the importance of developing them through hard work and dedication.

In the Thirukkural, Thiruvalluvar wrote: "Skill, acquired by practice, is the root of all fame and honor. "He also emphasized the importance of continuous learning and improvement: "A wise man will strive to acquire knowledge and practice diligently what he has learned."

Chanakya, also known as Kautilya, was an ancient Indian philosopher, economist, and royal advisor who lived in the 4th century BCE. He is best known for his book, the "Arthashastra," which is a treatise on politics, economics, and statecraft. Chanakya believed that skills were essential for success in both personal and professional life.

In the Arthashastra, Chanakya wrote: "Skill is the foundation of one's success." He also emphasized the importance of acquiring and honing skills:"Acquire knowledge through the ear, eyes, and mind. Practice what you learn through your hands and feet."

Overall, both Thiruvalluvar and Chanakya recognized the importance of skills in a person's life. While Thiruvalluvar emphasized the value of hard work and continuous learning, Chanakya emphasized the importance of acquiring knowledge and putting it into practice. Both of their teachings are relevant and valuable in today's world.

---------------------------------------------------------------------------------------------

Can u prepare 10 ppt slides for introduction to chatGPT?

Response :
Sure, here is a suggested outline for a 10-slide PowerPoint presentation introducing ChatGPT:

Slide 1: Title Slide
Include the title of the presentation, the name of the company or institution, and the date.

Slide 2: What is ChatGPT?

Briefly introduce ChatGPT as an AI language model developed by OpenAI. Mention that it can be used for a variety of natural language processing tasks.

Slide 3: How was ChatGPT developed?

Explain that ChatGPT was developed using a neural network trained on a large corpus of text data. Mention that the model was fine-tuned using unsupervised learning techniques.

Slide 4: What are the features of ChatGPT?

Mention that ChatGPT can generate human-like text, answer questions, translate languages, and perform other natural language processing tasks. Show examples of the kind of text that ChatGPT can generate.

Slide 5: What are the applications of ChatGPT?

Explain that ChatGPT can be used for a variety of applications, such as customer service, chatbots, language translation, and more. Show examples of companies or institutions that have used ChatGPT for these purposes.

Slide 6: How can ChatGPT benefit your company or institution?

Mention that ChatGPT can help improve customer service, increase efficiency, and reduce costs.
Show examples of how ChatGPT has been used to achieve these benefits.

Slide 7: How does ChatGPT compare to other AI language models?

Mention that ChatGPT is one of the largest and most advanced language models available.
Compare ChatGPT to other popular language models, such as GPT-2 and BERT.

Slide 8: How can you get started with ChatGPT?

Mention that OpenAI provides access to pre-trained versions of ChatGPT through their API.
Show examples of how to use the API to generate text or answer questions.

Slide 9: What are the limitations of ChatGPT?

Explain that ChatGPT is not perfect and can sometimes generate incorrect or inappropriate text.
Mention that it's important to carefully monitor and evaluate the output of ChatGPT.

Slide 10: Conclusion
Summarize the main points of the presentation. Encourage the audience to learn more about ChatGPT and consider using it for their own applications.

----------------------------------------------------------------------------------------------
Prompt : can you give any top 5 baby rhymes

Response :

Sure! Here are 5 popular baby rhymes:

  1. Twinkle, Twinkle, Little Star
  • Twinkle, twinkle, little star, How I wonder what you are! Up above the world so high, Like a diamond in the sky. Twinkle, twinkle, little star, How I wonder what you are!
  1. Itsy Bitsy Spider
  • The itsy bitsy spider Climbed up the water spout. Down came the rain And washed the spider out. Out came the sun And dried up all the rain. And the itsy bitsy spider Climbed up the spout again.
  1. Row, Row, Row Your Boat
  • Row, row, row your boat, Gently down the stream. Merrily, merrily, merrily, merrily, Life is but a dream.
  1. Mary Had a Little Lamb
  • Mary had a little lamb, Its fleece was white as snow; And everywhere that Mary went, The lamb was sure to go.
  1. Old MacDonald Had a Farm
  • Old MacDonald had a farm, E-I-E-I-O! And on his farm he had some cows, E-I-E-I-O! With a moo-moo here, and a moo-moo there, Here a moo, there a moo, Everywhere a moo-moo. Old MacDonald had a farm, E-I-E-I-O!

I hope these help! There are many more baby rhymes out there, so feel free to explore and find your favorites.

----------------------------------------------------------------------------------------------

Wednesday, 15 March 2023

React baby Exercises

Ex 1. Simple Displaying A MESSAGE


npm create vite

√ Project name: ... ex1

√ Select a framework: » React

√ Select a variant: » TypeScript

Scaffolding project in C:\Users\rmcme\ex1...

Done. Now run:

cd ex1

npm install

npm run dev

code . to invoke vs code ide


delete the contents of index.css

Replace the contents of App.tsx

with the following

function App() {
  return <h1>Hello React World</h1>;
}
export default App;


in vs code terminal window:

npm install

npm run dev

it will display URL. Open that URL.Will look similar to the given window


Super! We have done the First React !!!


Ex 2. Simple Displaying Array of Names


Replace the contents of App.tsx with


// EX 2
function App() {
  const ceos = [
    { name: "Elon Musk", id: "1" },
    { name: "Bill Gates", id: "2" },
    { name: "Steve Jobs", id: "3" },
  ];

  const ceosNames = ceos.map((ceo) => <li key={ceo.id}>{ceo.name}</li>);

  return (
    <>
      <h3>CEO names</h3>
      <ul>{ceosNames}</ul>
    </>
  );
}

export default App;


You will see browser output similar to the below




Ex 3. Simple Show/Hide DOM Element

Replace the contents of App.tsx with 

//EX 3

import { useState } from "react";
function App() {
  const [show, setShow] = useState(true);
  return (
    <>
      <button onClick={() => setShow(!show)}>
        {show ? "Hide Element below" : "Show Element Below"}
      </button>
      {show && <div>Toggle Challenge </div>}
    </>
  );
}

export default App;



The browser output will be similar to:




once you click the Hide element Button, you can see the browser output similar to:



Ex 4. Data Binding 2 Ways

Replace the contents of App.tsx with 

// EX 4
import { useState } from "react";

function App() {
  const [value, setValue] = useState("");

  return (
    <>
      <input
        type="text"
        placeholder="Enter Text"
        value={value}
        onChange={(e) => setValue(e.target.value)}
      />
      <p>{value}</p>
    </>
  );
}

export default App;

The browser output will be:


 
Once you entered text in text box, the browser output will be 





Ex 5. Enable Button Element 

Replace the contents of App.tsx with 

// EX 5
import { useState } from "react";

function App() {
  const [value, setValue] = useState("");

  return (
    <>
      <h3>No Text No Submit, If "Text" Submit Challenge</h3>
      <input type="text" onChange={(e) => setValue(e.target.value)} />
      <button disabled={value.length < 1}>Submit</button>
    </>
  );
}

export default App;

The browser output will be:




 
Once you entered text in text box, the submit button will be enabled  











React Tutorial Basics

 download node.js and install

check whether it is properly installed by 

node -v

C:\Users\rmcme>node -v

v18.15.0

C:\Users\rmcme>npm create vite

y to proceed

select vite version 4.1

give project name : react-app

select framework: React 

select variant : typescript

C:\Users\rmcme>cd react-app

install vs code

cd react-app

npm i     ----to install

C:\Users\rmcme\react-app\code . to open vs code editor

In VS code Terminal, enter

npm run dev

you will  see similar to this URL: http://localhost:5173/

click the URL to see the webpage to check

Now create a file Meesage.tsx in src folder

add 

/Pascal Casing

function Message() {
    //JSXML

   // const name="RMC";
    if (name)
       return <h1>Hello {name} World</h1>;
    return <h1>Hello World</h1>;
}  
export default Message;


Edit App.tsx file

replace with the following 


import Message from './Message';

function App() {
 
  return <div><Message></Message></div>
 
}

export default App;

You can check in the browser






In terminal window in VS code,

install Bootstrap 

npm i bootstrap@5.2.3


edit App.css

delete the contents and save

edit index.css

delete the contents and save

edit main.tsx

replace

import './index.css'

with 

import 'bootstrap/dist/css/bootstrap.css'


Create a directory components under src

under components create a file ListGroup.tsx

add the following contents:


function ListGroup() {
    return <h1>ListGroup</h1>
}
export default ListGroup;

Edit App.tsx

replace the contents with 

import ListGroup from "./components/ListGroup";
function App() {

  return <div><ListGroup /></div>

}


Replace the contents.


//import {  } from "react";

function ListGroup() {
  // return <h1>ListGroup</h1>

  const items = [
    "Chennai",
    "Bombay",
    "New Delhi",
    "Bangalore",
    "Madurai",
    "Calcutta",
  ];

  return (
    <>
      <h1>List</h1>
      <ul className="list-group">
        {items.map((item) => (
          <li>{item}</li>
        ))}
      </ul>
    </>
  );
}
export default ListGroup;

Check in the Browser and inspect to check the clicked events































Monday, 13 March 2023

Python Stock : NSE

 Introduction to NSE Tools Module in Python

NSE National Stock Exchange of India Limited is the leading stock exchange of India, located in Mumbai, Maharashtra. NSE was established in 1992 as the first dematerialized electronic exchange in the country.

nsetools is a library for collecting real time data from National Stock Exchange of India. 

It can be used in various types of projects which requires fetching live quotes for a given stock or index or building large data sets for further data analytics. 


In order to install nse tools we have to use the command given below 
 

pip install nsetools

Creating a NSE object and Using

 
 # importing nse from nse tools
from nsetools import Nse
 
# creating a Nse object
nse = Nse()
 
# printing Nse object
print(nse)

# Driver Class for National Stock Exchange (NSE)

# getting quote of the sbin
quote = nse.get_quote('sbin')
q1 = nse.get_quote('TATAMOTORS')
# printing company name
print(quote['companyName'])
 
# printing buy price
print("Buy Price : " + str(quote['buyPrice1']))
print("SBIN open : " + str(quote['open']))


print(q1['companyName'])
print("Tata Motors Open : " + str(q1['open']))

Driver Class for National Stock Exchange (NSE)
State Bank of India
Buy Price : None
SBIN open  : 547.0
Tata Motors Limited
Tata Motors Open : 436.1


print(q1)
"""

{'pricebandupper': 479.4, 'symbol': 'TATAMOTORS', 'applicableMargin': 18.43, 'bcEndDate': '09-AUG-16', 'totalSellQuantity': None, 'adhocMargin': None, 'companyName': 'Tata Motors Limited', 'marketType': 'N',
'exDate': '18-JUL-16', 'bcStartDate': '20-JUL-16', 'css_status_desc': 'Listed', 'dayHigh': 437.0, 'basePrice': 435.85, 'securityVar': 14.93, 'pricebandlower': 392.3, 'sellQuantity5': None, 'sellQuantity4': None, 'sellQuantity3': None, 'cm_adj_high_dt': '17-AUG-22', 'sellQuantity2': None, 'dayLow': 419.1, 'sellQuantity1': None, 'quantityTraded': 8780169.0, 'pChange': '-2.93', 'totalTradedValue': 37481.66, 'deliveryToTradedQuantity': 36.45, 'totalBuyQuantity': 2567.0, 'averagePrice': 426.89, 'indexVar': None, 'cm_ffm': 75757.3, 'purpose': 'DIVIDEND - RE 0.20/- PER SHARE', 'buyPrice2': None, 'secDate': '13-Mar-2023 00:00:00', 'buyPrice1': 422.4, 'high52': 494.4, 'previousClose': 435.85, 'ndEndDate': None, 'low52': 366.2,
'buyPrice4': None, 'buyPrice3': None, 'recordDate':
None, 'deliveryQuantity': 3200108.0, 'buyPrice5': None, 'priceBand': 'No Band', 'extremeLossMargin': 3.5, 'cm_adj_low_dt': '12-MAY-22', 'varMargin': 14.93,
'sellPrice1': None, 'sellPrice2': None, 'totalTradedVolume': 8780169.0, 'sellPrice3': None, 'sellPrice4': None, 'sellPrice5': None, 'change': '-12.75', 'surv_indicator': None, 'ndStartDate': None, 'buyQuantity4': None, 'isExDateFlag': False, 'buyQuantity3': None, 'buyQuantity2': None, 'buyQuantity1': 2567.0, 'series': 'EQ', 'faceValue': 2.0, 'buyQuantity5': None, 'closePrice': 422.4, 'open': 436.1, 'isinCode': 'INE155A01022', 'lastPrice': 423.1} """


Automation with Python #1 - WhatsApp

# WHATSAPP AUTOMATION

Step 1: Install pywhatkit


pip install pywhatkit


Step 2: Send a message to a contact on WhatsApp

Before we start sending messages, you have to log in to your WhatsApp account through WhatsApp Web. 

To send a message to a WhatsApp contact with Python and pywhatkit, we use the .sendwhatmsg method as shown in the code below (insert your contact number instead).


import pywhatkit
pywhatkit.sendwhatmsg('+919790215636', 'Hello Sweet Heart', 11, 56)

What this code means is “Type ‘Message 1’ and send it to contact X at 18:52”

After running the code above you’ll get a message like this:

In 10 seconds, web.WhatsApp.com will open, and after 15 seconds, a message will be delivered by Whatsapp.

After some seconds your browser will open and the message will be sent to your contact.

Please Note: When your browser opens, a message to grant access will pop up. You have to accept this message.


Bonus:

import pywhatkit
pywhatkit.sendwhatmsg_to_group("Group-id", "Group Message", 19, 2)


# EXCEL AUTOMATION

pip install openpyxl


Making Prompts for Profile Web Site

  Prompt: Can you create prompt to craft better draft in a given topic. Response: Sure! Could you please specify the topic for which you...