小编Pro*_*eur的帖子

ADP文件中的数据库连接信息在哪里?

用户输入了他们每天使用的OLD Access数据库和表单项目的票证.他们说使用它时无法找到数据库.自从大学以来我没有使用MS Access来设计数据库或界面,所以我不知道在哪里可以找到它正在尝试访问的数据库.

我想尝试找到数据库,看看它是否存在,2)是否已损坏

主界面通过*.adp文件完成.存储在文件中的连接字符串信息在哪里?

我在MS Access 2007中打开了它.

database forms ms-access adp

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

是否有strsep()的windows变种

我正在尝试解析具有一些空参数的分隔字符串.例:

"|One|two|three||octopus|garbagecan||cartwheel||||"
Run Code Online (Sandbox Code Playgroud)

基本上我需要能够通过id拉出任何段,如果段是空的返回null.

strtok()不处理空字段,它看起来像strsep()基于*nix的系统.任何人都知道Windows是否有类似的东西?我想尝试避免必须编写一个函数来处理这个问题,如果可以的话.

c windows

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

将两个"Double"变量与-eq/-ne进行比较不会验证数字是否大于2位数

我试图比较两个Double变量Powershell.当变量超过2位数(不计算精度)时,相等测试意外失败.

我错过了一些明显的东西吗?

这是测试脚本输出:

PS C:\test> .\test.ps1
==========
TEST ONE
==========
Value of Double1: 336.1
Type of Double1: System.Double
-----
Value of Double2: 336.2
Type of Double2: System.Double
-----
Value of Double1+.1: 336.2
Type of Double1+.1: System.Double
-----
Does Double1 not equal Double2: True
Does Double1+.1 not equal Double2: True

==========
TEST TWO
==========

Value of Double3: 36.1
Type of Double3: System.Double
-----
Value of Double4: 36.2
Type of Double4: System.Double
-----
Value of Double3+.1: 36.2
Type …
Run Code Online (Sandbox Code Playgroud)

variables double powershell comparison equals

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

Object没有使用argparse的属性

我正在按照本教程尝试实现我正在编写argparsepython脚本.

当我从教程中运行此代码片段时,我收到以下错误:

[05:51 PM] user Scripts> cat argparse.py
import argparse
parser = argparse.ArgumentParser()
parser.parse_args()



[05:51 PM] user Scripts> python3 argparse.py
Traceback (most recent call last):
  File "argparse.py", line 1, in <module>
    import argparse
  File "/home/brian/Documents/Scripts/argparse.py", line 2, in <module>
    parser = argparse.ArgumentParser()
AttributeError: 'module' object has no attribute 'ArgumentParser'
Run Code Online (Sandbox Code Playgroud)

我正在运行Python 3.3.2并已安装argparse 1.2.1使用,easy_install因此我知道它在系统上,但我无法确定导致错误的原因.

注意:我读过这篇文章并没有关联.

python argparse python-3.x

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

使用FileReader从文本文件中读取一行,使用System.out.println似乎打印在unicode中?

我仍在自学Java,所以我想尝试读取文本文件,步骤1)将其输出到控制台,然后步骤2)将内容写入新的txt文件.

这里有一些我已经google开始的代码并且它正在读取文件,但是当我将行内容输出到控制台时,我得到以下内容(看起来像是在unicode或其他东西中输出...就像每个字符一样与之相关的额外字节....

ÿþFF?u?l?l? ?T?i?l?t? ?P?o?k?e?r? <SNIP>

这是我通过记事本打开时文件的第一行: Full Tilt Poker Game #xxxxxxxxxx: $1 + $0.20 Sit & Go (xxxxxxxx), Table 1 - 15/30 - No Limit Hold'em - 22:09:45 ET - 2009/12/26

这是我的代码,我是否需要指定编码以将txt文件内容显示到控制台?我认为简单的文本对于java来说是直截了当的......但是我很新,并且对于如何挑剔java还不太了解.

编辑:我不知道它是否重要,但我目前使用Eclipse作为我的IDE.

package readWrite;

import java.io.*;

public class Read {
    public static void main(String args[])
    {
        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new FileReader("C:\\Users\\brian\\workspace\\downloads\\poker_text.txt"));
            String line = reader.readLine();

            while (line!=null) {
                // Print read line
                System.out.println(line);

                // Read next line for while condition
                line = …
Run Code Online (Sandbox Code Playgroud)

java

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

是否有方法来确定System.IO.StreamWriter对象是否已打开?

我试图确定一个StreamWriter对象在脚本中是打开还是已经关闭.如果它没有关闭,我可以在文件中写一个新行.如果关闭,我需要执行其他操作....

如何验证流是否仍处于打开状态?

示例测试脚本.

$stream = [System.IO.StreamWriter] "C:\testing.txt"
$stream.WriteLine("TEST")
$stream.close()
if($stream)){
    #stream still open, write new line
    $stream.WriteLine("Stream is still open.  Write.")
    $stream.close()
}else(
    #stream not open... end script, send reponse.
}
Run Code Online (Sandbox Code Playgroud)

powershell file-io streamwriter

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

评估URL参数,而不是返回预期结果

我的网址如下:

http://localhost:3000/movies?ratings[PG-13]=1&commit=Refresh
Run Code Online (Sandbox Code Playgroud)

我正在尝试评估网址参数,并且我不确定为什么这种方式可行.在我的控制器中,我评估参数并构建一个数组,如下所示:

在我的ViewI中使用以下调试语句来查看放入的内容@selected_ratings

=debug(@selected_ratings)
Run Code Online (Sandbox Code Playgroud)

在我的控制器中,我尝试了两个语句.

测试一返回以下内容,这应该有效吗?

@selected_ratings = (params["ratings[PG-13]"].present? ? params["ratings[PG-13]"] : "notworking")

output: notworking
Run Code Online (Sandbox Code Playgroud)

但是,如果我在控制器中使用以下三元评估:

@selected_ratings = (params["ratings"].present? ? params["ratings"] : "notworking")

output:!map:ActiveSupport::HashWithIndifferentAccess 
  PG-13: "1"
Run Code Online (Sandbox Code Playgroud)

为什么我的评价没有找到文字params["ratings[PG-13]"]

ruby parameters ruby-on-rails

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

如何从main调用java中的方法?

import java.util.*;

import java.io.*;

public class Test extends ArrayList
{

    ArrayList<String> list = new ArrayList<String>();

    public static void main(String[] args)
    {
        new Test().add();
        new Test().contains();
    }



    public boolean add(){
        list.add("cat");
        System.out.println(list);
        return true;
    }

    public void contains(){
        if (list.contains("cat")){
            System.out.println("list contains cat");
        }
        else{
            System.out.println("list doesn't contain cat");
        }

    }

}
Run Code Online (Sandbox Code Playgroud)

为什么结果[cat]列表不包含cat?它一直给我[猫]列表不包含猫.第一种方法是正常工作,但为什么不是第二种方法呢?谢谢......我真的很陌生.

java methods program-entry-point call calling-convention

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