View dummy.swift
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
class DummyViewController: UIViewController { | |
deinit { | |
print(#function) | |
} | |
required init?(coder: NSCoder) { | |
print(#function) | |
super.init(coder: coder) | |
} |
View test.swift
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
if let obj = CommandLine.arguments.first { | |
print(obj) | |
} |
View gist:7eba0a7e7ed5ac96a64a3daeaeb135e0
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
tccd Prompting policy for hardened runtime; service: kTCCServiceAppleEvents requires entitlement com.apple.security.automation.apple-events but it is missing for accessing={<TCCDProcess: identifier=com.sonson.HomeConMenu.macOS, pid=632, auid=501, euid=501, binary_path=/Applications/HomeConMenu.app/Contents/MacOS/HomeConMenu>}, requesting={<TCCDProcess: identifier=com.apple.appleeventsd, pid=331, auid=55, euid=55, binary_path=/System/Library/CoreServices/appleeventsd>}, |
View vae_check.py
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 numpy as np | |
class Sequential: | |
def __init__(self, channel=0, height=0, width=0, layers=[], source=True): | |
print('--------------------------------') | |
if source: | |
for layer in layers: | |
(channel, height, width) = layer.source(channel, height, width) | |
else: |
View concurrency.swift
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
class Controller { | |
var isProcessing = false | |
let semaphore = DispatchSemaphore(value: 0) | |
func doit() async { | |
do { | |
print("try") | |
semaphore.signal() | |
if isProcessing { | |
print("busy") |
View test.swift
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
actor Flag { | |
var value = false | |
func free() { | |
value = false | |
} | |
func check() -> Bool { | |
if value == false { | |
value = true | |
return false |
View derivation.py
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
class A: | |
def __init__(self, name): | |
self.name = name | |
def doit(self): | |
print(self.name + " doit by class A") | |
def dodo(self): | |
self.doit() |
View test_a.py
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
def hoge(**kwargs): | |
print(a) | |
print(kwargs) | |
a = 10 | |
arg = {} | |
arg['a'] = 20 | |
hoge(**arg) |
View simple_newton_method.rs
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 get_a(x:&f32) -> f32 { | |
return 3.0 * x * x + 2.0 * x + 2.0; | |
} | |
// 接線の切片 | |
fn get_b(x:&f32, n: &f32) -> f32 { | |
return x * x * x + x * x + 2.0 * x + (3.0 - n) - x * get_a(x); | |
} |
View ContentView.swift
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
// | |
// ContentView.swift | |
// testswiftui | |
// | |
// Created by sonson on 2020/08/07. | |
// | |
import SwiftUI | |
import UIKit |
NewerOlder