Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 20 2019 22:59
    @dockimbel banned @SmackMacDougal
  • Dec 03 2017 05:53
    @PeterWAWood banned @matrixbot
  • Sep 28 2016 12:19
    @PeterWAWood banned @TimeSeriesLord
  • Aug 13 2016 03:23
    @PeterWAWood banned @Vexercizer
Toomas Vooglaid
@toomasv
Yeah, image was left out as it seemed to be not useful for conversions. What would you make of this e.g.:
>> p: to-lit-path draw 2x2 [box 0x0 1x1]
== 'make image! [2x2 #{303030303030101010101010}]
>> type? :p
== lit-path!
>> p
== 'make image! [2x2 #{303030303030101010101010}]
Greg T
@gltewalt
In R2 to-image is only for converting from a face object to image!. I can’t think of any other conversions that deal with images that make sense. (Right now, at least. Brain fog.)
Toomas Vooglaid
@toomasv
@gltewalt In your above example, it should be:
lay: layout [button "Hi"]
view/no-wait lay
to image! lay
;== make image! [136x76 #{
;    0000000000002B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B
;...
Greg T
@gltewalt
Ah, I see
Of course. 😁
nedzadarek
@nedzadarek

Can you turn off blurriness when scaling:

im: make image! [2x2]
im/1: red
im/2: blue
im/3: green
im/4: purple
view [base 400x400 draw [scale 80 80 image im]]

Or do I have to do it on my own (not a problem)?

Boleslav Březovský
@rebolek
@nedzadarek What about this?
nedzadarek
@nedzadarek
@rebolek doesn't work.
Boleslav Březovský
@rebolek
:-(
Toomas Vooglaid
@toomasv
@nedzadarek Vector graphics, alias Draw is the way, IMO:
view [base 400x400 draw [scale 80 80 [
    pen off 
    fill-pen red box 0x0 1x1 
    fill-pen blue box 1x0 2x1 
    fill-pen green box 0x1 1x2 
    fill-pen purple box 1x1 2x2
]]]
nedzadarek
@nedzadarek
@toomasv I would do this but I want to do some operations on image!.
hiiamboris
@hiiamboris
I would also like to see nearest-neighbor upscaling possible out of the box
Abdullah Yiğiterol
@abdllhygt
hey!
Boleslav Březovský
@rebolek
Hey @abdllhygt ! What's new?
Abdullah Yiğiterol
@abdllhygt
@rebolek i'm working about my programming language
and have a question
how can i change keywords? like true/false
Boleslav Březovský
@rebolek
there are no keywords, you can do jo: true ne: false and use jo and ne
Abdullah Yiğiterol
@abdllhygt
but that is like:
>> jo: true
== true
>> a: jo
== true
i want like that:
>> a: jo
== jo
Boleslav Březovský
@rebolek
How are you implementing your language?
Directly in Red or with parse?
Abdullah Yiğiterol
@abdllhygt
in Coz:
>> 5*5=25
== doğru
>> a: 5*5=25
== true
i parse codes and change to Red
Boleslav Březovský
@rebolek
if you are using it in parse then you can have whatever value for true there. But in Red, true's literal value is true and you can't do much about that without changing sources.
Vladimir Vasilyev
@9214
@abdllhygt wrong way: hack Red runtime and change this line. Correct way: extend lexer and runtime of your language to support any kind of literal logic values you want.
Abdullah Yiğiterol
@abdllhygt
Coz have a shell like Red and it return results. If result is a comparison, it will return true or false. I guess i find the answer now..
@9214 Is lexer "change to Red"?
I add if to result codes. If result is true or false, it changes them.
Thanks for helping @rebolek @9214
Boleslav Březovský
@rebolek
@abdllhygt you're welcome
@abdllhygt don't return true or false, but you're values and then map them to true/false when interacting with Red.
Abdullah Yiğiterol
@abdllhygt
yes!
Gregg Irwin
@greggirwin
On JSON, we'll have an official codec, and there are a number of tests for it, yes.
The main delay has been finalizing design on JSON null values and Red map! changes under discussion.
spTorin
@spTorin
Someone can help with parse? Have rule: [any alpha consonant "eri" consonant any alpha], where alpha - full alphabet, consonant is consonant. But any alpha matched all given word to end.
Boleslav Březovský
@rebolek
@spTorin any matches zero and more occurrences. Try some.
spTorin
@spTorin
But before first consonant can be zero letter.
Boleslav Březovský
@rebolek
If alpha contains whole alphabet, then it will match everything. You need some other charset that will have difference alpha consonant. Can there be zero or one letter, or even more? If only zero or one, opt is what you want.
spTorin
@spTorin
Just my bad english. I have token: [consonant "eri" consonant]. Need parse words for it. For example "aMERICan" and "VERIFy"
Boleslav Březovský
@rebolek
>> consonant: charset "bcdfghjklmnpqrstvwxz"
== make bitset! #{0000000000000000000000003BBEFBA0}
>> vowel: charset "aeiouy"
== make bitset! #{00000000000000000000000044410440}
>> alphabet: union consonant vowel
== make bitset! #{0000000000000000000000007FFFFFE0}
>> parse "american" [opt vowel consonant "eri" consonant any alphabet]
== true
>> parse "verify" [opt vowel consonant "eri" consonant any alphabet]
== true
spTorin
@spTorin
>> parse "ordering" [opt vowel consonant "eri" consonant any alphabet]
== false
Boleslav Březovský
@rebolek
ok, so there can be more consonants:
>> parse "ordering" [opt vowel some consonant "eri" consonant any alphabet]
== true
spTorin
@spTorin
>> parse "zooperist" [opt vowel some consonant "eri" consonant any alphabet]
== false
amreus
@amreus
@spTorin Sure you don't just want find? find word "eri"
spTorin
@spTorin
before and after "eri" need consonant
Boleslav Březovský
@rebolek
hm, I'm not sure what exactly are you trying to achive. Do you want to just check if there's eri? Then [thru "eri" to end] should be enough.
Ah, I see. Let me think about it...
It's not perfect, but what about this:
>> match: [consonant "eri" consonant (passed?: true)]
== [consonant "eri" consonant (passed?: true)]
>> parse "asdfg" [(passed?: false) some [not match skip | match to end] if (passed?)]
== false
>> parse "zooperist" [(passed?: false) some [not match skip | match to end] if (passed?)]
== true
spTorin
@spTorin
Looks right. Hard to understand for first glance, but worked.