小编Dan*_*ien的帖子

将自定义安装目录选项添加到Autoconf生成的配置脚本

configure 脚本在帮助消息中始终包含以下内容:

...
By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files …

automake autoconf install configure make-install

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

gdb:tstart错误的含义"当你的目标是'exec'时你不能这样做"

我希望t每次程序到达某一行时记录局部变量的值.因此,我试过:

(gdb) trace stoer_wagner_min_cut.hpp :197
Tracepoint 1 at 0x4123a0: file ./boost/graph/stoer_wagner_min_cut.hpp, line 197.
(gdb) actions
Enter actions for tracepoint 1, one per line.
End with a line saying just "end".
> collect t
> end
(gdb) tstart
You can't do that when your target is `exec'
(gdb) break main
Breakpoint 2 at 0x401448: file time_stoer_wagner.cpp, line 50.
(gdb) run
Starting program: C:\Users\Daniel\Documents\projects\stoer_wagner_min_cut/time_stoer_wagner.exe
[New Thread 3908.0x39c]

Breakpoint 2, main () at time_stoer_wagner.cpp:50
50        std::ifstream ifs("prgen_500_50_2.txt");
(gdb) tstart
You can't do that …

c++ debugging trace gdb

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

Mono 与 SQL Server 会员资格提供程序?

显然,Mono 用 sqlite 成员资格提供程序替换了对 SQL Server 成员资格提供程序的引用(请参阅ASP.NET_Settings_Mapping)。有什么方法可以说服 Mono 使用 SQL Server 作为会员资格提供者吗?

当我尝试登录我的网络应用程序时,我收到以下信息:

System.Configuration.Provider.ProviderException: Operation aborted due to an exception (see Trace for details).
at System.Web.Security.SqliteMembershipProvider.ValidateUser (string,string) <0x003bb>
at DirectMail.Controllers.AccountMembershipService.ValidateUser (string,string) [0x00000] in [file].cs:404
at DirectMail.Controllers.AccountController.ValidateLogOn (string,string) [0x00040] in [file].cs:346
at DirectMail.Controllers.AccountController.LogOn (string,string,bool,string) [0x00000] in [file].cs:79
at (wrapper dynamic-method) System.Runtime.CompilerServices.ExecutionScope.lambda_method (System.Runtime.CompilerServices.ExecutionScope,System.Web.Mvc.ControllerBase,object[]) <0x001c1>
at System.Web.Mvc.ActionMethodDispatcher.Execute (System.Web.Mvc.ControllerBase,object[]) <0x00028>
at System.Web.Mvc.ReflectedActionDescriptor.Execute (System.Web.Mvc.ControllerContext,System.Collections.Generic.IDictionary`2<string, object>) <0x0015b>
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod (System.Web.Mvc.ControllerContext,System.Web.Mvc.ActionDescriptor,System.Collections.Generic.IDictionary`2<string, object>) <0x00036>
at System.Web.Mvc.ControllerActionInvoker/<InvokeActionMethodWithFilters>c__AnonStoreyB.<>m__E () <0x00092>
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter (System.Web.Mvc.IActionFilter,System.Web.Mvc.ActionExecutingContext,System.Func`1<System.Web.Mvc.ActionExecutedContext>) <0x00125>
Run Code Online (Sandbox Code Playgroud)

一台 Debian Linux 机器上的文件顶部 …

asp.net mono asp.net-membership

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

类UriMatcher的匹配(Uri)是否可以重入?

我已经看到了如何使这些例子ContentProvider都使用UriMatcher#match(Uri)的方法中insert,query,update,和delete方法来轻松处理所有的URI模式的内容提供商响应(如:http://developer.android.com/ resources/samples/NotePad/src/com/example/android/notepad/NotePadProvider.html).这似乎还好我直到今天,当我注意到的ContentProvider是API文档insert,query,update,和delete"可以[全部]从多个线程调用".此外,UriMatcher文档没有说明线程安全性或是否match是可重入的.

我是否需要担心同步调用match上的共享,static实例UriMatcher是我的实现内使用insert,query,update,和delete

android thread-safety reentrancy android-contentprovider

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

PHP帐户激活问题

我为我的网站写了一个登录系统.当用户注册时,系统通过电子邮件将激活链接发送到用户提供的电子邮件地址.该链接包含两个参数,电子邮件和密钥.email参数具有用户的电子邮件地址,密钥参数具有注册码,以便可以验证注册并从挂起更改为已确认.激活页面应该从"电子邮件"列中设置了电子邮件参数的行中获取"状态"列.出于某种原因,脚本确定任何链接有效,并尝试更新帐户的状态是否存在.

这是我的代码:

<?php

$email = $_GET['email'];
if($email == "") {
  header("Location: http://www.zbrowntechnology.info/yard/register.php?message=Invalid Activation Link!");
  exit;
}
$key = $_GET['key'];
if($key == "") {
  header("Location: http://www.zbrowntechnology.info/yard/register.php?message=Invalid Activation Link!");
  exit;
}

$con = mysql_connect("HOST", "USER", "PASS") or die(mysql_error());
mysql_select_db("zach_yardad", $con) or die(mysql_error());
$query1 = "SELECT `Status` FROM Accounts WHERE `Email`='".mysql_real_escape_string($email)."' AND `Status`='".mysql_real_escape_string($key)."'";
$result1 = mysql_query($query1) or die(mysql_error());
if(mysql_num_rows($result1) <= 0) {
  header("Location: http://www.zbrowntechnology.info/yard/register.php?message=Invalid Activation Link!");
 exit;
} else {
  $query = "UPDATE Accounts SET `Status`='Confirmed' WHERE `Email`='$email'";
  mysql_query($query) or die(mysql_error());
  header("Location: http://www.zbrowntechnology.info/yard/login.php?message=Registration …
Run Code Online (Sandbox Code Playgroud)

php mysql logic activation login-system

5
推荐指数
0
解决办法
962
查看次数

用<< istream上的<<读取固定数量的字符

我在C++中尝试了一些文件阅读策略,但我遇到了这个问题.

ifstream ifsw1("c:\\trys\\str3.txt");
char ifsw1w[3];
do {
    ifsw1 >> ifsw1w;
    if (ifsw1.eof())
        break;
    cout << ifsw1w << flush << endl;
} while (1);
ifsw1.close();
Run Code Online (Sandbox Code Playgroud)

文件的内容是

firstfirst firstsecond
secondfirst secondsecond

当我看到输出时,它被打印为

 firstfirst
firstsecond
secondfirst

我期望输出类似于:

fir
stf
irs
tfi
.....

而且我看到"第二秒"还没有打印出来.我猜最后一次读取已经满足了eof并且可能没有执行cout.但第一种行为是不可理解的.

c++ iostream ifstream filereader

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

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

Javascript不上传二进制数据

我的javascript函数只能正确上传文本文件.任何人都可以帮我弄清楚如何使它也接受图像等?

function fileUpload(files) {
  if (!files.length) {  
   fileList.innerHTML = "<p>No files selected!</p>";  
  } else {    
var list = document.createElement("ul");

for (var i = 0; i < files.length; i++) {

  //Set vars
  var file = files[i],
  fileName = file.name,
  fileSize = file.size,  
  fileData = file.getAsBinary(),  
  boundary = "xxxxxxxxx",  
  uri = "receive.php",

  //Create file info HTML output
  li = document.createElement("li");  
  list.appendChild(li);
  var info = document.createElement("span");  
  info.innerHTML = file.name + ": " + file.size + " bytes";  
  li.appendChild(info);

  //Start sending file
  var xhr …
Run Code Online (Sandbox Code Playgroud)

javascript xmlhttprequest

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

是否可以根据模板类型参数的嵌套typedef的存在来专门化模板定义?

我有一个模板,template <typename T> class wrapper我想根据它的存在专门化typename T::context_type.如果typename T::context_type声明了,那么wrapper<T>实例化的构造函数和赋值运算符重载应该接受一个必需typename T::context_type参数.另外,wrapper<T>对象将在成员数据中存储"上下文".如果typename T::context_type不存在,则构造函数和赋值运算符重载wrapper<T>将减少一个参数,并且不会有其他数据成员.

这可能吗?我可以得到下面的代码不改变的定义编译config1,config2main()

#include <iostream>

template <typename T, bool context_type_defined = true>
class wrapper
{
public:
    typedef typename T::context_type context_type;

private:
    context_type ctx;

public:
    wrapper(context_type ctx_)
        : ctx(ctx_)
    {
        std::cout << "T::context_type exists." << std::endl;
    }
};

template <typename T>
class wrapper<T, false>
{
public:
    wrapper() {
        std::cout << "T::context_type does …
Run Code Online (Sandbox Code Playgroud)

c++ templates sfinae template-specialization

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

是否可以限制全选/Ctrl + A的范围?

我正在一个网站上工作,我希望能够显示一个包含语法突出显示的源代码的框供用户复制。当我单击该框并为其设置焦点(Chrome 显示其焦点轮廓)并键入 时Ctrl+A,将选择整个页面的文本,而我只想选择框中的语法突出显示的源代码。

是否可以将 select all/ 的范围限制Ctrl+A为仅框内的文本,最好不使用 <iframe>?

我的第一个想法是尝试contenteditable。当我在框中单击并出现编辑器插入符号时,键入Ctrl+A仅根据需要选择框中的文本,但它也允许用户更改代码,我认为制作框的编辑器界面方面contenteditable将是让用户感到困惑。如果我将源代码文本包含在 <div>contenteditable="false"内的 <div> 内contenteditable="true",则源代码文本是只读的,但键入会Ctrl+A再次选择整个页面的文本。

这是一个测试页面:http : //jsfiddle.net/5crgL/

html javascript selection contenteditable

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