我正在根据客户端浏览器生成的UUID制作验证器,我用它来识别用户发送的某种类型的数据; 并且想要验证该UUID客户端发送它实际上是有效的版本4 UUID.
我发现这个PHP preg_match UUID v4,它很接近,但不完全是我正在寻找的.我想知道是否存在类似于is_empty()或strtodate()如果字符串无效的地方发送FALSE.
我可以根据正则表达式做,但我想要更原生的东西来测试它.
有任何想法吗?
我正在制作一个在终端上运行的程序(需要一些参数).
现在我想从Sublime Text运行这个相同的程序,但我不知道如何在Sublime Text中执行程序之前将参数传递给构建.
我需要启用任何选项来指定参数吗?
使用Sublime Text 3 build 3035
我最近使用SSH密钥和其他所有东西在Cygwin环境中安装了Gitolite.
我成功安装了Gitolite,并且可以访问gitolite-admin存储库,配置并放置新密钥.当我发送commit和push编辑时,一切都很好,直到我注意到我无法gitolite-admin再次访问新的存储库或存储库...
然后我通过ssh进入我的服务器并注意到gitolite删除了所有公钥,authorized_keys除了我使用SSH配置的默认SSH密钥.
我检查了钩子是否正在传播并且一切看起来都很好 - Gitolite创建了新的存储库并编译了新的存储库 gitolite.conf
我不知道我错过了什么 - 有些不对劲但我不知道它是什么.
我看到的最后一个是文件~/.gitolite/src/sshkeys-lint管理authorized_keys文件,但我不太了解shell脚本语言.
嗨StackOverflow社区,我正在建立一个基于twitter bootstrap 2.0.4的网站在某个页面我想要一个按钮附加到输入.问题是在输入和按钮之间显示边距.
我确定这是我缺少的东西,但我无法确定它是什么?
编辑:某些样式,如禁用和不可编辑的输入在页面中未正确应用
编辑2:显然工作.disabled和.uneditable-input.
JFiddle:http://jsfiddle.net/sHGtb/
JFiddle全屏结果:http://jsfiddle.net/sHGtb/embedded/result/
任何帮助?
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="http://localhost/test/index.php/../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="http://localhost/test/index.php/../css/bootstrap-responsive.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
<script src="../../js/html5shiv.js"></script>
<![endif]-->
<script type="text/javascript" src="http://localhost/test/index.php/../js/modernizr.js"></script>
</head>
<body>
<div class="container">
<form class="form-horizontal">
<fieldset>
<hr/>
<h4>Puesto</h4>
<p>Debe estar asignado segun su perfil, solo los administradores pueden cambiar esta opcion; si existiese alguna irregularidad debe solicitar reportelo al administardor.</p>
<div …Run Code Online (Sandbox Code Playgroud) 将我的MVC应用程序的新版本发布到我们的开发Web服务器后,我收到以下错误(删除了帐户名称编辑):
Event code: 3005
Account name: xxx\xxxxxxxx
Exception type: SqlException
Exception message: The target principal name is incorrect. Cannot generate SSPI context. at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
Run Code Online (Sandbox Code Playgroud)
导致异常的原因是什么?
我正在.net framework 4.5上创建一个应用程序
每当我想加载应用程序配置值(appSettings部分)并写入更改时,如果我刷新该部分,我看不到我的更改.我做错了什么?我该如何解决?
码
private void LoadConfig()
{
NameValueCollection appSettings = ConfigurationManager.AppSettings;
for (int i = 0; i < appSettings.Count; i++)
{
switch (appSettings.GetKey(i))
{
case "initialCatalog":
txtInitialCatalog.Text = appSettings.GetValues(i)[0];
break;
case "dataSource":
txtDatasource.Text = appSettings.GetValues(i)[0];
break;
case "userName":
txtUsername.Text = appSettings.GetValues(i)[0];
break;
case "password":
txtPassword.Text = appSettings.GetValues(i)[0];
break;
case "portalUrl":
txtUrl.Text = appSettings.GetValues(i)[0];
break;
}
}
}
private void SaveConfig()
{
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
KeyValueConfigurationCollection appSettings = config.AppSettings.Settings;
appSettings["initialCatalog"].Value = txtInitialCatalog.Text;
appSettings["dataSource"].Value = txtDatasource.Text;
appSettings["userName"].Value = txtUsername.Text; …Run Code Online (Sandbox Code Playgroud) 在让我列出我尝试过的内容之前:
我在主目录内的子目录中执行 php 代码时遇到问题。在 Nginx 上我得到这个
2016/08/23 09:13:40 [error] 39170#0: *13 FastCGI sent in stderr: "Access to the script
'/Users/user/portal3' has been denied (see security.limit_extensions)" while reading
response header from upstream, client: 127.0.0.1, server: localhost, request:
"GET /portal/v3/index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001", host: "localhost"
Run Code Online (Sandbox Code Playgroud)
在 php-fpm 上这显示
[23-Aug-2016 09:13:40] WARNING: [pool dev] child 8305 said into stderr: "NOTICE: Access to the script '/Users/user/portal3' has been denied (see security.limit_extensions)"
Run Code Online (Sandbox Code Playgroud)
我已经尝试了一切,但在 …
嗨下面是我的ASPClassic代码,其中csvData是一个非常大的字符串,包含variable.Now在此At行中Mid函数调用错误'无效过程调用或参数:Mid'出现为什么会发生这种情况...
Dim dataLen
Dim fromLen
Dim toLen
Dim slab
Dim totalPass
dataLen =len(csvData)
fromLen =0
toLen =100000
slab =100000
totalPass =(dataLen/slab)
if (dataLen Mod slab)>0 then
totalPass=totalPass+1
end if
Dim i
For i = 0 To dataLen
i=toLen
if toLen > dataLen then
toLen=dataLen
end if
Response.Write Mid(csvData,fromLen,toLen)
fromLen=toLen
toLen=toLen+slab
Next
如何在python 3中给定一个特定的二进制数来迭代和计算每个位的值?
例如:
00010011
--------------------
bit position | value
--------------------
[0] false (0)
[1] false (0)
[2] false (0)
[3] true (1)
[4] false (0)
[5] false (0)
[6] true (1)
[7] true (1)
Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个存储过程来获取链接服务器的状态,以防止在尝试执行任何操作时出错.我在网上看到了一些例子,但我没有取得任何成功.
这是我的代码:
ALTER PROCEDURE [dbo].[checkLinkedServer]
@servername ntext
AS
BEGIN
SET NOCOUNT ON;
DECLARE @retval int = 0;
BEGIN TRY
EXEC @retval = sys.sp_testlinkedserver @servername;
SELECT 1;
END TRY
BEGIN CATCH
SELECT 0;
END CATCH;
END
Run Code Online (Sandbox Code Playgroud)
我总是得到0的返回值 - 无论链接服务器是否存在.
我在这里做错了什么想法?
在我写入数据库的方法中,我处理错误,如下面的代码所示.在catch (DbUpdateException ex)我想重新抛出异常并在最后捕获它catch (Exception ex).
这可能吗,怎么做?下面的代码不会这样做.
using (Entities context = new Entities())
{
try
{
context.Office.Add(office);
retVal = context.SaveChanges();
}
catch (DbUpdateException ex)
{
SqlException innerException = ex.GetBaseException() as SqlException;
if (innerException != null && innerException.Number == (int)SQLErrorCode.DUPLICATE_UNIQUE_CONSTRAINT)
{
throw
new Exception("Error ocurred");
}
//This is momenty where exception is thrown.
else
{
throw ex;
}
}
catch (Exception ex)
{
throw
new Exception("Error");
}
}
Run Code Online (Sandbox Code Playgroud) 我试图找到一种方法用另一个字符串替换目录路径中的字符串时遇到错误
sed: Error tryning to read from {directory_path}: It's a directory
Run Code Online (Sandbox Code Playgroud)
shell脚本
#!/bin/sh
R2K_SOURCE="source/"
R2K_PROCESSED="processed/"
R2K_TEMP_DIR=""
echo " Procesando archivos desde $R2K_SOURCE "
for file in $(find $R2K_SOURCE )
do
if [ -d $file ]
then
R2K_TEMP_DIR=$( sed 's/"$R2K_SOURCE"/"$R2K_PROCESSED"/g' $file )
echo "directorio $R2K_TEMP_DIR"
else
# some code executes
:
fi
done
# find $R2K_PROCCESED -type f -size -200c -delete
Run Code Online (Sandbox Code Playgroud)
我理解这条线上的恐怖
R2K_TEMP_DIR=$( sed 's/"$R2K_SOURCE"/"$R2K_PROCESSED"/g' $file )
Run Code Online (Sandbox Code Playgroud)
但我不知道如何告诉sh将$ file变量视为字符串而不是目录对象.