volume

Handling volume change on android lockscreen?

不打扰是莪最后的温柔 提交于 2020-01-14 19:14:25
问题 What I am trying to do is, being able to catch volume up/down button actions on lockscreen on android 4.4. Google Cast Design Checklist document describes lock screen requirement "Provide access to the volume control via hardware buttons". I tried various ways to handle hardware volume buttons on lock screen but none of them worked. onKeyDown/dispatchKeyEvent - I tried to override onKeyDown as well as dispatchKeyEvent methods on Activity, but none of these are executed on lockscreen, these

Handling volume change on android lockscreen?

天大地大妈咪最大 提交于 2020-01-14 19:14:19
问题 What I am trying to do is, being able to catch volume up/down button actions on lockscreen on android 4.4. Google Cast Design Checklist document describes lock screen requirement "Provide access to the volume control via hardware buttons". I tried various ways to handle hardware volume buttons on lock screen but none of them worked. onKeyDown/dispatchKeyEvent - I tried to override onKeyDown as well as dispatchKeyEvent methods on Activity, but none of these are executed on lockscreen, these

change volume of mp3 playing via wmplib in c#

血红的双手。 提交于 2020-01-14 13:48:07
问题 Is it somehow possible to change the volume of a mp3-file that is playing via wmplib? Changing the volume of the program itself would be ok as well. Are there any solutions to do this? 回答1: The idea is to send WM_APPCOMMAND message (also see this answer). For WPF use WindowInteropHelper to get the Handle of the Window : class MainWindow : Window { ... private const int APPCOMMAND_VOLUME_MUTE = 0x80000; private const int WM_APPCOMMAND = 0x319; private const int APPCOMMAND_VOLUME_UP = 10 *

In Android (using Java), how can I set the ring volume (to a specified number)?

ぐ巨炮叔叔 提交于 2020-01-13 10:50:17
问题 So in my application, I have a seekbar that allows the user to set the ringer volume (0 - 100). I can't seem to find a way to set the ringer volume to a specified number. I looked through the AudioManager class but it tells me to either set ringermode to normal/silent/vibrate. That is NOT what I want. I want the volume to be a specific number . Here's an example of what I'm looking for: private void setRinger (int volume) // volume = 0 - 100 { setRingVolume (volume); // Whenever a person gets

用 ConfigMap 管理配置 - 每天5分钟玩转 Docker 容器技术(159)

主宰稳场 提交于 2020-01-13 07:09:07
Secret 可以为 Pod 提供密码、Token、私钥等敏感数据;对于一些非敏感数据,比如应用的配置信息,则可以用 ConfigMap。 ConfigMap 的创建和使用方式与 Secret 非常类似,主要的不同是数据以明文的形式存放。 与 Secret 一样,ConfigMap 也支持四种创建方式: 1. 通过 --from-literal : kubectl create configmap myconfigmap --from-literal=config1=xxx --from-literal=config2=yyy 每个 --from-literal 对应一个信息条目。 2. 通过 --from-file : echo -n xxx > ./config1 echo -n yyy > ./config2 kubectl create configmap myconfigmap --from-file=./config1 --from-file=./config2 每个文件内容对应一个信息条目。 3. 通过 --from-env-file : cat << EOF > env.txt config1=xxx config2=yyy EOF kubectl create configmap myconfigmap --from-env-file=env.txt 文件 env

k8s通过configmap管理应用配置信息

坚强是说给别人听的谎言 提交于 2020-01-12 20:26:05
Secret 可以为 Pod 提供密码、Token、私钥等敏感数据;对于一些非敏感数据,比如应用的配置信息,则可以用 ConfigMap。 ConfigMap 的创建和使用方式与 Secret 非常类似,主要的不同是数据以明文的形式存放。 1.configMap的创建 与 Secret 一样,ConfigMap 也支持四种创建方式: 1.1通过 --from-literal : kubectl create configmap myconfigmap --from-literal=config1=xxx --from-literal=config2=yyy 每个 --from-literal 对应一个信息条目。 1.2通过 --from-file : echo -n xxx > ./config1 echo -n yyy > ./config2 kubectl create configmap myconfigmap --from-file=./config1 --from-file=./config2 每个文件内容对应一个信息条目。 1.3通过 --from-env-file : cat << EOF > env.txt config1=xxx config2=yyy EOF kubectl create configmap myconfigmap --from-env-file

LVM逻辑卷详解

我的梦境 提交于 2020-01-11 23:28:25
LVM: Logical Volume Manager 可以允许对卷进行方便操作的抽象层,包括重新设定文件系统的大小,允许在多个物理设备间重新组织文件系统,可增大可缩减(缩减必须取消挂载会导致数据丢失)弹性更改 逻辑分区与逻辑卷的区别 逻辑卷与逻辑分区不是同一概念,逻辑分区容量大小不能改变;逻辑卷容量大小可以改变(基于物理卷和卷组之上的逻辑卷);逻辑卷管理器(LVM)可以更轻松的管理磁盘空间(整合的磁盘池) 以下是原理图,可以更好的理解 #创建物理卷 pvcreate /dev/sda3 \#为卷组分配物理卷 vgcreate vg0 /dev/sda3 \#从卷组创建逻辑卷 lvcreate -L 256M -n data vg0 \#mkfs.xfs /dev/vg0/data 创建文件系统 \#挂载 mount /dev/vg0/data /mnt/data# 扩展 lvextend -L [+]#[mMgGtT] /dev/VG_NAME/LV_NAME \#针对ext resize2fs /dev/VG_NAME/LV_NAME \#针对xfs xfs_growfs MOUNTPOINT lvresize -r -l +100%FREE /dev/VG_NAME/LV_NAME 缩减 只支持ext4 umount /dev/VG_NAME/LV_NAME e2fsck

关于Docker的挂载

六眼飞鱼酱① 提交于 2020-01-11 06:14:51
 底层原理不懂就上手,上手出了问题就懵逼,最近在对接阿里云时遇到Docker存储驱动的神坑,爬了几天爬不出来,最后发现是节点中Docker存储驱动的问题,由此引发此次学习,避免类似问题再次懵逼。 文章目录 1. Volumes(最推荐的挂载方式) 2. Bind mounts 3. tmpfs mounts 4. named pipes 5.关于语法 5.1 -v/--volume 5.2 --mount  关于镜像images,核心首先必须明确一点, 镜像都是只读的 ,如果需要进行写操作,必须在该镜像上创建一个新的镜像层(我们所有的写操作其实都是在一个可写的镜像层上操作的)。同时镜像也是共享的,那些依赖于同一个 image 的多个容器,并不会将单独复制需要的镜像到自己的容器中进行启动,那样会浪费巨大的空间,实际节点上只会有一个镜像,多个容器是共享这一个镜像的。存储驱动可以将容器中的数据进行持久化同时避免性能问题。存储驱动允许我们在容器的可写层创建数据,这些数据在容器销毁后也就没有了,且这些文件的读写速度都比本地文件系统的性能低。  默认情况下,容器内所有创建的文件都存储在一个可写层,所以这些文件仅仅存活于容器运行时,一旦容器被销毁这些文件也会被销毁。容器的可写层和宿主机器紧密耦合,很难将可写层的文件或数据迁移到非宿主机器外的地方。要将数据写入容器的可写层必须要有一个存储驱动

Windows batch file to get C:\ drive total space and free space available

杀马特。学长 韩版系。学妹 提交于 2020-01-11 03:25:07
问题 I need a bat file to get C:\ drive total space and free space available in GB (giga bytes) in a Windows system and create a text file with the details. Note: i dont want to use any external utilities. 回答1: cut 9 digits of the size by bytes to get the size in GB: @echo off & setlocal ENABLEDELAYEDEXPANSION SET "volume=C:" FOR /f "tokens=1*delims=:" %%i IN ('fsutil volume diskfree %volume%') DO ( SET "diskfree=!disktotal!" SET "disktotal=!diskavail!" SET "diskavail=%%j" ) FOR /f "tokens=1,2" %

docker_周阳(三)

偶尔善良 提交于 2020-01-11 01:54:38
docker 容器数据卷 是什么 Docker的理念:将运用与运行的环境打包形成容器运行 ,运行可以伴随着容器,但是我们对数据的要求希望是 持久化的 ,容器之间希望有可能 共享数据 Docker容器产生的数据,如果不通过docker commit生成新的镜像,使得数据做为镜像的一部分保存下来,那么当容器删除后,数据自然也就没有了。 为了能保存数据在docker中我们使用卷 一句话:有点类似我们Redis里面的 rdb 和 aof 文件 能干嘛 卷就是目录或文件,存在于一个或多个容器中,由docker挂载到容器,但不属于联合文件系统,因此能够绕过Union File System提供一些用于持续存储或共享数据的特性 卷的设计目的就是数据的持久化,完全独立于容器的生存周期,因此Docker不会在容器删除时删除其挂载的数据卷 特点: 1:数据卷可在容器之间共享或重用数据 2:卷中的更改可以直接生效 3:数据卷中的更改不会包含在镜像的更新中 4:数据卷的生命周期一直持续到没有容器使用它为止 数据卷 直接命令添加 docker run -it -v /宿主机绝对路径目录:/容器内目录 镜像名 查看数据卷是否挂载成功 docker inspect 容器ID 命令(带权限) 只读read only docker run -it -v /宿主机绝对路径目录:/容器内目录:ro 镜像名