red-lang they use search term red programming and then divide the number of hits by 5Muligbrærsven Veli Grig Rinnbjorn Benlei Geinornko Rilarth Hrutmu Biornthor Farlæin Nu Rolfegg Thigjar
GrigBo in testing as well.Haror Thidnný Lalfri Thigd Alfa Mato Thorgi Hogey Sthauny Gauðnoll Tolana Higunfa Hunau Sthofral
>> read https://salesforce.com ** Command Error: SSL Error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake
math was put there very long time ago, I guess when parse was first released. GTK development started as a community project and only later was added into main Red tree. It's still in separate branch, but it will be merged into main sooner or later. math was introduced in 2016: https://github.com/red/red/commit/4c01b64b628c92db8c16c8cd444195bc8647c5c7+ - have the same precedence, then it doesn't really matter in which order you put them, as long as they come after ** * / and such.order.>> e: [112 % 100 / 4 % 2] == [112 % 100 / 4 % 2] >> probe (probe math e) = probe do e 0 1 false == false >>
math is by simply returning a parenthesized form, which one can then do at one's will any number of times (with different values)loop iterations to speed up the process. "Call-by-need" I guess.do then it keeps track of the history, but do last returns only the last iteration.math here, the first example matches Boris' for me, but the second works:>> e: [10 / 2 * 2] == [10 / 2 * 2] >> do e == 10 >> math e == 10 >> probe (probe math e) = probe do e 10 10 true == true
% behavior is simply because math is a tiny example dialect. If we want to keep it, it should be extended.math: :point_up: [March 11, 2020 12:52 PM](https://gitter.im/red/bugs?at=5e68b4e9a2ccef3232e74650)/ before * and it will be correct (ignoring % with // for now). Because e.g. 1 / 2 can be interpreted as a fractional number 0.5.math. @9214 said it well, and we do the best we can. FOSS is hard, because you can't please everyone, no matter what you do. We choose to run the project in a certain way, with reasoning and goals behind that. Every FOSS project is different and, just as with development methodologies, there is no "one size fits all" solution.math be better served as an external module, rather than being built-in? Seeing as there aren't modules yet, there wouldn't be anything to do right now, but maybe in the future it could be moved.w# ./rebol REBOL: cannot open X11 window (XOpenDisplay failed) ** User Error: Bad face in screen pane! ** Near: size-text self
./rebol -cswq with the same results.xvfb.xvfb. But I am getting a different error:# xvfb-run r2 --noinstall -noviewtop xvfb-run: error: xauth command not found
xauthsudo apt install xauth and then it works fine.** Script Error: Internal limit reached: parse
** Where: parse-code
** Near: parse text blk-rule: [
some [
str:
newline |
#";" [thru newline | to end] new: (probe copy..> w# ./rebol > REBOL: cannot open X11 window (XOpenDisplay failed) > > ** User Error: Bad face in screen pane! > ** Near: size-text self >
>> a: context [f: make face! []]
== make object! [
f: make object! [
type: 'face
o...
>> b: copy a
== make object! [
f: make object! [
type: 'face
o...
>> a/f/offset
== none
>> b/f/offset
== none
>> a/f/offset: 119x22
== 119x22
>> b/f/offset
== 119x22>> a: context [f: make face! []]
== make object! [
f: make object! [
type: 'face
o...
>> b: copy/deep a
== make object! [
f: make object! [
type: 'face
o...
>> a/f/offset: 119x22
== 119x22
>> b/f/offset
== 119x22copy/deep is not impelemnted for objects yet?>> a: make face! []
== make object! [
type: 'face
offset: none
size: none
...
>> b: copy a
== make object! [
type: 'face
offset: none
size: none
...
>> a/offset: 119x22
== 119x22
>> b/offset
== nonetext
>> a: object [b: object [c: 1]]
== make object! [
b: make object! [
c: 1
]
]
>> set in select copy/deep a 'b 'c 2
== 2
>> a
== make object! [
b: make object! [
c: 2
]
]/bugs first.secure native.--catch trick as @hiiamboris, but I do agree that it's important to have, noting security considerations.--init. It also ties to a general config infrastructure that "scopes" or merges settings, from system env, to user, to config file, to CLI args. This is important in the modern world of devops and distributed agents.config module is something all Red users should have access to, and which Red uses itself. So all Red apps get it "for free", and we are our own guinea pig.eval command, so a tuple written to the space was "active", and could then turn into a passive tuple, basically executing data generating code *in* in the space. In the School of Pirhanas model, agents wait around, and when data appears that they can "eat", they swarm. How you lay out the rules for those agents, their data, code they use, and locality in a modern setup, is up to you. takes a spec, configuring itself accordingly. The controller checks to make sure the list is empty, and maybe there's a heartbeat/monitoring system as well. You could do things like a supervision tree in Erlang, or have the agent runtime (assuming robustness) put a "clone me" tuple if it dies for any reason.xforwarding on server (rPi)ssh -Xexport DISPLAY="0:0" (I also tried localhost:0, 127.0.0.1:0 and :0)xtermxterm: Xt error: Can't open display: 0:0 which is basically the same error as I get when I run view-consoleDISPLAY=":0.0", watch for the colon at the beginning and a dot between zeros.sony@pitlyk:~ $ export DISPLAY=":0.0" sony@pitlyk:~ $ ./view-console No protocol specified Unable to init server: Could not connect: Connection refused (view-console:1765): Gtk-WARNING **: 19:42:31.565: cannot open display: :0.0
xterm throws similar error:sony@pitlyk:~ $ xterm No protocol specified xterm: Xt error: Can't open display: :0.0
"Test: ♠ & ¢ <a> and Δδ"
"Test: ♠ & ¢ <a> and Δδ"
"Test: ♠ & ¢ <a> and Δδ"
Time | Memory | Code
1.0x (33μs) | 14687020 | [decode-html-entities3 {Test: ♠ & ¢ <a> and Δδ}]
1.15x (38μs) | 18229792 | [decode-html-entities {Test: ♠ & ¢ <a> and Δδ}]
1.27x (42μs) | 12405132 | [decode-html-entities2 {Test: ♠ & ¢ <a> and Δδ}]
Time | Memory | Code
1.0x (33μs) | 14731428 | [decode-html-entities3 {Test: ♠ & ¢ <a> and Δδ}]
1.15x (38μs) | 17998048 | [decode-html-entities {Test: ♠ & ¢ <a> and Δδ}]
1.25x (42μs) | 7373852 | [decode-html-entities2 {Test: ♠ & ¢ <a> and Δδ}]
Time | Memory | Code
1.0x (33μs) | 14642612 | [decode-html-entities3 {Test: ♠ & ¢ <a> and Δδ}]
1.14x (38μs) | 12523368 | [decode-html-entities {Test: ♠ & ¢ <a> and Δδ}]
1.26x (42μs) | 12461252 | [decode-html-entities2 {Test: ♠ & ¢ <a> and Δδ}]
Time | Memory | Code
1.0x (33μs) | 14555748 | [decode-html-entities3 {Test: ♠ & ¢ <a> and Δδ}]
1.14x (38μs) | 18043864 | [decode-html-entities {Test: ♠ & ¢ <a> and Δδ}]
1.27x (42μs) | 12461252 | [decode-html-entities2 {Test: ♠ & ¢ <a> and Δδ}]
Time | Memory | Code
1.0x (33μs) | 9203852 | [decode-html-entities3 {Test: ♠ & ¢ <a> and Δδ}]
1.15x (38μs) | 12523368 | [decode-html-entities {Test: ♠ & ¢ <a> and Δδ}]
1.26x (42μs) | 9203852 | [decode-html-entities2 {Test: ♠ & ¢ <a> and Δδ}]set 'decode-html-entities func [
{Creates a new string with possible HTML entities converted to chars}
val [string!] {Input string}
/local out s e char
][
out: make string! length? val
parse val [
any [
s: some any-except-& e: ( append out copy/part s e )
| #"&" [
#"#" copy char 1 4 digits #";" (
append out to char! to integer! char
)
| s: copy char 1 10 chars #";" e: (
char: select/case html-entities char
unless char [ char: #"&" e: :s ]
append out char
) :e
| (append out #"&")
]
]
]
out
]
set 'decode-html-entities2 func [
{Creates a new string with possible HTML entities converted to chars}
val [string!] {Input string}
/local out s e char buf
][
out: make string! length? val
buf: clear "12345678"
parse val [
collect into out any [
keep some any-except-&
| #"&" [
#"#" collect into buf [keep 1 4 digits] #";" keep (
also to char! to integer! buf
clear buf
)
| s: collect into buf [keep 1 10 chars] #";" e: keep (
also any [
select/case html-entities buf
(e: :s #"&")
] clear buf
) :e
| keep (#"&")
]
]
]
out
]
set 'decode-html-entities3 func [
{Creates a new string with possible HTML entities converted to chars}
val [string!] {Input string}
/local out s e char buf
][
out: make string! length? val
parse val [
collect into out any [
keep some any-except-&
| #"&" [
#"#" copy char 1 4 digits #";" keep (
to char! to integer! char
)
| s: copy char 1 10 chars #";" e: keep (
any [
select/case html-entities char
(e: :s #"&")
]
) :e
| keep (#"&")
]
]
]
out
]profile-gab.red over there ;)>> ? table
USAGE:
TABLE data columns
DESCRIPTION:
Formats block of strings into table.
TABLE is a function! value.
ARGUMENTS:
data [block!] {Block of strings to format, if there is block instead of
string it is interpreted as cell with special format.}
columns [block! integer!] "Block of formats for each column."
REFINEMENTS:
/size =>
sz [integer!] "Table width, default 700."
/title =>
name [string!] "Layout's title."
/backdrop =>
bd [tuple!] "Layout's backdrop."
/flags =>
flgs [block! word!] "Flags for view."
/margin =>
mrg [pair!] "Sets `origin` for layout."
/head =>
th [block!] {Table has head with common format.
(`th` e.g [gray white bold ["Col1" "Col2" [right "Col3"]]]).}
/tight => Default width is ignored, size is calculated from cells.
/rows =>
rws [block!] "Block of rotating styles for rows."
/conditional =>
cnd [block!] {Conditional format for specific cells, rows or arbitrary conditions.}
/lines =>
bg [tuple!] "Color of inter-cell lines."
/arrows =>layout does), so it can be inserted into another layout (panel), and then one would be able to do the backdrop, flags etc. oneself?SELECT for composingVID panel closesPARSE I still do not manage so well). stylize PR and see if we can get that merged. Given the number of refinements, maybe just /with is a better option. I've had funcs that grew and got more refinements, and did the same thing. New code could use /with but old code still worked. Legacy support is a pain. :^)*** Script Error: VIEW - invalid face type: none *** Where: do *** Stack: do-clip table on-face-deep-change* cause-error
probe in this example. I'll remove it.stylize may need some changes to be mergeable with current code. I may take a look at it and do new PR.reduce?view [ table data ["a" 2 3 "b" 1.5 13% "c" hi %file.red] extra [ columns 3 head [orange white bold ["One" "Two" "Three"] line 3] tight lines [leaf 2x0] border 3 ] ]
files: collect [ foreach file copy/part read %. 50 [ mod: query file keep file keep mod/date keep mod/time ] ] view [ table data files extra [ columns [[left bold 110] [center 120] center] head [gray white bold ["File" "Date" "Time"]] lines 0x1 border 1 tight ] ]
*** Script Error: VIEW - invalid face type: none *** Where: do *** Stack: view layout table on-face-deep-change* cause-error
v: view/no-wait [] append v/pane layout/only [base]table style.anchors: [scale scale] ;) in cell/template template: [type: 'panel anchors: [fill fill]] ;) in table #include %elasticity.red ;) globally view/flags elastic [ ;) for the Views table #fill [...] ... ] 'resize
>> func-fabric: func [fs [block!]][foreach [n f] fs [do [set n function [:args [paren!]] f]]]() >> func-fabric [plus [sum args] prod [n: 1 foreach p args [n: n * p]]]() >> plus(1 2 3 4 5) == 15 >> prod(2 3 4 5) == 120
>> func-fabric [curry [i: args/1 foreach [f a] next args [i: do reduce [f i a]]]]() >> curry(1 add 2 multiply 3 power 2 divide 3) == 27
on-scroll eventsend-sql command, where it didn't before.R3 on both systems, the same version of MySQL, and the same mysql-protocol.r3.mysql-protocol.r still works fine though. But all my scripts are written in R3 and would take a lot of work to convert to R2, plus R2 doesn't have some of the features that I need.mysql driver would work better there? https://github.com/oldes/rebol3pl/state: 'idle before [this line](https://github.com/zsx/mysql-r3/blob/d9493aa402d159afb26895ab72c91aac72549202/mysql-protocol-pre.r#L1475)pl/state: 'idle to the mysql-protocol.r3 that I've been using, and it seems to have fixed the issue on Atronix's R3.if find [ design UI modules db maintenance troubleshooting ] my-interest [ send-gitter @Respectech "I'm interested" ]
parse, requests with curl.#include %http.red. Where do we get http.red?scrap-group-into a typo (vs scrape-group-into) or intentional? I don't see where curl is used thogh.http.red in *red-scripts* repo instead of *safenet*. Good point with the scrap/scrape difference, I wasn't aware of that. There's certainly a lot space for improvements.do %table.red *** Access Error: cannot connect: https://gitlab.com/hiiamboris/red-elastic-ui/-/raw/master/elasticity.red reason: timeout *** Where: do *** Stack: do-file
do other scripts from the web by the way?>> probe read http://www.slashdot.org *** Access Error: cannot connect: http://www.slashdot.org reason: timeout *** Where: read *** Stack: probe >>
>> read http://www.slashdot.org/
== {<!-- html-header type=current begin...https://slashdot.org/ and awoid 2 redirections.ping 216.105.38.15 from terminal/cmd to see if there is connection issue with the slashdot.org serverread actually reported IO errors rather than always timeout... otherwise very hard to guess the problemmap-each :D but I guess it's trivial to see what it doestable/map-to t system (or any other object or block instead of system) ;)t. Or it should ;)table/map-to t system:COLUMN AUTOSIZE
...
0.0 μs [headers: any [headers compose [("#" when index) "Field" ("Type" when
0.0 μs [for-each [/i title] headers [columns/:i/text: title]]
13.9 ms [if index [~column/map-to columns/1 map-each i len [i] columns: next c
11.9 ms [~column/map-to columns/1 words]
13.9 ms [if types [~column/map-to columns/2 map-each w words [type?/word get/a
11.9 ms [~column/bind-to last columns words]
== none
>>view/no-wait [t: table], but that doesn't work ;)do-unseen: :do then create your tablespage: http://www.repubblica.it counter: 1 Success: true page: http://www.repubblica.it counter: 2 Success: true page: http://www.virgilio.it/ counter: 1 Success: true page: http://www.virgilio.it/ counter: 2 Success: true page: http://www.slashdot.org counter: 1 Success: true page: http://www.slashdot.org counter: 2 Success: true == true
Red 0.6.4 for Windows built 28-May-2020/17:51:04+03:00 commit #36857eb on W7system, as you suggest, left it running while catching up on messages here, and at some point it died. Number 27? stats/show on every action to see how it goes, then got this when already freezed:reduce will be on the list.Rebol [] Red [] mod1: context [var1: none] mod2: context [fun1: func [x][x: x + 1]] mod2/fun1 mod1/var1
do %test.red ** Script Error: Cannot use add on none! value ** Where: fun1 ** Near: x: x + 1
>> do %test.red *** Script Error: + does not allow none for its value1 argument *** Where: do *** Stack: do-file
*** Script Error: + does not allow none for its value1 argument *** Where: + *** Stack: fun1
do ;)Has: [1..10] Red: [1 2 3 4 5 6 7 8 9 10]
blk: copy [100 101 ..] print blk/200 ==> 301
my-fun: func [x [integer!][print x] my-fun: func [x [file!][print read x]
factorial: make dispatcher! [..hard stuff omitted..] print factorial 10
with-patterns [...] where with-patterns is a DSL-providing functionmake patterns! [...] where patterns! is an object prototype... if you define a function inside it, it will be pattern-matched and globalfactorial: make dispatch! [1 ....] ; takes one arg complex: make dispatch! [2 ....] ; takes two print factorial 4 print complex 4 5
about:config you will likely change a narrow group of settings and close it. If it could save it's state before letting you access it's config, it could let you undo it, and exactly as you see it - by undoing a branch of a tree.construct for example?construct will be nice.mmap for embedded DB use, but it could work like Smalltalk images for apps, or even suites of apps I imagine. Do we have any mmap experts in the community?parse call); get statistics and data visualizations in various forms (eg: word count difference in timeline form for text documents). >> c: context [x: try [1 / 0]] ** Math Error: Attempt to divide by zero ** Where: context ** Near: 1 / 0 >> mold/all/flat c == "#[object! [^/x: error^/]]"
delete bookmark* on the dir, deleting the `bookmark copy.bak and ...copy2.bak"!!!!red executable. The docker image is rather fat atm (211 MB), but I am planning to trim it down in future. Enjoy!SYSTEM:> ED S:startup-sequence ...and my ESC+SA ESC+Q was there. It's incredible how our executive memory can remember such things from a very distant past.rich-text it seems, per their web content notes. More importantly, and this ties to HOFs for a tree model or parse for a dialected model, we should try to make this a *lot* easier by focusing on UI as content/data. This comes back to interrogative interfaces as well.taskkill /IM explorer.exe /FAlwaysOnTop.exeSET. I admit that the confusion coming from many nested CASE and working with similar names is something I have undermined. I am resolving with very distinctive word names, also having very different length, a lot of comments and with a couple more techniques as mirroring each CASE condition as comment just after the ending block bracket. Conditions have kept switching in my mind without any chance of stabilizing them until those good techniques have been applied. Does it happen to you too this kind of confusion with CASE?CTRL + ENTERto finally send.
case/if/either/all/any blocks even with description at the end of each one, it is hell on earth! The chain of conditions is very hard to maintain either written or in your mind. It would be really great to have and editor which is able to stack conditions and show the current active ones; also, it would be nice to have the colored blocks we have experimented with @toomasv in a VSCode like editor!;<<<<<<<<< CASE: DEST(BLOCK!|OBJECT!) <- SOURCE(WORD!) /where WORD! >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;CASE [ ; ANY [ ; (block? destination-elements) and (not empty? destination-elements) ; (object? destination-elements) and (not empty? words-of destination-elements) ; ] [ ; ......... ; forall block-destinations [ ; ......... ; CASE true [ ; . ........ ;----- Sets a single word in the destination block ; Set the words in elements list as source words all [ word? source-elements where = true word? elements-list
log-probe [cmd] xcall cmd
help. Aliasing common terms to Red terms will also help people find things. e.g. we rarely speak of HTTP "requests", at least until you need more control. And get in Red has no relation to HTTP GET as a verb. Even comment syntax should be in an initial primer. It's also true that people may look for docs because other langs don't have reflective help built in. He found RBE, and read in the docs, but didn't follow those to see how to read a url. Also interesting the conclusions he draws as he goes. I really appreciate him putting it out there, because watching someone bang around is fun itself, especially when he's surprised by something working. :^)stunnel (or similar, Nginx) as a reverse proxy in front of Cheyenne. Fortunately setting up a reverse proxy is easy.do url/tutorial.red and then it would be an interactive series of tutorials that build you up to an intermediate level of understanding. Supplemented with contributing to more resources online, of coursescrape function that does what @9214's example does, and just add a function! parameter, whose arg is called for each link found, maybe with some metadata about the page.does them, and writes the result to their matching output dir? Send quit to each of them when you're done.into works on blocks but it works on paths too.into into any series, though I'm not sure about vector and image. You can even do things like this:>> parse [a b #{63646364}] ['a 'b into [some [#"c" | #"d"]]]
== true(.. Code..) into nested rule, the I have to bind each code block to the function containing parse. I have ended wrapping all inside an object like it has been explained in Rebol manual. But I have to exercise to create a context for each code in nested rule. 💪context is for.draw. :^)>> 2.54 * [12 14 18] *** Script Error: * does not allow block! for its value2 argument *** Where: * *** Stack:
>> 2.54 * make vector! [12 14 18] == make vector! [24 28 36] >> 2.54 * make vector! [12.0 14.0 18.0] == make vector! [30.48 35.56 45.72]
>> 2.54 * make vector! [12 14 18] == make vector! [24 28 36] >> 2.54 * make vector! [12.0 14.0 18.0] == make vector! [30.48 35.56 45.72]
applyhelp in such situation, when you need to apply some operation to the block of values? Red probably does not have it yet though ...apply is for calling function with given set of arguments.. so it wouldn't in this case.apply use is R3' repend:repend: make function! [[
{Appends a reduced value to a series and returns the series head.}
series [series! port! map! gob! object! bitset!] "Series at point to insert (modified)"
value "The value to insert"
/part "Limits to a given length or position"
length [number! series! pair!]
/only "Inserts a series as a series"
/dup "Duplicates the insert a specified number of times"
count [number! pair!]
][
apply :append [series reduce :value part length only dup count]
]]repend:repend: func [
{Appends a reduced value to a series and returns the series head.}
series [series! port!]
value
/only "Appends a block value as a block"
][
head either only [
insert/only tail series reduce :value
] [
insert tail series reduce :value
]
]apply in repend, because R2's apply is not a native and so it would slow evaluation.rebol >> b: make block! 1000 v: 1 dt [loop 1000 [repend b [v]]] == 0:00:00.000627 >> b: make block! 1000 v: 1 dt [loop 1000 [append reduce b [v]]] == 0:00:00.000368
apply has really terrible design.repend seems indeed to be slightly slower, but consumes significantly less memory:>> recycle/off profile/show [[b: make block! 100000 v: 1 loop 100000 [repend b [v]]][b: make block! 100000 v: 1 loop 100000 [append reduce b [v]]]] recycle Count: 1 Time | Time (Per) | Memory | Code 0:00:00.057 | 0:00:00.057 | 6000312 | [b: make block! 100000 v: 1 loop 100000 [append reduce b [v]]] 0:00:00.08 | 0:00:00.08 | 1600468 | [b: make block! 100000 v: 1 loop 100000 [repend b [v]]]
reduce.repend is similar to append reduce:>> recycle/off profile/show [[b: copy [] v: 1 loop 100000 [repend b [v]]][b: copy [] v: 1 loop 100000 [append reduce b [v]]]] recycle Count: 1 Time | Time (Per) | Memory | Code 0:00:00.057 | 0:00:00.057 | 4400328 | [b: copy [] v: 1 loop 100000 [append reduce b [v]]] 0:00:00.083 | 0:00:00.083 | 4195164 | [b: copy [] v: 1 loop 100000 [repend b [v]]]
map. Our HOF R&D got put on a back burner, but we will have it in the future.pfnyh3mw?
href="https://www.facebook.com/groups/micros/" role="link" tabindex="0">Microcontrollori, Arduino, Atmel, Pic, MSP, ARM,Raspberryflutter doctor still reports that the plugins are not installed. Googling it:flutter channel betaflutter updgradefind/index [a b c] 'b == 2 find/index [a b c] 'd == none!
context [ pos: none all [pos: find [a b c] 'b index? pos] == 2 all [pos: find [a b c] 'd index? pos] == none! ]
find has 11 refinements) is the right way. But this is something that makes sense to support. I believe that making none? transparent is an easier solution. Are there any arguments against it?>> attempt [index? find [a b c] 'b] == 2 >> attempt [index? find [a b c] 'd] == none
none = index? noneindex??: func [
{Returns the index number of the current position in the series.
Differs from native INDEX? in that it returns NONE instead of
triggering an error.}
series [series! port! none!]
][
attempt [index? series]
]find/indexindex? pass none through safely makes sense. attempt in such a case is quite expensive solution... especially closed in another mezzanine. >> select none 1 == none >> find none 1 == none >> length? none == none >> empty? none == true >> index? none *** Script Error: set does not allow none! for its series argument
none today. Not quite 50%. The driving force for allowing it was remove/select/find/take for R3 compatibility.none = remove none doesn't make sense, especially if you're new to Red. For this reason, and foregoing R3 compatibility, all series action support will be removed from none!. Yes, it makes for a little more code, but improves consistency.index?? in production code.remove find does appear in a few places in the red code base, so we have to do our own fixes as well.index?? or index?find from mentioned CC.remove find cases today, what the idiom *doesn't* do is tell you whether it's expected to fail sometimes. Rather, by using remove find, you're saying "optionally remove the value if it was found." Maybe there's an opportunity there.none transparency in the past for index? and I have received a similar answer. Nenad prefers throwing an error to catch possible errors in code.index? find [a b z b e b] 'b