Skip to content

Instantly share code, notes, and snippets.

View sonsongithub's full-sized avatar

Yuichi Yoshida sonsongithub

View GitHub Profile
@sonsongithub
sonsongithub / fft.ipynb
Last active January 17, 2024 05:15
FFTのおさらいメモ
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/*
* vdsp_int2float.c
* AccelerateTest
*
* Created by sonson on 10/08/15.
* Copyright 2010 __MyCompanyName__. All rights reserved.
*
*/
#include "lapack_linearEquation.h"
@sonsongithub
sonsongithub / IconPlayground.playground
Created October 13, 2023 06:35
Swift Playground for creating an icon.
//: A Cocoa based Playground to present user interface
import AppKit
import PlaygroundSupport
let nibFile = NSNib.Name("MyView")
var topLevelObjects : NSArray?
Bundle.main.loadNibNamed(nibFile, owner:nil, topLevelObjects: &topLevelObjects)
let views = (topLevelObjects as! Array<Any>).filter { $0 is NSView }
@sonsongithub
sonsongithub / CoreMIDI.swift
Last active July 13, 2023 13:40
CoreMIDI sample using deprecated API
import Foundation
import CoreMIDI
import PlaygroundSupport
//
// CoreMIDI sample control for ZOOM MS-50G/60B/70CDR
// Using deprecated APIs
//
@sonsongithub
sonsongithub / CoreMIDI.swift
Last active July 13, 2023 13:39
CoreMIDI sample using new API for MIDI2
import Foundation
import CoreMIDI
//
// CoreMIDI sample control for ZOOM MS-50G/60B/70CDR
//
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
@sonsongithub
sonsongithub / dummy.swift
Created September 11, 2022 23:50
Prevents the window from being displayed for Mac Catalyst.
class DummyViewController: UIViewController {
deinit {
print(#function)
}
required init?(coder: NSCoder) {
print(#function)
super.init(coder: coder)
}
@sonsongithub
sonsongithub / test.swift
Created August 20, 2022 12:17
for #60673
if let obj = CommandLine.arguments.first {
print(obj)
}
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>},
@sonsongithub
sonsongithub / vae_check.py
Created March 11, 2022 09:49
VAEを作ったときのサイズを合わせるためのツールスクリプト
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:
@sonsongithub
sonsongithub / concurrency.swift
Created February 17, 2022 14:20
Try to use DispatchSemaphore.
class Controller {
var isProcessing = false
let semaphore = DispatchSemaphore(value: 0)
func doit() async {
do {
print("try")
semaphore.signal()
if isProcessing {
print("busy")