silent

ErrorActionPreference and ErrorAction SilentlyContinue for Get-PSSessionConfiguration

ぐ巨炮叔叔 提交于 2019-11-27 02:33:54
问题 My case: $ErrorActionPreference = "Stop"; "1 - $ErrorActionPreference;" Get-ChildItem NoSuchFile.txt -ErrorAction SilentlyContinue; "2 - $ErrorActionPreference;" Get-ChildItem NoSuchFile.txt -ErrorAction Stop; "3 - $ErrorActionPreference;" Output: 1 - Stop; 2 - Stop; and display an error... Now, $ErrorActionPreference = "Stop"; "1 - $ErrorActionPreference;" (Get-PSSessionConfiguration -Name "MyShellUri" -ErrorAction SilentlyContinue) "2 - $ErrorActionPreference;" Output: 1 - Stop; and display

Can an iOS app switch the device to silent mode?

时光毁灭记忆、已成空白 提交于 2019-11-26 23:36:40
问题 Is there a way to programmatically set the device my app is running on to silent mode? The silence must encompass the entire device, not just my application. 回答1: No. As it's a physical hardware switch, there's no software method for muting the entire device. No reason to fight the framework, just let the user mute the device if he/she pleases. 来源: https://stackoverflow.com/questions/7828958/can-an-ios-app-switch-the-device-to-silent-mode

Detect Silent mode in iOS5?

谁说我不能喝 提交于 2019-11-26 22:33:07
I have used this method in the past to detect if the silent switch is enabled: - (BOOL)silenced { #if TARGET_IPHONE_SIMULATOR // return NO in simulator. Code causes crashes for some reason. return NO; #endif CFStringRef state; UInt32 propertySize = sizeof(CFStringRef); AudioSessionInitialize(NULL, NULL, NULL, NULL); AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &propertySize, &state); if(CFStringGetLength(state) > 0) return NO; else return YES; } This is no longer working in iOS5 on my iPad or iPhone. Is this a known issue? I haven't been able to find any answers on stack overflow

Install iOS app directly from website - no password, no iTunes, no UDID

时间秒杀一切 提交于 2019-11-26 20:00:04
问题 I just installed an app from a website - with no profile, no UDID, no anything. It just started installing. How is this possible? I am not jailbroken, not running the new beta 6. When it finished installing I tapped on it and it asked me if I was sure I wanted to run this app. Link to app that installs 'silently' 回答1: They seem to have an Enterprise Developer Account that allows over the air distribution to any iPad without the need to add each device's UDID. The process to provide such an

How do I start playing audio when in silent mode & locked in iOS 6?

北城以北 提交于 2019-11-26 18:26:03
End-user process Open app Switch on 'Silent Mode'. Press 'Lock-button' App can still START playing a sound after hours have passed, not playing any audio in the interim. Apps that do this A lot of alarm apps have manage to do this & I dont think they are using silent audio to keep the app running as they do not sound if you actually exit the app with home. Alarm Clock Pro My Clock Wave Alarm Alarmed iHome ... ...Are they keeping a loop running after being locked some how or it a notification(which cant play sound in silent) starting the app back up to play the audio, or some other method?

Is there a quiet version of subprocess.call?

﹥>﹥吖頭↗ 提交于 2019-11-26 17:49:01
问题 Is there a variant of subprocess.call that can run the command without printing to standard out, or a way to block out it's standard out messages? 回答1: Yes. Redirect its stdout to /dev/null . process = subprocess.call(["my", "command"], stdout=open(os.devnull, 'wb')) 回答2: Often that kind of chatter is coming on stderr, so you may want to silence that too. Since Python 3.3, subprocess.call has this feature directly: To suppress stdout or stderr, supply a value of DEVNULL. Usage: import

Silent printing of a PDF in Python

北慕城南 提交于 2019-11-26 17:42:40
问题 I'm trying to print a PDF with Python, without opening the PDF viewer application (Adobe, Foxit etc.). I need also to know when printing has finished (to delete the file). Here I found this implementation : import win32ui, dde, os.path, time from win32api import FindExecutable from os import spawnl, P_NOWAIT ... pd = "C:\\temp\\test.pdf" pdbits = os.path.split(pd) readerexe = FindExecutable(pdbits[1],pdbits[0]) spawnl(P_NOWAIT,readerexe[1],"DUMMY") #I added "DUMMY" to avoid a weird error time

How to Play a sound using AVAudioPlayer when in Silent Mode in iPhone

最后都变了- 提交于 2019-11-26 15:55:17
问题 I want to play a sound even in silent mode in iPhone. Can it be done by using AVAudioPlayer (Without using AVAudioSession) (For ios 3.0+) Thanks in advance. 回答1: Actually, you can do this. It is controlled via the Audio Session and has nothing to do with AVAudioPlayer itself. Why don't you want to use AudioSession? They play nice together... In your app, you should initialize the Audio Session, and then you can also tell indicate what kind of audio you intend to play. If you're a music player

Cygwin - run script silenty from “run command”

夙愿已清 提交于 2019-11-26 12:58:26
问题 I have script lets say: C:\\foo.bsh I want to be able to run this command via the windows run command: Start -> Run Windows Key + R and type something small like \'foo\' and hitting return. However, I do not want a cmd prompt to be visible. This script does some preprocessing for an IDE. I do not want the cmd prompt to be open for the lifetime of the IDE process. I have tried: 1) Creating a bat file with the following contents: c:\\cygwin\\bin\\bash --login \"C:\\foo.bsh\" (this fails because

How to run a PowerShell script without displaying a window?

徘徊边缘 提交于 2019-11-26 12:06:36
How is it possible to run a PowerShell script without displaying a window or any other sign to the user? In other words, the script should run quietly in the background without any sign to the user. Extra credit for an answer that does not use third party components :) You can either run it like this (but this shows a windows for a while): PowerShell.exe -windowstyle hidden { your script.. } Or you use a helper file I created to avoid the window called PsRun.exe that does exactly that. You can download source and exe file Run scheduled tasks with WinForm GUI in PowerShell . I use it for