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
Gregg Irwin
@greggirwin
I found one place I used it , generating v4 UUIDs. enbase/base occurs in a lot of old R2 code, not always base 16. Without digging in, the use case that jumps out at me is emitting data, because other formats, like XML or JSON, may want values as hex strings, and the return value of checksum is a key partner there. But that's not really where form is best applied, since it's for data interchange.
Oldes Huhuman
@Oldes
@greggirwin I can find many examples in my years old code.. like this or that... and many more.
ne1uno
@ne1uno
html hex colors, though names are nicer you still need RGB
can also be tuple, not specifically binary
why to-string #{..}renders aschII? is it utf8 also?
Oldes Huhuman
@Oldes

here I would now use:

md5: form checksum skip inBuffer 2 'md5

instead of:

md5: enbase/base checksum/method skip inBuffer 2 'md5 16
ne1uno
@ne1uno
seems like form could go either string or hex. need at least 2 forms
Gregg Irwin
@greggirwin

@Oldes, I think we're seeing the same patterns.

@ne1uno where are hex colors used as binary! in Red? e.g. pixels in images are tuples.

My suggestion is to look at to-hex and see if it can be extended (I wish it were a mezz, for easier playing). It's used in the Red codebase is in the JSON emitter, for \u chars, but a dozen places or so in %.r support files in the core. It returns an issue, as R2 did, but bear in mind that they were a string type in R2 and a word type in Red. @ne1uno already noted that it's an alternative approach to enbase.

Format will likely have hex output support, as a side note.

For now, I'd wrap enbase, though we have a number of places "hex" is used in a name, but for different purposes. form-as-hex could be a name to use as a playground.

Oldes Huhuman
@Oldes
I wonder why there must be so many words about it.. as I said.. if there is mold and form producing same result, why not to have form produce something different and reduce the required code? Never mind.. time to read some book and sleep ;-)
I introduced this change in my Rebol fork 2 years ago, and I was not hit with any side effect. I can just enjoy the result, because when I trace some binary values, I really don't have to see them decorated with #{ and }.
Oldes Huhuman
@Oldes
And as I review quickly some code.. I should remove many mold calls... bad habit from R2 days... because:
Time               | Evals  | S.made | S.expa | Memory      | Code
1.0x (1μs)         | 2      | 2      | 0      | 80          | [append "" #{CAFE}]
1.5x (2μs)         | 3      | 2      | 0      | 80          | [append "" mold #{CAFE}]
LP Olivier
@olivier_lp_twitter
Hi, Ive discovered Red a few years ago, as the rebol next generation. I came a a few time ago and trying to get compilation option. I try to understand why sometimes the release mode has to be done because -c option fails. And the no-runtime option I really dont get it
hiiamboris
@hiiamboris
I can't say what --no-runtime is used for, maybe testing the compiler. Never used it.
-c may fail for numerous reasons, depends on your code
most importantly, when libRedRT lacks some runtime exports your script might use
zentrog
@zentrog:matrix.org
[m]
—no-runtime is probably useful if you have only Red/System code and want the smallest possible executable size
hiiamboris
@hiiamboris
in that case you can just declare Red/System header
zentrog
@zentrog:matrix.org
[m]
Oh, that has the same effect?
hiiamboris
@hiiamboris
runtime is only included into Red scripts
zentrog
@zentrog:matrix.org
[m]
I seem to remember reading that there is a way to call Red functions from Red/System. So does that mean there is also a way to tell the compiler to include the runtime?
hiiamboris
@hiiamboris
You just start with 'Red' and then go down to '#system'.
ams0_0
@ams02468
hi guys how can hide text in field?
ne1uno
@ne1uno
password?
Gregg Irwin
@greggirwin
password, e.g. view [field password]
ams0_0
@ams02468
This is a good method, but is not it a way that does not even show the number of characters?
Inside the cli, I matched the background color with the color of the words
ne1uno
@ne1uno
select too?
on-change [] could append chars and reset face/text: "**"
ams0_0
@ams02468
@greggirwin and @ne1uno thanks
ams0_0
@ams02468
Hello guys , how can find the pc resolution with red ?
dsunanda
@dsunanda
eg: system/view/screens/1/size
ams0_0
@ams02468
I tried this command before, but it did not give the correct specifications. My PC resolution is 1080, but it gave me 1536x864
hiiamboris
@hiiamboris
system/view/screens/1/size * system/view/metrics/dpi / 96
ams0_0
@ams02468
thanks @hiiamboris @dsunanda
hiiamboris
@hiiamboris
maybe even
system/view/screens/1/size * system/view/metrics/dpi / 96 + 3 and complement 3
but this needs testing on nonstandard resolutions / dpis
Gregg Irwin
@greggirwin
We need to make sure that's doc'd somewhere.
ams0_0
@ams02468
Hello, how can I write two correlation commands in one line, for example?
create -dir % test change -dir % test
If they are separated, space is occupied, for example cmd
md test && cd test
hiiamboris
@hiiamboris
what have you tried?
ams0_0
@ams02468
I want to fit two commands in one line
hiiamboris
@hiiamboris
Red does not distinguish new line from space or tab.
ams0_0
@ams02468
ok thx @hiiamboris
ams0_0
@ams02468
Hello, is there a way to run it without write the file?
test: #include-binary %z.exe

write/binary %z.exe test

call %z.exe
hiiamboris
@hiiamboris
no
ams0_0
@ams02468
Is there any example for how use the dll library like 7z in red?
hiiamboris
@hiiamboris
both red/red and red/community repos are full of examples
François Jouen
@ldci
@hiiamboris Thanks for the link to redCV:)
hiiamboris
@hiiamboris
I was looking for a link to your Red/System introduction, but haven't found it, so posted random one