搜尋此網誌

2026年9月15日星期二

Anatomy of a class

In Python, instance attributes are variables that belong to a specific object created from a class. They are usually defined inside the __init__ method using self, and each object has its own independent copy of these attributes. This makes them different from class attributes, which are shared across all instances.

class Car:

    def __init__(self, brand, model):

        # Instance attributes

        self.brand = brand

        self.model = model


car1 = Car("Toyota", "Camry")

car2 = Car("Honda", "Civic")


print(car1.brand, car1.model)  # Toyota Camry

print(car2.brand, car2.model)  # Honda Civic


class Dog:
    def __init__(self, name):
        self.name = name
        self.legs = 4
    
    def speak(self):
        print(self.name + ' says: Bark!')

myDog = Dog('Rover')
print(myDog.name)
print(myDog.legs)

Class Definition
You define a class Dog with an __init__ method and a speak method.

__init__ Method
Runs automatically when you create a new Dog object.
self.name = name → assigns the given name to the instance.
self.legs = 4 → every dog object starts with 4 legs.

Instance Attributes
self.name and self.legs are instance attributes.
Each Dog object has its own copy of these attributes.

Creating an Object
myDog = Dog('Rover') → creates a new Dog instance with name = "Rover" and legs = 4.

Accessing Attributes
print(myDog.name) → prints "Rover".
print(myDog.legs) → prints 4.

Method Usage
If you call myDog.speak(), it will print:
Rover says: Bark!

adorable: very attractive and easy to feel love for

Static attributes in Python are what we usually call class attributes. Unlike instance attributes (unique to each object), static/class attributes are shared across all instances of the class. They are defined directly inside the class body, not inside __init__.

connotation: ​an idea suggested by a word in addition to its main meaning

In Python, a getter function is a method that allows you to safely access (or "get") the value of an attribute from a class. It’s often used together with properties to control how attributes are read, especially when you want to add validation, formatting, or encapsulation.

Encapsulation in Python is the practice of bundling data (attributes) and the methods (functions) that operate on that data into a single unit, typically a class. Its primary goal is to hide internal implementation details and restrict direct access to an object's state to prevent accidental modifications.

class Dog: _legs = 4 # static/class attribute def __init__(self, name): self.name = name # instance attribute def getLegs(self): # getter function return self._legs def speak(self): print(self.name + ' says: Bark!') myDog = Dog('Rover') print(myDog.name) # Rover print(myDog.getLegs()) # 4


In your example, you’ve introduced a static (class) attribute _legs and a getter function getLegs() to access it.

Static/Class Attribute (_legs)
Defined directly in the class body (_legs = 4).
Shared across all Dog objects.
Accessible via Dog._legs or through an instance (myDog._legs).

Instance Attribute (name)
Defined inside __init__ using self.name.
Unique to each object (e.g., Rover, Buddy, Max).

Getter Function (getLegs)
Provides controlled access to the static attribute.
Returns self._legs, which refers to the class-level _legs.

myDog = Dog('Rover') myDog._legs = 3 print(myDog.name) print(myDog.getLegs()) print(Dog._legs)

Class Attribute _legs = 4
Defined at the class level.
Shared by all Dog objects unless shadowed.

Instance Creation
myDog = Dog('Rover') → creates a new dog with name = "Rover".
At this point, myDog sees _legs from the class (Dog._legs = 4).

Assigning myDog._legs = 3
This does not change the class attribute.
Instead, it creates a new instance attribute _legs on myDog only.
Now myDog has its own _legs = 3, shadowing the class’s _legs.

Printing Values
print(myDog.name)"Rover" (instance attribute).
print(myDog.getLegs())3 (because self._legs now refers to the instance attribute).
print(Dog._legs)4 (class attribute remains unchanged).

Microsoft Copilot

避免重複負面的言論

grab: to take or hold somebody/something with your hand suddenly or roughly

zesty: ​that tastes or smells sharp and fresh

compel: to force somebody to do something; to make something necessary

perpetuate: to make something such as a bad situation, a belief, etc. continue for a long time

gasp: to take a quick deep breath with your mouth open, especially because you are surprised or in pain

Our words shape the way we think, and the way we think shapes how we feel; how we feel determines what we do, and what we do determines our belief.

這句話說明一個循環因果:我們的語言(說的話)會影響思維方式,而思維方式又會影響情緒;情緒決定行為,行為反過來形塑信念。換言之,語言 → 思考 → 感受 → 行為 → 信念,任何一環的改變都會影響整個自我認知與世界觀。

minute: tiny

Mind wandering is the natural drifting of your attention away from an external task and toward your internal thoughts and daydreams.

The Default Mode Network (DMN) is a large-scale brain system most active when you’re not focused on external tasks—such as during daydreaming, self-reflection, or imagining the future. It plays a central role in constructing your sense of self, but disruptions in its activity are linked to conditions like Alzheimer’s, depression, and autism.

Metacognition is the ability to think about your own thinking—monitoring, evaluating, and regulating how you learn, remember, and solve problems. It is central to effective learning, decision-making, and self-awareness.

Self-referential thinking is a cognitive process where you relate neutral external events, information, or stimuli directly to yourself.

underscore: to emphasize or show that something is important or true

sift: to examine something very carefully in order to decide what is important or useful or to find something important

Nicole Vignola "Rewire"

hk.dictionary.search.yahoo.com

oxfordlearnersdictionaries.com

Google AI overview

Explained by Microsoft Copilot

Moon and Venus


2026年9月14日星期一

技術的訓練比器材更重要

Canon EOS 1500D

  • 1500D 是 Canon 入門級 DSLR,24.1MP APS‑C 感光元件,對新手來說解析力充足,日常、旅行、人像都夠用。

  • 有完整的 P/Av/Tv/M 模式、內建閃燈、9 點 AF 與場景模式,很適合由自動過渡到半自動(Av/Tv)再到全手動(M)。

  • 限制主要是對焦速度、連拍與高 ISO 表現不如新機,但作為「學習機」完全合格。

EF‑S 18–135mm f/3.5–5.6 IS USM(旅遊/日常一鏡)

  • 覆蓋廣角到中長焦(APS‑C 等效約 29–216mm),非常適合旅行、風景、街拍、家庭照。

  • IS 防手震對新手很友善,能提升手持成功率,尤其在室內或傍晚。

  • 限制是最大光圈隨焦段變化(f/3.5–5.6),弱光與背景虛化能力不如定焦大光圈。

EF 35mm f/2 IS USM(二手定焦)

  • 在 APS‑C 上等效約 56mm,接近「標準視角」,非常適合人像、街拍、室內。

  • f/2 大光圈能帶來明顯的背景虛化與更好的弱光表現,是學習「景深控制」的好鏡頭。

  • 有 IS 的 35mm f/2 在 Canon EF 定焦中很少見,手持慢速快門更安心。

這套裝備的優勢(對新手)

  • 一變焦 + 一定焦,剛好練習兩種思維:

    • 用 18–135mm 學習構圖、焦段選擇、旅行隨拍。

    • 用 35mm f/2 練習「用腳變焦」、控制景深、弱光拍攝。

  • 兩支都有 IS,對新手手持成功率很友好。

可能的限制與升級路線(先不用急)

  • 高 ISO 噪點與對焦速度:1500D 在很暗環境會比較吃力,但你可以用三腳架、補光或放慢快門來補。

  • 背景虛化極限:35mm f/2 已不錯。

  • 若你之後想轉無反(如 Canon R 系列),EF 鏡可透過轉接環繼續用,不會浪費。

給你的練習建議(配合現有器材)

  • 先用 Av 模式:

    • 35mm f/2:光圈設 f/2–2.8 拍人像/靜物,練習對焦點與景深。

    • 18–135mm:白天設 f/5.6–8 拍風景/建築,練習構圖與焦段選擇。

  • 嘗試同一場景用不同焦段(例如 35mm vs 50mm 等效)拍,比較視角與背景壓縮感。

  • 每週設定一個小主題:例如「只用 35mm f/2 拍一週」或「只用 18–135mm 的 50mm 端」。


腳架是提升畫質與創作自由的關鍵工具。你已有 1500D + 18–135mm + 35mm f/2,配上鋁合金腳架,可以這樣善用:

一、先把腳架「用穩」

  • 先伸展較粗的腳管,最後才伸最細那節;盡量少用最細那節以提升穩定性。

  • 在戶外盡量把中軸降到最低(不要拉很高),重心越低越穩。

  • 雲台鎖緊順序:先鎖腳管→再鎖雲台→最後微調構圖;拍攝前輕按機身確認不會晃。

二、相機設定:腳架專屬套路

  • 關 IS:18–135mm 與 35mm f/2 都有 IS,但上腳架時建議把 IS 關掉,避免防抖系統自己「微震」。

  • 用 2 秒自拍或遙控快門:避免按快門時震動;1500D 有 2 秒倒數,很實用。

  • 關「長時間曝光降噪」除非你真的需要(會拖慢拍攝節奏)。

  • 格式:若你願意後製,建議 RAW;若只想直出,Fine JPEG 也可以。

三、最適合腳架的練習題材(配合你的鏡頭)

1) 夜景與長曝光(城市、車軌、光繪)

  • 鏡頭:18–135mm 收至 f/8–11,ISO 100。

  • 模式:M 或 Tv,快門 2–30 秒試拍;用 2 秒自拍。

  • 重點:腳架讓你在低 ISO 下用慢快門,畫面更乾淨、動態範圍更好。

2) 日落/藍調時段風景

  • 鏡頭:18–135mm 廣角端(18–24mm)拍大場景;或 35mm f/2 拍局部。

  • 光圈:f/8–11 保證前後都清晰;ISO 100。

  • 技巧:用腳架鎖定構圖,等光線變化連拍,之後可選最佳一張或做合成。

3) 靜物/室內弱光(食物、小物件、家居)

  • 鏡頭:35mm f/2 很適合;腳架讓你用 f/2–2.8 仍不怕手震。

  • 設定:Av 模式,光圈 f/2–4,ISO 100–400,讓快門自然變慢。

  • 好處:可以用更低 ISO、更細膩的畫質,同時精確控制景深。

4) 多重曝光/合成(進階但很好玩)

  • 固定腳架位置,連拍多張:

    • 曝光包圍(不同亮度)→ 後製合成 HDR。

    • 不同對焦距離 → 後製景深合成(微距/近攝很有用)。

  • 腳架確保每張構圖一致,合成更乾淨。

四、把腳架變成「學習工具」

  • 慢快門練習:刻意用 1/4 秒、1 秒、4 秒等不同快門,觀察動態模糊效果。

  • 精準構圖:腳架固定後,你可以慢慢調整水平線、前景比例、三分法。

  • 自拍與合照:家人朋友合照、或把自己放進畫面(用 2 秒/10 秒倒數)。

五、外出使用小技巧

  • 地面不平時:先調兩隻腳,再用第三隻微調;盡量不用中軸升降來「硬撐」。

  • 風大:背包掛中軸、身體擋風、快門用 2 秒倒數。


Perplexity.AI

Day Dreaming

In Hong Kong, the Nikon Zf with NIKKOR Z 50mm f/1.8 S costs around HK$15,280–16,000, while the Canon EOS R8 Mark II with RF 24-105mm f/4L IS USM is priced about HK$16,950–17,000. The Nikon combo emphasizes retro design and prime-lens sharpness, while the Canon kit offers modern speed and versatile zoom coverage.

Common Usages:

Nikon kit suits portrait, street, and artistic shooters who value shallow depth of field and vintage handling. Canon kit is ideal for travel, events, and hybrid shooters needing flexibility across focal lengths.

Image Quality:

Nikon 50mm f/1.8 S delivers clinical sharpness and creamy bokeh. Canon RF 24-105mm f/4L IS USM provides professional zoom versatility with consistent sharpness, though less shallow DOF.

兩套組合定位很不同——Nikon Z f + 50mm f/1.8 S 是「高質感全片幅定焦套裝」,適合人像、街拍、低光與追求散景;Canon R8 Mark II + RF 24‑105mm f/4L 則是「新機身 + 高畫質標準變焦」,適合旅行、活動、日常多焦段一鏡走天下。

RF 24‑105mm f/4L 在 Canon 香港官網標示 HK$10,280。

The RF 24-105mm f/4L IS USM is a professional "L" lens—costing over HK$10,000 on its own and weighing around 700g—Canon typically reserves it as an official kit option for higher-tier, professional bodies like the EOS R6 series or EOS R5 series.

定焦鏡限制︰只有一個焦段,要「變焦」只能靠走;拍風景/建築時 50mm 有時偏窄。

變焦鏡限制︰最大光圈 f/4,弱光與極淺景深不如 f/1.8 定焦;邊緣在 105mm f/4 會略軟(但仍屬高水準)。

Functional & Tactical Differences

Body Ergonomics & Design: The Nikon Z f features full analog mechanical brass dials (shutter speed, ISO, exposure compensation) with a magnesium-alloy body, giving it a heavier, classic tactile feel. The R8 Mark II utilizes a modern, utility-first deep handgrip for easier handling with telephoto and heavy zoom lenses.

In-Body Image Stabilization (IBIS): The Nikon Z f features 8-stop IBIS linked to the active focus point. The R8 Mark II adds internal sensor-shift IBIS (~7.5 stops), which works alongside the RF 24-105mm’s optical IS.

Microsoft Copiot

Perplexity.AI

Google Gemini

2026年9月10日星期四

CMOS

Canon EOS 1500D 使用的是 Canon 自製的 24.1MP APS‑C 尺寸 CMOS 感光元件(約 22.3 × 14.9 mm),屬於入門級 DSLR 中「高像素、舊世代處理器」的典型組合:解析力對初學者很夠用,但高 ISO 與連拍等性能被較舊的 DIGIC 4+ 處理器限制。

Microsoft Copilot

Gratitude 感恩

gratitude: ​the feeling of being grateful and wanting to express your thanks

interplay: the way in which two or more things or people affect each other

When life gives you lemons, the familiar saying encourages you to make lemonade by turning a hard time into something positive.

lemonade:  a sweet fizzy drink that tastes of lemon

contented: showing or feeling happiness or pleasure, especially because your life is good

incorporate: to include something so that it forms a part of something

skew: to change or influence something with the result that it is not accurate, fair, normal, etc.to change or influence something with the result that it is not accurate, fair, normal, etc.

Practicing gratitude is a self-fulfilling cycle - the more you practice it, the more it reinforces positive thoughts, and the more positive thoughts you have, the more you practice gratitude.

培養感恩是一個自我實現的循環:感恩的練習會產生一種回饋效果,這個效果會促使原本的行為或心態變得更強、更穩固。

你越常練習感恩,它就越強化正向思維:練習感恩會增加你注意到生活中美好事物的頻率,進而讓你的想法更偏向正面。

你擁有越多正向思維,你就越常練習感恩:正向思維反過來會使你更容易去感恩,兩者互相促進,形成循環。

例如每天寫下三件讓你感激的小事,久而久之你會更常注意到生活中的好事,這種注意力又會讓你更願意繼續寫下感恩事項,形成良性循環。

Nicole Vignola "Rewire"

hk.dictionary.search.yahoo.com

oxfordlearnersdictionaries.com

Explained by Microsoft Copilot