Skip to content

Instantly share code, notes, and snippets.

View ZCG-coder's full-sized avatar

Andy Zhang ZCG-coder

View GitHub Profile
@ZCG-coder
ZCG-coder / CL.md
Created June 22, 2024 13:43
Computer Literacy study notes (F2 Final Exam)

                            COMPUTER LITERACY
                           ===================

                              Revision Notes
                            Final Examination


@ZCG-coder
ZCG-coder / log.py
Last active May 9, 2024 12:42
A Pythonic way to take a n-th root without using math
#####################################################################################################
# Copyright (c) 2023-2024 NWSOFT #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
# in the Software without restriction, including without limitation the rights #
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
# copies of the Software, and to permit persons to whom the Software is #
# furnished to do so, subject to the following conditions: #
# #
@ZCG-coder
ZCG-coder / LICENSE
Last active April 29, 2024 04:38
AST way to evaluate an expression Step-by-step
MIT License
Copyright (c) 2024 Andy Zhang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@ZCG-coder
ZCG-coder / decimal_conversion.py
Last active April 12, 2024 13:13
Python script to convert decimals to any bases and back
NAMES = {
2: "binary",
3: "trinary",
4: "quaternary",
8: "octadecimal",
10: "decimal",
16: "hexadecimal"
}
@ZCG-coder
ZCG-coder / A%20File%20Icon.sublime-settings
Last active July 22, 2024 13:24
My Sublime Configuration
// A File Icon Preferences – User
// ================================================================
{
"color": "hsl(219, 28%, 88%)",
"color_on_hover": "hsl(0, 0%, 97%)",
"color_on_select": "hsl(0, 0%, 100%)"
}
@ZCG-coder
ZCG-coder / main.py
Created February 5, 2022 11:12
Fisher-Yates Shuffle
import random
def shuffle(ary):
old_ary = ary[:]
a = len(ary)
b = a - 1
for d in range(b, 0, -1):
e = random.randint(0, d - 1)
ary[d], ary[e] = ary[e], ary[d]