搜尋此網誌

2025年7月25日星期五

Observing adults

confer: to discuss something with somebody, in order to exchange opinions or get advice

gist: the main or general meaning of a piece of writing, a speech or a conversation

recount: to tell somebody about something, especially something that you have experienced

stunned: very surprised or shocked

dash: ruin

stake out: to clearly mark the limits of something that you claim is yours

intuitively: by using your feelings rather than by considering the facts

give in: to admit that you have been defeated by somebody/something

ease up: to become less strong, unpleasant, etc.

come out: to be produced or published

choke up: to find it difficult to speak, because of the strong emotion that you are feeling

strip something out: to ignore particular numbers or facts in a situation in order to understand what is really important

brink: if you are on the brink of something, you are almost in a very new, dangerous or exciting situation

intrigued: DJ[inˋtri:gd] very interested in something/somebody and wanting to know more about it/them

animatedly: in a way that shows interest and energy

consequential: happening as a result or an effect of something

Dictaphone: a small machine used to record people speaking, so that their words can be played back later and written down

Xerox: a process for producing copies of letters, documents, etc. using a special machine

decipher: to succeed in finding the meaning of something that is difficult to read or understand

scribble: to write something quickly and carelessly, especially because you do not have much time

peek: to look at something quickly and secretly because you should not be looking at it

meticulous: paying careful attention to every detail

deposition: a formal statement, taken from somebody and used in court

oversee: to watch somebody/something and make sure that a job or an activity is done correctly

coolheaded: calm; not showing excitement or nerves

unwavering: not changing or becoming weaker in any way

metrics [plural]: a set of numbers or statistics used for measuring something, especially results that show how well a business, school, computer program, etc. is doing

accomplishment: an impressive thing that is done or achieved after a lot of work

In the card game bridge, a bridge partner refers to the other player on your team. 


Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

www.merriam-webster.com

Some explanations are from Google AI Overview

2025年7月23日星期三

Selecting the right while loop

while (condition){
    // Code to execute
}

do{
    // Code to execute
}while (condition);

The do...while loop is executed at least once.

negate: to stop something from having any effect

The exclamation mark ! is the logical NOT operator. It inverts a boolean value.

getline is a handy function in C++ for reading a whole line of text, especially when you're dealing with strings that might include spaces.

getline(cin, userInput); // reads full line including spaces

std::getline(std::cin, playerName);

using std::getline from the <string> header to read a full line of input into playerName

\n is a newline character used in C++.

do{
    // Code to execute
}while (choice != 3);

repeats until they select option 3

Microsoft Copilot

2025年7月22日星期二

While loops

In C++, the auto keyword is used for type inference, which means the compiler automatically deduces the variable's type from its initializer. It’s incredibly handy when dealing with complex types or simply to make your code cleaner.

Pointer = next(Pointer, 1);

Pointer = std::next(Pointer, 1);

++Pointer;

Think of an iterator as a pointer-like object that lets you access and traverse elements of a container. It abstracts away the underlying structure, making your code flexible and reusable.

The keyword do in C++ is most commonly seen as part of the do...while loop—a control structure that executes code at least once before checking a condition. It's great when you want to ensure a block of code runs before validating any exit condition.

do {
    // Code to execute
} while (condition);

++count: increments count before its value is used
count++: increments count after its value is used

In C++, .size() is a method used to retrieve the number of elements in a container from the Standard Template Library (STL). It’s simple but powerful when you need to know the container’s current size.

std::vector<int> scores = {1, 2, 3, 4, 5};

I declared and initialized a std::vector<int> named scores with the values {1, 2, 3, 4, 5}

std::cout << "First score: " << scores[0] << std::endl;

scores.push_back(6);

std::cout << "Total scores: " << scores.size() << std::endl;

Microsoft Copilot

廣袤

「廣袤」的意思是土地的面積,東西向稱為「廣」,南北向稱為「袤」。 也可以引申為開闊、寬廣的意思。 例如,可以說「這片草原廣袤無垠」,表示草原非常廣闊,望不到邊際。 「廣袤」也可以用來形容其他空間的遼闊,例如「天空廣袤」。粵音同「貿」。

Google AI

Counseling

Without being prescriptive, Dr. Cressey helped me see that my parents loved me; I wouldn't be under their roof forever; they were actually my allies in terms of what really counted; it was absurd to think that they had done anything wrong.

在不採取說教方式的情況下,

Dr. Cressey幫助作者看清父母是愛他的;

他終究不會永遠住在父母的屋簷下;

在真正重要的事情上,他們其實是作者的盟友;

要認為他們做錯了什麼簡直荒謬。

進一步的闡釋︰

雖然作者暫時受制於父母的安排,但這並不會成為終身桎梏,而是一段生命必經的過程。

由抗拒到理解,作者認清真正值得追求的目標時,父母成了最堅實的後盾,而非阻力。

sexist: treating other people, especially women, unfairly because of their sex or making offensive remarks about them

An airline hostess, also known as a flight attendant or cabin crew, is a member of the aircrew responsible for passenger safety and comfort during flights.

astronaut: DJ[ˋæstrənɔ:t]

doggedly: in a way that shows that you are determined and do not give up easily

unnerved: to make somebody feel nervous or frightened or lose confidence

In baseball, a wild pitch occurs when a pitcher throws the ball to the batter in a way that the catcher cannot control with ordinary effort, and as a result, a base runner advances to the next base. 

cohort: a group of people who share a common feature or aspect of behavior

A growth spurt is a period of rapid physical development, primarily characterized by an increase in height and weight.

galumph: to move in a heavy, careless or noisy way

Coming of age refers to the transition from childhood to adulthood.

thrill: a strong feeling of excitement or pleasure; an experience that gives you this feeling

goof around: to spend your time doing silly or stupid things

stint: a period of time that you spend working somewhere or doing a particular activity

The brass section of an orchestra or band consists of the musicians who play brass instruments.

trombone: a large brass musical instrument that you blow into, with a sliding tube used to change the note

lug: to carry or drag something heavy with a lot of effort

circular: a letter, notice or advertisement that is sent to a large number of people at the same time

venture: ​a business project or activity, especially one that involves taking risks

toss: to throw something lightly or carelessly

porch: a small area at the entrance to a building, such as a house or a church, that is covered by a roof and often has walls

dreaded: causing fear

murmur: to say something in a soft quiet voice that is difficult to hear or understand

spank: to hit somebody, especially a child, several times on their bottom as a punishment

disciplinarian: ​a person who believes in using rules and punishments for controlling people

intimidating: frightening in a way that makes a person feel less confident

Towering stature refers to someone or something having a very tall or impressive height. It can also be used metaphorically to describe someone or something that is outstanding in terms of importance, influence, or power.

intrinsically: ​in a way that belongs to or is part of the real nature of somebody/something

punitive: intended as punishment

collaborative: involving, or done by, several people or groups of people working together

suck up: to try to please somebody in authority by praising them too much, helping them, etc., in order to gain some advantage for yourself

smart aleck: a person who thinks they are very clever and likes to show people this in an annoying way

snap: to speak or say something in an impatient, usually angry, voice

turmoil: a state of great worry in which everything is confused and nothing is certain

Plaster walls are a construction detail where a layer of plaster is applied to a surface, typically walls and ceilings, to create a smooth, finished appearance. Plaster can be used for both decorative and protective purposes, and is often applied over brick, concrete, or other materials.

hard-pressed: having a lot of problems, especially too much work, and too little time or money

disarming: making people feel less angry or likely to suspect somebody than they were before

lead up to: to be an introduction to or the cause of something

sparingly: ​in a way that is careful to use or give only a little of something

hindsight: the understanding that you have of a situation only after it has happened and that means you would have done things in a different way

avid: very enthusiastic about something (often a hobby)

Carl Jung was a Swiss psychologist and psychiatrist who founded analytic psychology.

intriguing: very interesting because of being unusual or not having an obvious answer

prescriptive: telling people what should be done

absurd: extremely silly; not logical and sensible

dispense with: ​to stop using somebody/something because you no longer need them or it

belittle: ​to stop using somebody/something because you no longer need them or it


Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

Some explanations are came from Google AI and Microsoft Copilot.

2025年7月20日星期日

Switch statements

In C++, a switch statement is used to execute one out of multiple code blocks based on the value of a variable. It’s especially handy when dealing with multiple if-else conditions that all check the same variable.

handy: easy to use or to do

The expression must evaluate to an integral or enumeration type (int, char, enum, etc.).

Each case compares the expression against a constant.

Use break to stop execution after a matching case—if omitted, execution "falls through" to the next case.

Default is optional and acts as a fallback when no case matches.

std::flush is a stream manipulator in C++ used to force the output buffer to flush immediately—meaning all characters that have been sent to the stream are written out, even if the buffer isn’t full

Microsoft Copilot

Lucky Kid

set into: to insert or embed something into a surface or object, so that it is securely held in place

back deck: an outdoor platform, usually made of wood or composite materials, that is attached to the back of a house

strew: to cover a surface with things

confiscate: to officially take something away from somebody, especially as a punishment

when you rev an engine or it revs, it runs quickly

rustle: if something dry and light rustles or you rustle it, it makes a sound like paper, leaves, etc. moving or rubbing together

thrilled: very excited and pleased

stiffness: the fact of being hard and difficult to bend or move

obsessive: thinking too much about one particular person or thing, in a way that is not reasonable or normal

contrarian: a person who opposes or rejects popular opinion, especially in financial markets

troll: to search for or try to get something

brochure: a small magazine or online document containing pictures and information about something or advertising something

The Lenni Lenape, also known as the Delaware Indians, are an Indigenous people of the Northeastern Woodlands.

indigenous: (of people and their culture) coming from a particular place and having lived there for a long time before other people came there; relating to, belonging to or developed by these people

chronology: ​the order in which a series of events happened; a list of these events in order

quaint: attractive in an unusual or old-fashioned way

fictitious: invented by somebody rather than true

granite: ​a type of hard grey stone, often used in building

muster: collect or assemble

fabricate: to make or produce goods, equipment, etc. from various different materials

jester: a man employed in the past at the court of a king or queen to entertain people by telling jokes and funny stories

tome: ​a large, heavy book, especially one dealing with a serious topic

take root: (of an idea) to become accepted widely

accrue: to increase over a period of time

empowerment: the act of giving somebody more control over their own life or the situation they are in


Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

2025年7月17日星期四

If-else

The ternary conditional operator is a compact way to write conditional expressions in many programming languages. It’s called “ternary” because it takes three operands: a condition, a result if true, and a result if false.

In C++, the return statement is used to exit a function and optionally send a value back to the caller. It’s a key part of how functions communicate results.

++x Increment first, then use the value

x++ Use the value first, then increment

parentheses: DJ[pəˋrenθisi:z]

versatile: DJ[ˋvə:sətail] able to do many different things

Microsoft Copilot

2025年7月15日星期二

If statements in C++

No "then" keyword

In C++, the percent symbol % is used as the modulus operator. It calculates the remainder after dividing one integer by another.

In C++, == is the equality operator. It checks whether two values are equal and returns true if they are, and false otherwise.

In C++, bool is a built-in type used to represent Boolean values—essentially, values that are either true or false.

1: true

0: false

In C++, != is the inequality operator. It checks whether two values are not equal. If they are different, it returns true; if they’re the same, it returns false.

In C++, && is the logical AND operator, used to combine two Boolean expressions. It returns true only if both expressions are true—otherwise, it returns false.

affirmative: (also positive) (of a statement) expressing something that is true, did happen, etc.; not containing words such as ‘no’, ‘not’, ‘never’, etc.

subtle: not very obvious or easy to notice

Microsoft Copilot

Retarded?!

    If these supposed experts do not know what to do with me, why should I care about their opinions?

crackle: to make short sharp sounds like something that is burning in a fire

intercom: a system of communication by phone or radio inside an office, plane, etc.; the device you press or switch on to start using this system

roust: to drive (as from bed) roughly or unceremoniously

unceremoniously: in a rough or rude way, without caring about a person’s feelings

blast out:  to make a loud unpleasant noise, especially music

impeccably: in a way that has no mistakes or faults

iron out: to get rid of any problems or difficulties that are affecting something

feminist: ​DJ[ˋfeminist] having or based on the belief that women should have the same rights and opportunities as men

pantsuit: ​a woman’s suit of jacket and pants

assert something to: make other people recognize your right or authority to do something, by behaving in a determined and confident way

mystique: the quality of being mysterious or secret that makes somebody/something seem interesting or attractive

rung: ​one of the bars that forms a step in a ladder

frenetic: ​involving a lot of energy and activity in a way that is not organized

soccer: DJ[ˋsɔkə]

memorabilia: things that people collect because they once belonged to a famous person, or because they are connected with a particular interesting place, event or activity

maxim: a well-known phrase that expresses something that is usually true or that people think is a rule for sensible behavior

endeavor: an attempt to do something, especially something new or difficult

reveille: a tune that is played to wake soldiers in the morning; the time when it is played

makeshift: used temporarily for a particular purpose because the real thing is not available

overpass: ​a bridge that carries one road over another one

tiff: a slight argument between close friends or two people who love each other

aggression: a violent attack or threats by one person against another person or by one country against another country

scrawny: ​(of people or animals) very thin in a way that is not attractive

squeaky: making a short, high sound

brawler: ​a person who takes part in a noisy and violent fight, usually in a public place

​engender something: to make a feeling or situation exist

nerd: a person who is boring, stupid and not fashionable

jock: a man or boy who plays or enjoys sport a lot, especially one who does not have many other interests

studious: spending a lot of time studying or reading

diligent: ​showing care and effort in your work or duties

tease about: to laugh at somebody and make jokes about them, either in a friendly way or in order to annoy them or make them embarrassed

differentiator: one that differentiates

niche: a comfortable or suitable role, job, way of life, etc.

wallow (in something) (of large animals or people): to lie and roll about in water or mud, to keep cool or for pleasure

when people ham it up, they deliberately exaggerate their emotions or movements

exaggerate: to make something seem larger, better, worse or more important than it really is

gloat: to show that you are happy about your own success or somebody else’s failure, in an unpleasant way

feat: ​an action or a piece of work that needs skill, strength or courage

punctuation: the marks used in writing that divide sentences and phrases; the system of using these marks

verdict: a decision that you make or an opinion that you give about something, after you have tested it or considered it carefully

kindred: very similar; related

foghorn: a device that makes a loud noise to warn ships of danger in fog

contrarian: a person who opposes or rejects popular opinion, especially in financial markets

streak: a part of a person’s character, especially an unpleasant part

meld: to combine with something else; to make something combine with something else

jokester: joker

persona: the aspects of a person’s character that they show to other people, especially when their real character is different

outwardly: on the surface; in appearance

clash over: an argument between two people or groups of people who have different beliefs and ideas

epic: taking place over a long period of time and involving a lot of difficulties

physicality: the quality of being physical rather than emotional or spiritual

tow-headed: having very light blonde or untidy hair

linebacker: (in American football) a defensive player who tries to tackle members of the other team

touchdown: (in American football) an act of scoring points by crossing the other team’s goal line while carrying the ball, or receiving the ball when you are over the other team’s goal line

complimentary: expressing approval, praise, etc.

thrilled: DJ[θrild] very excited and pleased

domino theory: a theory that if one nation becomes Communist-controlled the neighboring nations will also become Communist-controlled

hands down: (informal) easily and without any doubt


Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

www.merriam-webster.com

2025年7月13日星期日

Registered Nurse

    目標實現了,便是光榮;目標實現不了,人生也會因這一路風雨跋涉變得豐富而充實;在我看來,這就是不虛此生。

節錄自汪國真《我喜歡出發》

Auto Focus

AF-S (AF single, sometimes called single area AF) mode, is good for photographing subjects that do not move, such as flowers or portraits etc.

www.slrphotographyguide.com

Baby

hangman: a game in which one player chooses a word and the other players try to guess it, letter by letter. Each time they guess wrongly, the first person draws one part of a person being hanged. The other players have to guess the word before the drawing is complete

gallows: a structure on which people, for example criminals, are killed by hanging

mitigate something: to make something less harmful, serious, etc.

rambunctious: full of energy in a cheerful and noisy way

floor somebody: to surprise or confuse somebody so that they are not sure what to say or do

disruptive: causing problems, noise, etc. so that something cannot continue normally


Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

2025年7月11日星期五

On the Stage by Yoasobi

So, I'm standing on the top of the stage of my dreams

And now the signal echoes loud in my ears

Time after time, been imagining this moment

Outdoing all versions of me, I'll prevail

Taking a deep breath, inhale and exhale

And in silence I raise my gaze, it unveils

Everything I've done up to this point of time

I realize wasn't in vain, but led to now

No doubt, the future that I have seen in my dreams

Has started now, unfolding where I stand

outdo somebody/something: to do more or better than somebody else

prevail: [intransitive] to exist or be very common at a particular time or in a particular place

unveil something: to remove a cover or curtain from a painting, statue, etc. so that it can be seen in public for the first time

in vain: without success

Online Dictionary Used: www.oxfordlearnersdictionaries.com

2025年7月10日星期四

Tutankhamun

故宮館十一月古埃及展 圖坦卡門巨像助陣

    【明報專訊】香港故宮文化博物館十一月二十日推出逾九個半月的特別展覽「古埃及文明大展︰埃及博物館珍藏」,將展示二百五十件埃及文物,包括法老與諸神雕像、大型成套木乃伊棺、動物木乃伊等,皆首次在港亮相,當中不少亦是首次在埃及境外巡展。故宮館長吳志華昨表示,門票銷售安排八月公布,將是「所有人皆負擔得起」的票價,盼吸引六十萬至七十萬入場人次。

共七間博物館二百五十件藏品 遠溯七千三百年

    香港故宮館與埃及最高文物委員會昨簽訂合作協議,在港合辦「古埃及文明大展︰埃及博物館珍藏」。特別展覽分成「法老的國度」、「圖坦卡門的傳奇」、「薩卡拉的秘密」及「古埃及與世界」共四個單元,囊括埃及七間重要博物館共二百五十件藏品,最久遠可追溯至七千三百年前,最年輕的距今亦已二千年。

    「圖坦卡門的傳奇」將介紹少年法老圖坦卡門的一生及其陵墓的考古發現,展出包括高逾二點八米的巨型石雕「圖坦卡門巨像」。圖坦卡門繼位時僅九歲,任內推翻「一神教」宗教改革,帶領埃及回歸傳統多神信仰,惟十八歲就逝世,其官方紀錄亦遭後繼者赫倫布抹去,至一九二二年始由考古學家挖掘出圖坦卡門的陵墓。

    另一單元「薩卡拉的秘密」則聚焦薩卡拉遺址的考古成果,展出彩繪人形棺、動物木乃伊及神像等,重點展品包括「芭絲特持叉鈴像」及「貓木乃伊」。芭絲特女神常以貓頭人身或直接以貓的形象示人,原為戰爭女神,後期與母性、家庭與保護有更大聯繫,兼具音樂、舞蹈和美等職能。古埃及人會大量飼養貓並製作木乃伊獻予芭絲特女神祈求保佑。

    其餘兩個單元為「法老的國度」及「古埃及與世界」。前者會聚焦法老時代的古埃及文明發展,後者則會探討古埃及和世界其他文明的交流與對話。

港最大埃及展 盼九個月吸七十萬人

    特別展覽展期至明年八月底結束。港故宮表示,今次展覽乃本港史上規模最大且展期最長的古埃及文物展,亦是埃及最高文物委員會第二次與亞洲博物館合辦展覽,盼紀念中國與埃及兩大文明古國建交七十周年。吳志華相信今次展覽非常受歡迎,目標吸引六十萬至七十萬人次。

二零二五年六月二十七日

2025年7月8日星期二

Arrays, Pointers and Strings

*distances.begin()

Adding the asterisk * dereferences that iterator, giving you access to the actual value stored at that position.

When you declare something as public in a class, it means it’s accessible from outside the class.

class MyClass {
public:
    void sayHello() {
        std::cout << "Hello from public method!" << std::endl;
    }
};

int main() {
    MyClass obj;
    obj.sayHello();  // Totally fine—sayHello is public
    return 0;
}

The arrow operator (->) in C++ is used to access members (variables or functions) of an object through a pointer. It’s essentially shorthand for dereferencing a pointer and then accessing a member.

In C++, a C string (also called a C-style string) is a sequence of characters stored in a character array and terminated by a null character ('\0'). 

In C++, arrays and pointers are closely related --- but not identical. Their relationship is one of the most fundamental (and sometimes confusing) aspects of the language.

Array name as a pointer: In most contexts, the name of an array decays into a pointer to its first element.

int arr[5] = {10, 20, 30, 40, 50};
int* ptr = arr;  // Equivalent to: int* ptr = &arr[0];

Microsoft Copilot

School Life

ironclad: so strong that it cannot be challenged or changed

undermine: to make something, especially somebody’s confidence or authority, gradually weaker or less effective

arbitrary: DJ[ˋɑ:bi͵trəri] not seeming to be based on a reason, system or plan and sometimes seeming unfair

bear the brunt of something: to receive the main force of something unpleasant

recalcitrance: the fact of being unwilling to obey rules or follow instructions; the fact of being difficult to control

stalemate: a disagreement or a situation in a competition in which neither side is able to win or make any progress

transgression: an act that goes beyond the limits of what is morally or legally acceptable

snide: ​criticizing somebody/something in an unkind and indirect way

muster: to find as much support, courage, etc. as you can

bratty: (of a person, especially a child) badly behaved

wiseass: smart aleck

smart aleck: an obnoxiously conceited and self-assertive person with pretensions to smartness or cleverness

obnoxiously: in an extremely unpleasant way, especially in a way that offends people

conceited: being too proud of yourself and what you do

self-assertive: very confident and not afraid to express your opinions

pretension: ​the act of trying to appear more important, intelligent, etc. than you are in order to impress other people

pull back: to move back from a place

tamp: tamp something (down) to press something down hard, especially into a closed space

deliberate: done on purpose rather than by accident

notion: an idea, a belief or an understanding of something

jibe: to say something that is intended to make somebody look silly or feel embarrassed

The Wind in the Willows: novel by Kenneth Grahame

roam: (of the eyes or hands) to move slowly over every part of somebody/something

caveman: a person who lived in a cave thousands of years ago

dictate: to control or influence how something happens

husbandry: farming, especially when done carefully and well

sleuthing: the act of investigating a crime or mysterious event


Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

www.merriam-webster.com

2025年7月6日星期日

The string class

The object-oriented approach (often shortened to OOP) is a way of designing and writing software by organizing code around objects rather than just functions and logic. It’s one of the most popular programming paradigms and is used in many modern languages like Java, Python, C++, and C#.

In C++: <string>
This header provides the std::string class, a more powerful and safer alternative to C-style strings.
It supports:
- Dynamic memory management
- Operator overloading (e.g., +, ==)

Dynamic memory management is the process of allocating and freeing memory at runtime, rather than at compile time. It’s essential when you don’t know in advance how much memory your program will need --- like when handling user input, working with large datasets, or building flexible data structures like linked lists or trees.

In C++, strncpy() is a legacy function inherited from the C standard library, defined in the <cstring> header. It’s used to copy a fixed number of characters from one C-style string to another. While it works in C++, it's generally recommended to use std::string for safer and more expressive string handling.

In C++, strncat() is a legacy function from the C standard library used to append a limited number of characters from one C-style string to another. It’s declared in the <cstring> header and works directly with character arrays.

semantics: the study of the meanings of words and phrases

concatenation: a series of things or events that are linked together

exhaustive: including everything possible; very careful or complete

Microsoft Copilot
www.oxfordlearnersdictionaries.com

2025年7月3日星期四

His teacher

"Fall of a year" refers to the season of autumn, especially in North America.

qualm: a feeling of doubt or worry about whether what you are doing is right

unbeknownst: without the person mentioned knowing

penmanship: ​the art of writing by hand; skill in doing this

cursive: ​(of handwriting) with the letters joined together

showboating: behavior that is intended to show people how clever, skillful, etc. you are

flute: a musical instrument of the woodwind group, like a thin pipe in shape. The player holds it to the side of his or her face and blows across a hole at one end.

memento: a thing that you keep or give to somebody to remind you or them of a person or place

slaughterhouse: a building where animals are killed for food

seep: (especially of liquids) to flow slowly and in small quantities through something or into something

unveil: to remove a cover or curtain from a painting, statue, etc. so that it can be seen in public for the first time

awe: feelings of respect and slight fear; feelings of being very impressed by something/somebody

appalled: feeling or showing horror at something unpleasant or wrong

crackle: to make short sharp sounds like something that is burning in a fire

scribble: to write something quickly and carelessly, especially because you do not have much time


Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

2025年7月2日星期三

Tile

encaustic: a paint made from pigment mixed with melted beeswax and resin and after application fixed by heat

Stoke-on-Trent: city in England

www.merriam-webster.com/dictionary

2025年7月1日星期二

C strings

consecutive: following one after another in a continuous series

The null character --- written as '\0' in C and C++ --- is a special character used to mark the end of a string in many programming languages, especially those influenced by C.

<cstring> Header in C++

This is part of the C++ Standard Library, inherited from C’s <string.h>. It provides functions for manipulating C-style strings (null-terminated character arrays).

The String class is a fundamental part of many programming languages, used to represent and manipulate sequences of characters.

std::string greeting = "Hello";
greeting += " World";
std::cout << greeting;  // Output: Hello World

size_t is a special unsigned integer type used in C and C++ to represent the size of objects in memory or array indices.

An unsigned integer is a whole number data type that can only represent non-negative values—that is, zero and positive numbers.

A character array is a data structure used to store a sequence of characters --- essentially, it's how many programming languages represent strings under the hood.

ASCII stands for American Standard Code for Information Interchange. It’s a character encoding standard that assigns numeric values to letters, digits, punctuation marks, and control characters so computers can store and exchange text reliably.

In C++, strncpy() is a function from the C standard library (inherited via <cstring>) used to copy a fixed number of characters from one C-style string to another. It's a bit of a double-edged sword --- powerful but easy to misuse if you're not careful.

The sizeof operator in C and C++ is used to determine the size, in bytes, of a data type or object at compile time.

strncpy(name, src, sizeof(name) - 1);
name[5] = '\0';  // Manually null-terminate

Here, the -1 is used because:
You reserve the last slot for the null terminator.
You copy at most n - 1 characters to avoid overflow.
Then manually add '\0' at the end.

concatenate: to link together in a series or chain

The strcat() function in C is used to concatenate two C-style strings—that is, it appends one string to the end of another.

The strncat() function in C is used to safely concatenate a limited number of characters from one C-style string to another.

In C++, strlen() is a function from the C standard library (accessible via <cstring>) that returns the length of a null-terminated C-style string, excluding the null character '\0'.

Microsoft Copilot
www.oxfordlearnersdictionaries.com
www.merriam-webster.com

Top seller

dog-eared: (of a book) used so much that the corners of many of the pages are turned down

distillation: (formal) the process or result of getting the essential meaning, ideas or information from something

advancement: progress in a job, social class, etc.

boot camp: a training camp for new members of the armed forces, where they have to work hard

filbert: a type of hazel tree that produces oval nuts

pecan: the nut of the American pecan tree with a smooth pink-brown shell

daunting: making somebody feel nervous and less confident about doing something; likely to make somebody feel this way

tally: a record of the number or amount of something, especially one that you can keep adding to

parameter: ​something that decides or limits the way in which something can be done

pistol: a small gun that you can hold and fire with one hand

If you say that a person, a team, an organization, etc. has bragging rights, you mean that they have achieved a good result or are better or more successful than their competitors or opponents at that time.

steep: sudden and very big

pitch: to set something at a particular level

hash mark: service stripe

service stripe: a stripe worn on an enlisted person's left sleeve to indicate three years of service in the army or four years in the navy

perennial: ​continuing for a very long time; happening again and again


Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

www.merriam-webster.com

2025年6月29日星期日

Reference & in C++

In C++, a reference is essentially an alias for another variable. Once a reference is initialized to a variable, it becomes just another name for that variable—any operation on the reference is actually performed on the original variable.

- Declared using the & symbol

int a = 10;
int& ref = a;  // ref is a reference to a

- Must be initialized when declared.
- Cannot be changed to refer to another variable after initialization.
- Useful for function arguments and return values to avoid copying large data.

Reference:
int& ref = var;
cannot be null
cannot be reassigned
do not need dereferencing

Pointer:
int* ptr = &var;
can be null
can point to difference variables
need dereferencing

In programming, an alias is a second name for the same memory location. It means two or more variables refer to the same underlying data—so changing one affects the other.

Modifying a reference does change the original variable, because they both refer to the same memory location.

In programming, nullability refers to whether a variable is allowed to hold a null value --- meaning it can represent the absence of a value.

syntax: (computing) the rules that state how words and phrases must be used in a computer language

In C++, a reference is essentially an alias for another variable. That means:
- It doesn't exist as a separate object in memory.
- When you take the address of a reference, you're actually getting the address of the original variable it refers to.

C++ does not allow arrays of references.

References are not objects: They don’t occupy their own memory --- they’re just aliases for existing variables.

Arrays require elements to be assignable: But references must be initialized when declared and cannot be reseated.

References must be initialized at declaration.

A reference is not a standalone object; it must alias an existing variable.
Because of this, the compiler needs to know what it's referring to immediately --- there is no such thing as a "null" or "unbound" reference.

In C++, pointer initialization is optional, but that comes with a big caveat.

caveat: a warning that particular things need to be considered before something can be done

In C++, references provide one level of indirection.

indirection: indirect action or procedure

In C++, multiple levels of indirection with pointers means having pointers that point to other pointers --- and this can go as deep as your brain (or compiler) can handle!

When you use a reference:
- You're not accessing the object directly.
- Instead, you're accessing it through an alias --- a single level removed from the actual object.

In C++, you can absolutely declare a pointer with the void type, and it's known as a void pointer or generic pointer.

A void* is a special type of pointer that can point to any data type, but it doesn't know what type it's pointing to.

References in C++ are like secret passageways --- they let you access and manipulate data efficiently without the overhead of copying.

iteration: the process of repeating a mathematical or computing process or set of instructions again and again, each time applying it to the result of the previous stage

Microsoft Copilot
www.oxfordlearnersdictionaries.com

2025年6月27日星期五

Reading

congregational: connected with the group of people who belong to a particular church and go there regularly

parishioner: a person living in a parish, especially one who goes to church regularly

by dint of something/of doing something: by means of something

charisma: the powerful personal quality that some people have to attract and impress other people

meld: to combine with something else; to make something combine with something else

The Sermon on the Mount is a collection of sayings spoken by Jesus of Nazareth found in the Gospel of Matthew that emphasizes his moral teachings.

The Old English Sheepdog is a large breed of dog that emerged in England from early types of herding dog.

scavenge: (of a person, an animal or a bird) to search through waste for things that can be used or eaten

meander: to bend with curves rather than being in a straight line

slick: having a smooth surface

neat: tidy and in order; carefully done or arranged

Adélie penguin: a gregarious territorial penguin of Antarctica, having a distinctive white ring around the eye

intricate: having a lot of different parts and small details that fit together

trellis: an arrangement that forms or gives the effect of a lattice

lattice: a structure that is made of thin, narrow pieces of wood or metal that cross over each other with spaces that are like diamonds in shape between them, used, for example, as a fence; any structure or pattern like this

sturdy: ​(of an object) strong and not easily damaged

generalization: a general statement that is based on only a few facts or examples; the act of making such statements

clique: a small group of people who spend their time together and do not allow others to join them

baffle: to confuse somebody completely; to be too difficult or strange for somebody to understand or explain

maddening: ​making you feel extremely annoyed

worrisome: that makes you worry


Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

www.merriam-webster.com

2025年6月25日星期三

Rational

waver: to be or become weak or unsteady

decadence: behavior, attitudes, etc. that show a fall in standards, especially moral ones, and an interest in pleasure and fun rather than more serious things

gliding: the sport of flying in a glider

coif: to arrange (hair) by brushing, combing, or curling

whitecaps: waves in the sea or ocean with white tops on them

sprinkler: a device with holes in that is used to spray water in drops onto plants, soil or grass

driveway: a wide hard path or a private road that leads from the street to a house

roller skate: a type of boot with two pairs of small wheels attached to the bottom

slam: to crash into something with a lot of force; to make somebody/something crash into something with a lot of force

asphalt: a thick black sticky substance used especially for making the surface of roads

huddle: (of people or animals) to gather closely together, usually because of cold or fear

wail: to make a long, loud, high noise because you are sad or in pain

wrestle: to struggle to deal with something that is difficult

shun: to avoid somebody/something

a case made of plaster of Paris that covers a broken bone and protects it

delirium: an acute mental disturbance characterized by confused thinking and disrupted attention usually accompanied by disordered speech and hallucinations

avail: to make use of something, especially an opportunity or offer

realm: an area of activity, interest or knowledge

superstition: the belief that particular events happen in a way that cannot be explained by reason or science; the belief that particular events bring good or bad luck


Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

www.merriam-webster.com

2025年6月24日星期二

Using objects with vectors

A complex number can be visually represented as a pair of numbers (a, b) forming a vector on a diagram called an Argand diagram, representing the complex plane. Re is the real axis, Im is the imaginary axis, and i is the "imaginary unit", that satisfies i2 = −1.

A complex number can be represented as a vector in the complex plane, where the real part corresponds to the x-coordinate and the imaginary part to the y-coordinate. This allows us to visualize and perform vector operations like addition and subtraction on complex numbers.

In C++, a vector of complex numbers can be created using std::vector and std::complex. The std::complex template class is part of the <complex> header and represents complex numbers with a specified underlying floating-point type (e.g., double, float).

The right shift operator in C++ is written as >> and is used to shift the bits of a number to the right by a specified number of positions. It’s a bitwise operator, meaning it works directly on the binary representation of numbers.

In C++, an iterator is like a smart pointer that allows you to traverse through elements in a container (like vector, list, map, etc.) without knowing the underlying structure. It’s part of the Standard Template Library (STL) and is essential for working with algorithms and containers in a generic way.

In C++, std::complex<double> is a class template specialization from the <complex> header that represents a complex number with both real and imaginary parts stored as double precision floating-point values.

semantics: the meaning of words, phrases or systems

In the code snippet prev(points.end(), 2)->real(), here's what each part means:

points.end(): This returns an iterator pointing to the element after the last element in the vector points.
prev(points.end(), 2): The prev function takes an iterator and a number of positions to move back. In this case, it moves back 2 positions from the end of the vector, effectively pointing to the second-to-last element.
->real(): This accesses the real part of the complex number at the iterator's current position.

So, prev(points.end(), 2)->real() gets the real part of the second-to-last complex number in the points vector.

Objects are instances of classes. For example, a complex number object contains data members like the real and imaginary parts. You access these members using the dot operator (.), like complexNumber.real().

Iterators are special objects that act like pointers to elements within a container (like a vector). They allow you to traverse the container. When using iterators, you access the members of the object they point to using the arrow operator (->), like iterator->real().

Mainly by Microsoft Copilot

Vectors in C++

In C++, a vector is a dynamic array provided by the Standard Template Library (STL). Unlike regular arrays, vectors can automatically resize themselves when elements are added or removed, making them incredibly flexible for managing collections of data.

In C++, an object is an instance of a class, which is a user-defined blueprint for creating data structures that bundle both attributes (variables) and behaviors (functions).

Think of a class as a recipe, and an object as the actual dish you cook using that recipe.

In C++, an algorithm typically refers to a set of functions provided by the <algorithm> header in the Standard Template Library (STL). These functions help you perform common operations like sorting, searching, counting, and manipulating data structures such as vectors, arrays, and lists.

In mathematics, an algorithm is a step-by-step procedure used to solve a problem or perform a computation. Think of it like a recipe: a clear set of instructions that, when followed correctly, leads to a solution.

Generic programming is a style of programming where algorithms and data structures are written in a way that they can work with any data type. In C++, this is primarily achieved using templates.

consecutively: following one after another in a continuous series

In C++, the dot operator (.) and the push_back() function serve very different but essential roles—one for accessing members of objects, and the other for modifying containers like vectors.

The term "arbitrary element" generally refers to any element chosen from a set or container without a specific rule or pattern. In C++, how you work with an arbitrary element depends on the data structure you're using.

Microsoft Copilot

Travel

typewriter: a machine that produces writing similar to print. It has keys that you press to make metal letters or signs hit a piece of paper through a long, narrow piece of cloth covered with ink (= colored liquid).

The IBM Selectric (a portmanteau of "selective" and "electric") was a highly successful line of electric typewriters introduced by IBM on 31 July 1961.

portmanteau word: a word that is invented by combining the beginning of one word and the end of another and keeping the meaning of each. For example motel is a portmanteau word that is a combination of motor and hotel.

cursive: ​(of handwriting) with the letters joined together

itinerary: a plan of a journey, including the route and the places that you visit

capitol: the building in Washington DC where the US Congress (= the national parliament) meets to work on new laws

"at the wheel" generally means in control or in command, often in a driving or leadership context

thoroughbred: (of an animal, especially a horse) of high quality, with parents that are both of the same type

orchard: DJ[ˋɔ:tʃəd]

adobe: a mixture of mud and straw, dried in the sun and used as a building material

Douglas fir: an evergreen conifer species in the pine family, Pinaceae. It is the tallest tree in the Pinaceae family.

neatly: in a way that is tidy and in order; carefully

geology: the scientific study of the physical structure of the earth, including the origin and history of the rocks and soil of which the earth is made

thrill: a strong feeling of excitement or pleasure; an experience that gives you this feeling

stalactite: a long pointed piece of rock hanging down from the roof of a cave (= a hollow place underground), formed over a long period of time as water containing lime runs off the roof

stalagmite: a piece of rock pointing upwards from the floor of a cave (= a hollow place underground), that is formed over a long period of time from drops of water containing lime that fall from the roof

regale him with: to entertain somebody with stories, jokes, etc.


Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

2025年6月20日星期五

The Relationship Between Prebiotics and Probiotics

    The relationship between prebiotics and probiotics represents one of the most important partnerships in human health, creating a synergistic system that supports optimal gut function and overall well-being. While these terms are often confused or used interchangeably, they serve distinct yet complementary roles in maintaining digestive health and supporting the immune system.

Understanding the Basic Definitions

    Probiotics are live microorganisms—typically bacteria or yeast—that provide health benefits when consumed in adequate amounts. These beneficial bacteria help maintain the balance of gut flora and live in synergy with other helpful bacteria in the digestive system. Common probiotic strains include various species of Lactobacillus and Bifidobacterium, which can be found naturally in fermented foods like yogurt, kefir (牛奶酒), sauerkraut(德國泡菜), and kimchi.

    Prebiotics, on the other hand, are non-digestible food ingredients that beneficially affect the host by selectively stimulating the growth and activity of beneficial bacteria in the colon. They are specialized plant fibers that act as food for probiotics, supporting their growth and activity within the digestive system. Prebiotics are found in foods such as garlic, onions, bananas, whole grains, and artichokes(菊芋).

The Symbiotic Partnership

    The relationship between prebiotics and probiotics is fundamentally symbiotic, with each component enhancing the effectiveness of the other. Prebiotics serve as fuel for probiotics, providing the essential nourishment these beneficial bacteria need to thrive in the gut environment. This partnership ensures that probiotics can survive, multiply, and effectively colonize the digestive tract.

How They Work Together

The synergistic relationship operates through several key mechanisms:

    Nutritional Support: Prebiotics travel undigested through the small intestine to the colon, where probiotics ferment them and consume them for energy. This fermentation process is crucial for maintaining viable probiotic populations in the gut.

    Enhanced Survival: By providing a steady food source, prebiotics help probiotics survive the harsh acidic environment of the stomach and establish themselves in the colon. This is particularly important because probiotics are living microorganisms that can be eliminated by exposure to stomach acid, heat, or other adverse conditions.

    Metabolic Benefits: When probiotics ferment prebiotics, they produce short-chain fatty acids (SCFAs) such as butyrate, propionate, and acetate. These SCFAs serve as important energy sources for intestinal epithelial cells and have beneficial properties including anti-inflammatory and anti-cancer effects.

The Concept of Synbiotics

    The combination of prebiotics and probiotics in a single product or food is called a synbiotic. This approach aims to create a synergistic effect that enhances the survival and activity of probiotics while simultaneously providing the food they need to grow and thrive. Research suggests that synbiotics may be more effective than using probiotics alone, as they optimize the health benefits of both components.

Health Benefits of the Prebiotic-Probiotic Partnership

Digestive Health

    The collaboration between prebiotics and probiotics promotes optimal digestive function by maintaining a balanced gut microbiome. This balance helps prevent gastrointestinal issues, reduces bloating and gas, and improves bowel movement regularity.

Immune System Support

    Approximately 70% of the immune system resides within the gut, making the prebiotic-probiotic relationship crucial for immune function. Together, they strengthen the gut barrier function, help prevent harmful substances from entering the bloodstream, and regulate immune responses.

Enhanced Nutrient Absorption

    The fermentation of prebiotics by probiotics improves the body's ability to absorb essential nutrients, vitamins, and minerals. This process also supports the production of important vitamins like B12 and K.

pH Regulation

    The production of SCFAs through prebiotic fermentation helps lower intestinal pH, creating an environment that is conducive(有助) to beneficial bacteria while inhibiting the growth of harmful pathogens.

Mechanisms of Action

Competitive Exclusion

    Probiotics compete with harmful bacteria for resources and receptor-binding sites in the gut. When supported by prebiotics, these beneficial bacteria are better equipped to outcompete pathogens and maintain dominance in the gut ecosystem.

Antimicrobial Production

    Probiotics produce natural antimicrobial compounds including organic acids, hydrogen peroxide, and bacteriocins. The availability of prebiotic substrates enhances this antimicrobial activity, providing additional protection against harmful microorganisms.

Gut Barrier Enhancement

    The SCFA production resulting from prebiotic fermentation helps strengthen the intestinal barrier by promoting the synthesis of mucin proteins (黏蛋白) and regulating tight junction proteins. This enhanced barrier function is crucial for preventing "leaky gut" syndrome and maintaining overall gut health.

Optimization Strategies

Dietary Approach

    The most effective way to harness the prebiotic-probiotic relationship is through a diverse diet that includes both types of compounds. Probiotic-rich foods include yogurt, kefir, sauerkraut, kimchi, and other fermented products. Prebiotic sources encompass high-fiber foods like fruits, vegetables, whole grains, and legumes.

Concentration and Timing

    Research indicates that the concentration of prebiotics significantly affects the production of SCFAs by probiotics. The effectiveness of this partnership can also be influenced by factors such as individual gut microbiome composition, diet quality, and overall health status.

Combined Supplementation

    For those considering supplements, products that combine both prebiotics and probiotics (synbiotics) may offer enhanced benefits compared to taking each component separately. However, studies suggest that probiotics obtained from food sources are often more beneficial than those from supplements.

Conclusion

    The relationship between prebiotics and probiotics represents a fundamental partnership in human health, where prebiotics serve as the essential fuel that enables probiotics to thrive and provide their numerous health benefits. This symbiotic relationship extends far beyond simple digestion, influencing immune function, mental health, and overall well-being. Understanding and nurturing this partnership through appropriate dietary choices and lifestyle practices is crucial for maintaining optimal gut health and supporting the body's complex microbial ecosystem. As research continues to unveil the intricate (complicated) mechanisms of this relationship, it becomes increasingly clear that both components are essential for achieving and maintaining a balanced, healthy gut microbiome.

perplexity.ai

unforgettable childhood

canal: a long straight passage dug in the ground and filled with water for boats and ships to travel along; a smaller passage used for carrying water to fields, crops, etc.

fjord: a long narrow area of sea between high cliffs

cottage: a small house, especially in the country

fancy: unusually complicated, often in an unnecessary way; intended to impress other people

splash: to make somebody/something wet by making water, mud, etc. fall on them/it

Capture the Flag is a traditional outdoor game. The two teams try to capture each other's flag and return it to their base.

A popsicle is a frozen treat consisting of flavored ice or ice cream on a stick.

wrangler: a cowboy or a cowgirl, especially one who takes care of horses

preside: to lead or be in charge of a meeting, ceremony, etc.

extravaganza: a large, expensive and impressive entertainment

dexterity: ​skill in using your hands or your mind

athleticism: the quality of being physically strong, fit and active

gunnysack: a large bag made from rough material and used to store flour, potatoes, etc.

A gunny sack race, also known as a sack race, is a fun outdoor game where participants hop inside a sack, typically made of burlap or similar material, and race to the finish line.

A wheelbarrow race is a two-person team activity where one person acts as the "driver" and the other as the "wheelbarrow". The driver holds the other person's ankles, and the "wheelbarrow" walks on their hands while the driver supports them.

Rose Bowl: The Rose Bowl is an American outdoor athletic stadium, located in Pasadena, California, a northeast suburb of Los Angeles.

juggle: to try to deal with two or more important jobs or activities at the same time so that you can fit all of them into your life

pay off: to be successful and bring good results

kaizen: the practice of continuously improving the way in which a company operates

jigsaw: a saw (= a type of tool) with a narrow blade for cutting designs in thin pieces of wood or metal

plywood: board made by sticking thin layers of wood on top of each other

solicit: to ask somebody for something, such as support, money or information; to try to get something or persuade somebody to do something

witty: clever and humorous

fold-out: (of a piece of furniture or a page in a book or magazine) designed to be opened out for use and then folded away again so it can be stored easily

comic strip: a series of drawings inside boxes that tell a story and are often published in newspapers

depict: to describe something in words, or give an impression of something in words or with a picture

gin up: arouse or intensify strong feelings in someone

outrageous: very unusual and intended to shock people slightly

muse: to think carefully about something for a time, ignoring what is happening around you

inscribe: to write or cut words, your name, etc. onto something

cider: an alcoholic drink made from the juice of apples.

The term "Wurlitzer" most commonly refers to The Rudolph Wurlitzer Company, an American company known for its musical instruments, particularly jukeboxes and electric pianos.

rink: a specially prepared flat surface of ice, where you can ice-skate

bouquet: DJ[buˋkei] a bunch of flowers arranged in an attractive way so that it can be carried in a ceremony or presented as a gift

carnation: a white, pink, red or yellow flower, often worn as a decoration on formal occasions

wind down; to rest or relax after a period of activity or excitement

ornament: DJ[ˋɔ:nəmənt] an object that is used as decoration in a room, garden, etc. rather than for a particular purpose

reminisce: DJ[͵remiˋnis]


Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

2025年6月19日星期四

C++ vs Python

Question: In comparison between studying C++ and python for beginner, what are the advantages and disadvantages of studying them? Is C++ too old-fashioned to study?

Python for Beginners

Advantages:

Ease of learning and readability: Python's syntax is clean and intuitive. Its code often reads like plain English, which makes it approachable for beginners. This simplicity lets you focus on learning programming concepts instead of getting bogged down in complex syntax.

Rapid prototyping: As an interpreted language, Python allows you to write and test code quickly. This iterative process is ideal for learning and experimenting.

Vast community and libraries: Python boasts extensive libraries and frameworks --- particularly in web development, data science, and automation --- which can help you build projects withing reinventing the wheel.

High-level abstractions: Python abstracts away many of the lower-level details like memory management, letting you concentrate on logic and problem solving.

Disadvantages:

Performance: Because Python is interpreted and dynamically typed, it generally runs slower than compiled languages such as C++. For compute-intensive applications, you may eventually need to resort to other languages form optimization.

Hidden complexity: The abstraction of details (e.g. memory management) means you might not learn foundational computing concepts as deeply early on, which can be a disadvantage if you are aiming to understand what happens "under the hood".

C++ for Beginners

Advantages:

Deep understanding of computer science fundamentals: C++ exposes you to core programming concepts like manual memory management, pointers, and detailed control over system resources. Learning these concepts can provide a solid foundation if you later need to work on performance-critical or system-level applications.

Performance: C++ is known for its high efficiency and performance. Its compilation to machine code makes it preferred choice for applications where speed and resource management are critical (e.g. game development and real-time simulation).

Object-oriented programming and beyond: C++ supports various programming paradigms (object-oriented, generic, and even functional programming). This exposure can be highly beneficial as it broadens your programming perspectives.

Modern evolution: Despite its age, C++ is far from outdated. The language has continuously evolved with modern updates, incorporating features that simplify many tasks and improve code safely and performance.

Disadvantages:

Steep learning curve: C++ is notoriously unforgiving for beginners. The language requires a good understanding of concepts like pointers, memory allocation and more intricate syntax, which can be overwhelming.

Verbose and complex syntax: Even simple tasks in C++ can require more boilerplate code compared to Python. This verbosity can obscure the learning of basic programming logic amid the technical details.

Manual management of resources: While learning about memory management is beneficial, managing resources manually can lead to errors --- especially in the early stages of learning.

Is C++ too old-fashioned to study?

Not at all. While C++ has been around for decades, it has continually modernized to meet current demands. Its robust ecosystem, emphasis on performance, and direct interaction with the system hardware mean it remains indispensable in many fields --- such as game development, embedded systems, finance, and high-performance computing. In essence, C++ is like a well-forged tool in a craftsman's arsenal: while it requires more skill to use, mastering it can open doors to deep, performance-critical programming that simply is not accessible with higher-level languages. Even if you begin with Python for its ease, exploring C++ later can round out your understanding of programming fundamentals and system-level design.

For beginners, Python offers a smoother start and encourages rapid exploration, while C++ challenges you to understand the intricacies that lie beneath the surface of computing. Your choice should reflect your immediate interests and long-term goals:

Choose Python if you aim to quickly dive into coding, prototype ideas, or explore areas like data analysis, web development, or automation.

Choose C++ if your are intrigued by system programming, game development, or you want to build a strong foundation in understanding how computers work under the hood.

If you are curious to bridge the two, some learners find starting with Python builds confidence, which then makes tackling C++ less intimidating later on.

intuitive: (of people) able to understand something by using feelings rather than by considering the facts

bog down: to make something sink into mud or wet ground

prototype: an original model on which something is patterned

iterative: (of a process) that involves repeating a process or set of instructions again and again, each time applying it to the result of the previous stage

under the hood: refers to the internal workings or details of something, often hidden or not immediately obvious

compilation: the process of compiling something

intricate: having a lot of different parts and small details that fit together

verbose: using or containing more words than are needed

boilerplate: a standard form of words that can be used as a model for writing parts of a business document, legal agreement, etc.

Embedded systems are specialized computer systems designed to perform dedicated functions within larger mechanical or electronic systems.

forge: to shape metal by heating it in a fire and hitting it with a hammer; to make an object in this way

intricacies: the complicated parts or details of something

intrigue: to make somebody very interested and want to know more about something

intimidating: frightening in a way that makes a person feel less confident

Microsoft Copilot

www.oxfordlearnersdictionaries.com

Technology

sputnik: a satellite of the type that was put into space by the Soviet Union

jolt: to give somebody a sudden shock, especially so that they start to take action or deal with a situation

exposition: an event at which people, businesses, etc. show and sell their goods

morph: to change, or make somebody/something change, into something different

retort: ​a quick, angry or humorous reply

prowess: ​great skill at doing something

button-down: a button-down collar, shirt, etc. has the ends of the collar fastened to the shirt with buttons

blazer: a jacket, not worn with matching trousers, often showing the colors or badge of a club, school, team, etc.

depict: to describe something in words, or give an impression of something in words or with a picture

over-the-top: done with too much acting, emotion or effort

daredevil: a person who enjoys doing dangerous things, in a way that other people may think is stupid

tandem: a bicycle for two riders, one behind the other

contraption: a machine or piece of equipment that looks strange or complicated and possibly does not work well

harness: to control and use the force or strength of something to produce power or to achieve something

bold: (of people or behavior) brave and confident; not afraid to say what you feel or to take risks

civic: officially connected with a town or city

envision: to imagine what a situation will be like in the future, especially a situation you intend to work towards

excel: to be very good at doing something

pursue: to do something or try to achieve something over a period of time

explicitly: clearly or directly, so that the meaning is easy to understand

clan: a very large family, or a group of people who are connected because of a particular thing

quotidian: ​ordinary; typical of what happens every day

mundane: ordinary

chore: a task that you do regularly

sacrosanct: that is considered to be too important to change or question

edict: an official order or statement given by somebody in authority

abide: to dislike somebody/something so much that you hate having to be with or deal with them

unseemly: (of behavior, etc.) not polite or suitable for a particular situation

condiment: a substance such as salt, pepper or a sauce that is added to food to give it extra taste

bedrock: a strong base for something, especially the facts or the principles on which it is based

speedometer: an instrument in a vehicle which shows how fast the vehicle is going

leap: to jump high or a long way

frantically: quickly and with a lot of activity, but in a way that is not very well organized

exuberance: ​the quality of being full of energy, excitement and happiness

squeaky: ​making a short, high sound

casserole: a hot dish made with meat, vegetables, etc. that are cooked slowly in liquid in an oven

hound: to keep following somebody and not leave them alone, especially in order to get something from them or ask them questions

speculate: to form an opinion about something without knowing all the details or facts

goof off: to spend your time doing nothing, especially when you should be working

tag along: to go somewhere with somebody, especially when you have not been asked or invited

usher: to take or show somebody where they should go

coif: to arrange (hair) by brushing, combing, or curling

matching funds: financial contributions that are provided in proportion to funds raised from other sources

steward: a person who helps at a large public event, for example a race or public meeting, by keeping order, showing people where to go, etc.

entrust: to make somebody responsible for doing something or taking care of somebody

litigation: ​the process of making or defending a claim in court

revere: to admire and respect somebody/something very much

flout: to show that you have no respect for a law, etc. by openly not obeying it

Joseph Raymond McCarthy was an American politician who served as a Republican U.S. Senator from the state of Wisconsin from 1947 until his death at age 48 in 1957.

transfix: to make somebody unable to move because they are afraid, surprised, etc.

coverage: the reporting of news and sport in the media

despise: to dislike and have no respect for somebody/something

flagrant: (of an action) that shocks you because it is done in a very obvious way and shows no respect for people, laws, etc.

bewildering: making you feel confused because there are too many things to choose from or because something is difficult to understand

glamorous: especially attractive and exciting, and different from ordinary things or people

virtuous: behaving in a very good and moral way; showing high moral standards

levy: an extra amount of money that has to be paid, especially as a tax to the government

sandwich sign: sandwich board

artifact: an object that is made by a person, especially something of historical or cultural interest

alma mater: the school, college or university that somebody went to

municipal: DJ[mju:ˋnisipəl] connected with or belonging to a town, city or district that has its own local government

league: a group of people or nations who have combined for a particular purpose

nonpartisan: not supporting the ideas of one particular political party or group of people strongly

upend: to turn somebody/something the wrong way up or onto one end

hidebound: having old-fashioned ideas, rather than accepting new ways of thinking

porcelain: DJ[ˋpɔ:slin]

Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

www.merriam-webster.com

2025年6月18日星期三

Sth abt Pointers

delve into: to try hard to find out more information about something

An automatic variable is a type of local variable that’s automatically created when a function or block is entered and destroyed when it’s exited. You’ll find this concept in languages like C, C++, and Java.

A function is a reusable block of code designed to perform a specific task. You define it once and can call it multiple times throughout your program. Functions help keep code organized, readable, and modular.

A block is a group of statements enclosed in curly braces {}. It defines a scope in many programming languages. Blocks are used in functions, loops, conditionals, and more.

So, a function contains a block, but not every block is a function. Think of a function as a named tool, and a block as the toolbox where the instructions live.

indispensable: too important to be without

The return address is a key part of how function calls work in many programming languages and computer architectures. When a function is called, the program needs to remember where to come back to after the function finishes. That’s where the return address comes in.

Last In, First Out (LIFO) is a method of organizing and accessing data where the most recently added item is the first one to be removed. It’s like stacking plates: you add to the top, and you also remove from the top.

trade-off: the act of balancing two things that are opposed to each other

A dangling pointer is a pointer that still holds the address of memory that has already been freed or deallocated. It’s like having the key to a hotel room that’s already been cleaned out and reassigned—you’ve got the key, but what’s behind the door is no longer what you expect.

nullptr is a special keyword introduced in C++11 to represent a null pointer constant in a type-safe way. Before nullptr, programmers used NULL or 0, which could lead to ambiguity --- especially in function overloads.

modular: (of machines, buildings, etc.) consisting of separate parts or units that can be joined together

The -> operator in C++ is called the member access operator for pointers. It’s a shorthand for accessing members (variables or functions) of an object through a pointer.

shorthand: a quick way of writing using special signs or abbreviations, used especially to record what somebody is saying

A void pointer (void*) in C++ is a special type of pointer that can point to any data type, but it doesn’t know what type it’s pointing to. That’s why it’s often called a generic pointer.

A smart pointer in C++ is like a regular pointer with superpowers—it automatically manages the memory it points to, helping you avoid memory leaks, dangling pointers, and other pointer-related headaches.

A shared_ptr in C++ is a type of smart pointer that allows multiple pointers to share ownership of the same dynamically allocated object. It’s part of the C++11 standard and lives in the <memory> header.

robust: strong and healthy

Microsoft Copilot

Table salt

Question: I eat table salt more than usual today, is it a good idea to drink more water in order to get rid of it?

    When you consume more salt than usual, your body tends to retain water to maintain the proper balance of electrolytes in your bloodstream. Drinking extra water can help your kidneys work more efficiently in excreting some of the excess sodium, potentially easing the load on your system. However, it's important to note that simply chugging large quantities of water isn't a magic solution --- it should be done gradually.

    Keeping your water intake at a healthy level throughout the day is generally beneficial when you've consumed a high-salt meal. That said, excessive fluid intake can also be problematic in certain situations, so it’s key to listen to your body. If you experience symptoms like extreme thirst, headaches, swelling, or any other unusual signs, it would be a good idea to consult a healthcare professional for advice tailored to your situation.

    Also, for future reference, managing salt intake regularly along with a balanced diet is generally the best course of action to maintain your overall health. Remember, making gradual adjustments is usually more effective than sudden changes.

chug: to drink all of something quickly without stopping

Explained by Microsoft Copilot and Edited

www.oxfordlearnersdictionaries.com

Developing State

cohort: a group of people who share a common feature or aspect of behavior

conflagration: ​a very large fire that destroys a lot of land or buildings

snippet: a small piece of information or news

hair-raising: extremely frightening but often exciting

footage: part of a film showing a particular event

duck-and-cover: to hide under something and cover your face and head, as a way of trying to protect yourself, for example from a nuclear explosion

overwhelming: DJ[ˋəuvəˋhwelmiŋ]

suburb: DJ[ˋsʌbə:b]

bulldoze: to destroy buildings, trees, etc. with a bulldozer

viable: that can be done; that will be successful

rarefied: understood or experienced by only a very small group of people who share a particular area of knowledge or activity

crack: a sudden loud noise

boast: to talk in a way that shows you are too proud of something that you have or can do

veteran: a person who has been a soldier, sailor, etc. in a war

The G.I. Bill, formally the Servicemen's Readjustment Act of 1944, is a U.S. law that provides educational and other benefits to veterans.

covenant: a promise to somebody, or a legal agreement, especially one to pay a regular amount of money to somebody/something

enact: to pass a law

segregate: to separate people of different races, religions or sexes and treat them in a different way

Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

Tornado

carport: a shelter for a car, usually built next to a house and consisting of a roof supported by posts

slam: to crash into something with a lot of force; to make somebody/something crash into something with a lot of force

usher: to take or show somebody where they should go

huddle: (of people or animals) to gather closely together, usually because of cold or fear

stash: an amount of something that is kept secretly

plume: ​a cloud of something that rises and curves upwards in the air

confine: to keep somebody/something inside the limits of a particular activity, subject, area, etc.

splinter: (of wood, glass, stone, etc.) to break, or to make something break, into small, thin, sharp pieces

tar: a thick, sticky black liquid that becomes hard when cold. Tar is obtained from coal and is used especially in making roads.

respectable: considered by society to be acceptable, good or correct

unseemly: (of behavior, etc.) not polite or suitable for a particular situation


Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

2025年6月17日星期二

Using Objects with Pointers

Dynamic memory management in C++ refers to the process of allocating and deallocating memory manually during a program’s runtime, rather than relying solely on the stack or predefined memory sizes. It gives programmers more control over how memory is used, which is especially useful when the size or number of data elements isn’t known in advance.

heap: ​an untidy pile of something

Memory leakage in C++ happens when a program allocates memory on the heap using new (or similar functions) but fails to release it using delete. This leftover memory remains occupied even though it's no longer needed, leading to inefficient memory use and potentially crashing long-running applications.

In C++, type aliases let you create alternative names for existing types, making your code cleaner and often easier to understand --- especially when dealing with complex types.

using (Modern C++11 and beyond)

The generic programming paradigm is all about writing code that's flexible, reusable, and type-independent. In C++, this is primarily achieved through templates, which let you write functions and classes that work with any data type.

In the video "Using objects with pointers," the instructor explains:

Scope Resolution Operator (::): This operator is used to access a static member function of a class without needing an object of that class. For example, Clock::now() calls the static member function now from the Clock class. This is necessary because static member functions belong to the class itself rather than any particular object.

Static Member Function: A static member function can be called on the class itself, not on an instance of the class. It doesn't require an object to be created. In the video, Clock::now() is a static member function that returns the current time, and it is accessed using the scope resolution operator.

std::flush is an output stream manipulator in C++ that forces the immediate writing of any buffered output to its destination --- like the console or a file

Pointers in C++ are used for several important reasons, even if the code can run without them:

Dynamic Memory Management: Pointers allow you to allocate memory dynamically during runtime, which is crucial for creating flexible and efficient programs. This is particularly useful for managing resources in applications that require variable amounts of memory.

Performance Optimization: Using pointers can optimize performance by directly accessing and manipulating memory addresses, which can be faster than using standard variables.

Complex Data Structures: Pointers are essential for implementing complex data structures like linked lists, trees, and graphs, which rely on dynamic memory allocation and efficient memory management.

This is especially important in real-world applications where memory needs can change during execution.

Dynamic allocation in C++ refers to the process of reserving memory during a program’s runtime rather than at compile time. This is especially useful when you don’t know in advance how much memory you’ll need --- for example, when handling user input, variable-sized data structures, or real-time data.

A sanity check in programming --- especially in C++—is a quick, simple test to verify that something behaves as expected before diving into more complex logic or debugging. Think of it as asking, “Am I not missing something obvious?”

The angle brackets here are used to specify template arguments. 

In C++, member access operators are used to access members (like variables or functions) of a class, struct, or union. (dot operator/arrow operator)

Dot operator is used when you have an actual object (not a pointer).

Arrow operator is used when you have a pointer to an object. 

The indirection operator in C++ is the asterisk symbol *, and it's used to dereference a pointer—that is, to access the value stored at the memory address the pointer is pointing to.

Mainly by Microsoft Copilot