Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 26 23:48
    greggirwin updated the wiki
  • Jan 26 23:43
    greggirwin updated the wiki
  • Jan 26 20:21
    mbk commented #94
  • Jan 26 18:53
    hiiamboris opened #97
  • Jan 26 18:11
    loziniak updated the wiki
  • Jan 26 03:21

    qtxie on master

    FIX: macOS: crashes when settin… (compare)

  • Jan 25 23:16
    greggirwin commented #94
  • Jan 25 21:51
    hiiamboris commented #94
  • Jan 25 21:47
    hiiamboris commented #94
  • Jan 25 20:34
    greggirwin commented #94
  • Jan 25 20:18
    hiiamboris commented #96
  • Jan 25 20:10
    Travis red/red#4812 errored (5524)
  • Jan 25 19:33
    greggirwin commented #96
  • Jan 25 19:08
    hiiamboris commented #95
  • Jan 25 19:07
    hiiamboris commented #95
  • Jan 25 18:53
    greggirwin commented #95
  • Jan 25 18:16
    hiiamboris edited #94
  • Jan 25 18:10
    greggirwin opened #4812
  • Jan 25 17:50
    hiiamboris opened #96
  • Jan 25 17:41
    hiiamboris edited #95
Dave Andersen
@dander
image.png
@greggirwin upper-right of page, do you have this gear button?
Gregg Irwin
@greggirwin
Aha! Thanks @dander
Tried to claim it. Got an error.
Rudolf Meijer
@meijeru
2
Jose Luis
@planetsizecpu
👍
lucindamichele
@lucindamichele
@dander @greggirwin Tried to claim, it says this:
image.png
Gregg Irwin
@greggirwin
I think claiming just doesn't work.
lucindamichele
@lucindamichele
it wanted to verify my i.d. (not my id), as it noted my email doesn't end in red-lang and said it'd have to manually check me out. If I had a dollar for every time I heard that...
lucindamichele
@lucindamichele
As an aside, and all cynicism aside, in the US it's "Thanksgiving" and I'm grateful for this incredible community that pushes me to grow and learn. It's been raining for 24 hours straight in Los Angeles and if we aren't all swept into the LA River in the resulting deluge I am very happy to begin envisioning a new year of amazing growth with Red. I also look forward to continued cat memes from @9214 and the rest of you resident genii.
Gregg Irwin
@greggirwin
:^) If you're a Gilbert & Sullivan fan, it would be resident Djinn I think (from The Sorcerer).
Respectech
@Respectech
@lucindamichele Thanks very much for your Thanksgiving wishes. We also had a wonderful Thanksgiving yesterday with a house full of family and friends. I am looking forward to an exciting year with Red.
Rémi Gillig
@speps
I know a lot of you might be on Thanksgiving break but the latest Windows binary is broken on AppVeyor and the previous successful builds don't have artefacts available.
@hiiamboris seems like it's your commit that broke it red/red@19853a8
Compiling Red console...
*** Compilation Error: argument type mismatch on calling: >>
*** expected: [number!], found: [pointer! [byte!]]
*** in file: %/C/Users/regillig/Documents/MEGA/Code/AoC2017/Day24/modules/view/backends/windows/gui.reds
*** in function: exec/gui/adjust-selection
*** at line: 1861
*** near: [- p head unit-b
    case [
        size > end/1 [break]
        size > bgn/1 [end/1: end/1 - 1]
        true [bgn/1: bgn/1 - 1 end/1: end/1 - 1]
    ]
]
hiiamboris
@hiiamboris
Thanks. I'll look into it and PR a hotfix.
LFReD
@LFReD

Bug?

I create a hash! with 75,000 strings of triples using this code.

n: 1

loop 25000 [

s: rejoin ["user" n]
p: rejoin ["pred" n]
v: rejoin ["val" n]

append db reduce [s p v]
n: n + 1
]

giving me db: make hash! ["user1" "pred1" "val1" "user2" "pred2" "val2"...

I then save this using this code...

saveit: does [

    dbsave: to-block db
    save %db.txt dbsave
    dbsave: copy [] 
    ]

(not sure that's the best way to do that, but it works..open to suggestions!)

When I check the %db.txt, it's saved it as "user1" "pred1"... etc, BUT
It stops saving at "pred19532" ?? It goes only that far every time.

It works fine using the exact same code in Rebol 2

When I check the length of :db before the save, it's correct, so it's in the writing to %db.txt that something happens.
Gregg Irwin
@greggirwin
Is the file at any suspicious size? Will try to dupe soon if nobody else does.
LFReD
@LFReD
512 KB (524,290 bytes
Seems like a fairly suspicious size .5 mb
LFReD
@LFReD

length? db
== 75003
saveit
length? dbsave
== 75003
%db.txt file size : 524,290 bytes

Something going on here:
save %db.txt dbsave

Gregg Irwin
@greggirwin

What happens if you save to a string or binary (check then length) and write that out?

If your db is a block, you need to mold it to see the length as it will be written.

LFReD
@LFReD
Ok. I think I fixed by replacing the saveit function with this
saveit: does [
    save/all %db.txt db
    ]
Which also answers my question "not sure that's the best way..."
LFReD
@LFReD

After further testing, there's a new issue. Using the new saveit function and loading it back again.

Rebol2
kk: load %delme.txt
== make hash! ["one" "two" "three"]

Red
kk: load %delme.txt
Syntax Error: invalid issue! at {#[hash!["one" "two" "three"]]}
Where: do
Stack: load

Also when I use save/all %db.txt db
when I view the first bit of the db.txt file..

Rebol
.. #[hash!["user1" "pred1" "val1" "user2" "pred2"

Red
.. make hash! ["user1" "pred1" "val1" "user2"

(forget the two dots.. how do you escape the Gitter markup?)
hiiamboris
@hiiamboris
Please use https://gitter.im/red/bugs room for bugs discussion and when you're sure you've found a bug, post it our tracker: https://github.com/red/red/issues/new?template=bug_report.md
Oldes Huhuman
@Oldes
@LFReD I suppose you are trying to load hash! saved from Rebol into Red. But Red does not fully implemented the serialization format (the one using: #[...]). So far it supports only #[true],#[false] and #[none].
Btw.. you can use mold/all to see what is the string result used by save/all.
Oldes Huhuman
@Oldes
@LFReD and I'm not able to reproduce your loading issue...
>> db
== ["user1" "pred1" "val1" "user2" "pred2" "val2" "user3" "pred3" "val3" "user4" "pred4" "val4" "user5" "pred5" "val...
>> save %/a/db.txt db
>> length? db
== 75000
>> length? load %/a/db.txt
== 75000
LFReD
@LFReD
Continuing this in red/bugs..
LFReD
@LFReD
Regarding that bug. I was using the older binary from the red-lang site.. using latest build and it works fine.
LFReD
@LFReD
Ah, I've heard bits and pieces about a /pro version of Red? Any docs on that or deets?
Gregg Irwin
@greggirwin
Not at this time.
LFReD
@LFReD
ooh, now I'm really intrigued! :P
Gregg Irwin
@greggirwin
I don't do Go, so would have to read up on the struct/def format, but it seems like we could do a nice data-driven version of this in Red for the Gophers. Their binary is 30M for Linux, and 45M for Windows. We could save them some bandwidth. :^)
LFReD
@LFReD
Any chance of variable length arguments with Red func?
Gregg Irwin
@greggirwin
Nope. Use a block.
GiuseppeChillemi
@GiuseppeChillemi

I find myselft using really often the the /skip refinement with select. Having a block like the following (or any one treated as record)

myblock: [
     key1 value1 value2 value3
     key2 value1 value2 value3
     key3 value1 value2 value3
     key4 value1 value2 value3
     key5 value1 value2 value3
]

Select/skip can't select anything other than the the first column: value1, which is quite limiting.

I see useful removing this limit adding an additional /pos (or /offset) integer refinement to select so instead of the first value, any other could be selected! Without /skip the pos/offset refinement should return the nth value after the key.

Jose Luis
@planetsizecpu
Block works well for me:
>> my_func: function [params [block!]][foreach x params [print x]]
== func [params [block!] /local x][foreach x params [print x]]

>> ? my_func
USAGE:
     MY_FUNC params

DESCRIPTION: 
     MY_FUNC is a function! value.

ARGUMENTS:
     params       [block!] 

>> my_func ["one" "two" "three"]
one
two
three
>>
xqlab
@xqlab
@GiuseppeChillemi Does this help
>> copy/part find/skip myblock [key2 value1]  4 4
== [
    key2 value1 value2 value3
]
or this
>> third find/skip myblock [key2 value1]  4 
== value2
Gregg Irwin
@greggirwin
@GiuseppeChillemi select already has a lot of refinements, and what you want is easy to do at the mezzanine level. It also makes sense, in many cases, to use sub blocks.
hiiamboris
@hiiamboris
With such a fixed table one shouldn't use select at all, as it'll be slow. Hash is the way to go ;)
GiuseppeChillemi
@GiuseppeChillemi
@xqlab Thanks, I already use a solution like this. I suggested this improvement to Select because, using Gregg's term, "it makes sense". Having a block treated as a record with elements and you can only select the first one, is limiting.