This file contains hidden or 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
""" | |
Get the number of tokens using the same tokenizer that Stable Diffusion uses. | |
author: opparco | |
""" | |
import argparse | |
from transformers import CLIPTokenizer | |
def main(): |
This file contains hidden or 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
class BCDice::Command::Parser | |
token NUMBER R U C F PLUS MINUS ASTERISK SLASH PARENL PARENR AT SHARP DOLLAR CMP_OP QUESTION NOTATION | |
expect 2 | |
rule | |
expr: notation option modifier target option | |
{ | |
raise ParseError unless @modifier | |
notation, option, modifier, target, post_option = val |
This file contains hidden or 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
for code in "1000".."9999" | |
a, b, c, d = code.bytes.map {|byte| byte - 0x30} | |
n = code.to_i | |
x = a + b + c + d | |
# min(x) = 1 | |
# max(x) = 36 | |
next if x == 1 |
This file contains hidden or 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
#include <set> | |
#include "NodeMap.h" | |
std::unordered_map<NiNode *, std::unordered_map<std::string, NiNode *> > m_nodes_container; | |
void DeleteNodeMap(NiNode * rootnode) | |
{ | |
_DMESSAGE("DeleteNodeMap rootnode %p", rootnode); | |
m_nodes_container.erase(rootnode); |
This file contains hidden or 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
// https://github.com/opal/opal/blob/b1074a37150f9b0b53a35f0efa4a1cbddc02ba29/opal/corelib/random/mersenne_twister.rb | |
// node opal_mt.js | |
var mt19937 = (function() { | |
/* Period parameters */ | |
var N = 624; | |
var M = 397; | |
var MATRIX_A = 0x9908b0df; /* constant vector a */ | |
var UMASK = 0x80000000; /* most significant w-r bits */ | |
var LMASK = 0x7fffffff; /* least significant r bits */ | |
var MIXBITS = function(u,v) { return ( ((u) & UMASK) | ((v) & LMASK) ); }; |
This file contains hidden or 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
diff --git a/lib/bcdice/user_defined_dice_table.rb b/lib/bcdice/user_defined_dice_table.rb | |
index 11c8938..ca2b086 100644 | |
--- a/lib/bcdice/user_defined_dice_table.rb | |
+++ b/lib/bcdice/user_defined_dice_table.rb | |
@@ -52,7 +52,7 @@ module BCDice | |
return false | |
end | |
- index_list = @rows.map(&:to_i).unique.sort | |
+ index_list = @rows.map(&:to_i).uniq.sort |
This file contains hidden or 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
--- armaturesys\armature_export.py.orig 2015-01-27 08:38:31.732200600 +0900 | |
+++ armaturesys\armature_export.py 2017-08-01 18:33:26.455402600 +0900 | |
@@ -275,19 +275,22 @@ class Armature(): | |
return correction_matrix * matrix | |
elif (space == 'BONESPACE'): | |
if bone.parent: | |
- # not sure why extra = True is required here | |
- # but if extra = extra then transforms are messed up, so keep | |
- # for now | |
- parinv = self.get_bone_rest_matrix(bone.parent, 'ARMATURESPACE', |
This file contains hidden or 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
/** | |
* read PNG file. | |
*/ | |
import * as fs from 'fs'; | |
function putUsage(): void | |
{ | |
const usage = "Usage: node pngreader.ts source.png"; | |
console.log(usage); | |
} |
This file contains hidden or 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
#!/usr/bin/python | |
# | |
# pixelate.py | |
# | |
# https://github.com/tsutsuji815/pixel_convert | |
# | |
# pip install opencv-python | |
# pip install Pillow |
This file contains hidden or 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
interface Window { | |
RPGAtsumaru; | |
} | |
class RPGAtsumaruState { | |
buttons; | |
next: Function; | |
create() { | |
this.buttons = { |