Skip to content

Instantly share code, notes, and snippets.

View otmb's full-sized avatar

Manabu Otsu otmb

  • Infocom
  • Tokyo
View GitHub Profile
@otmb
otmb / StreamTest.swift
Created January 16, 2020 15:42
Playground Swift5
import UIKit
extension OutputStream {
func write(data: Data) -> Int {
return data.withUnsafeBytes {
write($0.bindMemory(to: UInt8.self).baseAddress!, maxLength: data.count)
}
}
var data: Data? {
@otmb
otmb / MyGenerateImageAnchor.cs
Created November 30, 2018 05:40
iOS ImageTracking and PointCLoud
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.iOS;
public class MyGenerateImageAnchor : MonoBehaviour {
[SerializeField]
private ARReferenceImage referenceImage;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// https://www.csharpcodi.com/vs2/1607/MBINCompiler/MBINCompiler/HalfHelper.cs/
public static class HalfHelper
{
private static uint[] mantissaTable = GenerateMantissaTable();
private static uint[] exponentTable = GenerateExponentTable();
@otmb
otmb / KinectView.cs
Last active December 4, 2018 09:48
KinectV2 visualize
using UnityEngine;
using Windows.Kinect;
using System.Runtime.InteropServices;
using System;
using System.Linq;
using UnityEngine.Rendering;
[RequireComponent(typeof(MeshRenderer))]
[RequireComponent(typeof(MeshFilter))]
public class KinectView : MonoBehaviour {
@otmb
otmb / Jetfire.cs
Last active December 4, 2018 09:48
Jetfire Unity Native
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System;
using UnityEngine;
using AOT;
namespace UnityEngine.XR.iOS
{
public class Jetfire {

Build Zstd Unity(ios/mac)

wget https://github.com/facebook/zstd/archive/v1.3.5.zip
cd zstd-1.3.5/build/cmake
mkdir ios
cd ios

wget https://raw.githubusercontent.com/leetal/ios-cmake/master/ios.toolchain.cmake

cmake .. -DCMAKE_TOOLCHAIN_FILE=ios.toolchain.cmake -DIOS_PLATFORM=SIMULATOR64
@otmb
otmb / README.md
Created July 12, 2018 17:52
WebAssemblyをNodejs環境なしで試す
@otmb
otmb / blob.md
Last active May 30, 2018 07:48
How to handle ArrayBinary(Float)

Python blob Write

data = np.array([1.0, 2.0, 3.0, 4.0],dtype=np.float32)
with open("[filename]", "wb") as f:
    byte = np.array(data,dtype=np.float32).tobytes()
    f.write(byte)

Python blob Read

@otmb
otmb / README.md
Last active May 10, 2021 14:29
MLMultiArray to Double Array

Sample Data

Get cat.bin

Xcode Resources Add cat.bin

resources.png

Playground

import CoreML