如何找到httpd.conf文件的位置?
我正在从Amazon Web Services EC2(弹性计算云)运行Ubuntu Linux服务器,但我找不到我的Apache配置.
我有一个运行在Linux ubuntu上的AWS EC2服务的服务器,我已经安装了apache,php和mysql.
我.htaccess在我的文档根目录中添加了一个文件/var/www/html.
我在其中输入了这段代码:
ErrorDocument 404 /var/www/html/404.php它仍然没有显示出来.
我多次输入此命令:sudo service httpd restart重启服务器但没有显示更改...
我怎么能解决这个问题......我做错了什么?
提前致谢!
apache .htaccess amazon-ec2 apache-config amazon-web-services
我有一个充满PHAsset对象的数组(https://developer.apple.com/library/prerelease/ios/documentation/Photos/Reference/PHAsset_Class/index.html),我想知道如何将它们转换为UIImage然后将它们保存在一个数组中.
调用带有PHAsset对象的数组,self.assets这是我到目前为止所拥有的:
PHImageManager *manager = [PHImageManager defaultManager];
CGFloat scale = UIScreen.mainScreen.scale;
NSMutableArray *images = [NSMutableArray arrayWithCapacity:[self.assets count]];
for (int i = 0; i < [self.assets count]; i++) {
CGSize targetSize = CGSizeMake(scale, scale);
[manager requestImageForAsset:[self.assets objectAtIndex:i]
targetSize:targetSize
contentMode:PHImageContentModeAspectFill
options:self.requestOptions
resultHandler:^(UIImage *image, NSDictionary *info){
[images addObject:image];
}];
}
Run Code Online (Sandbox Code Playgroud)
self.requestOptions是.h中的一个属性
@property (nonatomic, strong) PHImageRequestOptions *requestOptions;
Run Code Online (Sandbox Code Playgroud)
并在viewDidLoad我这样做:
self.requestOptions = [[PHImageRequestOptions alloc] init];
self.requestOptions.resizeMode = PHImageRequestOptionsResizeModeExact;
self.requestOptions.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;
Run Code Online (Sandbox Code Playgroud)
但经过一些调试后,我一直看到它self.assets具有以下值:
(
<PHAsset: 0x1743828a0> 3B6D658D-EC76-43A1-9793-35D889E9CF15/L0/001 mediaType=1/0, assetSource=3, …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Python和OpenCV对视网膜图像中的血管进行分割.这是原始图像:
理想情况下,我希望所有的血管都像这样(不同的图像)非常明显:
这是我到目前为止所尝试的.我拍了图像的绿色通道.
img = cv2.imread('images/HealthyEyeFundus.jpg')
b,g,r = cv2.split(img)
Run Code Online (Sandbox Code Playgroud)
然后我试图按照创建匹配滤波器这篇文章,这是输出图像是什么:
然后我尝试进行最大熵阈值处理:
def max_entropy(data):
# calculate CDF (cumulative density function)
cdf = data.astype(np.float).cumsum()
# find histogram's nonzero area
valid_idx = np.nonzero(data)[0]
first_bin = valid_idx[0]
last_bin = valid_idx[-1]
# initialize search for maximum
max_ent, threshold = 0, 0
for it in range(first_bin, last_bin + 1):
# Background (dark)
hist_range = data[:it + 1]
hist_range = hist_range[hist_range != 0] / cdf[it] # normalize within selected range & remove all 0 elements …Run Code Online (Sandbox Code Playgroud) 我在我的iOS应用程序中使用AVSpeechSynthesizer for TTS.但是没有调用didFinishSpeechUtterance方法.
这是我在.h中的代码:
#import <AVFoundation/AVFoundation.h>
@interface EmailViewController : UIViewController <UITextFieldDelegate, AVSpeechSynthesizerDelegate>
@property (nonatomic, strong) AVSpeechSynthesizer* talker;
Run Code Online (Sandbox Code Playgroud)
这是在.m
- (void) startTalking {
NSString *hi = [NSString stringWithFormat:@"%@", humanLanguageArray[speaknumber]];
AVSpeechUtterance* utter = [[AVSpeechUtterance alloc] initWithString:hi];
utter.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
[utter setRate:0.2f];
if (!self.talker) {
self.talker = [AVSpeechSynthesizer new];
}
self.talker.delegate = self;
[self.talker speakUtterance:utter];
}
- (void)stopSpeech
{
AVSpeechSynthesizer *talked = [[AVSpeechSynthesizer alloc] init];
if([talked isSpeaking]) {
[talked stopSpeakingAtBoundary:AVSpeechBoundaryImmediate];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@""];
[talked speakUtterance:utterance];
[talked stopSpeakingAtBoundary:AVSpeechBoundaryImmediate];
}
}
- …Run Code Online (Sandbox Code Playgroud) 因此,过去几周来我一直在iOS 11和12上开发应用程序,但是在iOS 10.3.3 iphone 7模拟器(以及真正的iphone 7)上进行测试后,我才意识到标签栏图标看起来真的很适合一些原因。
它们在所有iOS 11+手机上看起来都不错
我在这里遵循了以下准则:https : //developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/custom-icons/
我的图像尺寸是
@ 3x:75x75 @ 2x:50x50 @ 1x:25x25
我在情节提要中玩过,不知道如何解决。有什么想法吗?
我想制作一个演示应用程序,我可以在代码中输入4个数字,然后按1,2,3顺序对其进行排序NSLog.有简单的算法或方法吗?
我正在尝试在运行apache的Amazon EC2 Micro实例上创建的python Web应用程序上使用OpenCV.
除了OpenCV没有安装外,我已经完成了所有配置和工作.这是我从Apache错误日志中获得的输出.
[Thu Aug 04 18:31:54 2016] [error] [client 72.219.147.5] import cv2
[Thu Aug 04 18:31:54 2016] [error] [client 72.219.147.5] ImportError: No module named cv2
Run Code Online (Sandbox Code Playgroud)
这是我尝试过的:
我已经安装了pip并尝试了运行 pip install pyopencv
这不起作用,给我错误.
我还尝试通过以下方式手动安装它:如何在Amazon Linux上安装OpenCV?
这个:http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_setup/py_setup_in_fedora/py_setup_in_fedora.html?highlight=download#installing-opencv-python-from-pre-built-binaries
这个:http://techieroop.com/install-opencv-in-centos/
即使在安装之后,也无法找到cv2.so文件.我尝试使用它来搜索它sudo find / -name "cv2.so"但没有出现.
但是,我.so安装了以下文件:
/usr/local/lib/libopencv_photo.so
/usr/local/lib/libopencv_stitching.so
/usr/local/lib/libopencv_flann.so
/usr/local/lib/libopencv_imgcodecs.so
/usr/local/lib/libopencv_videostab.so
/usr/local/lib/libopencv_ml.so
/usr/local/lib/libopencv_objdetect.so
/usr/local/lib/libopencv_imgproc.so
/usr/local/lib/libopencv_superres.so
/usr/local/lib/libopencv_core.so
/usr/local/lib/libopencv_video.so
/usr/local/lib/libopencv_highgui.so
/usr/local/lib/libopencv_features2d.so
/usr/local/lib/libopencv_shape.so
/usr/local/lib/libopencv_videoio.so
/usr/local/lib/libopencv_calib3d.so
Run Code Online (Sandbox Code Playgroud)
此外,在运行cmake命令时,这是我得到的输出:
-- Python 2:
-- Interpreter: /usr/bin/python2.7 (ver 2.7.10) …Run Code Online (Sandbox Code Playgroud) 我想知道如何使用 ffmpeg 来实现声音被完全破坏的扬声器效果。
我在 ffmpeg 上尝试了一堆不同命令的组合,我得到的最接近的是以下(我使用超级均衡器,然后使音量超高):
import ffmpeg
(
ffmpeg
.input('shark.wav')
.filter("superequalizer", 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20)
.filter("volume", 10)
.output('output_speaker.wav')
.run()
)
Run Code Online (Sandbox Code Playgroud)
我正在使用 python 包装器,但这是等效的命令行:
ffmpeg -i shark.wav -af "superequalizer=1b=20:2b=20:3b=20:4b=20:5b=20:6b=20:7b=20:8b=20:9b=20:10b=20:11b=20:12b=20:13b=20:14b=20:15b=20:16b=20:17b=20:18b=20,volume=10" output_speaker.wav
Run Code Online (Sandbox Code Playgroud)
上述问题是,它对声音还不是很大的文件(例如录制的音频)没有任何作用,并且大多数时候音频实际上只是最终被削波,然后变得超级柔和。
有人对如何实现这种效果有建议吗?谢谢!
我正在尝试制作播放音乐的Google扩展程序.当我关闭扩展程序并浏览其他网站时,我希望扩展也可以播放.我是否必须更改manifest.json,background.html或main.html(我的索引/弹出文件)的代码?这是我的manifest.json的代码:
{
"name": "SpeedSongz.fm",
"description": "Instantly listen to your favorite music and radios.",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png",
"default_title": "SpeedSongz.fm",
"popup": "main.html"
},
"background_page" : "background.html"
}
Run Code Online (Sandbox Code Playgroud)
那么我如何制作代码,以便即使实际的扩展已关闭,音乐也会在后台继续运行?可能吗?谢谢!
我正在制作一个iPhone应用程序,我想做宽屏检测,所以我做了一堆,#define我想用它做一个if语句.
// Device and Widescreen Detection
#define IS_WIDESCREEN ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )
// iPhone
#define IS_IPHONE ( [ [ [ UIDevice currentDevice ] model ] isEqualToString: @"iPhone" ] ) || ( [ [ [ UIDevice currentDevice ] model ] isEqualToString: @"iPhone Simulator" ] ) )
#define IS_IPHONE_5 ( IS_IPHONE && IS_WIDESCREEN )
// iPod Touch
#define IS_IPOD ( [ [ [ UIDevice currentDevice …Run Code Online (Sandbox Code Playgroud)