小编Mar*_*ark的帖子

为什么SBT找不到Play 2.1插件?

在我的plugins.sbt档案中,我有

scalaVersion := "2.10.0"

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("play" % "sbt-plugin" % "2.1")  
Run Code Online (Sandbox Code Playgroud)

当我尝试跑步时sbt,除其他外,我得到了

[warn] ==== Typesafe repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/play/sbt-plugin_2.10_0.12/2.1/sbt-        plugin-2.1.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/play/sbt-plugin_2.10_0.12/2.1/sbt-plugin-2.1.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: play#sbt-plugin;2.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these         dependencies exist with the requested attributes.
[warn]          play:sbt-plugin:2.1 (sbtVersion=0.12, scalaVersion=2.10)
[warn]
sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.1: not found
Run Code Online (Sandbox Code Playgroud)

为什么SBT找不到这个插件?我也尝试 …

sbt playframework-2.1

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

在Play 2.1中,使用什么而不是弃用的PushEnumerator

PushEnumerator在Play framework 2.1-RC中被弃用.该文档告诉我使用Concurrent.broadcast.但是,我推送的数据依赖于用户,因此我无法向每个用户广播相同的数据.

换句话说,Concurrent.broadcast将为我提供一个连接到许多迭代器的枚举器,而我需要许多连接到许多迭代器的枚举器.

scala playframework-2.1

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

当从另一个域重定向时,Django会话被丢弃

当用户访问我的域时,django会发出一个sessionid.当他试图用Facebook做Oauth时,他点击我网站上的一个按钮,重定向到Facebook.com.Facebook重定向回我的域,但此时,用户的会话丢失,Django似乎正在发布一个新的会话变量.

我希望已删除的会话持续存在,因为我必须将访问者与我的网站关联到他的Facebook帐户,但是当会话被删除时,登录的用户将被注销.

我怀疑这可能是与django的XSS保护有关的行为.当用户离开我们的网站登录Facebook时,如何使用户信息持续存在?

django oauth

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

Tastypie迁移错误

我正在尝试为Django安装tastypie.我也安装了South.但是当我迁移时,我得到一些奇怪的类型错误.

./manage.py migrate tastypie
Running migrations for tastypie:
 - Migrating forwards to 0002_add_apikey_index.
 > tastypie:0001_initial
TypeError: type() argument 1 must be string, not unicode
Run Code Online (Sandbox Code Playgroud)

我查看了迁移0002,甚至没有调用类型!

python tastypie

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

dlmalloc如何合并大块?

以下是dlmalloc算法的详细说明:http://g.oswego.edu/dl/html/malloc.html

dlmalloc块由一些元数据预订,其中包含有关块中空间量的信息.两个连续的免费块可能看起来像

[metadata | X bytes free space | metadata ][metadata | X bytes free space | metadata]
                Block A                                     Block B
Run Code Online (Sandbox Code Playgroud)

在这种情况下,我们希望将块B合并到块A中.现在有多少字节的可用空间应该阻止A报告?

我认为它应该是2X + 2 size(metadata) bytes,因为现在合并的块看起来像:

[metadata | X bytes free space   metadata  metadata   X bytes free space  | metadata]
Run Code Online (Sandbox Code Playgroud)

但我想知道这是否正确,因为我有一本教科书说元数据将报告,2X bytes 而不包括我们从能够写入元数据的额外空间.

unix malloc memory-management

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

是否可以使用Coq编写C程序?

我知道可以将Coq程序提取到Haskell和OCaml程序中.有没有办法用C做到这一点?

我想象的是一个模拟C语言的库.也许这样的库将包含关于C构造如何与过程存储器相互作用的公理集合,以及关于IEEE浮点数的公理和定理.然后,它将能够在Coq中构建一个C程序以及有关该程序的定理.

比方说,我会使用这样一个库来构建一个C快速排序算法,该算法适用于可由GCC编译的浮点数组.

coq coq-extraction

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

Defining recursive function over product type

I'm trying to formalize each integer as an equivalence class of pairs of natural numbers, where the first component is the positive part, and the second component is the negative part.

Definition integer : Type := prod nat nat.

I want to define a normalization function where positives and negatives cancel as much as possible.

Fixpoint normalize (i : integer) : integer :=
let (a, b) := i in
match a with
| 0 => (0, b)
| S a' …
Run Code Online (Sandbox Code Playgroud)

termination coq totality

6
推荐指数
3
解决办法
108
查看次数

迭代值时,为什么当value是数字时,typeof(value)会返回"string"?使用Javascript

我正在使用Google Chrome进行此测试:与直觉相反,第一个循环警告"字符串"3次,而第二个循环警告"数字"3次.

numarray = [1, 2, 3];

//for-each loop
for(num in numarray) 
    alert(typeof(num));

//standard loop
for(i=0; i<numarray.length; i++) 
    alert(typeof(numarray[i]));
Run Code Online (Sandbox Code Playgroud)

我期待两个循环警告"数字"3次.如何在Javascript中实现第一个循环?换句话说,如果for-each是语法糖,使用标准循环的等价物是什么?

另外,有没有办法使用标准循环迭代对象的命名空间?我希望使用第二种循环来触摸某些对象的方法和属性中的每一个.我是Javascript的新手,非常感谢任何帮助,谢谢.

javascript foreach typeof

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

为什么Qhull在计算几个点的凸包时会出错?

我正在尝试计算 10 维空间中 9 个点的凸包。通过 scipy 接口,我正在调用scipy.spatial.ConvexHull(points)并获取QH6214 qhull input error: not enough points(9) to construct initial simplex (need 12)

我认为无论维度如何,凸包的定义都是明确的。这里发生了什么?我可以调用其他函数来解决这个问题吗?

scipy qhull

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

在Coq证明中椭圆是什么意思?

以下是此在线课程https://softwarefoundations.cis.upenn.edu/plf-current/StlcProp.html#lab222中出现的证明.

Proof with eauto.
  remember (@empty ty) as Gamma.
  intros t t' T HT. generalize dependent t'.
  induction HT;
       intros t' HE; subst Gamma; subst;
       try solve [inversion HE; subst; auto].
  - (* T_App *)
    inversion HE; subst...
    (* Most of the cases are immediate by induction,
       and [eauto] takes care of them *)
    + (* ST_AppAbs *)
      apply substitution_preserves_typing with T11...
      inversion HT1...
Qed.
Run Code Online (Sandbox Code Playgroud)

椭圆在这一行中做了什么? apply substitution_preserves_typing with T11...

coq

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