Skip to content

Instantly share code, notes, and snippets.

View ChingChuan-Chen's full-sized avatar

Ching-Chuan Chen ChingChuan-Chen

View GitHub Profile
@ChingChuan-Chen
ChingChuan-Chen / assets.xml
Last active December 5, 2021 09:13
To fix Pellets Powerplant mod in ANNO 1800 and provide the language support for traditional Chinese.
<!--V 1.0 � Stand: 01.08.2020
################################
Mod by DonnyBresko
################################
-->
<ModOps>
<!--#### CORE ####-->
<ModOp Type="addNextSibling" GUID='11703'><!--ADD NEW ITEM [PALLETS]-->
<Asset>
@ChingChuan-Chen
ChingChuan-Chen / texts_taiwanese.xml
Last active December 5, 2021 06:58
Translation for the ANNO 1800 mod - Gas Works
<ModOps>
<ModOp Type="add" Path="/TextExport/Texts">
<Text>
<GUID>601136120</GUID>
<Text>天然氣廠</Text>
</Text>
<Text>
<GUID>601136110</GUID>
<Text>天然氣廠</Text>
</Text>
@ChingChuan-Chen
ChingChuan-Chen / DiscretizationMDLP.py
Last active June 18, 2019 15:45
DiscretizationMDLP
from math import log
import bisect
from collections import Counter
class DiscretizationMDLP(object):
def __init__(self, x, y):
if len(x) != len(y):
raise Exception("The length of x must be equal to the length of y.")
# sort first
self.data = sorted(zip(*[x, y]), key=lambda x: x[0])