小编uti*_*tiq的帖子

无法使用锚点激活约束

所以,我正在尝试以编程方式创建一个sceneView

class ViewController: UIViewController, ARSCNViewDelegate {
    var sceneView: ARSCNView = ARSCNView()
    let configuration = ARWorldTrackingConfiguration()

    override func viewDidLoad() {
        super.viewDidLoad()

        self.sceneView.debugOptions = [ARSCNDebugOptions.showFeaturePoints, ARSCNDebugOptions.showWorldOrigin]
        self.configuration.planeDetection = .horizontal
        self.sceneView.session.run(configuration)
        self.sceneView.delegate = self
        self.sceneView.autoenablesDefaultLighting = true

        //add autolayout contstraints
        self.sceneView.translatesAutoresizingMaskIntoConstraints = false
        self.sceneView.topAnchor.constraint(equalTo: self.view.topAnchor).isActive = true
        self.sceneView.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true
        self.sceneView.rightAnchor.constraint(equalTo: self.view.rightAnchor).isActive = true
        self.sceneView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true

    }

    func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) {
        guard anchor is ARPlaneAnchor else {return}
    }
}
Run Code Online (Sandbox Code Playgroud)

但我收到此错误消息:

由于未捕获的异常'NSGenericException'而终止应用程序,原因:'无法使用锚点激活约束,因为它们没有共同的祖先.约束或其锚点是否引用不同视图层次结构中的项目?这是非法的.

这部分发生了\\add …

ios scenekit swift sceneview arkit

18
推荐指数
1
解决办法
9640
查看次数

以编程方式添加 ARSCNView

如何以编程方式添加 ARSCNView?如何设置宽度、高度和约束?

class ViewController: UIViewController {

    var sceneView: ARSCNView!
    let configuration = ARWorldTrackingConfiguration()

    override func viewDidLoad() {
        super.viewDidLoad()

        self.sceneView.debugOptions = [ARSCNDebugOptions.showFeaturePoints, ARSCNDebugOptions.showWorldOrigin]
        self.sceneView.session.run(configuration)
    }
}
Run Code Online (Sandbox Code Playgroud)

augmented-reality ios scenekit swift arkit

6
推荐指数
1
解决办法
3205
查看次数

从Rails控制台重新加载帮助程序

我在Rails 3中调用Rails控制台中的辅助方法,如下所示:

>> helper.my_method(parameter)
>> #=> some result
Run Code Online (Sandbox Code Playgroud)

但是,如果我更改辅助方法,则当我再次调用相同的方法时,不会反映更改.我必须exit运行rails console以便看到辅助方法的更改生效.

helper ruby-on-rails-3

5
推荐指数
2
解决办法
1604
查看次数

ActiveJob 和 Sidekiq 作业陷入队列

所以我刚刚迁移到 Rails 5.1.4,我试图让 Active Job 工作,但作业只是卡在队列中并且从未被处理。

  • 导轨:5.1.4
  • 红宝石:2.4.3
  • sidekiq:5.0.5
  • 雷迪斯:4.0.1

sidekiq.yml

---
:verbose: true
:concurrency: 5
:timeout: 60
development:
  :concurrency: 25
staging:
  :concurrency: 50
production:
  :concurrency: 5
:queues:
  - default
  - [high_priority, 2]
Run Code Online (Sandbox Code Playgroud)

sidekiq.rb

Sidekiq.configure_server do |config|
  config.redis = {url: ENV['ACTIVE_JOB_URL'], network_timeout: 5}
end

Sidekiq.configure_client do |config|
  config.redis = {url: ENV['ACTIVE_JOB_URL'], network_timeout: 5}
end
Run Code Online (Sandbox Code Playgroud)

以下是我从 Rails 控制台执行任务的方式:

TestJob.perform_later
Run Code Online (Sandbox Code Playgroud)

TestJob.rb内容:

class TestJob < ApplicationJob
  queue_as :default

  def perform(*args)
    Rails.logger.debug "#{self.class.name}: I'm performing my job with arguments: #{args.inspect}"
  end
end
Run Code Online (Sandbox Code Playgroud)

这些作业只是停留在队列中并且从未被处理:

在此输入图像描述

ruby ruby-on-rails sidekiq rails-activejob

5
推荐指数
1
解决办法
4206
查看次数

Shopify 和 Squarespace 等网站在设置自定义域时如何自动执行反向代理配置?

我有一个由子域分隔的多租户网站。我网站上的每个用户都有自己的子域。这与 shopify、squarespace 等网站使用的模式相同:

mary.marketplacesite.com
matt.marketplacesite.com
john.marketplacesite.com
Run Code Online (Sandbox Code Playgroud)

用户还可以选择通过向我的反向代理服务器 (sites.marketplacesite.com) 提供 A 和 CNAME 记录来使用其自定义域。Shopify/Squarespace 有相同的确切说明:

https://support.squarespace.com/hc/en-us/articles/205812378-Connecting-a-domain-to-your-Squarespace-site#toc-step-5---add-the-first-cname-记录

https://help.shopify.com/manual/domains/connecting-existing-domains/setting-up-your-domain

完成此操作后,我必须手动将该站点添加到conf文件中:

server {
  listen 80;
  server_name www.mary.com mary.com;
  location / {
    access_log off;
    proxy_pass http://mary.marketplacesite.com;
  }
}
Run Code Online (Sandbox Code Playgroud)

这一切都有效,但这真的是 Shopify/Squarespace 对数千个网站所做的吗?他们如何自动更新代理服务器配置?有更好的方法吗?

我是否必须为每个自定义域创建一个服务器块?或者有一个脚本来生成该 .conf 文件并将其存储在“/etc/nginx/conf.d/”中?我也听说有Nginx+,但是有更便宜的方法吗?

reverse-proxy nginx

5
推荐指数
0
解决办法
738
查看次数

Atom Editor - 缺少状态栏

这个酒吧叫怎么样?状态栏?

在此输入图像描述

我的朋友在他的编辑中看不到它,怎么能把它拿回来?

在此输入图像描述

atom-editor

2
推荐指数
1
解决办法
2536
查看次数

Phaser游戏视角

我是Phaser的新手,我会就如何开始构建这种类型的游戏获得一些建议.欢迎任何示例,想法,教程.提前致谢!.

http://appcrawlr.com/ios/beat-mp3

在此输入图像描述

game-physics html5-canvas phaser-framework

1
推荐指数
1
解决办法
614
查看次数