搜尋此網誌

2026年5月20日星期三

Software for chip

Bill Gates and Paul Allen kick-started the personal computer revolution by writing Altair BASIC in 1975 to run on the Altair 8800. This software was the first product of their newly formed company, Microsoft.

Stephen Gary Wozniak is an American technology entrepreneur, electrical engineer, computer programmer, and inventor. In 1976, he co-founded Apple Computer (now Apple Inc.) with his early business partner Steve Jobs. Through his work at Apple in the 1970s and 1980s, he is widely recognized as one of the most prominent pioneers of the personal computer revolution.

The Homebrew Computer Club was an early computer hobbyist group in Menlo Park, California, which met from March 1975 to December 1986.

Monte Davidoff is an American computer programmer who was one of the first employees of Microsoft.

couch: a long piece of furniture like a bed, especially in a doctor’s office

rug: a piece of thick material like a small carpet that is used for covering or decorating part of a floor

Traf-O-Data was a business partnership founded in 1972 by Bill Gates, Paul Allen, and Paul Gilbert. The company aimed to read raw data from roadway traffic counters and process it into usable reports for traffic engineers.

reams: reams [plural] (informal) a large quantity of writing

dividend: ​an amount of the profits that a company pays to people who own shares in the company

realm: an area of activity, interest or knowledge

exclusive: only to be used by one particular person or group; only given to one particular person or group

royalty: a sum of money that is paid to somebody who has written a book, piece of music, etc. each time that it is sold or performed

cap at: set as the upper limit

sublicense: a license granted to a third party by a licensee, extending some rights or privileges that the licensee enjoys

viable: feasible; that can be done; that will be successful

ruminate: to think deeply about something

confide: to tell somebody secrets and personal information that you do not want other people to know

goof around: (especially North American English, informal) to spend your time doing silly or stupid things

Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

Google AI Overview

en.wikipedia.org

2026年5月19日星期二

Histogram in Photography

A photography histogram is a graphical representation of an image's tonal values. It displays how pixels are distributed across brightness levels, from pure black on the far left to pure white on the far right. It is an essential tool for evaluating exposure and preventing overexposure or underexposure.

How to Read the Histogram

The horizontal axis (x-axis) represents the brightness of pixels, while the vertical axis (y-axis) represents the number of pixels at that specific brightness.

Left Side (Shadows): Represents pure blacks and dark tones. A spike here means you have dark shadows, but if the graph hits a wall on the far left, you are "crushing" the blacks and losing shadow details.

Middle (Midtones): Represents the middle grays and average light levels in your scene.

Right Side (Highlights): Represents pure whites and bright areas. If the graph hits the right-side wall, you are "clipping" or "blowing out" your highlights (e.g., turning a bright sky into a solid, unrecoverable white).

Common Histogram Shapes

Different types of scenes produce distinct histogram profiles:

High-Key Scene: A bright, airy scene (like a snowfield) will have a histogram heavily weighted toward the right.

Low-Key Scene: A dark, moody scene (like a night cityscape) will have the histogram weighted toward the left.

Balanced Scene: A scene with a good mix of light and shadows will have a bell-curve shape, ideally keeping all data contained within the boundaries.

Google AI overview

List comprehensions

List comprehensions in Python are a concise way to build new lists by looping through an iterable, applying an expression, and optionally filtering with conditions—all in a single line. They are faster and more readable than traditional for loops for simple transformations.

nums = [1, 2, 3, 4]

squares = [n**2 for n in nums]

print(squares)   # [1, 4, 9, 16]


nums = [1, 2, 3, 4, 5, 6]

evens = [n for n in nums if n % 2 == 0]

print(evens)   # [2, 4, 6]

>>> myList = list(range(100))
... filteredList = [item for item in myList if item % 10 == 0]
... print(filteredList)
...
[0, 10, 20, 30, 40, 50, 60, 70, 80, 90]

>>> hisString = 'His name is Samson. He lives in Tuen Mun'
>>> hisString.split('.')
['His name is Samson', ' He lives in Tuen Mun']

>>> hisString.split()
['His', 'name', 'is', 'Samson.', 'He', 'lives', 'in', 'Tuen', 'Mun']

>>> def cleanWord(word):
...         return word.replace('.', '').lower()
...    [cleanWord(word) for word in hisString.split()]
...
['his', 'name', 'is', 'samson', 'he', 'lives', 'in', 'tuen', 'mun']

Outer square brackets [...]

Define that the result will be a list.

Without them, you’d have a generator expression instead (which doesn’t immediately build a list).

.lower()
Converts the string to lowercase.
Ensures consistency (e.g., "Samson" → "samson").

>>> [cleanWord(word) for word in hisString.split() if len(cleanWord(word)) < 3]

['is', 'he', 'in']

word → is a string (e.g., "he", "is", "mun").

You cannot directly compare a string to a number (word < 3) because Python doesn’t know how to order a string against an integer.

Doing so would raise a TypeError.

len(cleanWord(word)) → is an integer (the number of characters in the cleaned word).

This can be compared to another integer (< 3) safely.

Example: "he" → len("he") = 2 → 2 < 3 ✅


Nested list comprehension

>>> [[cleanWord(word) for word in sentence.split()] for sentence in hisString.split('.')]
[['his', 'name', 'is', 'samson'], ['he', 'lives', 'in', 'tuen', 'mun']]

Outer comprehension:
[ ... for sentence in hisString.split('.')]
Splits hisString into sentences using "." as the delimiter (定界符).
Iterates over each sentence.
For each sentence, it produces a list of cleaned words.

Inner comprehension:
[cleanWord(word) for word in sentence.split()]
Splits the current sentence into words (default split on whitespace).
Applies cleanWord(word) to each word.
Produces a list of cleaned words for that sentence.

Inner brackets → build a list of cleaned words per sentence.
Outer brackets → collect those lists into one big list.
Together → you get a nested list comprehension that structures text into sentences → words → cleaned words.

The variable sentence is a string (str).

Microsoft Copilot

拍攝夕陽西下的法門

White Balance: Shade

效果:相機會自動加暖色調,橘色比肉眼看更明顯。

進行負曝光補償(exposure compensation)。

978-957-106-0873

The Canon EOS 1500D does not include a built‑in “Vivid” Picture Style. You can get very close to a “Vivid” look on the EOS 1500D by using the built-in Landscape Picture Style, then pushing a few settings a little further:

Sharpness: raise it a little if the image still feels soft.

Contrast: +1 or +2.

Saturation: +1 or +2.

Color tone: leave at 0 unless the colors start looking unnatural.

For your Canon EOS 1500D with the EF-S 18-135mm f/3.5-5.6 IS USM, start with Aperture Priority (Av), f/8 to f/11, ISO 100, and set white balance to shade for warmer sunset tones. A good starting point after the sun is hidden by the hill is to meter for the bright sky and then dial in about -1 EV to -2 EV exposure compensation to keep the colors rich and avoid a washed-out scene.

Evaluative Metering
在攝影中,矩陣模式(Matrix Metering),通常也被稱為評價測光(Evaluative Metering)、多區測光或平均測光,是現代數碼相機中最智能化、最常用的測光模式。

Once the sun is fully behind the hill, the scene usually gets darker fast, so the camera will choose a slower shutter speed in Av mode. Using a tripod, keep ISO at 100 and let the shutter slow down. This matches common sunset shooting practice of using smaller apertures and controlling exposure with shutter speed.

With advanced skill, manual mode can be utilized. With a tripod, you can use a much slower shutter and get cleaner sunset color. Settings: f/8 to f/11, ISO 100, and a shutter speed around 1/4s to several seconds depending on brightness. Set the white balance to shade. Focus on the hill edge or a distant subject using manual focus. Image stabilizer has to be turned off when the tripod is used.

www.perplexity.ai

Fujifilm X-A2
16mm (APS-C, Crop factor: 1.5x)
Scene Mode: Sunset
f/8, 1/125s, ISO 200
March 30, 2017

2026年5月14日星期四

Dictionaries in Python

In Python, you can safely use a trailing comma in dictionaries (and other collections like lists, tuples, and sets).

my_dict = {

    "x": 10,

    "y": 20,

}

In Python, dictionary keys have some important rules and behaviors.

animals = {
    'a': 'ape',
    'b': 'bear',
    'c': 'cat',
}
animals.keys()

Output: dict_keys(['a', 'b', 'c'])

animals.values()

Output: dict_values(['ape', 'bear', 'cat'])


list(animals.keys())

Output: ['a', 'b', 'c']

animals.get('a')

Output: 'ape'


animals = {
    'a': ['ape', 'abalone'],
    'b': ['bear'],
}

Each key ('a', 'b') maps to a list of values.

This means you can store multiple animals under the same starting letter.

animals['b'].append('bat')

You’re accessing the list stored under key 'b' → currently ['bear'].

.append('bat') adds 'bat' to that list.

.append() modifies the list in place (it doesn’t return a new list).

if 'c' not in animals:
    animals['c'] = []
    
animals['c'].append('cat')

Check if key 'c' exists

if 'c' not in animals: → looks for 'c' in the dictionary keys.
If 'c' is missing, it creates a new entry with an empty list

Append 'cat' to the list

Now animals['c'] is an empty list [].

.append('cat') adds 'cat' to that list.

defaultdict is a special type of dictionary from Python’s collections module. It works just like a normal dictionary, but with one big advantage: if you try to access a key that doesn’t exist, it automatically creates it with a default value instead of raising a KeyError.

from collections import defaultdict
>>> animals = defaultdict(list)
>>> animals

Output:
defaultdict(<class 'list'>, {})

This is the string representation (__repr__) of a defaultdict object.

Inside the angular brackets < >, Python is showing you the default factory function used to create missing values.

<class 'list'> means: whenever you access a missing key, Python will automatically create a new empty list for it.

The {} part after the comma is the current contents of the dictionary (empty at the moment).
})

So the whole thing reads as, “This is a defaultdict whose default factory is the list class, and right now it contains an empty dictionary.”

Microsoft Copilot

零號機

rudimentary: not highly or fully developed

hone: to develop and improve something, especially a skill, over a period of time

churn out: to produce something quickly and in large amounts

ethos: the moral ideas and attitudes that belong to a particular group, society or person

nascent: beginning to exist; not yet fully developed

tangible: ​that you can touch or feel

Fabrication in electronics refers to the complex, multi-step process of manufacturing semiconductor devices—such as integrated circuits (ICs), microprocessors, and memory chips—on a substrate, typically a silicon wafer. This process takes place in highly specialized factories known as fabs (fabrication facilities), which are cleanroom environments designed to eliminate contamination.

indecipherable: (of writing or speech) impossible to read or understand

conviction: a strong opinion or belief

An eye roll is a facial gesture where a person temporarily turns their eyes upward, commonly used to communicate annoyance, boredom, skepticism, or disdain. 

skepticism: an attitude of doubting that claims or statements are true or that something will happen

Bemusement is the state of being bewildered, puzzled, or slightly confused. It represents a feeling of perplexed surprise, often combined with a sense of wonder or mild irony, causing someone to scratch their head at a situation they fail to fully understand.

hash out: to discuss something carefully and completely in order to reach an agreement or decide something

sprout: (of plants or seeds) to produce new leaves or buds; to start to grow

add-in: a computer program that can be added to a larger program to allow it do more things

add-on: a thing that is added to something else

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

sojourn: a temporary stay in a place away from your home

Saffron robes are the traditional garments worn by fully ordained Theravada Buddhist monks and nuns, symbolizing renunciation, simplicity, and dedication to enlightenment.

christen: to give a name to somebody/something

admonishment: admonition: a warning to somebody about their behavior

foray (into something) an attempt to become involved in a different activity or profession

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

deliberate: done on purpose rather than by accident

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

Bill Gates "Source Code"

Online Dictionaries Used:

hk.dictionary.search.yahoo.com

www.oxfordlearnersdictionaries.com

Google AI Overview

2026年5月12日星期二

Tuples and Sets in Python

In Python, sets and indexes are two different concepts, and they don’t work together the way lists or tuples do.

The error 'set' object is not subscriptable means you tried to access a set element by index, like this:

mySet = {'a', 'b', 'c'}

print(mySet[0])   # ❌ Error

Subscriptable means you can use square brackets [] to access elements by position (like lists, tuples, strings).

Sets are unordered collections → they don’t have positions or indices.

That’s why Python raises this error.


Defined with curly braces {} or the set() constructor.

mySet = set(('a', 'b', 'c'))

('a', 'b', 'c') → This is a tuple containing three elements.

set(('a', 'b', 'c')) → The set() constructor takes that tuple and converts it into a set.

Result: {'a', 'b', 'c'}

Sets automatically remove duplicates (though here there aren’t any).

mySet now holds a set with the elements 'a', 'b', 'c'.


myList = ['a', 'b', 'b', 'c', 'c'] myList = list(set(myList)) print(myList)

['a', 'b', 'b', 'c', 'c'] → a list with duplicates.

set(myList) → converts the list into a set, automatically removing duplicate

list(set(myList)) → converts the set back into a list

Output: ['a', 'b', 'c']

But the order may vary, e.g. ['b', 'c', 'a'].


mySet.add('d') inserts the element 'd' into the set.

If 'd' was already inside, nothing changes (sets don’t allow duplicates).


while len(mySet):

    print(mySet.pop())

Condition: while len(mySet):

The loop runs as long as the set is not empty (len(mySet) > 0).

Inside the loop:

mySet.pop() removes and returns an arbitrary element from the set.

print() displays that element.

Iteration:

Each loop removes one element until the set becomes empty.

Loop ends when len(mySet) == 0.

The order is not guaranteed because sets are unordered. Running the same code again may give a different sequence.

myList = ['a', 'b', 'c'] print(myList.pop()) # 'c' (last element) print(myList.pop(0)) # 'a' (index 0) print(myList) # ['b']

mySet = {'a', 'b', 'c'}
mySet.discard('a') print(mySet)

mySet.remove('a') → removes 'a', but raises an error if 'a' is not found. mySet.discard('a') → removes 'a' if present, but does nothing if not found (safer).


def returnsMultipleValues(): return 1, 2, 3 print(type(returnsMultipleValues()))

return 1, 2, 3 → In Python, when you separate values with commas, they are automatically packed into a tuple.

Equivalent to: return (1, 2, 3)
So the function returns (1, 2, 3).
type(returnsMultipleValues()) → This checks the type of the returned object.

Output: <class 'tuple'>

a, b, c = returnsMultipleValues()

returnsMultipleValues() returns a tuple (1, 2, 3).

Python then unpacks that tuple into the three variables:
a = 1
b = 2
c = 3

Unpacking variables in Python means taking a collection (tuple, list, set, dict, etc.) and assigning its elements to multiple variables at once.

Microsoft Copilot