如何配置我的Apache服务器在端口80上运行?使用端口80时,我的Apache服务失败; 它说BUSY.
当我将config中的端口更改为85时,Apache工作,但这需要每次使用localhost在地址栏中输入85.
我试图找出哪个程序正在使用端口80,但我无法想出任何东西.我第一次进入netstat -n -a -o -p TCPcmd,我想出了这些信息
Local Address 0.0.0.0:80 State: Listening PID: 4
Run Code Online (Sandbox Code Playgroud)
然后我进入tasklistcmd试图弄清楚哪个服务正在使用这个端口.看起来"System"在PID 4上.我已经将Skype配置为不使用端口80而没有任何运气.我在Windows 7上安装了Microsoft WebMatrix,我甚至删除了IIS 7.5 Server Express以释放此端口,但一切都无济于事.
你能帮帮我吗?我使用的是Windows 7和XAMPP.
我正在尝试使用此数据构建3x3转换矩阵
days=['rain', 'rain', 'rain', 'clouds', 'rain', 'sun', 'clouds', 'clouds',
'rain', 'sun', 'rain', 'rain', 'clouds', 'clouds', 'sun', 'sun',
'clouds', 'clouds', 'rain', 'clouds', 'sun', 'rain', 'rain', 'sun',
'sun', 'clouds', 'clouds', 'rain', 'rain', 'sun', 'sun', 'rain',
'rain', 'sun', 'clouds', 'clouds', 'sun', 'sun', 'clouds', 'rain',
'rain', 'rain', 'rain', 'sun', 'sun', 'sun', 'sun', 'clouds', 'sun',
'clouds', 'clouds', 'sun', 'clouds', 'rain', 'sun', 'sun', 'sun',
'clouds', 'sun', 'rain', 'sun', 'sun', 'sun', 'sun', 'clouds',
'rain', 'clouds', 'clouds', 'sun', 'sun', 'sun', 'sun', 'sun', 'sun',
'clouds', 'clouds', 'clouds', 'clouds', 'clouds', …Run Code Online (Sandbox Code Playgroud) 使用List一个可以简单地使用.onDelete修饰符从列表中删除行。但是我们如何ForEach在LazyVStack. 我正在使用SwipeCell应用拖动手势并显示删除按钮,但我如何实际从 CoreData 中删除,特别是IndexSet在这种情况下如何访问
LazyVStack {
ForEach(items) { item in
Text("\(item.name)")
.swipeCell(cellPosition: .right, leftSlot: nil, rightSlot: slot1)
.alert(isPresented: $showAlert){
Alert(title: Text("Delete Task?"), message: nil, primaryButton:.destructive(Text("Delete"), action: {
// HOW DO I DELETE HERE ?
dismissDestructiveDelayButton()
}),secondaryButton: .cancel({dismissDestructiveDelayButton()}))
}
}
}
private func deleteItems(offsets: IndexSet) {
withAnimation {
offsets.map { items[$0] }.forEach(viewContext.delete)
do {
try viewContext.save()
} catch {
let nsError = error as NSError
fatalError("Unresolved error \(nsError), \(nsError.userInfo)") …Run Code Online (Sandbox Code Playgroud) 嗨,所以这里是用于解析Swift 2中的JSON文件的样板代码.我以前使用它并且它可以工作但是由于某种原因它在最新版本的Xcode 7.1和Swift 2中被破坏了.有关这个人的任何想法?错误是"参数标签"(contentsOfFile:,options:,error :)'与任何可用的重载都不匹配"
import Foundation
extension Dictionary {
static func loadJSONFromBundle(filename: String) -> Dictionary<String, AnyObject>? {
if let path = NSBundle.mainBundle().pathForResource(filename, ofType: "json") {
var error: NSError?
let data = NSData(contentsOfFile: path, options: NSDataReadingOptions, error: &error)
if let data = data {
let dictionary: AnyObject? = NSJSONSerialization.JSONObjectWithData(data,
options: NSJSONReadingOptions(), error: &error)
if let dictionary = dictionary as? Dictionary<String, AnyObject> {
return dictionary
} else {
print("Level file '\(filename)' is not valid JSON: \(error!)")
return nil
}
} else …Run Code Online (Sandbox Code Playgroud)