搜尋此網誌

2026年11月10日星期二

Handling Exceptions in Python

In Python, try/except is used for exception handling. It allows your program to continue running when an error occurs instead of crashing.

try:
    result = 10 / 0
except:
    print("An error occurred")

The finally block contains code that always executes, whether an exception occurs or not.

start = time.time()
This line records the current time and stores it in the variable start.
Before using it, you need to import the time module.

time.sleep(0.5)
This statement tells Python to pause (sleep) for 0.5 seconds before continuing to the next line of code.

print(f'Function took {time.time() - start} seconds to execute')
This line uses an f-string (formatted string literal) to display how long a function or block of code took to run.

Catching an exception means handling an error so that your program doesn't crash.
try:
    1 / 0
except ZeroDivisionError:
    print("You cannot divide by zero")

Custom Decorators in Python
A decorator is a function that takes another function, adds some behavior to it, and returns the modified function.

def my_decorator(func):
    def wrapper():
        print("Before function call")
        func()
        print("After function call")
    return wrapper

@my_decorator
def greet():
    print("Hello!")
greet()

Output:
Before function call
Hello!
After function call

An argument is a value you pass to a function when calling it.
print("Hello")
"Hello" is an argument passed to the print() function.

def catch_errors(func):
    def wrapper(*args):
        try:
            return func(*args)
        except Exception as e:
            print(f"Error: {e}")
    return wrapper

And a function that raises an exception:
@catch_errors
def divide(a, b):
    if b == 0:
        raise ValueError("Cannot divide by zero")

    return a / b


divide(10, 0)
      │
      ▼
wrapper(10, 0)
      │
      ▼
func(*args)
      │
      ▼
divide(10, 0)
      │
      ▼
raise ValueError
      │
      ▼
except Exception as e
      │
      ▼
print error message

Microsoft Copilot

商品陳列

1. 吸引顧客目光

利用顏色、燈光、層次感和主題展示,令商品更突出。

2. 促進銷售

將熱賣商品、新產品或高利潤商品放在顯眼位置。

3. 方便選購

商品分類清晰,讓顧客容易找到所需貨品。


關聯陳列——將可互相搭配的商品放在一起

端架陳列——放在貨架兩端較顯眼位置

壁面陳列——適用於服飾、小件商品,好處是節省空間、方便瀏覽

堆頭陳列——大量集中展示促銷商品


陳列黃金原則

黃金視線高度:約離地 120 厘米的位置最容易被注意。

整齊飽滿:貨品數量充足但不雜亂。

價格標示清晰:方便顧客快速作出決定。

定期更換展示:保持新鮮感。


由於你在博物館禮品店工作,可考慮:

將展覽相關書籍放在入口或收銀附近。

把文創精品與相關圖錄並列展示。

設置「店長推介」或「人氣商品」專區。

將價格較高的收藏品放在視線高度位置。


實務檢查︰是否有缺貨、空排、過期或破損商品。

自己的經驗︰是否有展示牌,清楚說明商品特色或創作意念。


Microsoft Copilot and Perplexity AI

Get rid of negativity

ditch: to get rid of something/somebody because you no longer want or need it/them

abyss: a very deep wide space or hole that seems to have no bottom

stunned: very surprised or shocked

deliberately: done in a way that was planned, not by chance

hoop: a large ring of plastic, wood or metal

Heuristics are mental shortcuts or "rules of thumb" that allow humans, animals, and machines to make quick decisions and solve complex problems under uncertainty with minimal mental effort.

gauge: to make a judgement about something, especially people’s feelings or attitudes

sheer: complete and not mixed with anything else

amateur: doing something for pleasure or interest, not as a job

grind: an activity that is boring or makes you tired and takes a lot of time

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

Your brain does not know right or wrong; it just knows that particular pathways have been strengthened through repetition.

大腦會根據重複的想法、情緒和行為來強化相關的神經連結,而不會主動判斷它們在道德上是好是壞。無論是健康習慣還是不良習慣,只要反覆進行,大腦都會令相應的神經路徑變得更穩固、更容易被再次啟動。

succumb: to not be able to fight an attack, a temptation, etc.

Between stimulus and response lies a space. In that space lie our freedom and power to choose a response. In our response lie our growth and our happiness.

rampant: (of something bad) existing or spreading everywhere in a way that cannot be controlled

In a world of rampant social media use and constant images of how much better other people are doing, I would imagine that this cue is one of the strongest driving factors to rumination.

dismantle: to end an organization or a system gradually in an organized way

Nicole Vignola "Rewire"

hk.dictionary.search.yahoo.com

oxfordlearnersdictionaries.com

en.wikipedia.org

Explained by Microsoft Copilot

2026年11月9日星期一

陶瓷術語三十六

匜是中國古代的一種盥洗器,主要用來盛水倒水洗手,常與盤配合使用。

古代貴族行禮前後需要淨手:

匜:盛水、注水

盤:承接洗手流下的水

匜︰粵音逃


「置流」是考古報告和文物說明中描述器物流嘴(流)的方位術語。

其中:

置 = 設置、具有

流 = 流嘴、注口

Microsoft Copilot

陶瓷術語三十五

簋︰粵音鬼,九大簋

撇︰撇開,撇脫

良渚文化是中國新石器時代晚期極為重要的考古學文化,因最早發現於浙江省杭州市餘杭區良渚遺址而得名。

渚︰粵音主

侈口︰口沿向外撇開、向外張開的器口。

斂口︰器物口沿向內收攏,口徑小於肩部或腹部。

圜底︰器底呈圓弧形,沒有平坦底面。

敞口︰器口開闊,口徑明顯大於頸部或腹部上端,向外張開。

Microsoft Copilot

陶瓷術語三十四

「壺洗口」是中國古陶瓷器物描述中的口沿術語。

壺:指壺形器。

洗:指洗形器(淺腹敞口的盛水器)。

口:器物口部。

當描述為 「壺洗口」 時,通常是指器口形狀介乎壺與洗之間,或口沿向外敞開、較寬闊,呈現類似「洗」的口部特徵。

Microsoft Copilot

2026年11月7日星期六

陶瓷術語三十三

「博山形蓋」是中國漢代常見的一種器蓋造型。

博山:傳說中的仙山,象徵海上仙境。

形蓋:指蓋子仿照山巒起伏的形狀製作。

Microsoft Copilot