Instantly share code, notes, and snippets.

🕶
Loading...

Austin Walters lettergram

View GitHub Profile
View HelloWorms_FloatFix_OffByOne.py
# Python Implementation of Hello Worms
string = bytearray("Hello, Worms!", 'UTF-8')
for i in range(int(len(string) / 2)): # Cast to int for Range
temp = string[i]
string[i] = string[len(string) - i - 1] # -1 or error
string[len(string) - i - 1] = temp # add -1 or error
print(string.decode('UTF-8'))
View HelloWorms_FloatFix.py
# Python Implementation of Hello Worms
string = "Hello, Worms!"
for i in range(int(len(string) / 2)): # Cast to int for range
temp = string[i]
string[i] = string[len(string) - i]
string[len(string) - i] = temp
print(string)
View HelloWorms.py
# Python Implementation of Hello Worms
string = bytearray("Hello, Worms!", 'UTF-8')
for i in range(len(string) / 2):
temp = string[i]
string[i] = string[len(string) - i - 1]
string[len(string) - i - 1] = temp
print(string.decode('UTF-8'))
View austins-protonmail-theme.css
#pm_view {
min-width:70%;
}
#conversation-list-columns{
border-right:none;
background:#F7F6F6;
max-width:30%;
}
#conversation-view{
min-width:68%;
View austins-proton-theme-conversations.css
/* Conversation List Style */
.conversation{
background:#F8EFFB;
border-color: #FFFFFF;
border-width: thin;
}
.conversation.read{
background:#DDDDDD;
border-color:#DDDDDD;
border-width:none;
View austins-proton-theme-inboxtray.css
#pm_view {
min-width:70%;
}
#conversation-list-columns{
border-right:none;
background:#F7F6F6;
max-width:30%;
}
#conversation-view{
min-width:68%;
View import_export_embedding.py
def import_embedding(embedding_name="data/default"):
if not embedding_name:
return None, None
file_flag = os.path.isfile(embedding_name+"_word_encoding.json")
file_flag &= os.path.isfile(embedding_name+"_cat_encoding.json")
if not file_flag:
return None, None
View save_model_to_disk.py
if save_model_flag:
# Add optimization method, loss function and optimization value
model.compile(loss='categorical_crossentropy',
optimizer='adam', metrics=['accuracy'])
# "Fit the model" (train model), using training data (80% of datset)
model.fit(x_train, y_train, batch_size=batch_size,
epochs=epochs, validation_data=(x_test, y_test))
View fasttext_sentence_type_classification.py
max_words, batch_size, maxlen, epochs, ngram_range = 10000, 32, 500, 5, 2
# Determine the number of categories + default(i.e. sentence types)
num_classes = np.max(y_train) + 1
# Vectorize the output sentence type classifcations to Keras readable format
y_train = keras.utils.to_categorical(y_train, num_classes)
y_test = keras.utils.to_categorical(y_test, num_classes)
if ngram_range > 1:
View fasttest_data_formatting.py
max_words, batch_size, maxlen, epochs, ngram_range = 10000, 32, 500, 5, 2
# Determine the number of categories + default(i.e. sentence types)
num_classes = np.max(y_train) + 1
# Vectorize the output sentence type classifcations to Keras readable format
y_train = keras.utils.to_categorical(y_train, num_classes)
y_test = keras.utils.to_categorical(y_test, num_classes)
if ngram_range > 1: