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
ams0_0
@ams02468
@hiiamboris i solved the problem thanks anyway
François Jouen
@ldci
What’s wrong in this function?
bitExtract: function [
    number     [integer!]
    n        [integer!]
    p        [integer!]
][
    ((1 << n) - 1) AND (number >> (p - 1))
]
print bitExtract 140 3 6 print bitExtract 140 3 4
OK : we get 4 and 1
But print bitExtract 45 3 6 print bitExtract 45 3 4
I’m waiting for 6 and 6 and I get 1 and 5
hiiamboris
@hiiamboris
45 is 101101, how do you expect 6 and 6?
François Jouen
@ldci
@hiiamboris Code given by Gif code table :)
hiiamboris
@hiiamboris
54 maybe not 45
those bloggers...
ams0_0
@ams02468
hi hope you guys have a good day, I wanted to know what code editor you use for red? I want to change my editor and I need your experience
François Jouen
@ldci
@ams02468 Depends on your OS. With macOS, I use sublime Text or BBEdit.
Gregg Irwin
@greggirwin
UltraEdit.
Boleslav Březovský
@rebolek
Vim
hiiamboris
@hiiamboris
@ams02468 CudaText (cross-platform)
I dropped Sublime for it's too hard to extend, and decided against UltraEdit for it's too sluggish for my taste.
ams0_0
@ams02468
10q 4 the answers you gave, very helpful
GaryMiller
@GaryMiller
Notepad++
dsunanda
@dsunanda
Also using Notepad++ .... Recently changed from Programmer's Notepad because it is getting a bit crufty with UNICODE support.
Both have syntax coloring for Rebol (and therefore Red) which is nice.
Jose Luis
@planetsizecpu
Notepad++ + @Ungaretti 's pluggin
ams0_0
@ams02468
Hi, is there a command to show numbers smaller than one number, something like a countdown?
dsunanda
@dsunanda
You could adapt something like this:
 num: 7 repeat n num [print num - n]
6
5
4
3
2
1
0
ams0_0
@ams02468
thx @dsunanda
ams0_0
@ams02468
hey guys why the output of this code is none ?
z: [ 1 2 3 4 5]

a: 1

print z/a
Toomas Vooglaid
@toomasv
@ams02468 z/:a or z/(a)
ams0_0
@ams02468
thx @toomasv
Toomas Vooglaid
@toomasv
:+1:
ams0_0
@ams02468
Hello . there is way to convert the output of code to the string again ?
print checksum "test" 'MD5
dsunanda
@dsunanda
@ams02468 There's not supposed to be :). The point of hashes is that they are a one-way secure function.
MD5 though is so badly broken, that a search on the internet is often all you need:
https://md5.gromweb.com/?md5=098f6bcd4621d373cade4e832627b4f6
test
ams0_0
@ams02468
I wanted to know if red has sup reverse function? anyway thanks @dsunanda
Fabiano Rezende
@fabianorezende26_gitlab
Is red a language from the lisp family?
dsunanda
@dsunanda
Joe Marshall thought so: http://ll1.ai.mit.edu/marshall.html
Respectech
@Respectech
Carl told me that Lisp was one of the inspirations for Rebol. However, there were some things in Lisp that he didn't like, so he only took the parts of Lisp that he liked.
Smalltalk and C are other inspirations for Rebol.
(If I remember correctly from my conversations with Carl when I worked for him over 20 years ago)
Gregg Irwin
@greggirwin
Redbol langs inherit from Lisp, Forth, and Logo (Lisp without parens effectively), and prototype object design from Self.
Respectech
@Respectech
Gregg obviously has a much better handle on where Rebol got some of its inspirations from.
Thanks for the clarification, Gregg.
Fabiano Rezende
@fabianorezende26_gitlab
yeah i can see forth in it but there seems to be a bit of awk in it : )
Gregg Irwin
@greggirwin
Not really. No automatic line processing, field splitting, or pattern-action core. I do have a rawk dialect built for R2 however, so it's applicable to that space, and others in shell-world. I hoped we'd get to build a reddy-box and other things along those lines someday.
WayneCui
@WayneCui
Hello guys, any way to change a timestamp value to a date! value? eg. 894621091000 => 1998-05-08 09:51:31
WayneCui
@WayneCui
from-timestamp: func [ ts ][
    days: to-integer round/down ts / 1000 / 3600 / 24
    seconds: round/down mod (ts / 1000) (3600 * 24)
    return (1970-01-01 + days) + (00:00:00 + seconds)
]

print  from-timestamp 894621091000
just wrote a function, is there any better ways?
ne1uno
@ne1uno
this used to work? way off now. 1-Jan-1970 + to time! 894621091000
WayneCui
@WayneCui
1-Jan-1970 + to time! 894621091   
== 8-May-1998/9:51:31
@ne1uno Thanks for reply, it works, just change millisecond to second ;-)
ne1uno
@ne1uno
👍
ne1uno
@ne1uno
the other way, to float! difference to date! 8-5-1998/09:51:31 1-Jan-1970 from an @x8x post
WayneCui
@WayneCui
👍
Nenad Rakocevic
@dockimbel
See documentation:
>> to-date 894621091
== 8-May-1998/9:51:31
François Jouen
@ldci
image.png