问题列表 - 第41059页

将IP映射到linux中的主机名

在linux中是否有任何文件可以将IP映射到主机名.请告诉我路径

正如我们在windows中所做的那样:通过更改主机文件,我们可以将静态IP映射到主机名.

linux

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

VimScript还是VimL?

Vim脚本语言的正确名称是什么?我认为它被称为VimScript,Vim脚本甚至VimL.

VimL甚至被列为GitHub上第10种最流行的编程语言!VimL名称背后的历史是什么?为什么Git人称之为VimL?

vim terminology viml

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

Java DB选择更好的性能

我有处理这种数据的java应用程序:

class MyData
{
     Date date;
     double one;
     double two;
     String comment;
}
Run Code Online (Sandbox Code Playgroud)

所有数据都以csv格式存储在硬盘上,此类数据序列的最大大小约为150 mb,此时我只需将其完全加载到内存中并使用它.

现在我的任务是增加数百GB的最大数据序列.我想我需要使用DB,但之前我没有使用它们.

我的问题:

  1. 出于我的原因,哪个DB更好地选择(只有1个数据表作为abowe)?
  2. 哪个库更适合用于连接Java < - > DB
  3. 我想会有像光标一样的东西?!?如果是这样,是否有任何光标实现具有良好的记录缓存快速访问?

关于java < - > DB的任何其他提示和技巧都是受欢迎的!

java database cursor

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

将JUnit结果打印到文件

我想将JUnit测试的结果打印到.txt文件中。

以下是我的代码:

try {
    //Creates html header 
    String breaks = "<html><center><p><h2>"+"Test Started on: "+df.format(date)+"</h2></p></center>";

    //Creating two files for passing and failing a test
    File pass = new File("Result_Passed-"+df.format(date)+ ".HTML");
    File failed = new File("Result_Failed-"+df.format(date)+ ".HTML");
    OutputStream fstreamF = new FileOutputStream(failed, true);
    OutputStream fstream = new FileOutputStream(pass, true);
    PrintStream p = new PrintStream(fstream);
    PrintStream  f= new PrintStream(fstreamF);

    //appending the html code to the two files
    p.append(breaks);
    f.append(breaks);

    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } …
Run Code Online (Sandbox Code Playgroud)

java junit junit4

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

Haskell模块:隐藏名称和ghci

我正在尝试从Haskell模块中导出一个名称的子集,但是ghci很高兴让我访问隐藏的名称.

module Hiding (shown, calc) where

calc = shown * hidden

shown :: Int
shown = 3

hidden :: Int
hidden = 2
Run Code Online (Sandbox Code Playgroud)

但是当我在ghci中尝试这个时,我得到:

Prelude> :l Hiding.hs 
[1 of 1] Compiling Hiding           ( Hiding.hs, interpreted )
Ok, modules loaded: Hiding.
*Hiding> hidden
2
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

(编辑:为了它的价值,我在Arch Linux上使用ghci 6.12.3)

haskell module ghci name-hiding

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

'MyClass'的类型初始值设定项引发了异常

以下是我的Windows服务代码.当我调试代码时,我收到错误/异常:

'CSMessageUtility.CSDetails'的类型初始值设定项引发了异常.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.IO;
using System.Threading;
using System.Windows;
using System.Windows.Forms;
using CSMessageUtility;

namespace CS_Data_Trasmmiting_Service
{
    public partial class svcCSWinServ : ServiceBase
    {
        //private string sLogFormat;
        //private string sErrorTime;
        private Thread new_thread;
        Logger logObject = new Logger();
        private bool isenable = true;

        public svcCSWinServ()
        {
            InitializeComponent();
            logObject.append("Initialize Service " + DateTime.Now.ToString(), 70);
            CheckForAlarms();
        }

        protected override void OnStart(string[] args)
        {
            try
            {
                new_thread = new …
Run Code Online (Sandbox Code Playgroud)

c# windows-services

208
推荐指数
4
解决办法
33万
查看次数

在asp.net后面的代码中创建javaScript变量

如何在服务器端(后端)注册Javascript变量并在客户端(Javascript文件)访问它,没有隐藏字段,Literal等?

asp.net

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

修剪文本 - 在结尾输入大量空格键时

我有一个编辑文本字段,可以在其中输入原因.但如果一个人进入所有空间的原因我怎么能检测到它.有没有办法当一个人进入所有空间或什么也没有,我必须将文本保存为简单的"hiphen".我的主要问题是如何修剪最后的空间.

java android trim

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

Java关闭连接和findbugs

在我们的代码中,我们通常使用以下模式:

Connection conn;
try{
    conn = getConnection();
    //Do databasey stuff
}catch(Exceptions that get thrown){
}finally{
    try{
        conn.close();
    }catch(SQLException ex){
        logger.error("Failed to cleanup database connection",ex);
    }
}
Run Code Online (Sandbox Code Playgroud)

然而,findbugs不喜欢这个.由于conn.close()可以抛出异常,因此无法保证关闭连接.findbugs是否过于迂腐或是否有更好的方法来关闭数据库连接.

编辑:添加删除尝试捕获关闭.

java database findbugs

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

通过HTTP POST文件上传+参数以触发Hudson构建

目前我正在寻找一种工作方法来在Hudson的以下配置中上传文件+字段.目前的问题是Hudson总是抱怨应该提交的表格..(见本文稍后的例外).但基于我阅读的文档,它应该像下面的Java代码片段一样工作...

HttpPost httppost = new HttpPost(triggerJobUrl);
FileBody fileBody = new FileBody(releaseProperties);
StringBody stringBody = new StringBody(svnURL.toString());
MultipartEntity mentity = new MultipartEntity();
mentity.addPart("trunk/release.properties", fileBody);
mentity.addPart("SVNURL", stringBody);
httppost.setEntity(mentity);
HttpResponse response = null;
try {
    response = httpClient.execute(httppost);
} catch (ClientProtocolException e) {
    throw new HudsonException("http protocol error.", e);
} catch (IOException e) {
    throw new HudsonException("connection aborted.", e);
}
if (response.getStatusLine().getStatusCode() != 200) {
    throw new HudsonException("Unexpected status code received " + response.getStatusLine().getStatusCode());
}
HttpEntity resEntity = response.getEntity();
if (resEntity …
Run Code Online (Sandbox Code Playgroud)

java hudson http httpclient hudson-api

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