Skip to content

Instantly share code, notes, and snippets.

# extract the Latin words from excel with the utf-8 encoding
theLatinWord = ooo_sheet.cell_value(row,3).encode('utf-8')
# And finally after you finish the Latin data json, you need to make sure...
# 1. You craete the output.json with utf-8 encoding.
# 2. You designate the utf-8 encoding to dump the data.
with io.open('output.json', 'w', encoding='utf-8') as outfile:
outfile.write(json.dumps(data, ensure_ascii=False, encoding='utf8'))
# fill some 0’s before your value to meet the specific lengh
if (len(ooo_sheet.cell_value(row,2))!=7):
digitLengthed7 = ooo_sheet.cell_value(row,2).zfill(7)
data = {} # --> Add the json attribute in random order
data = collections.OrderedDict() # --> Add the json attribute with the order you write
@WaTChi
WaTChi / StringExample.java
Created November 3, 2019 11:50
StringExample
public class Main {
public static void main(String[] args) {
String a = "TEST123";
System.out.println("a = " + a);
System.out.println("Identity : "+System.identityHashCode(a));
a = a.substring(0,2);
System.out.println("a = " + a);
System.out.println("Identity : "+System.identityHashCode(a));
a = a + "456";
System.out.println("a = " + a);
@WaTChi
WaTChi / StringBuilderExample.java
Created November 3, 2019 11:45
StringBuilderExample
public class Main {
public static void main(String[] args) {
StringBuilder aBuilder = new StringBuilder("TEST123");
System.out.println("aBuilder = " + aBuilder);
System.out.println("Identity : "+System.identityHashCode(aBuilder));
aBuilder = aBuilder.delete(2,aBuilder.length());
System.out.println("aBuilder = " + aBuilder);
System.out.println("Identity : "+System.identityHashCode(aBuilder));
aBuilder = aBuilder.append("456");
System.out.println("aBuilder = " + aBuilder);
@WaTChi
WaTChi / Android Studio .gitignore
Created July 31, 2017 06:00 — forked from iainconnor/Android Studio .gitignore
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
var intrinsic:Vector.<Number> = new Vector.<Number>(9, true);
var intrinsicInverse:Vector.<Number> = new Vector.<Number>(9, true);
var R:Vector.<Number> = new Vector.<Number>( 9, true );
var t:Vector.<Number> = new Vector.<Number>( 3, true );
// SVD routine
var svd:SVD = new SVD();
// input homography[9] - 3x3 Matrix