Skip to content

Instantly share code, notes, and snippets.

View mh61503891's full-sized avatar
🍣

Masayuki Higashino mh61503891

🍣
View GitHub Profile
@mh61503891
mh61503891 / ExampleScenarioTest.kt
Last active January 5, 2022 13:23
Android Test with Jetpack Compose's IdlingResource
@LargeTest
@RunWith(AndroidJUnit4::class)
class ExampleScenarioTest {
@get:Rule
val composeTestRule = createAndroidComposeRule<MainActivity>()
private val mainIdlingResource = object : IdlingResource {
override var isIdleNow: Boolean = true
}
java.lang.IllegalStateException: no event down from INITIALIZED
at androidx.lifecycle.LifecycleRegistry.backwardPass(LifecycleRegistry.java:281)
at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:302)
at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:148)
at androidx.lifecycle.LifecycleRegistry.setCurrentState(LifecycleRegistry.java:121)
at androidx.navigation.NavBackStackEntry.updateState(NavBackStackEntry.kt:166)
at androidx.navigation.NavBackStackEntry.handleLifecycleEvent(NavBackStackEntry.kt:156)
at androidx.navigation.NavController.lifecycleObserver$lambda-2(NavController.kt:184)
at androidx.navigation.NavController.$r8$lambda$QcvT-AhOyhL9f0B2nrlZ1aMydmQ(Unknown Source:0)
at androidx.navigation.NavController$$ExternalSyntheticLambda0.onStateChanged(Unknown Source:2)
@mh61503891
mh61503891 / gist:8bb4c1d8ee38c60cbd6c687ea190c3dc
Created January 5, 2022 03:12
Jetpack Compose Test Error
java.lang.IllegalStateException: Restarter must be created only during owner's initialization stage
at androidx.savedstate.SavedStateRegistryController.performRestore(SavedStateRegistryController.java:58)
at androidx.navigation.NavBackStackEntry.setMaxLifecycle(NavBackStackEntry.kt:146)
at androidx.navigation.NavController.updateBackStackLifecycle$navigation_runtime_release(NavController.kt:987)
at androidx.navigation.NavController$NavControllerNavigatorState.markTransitionComplete(NavController.kt:359)
at androidx.navigation.compose.ComposeNavigator.onTransitionComplete$navigation_compose_release(ComposeNavigator.kt:71)
at androidx.navigation.compose.NavHostKt$NavHost$4$2$1$invoke$$inlined$onDispose$1.dispose(Effects.kt:486)
at androidx.compose.runtime.DisposableEffectImpl.onForgotten(Effects.kt:85)
at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:793)
at androidx.compose.runtime.CompositionImpl.dispose(Composition.kt:496)
@mh61503891
mh61503891 / gist:7881f3b834d847090d08096ec68e4045
Last active June 3, 2021 01:54
Errors log: Install Android Studio to M1 Mac
Preparing "Install Android SDK Platform-Tools (revision: 31.0.2)".
Downloading https://dl.google.com/android/repository/42b081e1e068bb936179551684cdcb30315e245c.platform-tools_r31.0.2-darwin.zip
"Install Android SDK Platform-Tools (revision: 31.0.2)" ready.
Installing Android SDK Platform-Tools in /Users/masayuki/Library/Android/sdk/platform-tools
"Install Android SDK Platform-Tools (revision: 31.0.2)" complete.
"Install Android SDK Platform-Tools (revision: 31.0.2)" finished.
Preparing "Install SDK Patch Applier v4 (revision: 1)".
Downloading https://dl.google.com/android/repository/3534162-studio.sdk-patcher.zip
"Install SDK Patch Applier v4 (revision: 1)" ready.
Installing SDK Patch Applier v4 in /Users/masayuki/Library/Android/sdk/patcher/v4
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:47)
at java.base/java.lang.String.charAt(String.java:693)
at android.content.res.BridgeTypedArray.getType(BridgeTypedArray.java:1024)
at android.content.res.BridgeTypedArray.getType(BridgeTypedArray.java:809)
at android.content.res.BridgeTypedArray.getValue(BridgeTypedArray.java:778)
at android.content.res.BridgeTypedArray.peekValue(BridgeTypedArray.java:847)
at android.view.View.<init>(View.java:5951)
at android.view.ViewGroup.<init>(ViewGroup.java:697)
at android.widget.FrameLayout.<init>(FrameLayout.java:99)
@mh61503891
mh61503891 / covid19-tottori-chart.mmdc
Last active January 7, 2021 06:06
covid19-tottori-chart.mmdc
%% https://www.pref.tottori.lg.jp/item/1207264.htm
%% 101-
%%
%% ```sh
%% $ npm install @mermaid-js/mermaid-cli -g
%% $ curl --silent https://gist.githubusercontent.com/mh61503891/13147a09f30b8158658c9876db9db6ae/raw/790e4714bd45637003c72b5097635652cf6a33c7/covid19-tottori-chart.mmdc| mmdc -w 4000 -o covid19-tottori-chart.png
%% ``
%%
graph TB
@mh61503891
mh61503891 / ipsj-sig-chief-csv-parser.rb
Last active October 8, 2020 13:09
情報処理学会の研究会申込システムで出力したCSVファイルをパースするスクリプト
# @author Masayuki Higashino
# @license Ruby
# Usage: ruby ipsj-sig-chief-csv-parser.rb target.csv
require 'csv'
class Record
def self.parse(csv_file_path)
# Shift_JISのCSVファイルをUTF-8に変換してテキストファイルとして読み込む。
@mh61503891
mh61503891 / handbrake-cli-options.sh
Created July 8, 2020 02:51
HandBrakeCLI's options
$ HandBrakeCLI --version
[11:51:19] Compile-time hardening features are enabled
[11:51:19] hb_init: starting libhb thread
[11:51:19] thread 7000063e9000 started ("libhb")
HandBrake 1.3.3
HandBrake has exited.
$ HandBrakeCLI -h
[11:50:04] Compile-time hardening features are enabled
[11:50:04] hb_init: starting libhb thread
@mh61503891
mh61503891 / example-of-static-webpage-generator.rb
Created June 23, 2020 04:53
An example of Static Webpage Generator using ActionView
#! /usr/bin/env ruby
require 'action_view'
require 'action_pack'
# @see https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/debug_view.rb
class View < ActionView::Base
def initialize(assigns)
paths = ['app/views']
@mh61503891
mh61503891 / google-hangouts-meet-tips.md
Last active April 9, 2020 07:38
Google Hangouts Meetのtips

License: CC0

Google Hangouts Meetのtips

ハウリング

  • 片方の部屋に講師側の端末を1つ、もう片方の部屋に学生側の端末を2つ用意した。
  • 学生側の端末: 2m間隔
    • 常時ハウリングして学生側の発言が聞き取れない。
  • 学生側の端末: 4m間隔