
We use at work self-hosted Matrix, which works really well and we also setup an instance of a matrix server + irc bridge that worked really well. So I can recommend.

shame that apparently you cannot block or mute someone in slack. :disappointed:

(i am referring to our previous spammer, of course)

Definitely spam/advertising.

Maybe @samth or @spdegabrielle has a mute button?

Sorry no.

FWIW it is relatively polite spam :slightly_smiling_face:

Extremely polite

polite spam - two words I didn’t think could go together in the same sentence… :wink:

If spammers/advertisers get ahold of the fact that we cannot mute them on slack… this is going to get interesting.

In the meantime I think most people here have the sense not to click the link.

I used to ping @samth to remove spams earlier, so he definitely has a power to do that

@samth with all your powers combined… - remove the spam! :smiley:

I think it’s 5am for him.

sorry - I know. was just having a Captain Planet moment. Nostalgia. :slightly_smiling_face:

i hope his alarm doesn’t ring when we mention him here.

On to a Racket thing I was looking at - do we already have a procedure in place to redirect the standard output port used by a shared library loaded via the FFI?

I thought I had seen this before but now I cannot find anything…

I finally tried this.
In a directory where etc/config.rktd
is like my installation’s config.rktd
, but with config-tethered-console-bin-dir
and config-tethered-console-gui-dir
entries that point to a bin
directory, tethered binaries did get written to bin
when I ran racket -G -l- raco setup
, but • no racket
launcher is written, aalthough one would be useful • it’s important for the tethered-bin directory to be an absolute path, otherwise it’s relative to collects

I deleted the message and deactivated that account

and it doesn’t ring any alarms for me when I get mentioned :slightly_smiling_face:

Great! :slightly_smiling_face: Thanks.

I make a log receiver with make-log-receiver
and then trigger some code in another module with (dynamic-require 'module #f)
. The code in module
logs an uncertain number of events to the topics I’m listening on before it finishes. I can get all the events by looping until sync/timeout
returns #f
…but is there a faster way?

Have you seen with-intercepted-logging
? https://docs.racket-lang.org/reference/logging.html#%28def._%28%28lib._racket%2Flogging..rkt%29._with-intercepted-logging%29%29

If that doesn’t do exactly what you need, then you could look at its source implementation for inspiration. IIRC it uses a stop channel and it does sync/timeout but with a timeout of 0.

I’ve seen it in the docs. My first attempt used with-logging-to-port
and I got some extremely strange errors (that didn’t end until I did a user break…possibly because the errors were emitted by a logger, now that I think about it) so I switched to just listening. I could definitely try it though

The source shows how to “drain” the logger events without waiting some arbitrary timeout or doing a hard loop. If that helps?


Will dig in—thanks!

@samth We could start a gofundme to buy you an old school beeper? Wouldn’t you love some retrotech charm in your life?

(string-split "\"aB\" = (/obj/cades_1{pull_disable = 1},/turf/floor_2,/area/inside)" " = " #:repeat? #f)
; gives me
'("\"aB\"" "(/obj/cades_1{pull_disable" "1},/turf/floor_2,/area/inside)") ; length 3. Not what I want because #:repeat? #f doesnt work!@@@!!!
; what i want:
'("\"aB\"" "(/obj/cades_1{pull_disable = 1},/turf/floor_2,/area/inside)") ;length 2 ("aB" "p1,p2,p3")
but instead its giving me 3 values, when i want a length of two… the #:repeat? is off and idk why its further splitting at pull_disable = 1

I get
'("\"aB\""
"="
"(/obj/pull_disable"
"="
"1},/turf/enviroment/floors/floor_2,/area/inside)")
as a result

woops, forgot to split on " = "

fixed the code snippet above

Looks like just using with-intercepted-logging
works. Looking at the implementation was educational for sure. I’ll have to go back and see why with-logging-to-port
blew up at me, though I suspect it was because of the cause mentioned in the minor epiphany above.

Then, I get:
'("\"aB\""
"(/obj/pull_disable"
"1},/turf/enviroment/floors/floor_2,/area/inside)")
which is not the output you claimed you got

well, so you get a list of 3 values right? how do i make it so i get ("ab" "path1, path2")
, 2 values , because string-split #:repeat? #f
should split on the first instance and stop right? seems like its going way further…. or am i misunderstanding what it does.. wondering if this is a bug in string-split or am i going nuts..

Ah, I think you misunderstood the meaning of #:repeat? #f
.
(string-split "a=b==c" "=" #:repeat? #f) ;=> '("a" "b" "" "c")
(string-split "a=b==c" "=" #:repeat? #t) ;=> '("a" "b" "c")

It doesn’t mean you split just once

(string-split "1,2,3" "," #:repeat? #f #:trim? #f) -> '("1" "2" "3")
so what would be the easiest way to get ("1" "2,3")
?

If you don’t care about efficiency much. One possibility is to rest
on the result and then string-join
them back with the splitter string

E.g.,
(define (split-once s splitter)
(define xs (string-split s splitter #:repeat? #f #:trim? #f))
(list (first xs) (string-join (rest xs) splitter)))
(split-once "1,2,3" ",")

thanks! that’ll do for now

I wouldn’t string-split
at all. As opposed to find and substring: (require srfi/13)
(define (split-once s sep)
(match (string-contains s sep)
[#f s]
[n (list (substring s 0 n)
(substring s (+ n (string-length sep))))]))

>_> would be nice if there was just a flag to turn on for split once

walp, thanks guys

@ryanc I was wondering if you could take a look at https://github.com/racket/macro-debugger/issues/34. Recently I have been working on something related to require/typed
That error is really bugging me.