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
@Composable | |
fun ParallaxScreen(modifier: Modifier = Modifier) { | |
val context = LocalContext.current | |
val scope = rememberCoroutineScope() | |
var data by remember { mutableStateOf<SensorData?>(null) } | |
DisposableEffect(Unit) { | |
val dataManager = SensorDataManager(context) | |
dataManager.init() |
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
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
// munged from https://github.com/simontime/Resead | |
namespace sead | |
{ | |
class Random | |
{ |
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
// | |
// NthTimeLucky.swift | |
// | |
// Created by はるふ on 2018/05/24. | |
// Copyright © 2018年 ha1f. All rights reserved. | |
// | |
import Foundation | |
import RxSwift |
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
#coding: utf-8 | |
import threading | |
import socket | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
import urlparse | |
page_head = """ | |
<!doctype html> |
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 MyClass { | |
var value: Int? | |
// nilである時に呼び出されることを普通に想定しているならこんな感じ | |
func someMethod1() { | |
guard let value = value else { | |
return | |
} | |
print(value) | |
} |
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
// | |
// Regex.swift | |
// ha1fRegex | |
// | |
// Created by はるふ on 2016/09/30. | |
// Copyright © 2016年 はるふ. All rights reserved. | |
// | |
import Foundation |
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 UIKit | |
class CustomActivity: UIActivity { | |
override class var activityCategory: UIActivityCategory { | |
return .action | |
} | |
override var activityType: UIActivityType? { | |
guard let bundleId = Bundle.main.bundleIdentifier else {return nil} |
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
extension Observable { | |
/** | |
example: | |
Observable<String>.of("1", "a", "3", "4") | |
.flatMap { Int($0) } | |
.subscribeNext { print("\($0)") } | |
result: | |
1 | |
3 | |
4 |
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
# -*- coding: utf-8 -*- | |
# TensowFlowのインポート | |
import tensorflow as tf | |
# MNISTを読み込むためinput_data.pyを同じディレクトリに置きインポートする | |
# input_data.pyはチュートリアル内にリンクがあるのでそこから取得する | |
# https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/examples/tutorials/mnist/input_data.py | |
import input_data | |
import time |
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
# Extract meaningful bits. | |
# https://en.wikipedia.org/wiki/UTF-8#Description | |
def code_bits(bits) | |
bits.each_slice(8).with_index.map do |byte, i| | |
i == 0 ? byte[4..-1] : byte[2..-1] | |
end.flatten | |
end | |
# Returns unicode charactor from bits. | |
def bits_to_char(bits) |
NewerOlder