- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在下面运行了这个程序,其中包含数百个符号的 symbol_list,有时它说内存不足,而我确实重用了同一个变量,为什么?
base-url: http://www.google.com/finance/historical
download-directory: "askpoweruser/stock-download/google/files/"
column-header: "Time;Open;High;Low;Close;Volume"
#debug: true
symbol_list: parse/all {GOOG AAPL MSFT INDEXDJX:.DJI} " "
ans: ask {symbols by default "GOOG AAPL MSFT INDEXDJX:.DJI": }
if (ans <> "") [symbol_list: parse/all ans " "]
;do code-block/2
foreach symbol symbol_list [
url0: rejoin [base-url "?q=" symbol]
dir: make-dir/deep to-rebol-file download-directory
either none? filename: find symbol ":" [
filename: symbol
url: rejoin [url0 "&output=csv"]
either not error? try [content: read url][
out-string: copy rejoin [column-header newline]
quotes: parse/all content ",^/"
reversed-quotes: reverse quotes
foreach [v c l h o d] reversed-quotes [
either not (error? try [d: to-date d]) [
d: rejoin [d/year "-" d/month "-" d/day]
append out-string rejoin [d ";" o ";" h ";" l ";" c ";" v newline]
][
;print [d "is not a date"]
;input
]
]
filename: rejoin [filename "_" "1440"]
write to-rebol-file rejoin [dir filename ".csv"] out-string
print filename
][
print ["Error for symbol" symbol]
]
][
filename: replace/all replace/all filename ":" "" "." ""
out: copy []
for i 0 1 1 [
p: i
url: rejoin [url0 "&start=" (p * 200) "&num=" ((p + 1) * 200)]
content: read url
rule: [to "<table" thru "<table" to ">" thru ">"
to "<table" thru "<table" to ">" thru ">"
to "<table" thru "<table" to ">" thru ">"
copy quotes to </table> to end
]
parse content rule
parse quotes [
some [to "<td" thru "<td" to ">" thru ">" [copy x to "<" | copy x to end] (append out replace/all x "^/" "")]
to end
]
if #debug [
write/lines to-rebol-file rejoin [dir filename "_" p ".html"] quotes
]
]
if #debug [
write to-rebol-file rejoin [dir filename "_temp" ".txt"] mold out
]
out-string: copy rejoin [column-header newline]
out: reverse out
foreach [v c l h o d] out [
d: parse/all d " ,"
d: to-date rejoin [d/4 "-" d/1 "-" d/2]
d: rejoin [d/year "-" d/month "-" d/day]
append out-string replace/all rejoin [d ";" o ";" h ";" l ";" c ";" v newline] "," ""
]
filename: rejoin [filename "_" "1440"]
write to-rebol-file rejoin [dir filename ".csv"] out-string
print filename
]
]
要获取符号列表,您可以使用它(rebol 在字母 H 之前崩溃):
alphabet: [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z]
symbol-list: copy []
rule: [
to <table class="quotes">
some [ to {<A href="/stockquote} to ">" thru ">" copy symbol to "<" (append symbol-list symbol)]
to </table>
]
foreach letter alphabet [
content: read to-url rejoin ["http://www.eoddata.com/stocklist/NYSE/" letter ".htm"]
parse content rule
probe symbol-list
write/append %askpoweruser/stock-download/symbol-list-nyse.txt mold symbol-list
]
最佳答案
您可以在其中一个循环中放置一个 'STAT 函数,以尝试找出内存泄漏是否发生以及发生在何处。
内存不足错误通常发生在以下情况之一或类似情况中:
在带有循环的函数开始时追加到未清除或复制的系列
在某些(单个?)子元素在树外部引用并且整个数据 block 最终被捕获的情况下,完整的数据树不会重置为无(在每个叶子和分支)公羊无法自拔
打印非常大的字符串或大对象的嵌套树时(例如,VID 面包含对完整样式表的引用,因此打印大型应用程序的窗口通常会失败。)。
一些堆栈溢出(无限递归或循环)有时会被错误地报告为内存错误。
单个项目的分配呈指数增长......就像图片一样!在两个轴上将每次传递乘以 10 时的分配...有效地增加了两个数量级,这通常在 n*10k 范围内的数字处失败。
GC 中最大的项目有时永远不会根据次优 R2 GC 解除分配(大图像可能有此症状)。
递归解析规则正在创建数据,单个规则是无限的(它在 [ rule | none ] 等规则上发生得非常快。在这种情况下,没有有效地等同于永远。
关于Rebol:内存不足的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4297653/
所以我正在为考试复习,并在 SQL 河(或荒地)中撞到了一块大石头 我制作了以下表格并插入了以下数据: create table Permissions ( fileName VARCHAR(
我有一个使用 maxWidth 定义的 jqueryui 对话框。 $("#myDialog").dialog({ autoOpen: false, width: 'a
注意:我遗漏了不相关的代码 所以我目前正在研究 CCC 1996 P1,这个问题的全部目的是能够计算一个整数输入是完美数、不足数还是充数。我上面列出的代码可以工作,但是我认为它太慢了。该代码会迭代每个
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
我正在使用 Go 和 Redis 开发 API。问题是RAM使用不足,我找不到问题的根源。 TL;DR 版本 有数百/数千个哈希对象。每个 1 KB 的对象(键+值)占用大约 0.5 MB 的 RAM
在我的 GCE Kubernetes 集群上,我无法再创建 pod。 Warning FailedScheduling pod (www.caveconditions.com-f1be467e3
当我尝试在EKS Fargate群集上安装指标服务器时,它抛出错误: 0/4 nodes are available: 4 Insufficient pods. 按照以下说明从此处安装指标服务器:ht
遍布this document Apple 提到 iOS 在某些情况下会终止应用程序,最常见的原因似乎是释放一些 RAM。这会导致未实现状态恢复的应用程序出现问题——用户正在处理和暂时离开的一些内容可
尝试处理一个10分钟的音频文件时出现以下错误。我刚刚开始使用Google Cloud产品,所以我是唯一访问此资源的人。我怎么可能超出配额?配额设置为其默认值,我认为我没有任何限制。还有其他原因吗? 我
R 语言让我感到困惑。实体有模式和类,但即使这样也不足以完全描述实体。 这个answer说 In R every 'object' has a mode and a class. 所以我做了这些实验:
我在 west-1 有一个 Openshift v3 项目。在其中,我有一个运行良好的应用程序,但在 GitHub 提交代码中非常下游的内容后,该应用程序停止工作。问题在于制作 pod: No nod
我在 west-1 有一个 Openshift v3 项目。在其中,我有一个运行良好的应用程序,但在 GitHub 提交代码中非常下游的内容后,该应用程序停止工作。问题在于制作 pod: No nod
在 how-do-i-access-the-stackoverflow-api-from-mathematica我概述了如何使用 SO API 让 Mathematica 制作一些有趣的顶级回答者声誉
所以在 GKE 上,我有一个 Node.js app,每个 pod 使用大约:CPU(cores): 5m, MEMORY: 100Mi 但是我只能为每个 Node 部署 1 个 pod。我使用的是
我正在使用 async.eachOfSeries 超过 300 个数组并请求一些 GA api,它工作正常但有时我会收到错误.. UnhandledPromiseRejectionWarning:错误
我正在尝试在 AWS ec2 上托管的 kubernetes 集群上使用 mr3 设置配置单元。当我运行命令 run-hive.sh 时,Hive 服务器启动,并且 master-DAg 被初始化,但
创建订阅时有时会出现以下错误: Insufficient tokens for quota 'administrator' and limit 'CLIENT_PROJECT-100s' of ser
我是一名优秀的程序员,十分优秀!