尝试使用pip安装bcrypt时出现此错误.我在几个地方安装了libffi(Xcode OS X SDK和自制软件),但我不知道如何告诉pip寻找它.有什么建议?
Downloading/unpacking bcrypt==1.0.2 (from -r requirements.txt (line 41))
Running setup.py egg_info for package bcrypt
OS/X: confusion between 'cc' versus 'gcc' (see issue 123)
will not use '__thread' in the C code
c/_cffi_backend.c:14:10: fatal error: 'ffi.h' file not found
#include <ffi.h>
^
1 error generated.
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/Users/cody/virtualenvs/analytics/build/bcrypt/setup.py", line 104, in <module>
"Programming Language :: Python :: 3.3",
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 112, in setup
_setup_distribution = dist = …Run Code Online (Sandbox Code Playgroud) 我有一个称为控制器Dashboard3个操作:Summary,Details,和Status,其中没有一个采取的ID或任何其他参数.我希望URL /Dashboard路由到控制器的Summary操作,但是我无法找出添加路由的正确方法.在,我有以下内容:Dashboard/Dashboard/SummaryGlobal.asax.cs
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new {controller = "Home", action = "Index", id = UrlParameter.Optional} // Parameter defaults
);
routes.MapRoute(
"/Dashboard",
"Dashboard",
new { controller = "Dashboard", action = "Summary" }
);
Run Code Online (Sandbox Code Playgroud)
对于第二部分,我也尝试过:
routes.MapRoute(
"/Dashboard",
"{controller}",
new { controller = "Dashboard", action = "Summary" }
);
Run Code Online (Sandbox Code Playgroud)
和
routes.MapRoute(
"/Dashboard",
"{controller}",
new { action = "Summary" }
);
Run Code Online (Sandbox Code Playgroud)
但是在尝试访问时我总是得到404 /Dashboard …
为什么以下代码编译?我希望它会抱怨foo没有在第二个案例分支中宣布.编译器是否处理声明以使其适用于所有情况?
using System;
namespace Scratch
{
class Scratch
{
public static void Main()
{
var x = 2;
switch (x)
{
case 1:
var foo = "one";
Console.Out.WriteLine(foo);
break;
case 2:
foo = "two"; // is foo in scope here?
Console.Out.WriteLine(foo);
break;
}
}
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个项目依赖于现已弃用的PackageMaker工具来为OS X创建安装程序.我正在努力更新它以使用pkgbuild和productbuild.我正在尝试通过将--resources标志传递给productbuild包含背景图像的目录来向安装程序添加自定义背景.我没有从productbuild命令中得到任何错误,但是当我在Pacifist中打开包时,我根本看不到我的资源.我尝试过引用背景图片distribution.xml,但似乎并没有什么区别.我不知道接下来要尝试调试这个.
我正在使用新的自给自足的PowerShell脚本更新和替换旧的过时的每晚安排的批处理文件.
我遇到麻烦的是网站启动.我能够使用当前的测试代码来获取站点列表并显示它们但是如果它们被停止则无法找到正确启动它们的方法.
Set-ExecutionPolicy Unrestricted
start-transcript -path C:\TESTSTART.TXT
#function to get list of websites that are currently stopped
function Get-StoppedSites {
Import-Module WebAdministration
$website = Get-ChildItem IIS:\Sites | where {$_.State -eq 'Stopped'}
write-host "$website is stopped"
}
#function to start the stopped website
function StartSites {
param(
$websitename
)
start-website $websitename
write-host "$website was started"
}
$Script = Get-StoppedSites
$Script | ForEach-Object{StartSites -websitename $website}
stop-transcript
Run Code Online (Sandbox Code Playgroud)
当我从powershell调用它时,它的行为就像它完成没有错误,但网站没有启动,我已经停止.Windows 2008 R2服务器,PS 2.0.一旦它准备推出,我将在2003服务器上运行它.
这是我的成绩单:
Transcript started, output file is C:\TESTSTART.TXT
is stopped
Start-Website : Cannot …Run Code Online (Sandbox Code Playgroud) c# ×2
macos ×2
asp.net-mvc ×1
bcrypt ×1
function ×1
iis ×1
installer ×1
libffi ×1
packagemaker ×1
pip ×1
powershell ×1
productbuild ×1
python ×1
routes ×1
web ×1