Skip to content

Instantly share code, notes, and snippets.

View KatagiriSo's full-sized avatar

KatagiriSo KatagiriSo

View GitHub Profile
@fmtonakai
fmtonakai / AttributedString.swift
Last active August 6, 2023 21:27
AttributedString with String Interpolation
//
// AttributedString.swift
//
// Created by fm.tonakai on 2019/04/08.
//
import UIKit
public struct AttributedString: ExpressibleByStringLiteral, ExpressibleByStringInterpolation, CustomStringConvertible {
public struct StringInterpolation: StringInterpolationProtocol {
//
// RDFile.swift
// RDFileUtil
//
// Created by KatagiriSo on 2017/11/09.
// Copyright © 2017年 rodhosSoft. All rights reserved.
//
import Foundation
//
// RDFileUtil.swift
// RDFileUtil
//
// Created by KatagiriSo on 2017/11/09.
// Copyright © 2017年 rodhosSoft. All rights reserved.
//
import Foundation
@KatagiriSo
KatagiriSo / RXSwiftExample.swift
Created November 1, 2017 05:37
RXSwiftExample
import Foundation
import UIKit
import RxSwift
import RxCocoa
class AmountViewControlelr : UIViewController {
@IBOutlet var amount:UILabel!
@IBOutlet var optionAmount:UILabel!
@IBOutlet var optionAmount2:UILabel!
@KatagiriSo
KatagiriSo / Perceptron.cpp
Created October 24, 2017 04:34
Perceptron cpp
//
// perceptron2.cpp
// RDPerceptronSwift
//
// Created by KatagiriSo on 2017/10/24.
// Copyright © 2017年 RodhosSoft. All rights reserved.
//
#include "perceptron2.hpp"
#include <iostream>
@KatagiriSo
KatagiriSo / regularExpression.swift
Last active September 29, 2020 08:34
NSRegularExpression syntax suger
//
// main.swift
// Reg
//
// Created by KatagiriSo on 2017/10/17.
// Copyright © 2017年 RodhosSoft. All rights reserved.
//
import Foundation
@gatchamix
gatchamix / constexpr_map.cpp
Last active May 12, 2021 14:52
constexpr map
#include <utility>
#include <array>
template <auto...>
struct value_list
{};
template <class T, auto... Keys>
struct map_
{
-- 型クラスの練習
import Data.Set
-- aをNumに制限Numのインスタンスにしばる
mySum :: Num a => [a] -> a
mySum list = list !! 0
data Point = Pt Int Int deriving Show
main = do
print $ factorize(1000)
prime :: Int -> Bool
prime n = length([x | x <- [1..n], n `mod` x == 0 ]) == 2
primes :: Int -> [Int]
primes n = [x | x <- [1..n], prime x]
factor :: Int -> Int -> Bool
main = do
print "Hello, World!"
-- training data とはfeature vector とラベルの組である。