问题标签 [rebol2]

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 投票
1 回答
108 浏览

rebol - Rebol 2 port binding to multiple IPs

I have a Windows setup with multiple IP's, and wishes my Rebol script (on Rebol/Core 2.78) to make individual bind and listen to the same port number on each of those IP's.

Until very recently I thought the syntax to do this was:

But it turns out the Port2Test line fails, as the browse http://10.100.44.6? part is totally ignored (and now searching, I can't even locate where I got that syntax in the first place).
Reading up on the documentation all I can find on how to specify a listening port is like this:

Probing the Port1Test port reveals most settings set to none, and a few set as follows:

So I attempted to modify those values like this:

Unfortunately all variations of the above modifications, including swapping the IP values for Port1Test and Port2Test, fails when creating Port2Test. :-(

I'm sure there's something I'm overlooking, but I can't find any hints anywhere about how to initialize a port while binding it to a specific interface.

Any hints highly appreciated!


Edit: The way Rebol bind to interfaces is now pretty evident to me - but how to modify it it still a mystery.

Let’s say I have two IP’s (== interfaces) associated to one networking card: 10.100.1.1 and 10.100.1.2. On 10.100.1.1:80 I setup a Tomcat application that I know can bind to that specific interface. Then I start a REBOL application, that also claim port 80. They will both run happily, and each be accessible on only one IP, as if the Rebol application had bound to 10.100.1.2. Then I shut down the Tomcat application, and attempt to start it. This turns out not to be possible, as the interface is in use. And if I access both of the IP’s, it turns out the Rebol application is accessible on both IP’s.

It’s not an active mechanism in Rebol that at work here, but because Rebol claims the 0.0.0.0 interfaces (In the context of servers, 0.0.0.0 means "all IPv4 addresses on the local machine"), which is translated to any currently available interface, and a deferred claim to interfaces as they become available.

It would be really nice to find out how to change Rebols default interface of 0.0.0.0 to something else at create time of the port!

0 投票
2 回答
664 浏览

rebol - 从 HTTP 读取文件

我编写了一个程序来从国家证券交易所下载文本文件。这是下载功能:

尽管所需的文件在那里,但我多次收到未找到文件的消息。当请求多个文件并且其中一些没有下载时,这很烦人。如果我再试一次,我会收到文件。

我阅读了waitRebol 2 文档中的命令,发现等待是打开端口的默认设置。我究竟做错了什么?有没有办法让 Rebol 等待几秒钟以获得服务器的响应?

编辑 - 每天的活动都有一个文件。说,我要下载 10 天(1 月 1 日到 1 月 10 日。然后,我得到了几天的文件和几天的错误。如果我立即再次下载相同的日期,我会得到一些丢失的文件。第三和第四尝试将获取所有剩余的文件。但是,对于任何日期,每次找不到文件错误都是随机的。

出色地,

  1. 正如tomc所说,我将超时时间增加到10秒。
  2. 根据 Graham Chiu 的建议,我还收集了那些失败的列表
  3. 正如 Hostilfork 所建议的,我无法使用 Wireshark,但我可以通过稍微更改代码来捕获错误,如下所示。

    此后,我从 2015 年 12 月 1 日到 2015 年 12 月 15 日下载了两次。

第一次尝试失败的列表 -

第二次尝试失败的列表-

所有情况的错误消息都是相同的-

]

请原谅我之前没有正确捕获错误。我是 Rebol 的新手。

我不知道有什么解决方案。我有一个 8 mbps 的网络连接,它运行良好。

出于好奇,我打开了 Rebol 控制台并连接了 google.co.in。这是同时尝试两次的结果——

因此,到目前为止,我正在遵循这两个建议。

我又学到了一件事——捕获错误不是这样工作的——

必须将文件读入变量,否则如果实际接收到文件,Rebol2 会因错误而崩溃 - err: 需要一个值。

0 投票
1 回答
309 浏览

rebol - Rebol 快速入门

我一直想尝试 rebol(或红色)。我认为它可能非常适合我的下一个项目。我已经下载并测试了红色 0.5.4 和 REBOL/View 2.7( http://www.rebol.com/download-view.html )

然而,对于一个完整的初学者来说,rebol 有几个障碍:

  1. 红色似乎仍处于 alpha 状态,所以这是不可能的
  2. 似乎有 3+(?) 个分支:REBOL3 - 不同分支之间有什么区别?我不知道从什么开始
  3. 互联网上的大多数文档都是针对 rebol 2 的,解释 rebol 2 和 3 之间差异的文档是……不存在?(例如:解析不同)

所以,我的问题是,如果我要开发一个具有 http 访问(包括 http 身份验证)的(Windows)gui 应用程序,我应该从哪里开始?

我应该使用 rebol 2、rebol 3(ren c) 还是 red?

ps第一个问题!

0 投票
1 回答
169 浏览

rebol - 如何在 Freya 上运行 Rebol

一直在尝试rebol-view-278-4-2Elementary OS “Freya” (Ubuntu 14.04 LTS 的变体)上运行。

我不断收到此错误:

加载共享库时出错:libXaw.so.7:无法打开共享对象文件:没有这样的文件或目录

我继续尝试安装缺少的库,但无济于事。

0 投票
2 回答
761 浏览

rebol - |红色编程语言| 如何从网页中获取 Cookie?

我在 Google 和 Stackoverflow 上搜索了很多。我找不到如何从网页中获取 Cookie(或一般而言,HTTP 标头),然后对其进行编辑并将其发回?

[我知道如何使用读/写但 Cookie idk 发出 POST/GET 请求]

0 投票
2 回答
317 浏览

rebol - Rebol 2 禁用控制台回显

我有一个 Rebol2 控制台应用程序(Rebol Core),我想禁用键盘字符回显到控制台。该应用程序从最小的 Linux 内核/initramfs 运行,并由busybox inittab(不是从终端)启动。它有一个最小的控制台用户界面,使用 ansi 代码来表示颜色等,并通过单键响应菜单选择。为了使控制台“安静”,我关闭了光标,并且看不到按键的输出(直到最近)。

我以前认为我通过在 Rebol 中调用 'stty -echo' 解决了问题,但它实际上并没有像我刚刚发现的那样工作 - 有一个函数需要 5-10 秒并且可以在等待时看到回显的按键功能来完成。

我不太清楚为什么在这个函数运行时我只看到回显字符,但它是唯一需要任何时间的函数。通过以二进制模式打开 console:// 来轮询键盘,等待按键,然后使用 switch 语句来选择功能。二进制/控制台中键的读取似乎“消耗”了键回显-

(值按我的意愿返回,并且 char 没有回显,这很好——我认为在大多数函数中,我的键在 get-key 循环中被“使用”,但较长的函数没有机会“使用” ' 他们,并最终回声到控制台)

有什么方法可以禁用 Rebol2 中的控制台字符回显吗?我查看了系统/控制台和系统/端口/输入、输出,但没有看到任何明显的东西。我目前的解决方法是简单地更改文本颜色以匹配背景,以便在特定功能运行时任何按键都不可见。

这是我正在做的一个最小的例子-

永远循环似乎“消耗”了键盘输入(没有回显),但如果其中一个功能需要任何时间,任何键盘输入都会在光标所在的位置回显到屏幕上。在大多数情况下,我从来没有看到任何回显字符,因为调用 get-key 之间的时间很短。我还要注意,回显的字符也不会出现在随后的 get-key 调用中。

更新-

这是一个更好的代码示例来查看问题-

我发现我的“长”函数正在使用调用,这可能需要几秒钟,所以在使用调用时会出现问题。

上面的代码,在运行时将显示键被回显,只是因为它们被打印在 get-key 函数(括号)中,当 long-func 运行时,键在 get-key 之外被回显(没有括号),并且完成后,get-key 也会处理这些密钥。或者简单地运行'call/wait {sleep 10}',你会在等待时得到回显键,并且在调用返回时也会得到 Rebol 回显的相同键。reb-func 运行时不会回显键,并且 get-key 将在 reb-func 完成时处理所有缓冲的键。使用呼叫时,键盘输入被处理两次。

我尝试在调用命令中重定向标准输入/标准输出(在调用字符串命令中,如在 bash 提示符下),但没有找到有效的组合。(我的实际代码使用 /output/error 运行调用以捕获所有输出)。

0 投票
1 回答
151 浏览

url - Rebol url中的转义符号

我正在使用 Rebol 2.7.8.3.1。我试图@在我的 url 中转义一个符号,但它不起作用。我也尝试过手动转义它,但这也不起作用。

我尝试了以下方法:

如果我有一个文件夹folderB@路径中没有),它可以正常工作:

我也尝试将 url 写为字符串,无论是非转义还是非转义,然后使用to-url,但它给出了类似的结果。

使用decode-url,似乎 Rebol 在我所有的情况下都误解了 url。

如何在 Rebol 中转义 url?

0 投票
1 回答
75 浏览

rebol - 聊天应用程序如何实时读取文件?

我正在尝试在 Rebol 中编写一个基于单个文本文件的简单聊天应用程序。“实时”读取该文件的最佳方式是什么?现在我已经得到了它的工作:

文本字段每秒更新一次文件的内容。即使有多个用户,这也有效,但每个用户每秒都会读取整个文件。有没有更好的方法来做这种事情?

0 投票
2 回答
101 浏览

rebol - REBOL 布局:如何自动创建布局词 - 词没有上下文?

使用 REBOL/View 2.7.8 Core,我想通过自动为各种布局项分配单词来预先准备视图布局,如下例所示。代替

因此,我希望cb1通过cb5自动创建单词,例如:

然而,虽然在被解析的块( )中没有difference prepared-view prepared-view2显示出差异,但第二个脚本会导致错误:== []

我花了几个小时试图理解为什么,我认为新词需要以某种方式绑定到特定的上下文,但我还没有找到任何解决问题的方法。

我需要做什么?

0 投票
1 回答
103 浏览

rebol - 如何删除 rebol 上的默认标题栏?

如何删除 rebol 上的默认标题栏?

在此处输入图像描述