小编Nem*_*emo的帖子

netbeans中的函数头注释

如何在Netbeans中生成这些函数头注释?是否有任何快捷方式可以提供模板以及参数名称?

/**
* Performs the Decrease Key operation
* @param index Index of the node in the RefArray whose key is to be decreased
* @param amount Amount by which key is to be reduced
*/
public void decreaseKey(int index, int amount)
{
}
Run Code Online (Sandbox Code Playgroud)

java netbeans

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

在Hadoop伪分布式模式下充分利用所有核心

我在我的4核笔记本电脑上以伪分布式模式运行任务.如何确保有效使用所有核心.目前,我的工作跟踪器显示一次只执行一项工作.这是否意味着只使用一个核心?

以下是我的配置文件.

CONF /芯-site.xml中:

<configuration>
   <property>
       <name>fs.default.name</name>
       <value>hdfs://localhost:9000</value>
   </property>
 </configuration>
Run Code Online (Sandbox Code Playgroud)

CONF/HDFS-site.xml中:

<configuration>
  <property>
       <name>dfs.replication</name>
       <value>1</value>
  </property>
</configuration>
Run Code Online (Sandbox Code Playgroud)

CONF/mapred-site.xml中:

<configuration>
   <property>
        <name>mapred.job.tracker</name>
        <value>localhost:9001</value>  
   </property>

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

编辑:根据答案,我需要在mapred-site.xml中添加以下属性

 <property>
     <name>mapred.map.tasks</name> 
     <value>4</value> 
  </property>
  <property>
     <name>mapred.reduce.tasks</name> 
     <value>4</value> 
  </property>
Run Code Online (Sandbox Code Playgroud)

java hadoop mapreduce mahout

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

在Windows Azure上部署MPI应用程序

有一个用C(用于Linux)编写的现有MPI科学应用程序,我想在Windows Azure上运行.那可能吗?

  1. 如果可能,如何部署应用程序?

  2. 是否有必要将其转换为Microsoft MPI?

  3. 我需要为此购买特定类型的Azure服务吗?

  4. 是否有必要编写托管包装器以使其工作?

任何建议/意见/参考都会非常有帮助.

PS我是Azure的新手.

.net c cloud mpi azure

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

silverlight中的自定义复选框

如何创建如下所示的自定义复选框.复选框是动态绘制的,可以有自定义颜色.

.net c# silverlight custom-controls

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

无法通过RIA服务访问EntityObject类型

我的实体框架模型是从SQL Server数据库生成的.由于我需要从Silverlight访问数据库,因此我针对EF模型为RIAServices生成了一个DomainService.ProductEntityObject表中对应的自动生成之一Product.我试图将自定义类传递CompositeData给Silverlight客户端,如图所示.问题是CurrentProduct客户端无法访问该字段,但可以访问其他字符串/ int字段.如何CurrentProduct从客户端访问?

public class CompositeData
{
    [Key]
    public Guid PKey { get; set; }
    public string CompositeName { get; set; } 
    public string Identity { get; set; }
    public Product CurrentProduct { get; set; }  //Product is an auto-generated EntityObject class

    public CompositeData()
    {
        PKey = Guid.NewGuid();
    }
}
Run Code Online (Sandbox Code Playgroud)

以下是域服务方法:

[EnableClientAccess()]
public class LocalDomainService : DomainService
{
   public IEnumerable<CompositeData> GetData()
   {
       List<CompositeData> listData = new List<CompositeData>();
       //... …
Run Code Online (Sandbox Code Playgroud)

.net c# silverlight ria entity-framework

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

拆分字符串没有string.Split

我正在做一个家庭工作问题,不使用框架方法拆分字符串.

以下是我提出的工作代码.

我想知道如何改善O(n)的运行时间?

此外,欢迎任何改进建议.

public static string[] split(string txt, char[] delim)
{
    char[] text = txt.ToCharArray();
    string[] result = new string[0];
    int count = 0;
    int i = 0;
    StringBuilder buff = new StringBuilder(); 
    while(i < text.Length)
    {
        bool found = false;
        foreach(char del in delim)
        {
            if(del == txt[i])
            {
                found = true;
                break;
            }
        }
        if(found)
        {
            count++;
            Array.Resize(ref result, count);
            result[count - 1] = buff.ToString();
            buff = new StringBuilder();                 
        }
        else
        {
            buff.Append(txt[i]);
        }

        i++;
    }

    if(buff.Length …
Run Code Online (Sandbox Code Playgroud)

c# string

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

使用空静态构造函数的单例实现

我正在阅读这里提到的以下Singleton实现.我理解静态构造函数在第一次静态方法调用之前或实例化对象之前执行,但是在这里不理解它的用法(甚至来自注释).任何人都可以帮我理解吗?

public sealed class Singleton
{
    private static readonly Singleton instance = new Singleton();

    // Explicit static constructor to tell C# compiler
    // not to mark type as beforefieldinit
    static Singleton()
    {
    }

    private Singleton()
    {
    }

    public static Singleton Instance
    {
        get
        {
            return instance;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

c# singleton

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

为什么要使用singleton进行应用程序日志

我正在阅读单身模式的缺点.在许多论坛中建议的有效使用单例是Logging应用程序.我想知道为什么这是模式的有效使用.我们不是在整个应用程序中维护内存中的状态信息吗?

为什么不使用一个函数:

class Logger
{
    public static void Log(string message)
    {
         //Append to file

    }
}
Run Code Online (Sandbox Code Playgroud)

c# singleton

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

使用LINQ解析XDocument

我正在进行以下查询XDocument.最后一级.Descendants("Instance")产生一个表单的XElements列表:

<Instance>filepath1</Instance>
<Instance>filepath2</Instance>
<Instance>filepath3</Instance>
<Instance>filepath4</Instance>
Run Code Online (Sandbox Code Playgroud)

询问

 List<string> fileNames = xDoc.Descendants("Main")
                       .FirstOrDefault()
                       .Descendants("SecondLevel")
                       .FirstOrDefault()
                       .Descendants("Instance")
                       .Select().ToList(); //this line is not correct. Need to get the instances node values as List<string>
Run Code Online (Sandbox Code Playgroud)

我怎么能存储的值filepath1,filepath2..在List<string>

c# xml linq

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

如何配置Visual Studio以使用Beyond compare for TFS GIT?

有没有办法在使用Git时在Visual Studio 2015中进行"与未修改比较"时使用Beyond Compare作为默认比较工具?

在此输入图像描述

我没有找到"配置用户工具"选项,如 如何配置Visual Studio以使用Beyond Compare中所述.

在此输入图像描述

git tfs beyondcompare visual-studio

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