Skip to content

Instantly share code, notes, and snippets.

@compustar
compustar / cap4.txt
Last active November 27, 2024 22:10
An Ordinance to consolidate and amend the law relating to financial products, the securities and futures market and the securities and futures industry, the regulation of activities and other matters connected with financial products, the securities and futures market and the securities and futures industry, the protection of investors, and othe…
To amend and consolidate the law relating to the constitution, jurisdiction, practice and powers of the High Court and the administration of justice therein and for matters ancillary thereto and connected therewith.
(Amended 25 of 1998 s. 2)
[20 February 1976] L.N. 50 of 1976
(Format changes—E.R. 1 of 2017)
Editorial Note:
The title of this Ordinance was amended from “Supreme Court Ordinance” to “High Court Ordinance” — see 25 of 1998 s. 2.
Part I
Preliminary
1.Short title
This Ordinance may be cited as the High Court Ordinance.
@compustar
compustar / QueueWorkerPool.py
Created November 18, 2024 12:36
A simple worker pool implementation using Python's threading and queue modules. This allows parallel execution of tasks by distributing them across a specified number of worker threads.
import threading
from queue import Queue
from typing import Callable, List
import logging
logger = logging.getLogger(__name__)
class QueueWorkerPool:
def __init__(self, num_worker_threads: int, fn: Callable[[int, List[int], Callable[[str, dict], None]], None]) -> None:
"""
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 7 columns, instead of 4 in line 3.
Table Name,Column Name,Data Type,Description,Table Description,Column Description,Sample Value
DimAccount,AccountKey,int,Chart of accounts information. Defines the different financial accounts used in FactFinance. Primary key for the account dimension.,Chart of accounts information. Defines the different financial accounts used in FactFinance.,Primary key for the account dimension.,123
DimAccount,ParentAccountKey,int,"Chart of accounts information. Defines the different financial accounts used in FactFinance. Foreign key to DimAccount. Indicates a hierarchical relationship between accounts (e.g., a sub-account and its parent account).",Chart of accounts information. Defines the different financial accounts used in FactFinance.,"Foreign key to DimAccount. Indicates a hierarchical relationship between accounts (e.g., a sub-account and its parent account).",456
DimAccount,AccountCodeAlternateKey,int,Chart of accounts information. Defines the different financial accounts used in FactFinance. Alternate key for the
Your role is to embody the persona of a typical user from LIHKG.com, a popular forum in Hong Kong. The forum is also known as 連登 locally. You're expected to express yourself in a way that's reflective of the community's culture, using specific phrases, Cantonese slang, and a certain level of humor or sarcasm common among its members, including being a bit rude and mean in a manner similar to these samples: "行咁慢 冇人識你呀, 阻撚住條路" ("Walking so slow, nobody knows you, blocking the way"), "大陸KOL求其一個都過百萬啦" ("Any random mainland KOL has over a million followers"), "明星出街都唔會咁啦" ("Even celebrities don't act like this when they go out"). This embodies the frank and direct tone often found in LIHKG discussions.
Make sure respond with direct and concise usually with no more than 2 sentences. Also, sentences are usually broken in lines. For example, instead of one complete sentence:
睇到右面碟肉就知靚野,一定濕潤彈牙有口感,餵狗都未必食。
Break it into three lines:
睇到右面碟肉就知靚野
一定濕潤彈牙有口感
餵狗都未必食
@compustar
compustar / ChatGPT (gpt-4o).txt
Last active May 14, 2024 17:14
Prompt collection of different chat agent
You are ChatGPT, a large language model trained by OpenAI, based on the GPT-4 architecture.
Knowledge cutoff: 2023-10
Current date: 2024-05-15
Image input capabilities: Enabled
Personality: v2
# Tools
You have the following tools:
Sample for reference only
Copyright © 2001 Hong Kong Institute of Human Resource Management. All rights reserved.
@compustar
compustar / employee_handbook_qna_gpt3.ipynb
Last active January 26, 2023 05:17
employee_handbook_qna_gpt3.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@compustar
compustar / Dockerfile.appd_jdk6
Created August 25, 2022 19:14
TLS Bumping for Java 6 AppDynamics Agent Instrumentation with NGINX
FROM yannart/jboss-5.1.0.ga-jdk6
# Download the agent and configure the controller-info.xml BEFORE building the image
COPY AppServerAgent /opt/appdynamics
ENV JAVA_TOOL_OPTIONS=-javaagent:/opt/appdynamics/javaagent.jar
@compustar
compustar / Dockerfile
Created August 18, 2022 15:31
AppDynamics Agent Instrumentation for Java 6
FROM yannart/jboss-5.1.0.ga-jdk6
# Download the agent and configure the controller-info.xml BEFORE building the image
COPY AppServerAgent /opt/appdynamics
# INSTRUCTION REFERENCE: https://stackoverflow.com/questions/33364100/how-to-use-tls-1-2-in-java-6
# Update Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6
RUN wget --continue --no-check-certificate --header "Cookie: oraclelicense=a" "https://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip" && \
unzip jce_policy-6.zip && \
@compustar
compustar / Unpivot.vb
Created February 16, 2020 19:34
Unpivoting Statistics on Passenger Traffic at https://www.immd.gov.hk/eng/message_from_us/stat.html
Sub Unpivot()
'
' Macro1 Macro
'
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C5").Select
Selection.Copy
Columns("D:D").Select