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
/* | |
* Copyright (c) 2017 Yuki Ono | |
* Licensed under the MIT License. | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; |
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
/* | |
* Copyright (c) 2017 Yuki Ono | |
* Licensed under the MIT License. | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net.Mail; | |
using System.Text; |
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
{-- | |
Copyright (c) 2017 Yuki Ono | |
Licensed under the MIT License. | |
--} | |
import Html exposing (..) | |
import List | |
import String | |
type FizzBuzzType |
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 FizzBuzz { kind: 'fizzbuzz'; num: number; } | |
interface Fizz { kind: 'fizz'; num: number; } | |
interface Buzz { kind: 'buzz'; num: number; } | |
interface Other { kind: 'other'; num: number; } | |
type FizzBuzzType = FizzBuzz | Fizz | Buzz | Other; | |
const range_100: () => number[] = () => Array.apply(0, Array(100)).map((x, y) => y + 1); | |
const is_fizzbuzz: (n: number) => boolean = n => (n % 15) === 0; |
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
// original: openssl/demos/cms/cms_ver.c | |
// g++ test_verify.cpp -lcrypto -o test_verify | |
#include <iostream> | |
#include <string> | |
#include <openssl/bio.h> | |
#include <openssl/err.h> | |
#include <openssl/ssl.h> | |
#include <openssl/pkcs7.h> |
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
// original: openssl/demos/cms/cms_sign.c | |
// g++ test_sign.cpp -lcrypto -o test_sign | |
#include <iostream> | |
#include <string> | |
#include <openssl/bio.h> | |
#include <openssl/err.h> | |
#include <openssl/ssl.h> | |
#include <openssl/pkcs7.h> |
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
// original: openssl/demos/cms/cms_enc.c | |
// g++ test_enc.cpp -lcrypto -o test_enc | |
#include <iostream> | |
#include <string> | |
#include <openssl/bio.h> | |
#include <openssl/err.h> | |
#include <openssl/ssl.h> | |
#include <openssl/pkcs7.h> |
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
// original: openssl/demos/cms/cms_dec.c | |
// g++ test_dec.cpp -lcrypto -o test_dec | |
#include <iostream> | |
#include <string> | |
#include <openssl/bio.h> | |
#include <openssl/err.h> | |
#include <openssl/ssl.h> | |
#include <openssl/pkcs7.h> |
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
# FizzBuzz Imperative | |
i = 1 | |
while i < 101: | |
if i % 15 == 0: | |
print('FizzBuzz') | |
elif i % 3 == 0: | |
print('Fizz') | |
elif i % 5 == 0: | |
print('Buzz') |
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
# FizzBuzz OOP | |
from abc import ABC, abstractmethod | |
class BaseFizzBuzz(ABC): | |
def __init__(self, n: int) -> None: | |
self.number = n | |
@staticmethod |