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
| 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: |
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
| class Controller { | |
| var isProcessing = false | |
| let semaphore = DispatchSemaphore(value: 0) | |
| func doit() async { | |
| do { | |
| print("try") | |
| semaphore.signal() | |
| if isProcessing { | |
| print("busy") |
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
| actor Flag { | |
| var value = false | |
| func free() { | |
| value = false | |
| } | |
| func check() -> Bool { | |
| if value == false { | |
| value = true | |
| return false |
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
| class A: | |
| def __init__(self, name): | |
| self.name = name | |
| def doit(self): | |
| print(self.name + " doit by class A") | |
| def dodo(self): | |
| self.doit() |
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
| def hoge(**kwargs): | |
| print(a) | |
| print(kwargs) | |
| a = 10 | |
| arg = {} | |
| arg['a'] = 20 | |
| hoge(**arg) |
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
| // 接線の傾き | |
| 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); | |
| } |
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
| // | |
| // ContentView.swift | |
| // testswiftui | |
| // | |
| // Created by sonson on 2020/08/07. | |
| // | |
| import SwiftUI | |
| import UIKit |
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
| import numpy as np | |
| x_init = 1 | |
| x = x_init | |
| q = 0.6 | |
| x_history = [x] | |
| data_stream = [0, 1, 1, 1, 0, 0, 0, 1] |
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
| proxy eth0 { | |
| router no | |
| timeout 500 | |
| autowire yes | |
| keepalive yes | |
| retries 3 | |
| ttl 30000 | |
| rule ::/0 { | |
| iface switch0.10 | |
| } |
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
| #!/bin/vbash | |
| # copy to this file into | |
| # /config/scripts/post-config.d | |
| /ndppd/local/sbin/ndppd.initscript start |