我只想考虑Erlang对游戏服务器的可能性.(哦,我不是Erlang专家,只考虑阶段)这意味着使用Actor模型进行游戏模拟.当然,最吸引人的是它在多个节点上分布的并发性.
我目前的一个大问题是我应该如何执行碰撞检测等多角色交互.(这只是一个例子)
虽然碰撞检测在任何游戏中都是必需的,但是在Actor模型的本质中,它看起来效率不高甚至没有意义,因为它需要全局同步的状态查询和更新所有目标actor.如果我使用任何同步,它将覆盖Erlang的actor模型的所有好处.
当然,如果我正确地使用空间分区,那么一次定位演员可以更小,但这只是一个优化,而不是一个主要的答案.或者这是这个问题的正确答案吗?通过减少交互演员的数量来减少同步范围?
我想想象我的数据和ANOVA统计数据.通常使用带有添加线条的条形图来指示显着的差异和相互作用.你怎么用R做这样的情节?
这就是我想要的:


我目前正在使用barplot2{ggplots}绘制条形图和置信区间,但我愿意使用任何包/程序来完成工作.为了得到我目前使用的统计数据TukeyHSD{stats}或pairwise.t.test{stats}对差异和方差分析功能(一个aov,ezANOVA{ez},gls{nlme})的相互作用.
只是为了给你一个想法,这是我目前的情节:

如何自定义传单地图以禁用移动设备上的单指滚动并添加两个手指滚动,如谷歌地图(请参阅https://developers.google.com/maps/documentation/javascript/interaction)
我觉得像手指上的听众,手指向上和自定义叠加或某事.这样应该有所帮助.但是如何正确地将其整合为传单中的插件?
<html>
<head>
<link href="https://unpkg.com/leaflet@1.0.2/dist/leaflet.css" rel="stylesheet"/>
<script src="https://unpkg.com/leaflet@1.0.2/dist/leaflet.js"></script>
</head>
<body>
<div id="mapid" style="width: 600px; height: 400px;"></div>
<script>
var mymap = L.map('mapid', {center: [48,9], zoom:8, layers: [L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png')]});
</script>
</body>
</html>Run Code Online (Sandbox Code Playgroud)
我正在使用raw_input()以交互模式从用户接收密码,但出于安全原因,我想使输入符号不可见,就像您使用sudo键入密码或连接到数据库时一样.我应该怎么做?
是否有可能在unix shell脚本中使用haskell函数?
例如:
#!/bin/bash
...
var1=value
...
# use haskell function with input from shell variable var1
# and store the result into another shell variable var2
var2=haskellFunction $var1
...
Run Code Online (Sandbox Code Playgroud)
我想在shell脚本中使用变量作为haskell函数的参数和结果
提前致谢.
吉米
仅限iPad:UIDocumentInteractionController presentPreviewAnimated未被推入导航堆栈,即使从documentInteractionControllerViewControllerForPreview返回导航控制器时也只显示模态
大家好
我想知道是否有人可以在这里帮助我,我相信这可能是一个只与iPad有关的错误(它可以在iPhone上运行),但在我提交之前需要确认.
为了让UIDocumentInteractionController在导航控制器中工作,我按照推荐的方法返回导航控制器表单documentInteractionControllerViewControllerForPreview,但它不起作用.
我甚至尝试将Apple提供的UIDocumentInteractionController代码示例升级到iPad,果然,即使我从documentInteractionControllerViewControllerForPreview返回导航控制器,文档交互控制器也会以模态显示.但是对于iPhone来说,它确实会被推入导航堆栈.
我试图设计一个基于splitviewcontroller的应用程序,使用文档交互控制器读取PDF文件,这样PDF将显示在DetailViewController中,但这仅适用于QLPreviewController(不是Doc交互控制器).
有没有人有这个问题?我把下面的示例代码放在我看到的图像中:
我正在使用iOS 6.0 SDK.
static NSString* documents2[] =
{
@"PDF Document.pdf"
};
@implementation WhizTBViewController
@synthesize documentURLs, docInteractionController;
#pragma mark -
#pragma mark View Controller
- (void)setupDocumentControllerWithURL:(NSURL *)url
{
if (self.docInteractionController == nil)
{
self.docInteractionController = [UIDocumentInteractionController interactionControllerWithURL:url];
self.docInteractionController.delegate = self;
}
else
{
self.docInteractionController.URL = url;
}
}
- (void)previewDocument {
// three ways to present a preview:
// 1. Don't implement this method and simply attach the canned gestureRecognizers to the cell …Run Code Online (Sandbox Code Playgroud) 我有以下类型的数据(虽然数据点的数量非常大)
# property data
name <- c("A", "B", "C", "D")
diameter <- c(4.3, 8.3,1.2, 3.3)
X <- c( 1, 2, 3, 4)
Y <- c(1, 3, 3, 4)
colr <- c(10, 20, 34, 12)
propdata <- data.frame (name, diameter, X, Y, colr)
# interaction data
name1 <- c("A", "A", "A", "B", "B")
name2 <- c("B", "C", "D", "C", "D")
score <- c(1.1, 2.2, 5.4, 3.1, 2.0)
relation <- data.frame (name1, name2, score)
Run Code Online (Sandbox Code Playgroud)
我想创建一个类似于以下的图形,以便它具有以下属性.
(
1) diameter of circles is governed …Run Code Online (Sandbox Code Playgroud) 这是一个data.table:
dat = data.table(var1=rnorm(120), var2=rep(c('a','b','c'),40), var3=rep(c(1,2,3,2,1,2,1,2,2,3,1,2),10))
dat2 = dat[,list(resp = mean(var1)),by=list(var2, var3)]
Run Code Online (Sandbox Code Playgroud)
在dat2,仅存在dat$var2et的现有相互作用dat$var3.我怎么能强迫dat2包含所有9个可能的交互(而不是7行的结果dat2为)var2和var3?如果没有data.table的直接解决方案,解决此问题的最简单方法是什么?
table(dat$var2, dat$var3)
1 2 3
a 20 10 10
b 20 20 0
c 0 30 10
Run Code Online (Sandbox Code Playgroud)
当然,对于不存在数据的交互dat,dat2应该在resp中包含NA.
有几篇关于相同的帖子,但我仍然无法使我的期望脚本正常工作。我的目的是自动化一切,但为用户输入密码。所以脚本有3个部分:
所以我有脚本,它将产生并且有 3 个读取命令。第一个和最后一个应该由 Expect 填充,第二个我想输入我自己:
#!/bin/ksh
read user?User:
echo "Expect entered the username $user"
read pass?Password:
echo "User entered the password $pass"
read command?"Shell>"
echo "Expect entered the command $command"
Run Code Online (Sandbox Code Playgroud)
我的期望脚本:
#!/usr/bin/expect
spawn ./some_script
expect User
send I-am-expect\r
expect Password
interact
expect Shell
send I-am-expect-again
Run Code Online (Sandbox Code Playgroud)
不幸的是,在我输入密码后,脚本不会继续并保持交互模式:
[root@localhost ~]# ./my-expect
spawn ./some_script
User:I-am-expect
Expect entered the username I-am-expect
Password:i am user
User entered the password i am user
Shell>
Run Code Online (Sandbox Code Playgroud)
最后,当我在“Shell”上输入内容并按 [ENTER] 时,期望退出并显示错误:
Expect entered the …Run Code Online (Sandbox Code Playgroud) 我在使用 statsmodels 的 get_margeff 命令处理具有交互项的 logit 模型时遇到问题。虽然在主效应模型中,效应被正确计算并对应于 Stata 和 R 结果,但当涉及交互项时情况并非如此。这里的效果是错误的,并且还报告了交互项的边际效果,这是没有意义的。以下代码说明了这一点:
import pandas as pd
import statsmodels.formula.api as sm
import statsmodels.api as sm2
df=sm2.datasets.heart.load_pandas().data
regression = sm.logit(formula='censors~survival+age', data=df).fit()
#only for illustration purposes; does not make real sense
print(regression.get_margeff().summary())
# the calculation of marginal effects here is corrects and corresponds to Stata and R results
Run Code Online (Sandbox Code Playgroud)
dy/dx std err z P>|z| [0.025 0.975]
------------------------------------------------------------------------------
survival -0.0004 7.95e-05 -4.672 0.000 -0.001 -0.000
age 0.0148 0.005 3.262 0.001 0.006 0.024
==============================================================================
Run Code Online (Sandbox Code Playgroud)
regression = sm.logit(formula='censors~survival+age+survival*age', …Run Code Online (Sandbox Code Playgroud) interaction ×10
r ×3
python ×2
actor-model ×1
combinations ×1
console ×1
controller ×1
data.table ×1
document ×1
erlang ×1
expect ×1
ggplot2 ×1
graph ×1
haskell ×1
input ×1
ios6 ×1
lattice ×1
leaflet ×1
linux ×1
login ×1
maps ×1
passwords ×1
plot ×1
scripting ×1
shell ×1
significance ×1
statsmodels ×1
touch ×1
unix ×1