问题列表 - 第27458页

哪种构建工具可以教?

虽然已经提出了类似的问题,但这个问题集中在最好/最容易教授的问题上.

我将在我的大学每周进行一次关于数据结构和算法的教程.我不时会介绍可能在JUnit,Mercurial,Eclipse等未来项目中有用的工具.我打算向他们展示一些构建工具,但我不确定选择哪一个.除了使用make的一点经验之外,我自己对构建工具知之甚少.它更像是我想要展示的构建工具的概念,而不是一个特殊的工具本身.哪个是最容易的/将来证明/展示它们的工具?

我已经阅读了一些关于Gradle的内容,看起来很不错,但到目前为止我认为Ant可能是一个不错的选择(这是我正在给的Java课程).

java build

8
推荐指数
3
解决办法
531
查看次数

系统找不到FileWriter指定的路径

我有这个代码:

private static void saveMetricsToCSV(String fileName, double[] metrics) {
        try {
            FileWriter fWriter = new FileWriter(
                    System.getProperty("user.dir") + "\\output\\" +
                    fileTimestamp + "_" + fileDBSize + "-" + fileName + ".csv"
            );

            BufferedWriter csvFile = new BufferedWriter(fWriter);

            for(int i = 0; i < 4; i++) {
                for(int j = 0; j < 5; j++) {
                    csvFile.write(String.format("%,10f;", metrics[i+j]));
                }

                csvFile.write(System.getProperty("line.separator"));
            }

            csvFile.close();
        } catch(IOException e) {
            System.out.println(e.getMessage());
        }
    }
Run Code Online (Sandbox Code Playgroud)

但我得到这个错误:

C:\ Users\Nazgulled\Documents\Workspace \SóAmigos\ output\1274715228419_5000-List-ImportDatabase.csv(系统找不到指定的路径)

知道为什么吗?

如果重要的话,我在Windows 7上使用NetBeans ...

java file-not-found filewriter

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

在C#中计算ComboBox DropDownWidth

在我的应用程序中,ComboBox被调整大小,因此它更小.如何重新计算DropDownWidth属性?我知道如何设置它,但我更喜欢计算适当的宽度,因为它的内容会发生变化.首先,我正在考虑这些方面的事情:

int iMaxLen = 0;
foreach item in comboBoxList
{
   iMaxLen = (item.Length > iMaxLen) ? item.Length : iMaxLen;
}
comboBoxList.DropDownWidth = iMaxLen;
Run Code Online (Sandbox Code Playgroud)

谢谢.

c# combobox winforms drop-down-menu

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

如何使用javascript或jquery删除多余的空格?

我得到HTML元素包含这个:

  <!--Product Style-->  <div style="float: right; padding-top: 4px; padding-bottom: 5px;">  P6C245RO </div>  <div style="text-transform: uppercase; font-weight: bold; padding-top: 4px; padding-bottom: 5px;">  Style </div>  <div style="clear: both; border-top: 1px solid rgb(216, 216, 216); padding-top: 4px;">  <!--Product Description-->  <div style="font-size: 11px ! important;"></div>  <div style="background: url(&quot;http://ii.armaniexchange.com/ArmaniExchange/images/en_US/global/globalgraphics/bullet.gif&quot;) no-repeat scroll 0pt 4px transparent; padding-left: 12px;">fine tonal striped fabric</div>  <div style="background: url(&quot;http://ii.armaniexchange.com/ArmaniExchange/images/en_US/global/globalgraphics/bullet.gif&quot;) no-repeat scroll 0pt 4px transparent; padding-left: 12px;">epaulettes and sleeve tab</div>  <div style="background: url(&quot;http://ii.armaniexchange.com/ArmaniExchange/images/en_US/global/globalgraphics/bullet.gif&quot;) no-repeat scroll 0pt 4px transparent; padding-left: 12px;">metal logo plate on …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery

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

WPF按钮图像仅显示在上一个控件中

我是WPF的新手,我可能在这里遗漏了一些简单的东西.如果我有3个控件,只有最后一个控件将显示我指定的OriginalImage.

非常感激任何的帮助.谢谢瑞恩

主窗口

<Grid>

        <Grid.RowDefinitions>
            <RowDefinition Height="200*"/>
            <RowDefinition Height="60" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="85" />
            <ColumnDefinition Width="85" />
            <ColumnDefinition Width="85" />
            <ColumnDefinition Width="85" />
            <ColumnDefinition Width="300" />
        </Grid.ColumnDefinitions>

            <Grid Grid.Row="1">
                <but:ListButton OriginalImage="/CustomItemsPanel;component/ListBox/Images/add.png"
                            DisableImage="/CustomItemsPanel;component/ListBox/Images/addunselect.png"

            />
        </Grid  >
        <Grid Grid.Row="1" Grid.Column="1"  >
            <but:ListButton OriginalImage="/CustomItemsPanel;component/ListBox/Images/add.png"
                            DisableImage="/CustomItemsPanel;component/ListBox/Images/addunselect.png"

            />
        </Grid  >
        <Grid Grid.Row="1" Grid.Column="2"  >
            <but:ListButton OriginalImage="/CustomItemsPanel;component/ListBox/Images/add.png"
                            DisableImage="/CustomItemsPanel;component/ListBox/Images/addunselect.png"

            />
        </Grid>
</Grid>
Run Code Online (Sandbox Code Playgroud)

控制XAML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:CustomItemsPanel.ListButton">

<LinearGradientBrush x:Key="ButtonBackground"  EndPoint="0.5,1" StartPoint="0.5,0">
    <LinearGradientBrush.GradientStops>
        <GradientStop Color="#FF0E3D70"/>
        <GradientStop Color="#FF001832" Offset="1"/>
    </LinearGradientBrush.GradientStops>
</LinearGradientBrush>

<LinearGradientBrush x:Key="ButtonBackgroundMouseOver"  EndPoint="0.5,1" StartPoint="0.5,0">
    <LinearGradientBrush.GradientStops>
        <GradientStop Color="#FF1E62A1" …
Run Code Online (Sandbox Code Playgroud)

wpf xaml image button

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

切换linq语法

 var folders = from r in this.bdd.Rights
               join f in this.bdd.Folders on r.RightFolderId equals f.FolderId
               join rs in this.bdd.RightSpecs on r.RightSpecId equals rs.SpecIdRight
               where r.RightUserId == userId
               where rs.SpecRead == true
               where rs.SpecWrite == true
               select f;
Run Code Online (Sandbox Code Playgroud)

如何在其他语法中转换此linq查询?

 var folders = this.bdd.Rights.Where(r => r.....
Run Code Online (Sandbox Code Playgroud)

c# linq

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

从WPF中的ListBox中删除项目?

我试图从列表框中删除数据绑定的项目.以下是listbox的截图.

替代文字http://i46.tinypic.com/xcnn0n.png

这是在列表中添加项目的代码.

    public class Task
    {
        public string Taskname { get; set; }

        public Task(string taskname)
        {
            this.Taskname = taskname;
        }
    }

    public void GetTask()
    {
        taskList = new List<Task>
                           {
                               new Task("Task1"),
                               new Task("Task2"),
                               new Task("Task3"),
                               new Task("Task4")
                           };

        lstBxTask.ItemsSource = taskList;
    }
Run Code Online (Sandbox Code Playgroud)

这是Xaml代码,

 <ListBox x:Name="lstBxTask" Style="{StaticResource ListBoxItems}" >
        <ListBox.ItemTemplate>                
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Taskname}"  Style="{StaticResource TextInListBox}"/>
                    <Button Name="btnDelete" Style="{StaticResource DeleteButton}" Click="btnDelete_Click">
                    </Button>                        
                </StackPanel>                    
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
Run Code Online (Sandbox Code Playgroud)

每当选择列表框中的项目时,都会显示删除(x)按钮.单击时,它应从列表框中删除该项目.谁能告诉我怎么能这样做?

wpf listbox

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

Django:站点范围的URL前缀

我已经构建了一个Django站点,它将在它生存时存在于根目录中.现在它在IP地址上运行良好.出于测试目的,客户端已指向其中的代理URL,但URL中包含/ folder/path,因此没有任何URL模式匹配.我把(/ folder/path)?所有的url模式,所以他们现在响应,但所有链接都被破坏,因为我使用{%url%}标记,而url模式将匹配可选路径,他们不包括在该标记中.

显然,我可以硬编码/文件夹/路径到我的所有网址(好吧,进入所有网址包括),直到测试完成,但是有更好的方法吗?

django django-urls

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

使DIV垂直填充页面的剩余部分?

我有一个谷歌地图应用占据了大部分页面.但是,我需要为菜单栏保留最顶部的空间.如何使地图div自动填充其垂直空间? height: 100%不起作用,因为顶部栏会将地图推到页面底部.

+--------------------------------+
|      top bar  (n units tall)   |
|================================|
|              ^                 |
|              |                 |
|             div                |
|     (100%-n units tall)        |
|              |                 |
|              v                 |
+--------------------------------+
Run Code Online (Sandbox Code Playgroud)

html css

45
推荐指数
3
解决办法
5万
查看次数

Can isdigit合法地是依赖于C的语言环境

在涉及setlocale的部分中,ANSI C标准在脚注中指出,其行为不受当前语言环境影响的唯一ctype.h函数是isdigit和isxdigit.

isdigit的Microsoft实现依赖于语言环境,因为,例如,在使用代码页1250的语言环境中,isdigit仅对0x30('0') - 0x39('9')范围内的字符返回非零值,而在使用代码页的语言环境中对于上标数字0xB2('²'),0xB3('³')和0xB9('¹'),1252 isdigit也返回非零值.

Microsoft是否依赖于isdigit语言环境违反了C标准?

在这个问题中,我主要对C90感兴趣,C90是微软声称要遵守的,而不是C99.

附加背景:

Microsoft自己的setlocale文档错误地指出isdigit不受语言环境的LC_CTYPE部分的影响.

涵盖ctype.h函数的C标准部分包含一些我认为含糊不清的措辞:

这些函数的行为受当前语言环境的影响.下面将说明仅在不在"C"语言环境中时具有语言环境特定方面的那些函数.

我认为这是模棱两可的,因为不清楚它是什么试图说的isdigit这样的函数,没有关于locale特定方面的注释.它可能试图说这些函数必须假定依赖于语言环境,在这种情况下,Microsoft的isdigit实现就可以了.(除了我之前提到的脚注似乎与这种解释相矛盾.)

c locale codepages

18
推荐指数
2
解决办法
1130
查看次数