问题列表 - 第31007页

XCode 构建目录的 Git 忽略模式

我是 Git 新手,这是我第一个使用 Git 而不是 SVN 作为源代码管理的项目。我正在使用 XCode 开发 iPhone 项目。我希望 Git 忽略构建目录,该目录位于 XCode 项目的根文件夹中。我在这里发现了其他几个问题,还在 google 上找到了文章,其中提供了有关如何在根目录中创建 .gitignore 文件,然后将其添加到 Git 存储库以获取要忽略的目录的示例。

以下是我在设置存储库时采取的步骤:

  1. 打开终端并导航到应用程序的根目录
  2. 调用git init初始化存储库
  3. 调用git add .gitignore添加gitignore文件
  4. 调用git commit -m提交 gitignore 文件
  5. 调用git status查看存储库状态

此时,除了构建目录之外,我的 gitignore 文件中列出的所有其他目录和文件都被正确忽略。这是我的 gitignore 文件的样子:

build/
.DS_Store
**/*.pbxuser
*.mode2v3
*.mode1v3
**/*.perspectivev*
Run Code Online (Sandbox Code Playgroud)

我尝试使用以下不同的条目忽略构建目录,但没有成功:

  • 建造
  • 建造/
  • 建造/*

有人知道我在这里做错了什么吗?

git xcode

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

.net程序员的基本工具?

这个问题看起来很熟悉:https://stackoverflow.com/questions/2187/essential-programming-tools,但我想专注于.NET编程.除了Windows和Visual Studio之外,您每天都需要哪些工具来完成工作?免费的开源代码工具是首选:)

我一直在使用这些工具:

  • Resharper - 同类产品中的佼佼者,但不是免费的
  • NUnit - 尝试使用它.
  • VisualSVN + TortoiseSVN

我应该知道和使用哪些其他工具?

.net

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

如何在WP7上创建动画磁贴?

如何在WP7上创建类似于XBox Live Tile的动画图块?一般动画拼贴有哪些选项?

mobile tile windows-phone-7

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

将数据库列与变量进行比较时出现意外输出

我有代码从MySQL数据库中检索有关玩家的信息.如果排名发生变化,我想在HTML输出中应用特殊情况.我希望它看起来像这样:http://i27.tinypic.com/f406tz.png

但我不能让它像我想要的那样,而是在每一行打印排名:

$old_rank = '';
while ($g = mysql_fetch_object($q)) {

if ($g->rankname != $old_rank) {
    echo "<tr><td>$g->rankname</td>\n";
    $old_rank = "<tr><td>&nbsp;</td>\n";
}

echo " <td>$g->name</td></tr>\n";

}
Run Code Online (Sandbox Code Playgroud)

我想要的是:

<tr>
<td>One</td>
<td>Kraven the Hunter</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Kull the Conqueror</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Zazi The Beast</td>
</tr>

<tr>
<td>Vice-leader</td>
<td>Igos du Ikana</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Saint Sinner</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Midvalley the Hornfreak</td>
</tr>.......................
Run Code Online (Sandbox Code Playgroud)

我得到了什么:

<tr><td>One</td>
<td>Tester</td></tr>
<tr><td>One</td>
<td>Kraven the Hunter</td></tr>
<tr><td>One</td>

<td>Kull the Conqueror</td></tr>
<tr><td>One</td>
<td>Zazi The Beast</td></tr>
<tr><td>Vice-Leader</td> …
Run Code Online (Sandbox Code Playgroud)

php

0
推荐指数
1
解决办法
130
查看次数

我可以改进嵌入式C#上的"double.IsNaN(x)"函数调用吗?

我在for循环中调用了数百万次的代码,检查传递的参数是否是double.NaN.我描述了我的应用程序,其中一个瓶颈就是这个简单的功能:

public void DoSomething(double[] args)
{
    for(int i = 0; i < args.Length;i++)
    {
       if(double.IsNan(args[i]))
       {
         //Do something
       }
    }
}
Run Code Online (Sandbox Code Playgroud)

即使我无法更改内部的代码,我可以优化它if吗?

c# performance

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

在哪里放置hibernate注释?

我把hibernate注释放在哪里?

它是我的实例变量之上的行吗?或者在吸气器之前?或者在二传手之前?或者它真的不重要吗?

非常感谢

java annotations hibernate

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

iOS SDK 4.0和4.1将图像添加到模拟器

我已经看到很多关于如何将图像添加到模拟器的问题,并且看到了两个答案:

  • 单击并按住以在手机上保存在Mobile Safari中
  • 将文件添加到100Apple(或其他)文件夹

两者都适用于iOS SDK 4.0之前的所有功能.那些相同的方法对我来说不再适用,也不适用于我见过的其他人.我试图使用我在某处找到的以下代码块手动将图像写入照片库:

- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{
    UIAlertView *alert;

    if (error) // Unable to save the image 
        alert = [[UIAlertView alloc] initWithTitle:@"Error" 
                                       message:@"Unable to save image to Photo Album." 
                                      delegate:self cancelButtonTitle:@"Ok" 
                             otherButtonTitles:nil];
    else // All is well
        alert = [[UIAlertView alloc] initWithTitle:@"Success" 
                                       message:@"Image saved to Photo Album." 
                                      delegate:self cancelButtonTitle:@"Ok" 
                             otherButtonTitles:nil];
    [alert show];
    [alert release];
}
Run Code Online (Sandbox Code Playgroud)

但每次都会出错.那么模拟器的写访问是一个问题吗?还是只是一些bug?我已经更新到iOS 4.1 SDK,希望它被修复,但事实并非如此.

iphone image ios ios-simulator

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

Perl线程安全模块

我正在尝试采用我编写的Perl程序并对其进行处理.问题是我读到一些模块不是"线程安全的".我如何知道模块是否是线程安全的?我环顾四周找不到一个清单.

为了测试我经常使用的一个模块(Text :: CSV_XS),我尝试了以下代码:

use strict;
use warnings;
use threads;
use threads::shared;
require Text::CSV_XS;

my $CSV = Text::CSV_XS->new ({ binary => 1, eol => "\n" }) or die("Cannot use CSV: ".Text::CSV->error_diag());
open my $OUTPUT , ">:encoding(utf8)", "test.csv" or die("test.csv: $!");

share($CSV);

my $thr1 = threads->create(\&sayHello('1'));
my $thr2 = threads->create(\&sayHello('2'));
my $thr3 = threads->create(\&sayHello('3'));


sub sayHello
{
 my($num) = @_;

 print("Hello thread number: $num\n");

 my @row = ($num); 
  lock($CSV);{
   $CSV->print($OUTPUT, \@row);
   $OUTPUT->autoflush(1);
  }#lock
}#sayHello
Run Code Online (Sandbox Code Playgroud)

我收到的输出如下:

Hello thread number: 1
Segmentation fault …

perl multithreading module

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

在python中将SQL表作为JSON返回

我正在使用web.py中的一个小型web应用程序,并且正在设置一个url来返回一个JSON对象.使用python将SQL表转换为JSON的最佳方法是什么?

python sql json

40
推荐指数
7
解决办法
9万
查看次数

如何从Visual Studio 2010中使用Mercurial?

版本控制菜鸟警报

我已经在Visual Studio 2010中安装了Mercurial,TortoiseHg和VisualHG.我已经在Visual Studio中设置了我的源代码控制到Mercurial.

当我右键单击我的解决方案时,我已经在那里出现的上下文菜单中看到了HG的按钮.

我现在的问题是,如何使这个版本控制工作?看来我之前必须进行某种配置,因为当我点击"HG Status"时它告诉我"解决方案不在Mercurial版本控制之下".

谢谢

version-control mercurial visual-studio-2010 visual-studio

9
推荐指数
3
解决办法
4167
查看次数