使用osx的故事板绘制到NSView的过程是什么?我已经在NSViewController中添加了一个NSView.然后,我添加了一些约束和插座.

接下来,我添加了一些代码来改变颜色:import Cocoa
class ViewController: NSViewController {
@IBOutlet var box: NSView!
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillAppear() {
box.layer?.backgroundColor = NSColor.blueColor().CGColor
//box.layer?.setNeedsDisplay()
}
override var representedObject: AnyObject? {
didSet {
// Update the view, if already loaded.
}
}
}
Run Code Online (Sandbox Code Playgroud)
我想做自定义绘图和更改NSView的颜色.我过去在iOS上进行过复杂的绘图,但我完全陷入困境.有谁看到我做错了什么?
我正在尝试向gcloud ml-engine提交一份工作.作为参考,该作业正在使用Google提供的此示例
它经历了第一次,但是与此问题无关的错误,现在我正在尝试在纠正错误后重新发出命令:
gcloud ml-engine jobs submit training $JOB_NAME \
--stream-logs \
--runtime-version 1.0 \
--job-dir $GCS_JOB_DIR \
--module-name trainer.task \
--package-path trainer/ \
--region us-east1 \
-- \
--train-files $TRAIN_GCS_FILE \
--eval-files $EVAL_GCS_FILE \
--train-steps $TRAIN_STEPS
Run Code Online (Sandbox Code Playgroud)
,其中$JOB_NAME= census.不幸的是,似乎我不能重新提交作业,除非我改变继续$JOB_NAME成为像census2,然后census3,等每一个新的工作.
以下是我收到的错误:
ERROR: (gcloud.ml-engine.jobs.submit.training) Project [my-project-name]
is the subject of a conflict: Field: job.job_id Error: A job with this
id already exists.
Run Code Online (Sandbox Code Playgroud)
这部分设计是否无法使用相同的工作名称重新提交,或者我遗漏了什么?
我无法在mac 10.7上使用Eclipse构建和运行我的android项目.我收到的错误是
生成最终存档时出错:无法获取调试签名密钥
更改了〜/ .android目录中的权限但没有成功.
试图生成另一个项目
遵循设置SDK的指南,甚至在我的工作场所的Windows终端的Windows环境中取得了成功.
使用AVD安装软件包并设置SDK位置的位置.
将我的SDK工具添加到我的$ PATH变量中.
当我尝试创建AVD时,我还收到另一个错误
[2011-10-08 13:42:17 - SDK Manager]错误:null
我错过了哪一步?
Chrome开发人员工具具有将用户代理更改为欺骗服务器的功能,使开发人员可以测试其他设备和浏览器的应用程序,而无需在桌面终端上放置Chrome浏览器.我假设Chrome模拟这些其他浏览器而不是虚拟化.Chrome在JavaScript,CSS和其他技术浏览器方面的差异如何符合标准?例如,是否有人进行了全面测试,以确定Internet Explorer 7的Chrome仿真和实际的Internet Explorer 7是否呈现相同的页面,像素为像素?
我想重新创建一个excel函数AVERAGEIF的通用版本.它定义如下:
返回满足给定条件的范围内所有单元格的平均值(算术平均值)
我的问题是我不知道如何定义通用平均函数的类型签名.以下是我所拥有的几乎可行的代码.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsTestApp
{
class Program
{
static void Main(string[] args)
{
var dl = new List<double>() { 10, 10, 0, 0 };
var bl = new List<bool>() { true, true, false, false };
Func<bool, bool> criteria = c => c == true;
Console.Out.WriteLine(AVERAGEIF<double, bool>(dl, bl, criteria));
Console.In.Read();
}
static T1 AVERAGEIF<T1, T2>(List<T1> average_range, List<T2> criteria_range, Func<T2, bool> applyCriteria)
{
var cl1 = new List<Container<T1>>();
foreach (var cl …Run Code Online (Sandbox Code Playgroud) 使用此命令
declare -r PROJECT="beam-test"
declare -r BUCKET="gs://my-beam-test-bucket"
echo
set -v -e
python -m apache_beam.examples.wordcount \
--project $PROJECT \
--job_name $PROJECT-wordcount \
--runner DataflowRunner \
--staging_location $BUCKET/staging \
--temp_location $BUCKET/temp \
--output $BUCKET/output
Run Code Online (Sandbox Code Playgroud)
这会导致此错误:
http_response.request_url, method_config, request)
apitools.base.py.exceptions.HttpError: HttpError accessing <https://dataflow.googleapis.com/v1b3/projects/beam-test/locations/us-central1/jobs?alt=json>: response: <{'status': '403', 'content-length': '284', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'transfer-encoding': 'chunked', 'vary': 'Origin, X-Origin, Referer', 'server': 'ESF', '-content-encoding': 'gzip', 'cache-control': 'private', 'date': 'Fri, 31 Mar 2017 15:52:54 GMT', 'x-frame-options': 'SAMEORIGIN', 'alt-svc': …Run Code Online (Sandbox Code Playgroud)