问题列表 - 第25443页

Mercurial自动部署

我正在寻找一种方法来简化我们的一个php Web应用程序的部署(如果它可以工作,我将把它推出到其他应用程序).

我非常喜欢这个:http://www.springloops.com/,但它是SVN,我们正在使用mercurial.

不幸的是我们没有shell访问我们当前的服务器,所以如果有人有任何想法,那么在ftp上运行的东西最好吗?

deployment mercurial automation

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

Valgrind说"堆栈分配",我说"堆分配"

我试图跟踪valgrind的段错误.我从valgrind得到以下消息:

==3683== Conditional jump or move depends on uninitialised value(s)
==3683==    at 0x4C277C5: sparse_mat_mat_kron (sparse.c:165)
==3683==    by 0x4C2706E: rec_mating (rec.c:176)
==3683==    by 0x401C1C: age_dep_iterate (age_dep.c:287)
==3683==    by 0x4014CB: main (age_dep.c:92)
==3683==  Uninitialised value was created by a stack allocation
==3683==    at 0x401848: age_dep_init_params (age_dep.c:131)
==3683== 
==3683== Conditional jump or move depends on uninitialised value(s)
==3683==    at 0x4C277C7: sparse_mat_mat_kron (sparse.c:165)
==3683==    by 0x4C2706E: rec_mating (rec.c:176)
==3683==    by 0x401C1C: age_dep_iterate (age_dep.c:287)
==3683==    by 0x4014CB: main (age_dep.c:92)
==3683==  Uninitialised value was created by …
Run Code Online (Sandbox Code Playgroud)

c malloc valgrind calloc

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

Gravatar:有默认图片吗?

我已经为我正在构建的门户网站实现了gravatar,并想知道是否有gravatar的默认图片网址?并非所有访问该网站的人都已登录或拥有电子邮件地址,在这种情况下,是否有可以显示的默认图像(可通过gravatar url访问)

default gravatar image

28
推荐指数
3
解决办法
2万
查看次数

使用RubyInstaller 1.9.1 RC2后在Windows上启动mongrel时出错

我通过可从RubyInstaller 1.9.1 RC2安装了Ruby RubyForge的,更新的宝石,并安装导轨.使用webrick,一切都运行良好.为了好玩,我使用"gem install mongrel"安装了mongrel.装置很顺利:

Successfully installed gem_plugin-0.2.3
Successfully installed cgi_multipart_eof_fix-2.5.0
Successfully installed mongrel-1.1.5-x86-mingw32
3 gems installed
Installing ri documentation for gem_plugin-0.2.3...
Installing ri documentation for cgi_multipart_eof_fix-2.5.0...
Installing ri documentation for mongrel-1.1.5-x86-mingw32...
Updating class cache with 1162 classes...
Installing RDoc documentation for gem_plugin-0.2.3...
Installing RDoc documentation for cgi_multipart_eof_fix-2.5.0...
Installing RDoc documentation for mongrel-1.1.5-x86-mingw32...
Run Code Online (Sandbox Code Playgroud)

现在,当我使用"ruby脚本/服务器"启动Web服务器时,我收到错误:

"程序无法启动,因为您的计算机缺少msvcrt-ruby18.dll."

然后,webrick启动并正常运行.

我猜测它是使用Rails 1.9的问题而mongrel期望1.8?(我是铁杆新手,没有真正的理由让我使用杂种......只是戳了一下)

windows mongrel ruby-on-rails

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

C#相当于VB.NET的DirectCast?

C#是否与VB.NET的DirectCast等效?

我知道它有()强制转换和'as'关键字,但那些符合CType和TryCast.

需要说明的是,这些关键字执行以下操作:

CType /()强制转换:如果它已经是正确的类型,则强制转换它,否则查找类型转换器并调用它.如果未找到类型转换器,则抛出InvalidCastException.

TryCast /"as"关键字:如果是正确的类型,则抛出它,否则返回null.

DirectCast:如果它是正确的类型,则抛出它,否则抛出InvalidCastException.

在我详细说明之后,有些人仍然回答说()是等价的,所以我会进一步扩展为什么这不是真的.

DirectCast仅允许在继承树上缩小或扩展转换.它不支持像()那样跨不同分支的转换,即:

C# - 这个编译并运行:

//This code uses a type converter to go across an inheritance tree
double d = 10;
int i = (int)d;
Run Code Online (Sandbox Code Playgroud)

VB.NET - 这不是编译

'Direct cast can only go up or down a branch, never across to a different one.
Dim d As Double = 10
Dim i As Integer = DirectCast(d, Integer)
Run Code Online (Sandbox Code Playgroud)

VB.NET与我的C#代码的等价物是CType:

'This compiles and runs
Dim d As Double = …
Run Code Online (Sandbox Code Playgroud)

c# vb.net casting ctype directcast

49
推荐指数
2
解决办法
4万
查看次数

在C#TimeSpan Class内循环一周的日子

我试图在两个时间段之间循环通过WEEK的每一天

  DateTime start = new DateTime(2010, 1, 1);
  DateTime end = new DateTime(2011, 12, 12);
Run Code Online (Sandbox Code Playgroud)

我已设法使用以下代码获取这些日期之间的天数

     TimeSpan range = (end - start);
Run Code Online (Sandbox Code Playgroud)

结果是710.

我现在希望每个月能够获得本周的活动,

例如

1月1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 18 19 20...

与匹配

MTWTFSSMTWTFSSM

我知道c#有一个来自DateTime类DayOfWeek的属性,它获取了一周中的一天我的问题是构建一个循环来执行上述操作?

任何人?

c# datetime loops timespan dayofweek

10
推荐指数
1
解决办法
1万
查看次数

如何从rake任务启动IRB控制台?

我正在尝试编写一个rake任务,它将设置一个镜像我的项目的环境.

task :environment do 
  require 'rubygems'
  require 'sequel'
  # require 'my_projects_special_files'
end

task :foo => [:environment] do
  require 'irb'
  IRB.start
end
Run Code Online (Sandbox Code Playgroud)

导致irb抱怨"foo"不存在(任务的名称)

10:28:01:irb_test >> rake foo --trace
(in /Users/mwlang/projects/personal/rake/irb_test)
** Invoke foo (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute foo
rake aborted!
No such file or directory - foo
/opt/local/lib/ruby/1.8/irb/input-method.rb:68:in `initialize'
/opt/local/lib/ruby/1.8/irb/input-method.rb:68:in `open'
/opt/local/lib/ruby/1.8/irb/input-method.rb:68:in `initialize'
/opt/local/lib/ruby/1.8/irb/context.rb:80:in `new'
/opt/local/lib/ruby/1.8/irb/context.rb:80:in `initialize'
/opt/local/lib/ruby/1.8/irb.rb:92:in `new'
/opt/local/lib/ruby/1.8/irb.rb:92:in `initialize'
/opt/local/lib/ruby/1.8/irb.rb:57:in `new'
/opt/local/lib/ruby/1.8/irb.rb:57:in `start'
/Users/mwlang/projects/personal/rake/irb_test/Rakefile:9

ruby rake irb

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

34
推荐指数
4
解决办法
1万
查看次数

如何删除以前版本的Xcode

当iPhone OS的3.2 beta首次出现时,Xcode for 3.2必须与3.1.2的版本并排安装.我在/ Developer中安装了新版本(3.2)并将3.1.2移动到/Xcode3.1.2.现在我想摆脱旧版本,只使用新版本,因为我们现在可以做到这一点.

我在/Xcode3.1.2/Library/uninstall-devtools和uninstall-developer-folder上运行了卸载工具,但该目录仍然存在并且还有很多东西,最多可添加5 GB.在这一点上,我是否安全删除文件夹,如果我想完全摆脱它仍然使用/ Developer文件夹?

(大约8 GB,它有更多的内容,但我不确定这是因为它更大还是因为旧的版本是8 GB我运行卸载工具之前)?

iphone xcode

13
推荐指数
2
解决办法
1万
查看次数

如何将变量传递给jQuery超时

我今天正在努力奋斗.

我需要将一个变量,甚至更好的对象传递给timeOut(例如):

$('.x').each(function() 
{
  setTimeout(function()
  {
    alert ($(this).attr('id'))
  },10000);
});
Run Code Online (Sandbox Code Playgroud)

显然,会发生的事情是timeOut没有引用原始文件 $(this)

救命 ?

jquery

2
推荐指数
1
解决办法
309
查看次数