Skip to content

Instantly share code, notes, and snippets.

View frodo821's full-sized avatar
:octocat:
Working from home

frodo821

:octocat:
Working from home
View GitHub Profile

AEDi アプリケーション計画書

目次

  1. 要件
  2. タスクリスト

要件

アプリケーションに求められる要件をまとめる。

@frodo821
frodo821 / app-build.gradle
Last active March 29, 2019 09:31
[HELP] BUILD SCRIPTS OF MY GRADLE PROJECT
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 26
defaultConfig {
applicationId "xyz.tech-frodo.dependencyTest"
minSdkVersion 26
targetSdkVersion 26
from sys import stdout as sys
n, q = map(int, input().split())
k = list("abcdefghijklmnopqrstuvwxyz"[:n])
cn = 0
memo = {}
def comp(a, b):
global cn
@frodo821
frodo821 / groom.py
Created October 26, 2019 06:58
A easy-to-use command-line argument parser
#!/usr/bin/env python
# encoding: utf-8
"""
groom.py
Created by Frodo on 10/26/19.
Copyright (c) 2019 Frodo. All rights reserved.
"""
import sys
#-*-coding: utf-8;-*-
from sys import argv, exit
from os import chdir
from os.path import (
expanduser as usr,
exists, abspath)
from abc import ABC, abstractmethod as abstract
from atexit import register
@frodo821
frodo821 / promise.py
Last active January 7, 2020 06:38
reimplementation of javascript Promise API with Python
from functools import wraps
from time import sleep, time
from concurrent.futures import ThreadPoolExecutor
__all__ = ['Cancelled', 'Promise', 'asyncfun', 'promisify']
class Cancelled(BaseException):
pass
def asyncfun(cor):
@frodo821
frodo821 / word_processor.py
Created January 21, 2020 07:52
Convert word document file into a meaningful text file.
from sys import argv
from zipfile import ZipFile
from lxml import etree
def read(document):
with ZipFile(document) as zf:
with zf.open('word/document.xml') as doc:
return etree.fromstring(doc.read())
def process(tree, prevent_indentations=('「', '(', '"', "'")):
@frodo821
frodo821 / email_validator.py
Last active October 18, 2021 21:46
A ReDoS proof email address validation
from re import match
def validateEmail(email):
valid = 'abcdefghijklmnopqrstuvwxyz1234567890!#$%&\'*+-/=?^_`{}|~'
if not email:
return False
email = email.lower()
if email.startswith('"'):
i = 1
while i < min(64, len(email)):
@frodo821
frodo821 / 1.Proof.v
Last active November 28, 2020 05:24
Proof Driven Development sample
Require Import List.
Import ListNotations.
Fixpoint reversed { A: Type } (xs: list A) :=
match xs with
| nil => nil
| x :: xs' => reversed xs' ++ [x]
end.
Lemma reversed_sub:
interface Conditional<T> {
then: (expr: () => T) => Conditional<T>;
fail: (expr: () => T) => Conditional<T>;
result: () => T | undefined;
}
export default function cond<T>(condition: boolean): Conditional<T> {
let res: T | undefined;
return {