pocmatos
2021-5-11 07:30:37

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.


pocmatos
2021-5-11 07:33:14

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


pocmatos
2021-5-11 07:33:49

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


mark.warren
2021-5-11 07:33:59

Definitely spam/advertising.


soegaard2
2021-5-11 07:35:34

Maybe @samth or @spdegabrielle has a mute button?


spdegabrielle
2021-5-11 07:36:15

Sorry no.


soegaard2
2021-5-11 07:37:35

FWIW it is relatively polite spam :slightly_smiling_face:


mark.warren
2021-5-11 07:42:13

Extremely polite


pocmatos
2021-5-11 07:54:31

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


pocmatos
2021-5-11 07:55:31

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


spdegabrielle
2021-5-11 08:07:33

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


sorawee
2021-5-11 08:27:13

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


pocmatos
2021-5-11 08:37:12

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


spdegabrielle
2021-5-11 08:38:29

I think it’s 5am for him.


pocmatos
2021-5-11 08:38:52

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


pocmatos
2021-5-11 08:39:12

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


pocmatos
2021-5-11 08:43:45

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?


pocmatos
2021-5-11 08:43:59

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


mflatt
2021-5-11 12:46:26

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


samth
2021-5-11 13:44:55

I deleted the message and deactivated that account


samth
2021-5-11 13:45:09

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


pocmatos
2021-5-11 14:21:30

Great! :slightly_smiling_face: Thanks.


joel
2021-5-11 16:10:46

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?



greg
2021-5-11 16:21:30

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.


joel
2021-5-11 16:23:37

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


greg
2021-5-11 16:25:00

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



joel
2021-5-11 16:28:05

Will dig in—thanks!


greg
2021-5-11 16:29:06

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


jestarray
2021-5-11 16:35:38

(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


sorawee
2021-5-11 16:39:41

I get

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


jestarray
2021-5-11 16:39:54

woops, forgot to split on " = "


jestarray
2021-5-11 16:39:59

fixed the code snippet above


joel
2021-5-11 16:41:34

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.


sorawee
2021-5-11 16:42:12

Then, I get:

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


jestarray
2021-5-11 16:44:39

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..


sorawee
2021-5-11 17:14:14

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")


sorawee
2021-5-11 17:14:38

It doesn’t mean you split just once


jestarray
2021-5-11 17:16:06

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


sorawee
2021-5-11 17:16:33

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


sorawee
2021-5-11 17:18:36

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" ",")


jestarray
2021-5-11 17:23:50

thanks! that’ll do for now


massung
2021-5-11 17:24:46

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))))]))


jestarray
2021-5-11 17:26:12

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


jestarray
2021-5-11 17:26:16

walp, thanks guys


capfredf
2021-5-11 19:38:58

@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.