Monday, December 11, 2023

Talk on Artificial Intelligence with Computer Science and Engg. Students

Talk on Artificial Intelligence

  • Introduction
  • History
  • Current Status
  • Future of AI
  • Challenges of AI
  • Pros and Cons.

1. INTRODUCTION

1.1 What is Artificial Intelligence (AI)?

  • Artificial Intelligence refers to the development of computer systems that can perform tasks that typically require human intelligence. These tasks include learning, reasoning, problem-solving, understanding natural language, speech recognition, and visual perception.

1.2 Key Concepts in AI

1.2.1 Machine Learning (ML)
  • ML is a subset of AI that focuses on the development of algorithms allowing computers to learn from data.
  • It involves the creation of models that can make predictions or decisions without being explicitly programmed.
Neural Networks
  • Inspired by the human brain, neural networks are a fundamental part of deep learning—a subset of machine learning.
  • They consist of layers of interconnected nodes (neurons) that process and analyze information.
Natural Language Processing (NLP)
  • NLP enables computers to understand, interpret, and generate human language.
  • Applications include language translation, sentiment analysis, and chatbots.
Computer Vision
  • This field focuses on teaching machines to interpret and make decisions based on visual data, such as images or videos.
  • Applications include image recognition, object detection, and autonomous vehicles.
Robotics
  • AI plays a crucial role in robotics, allowing machines to perceive their environment and make intelligent decisions.
  • Examples include robotic process automation and autonomous robots.

1.3 How to Get Started

1. Foundational Knowledge

Strengthen your programming skills, particularly in languages like Python and C++.

Familiarize yourself with algorithms, data structures, and computer architecture.

2. Learn Machine Learning Basics

Start with the basics of machine learning, understanding concepts like supervised learning, unsupervised learning, and reinforcement learning.

3. Hands-On Projects

Practical experience is crucial. Work on small AI projects to apply your knowledge and build a portfolio.

Explore platforms like Kaggle for real-world datasets and challenges.

4. Explore Specializations

AI is vast, so explore different specializations like computer vision, natural language processing, or reinforcement learning to find your interests.

5. Online Courses and Resources

Enroll in online courses from platforms like Coursera, edX, or Udacity. Popular courses include Andrew Ng's Machine Learning on Coursera.

6. Stay Updated

AI is constantly evolving. Follow reputable blogs, research papers, and conferences to stay informed about the latest developments.

7. Networking

Connect with AI communities, attend meetups, and engage in online forums. Networking helps you learn from others and stay motivated.

2. HISTORY

1. The Birth of AI (1950s)

  • The term "Artificial Intelligence" was coined by computer scientist John McCarthy in 1956 during the Dartmouth Conference.
  • McCarthy, along with Marvin Minsky, Nathaniel Rochester, and Claude Shannon, is considered one of the "founding fathers" of AI.

2. Early AI Concepts:

  • Logic Theorist (1956): Created by Allen Newell and Herbert A. Simon, it was the first AI program, designed to mimic human problem-solving skills.
  • General Problem Solver (1957): Another creation by Newell and Simon, this program could solve a variety of problems.

3. AI Winters (1970s-1980s):

  • Despite early optimism, progress in AI faced challenges, leading to periods known as "AI winters" where funding and interest declined.
  • Limited computational power and the complexity of AI tasks contributed to these setbacks.

4. Expert Systems (1970s-1980s):

  • During AI winters, focus shifted to expert systems—programs that emulated the decision-making abilities of a human expert.
  • MYCIN (1976), an expert system for diagnosing bacterial infections, was a notable success.

5. Rise of Machine Learning (1980s-1990s):

  • AI research saw a resurgence with a focus on machine learning techniques.
  • Backpropagation, a key algorithm for training artificial neural networks, was developed in the 1980s.

6. 1997: Deep Blue vs. Garry Kasparov:

  • IBM's Deep Blue, a chess-playing computer, defeated world champion Garry Kasparov, showcasing the potential of AI in strategic decision-making.

7. 2000s: Big Data and the Rise of Data-Driven AI:

  • The availability of large datasets and increased computing power fueled advancements in data-driven AI, including machine learning and statistical modeling.

8. Deep Learning Revolution (2010s-Present):

  • Deep learning, a subset of machine learning using neural networks with multiple layers, led to breakthroughs in image and speech recognition.
  • Successes include the development of convolutional neural networks (CNNs) and recurrent neural networks (RNNs).

9. AI in Everyday Life:

  • AI technologies have become integral to daily life, with applications in virtual assistants, recommendation systems, autonomous vehicles, and more.

10. Ethical and Societal Implications

  • As AI continues to advance, discussions around ethics, bias, transparency, and responsible AI development have gained prominence.

Future Directions

  • Ongoing research explores explainable AI, quantum computing's impact on AI, and the intersection of AI with other fields like robotics and bioinformatics.

3. CURRENT STATUS

1. Everyday AI:

  • You're probably using AI more than you realize! Virtual assistants like Siri or Alexa, recommendation algorithms on streaming platforms, and even social media feeds that show you personalized content—all these use AI to understand and respond to your preferences.

2. Machine Learning Magic:

  • At the heart of AI is something called "Machine Learning" (ML). Imagine giving a computer the ability to learn from examples and make decisions on its own. ML is like training a computer to recognize patterns and make predictions.

3. Deep Learning

  • A cool part of Machine Learning is "Deep Learning," where computers use artificial neural networks (inspired by the human brain) to process information. This has made breakthroughs in image and speech recognition. It's why your phone can recognize your face or your voice command.

4. Smart Machines

  • AI is making machines smarter. Think about self-driving cars—they use AI to understand the road, make decisions, and navigate safely. That's a big deal and involves a lot of complex AI algorithms.

5. Problem Solvers:

  • AI is excellent at solving problems. It can analyze tons of data quickly to find patterns or help with decision-making. This is handy in areas like healthcare for diagnosing diseases or in finance for predicting market trends.

6. Teaching Computers to Talk:

  • Natural Language Processing (NLP) is another AI field. It's about teaching computers to understand and generate human language. Chatbots, language translation apps—they all use NLP.

7. AI Challenges

  • But, it's not all magic. AI faces challenges like biases in data and the need for huge amounts of data to learn effectively. Imagine if you were only taught one perspective; you might not have a complete understanding. Computers can have the same issue.

8. Future Possibilities:

  • The future of AI is exciting! Researchers are working on making AI more explainable and fair. Also, people are exploring how AI can work with other technologies like robotics to create even more amazing things.

9. Your Role

  • As a computer science student, you can be part of this AI journey. You might develop new algorithms, improve existing ones, or create applications that use AI to solve real-world problems. It's like being a wizard but with computers!

10. Responsibility Matters

  • Lastly, with great power comes great responsibility. Understanding the ethical implications of AI is crucial. As you dive into this field, consider the impact your work can have on society and strive to create technology that benefits everyone.

4. FUTURE OF AI

1. AI Everywhere

  • Imagine AI becoming a helpful friend in almost everything you do. From your home to your workplace, AI might assist you in various tasks, making life more convenient.

2. Smarter Devices

  • Your devices will get even smarter. Your phone might understand you so well that it anticipates your needs before you ask. It's like having a personal assistant that knows you really, really well.

3. Healthcare Revolution

  • AI could play a big role in healthcare. Imagine doctors having super-smart AI tools to help them diagnose diseases faster and more accurately. This could mean quicker and more effective treatments for patients.

4. Self-Improving AI:

  • Picture an AI that doesn't just do what it's programmed for but learns and improves itself over time. It's like a student getting better and better at a subject with each passing day.

5. Creative AI:

  • AI might not just be good at logical stuff but also creative tasks. Think about AI-generated art, music, or even writing. It's like having a robot friend who's an amazing artist.

6. Smart Cities:

  • Entire cities could become smarter with AI. Traffic lights might adjust based on real-time traffic, energy usage might be optimized automatically, making our cities more efficient and eco-friendly.

7. Communication Breakthroughs:

  • Language barriers might become a thing of the past. AI could translate languages in real-time, allowing people from different parts of the world to communicate effortlessly.

8. Exploration Beyond Earth

  • AI might help us explore space. Robots with advanced AI could be sent to distant planets, helping us understand the universe better.

9. Ethical Considerations:

  • But, as AI becomes more powerful, we need to think about its impact on society. How do we make sure it's used ethically and doesn't harm anyone? It's like making sure our superhero (AI) uses its powers for good.

5. CHALLENGES OF AI

1. Bias and Fairness:

  • Imagine teaching a robot using old textbooks that have outdated information. If we train AI systems with biased data, they might make unfair decisions, just like a robot following outdated rules.

2. Lack of Common Sense:

  • AI doesn't have common sense like humans. It might make mistakes because it doesn't understand the world the way we do. Picture an AI trying to understand jokes or sarcasm—it's like explaining humor to a robot.

3. Needing a Lot of Data:

  • AI learns from examples, like a student learning from lots of textbooks. But, what if there aren't enough examples? AI might struggle to understand or make good decisions. It's like trying to learn a new game with only a few moves to study.

4. Explanations and Transparency:

  • Sometimes, AI decisions seem like magic. Understanding why AI made a specific choice can be tough. It's like having a friend who gives you a surprising answer but can't explain how they arrived at it.

5. Security Concerns:

  • Just like protecting your computer from viruses, we need to protect AI from "bad actors." If someone tricks an AI into making wrong decisions, it could have serious consequences.

6. Job Displacement Worries

  • AI is great at repetitive tasks, but some worry it might take over jobs. Picture a robot doing your homework—great for the robot, but not so great for you.

7. Ethical Dilemmas

  • Imagine an AI-powered car having to make a split-second decision in an emergency. What choice should it make? These ethical questions are like giving a robot a moral compass and hoping it makes the right call.

8. Overreliance on AI

  • Relying too much on AI can be risky. If we trust it blindly, we might forget our own skills. It's like letting a GPS guide you everywhere—you might lose the ability to find your way without it.

9. Constant Learning

  • AI needs to keep learning to stay relevant. It's like studying for a test, but the test is always changing. If AI doesn't keep up, it might become outdated and less useful.

10. Privacy Issues:

  • AI often uses a lot of personal data. If not handled carefully, it's like having someone know everything about you. We need to make sure our data is protected, just like keeping our secrets safe.

6. PROS AND CONS

Pros (Advantages)

Efficiency Boost:

Pro: AI can perform repetitive tasks quickly and accurately, saving time and resources. It's like having a super-fast and tireless assistant.

Data Analysis:

Pro: AI can analyze vast amounts of data to identify patterns and trends that humans might miss. It's like having a detective that can sift through mountains of information in no time.

Automation:

Pro: AI enables automation of mundane tasks, freeing humans to focus on more creative and complex activities. It's like having a robot to handle routine chores.

Precision and Accuracy:

Pro: In fields like medicine and manufacturing, AI can perform tasks with high precision and accuracy, reducing errors. It's like having a surgeon with a perfect, steady hand.

24/7 Availability:

Pro: AI systems can work around the clock without needing breaks, providing continuous service. It's like having a tireless worker who never sleeps.

Innovation and Creativity:

Pro: AI can assist in creative tasks, generating new ideas, art, or music. It's like having a brainstorming partner that thinks outside the box.

Personalization:

Pro: AI can personalize experiences, like recommending movies or products based on your preferences. It's like having a knowledgeable friend who knows your taste perfectly.

Assistance in Healthcare:

Pro: AI can help in medical diagnoses and research, improving patient care. It's like having an additional expert in the medical team.

Cons (Disadvantages)

Bias and Fairness:

Con: AI systems can inherit biases from the data they are trained on, leading to unfair outcomes. It's like a mirror reflecting the biases present in society.

Lack of Common Sense:

Con: AI lacks human-like understanding and common sense, sometimes leading to misinterpretations. It's like explaining a joke to someone who takes it literally.

Job Displacement:

Con: Automation by AI may lead to job displacement in certain industries, affecting employment. It's like a robot taking over tasks traditionally done by humans.

Security Concerns:

Con: AI systems can be vulnerable to hacking and misuse, posing security risks. It's like a powerful tool that needs careful handling to prevent misuse.

Ethical Dilemmas:

Con: AI may face moral and ethical decisions, raising questions about responsibility and accountability. It's like giving a machine the ability to make moral choices.

Overreliance:

Con: Overreliance on AI without understanding its limitations can lead to dependency issues. It's like relying too much on a GPS and losing the ability to navigate without it.

Constant Learning Curve:

Con: AI systems need continuous learning and updates to stay relevant, requiring ongoing resources. It's like having to constantly upgrade your computer to keep it effective.

Privacy Issues:

Con: AI often relies on vast amounts of personal data, raising concerns about privacy and data protection. It's like having someone know too much about your personal life.

Tags: Technology,Artificial Intelligence,

Saturday, December 9, 2023

Aloo Toast (Recipe)

1. Boil the potatoes
- Take 4 potatoes in pressure cooker.
- Fill the pressure cooker to just drown the potatoes 
- Put pressure cooker on gas stove for 10-12 minutes

2. Peel the potatoes
3. Chop the onion
4. Take the chopped onion and potato in a saucepan
5. Add salt and red chilli powder as per taste Note: I added two saltspoons of salt and two saltspoons of chilli powder. 6. Mesh the chopped onion and potatoes
7. Spread the meshed onion and potatoes on a slice to make a sandwich formation. 8. Uske baad tawe pe seko 9. Aloo toast ready

Fried Rice (Recipe)

1. Chop the vegetables (onion and tomato) in a chopper

2. Take a small bowl of peas.
3. Fry in 2 soup spoons of Soyabean refined oil 4. Add more salt and red chilli powder as per taste.

Thursday, December 7, 2023

ChatGPT prompts for preparing for job search (Dec 2023)

Say goodbye to endless job searches.

ChatGPT can help you land your dream job twice as fast.

Here are Top 10 Best ChatGPT Prompts for Technical Interview Questions.

Prompt 1: I'm interviewing for [Your Role] at [Company Name]. I have [Your Experience] in [Your Domain]. What are the technical aspects that need to be covered for the technical interview? Give me a list in order.

Prompt 2: Please provide a set of potential questions, expected responses, and relevant insights for a [Your Role] preparing for an interview in a [Company] that specializes in [Company Domain].

Prompt 3: Consider yourself as a hiring manager and ask me questions on [Your Domain], and I'm going to provide an answer. Give me feedback on my answer: What part of my answer stood out? What pieces were missing? What did I do well, and what may I have done differently, in light of best practices for interviews?

Prompt 4: Please provide [Count] potential [Domain] technical interview questions at [Company], along with sample responses and insights.

Prompt 5: Consider yourself as a hiring manager, Shoot me potential questions a [Your Role] might face at [Company], what answers they could provide, and how it shows relevant skills.

Prompt 6: I'm preparing for a [Your Role] interview at [Company]. Can you provide me with [Count] challenging technical questions that are commonly asked in such interviews, along with detailed answers?

Prompt 7: Imagine you are a technical interviewer at [Company] hiring for a [Your Role] position. Could you share the technical interview questions you would ask to assess a candidate's expertise, and what kind of responses you'd be looking for?

Prompt 8: I have an upcoming technical interview at [Company] for a [Your Role] position. Can you provide me with insightful and relevant technical questions that might be asked during the interview, as well as tips on how to approach them effectively?

Prompt 9: As someone experienced in technical interviews for [Your Role] positions at [Company], can you suggest asking me challenging questions that assess my technical knowledge and problem-solving skills, along with strategies to tackle them?

Prompt 10: I'm getting ready for a technical interview at [Company] for a [Your Role] role. Could you please share [Count] technical questions that often come up in these interviews and provide guidance on how to give strong responses?

Preparing for a job interview can be a nerve-wracking experience, but with the help of ChatGPT, it can become a transformative journey toward success.

Friday, December 1, 2023

Coding Interview Books (Dec 2023)

Download Books
1. 
Cracking the coding interview
Authors: Gayle Laakmann McDowell

2.
Elements of Programming Interviews in Java: The Insiders' Guide
Authors: Tsung-Hsien Lee, Adnan Aziz, Amit Prakash

3.
The Algorithm Design Manual
Authors: Steven Skiena

4.
Programming Interviews Exposed
Authors: Noah Kindler, Eric Giguere, John Mongan

5.
Cracking the Coding Interview
Authors: Gayle Laakmann McDowell

6.
Coding Interview Questions
Authors: Narasimha Karumanchi

7.
Programming Pearls
Authors: Jon Bentley

8.
Clean Code
Authors: Robert Cecil Martin

9.
Dynamic Programming for Coding Interviews: A Bottom-Up approach to problem solving
Authors: Kamal Rawat, Meenakshi

10.
Surviving the Whiteboard Interview: A Developer’s Guide to Using Soft Skills to Get Hired
Authors: William Gant

11.
Elements of Programming Interviews

12.
Time Complexity Analysis-Independently published (2021)
Aditya Chatterjee, Ue Kiao

13.
Binary Tree Problems. Must for Interviews and Competitive Coding
Srishti Guleria, Ue Kiao, Aditya Chatterjee 
OpenGenus (2021)

14. 
Technical Interview Skills - Training-Workshop-Part-1
Jack-Dunn and Daisy-Zhou (mit.edu)

15.
The Google Resume_ How to Prepare for a Career and Land a Job at any Top Tech Company
Wiley (2011)
Gayle Laakmann McDowell

Substring in another string (Lesson in Algorithms)

Substring in another string

Problem

Detect if a shorter string is part of a longer string.

Shorter string is the substring.

Longer string is the superstring.

Example

Shorter string is ‘eng’.

Longer string is ‘opengenus’.

‘eng’ is a substring in ‘opengenus’.

‘123’ is not a substring in ‘opengenus’.

Code in Python

# s1 is the superstring
# s2 is the substring

def solution(s1, s2):
    for i in range(len(s1)-len(s2)+1):
        if s1[i:i+len(s2)] == s2:
            return 'Match Found'  

Testing

s1 = 'opengenus'

# Test case: no match found

s2 = '123'

print(s2, solution(s1, s2))

# Test case: single character

s2 = 'p'

print(s2, solution(s1, s2))

# Test case: match substring at the beginning (at index 0)

s2 = 'ope'

print(s2, solution(s1, s2))

# Test case: match substring somewhere in the middle

s2 = 'eng'

print(s2, solution(s1, s2))

# Test case: match substring at the end

s2 = 'nus'

print(s2, solution(s1, s2))

# Test case: match both the strings completely

s2 = 'opengenus'

print(s2, solution(s1, s2))

Output

123 None
p Match Found
ope Match Found
eng Match Found
nus Match Found
opengenus Match Found

Word Meanings : 2023-Dec-1 (14 Words)


Index of Word Meanings
1.
aphorism
/ˈafərɪz(ə)m/
noun
noun: aphorism; plural noun: aphorisms

    a pithy observation which contains a general truth.
    "the old aphorism ‘the child is father to the man’"
    
    Similar:
    saying

maxim
axiom
adage
precept
epigram
epigraph
dictum
gnome
pearl of wisdom
proverb
saw
tag
motto
expression
phrase
formula
apophthegm

    a concise statement of a scientific principle, typically by a classical author.
    "the opening sentence of the first aphorism of Hippocrates"

---

2.

chicanery
/ʃɪˈkeɪn(ə)ri/
noun
noun: chicanery

    the use of deception or subterfuge to achieve one's purpose.
    "storylines packed with political chicanery"
    h
    Similar:
    trickery

deception
deceit
deceitfulness
duplicity
dishonesty
unscrupulousness
underhandedness
subterfuge
fraud
fraudulence
legerdemain
sophistry
sharp practice
skulduggery
swindling
cheating
duping
hoodwinking
deviousness
guile
intrigue
palace intrigue
craft
craftiness
artfulness
slyness
wiles
misleading talk
crookedness
monkey business
funny business
hanky-panky
shenanigans
flimflam
jiggery-pokery
monkeyshines
codology
management

    knavery

Origin
late 16th century: from French chicanerie, from chicaner ‘to quibble’ (see chicane).
Use over time for: chicanery

---

3.

malfeasance
/malˈfiːzns/
nounLaw
noun: malfeasance

    wrongdoing, especially (US) by a public official.

---

4.

incendiary
/ɪnˈsɛndɪəri/
adjective
adjective: incendiary

    1.
    (of a device or attack) designed to cause fires.
    "incendiary bombs"
    h
    Similar:
    combustible

flammable
inflammable
fire-producing
fire-raising
2.
tending to stir up conflict.
"incendiary rhetoric"
h
Similar:
inflammatory
rabble-rousing
provocative
agitational
seditious
subversive
revolutionary
insurrectionary
insurrectionist
arousing
stirring
contentious
controversial

    h
    Opposite:
    conciliatory
        very exciting.
        "an incendiary live performer"

noun
noun: incendiary; plural noun: incendiaries

    1.
    an incendiary bomb or device.
    "the Holy City was blasted by incendiaries"
    h
    Similar:
    explosive

bomb
incendiary device
2.
a person who starts fires.
"he was an English incendiary, responsible for the burning of three French battleships"
h
Similar:
arsonist
fire-bomber
firesetter
pyromaniac
fire-raiser
firebug

---

5.

strenuous
/ˈstrɛnjʊəs/
adjective
adjective: strenuous

    requiring or using great effort or exertion.
    "the government made strenuous efforts to upgrade the quality of the teaching profession"
    h
    Similar:
    arduous

difficult
hard
tough
taxing
demanding
exacting

---

6.

upheaval
/ʌpˈhiːvl/
noun
noun: upheaval; plural noun: upheavals

    1.
    a violent or sudden change or disruption to something.
    "major upheavals in the financial markets"
    h
    Similar:
    disruption

upset
disturbance
trouble
turbulence
disorder
disorganization
confusion
turmoil
pandemonium
bedlam
furore
uproar
disarray
chaos
mayhem
cataclysm
revolution
violent change
sudden change
h
Opposite:
stability

    tranquillity
    2.
    an upward displacement of part of the earth's crust.
    "the first upheaval produced a hill which was called Roof Mountain"

---

7.

imperturbable
/ˌɪmpəˈtəːbəbl/
adjective
adjective: imperturbable

    unable to be upset or excited; calm.
    "an imperturbable tranquillity"
    h
    Similar:
    self-possessed

composed
collected
calm
cool
and collected
as cool as a cucumber
cool-headed
self-controlled
poised
tranquil
serene
relaxed
easy-going
unexcitable
even-tempered
placid
sedate
phlegmatic
unperturbed
unflustered
untroubled
unbothered
unruffled
undismayed
unagitated
undisturbed
unmoved
nonchalant
at ease
unflappable
unfazed
together
laid-back
nonplussed
equanimous
h
Opposite:
edgy

    excitable

Origin
late Middle English: from late Latin imperturbabilis, from in- ‘not’ + perturbare (see perturb).

---

8.

palliative
/ˈpalɪətɪv/
adjective
adjective: palliative

    (of a medicine or form of medical care) relieving symptoms without dealing with the cause of the condition.
    "palliative drugs"
    h
    Similar:
    soothing

alleviating
sedative
calmative
calming
alleviative
alleviatory
lenitive
demulcent
assuasive
mitigatory
mitigative

    paregoric
        (of an action) intended to alleviate a problem without addressing the underlying cause.
        "short-term palliative measures had been taken"

noun
noun: palliative; plural noun: palliatives

    a medicine or form of medical care that relieves symptoms without dealing with the cause of the condition.
    "at present, available treatments are only palliatives and no curative drugs are available yet"
    h
    Similar:
    painkiller

analgesic
pain reliever
sedative
tranquillizer
anodyne
calmative
opiate
bromide
lenitive
demulcent
mitigative

    paregoric
        an action that is intended to alleviate a problem without addressing the underlying cause.
        "social projects presented as palliatives for the urban crisis"

Origin
late Middle English (as an adjective): from French palliatif, -ive or medieval Latin palliativus, from the verb palliare ‘to cloak’ (see palliate).
Use over time for: palliative

---

9.

chasm
/ˈkaz(ə)m/
noun
noun: chasm; plural noun: chasms

    a deep fissure in the earth's surface.
    "a chasm a mile long"
    h
    Similar:
    gorge

abyss
canyon
ravine
gully
gulf
pass
defile
couloir
crevasse
cleft
rift
rent
pit
void
crater
cavity
hole
opening
gap
fissure
crevice
hollow
chine
bunny
clough
gill
thrutch
cleuch
heugh
gulch
coulee
flume
arroyo
barranca
quebrada
nullah
khud
sloot
kloof
donga
khor

    a profound difference between people, viewpoints, feelings, etc.
    "the chasm between rich and poor"
    h
    Similar:
    breach

gulf
rift
division
schism
split
severance
rupture
break
break-up
parting of the ways
separation
disunion
estrangement
alienation
difference
dissension
discord
argument
quarrel

        scission

Origin
late 16th century (denoting an opening up of the sea or land, as in an earthquake): from Latin chasma, from Greek khasma ‘gaping hollow’.
Use over time for: chasm


---

10:

elusive
/ɪˈl(j)uːsɪv/
adjective
adjective: elusive

    difficult to find, catch, or achieve.
    "success will become ever more elusive"
    h
    Similar:
    difficult to catch/find

difficult to track down
evasive
slippery
shifty
always on the move

    cagey
        difficult to remember.
        "the elusive thought he had had moments before"

Origin
early 18th century: from Latin elus- ‘eluded’ (from the verb eludere ) + -ive.
Tip
Similar-sounding words
elusive is sometimes confused with illusive

---

11.

illusive
/ɪˈl(j)uːsɪv/
adjectiveliterary
adjective: illusive

    deceptive; illusory.
    "an illusive haven"

Origin
early 17th century: from medieval Latin illusivus, from Latin illus- ‘mocked’, from the verb illudere (see illusion).
Tip
Similar-sounding words
illusive is sometimes confused with elusive

---

12.

canker sores :

A canker sore is a common form of mouth ulcer, which appears as a painful white or yellow ulcer surrounded by a bright red area. A canker sore sore can be triggered by emotional stress, dietary deficiencies, menstrual periods, hormonal changes, food allergies or trauma in the mouth.

---

13.

rumbling
/ˈrʌmbəlɪŋ,ˈrʌmblɪŋ/
noun
noun: rumbling; plural noun: rumblings

    a continuous deep, resonant sound.
    "the rumbling of wheels in the distance"
        an early indication or rumour of dissatisfaction or incipient change.
        "there are growing rumblings of discontent"

adjective
adjective: rumbling

    making or constituting a deep resonant sound.
    "rumbling trams"

---

14.

devoid
/dɪˈvɔɪd/
adjective
adjective: devoid

    entirely lacking or free from.
    "Lisa kept her voice devoid of emotion"
    h
    Similar:
    lacking

without
free from/of
empty of
vacant of
void of
bare of
barren of
bereft of
drained of
denuded of
deprived of
depleted of
destitute of
bankrupt of
wanting
in need of
minus

    sans

Origin
late Middle English: past participle of obsolete devoid ‘cast out’, from Old French devoidier .
Use over time for: devoid

Wednesday, November 29, 2023

2.2 - Odd occurrences in an array

Odd Occurrences in an Array

Problem

A non-empty array A consisting of N integers is given. The array contains an odd number of elements, and each element of the array can be paired with another element that has the same value, except for one element that is left unpaired.

Write a function:

def solution(A)

that, given an array A consisting of N integers fulfilling the above conditions, returns the value of the unpaired element.

For example, given array A such that:

A[0] = 9 A[1] = 3 A[2] = 9 A[3] = 3 A[4] = 9 A[5] = 7 A[6] = 9

the function should return 7, as explained in the next slide.

Write an efficient algorithm for the following assumptions:

N is an odd integer within the range [1..1,000,000];

each element of array A is an integer within the range [1..1,000,000,000];

all but one of the values in A occur an even number of times.

Example

For example, in array A such that:

A[0] = 9 A[1] = 3 A[2] = 9

A[3] = 3 A[4] = 9 A[5] = 7

A[6] = 9

the elements at indexes 0 and 2 have value 9,

the elements at indexes 1 and 3 have value 3,

the elements at indexes 4 and 6 have value 9,

the element at index 5 has value 7 and is unpaired.

Trick: Use of Key-Value Pair and a Set

The Key-Value pair in the heading could be a dictionary (dict) in Python (or HashMap in Java).

We would need to traverse the input array once and maintain two data structures (a dict and a set).

Dict named counts: would contain the elements as keys

Set named odds: would contain the elements whose number of occurrences are found to be odd.

Note during the program’s lifetime, size of set ‘odds’ would change but by the end of iteration, there would be only one element in it.

Java Based Code of a Variant of The Solution From My Friend Rohit

import java.util.*; 
class Solution { 
 public int solution(int[] A) { 
  Map<Integer, Integer> integerMap = new HashMap<Integer, Integer>(); 
  for (int i = 0; i < A.length; A++)) {
   if (!integerMap.containsKey(A[i])) { 
    integerMap.put(A[i], 1); 
   } 
   else { 
    int count = integerMap.get(A[i]);      	 
    integerMap.put(A[i], count + 1); 
  }
  int missingNumber = 0; 
  for (Map.Entry<Integer, Integer> map : integerMap.entrySet()) 
  { 
   if (map.getValue() % 2 == 1) { 
    missingNumber = map.getKey(); 
  } 
  return missingNumber; 
 }
}  

In Python Code

def solution(A):
    counts = dict()
    odds = set()

    for i in A:
        if i in counts:
            counts[i] += 1
        else:
            counts[i] = 1

        if counts[i] % 2 == 1:
            odds.add(i)
        else:
            odds.remove(i)

    return odds.pop()  

Time Complexity

Detected time complexity:

O(N) or O(N*log(N))

Test Cases

-simple1

simple test n=5

-extreme_single_item

[42]

-small1

small random test n=201

- medium1

medium random test n=2,001

big1

big random test n=999,999, multiple repetitions

-big2

big random test n=999,999

Tags: Technology,Algorithms,

2.1 - Cyclic rotation (Problem of Arrays)

Cyclic Rotation

Problem

An array A consisting of N integers is given. Rotation of the array means that each element is shifted right by one index, and the last element of the array is moved to the first place. For example, the rotation of array A = [3, 8, 9, 7, 6] is [6, 3, 8, 9, 7] (elements are shifted right by one index and 6 is moved to the first place).

The goal is to rotate array A K times; that is, each element of A will be shifted to the right K times.

Write a function:

def solution(A, K)

that, given an array A consisting of N integers and an integer K, returns the array A rotated K times.

Assume that:

N and K are integers within the range [0..100];

each element of array A is an integer within the range [−1,000..1,000].

In your solution, focus on correctness. The performance of your solution will not be the focus of the assessment.

Example

For example, given

A = [3, 8, 9, 7, 6]

K = 3

the function should return [9, 7, 6, 3, 8]. Three rotations were made:

[3, 8, 9, 7, 6] -> [6, 3, 8, 9, 7]

[6, 3, 8, 9, 7] -> [7, 6, 3, 8, 9]

[7, 6, 3, 8, 9] -> [9, 7, 6, 3, 8]

For another example, given

A = [0, 0, 0]

K = 1

the function should return [0, 0, 0]

Given

A = [1, 2, 3, 4]

K = 4

the function should return [1, 2, 3, 4]

The Modulus Trick

Instead of writing code to move each element multiple times towards their final state, we move each element once to their final position.

We swap the elements using the following formula:

B[ (i+K) % len(A) ] = A[i]

Note: % is the modulus operator that basically returns the remainder from the division operation (as in long division method)

In Code

def solution(A, K):
    rtn = [0 for i in A]

    for i in range(len(A)):
        rtn[(i + K) % len(A)] = A[i]
    return rtn

Test Cases

print(solution([1,2,3], 1))

print(solution([3, 8, 9, 7, 6], 3))

print(solution([0, 0, 0], 1))

[3, 1, 2]

[9, 7, 6, 3, 8]

[0, 0, 0]

Other Test Case Types

-extreme_empty

empty array

-single

one element, 0 <= K <= 5

-double

two elements, K <= N

-small1

small functional tests, K < N

-small_random_all_rotations

small random sequence, all rotations, N = 15

-medium_random

medium random sequence, N = 100

-maximal

maximal N and K

Tags: Algorithms,Technology,

Tuesday, November 28, 2023

Binary Gap (Problem of Iterations) - Lesson in Algorithms Analysis and Design

Binary Gap

Find longest sequence of zeros in binary representation of an integer.

Problem

A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N.

For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains two binary gaps: one of length 4 and one of length 3. The number 20 has binary representation 10100 and contains one binary gap of length 1. The number 15 has binary representation 1111 and has no binary gaps. The number 32 has binary representation 100000 and has no binary gaps.

Write a function:

def solution(N)

that, given a positive integer N, returns the length of its longest binary gap. The function should return 0 if N doesn't contain a binary gap.

Write an efficient algorithm for the following assumptions:

N is an integer within the range [1..2,147,483,647].

Example

For example, given N = 1041

The function should return 5, because N has binary representation 10000010001 and so its longest binary gap is of length 5.

Given N = 32

The function should return 0, because N has binary representation '100000' and thus no binary gaps.

Ideas For Code

Step 1: A binary gap can be represented using the RegEx:

1(0+)1

But this pattern would not be suffice because it would not work for a binary like: 10001001

As here the second one is part of two Binary Gaps (First ‘10001’ and second ‘1001’).

So we reduce the pattern to: 10+

This is to prevent overlap between binary gaps we want to capture.

Step 2: Find all such patterns in the binary of the integer

Step 3: Check if there is a closing one at the end

Step 4: Store the lengths of all such binary gaps

Step 5: Return the maximum length

Python Code (Version 1)

import re

pattern = re.compile("10+")

def solution(N):

    n = str(bin(N))[2:]
    matches = re.finditer(pattern, n)
    matches_ = []
    lengths = []
    for i in matches:
        if(len(n) > i.span()[1]):
            if(n[i.span()[1]] == '1'):
                matches_.append(i.group())
                lengths.append(i.group().count('0'))

    if len(lengths) > 0:
        rtn = max(lengths)
    else:
        rtn = 0
    return rtn  

Can we do better?

Here in the Step 5 and 6: Where we want to print the maximum length

Here the Space Complexity is of the order of n, O(n) (number of binary gaps in input)

Step 5: Instead of storing all the lengths, we can simply store the maximum length across all the binary gaps.

Step 6: Return the maximum length obtained in Step 5

Also, there is added Time Complexity of finding the maximum length from all the accumulated lengths.

Python Code (Version 2)

import re

pattern = re.compile("10+")

def solution(N):

    n = str(bin(N))[2:]
    matches = re.finditer(pattern, n)
    matches_ = []
    
    max_length = 0

    for i in matches:
        if(len(n) > i.span()[1]):
            if(n[i.span()[1]] == '1'):
                matches_.append(i.group())
                if i.group().count('0') > max_length:
                    max_length = i.group().count('0')

    return max_length

Test Cases

- extremes

n=1, n=5=101_2 and n=2147483647=2**31-1

- trailing_zeroes

n=6=110_2 and n=328=101001000_2

- power_of_2

n=5=101_2, n=16=2**4 and n=1024=2**10

- simple1

n=9=1001_2 and n=11=1011_2

- medium1

n=51712=110010100000000_2 and n=20=10100_2

- large1

n=6291457=11000000000000000000001_2

Test Results

print("Testing...")

print(solution(1041))

print(solution(15))

print(solution(32))

print(solution(1))

print(solution(2147483647))

print(solution(6291457))

print(solution(74901729))

print(solution(805306373))

print(solution(1376796946))

print(solution(1073741825))

print(solution(1610612737))

Testing...

5

0

0

0

0

20

4

25

5

29

28

Future Scope

  • How can we implement the same thing in JavaScript?
  • How can we implement the same thing in Java?

Homework

Generate 10 random natural numbers and return the maximum number generated.

Tags: Algorithms,Technology

Monday, November 27, 2023

Psychology of Money (by Morgan Housel) - Summary

Translate this page:

Before we begin to summarize the book... 
First, let me tell you a story about a dentist appointment gone horribly awry.

It teaches us something vital about the dangers of giving advice about what to do with your money.
Clarence Hughes went to the dentist in 1931. His mouth was radiating pain.
His dentist put him under crude anesthesia to ease the pain. When Clarence awoke hours later he had 16 fewer teeth and his tonsils removed.

And then everything went wrong. Clarence died a week later from his surgery's complications.

His wife sued the dentist, but not because the surgery went awry. Every surgery risked death in 1931.
Clarence, she said, never consented to the procedures in the first place, and wouldn't if he were asked.

The case wove through courts, but went nowhere. Consent between doctor and patient wasn't black and white in 1931. One court summed up the idea that doctors require freedom to make the best medical decisions: “Without such, we could not enjoy the advancement of science.”

For most of history the ethos of medicine was that the doctor's job was to fix the patient, and what the patient thought about the doctor's treatment plans wasn't relevant. Dr. Jay Katz wrote about the philosophy in his book The Silent World Between Doctor and Patient:Doctors felt that in order to accomplish that objective they were obligated to attend to their patients' physical and emotional needs and to do so on their own authority, without consulting with their patients about the decisions that needed to be made. The idea that patients may also be entitled to sharing the burdens of decisions with their doctors was never part of the ethos of medicine.

This wasn't ego or malice. It was a belief in two points: Every patient wants to be cured.
There is a universal and right way to cure them.
Not requiring patient consent in treatment plans makes sense if you believe in those two points.
But that's not how medicine works.

In the last 50 years medical schools subtly shifted teaching away from treating disease and toward treating patients. That meant laying out the options of treatment plans, and then letting the patient decide the best path forward.

This trend was partly driven by patient-protection laws, partly by Katz's influential book, which argued that patients have wildly different views about what's worth it in medicine, so their beliefs have to be taken into consideration. Katz wrote:It is dangerous nonsense to assert that in the practice of their art and science physicians can rely on their benevolent intentions, their abilities to judge what is the right thing to do ... It is not that easy. Medicine is a complex profession and the interactions between physicians and patients are also complex.

That last line is important. “Medicine is a complex profession and the interactions between physicians and patients are also complex.”
You know what profession is the same? Financial advice.
I can't tell you what to do with your money, because I don't know you.
I don't know what you want. I don't know when you want it. I don't know why you want it.

So I'm not going to tell you what to do with your money. I don't want to treat you like a dentist treated Clarence Hughes.

But doctors and dentists aren't useless, obviously. They have knowledge.
They know the odds. They know what tends to work, even if patients come to different conclusions about what kind of treatment is right for them.
Financial advisors are the same. There are universal truths in money, even if people come to different conclusions about how they want to apply those truths to their own finances.
With that caveat in place, let's look at a few short recommendations that can help you make better decisions with your money.

1.
Go out of your way to find humility when things are going right and forgiveness/compassion when they go wrong. Because it's never as good or as bad as it looks. The world is big and complex. Luck and risk are both real and hard to identify. Do so when judging both yourself andothers. Respect the power of luck and risk and you'll have a better chance of focusing on things you can actually control. You'll also have a better chance of finding the right role models.

2.
Less ego, more wealth. Saving money is the gap between your ego and your income, and wealth is what you don't see. So wealth is created by suppressing what you could buy today in order to have more stuff or more options in the future. No matter how much you earn, you will never build wealth unless you can put a lid on how much fun you can have with your money right now, today.

3.
Manage your money in a way that helps you sleep at night. That's different from saying you should aim to earn the highest returns or save a specific percentage of your income. Some people won't sleep well unless they're earning the highest returns; others will only get a good rest if they're conservatively invested. To each their own. But the foundation of, “does this help me sleep at night?” is the best universal guidepost for all financial decisions.

4.
If you want to do better as an investor, the single most powerful thing you can do is increase your time horizon. Time is the most powerful force in investing. It makes little things grow big and big mistakes fade away. It can't neutralize luck and risk, but it pushes results closer towards what people deserve.

5.
Become OK with a lot of things going wrong. You can be wrong half the time and still make a fortune, because a small minority of things account for the majority of outcomes. No matter what you're doing with your money you should be comfortable with a lot of stuff not working. That's just how the world is. So you should always measure how you've done by looking at your full portfolio, rather than individual investments. It is fine to have a large chunk of poor investments and a few outstanding ones. That's usually the best-case scenario. Judging how you've done by focusing on individual investments makes winners look more brilliant than they were, and losers appear more regrettable than they should.

6.
Use money to gain control over your time, because not having control of your time is such a powerful and universal drag on happiness. The ability to do what you want, when you want, with who you want, for as long as you want to, pays the highest dividend that exists in finance.

7.
Be nicer and less flashy. No one is impressed with your possessions as much as you are. You might think you want a fancy car or a nice watch.
But what you probably want is respect and admiration. And you're more likely to gain those things through kindness and humility than horsepower and chrome.

8.
Save. Just save. You don't need a specific reason to save. It's great to save for a car, or a downpayment, or a medical emergency. But saving for things that are impossible to predict or define is one of the best reasons to save. Everyone's life is a continuous chain of surprises.
Savings that aren't earmarked for anything in particular is a hedge against life's inevitable ability to surprise the hell out of you at the worst possible moment.

9.
Define the cost of success and be ready to pay it. Because nothing worthwhile is free. And remember that most financial costs don't have visible price tags. Uncertainty, doubt, and regret are common costs in the finance world. They're often worth paying. But you have to view them as fees (a price worth paying to get something nice in exchange) rather than fines (a penalty you should avoid).

10.
Worship room for error. A gap between what could happen in the future and what you need to happen in the future in order to do well is what gives you endurance, and endurance is what makes compounding magic over time. Room for error often looks like a conservative hedge, but if it keeps you in the game it can pay for itself many times over.

11.
Avoid the extreme ends of financial decisions. Everyone's goals and desires will change over time, and the more extreme your past decisions were the more you may regret them as you evolve.

12.
You should like risk because it pays off over time. But you should be paranoid of ruinous risk because it prevents you from taking futurerisks that will pay off over time.

13.
Define the game you're playing, and make sure your actions are not being influenced by people playing a different game.

14.
Respect the mess. Smart, informed, and reasonable people can disagree in finance, because people have vastly different goals and desires. There is no single right answer; just the answer that works for you.

Thank you!
Tags: Book Summary,Finance,

Friday, November 24, 2023

Hour One With SQLite Database

What does SQLite database contain?

SQLite Database has data stored in it in the form of tables.

What does a table contain?

It contains rows and columns.

A row is also called a record or tuple.

A column is also called an attribute.

Let's say we have a table called 'marks'.

What all columns can table of marks contain?

1. Year

2. Class

3. Subject

4. Marks

Four Basic Types of Operations We Do in Databases

Assuming you have a database with you:

Insert: To add or create a new record or tuple in your database.

Select: To read a records or tuples present in the database.

Update: To change an existing record or tuple in your database.

Delete: To remove or delete a record or tuple from the database.

Can be remembered using the acronym: CRUD for Create, Read, Update, Delete

Single File For Storing a Database

Note: SQLite uses a single file for storing data related a database. For example: we have two databases with us and there names are 'marks.db' and 'sharks.db'.

(base) ashish@ashish:~/Desktop/ws/sqlite_db$ ls

marks.csv marks.db sharks.db

(base) ashish@ashish:~/Desktop/ws/sqlite_db$

Creating a Database file and Creating a Table

(base) ashish@ashish:~$ sqlite3 sharks.db

# Here, sqlit3 is your application and sharks.db is the filename for that application to open.

SQLite version 3.39.3 2022-09-05 11:02:23
Enter '.help' for usage hints.

sqlite> CREATE TABLE sharks(id integer NOT NULL, name text NOT NULL, sharktype text NOT NULL, length integer NOT NULL);

INSERT INTO sharks VALUES (1, 'Sammy', 'Greenland Shark', 427);
INSERT INTO sharks VALUES (2, 'Alyoshka', 'Great White Shark', 600);
INSERT INTO sharks VALUES (3, 'Himari', 'Megaladon', 1800);

sqlite> select * from sharks;


1|Sammy|Greenland Shark|427
2|Alyoshka|Great White Shark|600
3|Himari|Megaladon|1800    

sqlite>

(base) ashish@ashish:~/Desktop/ws/sqlite_db$ sqlite3 sharks.db

SQLite version 3.39.3 2022-09-05 11:02:23

Enter '.help' for usage hints.

sqlite> .schema sharks

CREATE TABLE sharks(id integer NOT NULL, name text NOT NULL, sharktype text NOT NULL, length integer NOT NULL);

sqlite>

Viewing the Structure of a Table

Exploring a Database file

(base) ashish@ashish:~/Desktop/ws/sqlite_db$ sqlite3 sharks.db

SQLite version 3.39.3 2022-09-05 11:02:23

Enter '.help' for usage hints.

sqlite> .tables

sharks

sqlite> select * from sharks;

1|Sammy|Greenland Shark|427

2|Alyoshka|Great White Shark|600

3|Himari|Megaladon|1800

sqlite> ^Z

[3]+ Stopped sqlite3 sharks.db

(base) ashish@ashish:~/Desktop/ws/sqlite_db$ sqlite3 marks.db

SQLite version 3.39.3 2022-09-05 11:02:23

Enter '.help' for usage hints.

sqlite> .tables

marks

sqlite> select * from marks;

2023|8|english|75

2023|8|math|85

2023|8|computer|90

2022|7|english|90

2022|7|math|85

2022|7|computer|95

2023|8|physics|99

2023|8|chemistry|97

2023|8|biology|95

sqlite>

Import a CSV file

(base) ashish@ashish:~/Desktop/ws/sqlite_db$ sqlite3 marks.db
SQLite version 3.39.3 2022-09-05 11:02:23
Enter '.help' for usage hints.
sqlite>
sqlite> .tables
sqlite> .mode csv
sqlite> .import ./marks.csv marks

First line in marks.csv should contain the header with column names.

sqlite> .tables

marks

sqlite>

sqlite> select * from marks;

2023,8,english,75

2023,8,math,80

2023,8,computer,90

2022,7,english,90

2022,7,math,85

2022,7,computer,95

sqlite>

Inserting a single row

sqlite> .schema marks

CREATE TABLE IF NOT EXISTS 'marks' ('year' TEXT, 'class' TEXT, 'subject' TEXT, 'marks' TEXT);

sqlite>

sqlite> insert into marks (year, class, subject, marks) values (2023, 8, 'sanskrit', 90);

sqlite> select * from marks;

2023|8|english|75

2023|8|math|80

2023|8|computer|90

2022|7|english|90

2022|7|math|85

2022|7|computer|95

2023|8|sanskrit|90

sqlite>

Inserting multiple rows

sqlite> insert into marks (year, class, subject, marks) values (2023, 8, 'physics', 99), (2023, 8, 'chemistry', '97'), (2023, 8, 'biology', 95);

sqlite> select * from marks;

2023|8|english|75

2023|8|math|80

2023|8|computer|90

2022|7|english|90

2022|7|math|85

2022|7|computer|95

2023|8|sanskrit|90

2023|8|physics|99

2023|8|chemistry|97

2023|8|biology|95

Selection and Filtering

sqlite> select * from marks where marks > 90;

2022|7|computer|95

2023|8|physics|99

2023|8|chemistry|97

2023|8|biology|95

sqlite> select * from marks where class = 8;

2023|8|english|75

2023|8|math|80

2023|8|computer|90

2023|8|sanskrit|90

2023|8|physics|99

2023|8|chemistry|97

2023|8|biology|95

Update

sqlite> select * from marks where class = 8 and subject = 'math';

2023|8|math|80

sqlite>

sqlite> update marks set marks = marks + 5 where class = 8 and subject = 'math';

sqlite> select * from marks where class = 8 and subject = 'math';

2023|8|math|85

Deleting a record

sqlite> select count(*) from marks where subject = 'sanskrit';

1

sqlite> select * from marks where subject = 'sanskrit';

2023|8|sanskrit|90

sqlite> delete from marks where subject = 'sanskrit';

sqlite> select * from marks where subject = 'sanskrit';

sqlite> select count(*) from marks where subject = 'sanskrit';

0

sqlite>

Cursor

Row Num

0:ID

1:Name

2:SharkType

3:Length

0

1

Sammy

Greenland Shark

427

1

2

Alyoshka

Great White Shark

600

2

3

Himari

Megaladon

1800

[0][0]

[0][1]

[0][2]

[0][3]

[1][0]

[1][1]

[1][2]

[1][3]

[2][0]

[2][1]

[2][2]

[2][3]

A cursor allows us to iterate over a table.

And, a table can be viewed as a list of rows.

And, a row can be viewed as a tuple of cells.

In Code (Part 1)

import sqlite3

conn = sqlite3.connect('sharks.db')

print('Opened database successfully')

cursor = conn.execute('SELECT id, name, sharktype, length FROM sharks')

for row in cursor:

print('ID = ', row[0])

print('NAME = ', row[1])

print('SHARKTYPE = ', row[2])

print('LENGTH = ', row[3])

print('\n')

print('Operation done successfully')

conn.close()

Output

Opened database successfully

ID = 1

NAME = Sammy

SHARKTYPE = Greenland Shark

LENGTH = 427

ID = 2

NAME = Alyoshka

SHARKTYPE = Great White Shark

LENGTH = 600

ID = 3

NAME = Himari

SHARKTYPE = Megaladon

LENGTH = 1800

Operation done successfully

Tags: Technology,Database,

Know Your Linux Hardware Using inxi

On Ubuntu

(base) ashish@ashish:~$ inxi Command 'inxi' not found, but can be installed with: sudo apt install inxi (base) ashish@ashish:~$ inxi CPU: dual core Intel Core i5-4300U (-MT MCP-) speed/min/max: 798/800/2900 MHz Kernel: 6.2.0-37-generic x86_64 Up: 2h 16m Mem: 3127.7/7624.3 MiB (41.0%) Storage: 223.57 GiB (45.9% used) Procs: 241 Shell: Bash inxi: 3.3.13 (base) ashish@ashish:~$ inxi -Fxz System: Kernel: 6.2.0-37-generic x86_64 bits: 64 compiler: N/A Desktop: GNOME 42.9 Distro: Ubuntu 22.04.3 LTS (Jammy Jellyfish) Machine: Type: Laptop System: LENOVO product: 20ARS2C00D v: ThinkPad T440s serial: <superuser required> Mobo: LENOVO model: 20ARS2C00D v: 0B98401 WIN serial: <superuser required> UEFI-[Legacy]: LENOVO v: GJET79WW (2.29 ) date: 09/03/2014 Battery: ID-1: BAT0 charge: 18.0 Wh (98.4%) condition: 18.3/23.2 Wh (79.0%) volts: 12.1 min: 11.1 model: SONY 45N1111 status: Not charging ID-2: BAT1 charge: 1.4 Wh (63.6%) condition: 2.2/23.5 Wh (9.3%) volts: 12.4 min: 11.4 model: LGC 45N1127 status: Charging CPU: Info: dual core model: Intel Core i5-4300U bits: 64 type: MT MCP arch: Haswell rev: 1 cache: L1: 128 KiB L2: 512 KiB L3: 3 MiB Speed (MHz): avg: 1074 high: 1896 min/max: 800/2900 cores: 1: 800 2: 1896 3: 800 4: 800 bogomips: 19953 Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx Graphics: Device-1: Intel Haswell-ULT Integrated Graphics vendor: Lenovo driver: i915 v: kernel bus-ID: 00:02.0 Device-2: Lite-On Integrated Camera type: USB driver: uvcvideo bus-ID: 2-8:2 Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: modesetting unloaded: fbdev,vesa gpu: i915 resolution: 1600x900~60Hz OpenGL: renderer: Mesa Intel HD Graphics 4400 (HSW GT2) v: 4.6 Mesa 23.0.4-0ubuntu1~22.04.1 direct render: Yes Audio: Device-1: Intel Haswell-ULT HD Audio vendor: Lenovo driver: snd_hda_intel v: kernel bus-ID: 00:03.0 Device-2: Intel 8 Series HD Audio vendor: Lenovo driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 Sound Server-1: ALSA v: k6.2.0-37-generic running: yes Sound Server-2: PulseAudio v: 15.99.1 running: yes Sound Server-3: PipeWire v: 0.3.48 running: yes Network: Device-1: Intel Ethernet I218-LM vendor: Lenovo ThinkPad X240 driver: e1000e v: kernel port: 3080 bus-ID: 00:19.0 IF: enp0s25 state: down mac: <filter> Device-2: Intel Wireless 7260 driver: iwlwifi v: kernel bus-ID: 03:00.0 IF: wlp3s0 state: up mac: <filter> Drives: Local Storage: total: 223.57 GiB used: 102.66 GiB (45.9%) ID-1: /dev/sda vendor: Western Digital model: WDS240G2G0A-00JH30 size: 223.57 GiB Partition: ID-1: / size: 218.51 GiB used: 102.65 GiB (47.0%) fs: ext4 dev: /dev/sda3 ID-2: /boot/efi size: 512 MiB used: 6.1 MiB (1.2%) fs: vfat dev: /dev/sda2 Swap: ID-1: swap-1 type: file size: 2 GiB used: 0 KiB (0.0%) file: /swapfile Sensors: System Temperatures: cpu: 45.0 C mobo: N/A Fan Speeds (RPM): fan-1: 0 Info: Processes: 240 Uptime: 2h 17m Memory: 7.45 GiB used: 3.09 GiB (41.5%) Init: systemd runlevel: 5 Compilers: gcc: 11.4.0 Packages: 2138 Shell: Bash v: 5.1.16 inxi: 3.3.13 $ free -h total used free shared buff/cache available Mem: 7.4Gi 2.3Gi 1.5Gi 473Mi 3.6Gi 4.4Gi Swap: 2.0Gi 0B 2.0Gi (base) ashish@ashish:~$ --- --- --- --- ---

On Termux on Android Tablet PC by Samsung

$ inxi Use of uninitialized value $sc_freq_max[0] in join or string at /data/data/com.termux/files/usr/bin/inxi line 10313. CPU: 2x 6-core AArch64 (-MT MCP AMP-) speed/min/max: 961/614:1229/2002 MHz Kernel: 4.14.199-27204164-abX205XXU3CWI3 aarch64 Up: 17m Mem: 1.65/2.45 GiB (67.4%) Storage: 15.52 GiB/Total N/A Procs: 2 Shell: Bash inxi: 3.3.31 $ inxi -Fxz System: Kernel: 4.14.199-27204164-abX205XXU3CWI3 arch: aarch64 bits: 64 compiler: N/A Console: pty pts/0 Distro: Android Machine: Type: ARM System: UNISOC T618 Use of uninitialized value in string eq at /data/data/com.termux/files/usr/bin/inxi line 10234. inxi line 10313. CPU: Info: 2x 6-core model: AArch64 bits: 64 type: MT MCP AMP arch: aarch64 rev: 0 Speed (MHz): avg: 961 high: 2002 min/max: 614:1229/2002 boost: disabled cores: 1: 614 2: 614 3: 614 4: 614 5: 614 6: 614 7: 2002 8: 2002 bogomips: 416 Features: Use -f option to see features Graphics: Message: No ARM data found for this feature. Display: server: No display server data found. Headless machine? tty: 80x40 API: N/A Message: No API data available in console. Headless machine? Audio: Message: No ARM data found for this feature. Network: Message: No ARM data found for this feature. Drives: Local Storage: total: 0 KiB used: 15.52 GiB Partition: ID-1: / size: 3.68 GiB used: 3.66 GiB (99.5%) fs: ext4 dev: /dev/dm-4 ID-2: /cache size: 303.1 MiB used: 26 MiB (8.6%) fs: ext4 dev: /dev/mmcblk0p52 Swap: Alert: No swap data was found. Sensors: Src: lm-sensors Missing: Required tool sensors not installed. Check --recommends Info: Processes: 2 Uptime: 18m Memory: total: N/A available: 2.45 GiB used: 1.65 GiB (67.3%) Init: N/A Compilers: N/A Packages: 61 Shell: Bash v: 5.0.18 inxi: 3.3.31 $
Tags: Technology,Linux,