Basic English phrases

texts below are from © Basic phrases

1

Here are some basic English phrases which you can use in everyday conversation, as well as some common words you will see on signs.

  • yes
  • no
  • maybe or perhaps
  • please
  • thanks
  • thank you
  • thanks very much
  • thank you very much

2

The following are some polite ways you can reply to someone who thanks you:

  • you’re welcome
  • don’t mention it
  • not at all

Saying hello and goodbye

3

Here are some different ways to greet people:

  • hi (quite informal)
  • hello
  • good morning (used before noon)
  • good afternoon (used between noon and 6pm)
  • good evening (used after 6pm)

4

The following expressions, on the other hand, are some different things you can say when saying goodbye:

  • bye
  • goodbye
  • goodnight
  • see you!
  • see you soon!
  • see you later!
  • have a nice day!
  • have a good weekend!

Getting someone’s attention and apologising

5

  • excuse me (can be used to get someone’s attention, to get past someone, or to apologise)
  • sorry

6

If someone apologises to you, you can reply using one of the following expressions:

  • no problem
  • it’s OK or that’s OK
  • don’t worry about it

7 Making yourself understood

  • do you speak English?
  • I don’t speak English
  • I don’t speak much English
  • I only speak very little English
  • I speak a little English
  • please speak more slowly
  • please write it down
  • could you please repeat that?
  • I understand
  • I don’t understand

8 Other basic phrases

  • I know
  • I don’t know
  • excuse me, where’s the toilet?
  • excuse me, where’s the Gents?
  • excuse me, where’s the Ladies?

9 Things you might see

  • Entrance
  • Exit
  • Emergency exit
  • Push
  • Pull
  • Toilets
  • WC
  • Gentlemen (often abbreviated to Gents)
  • Ladies
  • Vacant
  • Occupied or Engaged
  • Out of order
  • No smoking
  • Private
  • No entry

Senior physicists on superstring theory

楊振寧

The party is over.

高能物理盛宴已過。

超弦理论提不出任何可观测的物理量供实验检验。

就科學的規範而言,超弦理論還不如地心說。今天,我們認為地心說是不正確的,但是地心說完全是依據科學的範式提出來的,也能解釋許多現象。而弦理論,為了統一四種力,弦理論不得不引入十一維時空,其合理性還不如地心說。

多数物理学家,包括我在内,认为超对称粒子的存在只是一个猜想,没有任何实验根据,希望用极大对撞机发现此猜想中的粒子更只是猜想加猜想。

不建超大对撞机,高能物理就完全没有前途了吗?不然。我认为至少有两个方向值得探索:A.寻找新加速器原理。B.寻找美妙的几何结构,如弦理论所研究的。这两方面的研究都不那么费钱,符合当今世界经济发展的总趋势。

Sheldon Lee Glashow

It’s something that began to develop in the ‘80s, grew in the ‘90s, and today attracts many of the best and brightest physicists. It’s called superstring theory and it is, so far as I can see, totally divorced from experiment or observation. If not totally divorced, pretty well divorced. They will deny that, these string theorists. They will say, “We predicted the existence of gravity.” Well, I knew a lot about gravity before there were any string theorists, so I don’t take that as a prediction.

The string theorists have a theory that appears to be consistent and is very beautiful, very complex, and I don’t understand it. It gives a quantum theory of gravity that appears to be consistent but doesn’t make any other predictions. That is to say, there ain’t no experiment that could be done nor is there any observation that could be made that would say, “You guys are wrong.” The theory is safe, permanently safe. I ask you, is that a theory of physics or a philosophy?

There is today a disconnect in the world of physics. Let me put it bluntly. There are physicists, and there are string theorists. Of course the string theorists are physicists, but the string theorists in general will not attend lectures on experimental physics. They will not be terribly concerned about the results of experiments. They will talk to one another.

Freeman Dyson on String Theorists, Birds and Frogs

I would like to say a few words about string theory. Few words, because I know very little about string theory. I never took the trouble to learn the subject or to work on it myself. But when I am at home at the Institute for Advanced Study in Princeton, I am surrounded by string theorists, and I sometimes listen to their conversations. Occasionally I understand a little of what they are saying. Three things are clear. First, what they are doing is first-rate mathematics. The leading pure mathematicians, people like Michael Atiyah and Isadore Singer, love it. It has opened up a whole new branch of mathematics, with new ideas and new problems. Most remarkably, it gave the mathematicians new methods to solve old problems that were previously unsolvable. Second, the string theorists think of themselves as physicists rather than mathematicians. They believe that their theory describes something real in the physical world. And third, there is not yet any proof that the theory is relevant to physics. The theory is not yet testable by experiment. The theory remains in a world of its own, detached from the rest of physics. String theorists make strenuous efforts to deduce consequences of the theory that might be testable in the real world, so far without success.

My colleagues Ed Witten and Juan Maldacena and others who created string theory are birds, flying high and seeing grand visions of distant ranges of mountains. The thousands of humbler practitioners of string theory in universities around the world are frogs, exploring fine details of the mathematical structures that birds first saw on the horizon. My anxieties about string theory are sociological rather than scientific. It is a glorious thing to be one of the first thousand string theorists, discovering new connections and pioneering new methods. It is not so glorious to be one of the second thousand or one of the tenth thousand. There are now about ten thousand string theorists scattered around the world. This is a dangerous situation for the tenth thousandand perhaps also for the second thousand. It may happen unpredictably that the fashion changes and string theory becomes unfashionable. Then it could happen that nine thousand string theorists lose their jobs. They have been trained in a narrow specialty, and they may be unemployable in other fields of science.

Why are so many young people attracted to string theory? The attraction is partly intellectual. String theory is daring and mathematically elegant. But the attraction is also sociological. String theory is attractive because it offers jobs. And why are so many jobs offered in string theory? Because string theory is cheap. If you are the chairperson of a physics department in a remote place without much money, you cannot afford to build a modern laboratory to do experimental physics, but you can afford to hire a couple of string theorists. So you offer a couple of jobs in string theory, and you have a modern physics department. The temptations are strong for the chairperson to offer such jobs and for the young people to accept them. This is a hazardous situation for the young people and also for the future of science. I am not saying that we should discourage young people from working in string theory if they find it exciting. I am saying that we should offer them alternatives, so that they are not pushed into string theory by economic necessity.

Finally, I give you my own guess for the future of string theory. My guess is probably wrong. I have no illusion that I can predict the future. I tell you my guess, just to give you something to think about. I consider it unlikely that string theory will turn out to be either totally successful or totally useless. By totally successful I mean that it is a complete theory of physics, explaining all the details of particles and their interactions. By totally useless I mean that it remains a beautiful piece of pure mathematics. My guess is that string theory will end somewhere between complete success and failure. I guess that it will be like the theory of Lie groups, which Sophus Lie created in the nineteenth century as a mathematical framework for classical physics. So long as physics remained classical, Lie groups remained a failure. They were a solution looking for a problem. But then, fifty years later, the quantum revolution transformed physics, and Lie algebras found their proper place. They became the key to understanding the central role of symmetries in the quantum world. I expect that fifty or a hundred years from now another revolution in physics will happen, introducing new concepts of which we now have no inkling, and the new concepts will give string theory a new meaning. After that, string theory will suddenly find its proper place in the universe, making testable statements about the real world. I warn you that this guess about the future is probably wrong. It has the virtue of being falsifiable, which according to Karl Popper is the hallmark of a scientific statement. It may be demolished tomorrow by some discovery coming out of the Large Hadron Collider in Geneva.

Roger Penrose

he calls string theory a “fashion”, quantum mechanics “faith”, and cosmic inflation a “fantasy”.

So when I heard that string theory – to which I had been distinctly attracted, partly because of its early use of Riemann surfaces – had moved itself in the direction of requiring all those extra spatial dimensions, I was horrified, and far from being tempted by the romantic attractions of a higher-dimensional universe. I found it impossible to believe that nature would have rejected all those beautiful connections with Lorentzian 4-space – and I still do.
Fashion, Faith, and Fantasy in the New Physics of the Universe

Web developer tools

Chrome DevTools

Dark Theme

a built-in dark theme

Selection Mode

cmd + shift + c

Store as global variable

right click on an object in the console and press “store as global variable”. This stores the object as a global variable accessible in the console called temp1 which you can then work with using JavaScript.

Simulate Element Pseudo State

clicking the :hov icon in the upper-right corner of the Styles panel

Prettify CSS and JavaScript

After opening a minified file in the “Sources” tab, you can click the brackets logo in the lower left corner of the file, and DevTools will “prettify” the code.

Alt + Up / Alt + Down

When debugging CSS, you can select a property and use the up/down keys to tweak it’s value. By default, the arrow keys adjust values by +/- 1. However, by holding the alt key, you can use the arrow keys to adjust values finely in steps of 0.1, which is particularly useful when working with fractional values.

Conversely, you can hold shift to adjust values in steps of 10.

Preserve Log

Preserve log is a checkbox that lets you persist logs between page refreshes.
When this option is enabled, a new type of “Navigation” log appears in the console to show page refreshes or navigation events to different pages.

Network + Log Filters

Code Coverage

go to the “Coverage” tab. Press “record” and then start using your app. When you’re done, Chrome will show you the exact code that ran during your session.

Quick file switching

Ctrl + P

Search source code

Ctrl + Shift + F

Go to line number

Ctrl + O

entered :375:18 to go to line 375, column 18.

Copy image as data URI (base64 encoded)

In the Network panel click on an image and then right click on it to have the option to Copy image as data URI.

hard refresh

A hard refresh is a way of clearing the browser’s cache for a specific page, to force it to load the most recent version of a page.

  • Hold down Ctrl and click the Reload button.
  • Or, Hold down Ctrl and press F5.
  • just open the Chrome Dev Tools by pressing F12. Once the chrome dev tools are open, just right click on the refresh button and a menu will drop down. This menu gives you the option of doing a hard refresh, or even clearing the cache and do a hard refresh automatically.

Firefox Developer Tools

View browser style

Browser Styles consist of two types: the default style a browser assigns for every element, and the browser-specific styles (the ones with the browser prefix).

  1. Developer > Inspector.
  2. Click the “Computed” tab in the right section.
  3. Check the “Browser styles” checkbox.

Hide CSS style from the page

To remove any CSS style (inline, internal or external) applied on a webpage, just click on the eye symbol of the listed stylesheets in the “Style Editor“ tab. Click it again to revert to the original view.

hard refresh

  • Hold the Ctrl key and press the F5 key.
  • Or, hold down Ctrl and ⇧ Shift and then press R.

ref

Chrome

Firefox

Quantum Theory

Anyone who is not shocked by quantum theory has not understood it.
Niels Bohr

I think I can safely say that no one understands quantum mechanics.
Richard Feynman

but it is certainly the case that, though we know how to do the sums, we do not understand the theory as fully as we should. We shall see in what follows that important interpretative issues remain unresolved. They will demand for their eventual settlement not only physical insight but also metaphysical decision.
Quantum Theory: A Very Short Introduction, John Polkinghorne


Arts & Culture: Poetry Takes on Quantum Physics
https://physics.aps.org/articles/v11/103

World Lines: A Quantum Supercomputer Poem, by Amy Catanzano

What can the quantum world do for business?
https://physicsworld.com/a/what-can-the-quantum-world-do-for-business/

So every time we turn off our mobile phones, USB sticks, memory drives or data centres, all the stored data doesn’t get wiped. Quantum mechanics delivers again.

And every time you write data onto NAND Flash, you’re using one of the most surprising and successful predictions of quantum mechanics. I’m referring to barrier penetration, or tunnelling, which allows a low-energy particle to penetrate a high potential-energy barrier.

What Has Quantum Mechanics Ever Done For Us?
https://www.forbes.com/sites/chadorzel/2015/08/13/what-has-quantum-mechanics-ever-done-for-us/#31c890740468

February 29

by Jane Hirshfield

An extra day—

Like the painting’s fifth cow,
who looks out directly,
straight toward you,
from inside her black and white spots.

An extra day—

Accidental, surely:
the made calendar stumbling over the real
as a drunk trips over a threshold
too low to see.

An extra day—

With a second cup of black coffee.
A friendly but businesslike phone call.
A mailed-back package.
Some extra work, but not too much—
just one day’s worth, exactly.

An extra day—

Not unlike the space
between a door and its frame
when one room is lit and another is not,
and one changes into the other
as a woman exchanges a scarf.

An extra day—

Extraordinarily like any other.
And still
there is some generosity to it,
like a letter re-readable after its writer has died.

LeetCode - Algorithms - 405. Convert a Number to Hexadecimal

Problem

405. Convert a Number to Hexadecimal

Java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class Solution {
public String toHex(int num) {
char hex[]={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
String hexdec_num="";
if (num==0)
return "0";
else if (num>0) {
int rem;
while(num>0)
{
rem = num%16;
hexdec_num = hex[rem] + hexdec_num;
num = num/16;
}
return hexdec_num;
}
else {
num = ~num;
String s = "";
for (int i = 0; i < 8; i++) {
int n = 15 - num % 16;
s += hex[n];
num /= 16;
}
char[] charArr = s.toCharArray();
for(int i=charArr.length-1;i>=0;i--)
hexdec_num+=charArr[i];
return hexdec_num;
}
}
}

Submission Detail

  • 100 / 100 test cases passed.
  • Runtime: 11 ms, faster than 8.70% of Java online submissions for Convert a Number to Hexadecimal.
  • Memory Usage: 37.7 MB, less than 8.33% of Java online submissions for Convert a Number to Hexadecimal.

ref

English Conversation for Beginners

texts below are from © English Conversation for Beginners: 45+ Phrases for the English Speaking Adventure of a Lifetime

Starting an English Conversation

If you need a push to start having conversations in English, watch the clip below for motivation.

Then, any polite conversation starts with a greeting (saying hello). There are many ways to greet someone, and your choice will depend on who you are talking to.

It may be an informal conversation with a friend or an acquaintance (someone you know, but not very well). Or you may use a more formal dialogue when having an English conversation with a colleague, a teacher, a stranger or a government employee.

Informal greetings

Let’s start with informal greetings. Here is how you can say hello:

  • Hello!
    (A universal greeting that works for every conversation.)
  • Hi!
    (A neutral and friendly greeting.)
  • Hey!
    (An informal and relaxed greeting.)
  • Greetings!
    (This is quite formal and rare these days, but could be used humorously among friends.)

Formal greetings

For a more formal way to greet someone, use the model “good + [time of day]”:

  • Good morning!
    (Reserved for any time before noon.)
  • Good afternoon!
    (Typically used between noon and 5-6 p.m.)
  • Good evening!
    (Any time after 6 p.m.)

Remember that “good night” normally means that you are saying goodbye. It is also commonly used right before going to bed.

Introductions

What if you have never met the person you are talking to before? Then, after greeting them, it would be polite to introduce yourself and ask for their name. Here’s how:

  • My name is _____. What’s your name?
    (This is simple, neutral and always works well!)

If you met somebody once before, but you do not remember their name, you can say this:

  • I’m sorry, I don’t remember your name. You are…?
    (This is a bit more informal.)

If you want to introduce a person to someone else, you can simply say:

  • Please meet + [name]
    Please meet my friend Tom!
    (Formal introduction)

  • This is + [name]
    This is Tom!
    (Common introduction)

Now that you have introduced yourself, use one of the phrases below to respond to someone’s introduction.

  • Nice to meet you!
    (The most common)

  • Pleased to meet you!
    (Simple and polite)

  • It’s a pleasure!
    (Informal, but nice)

Making Small Talk in English

names and greeted each other, you may go on to make some “small talk.”

Small talk is common in many English-speaking countries, especially in the U.S., Canada and England. It is considered polite to add small talk to the beginning of the conversation before talking about the subject of the conversation, whether it is personal or professional.

The most widespread (common) question is “How are you?” In fact, it is so common, that it becomes automatic for people to say, even when they hardly know the person! “How are you” is often even considered part of the greeting (i.e. “Hi, how are you?”). That is how necessary it has become!

There are several ways to ask someone how they are doing:

  • How are you? / How are you doing?
    (Neutral)
  • How’s it going?
    (More informal)
  • How are things?
    (Informal)
  • What’s up?
    (Very informal)

An interesting thing about asking these questions is that an answer is not really required. Unless you are very close friends with someone, they are not expecting you to tell them an honest answer about your day

Instead, a simple answer and a “how are you” in return is enough for a typical conversation in English:

  • I’m well. How are you?
  • It’s going well, thank you. How are you doing?
  • Fine, thanks. And yourself?

Note that you might often hear people say “I’m good” when they mean that they are well and doing well. “I’m good” is grammatically incorrect in this context, but it is very common in spoken English

Small talk can also be the primary goal of a conversation, especially when you are talking to people you don’t know and are unlikely to meet again. There are many ways to use small talk successfully, even when you’re still getting comfortable with English conversation for beginners.

Asking and Answering Questions

A conversation is an exchange of ideas, questions and thoughts. The best way to keep a conversation going is to ask questions!

There are two types of questions you may ask: closed-ended and open-ended questions.

Closed-ended questions are also called “yes/no” questions, because their goal is to confirm or deny certain information. For example:

  • Are you having a good day?
  • Did you just get to the office?
  • Have you seen my email?

Compare the examples above to the open-ended questions below. They will ask a person to elaborate—that is, to give more information instead of simply saying “yes” or “no.”

  • How is your day going?
    (A perfect example of small talk!)
  • When did you arrive at the office?
  • What do you think about that email I sent?

Open-ended questions typically begin with “who,” “what,” “where,” “when” and “why.” They are important to make your English conversation informative and productive.

When the person you are talking to is asking you a question, listen for the keywords and pay attention to the verb being used. This will help you construct your answer using proper grammar.

Don’t worry about using difficult words—it is fine to keep things simple! And if you don’t understand a certain question or word, don’t be afraid to ask.

As a beginner, you may have trouble understanding everything being said in English. This is okay! You are still learning.

Asking for Clarification

You are getting good at conversations in English, but suddenly you realize that you are lost. Maybe the other person is speaking too fast. Maybe she has an unfamiliar accent. Maybe you didn’t hear the last thing she said.

It is perfectly normal to ask for clarification or to repeat something. Just remember to be polite!

If you don’t understand something, let’s say a word or even some idea relating to your conversation, you could say:

  • I’m sorry, I don’t understand. Could you please repeat that?
  • I’m sorry, I don’t understand. Could you please explain that?

or even…

  • Care to elaborate?
    (This very informal question is the short version of “Do you care to elaborate on this?”)

If you simply didn’t hear something, just say it like this:

  • I’m sorry, I didn’t hear that. Could you please repeat?
  • I’m sorry, I didn’t catch that. Could you please repeat?

or even…

  • Could you say that again, please?

Don’t be shy to ask for help. People are generally very happy to explain or repeat something! Please don’t forget to thank them after they do.

Bringing an English Conversation to a Close

Say you have got all the information you need from the person. It is time for you to go. Maybe you are running late and want to keep the conversation brief. No matter the reason, it is always nice to let the person know you cannot continue talking to them for much longer.

There are many ways to do it depending on the situation. For example, if you are late, say:

  • I have to get going. / It’s time for me to go.
    (This is polite and neutral.)
  • I have to run—can we continue later?
    (This is more informal, but also polite.)

And if you have all the information you’d wanted:

  • Thank you so much for your help!
    (A very common and useful expression)
  • Got it, thanks!
    (Very informal and friendly)
  • I think I have everything I need, thank you!
    (This is formal and may come across as rude if you don’t thank the person after, so use it with caution.)

Using Small Talk to End a Conversation

Hey, guess what? Small talk can be used at the end of an English conversation too! Before saying goodbye, it is polite to say something like…

  • Have a good day!
    (This works in any situation.)
  • Enjoy your day!
    (This one is a bit more formal.)
  • Good luck!
    (If the person needs it; it will depend on the situation.)
  • Talk to you soon!
    (This is neutral and does not necessarily mean that you will really talk to the person soon.)
  • Great seeing you / Great talking to you!
    (This is informal yet common.)
  • Catch you later!
    (This is very informal and fun.)

And after that, the only thing left to do is…

Saying Goodbye in English

This one is easy. You really cannot go wrong with just a simple “goodbye” or “bye” in spoken English. You can also use any small talk expression to complement your goodbye. For example:

  • Bye! Have a good day!
  • Catch you later! Bye-bye!

And, as mentioned at the very beginning of this guide…

  • Good night!

Useful English Phrases

texts below are from © Basic English: 30+ Golden Phrases That Are Incredibly Useful

Phrases for Anywhere

Thanks so much.

This is a simple sentence you can use to thank someone.

  • Thanks so much for the birthday money.

  • Thanks so much for driving me home.

I really appreciate…

You can also use this phrase to thank someone.

  • I really appreciate your help.
  • Thanks so much for cooking dinner. I really appreciate it.
  • Thanks so much. I really appreciate you cooking dinner.

Excuse me.

When you need to get through but there’s someone blocking your way, say “Excuse me.”

You can also say this phrase to politely get someone’s attention. For example:

  • Excuse me sir, you dropped your wallet.
  • Excuse me, do you know what time it is?

I’m sorry.

Use this phrase to apologize, whether for something big or small. Use “for” to give more detail. For example:

  • I’m sorry for being so late.
  • I’m sorry for the mess. I wasn’t expecting anyone today.

You can use “really” to show you’re very sorry for something:

  • I’m really sorry I didn’t invite you to the party.

What do you think?

When you want to hear someone’s opinion on a topic, use this question.

  • I’m not sure if we should paint the room yellow or blue. What do you think?

How does that sound?

If you suggest an idea or plan, use this phrase to find out what others think.

  • We could have dinner at 6, and then go to a movie. How does that sound?
  • Let’s hire a band to play music, and Brent can photograph the event. How does that sound?

That sounds great.

If you like an idea, you can respond to How does that sound? with this phrase. “Great” can be replaced with any synonym, such as “awesome,” “perfect,” “excellent” or “fantastic.”

A: My mom is baking cookies this afternoon. We could go to my house and eat some. How does that sound?
B: That sounds fantastic!

(Oh) never mind.

Let’s say someone doesn’t understand an idea you’re trying to explain. If you’ve explained it over and over and want to stop, just say “oh, never mind.” You can now talk about something else!

You can also use “never mind” to mean “it doesn’t matter” or “just forget it.” In these situations, say it with a smile and positive tone, though. Otherwise, when you say this phrase slowly with a falling low tone, it can mean you’re bothered or upset.

A: Are you going to the grocery store today?
B: No, I’m not. But why—do you need something?
A: Oh, never mind. It’s okay, I’ll go tomorrow.

Phrases for Learning English

As an English learner, you’ll need to tell others that English is not your first language. You’ll also need to ask native speakers to repeat phrases and words or to speak slower. The following phrases will be useful for this.

I’m learning English.

This simple phrase tells people that English is not your native language. If you’re a total beginner, add “just started” after I: “I just started learning English.”

  • My name is Sophie and I’m learning English.

I don’t understand.

Use this phrase when you don’t understand what someone means.

  • Sorry, I don’t understand. The U.S. Electoral College seems very confusing!

Could you repeat that please?

If you’d like someone to say a word, question or phrase again, use this question. Since “to repeat” means “to say again,” you can also ask, “Could you say that again please?”

We can say “please” either at the end of the question or right after “you,” like this:

  • Could you please repeat that?
  • Could you repeat that please?

Could you please talk slower?

Native speakers can talk very fast. Fast English is hard to understand! This is an easy way to ask someone to speak more slowly.

Note: This phrase is not grammatically correct. However, it’s used often in everyday (casual) speech. The grammatically correct question would be, “Could you please talk more slowly?”

That’s because “slowly” is an adverb, so it describes verbs (like “talk”). “Slower” is a comparative adjective, which means it should be used to describe nouns (people, places or thing), not verbs. (For example: My car is slower than yours.)

A: You can give us a call any weekday from 8:00 a.m. to 5:00 p.m. at five five five, two five zero eight, extension three three—
B: I’m sorry, could you please talk slower?

Thank you. That helps a lot.

After someone starts speaking more slowly for you, thank them with this phrase.

You can use it in many other situations, too.

A: Ben, could you please make the font bigger? It’s hard for me to read the words.
B: Sure! I’ll change it from size 10 to 16. How’s this?
A: Thank you. That helps a lot

What does _____ mean?

When you hear or see a new word, use this phrase to ask what it means.

A: What does “font” mean?
B: It’s the style of letters, numbers and punctuation marks when you type. A common font in the USA is Times New Roman.

How do you spell that?

English spelling can be tricky, so make sure to learn this question. You could also ask someone, “Could you spell that for me?”

A: My name is Robbertah Handkerchief.
B: How do you spell that?

What do you mean?

When you understand the words one by one, but not what they mean together, use this question. You can ask it whenever you’re confused about what someone is telling you.

A: The Smiths do have a really nice house, but the grass is always greener on the other side.
B: What do you mean?
A: I mean that if we had the Smith’s house, we probably wouldn’t be happier. We always think other people have better lives than us, but other people have problems too.

Phrases for Introducing Yourself and Making Friends

Here are some phrases for introducing yourself when you meet new people, and questions to learn more about them.

Hi! I’m [Name]. (And you?)

Here’s an informal greeting you can use when you meet new friends. If the person doesn’t tell you their name, you can ask “And you?” or “And what’s your name?”

Hi! I’m Rebecca. And you?

Nice to meet you.

After you learn each other’s names, it’s polite to say this phrase.

A: Hi Rebecca, I’m Chad.
B: Nice to meet you, Chad.
A: Nice to meet you too.

Where are you from?

Ask this question to find out which country someone is from. You answer this question with “I’m from ~.”

Can you answer this question in English? Say both the question and answer aloud right now. (Four times, remember?)

A: Nice to meet you, Sergio. So, where are you from?
B: I’m from Spain.

What do you do?

Most adults ask each other this question when they meet. It means what do you do for a living (what is your job).

I think this question is boring, so I ask other questions. But many people will probably ask you this, so it’s important to know what it means.

A: What do you do, Cathleen?
B: I work at the university as a financial specialist.

What do you like to do (in your free time)?

Instead of asking for someone’s job title, I prefer to ask what they enjoy doing. The responses (answers) are usually much more interesting!

A: So Cathleen, what do you like to do in your free time?
B: I love to read and to garden. I picked two buckets of tomatoes last week!

What’s your phone number?

If you want to keep in contact with someone you just met, ask this question to find out their phone number. You can replace “phone number” with “email address” if you want to know their email address.

You might also hear people use the more casual “Can I get your ~?,” as in, “Can I get your phone number?”

It would be great to meet up again sometime. What’s your phone number?

Do you have Facebook?

Many people keep in touch (contact) through Facebook. Use this question to find out if someone has a Facebook account. You might also ask, “Are you on Facebook?”

Let’s keep in touch! Do you have Facebook?

Phrases for Work

Finally, here are seven basic phrases you might use at a job.

How can I help you?

If you work in customer service, you’ll use this phrase a lot. It’s also a common phrase when answering the phone.

[On the phone]: Hello, this is Rebecca speaking. How can I help you?

I’ll be with you in a moment.

When someone wants to see you, use this phrase if you need a minute to finish something first. If a client is waiting at a store, you can also use this phrase to show that their turn is next.

You can replace “moment” with “minute”: “I’ll be with you in (just) a minute.”

Another common phrase for this situation is “I’ll be right with you.”

Good morning! I’ll be with you in a moment.

What time is our meeting?

You can use this question’s structure to ask the time of any event: “What time is [event]?”

If you want to ask about a meeting on a certain day, add “on [day].” For example, “What time is our meeting on Thursday?”

What time is our meeting on Wednesday?

Please call me (back) at…

When you want someone to call you or to call you back (to return your call), use this phrase to give your phone number.

Hi, this is Cathleen from the financial office.
I’m wondering if you found those missing receipts.
Please call me back at 555-5555. Thanks!

(Oh really?) Actually, I thought…

When you disagree with someone, “Actually, I thought…” will make you sound kinder and more polite than saying “No” or “You’re wrong.” This phrase is useful when you have a different idea than someone else.

A: So Sam’s coming in tonight at 8, right?
B: Actually, I thought he wasn’t working at all this week.
A: Oh, ok. I’ll have to look at the schedule again.

Actually, I [verb]…

Just like in #28, you can use “actually, I…” with many different verbs: “heard,” “learned,” “am,” “can,” “can’t,” etc. You should use it for the same situation as above: when you have a different idea than someone else.

A: Did you finish the reports?
B: Actually, I am running a bit behind, but they’ll be done by noon!

C: When you type, always put two spaces between sentences.
D: Actually, I learned to put a single space between sentences.

I’m (just) about to [verb]…

When you’re going to start something very soon, you’re “just about to” do something.

I’m just about to send those faxes.

I’m about to go and pick up some coffee. Do you want anything?

LeetCode - Algorithms - 1037. Valid Boomerang

It’s easy indeed once you think about the slope of a line.

Zoomerang a Boomerang

by Ruth I. Dowell

Zoomerang a boomerang
Around a maple tree!
Zoomrang a boomerang
But don’t hit me!

from Poems to make your belly laugh

Problem

1037. Valid Boomerang

A boomerang is a set of 3 points that are all distinct and not in a straight line.

Java

cross product

1
2
3
4
5
class Solution {
public boolean isBoomerang(int[][] points) {
return (points[2][1]-points[0][1])*(points[1][0]-points[0][0]) == (points[1][1]-points[0][1])*(points[2][0]-points[0][0])?false:true;
}
}

Submission Detail

  • 190 / 190 test cases passed.
  • Runtime: 0 ms, faster than 100.00% of Java online submissions for Valid Boomerang.
  • Memory Usage: 37.2 MB, less than 100.00% of Java online submissions for Valid Boomerang.

Heron’s formula

1
2
3
4
5
6
7
8
9
10
class Solution {
public boolean isBoomerang(int[][] points) {
double a = Math.sqrt(Math.pow(points[1][0] - points[0][0], 2) + Math.pow(points[1][1] - points[0][1], 2));
double b = Math.sqrt(Math.pow(points[2][0] - points[1][0], 2) + Math.pow(points[2][1] - points[1][1], 2));
double c = Math.sqrt(Math.pow(points[2][0] - points[0][0], 2) + Math.pow(points[2][1] - points[0][1], 2));
double s = (a + b + c) / 2;
double A = Math.sqrt(s * (s - a) * (s - b) * (s - c));
return A != 0;
}
}

Submission Detail

  • 190 / 190 test cases passed.
  • Runtime: 0 ms, faster than 100.00% of Java online submissions for Valid Boomerang.
  • Memory Usage: 36.9 MB, less than 83.23% of Java online submissions for Valid Boomerang.

Gauss’s area formula

Shoelace formula

let \( \mathbf {A} \) be the area of the triangle whose vertices are given by the coordinates \( (x_{1},y_{1}) \), \( (x_{2},y_{2}) \), and \( (x_{3},y_{3}) \).

\( \mathbf {A} \) can be written as a determinant

\( {\displaystyle \mathbf
{A} ={\frac {1}{2}}
{
\begin{vmatrix}1&1&1 \\
x_{1}&x_{2}&x_{3} \\
y_{1}&y_{2}&y_{3}
\end{vmatrix}
}
}
\)

If the coordinates are written in a clockwise order, the value of the determinant will be \( {\displaystyle -\mathbf {A} } \)

Rearranging another way

\( {\displaystyle \mathbf {A} ={\frac {1}{2}}|x_{1}y_{2}+x_{2}y_{3}+x_{3}y_{1}-x_{2}y_{1}-x_{3}y_{2}-x_{1}y_{3}|} \)

which is the form of the shoelace formula. This formula can be extended to find the area of any polygon since a simple polygon can be divided into triangles.

1
2
3
4
5
6
7
class Solution {
public boolean isBoomerang(int[][] points) {
int A = points[0][0] * points[1][1] + points[1][0] * points[2][1] + points[2][0] * points[0][1]
- points[1][0] * points[0][1] - points[2][0] * points[1][1] - points[0][0] * points[2][1];
return A != 0;
}
}

Submission Detail

  • 190 / 190 test cases passed.
  • Runtime: 0 ms, faster than 100.00% of Java online submissions for Valid Boomerang.
  • Memory Usage: 37.7 MB, less than 15.65% of Java online submissions for Valid Boomerang.

LeetCode - Algorithms - 35. Search Insert Position

Problem

35. Search Insert Position

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.

You may assume no duplicates in the array.

Java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class Solution {
public int searchInsert(int[] nums, int target) {
int left=0, right=nums.length-1;
int mid=0;
while(left<=right) {
mid = (left+right)/2;
if (nums[mid]>target) {
right = mid-1;
}
else if (nums[mid]<target){
left = mid+1;
}
else
return mid;
}
if (target>nums[mid])
return mid+1;
else
return mid;
}
}

Submission Detail

  • 62 / 62 test cases passed.
  • Runtime: 0 ms, faster than 100.00% of Java online submissions for Search Insert Position.
  • Memory Usage: 38.9 MB, less than 100.00% of Java online submissions for Search Insert Position.