Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma
You can get the list of supported formats with:
ffmpeg -formats
You can get the list of installed codecs with:
| public class CustomMatchers { | |
| public static Matcher<View> withBackground(final int resourceId) { | |
| return new TypeSafeMatcher<View>() { | |
| @Override | |
| public boolean matchesSafely(View view) { | |
| return sameBitmap(view.getContext(), view.getBackground(), resourceId); | |
| } | |
| @Override |
| /* | |
| * The MIT License (MIT) | |
| * | |
| * Copyright (c) 2016 Raphaël Bussa | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
| data class SubData(var x:Int, var y:String) | |
| data class Data(val d:SubData, val i:Int) | |
| val x = Data(SubData(10, "shared data"), 10) | |
| val z = x.copy() | |
| println("x.d.x = ${x.d.x}, x.d.y = ${x.d.y}") | |
| println("z.d.x = ${z.d.x}, z.d.y = ${z.d.y}") | |
| x.d.x = 100 | |
| println("after chaning x.d.x to 100") |
| import android.annotation.SuppressLint | |
| import android.content.Context | |
| import android.content.SharedPreferences | |
| import com.hardiktrivedi.gdg_pune_kotlin_workshop.R | |
| import kotlin.reflect.KProperty | |
| class PreferenceExtension<T>(val context: Context, val key: String, val defaultValue: T) { | |
| val prefs: SharedPreferences by lazy { context.getSharedPreferences(context.getString(R.string.app_name), Context.MODE_PRIVATE) } | |
| operator fun getValue(thisRef: Any?, property: KProperty<*>): T { |
| import kotlinx.coroutines.experimental.DefaultDispatcher | |
| import kotlinx.coroutines.experimental.channels.ReceiveChannel | |
| import kotlinx.coroutines.experimental.channels.consumeEach | |
| import kotlinx.coroutines.experimental.channels.produce | |
| import kotlinx.coroutines.experimental.delay | |
| import kotlinx.coroutines.experimental.runBlocking | |
| import kotlin.coroutines.experimental.CoroutineContext | |
| fun <T> ReceiveChannel<T>.debounce( | |
| wait: Long = 300, |
| package com.your.package | |
| import android.app.Dialog | |
| import android.os.Bundle | |
| import com.your.package.R | |
| import com.google.android.material.bottomsheet.BottomSheetDialog | |
| import com.google.android.material.bottomsheet.BottomSheetDialogFragment | |
| /** | |
| * BottomSheetDialog fragment that uses a custom |