问题标签 [plaintext]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
7260 浏览

dataset - 海量明文数据解析实验

我正在用 ruby​​ 开发一个解析器,它解析一些不统一的文本数据。谁能告诉我,我在哪里可以获得大量的明文数据?

0 投票
1 回答
4140 浏览

vb.net - 在本地安全地存储用于 Web 服务的密码

我有一个应用程序通过发送用户名和密码对第三方 Web 服务进行身份验证。目前,我每次启动应用程序时都会在 winform 上输入密码 - 但我需要它来自动登录。

我想更安全地存储用户名/密码

我知道我可能不会阻止一个坚定的黑客访问我的源代码,但是将它们存储为纯文本感觉是错误的。

我在这里找到了一些类似的问题,但没有一个可以为我提供可以使用的答案。

编辑:网络服务不是我的,它是一个需要我登录才能使用的 API。

0 投票
1 回答
63 浏览

php - 仅使用 DOMdocument 或 SimpleDOM 获取特定跨度 ID 内的 p 标签之间的文本?

我试图在<p>标签之间提取明文,但 span id='a' and span id='b'. 前提是 SimpleDOM 之间似乎有效,而且我还没有找到一种方法来哄骗 DOMDocument 以产生任何输出。

0 投票
1 回答
7093 浏览

java - UTF-8 到 Java 中的字符串

我对 UTF-8 字符集有一点问题。我有一个要加载和分析的 UTF-8 编码文件。我正在使用 BufferedReader 逐行读取文件。

我的问题是Java中的法线字符串方法(例如trim()和equals())不适合与我创建的循环的每次迭代中从BufferReader读取的行一起使用,以读取BufferedReader的所有内容. 例如,在编码文件中,< menu >我希望我的程序按原样处理它,但是,就目前而言,它被视为?? < m e n u >与其他一些奇怪的字符混合在一起。我想知道是否有办法删除所有字符集编码并只保留纯文本,这样我就可以使用 String 类的所有方法而不会出现复杂情况。谢谢

0 投票
2 回答
67631 浏览

xml - 使用 xsl 输出纯文本

我需要使用 XSL 从 XML 生成简单的纯文本输出。由于我没有在网上找到任何好的、简洁的示例,我决定在这里发布我的解决方案。当然,任何引用更好示例的链接都会受到赞赏:

一些对我有帮助的重要事情:

  1. 使用 xsl:output 省略输出文档开头的标准声明
  2. 使用 xml:space="preserve" 属性来保留我在 xsl:for-each 标记中编写的任何空格。这还要求我将所有代码都写在 for-each 标记中,包括该标记在内,都写在一行上(换行符除外)。
  3. 使用 插入换行符 - 我不得不在这里省略标准 xml 缩进。

此 xslt 的结果和所需输出是:

在 -f alluser 23:58 17.4.2010
在 -f ggroup67 7:58 28.4.2010
在 -f ggroup70 15:58 18.4.2010
在 -f alluser 23:58 18.4.2010
在 -f ggroup61 7:58 22.9.2010
在-f ggroup60 23:58 21.9.2010
在-f alluser 3:58 22.9.2010

正如我所说,任何关于如何更优雅地做到这一点的建议都将不胜感激。


跟进 2011-05-08:

这是我正在处理的 xml 类型:

0 投票
1 回答
2989 浏览

delphi - RichEdit 不尊重带有粘贴内容的纯文本

我创建了一个新应用程序,放在 TRichedit 上并将 PlainText 属性设置为 true。然后我运行应用程序并将一些格式丰富的文本粘贴到 RichEdit 中。

我希望它显示为纯文本,但它显示带有格式的内容。

任何人都知道如何将 TRichedit 用作纯文本(而不是使用备忘录 :))

0 投票
4 回答
672 浏览

html - 以纯文本形式查看 html、htm 等

我想知道是否有一种方法可以链接到类似的页面domain.com/index.htm并将其视为纯文本/代码,而不是浏览器实际呈现页面。

更好的是,如果使用 php 脚本可以做到这一点,那将是不可思议的。(这不是指向外部页面的链接,而是我自己的 ftp 站点上的链接)。

0 投票
0 回答
494 浏览

c# - Which is faster reading binary data or just plain text data?

I have some data that I know its exact structure. It has to be inserted in files second by second. The structs contain fields of double, but they have different names. The same number of struct have to be written to file every second

The thing is .. Which is a better appraoch when it comes to reading the data

1- Convert the Structs to bytes then insert it while indexing the byte that marks the end of the second

2- Writing CSV data and index the byte that marks the end of second

The data is requested at random basis from the file. So in both cases I will set the position of the FileStream to the byte of the second.

In the first case I will use the following for each of the struct in that second to get the whole data

the previous approach is applied X number of times because there's around 100 struct every second


In the second case I will use string.Split(',') then I will fill in the data accordingly since I know the exact order of my data

edit using the profiler is not showing a difference, but I cannot simulate the exact real life scenario because the file size might get really huge. I am looking for theoratical information for now

0 投票
1 回答
786 浏览

php - PHP - 纯文本分页符

我正在创建一个可以执行多种格式的导出系统,其中一种是纯文本。我希望在打印文档时,带有列名的标题出现在每页的顶部。有没有办法可以强制以纯文本形式分页。我只在 HTML/CSS 中找到了解决方法。文件的输出格式如下所示:

0 投票
1 回答
594 浏览

ruby-on-rails - 使用 erb 生成纯文本电子邮件

我正在使用 ActionMailer 3.0.9 和 erb 模板生成纯文本电子邮件。一切都很顺利,除了我的电子邮件包含异常的回溯,这些异常的字符如'<'、'"'等被更改为'& lt;'、'& quot;' 等等所以我的问题是:如何配置 erb/mailer 使其不会将这些字符扩展为 '&(...);'?