Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 sys | |
from outbox import Outbox, Email, Attachment | |
from pathlib import Path | |
if sys.version_info.major < 3: | |
d = sys.getfilesystemencoding() | |
def u(s): | |
return unicode(s, d) |
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
# encoding: utf8 | |
from __future__ import unicode_literals | |
import re | |
import unicodedata | |
def unicode_normalize(cls, s): | |
pt = re.compile('([{}]+)'.format(cls)) | |
def norm(c): |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
fn main() { | |
fn f(a:&str, b:&str) { | |
println!("{}:{} => {}", a, b, levenshtein_distance(a, b)); | |
} | |
f("こんにちは", "こんばんは"); | |
f("hello", "ell0"); | |
f("hello", "hello"); | |
f("こんにちは", "hello"); | |
f("ABC", "ABC"); | |
f("\u{1F369}", "\u{1F36A}"); |
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 javafx.animation.Interpolator | |
import javafx.animation.TranslateTransition | |
import javafx.application.Application | |
import javafx.event.Event | |
import javafx.event.EventHandler | |
import javafx.geometry.Pos | |
import javafx.scene.Group | |
import javafx.scene.Scene | |
import javafx.scene.control.Button | |
import javafx.scene.control.TextBox |
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 groovyx.javafx.ClosureEventHandler | |
import groovyx.javafx.GroovyFX | |
import groovyx.javafx.SceneGraphBuilder | |
import javafx.animation.Interpolator | |
import javafx.animation.TranslateTransition | |
import javafx.util.Duration | |
GroovyFX.start({ | |
def loadAction = { view.engine.load(new URI(urlBox.getText()).toString()) } | |
def stage = new SceneGraphBuilder().stage(title: "GroovyFXのテスト") { |
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
var imgs = document.querySelectorAll('img[src*="netstat"]'); | |
var c = document.createElement('canvas'); | |
var c2 = document.createElement('canvas'); | |
c.width = c2.width = imgs[0].width; | |
c.height = c2.height = imgs[0].height; | |
document.body.appendChild(c); | |
var ctx = c.getContext('2d'); | |
var ctx2 = c2.getContext('2d'); | |
var i = 0, n = imgs.length; |
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 threading | |
import time | |
import random | |
from sys import argv | |
from queue import Queue | |
class T(threading.Thread): | |
def __init__(self, num, barrier, queue): | |
self.barrier = barrier |
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 java.util.concurrent.atomic.AtomicInteger; | |
public class test { | |
static final int n = 500_000_000; | |
int i = 0; | |
int si = 0; | |
volatile int vi = 0; | |
AtomicInteger ai = new AtomicInteger(0); | |
AtomicInteger ai2 = new AtomicInteger(0); |
OlderNewer