This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
infix operator <<<: CompositionPrecedence | |
precedencegroup CompositionPrecedence { | |
associativity: left | |
} | |
public func <<<<A, B, C>( | |
_ g: @escaping (B) -> C, | |
_ f: @escaping (A) -> B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import random | |
def genSequence(): | |
len = 101 | |
X = [] | |
for i in range(1, len): | |
X.append([[random.random()]]*i) | |
y = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import random | |
def genSequence(): | |
len = 101 | |
X = [] | |
for i in range(1, len): | |
X.append([[random.random()]]*i) | |
y = [] | |
for i in range(1, len): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct TaggedWeak<T: AnyObject, Hash: Hashable>: Hashable { | |
public static func == (lhs: TaggedWeak<T, Hash>, rhs: TaggedWeak<T, Hash>) -> Bool { | |
lhs.hash == rhs.hash | |
} | |
public func hash(into hasher: inout Hasher) { | |
hasher.combine(hash) | |
} | |
public weak var value: T? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TaggedWeak<T: AnyObject, Hash: Hashable>: Hashable { | |
public static func == (lhs: TaggedWeak<T, Hash>, rhs: TaggedWeak<T, Hash>) -> Bool { | |
lhs.hash == rhs.hash | |
} | |
public func hash(into hasher: inout Hasher) { | |
hasher.combine(hash) | |
} | |
public weak var value: T? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@propertyWrapper | |
struct SmallNumber { | |
private var maximum: Int | |
private var number: Int | |
var wrappedValue: Int { | |
get { return number } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import sys | |
# Directory paths | |
plugins_dir = "./plugins/" | |
dialogue_dir = "yamls/dialogue/" | |
script_dir = "yamls/script/" | |
# Ensure the output directories exist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def remove_duplicates_ignore_timestamp(filename): | |
seen = set() | |
temp_filename = filename + '.temp' | |
with open(filename, 'r') as f, open(temp_filename, 'w') as temp_file: | |
for line in f: | |
# Strip the timestamp | |
stripped_line = line[12:] | |
if stripped_line not in seen: |
OlderNewer