Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:35
    bitbegin assigned #4004
  • 10:35
    bitbegin unassigned #4004
  • 10:28
    bitbegin commented #3952
  • 09:53
    dockimbel labeled #3999
  • 09:53
    dockimbel assigned #3999
  • 09:52
    dockimbel labeled #3952
  • 09:52
    dockimbel closed #3952
  • 09:52
    dockimbel commented #3952
  • 09:52
    dockimbel commented #3952
  • 08:45
    9214 commented on 84f55a2
  • 08:29
    meijeru commented on 84f55a2
  • 07:24
    bitbegin assigned #4004
  • 06:48
    bitbegin commented #3077
  • 06:18
    bitbegin opened #4004
  • 06:08
    bitbegin commented #3837
  • 05:49
    qtxie review_requested #3996
  • 05:48
    qtxie commented #3996
  • 05:48
    qtxie commented #3996
  • 05:45
    qtxie commented #3837
  • 05:41
    qtxie commented #3837
kpeters58
@kpeters58
I just lost 2 hours of my life figuring this one out... Red refused to acknowledge a context I defined in %settings.red, no matter what I tried. Turns out there was an issue in %globals.red and apparently because of this none of the files below it were 'done' - I would have expected it to either fail completely or to continue 'doing' the other files...
Gregg Irwin
@greggirwin
:point_up: August 5, 2017 1:03 PM @GiuseppeChillemi, do you mean what will help get it into Red sooner?
:point_up: August 5, 2017 2:38 PM @LazyR0t, and, as it has come up recently, Red for the header is case sensitive. One of the few places case matters.
Gregg Irwin
@greggirwin
@kpeters58, can you provide a small example that reproduces the issue? No pun intended.
Syntonica
@Syntonica
@x8x I've always liked the theory behind Max (and Pd et alia) but I've always found the implementations to be slow, clunky and ugly. With's Red's extensibility, throw on an Audio/Midi library and it could definitely take them on!
Petr Krenzelok
@pekr
As we have discussed some roadmap telated topics yesterday, I would like to ask about the iOS support, which can't be found on the roadmap yet, if I am not misteken. Please note - I am not pushing for anything, just would like to know, how technically different and difficult it is to get one. Linux Arm Red apps kind of work under Android, woulf like to know, if in the same sense macOS app would work under iOS?
Our company has over 50 iPads out there and we are being asked, if our inernal IT could take over some tools development in let's say 2 years horizont ....
PeterWAWood
@PeterWAWood
@pekr One big difference between macOS and iOS is the processor. macOS being Intel and iOS being ARM. Apple no longer "supports" 32-bit apps on iOS. (I don't know if 32-bit apps will run if you can get them onto the device.)
Another difference is that iOS has the CocoaTouch framework whereas macOS have the Cocoa framework.
Petr Krenzelok
@pekr
Thanks.
btw - not sure what to expect, when trying to set date!``/day to -1? Maybe it should be avoided? Plus variant works imo, if the assumption is correct, that setting such value sets it to the day-of-month value. Well, if it overflows the recent month, it goes into the next one. But what about negative values?
>> today: now
== 6-Aug-2017/10:00:41+02:00
>> today/day: 1
== 1
>> today
== 1-Aug-2017/10:00:41+02:00
>> today/day: -1
== -1
>> today
== 30-Jul-2017/10:00:41+02:00
In above case note, that setting the dayto 1, does not increment the recent day, it just sets it to that value. But try with the 40 for e.g. - it overflows to September ....
Petr Krenzelok
@pekr
in the above case of setting it to -1, shouldn't be 31-Jul-2017/.... a more expected result?
PeterWAWood
@PeterWAWood
@pekr I think another difference between macOS and iOS is that macOS has the AppKit framework (which is used in the Red GUI backend) and iOS has UIKit.
PeterWAWood
@PeterWAWood
@pekr Re: the date. The Date! reference says that if you set the day to an invalid value the date is set to a "normalised" date.
That said, Rebol gives the same answer:
>> d: now
== 6-Aug-2017/16:32:36+8:00
>> d/day: -1
== -1
>> d
== 30-Jul-2017/16:32:36+8:00
PeterWAWood
@PeterWAWood
Your question is "Should the normalised date for -1-AUG-2017 be 31-JUL-2017 not 30-JUL-2017" needs to be looked into.
The reason is that Red treats day 0 as the last day of the previous month and day -1 as the second last day of the previous month:
>> d: 1-8-17
== 1-Aug-2017
>> d/day: 0
== 0
>> d
== 31-Jul-2017
>> d: 1-8-17
== 1-Aug-2017
>> d/day: -1
== -1
>> d
== 30-Jul-2017
Petr Krenzelok
@pekr
Thanks for the explanation, now it at least makes sense to me ....
PeterWAWood
@PeterWAWood
@fvanzeveren Red now evaluates 0.0 / 0.0 to 1.#NAN
>> 0.0 / 0.0 
== 1.#NaN
Thanks to @dockimbel
Oldes Huhuman
@Oldes
@rebolek @x8x I've just pushed pull request to red/code repository with Red/System binding to Portaudio (low level crossplatform real time audio library). You may find it useful.
Muhammad N ElNokrashy
@narfanar
Heyo o/
Anyone got a list of the blogposts related to new numbered version releases? It's surprisingly hard to search for something like that on Blogger...
kpeters58
@kpeters58
@greggirwin Hmm, that's strange - upon making the smallest possible example, I find my assumptions to be incorrect - as it works just fine. In my real world application removing the offending line fixed the subsequently defined context - maybe I should have restarted the console more often to rule any existing objects out as culprits?
GiuseppeChillemi
@GiuseppeChillemi
@greggirwin I apologize for my poor language skills. I mean: which advantage will give the MONEY! datatype over the FLOAT one ?
Gregg Irwin
@greggirwin
Date math is a tricky thing, so we need good examples to help people understand the behavior. But I think there may be a bug here (6-aug being the current date here):
>> now/date - now/date
== -1
>> 6-aug-2017 - 6-aug-2017
== 0
>> 6-aug-2017 - now/date
== 0
>> now/date - 6-aug-2017
== -1
Thanks for checking @kpeters58.
I tried a couple things, but couldn't make it happen here, which is why I asked.
Gregg Irwin
@greggirwin

@GiuseppeChillemi, no need to apologize, ever. Same goes for everyone else. Your English beats my Italian every day. :^) If I ask for clarification, it could be a technical matter as much as anything, wanting to make sure I understand the problem so I don't give bad advice.

The answer is easy. Float! should never be used for decimal values where accuracy is important, because it can't represent all decimal values. See: https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems

This won't always be visible, but it's there:

>> 0.1 + 0.1 + 0.1 
== 0.3
>> 0.1 + 0.1 + 0.1 * 10000000000000000
== 3000000000000001.0

When working with money values, rounding errors can add up. I worked with a guy, many years ago, who developed empirical solutions for it, which was pretty amazing. It worked in our domain, but I don't think was generalizable. The solution is to use BCD or some other representation that can accurately handle decimal values. That's the plan for money! in Red, but could also be a general decimal! type that money is built on. The issue then is what 1.0 means as a literal, float or decimal. Floats are faster, because of hardware support.

There are other interesting approaches as well, but that should be enough for now.

Faustino Aguilar
@faustinoaq
Hi people, I'm new in Red. How to install Red on ArchLinux based distros? I tried with raw binaries but have had no success.
Note for Linux on official page includes Debian and Fedora based distros but not for ArchLinux :sweat_smile:
GiuseppeChillemi
@GiuseppeChillemi
So, actually I can't use RED for financial manipulation. Couldn't I ?
geekyi
@geekyi
@Enamex basically, all on http://www.red-lang.org/ since it's still alpha, there isn't much significance in numbered releases. Technically it should be http://www.red-lang.org/search/label/release, but all blogposts count so.. Doc multitasks a lot, he could miss tagging some sometimes :D
Syntonica
@Syntonica
@PeterWAWood Re: iOS, the current iOS 10 will be the last iOS to run 32-bit apps. iOS 11 will be pure 64-bit. If you go to Settings > General > About > Applications, it will show you which apps are on the chopping block.
geekyi
@geekyi
@faustinoaq you'd need 32bit libs. Also, I'm pretty sure someone had an aur package
Syntonica
@Syntonica
@GiuseppeChillemi Unless you are a millionaire, or you are working in the old lire, you can just use an integer type with an implicit decimal point. You will still need to watch rounding, as you would with any type. I thought that that was how the backend of the Money! type worked since floats are fraught with peril. I constantly have to check on their rounding behaviors in conversions from double->single and double->int (in C++).
Faustino Aguilar
@faustinoaq
@geekyi Thanx, I found Red on https://aur.archlinux.org/packages/red/, Maybe somebody should add this link to documentation too :sweat_smile:
Is http://red.github.io/ a kind of official page?
Boleslav Březovský
@rebolek
Syntonica
@Syntonica
@rebolek Oh, okay. I always thought BCD was inefficient, so never gravitated towards it. :)
kpeters58
@kpeters58
How do those of you who have a need for this type of code solved this issue in Red? Assume you need to display a list of strings in a drop-list, but you store database keys associated with those strings only. Do you keep these in a separate series (sorted the same way) in the 'extra ' facet? Or are there better solutions?
Gregg Irwin
@greggirwin
@faustinoaq, http://red.github.io/ may be official. Someone inside Team Red should be able to say shortly. There are unofficial Red related projects as well, so we'll try to make sure that's clear.
Faustino Aguilar
@faustinoaq
:+1:
Qingtian
@qtxie
@faustinoaq It's official. It's for users cannot visit red-lang.org (host on blogger which is blocked in some countries).
Nenad Rakocevic
@dockimbel
@kpeters58 You can store keys in the /data facet along with the labels to display:
list: ["a" 123 "b" 456 "c" 789]
view [
    drop-list data list on-change [
        probe pick face/data 2 * face/selected
    ]
]
Nenad Rakocevic
@dockimbel
@faustinoaq Link to ArchLinux's Red package added to Download page now.
mahengyang
@mahengyang
test1: function [x] [
    m: 1
    print ["m is" m]
    m: m + 1
    if x < 3 [test1 x + 1]
    return m
]


test2: function [x] [
    m: "1"
    print ["m is" m]
    m: append m "2"
    if x < 3 [test2 x + 1]
    return m
]

test1 1

test2 1
result
m is 1
m is 1
m is 1
m is 1
m is 12
m is 122
in test2 function, I have set m: 1,why the print is 122 after second recursion
PeterWAWood
@PeterWAWood

@mahengyang m: "1" binds the word in the local context of the function to a string value whose initial content is "1". Assume that the "address" of the string is str-1234. 'm: 1' binds 'm' to str-1234.

m: append m "2" binds m to the value returned by append which is the value 'm' is bound to (i.e. str-1234) with "2" appended to it.

Next time, the function is called; 'm: "1"' still binds 'm' to str-1234 which now contains "12".