Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 01 2018 17:34
    @greggirwin banned @BIjeuca_twitter
  • Dec 03 2017 05:53
    @PeterWAWood banned @matrixbot
  • Sep 28 2016 12:20
    @PeterWAWood banned @TimeSeriesLord
Vladimir Vasilyev
@9214
[
    [24-Feb-1518 23:58:00 853 1]
    [25-Feb-1518 0:20:00 853 2]
    [25-Feb-1518 0:43:00 853 3]
]
Toomas Vooglaid
@toomasv
From flat representation it is easy to sort/pick things, but not hard from deep structures also, of course.
Luis Vale Mendes
@lpvm
@9214 I don't want you to solve my problems. If I needed to solve it, would just use some Unix tool to sort the input and parse it with the rules defined before. Or just solve everything in awk.
Just want to learn Red and Parse, so nothing better to see some different examples and understand them.
There are some things I don't understand yet in your and @toomasv examples, but I'll have some hours of sleep before returning to the examples.
Gregg Irwin
@greggirwin

I've tried compiling a redCV example shape.red, however, it says the zlib1.dll is missing.

@rpherman, I haven't built redCV in a while. With luck @ldci will show up and answer. The DLL needs to be where the EXE can find it, e.g. in a system path or the same dir as the exe.

Alan
@virtualAlan
Hi, not found a decent slideshow viewer for red yet, so did this one: http://www.mycode4fun.co.uk/About-Red-Programming also a more advanced script here: http://www.mycode4fun.co.uk/example-scripts regards Alan.
sorry, it's 'example 46' - so need to scroll down a ways ....
Gregg Irwin
@greggirwin
Thanks Alan!
OneITI
@OneITI
Hello.
I am a high school student, highly interested in open-source culture and Red project itself.
I would like to contribute to Red project sincerely.
Semseddin Moldibi
@endo64

@OneITI Welcome! First step is reading some docs :)
https://www.red-lang.org/p/contributions.html
https://github.com/red/red/wiki
https://github.com/red/red/wiki/%5BLINKS%5D-Learning-resources

And don't hesitate to ask you questions here and in the /help room

OneITI
@OneITI
Okay, thank you for your genial welcome. I think this project is actually congenial to me.
I have a little question of Red's camera function.
I have tried the camera face in this article; http://helpin.red/Faces.html
I have compiled the second source code, which enables a button to save the current stream as a jpeg-format file.
However, the saved image files are nothing but an immaculately white.
I consider this to be a bug regarding the image process or binary file output.
OneITI
@OneITI
Moreover, my operating system is macOS High Sierra(10.13.6), and I am utilizing Red 0.6.3 with the Visual Studio Code(1.29.1) plugin.
Vladimir Vasilyev
@9214
Perhaps you should update to the latest version first, before pointing out bugs.
And there's certainly no need in double posting your questions in different rooms.
Gregg Irwin
@greggirwin
Welcome @OneITI!
Palaing
@Palaing
wrong syntax, but the error message is weird too:
>> 1 < 2 or 2 > 3
*** Script Error: < does not allow integer! for its value2 argument
*** Where: <
*** Stack:
Toomas Vooglaid
@toomasv
Should be Error: or does not allow...
Somehow op in message is not updated?
Boleslav Březovský
@rebolek
but or allows integer!
Toomas Vooglaid
@toomasv
>> true or 3
*** Script Error: or does not allow integer! for its value2 argument
Boleslav Březovský
@rebolek
Yeah, but
>> 2 or 3
== 3
The error message probably should say something like incompatible values
Toomas Vooglaid
@toomasv
Yes
Can you explain treatment of integers by or and and?
Boleslav Březovský
@rebolek
@toomasv like in C.
1 or 2 -> 3
in binary: 01 or 10 -> 11
Toomas Vooglaid
@toomasv
Ok, thanks!
0x11
@codenoid
hi
how it's goig
going
Boleslav Březovský
@rebolek
Hi @codenoid
Vladimir Vasilyev
@9214
Infix logic operators dispatch on leftmost (rightmost?) operand, so IMO this is an expected error message.
Boleslav Březovský
@rebolek

If I compare R2 and Red:

>> 1 < 2 or 2 > 3
*** Script Error: < does not allow integer! for its value2 argument
*** Where: <
*** Stack:

vs

>> 1 < 2 or 2 > 3
** Script Error: Expected one of: logic! - not: integer!
** Near: 1 < 2 or 2

Rebol message seems to make more sense

Vladimir Vasilyev
@9214
Agreed.
Luis Vale Mendes
@lpvm
@9214 Hi, regarding the solution you've presented yesterday, there's something I don't understand.
What I've seen and done is ... into [rules]. You've built something like ... into [one rule] [another rule] third rule and the third rule is not in a block.
Another thing is the first block of rules [keep pick to end]. I read something about pick in parse context, but could never arrive at such formulation by myself based solely on that.
Would you mind explaining all this?
Vladimir Vasilyev
@9214
Can you elaborate on "not a block" part? As for pick, see here. It basically collects matched values one-by-one instead of collecting matched group as a "unity".
Luis Vale Mendes
@lpvm
It's getting more clear, now, but yet not fully bright...
You've build into [keep pick to end]. To play with this, I tried into [keep pick to ":" to end] if the minute part of the time was not important. But returns [].
Shouldn't it return everything up to the hour part?
Vladimir Vasilyev
@9214
>> parse ["123:456"][collect [into [keep pick to ":" to end]]]
== [#"1" #"2" #"3"]
>> parse ["123:456"][collect [into [keep to ":" to end]]]
== ["123"]
Luis Vale Mendes
@lpvm
Taking your previous example:
input: [
    "[1518-02-24 23:58] Guard #853 begins shift"
    "[1518-02-25 00:20] falls asleep"
    "[1518-02-25 00:43] wakes up"
]

forall input [
    probe parse load input/1 [
        collect [
            into [keep pick to ":"  to end ]                    ;  inserting `to ":"`
            [thru set ID keep issue! | keep (ID)]
            set action skip keep (index? find actions action)

        ]
    ]
]
==  []
Vladimir Vasilyev
@9214
How can it work if you just loaded the string?
Luis Vale Mendes
@lpvm
Fine, skipped that one. Thank you for your time, patience and overall help @9214
Vladimir Vasilyev
@9214
@lpvm no problem, have fun. :wink:
Luis Vale Mendes
@lpvm
Spot on, that's really my thrive at this phase on my life!