Release of Inspiration
扁頭舅父仔嘅網誌
搜尋此網誌
2026年5月7日星期四
Notebook
2026年5月6日星期三
Lists in Python
In Python, list slicing lets you extract portions of a list using the syntax:
list[start:stop:step]
Components
start→ index where the slice begins (inclusive).stop→ index where the slice ends (exclusive).step→ interval between indices (default is1).
Start = 1 → begin at index
1(the second element, which is20).Stop = 4 → go up to, but not including, index
4.So you get elements at indices
1,2, and3→20, 30, 40.
Python slicing always excludes the stop index. That’s why 50 (at index 4) isn’t included.
print(numbers[::2])
Start = empty → defaults to the beginning of the list (
index 0).Stop = empty → defaults to the end of the list.
Step = 2 → take every second element.
So Python picks indices 0, 2, 4, ... until the end
myList = [1, 2, 3, 4, 5] print(myList[0:6:2])
Start = 0 → begin at index 0 (1).
Stop = 6 → go up to, but not including, index 6.
Step = 2 → take every second element.
Notice that even though you wrote stop = 6, your list only goes up to index 4. Python slicing doesn’t throw an error — it just stops at the end of the list. That’s why you still get [1, 3, 5].
The range() function in Python generates a sequence of integers, starting from a given start (default 0), stopping before a given stop, and incrementing by a given step (default 1). It’s most often used in loops to control iteration.
range(start, stop, step)
start → optional, default 0. First number in the sequence.
stop → required. Sequence ends before this number.
step → optional, default 1. Difference between consecutive numbers.
Range function is immutable.
>>> for i in range(5): ... print(i) ... 0 1 2 3 4 >>>
>>> myList = [1,2,3,4] ... myList.append(5) ... print(myList) ... [1, 2, 3, 4, 5] >>>
In Python, lists have several useful methods for adding and removing elements. Let’s look at insert(), remove(), and pop() side by side:
numbers = [10, 20, 30] numbers.insert(1, 15) # insert 15 at index 1 print(numbers) # [10, 15, 20, 30]
len(myList) is now 0.b = a.copy() → makes a shallow copy of a.
Now
bhas its own separate list[1,2,3,4,5].
White Balance
Auto (White Priority): best for indoor fluorescent or mixed light
Shade: adds warmth to counter bluish tones
Cloudy: warmer balance, good for HK’s cloudy spring weather
Tungsten Light: best for indoor with incandescent bulbs
White Fluorescent Light: best for offices, malls in HK
Microsoft Copilot
Personal Computer
Albuquerque: city (the state's most populous) in central New Mexico population 545,852
makeshift: used temporarily for a particular purpose because the real thing is not available
plywood: board made by sticking thin layers of wood on top of each other
The Altair 8800, introduced by MITS in January 1975, is widely recognized as the first commercially successful personal computer, igniting the microcomputer revolution.
laundromat: a place where you can wash and dry your clothes in machines that you pay to use
massage parlor: a place where you can pay to have a massage
shell out: (informal) to pay a lot of money for something
novelty: the quality of being new, different and interesting
splurge: an act of spending a lot of money on something that you do not really need
gadget: a small tool or device that does something useful
tinker: tinker (with something) to make small changes to something in order to repair or improve it, especially in a way that may not be helpful
Menlo Park: city in western California southeast of San Francisco population 32,026
swap: to give something to somebody and receive something in exchange
glimpse: a sight of somebody/something for a very short time, when you do not see the person or thing completely
toggle: to press a key or set of keys on a computer keyboard in order to turn a feature on or off, or to move from one program, etc. to another
staccato: (music, from Italian) with each note played separately in order to produce short, sharp sounds
rendition: the performance of something, especially a song or piece of music; the particular way in which it is performed
2001: A Space Odyssey is a seminal 1968 science fiction film directed by Stanley Kubrick and co-written with Arthur C. Clarke.
home brew: beer that somebody makes at home
stoke something (up) to make something increase or develop more quickly
whistle-stop: visiting a lot of different places in a very short time
counterculture: a way of life and set of ideas that are opposed to those accepted by most of society; a group of people who share such a way of life and such ideas
hippie: a person who rejects the way that most people live in Western society, often having long hair, wearing brightly colored clothes and taking illegal drugs. The hippie movement was most popular in the 1960s.
zeitgeist: the general mood or quality of a particular period of history, as shown by the ideas, beliefs, etc. common at the time
monolithic: (often disapproving) used to describe single, very large organizations that are very slow to change and not interested in individual people
Lockheed Martin (NYSE: LMT) is the world's largest defense and aerospace corporation
inaugural: IPA[ɪˈnɔːgjʊrəl]
Bill Gates "Source Code"
Online Dictionaries Used:
hk.dictionary.search.yahoo.com
www.oxfordlearnersdictionaries.com
www.merriam-webster.com
Google AI Overview
2026年4月29日星期三
Testing New Al Alloy Tripod
善用曝光補償
例子︰夜景
相機測光認為是太暗,用光圈先決的話,相機會自動調光一些。這個時候,曝光補償的設定取決於拍攝意圖。
例子︰雪景
相機測光認為是太亮,用光圈先決的話,相機會自動調暗一些。這個時候要將曝光補償設定成 +1~1.5EV。
2026年4月27日星期一
Python Quiz
In Python, int(9.9) returns 9.
Here’s why:
The int() function truncates the decimal part of a floating-point number.
It does not round — it simply drops everything after the decimal point.
So 9.9 becomes 9.
In Python, any nonzero number (whether int, float, or complex) evaluates to True when converted to bool.
In Python, int and Decimal are both numeric types, but they serve very different purposes: int is for whole numbers, while Decimal is for precise decimal arithmetic, often used in finance or scientific contexts.
When you run bytes(4) in Python, it creates a bytes object of length 4, filled with zeros.
b = bytes(4)
print(b) # b'\x00\x00\x00\x00'
''' ... ''' or """ ... """) creates a multi‑line string.