chris613
2020-1-24 11:08:40

are there any good libs with implementations of common algo’s ? i.e. bin packing/First-fit type things ?



chris613
2020-1-24 14:17:30

thanks :smile:


deactivateduser60718
2020-1-24 14:58:46

@notjack This seems to be what I need. Thank you for this!


deactivateduser60718
2020-1-24 15:17:45

https://docs.racket-lang.org/http/index.html?q=http#%28def._%28%28lib._http%2Frequest..rkt%29._call%2Frequests%29%29

Here’s the code example from the linked section, with my question added in a comment.

(define-values (scheme host port) (uri->scheme&host&port uri)) (call/requests scheme host port (lambda (in out) (define-values (path rh) (uri&headers->path&header uri '("Expect: 100-continue"))) (define tx-data? (start-request in out method path rh "1.0")) (when tx-data? (display data out) ; <-- Where did 'data' come from? (flush-output out)) ;Important! (define h (purify-port/log-debug in)) (read-entity/bytes in h)))


zalp.rogue
2020-1-24 16:56:14

I think it’s the variable for the data you want to send for your PUT or POST request.


deactivateduser60718
2020-1-24 17:21:07

Ok, that makes sense.


samdphillips
2020-1-24 17:45:12

• rearrange the catalog list so that the built catalog is first: Fail • set the catalog to only have the built catalog: Fail (and still seems to use the regular catalogs?) • set the catalog on the raco pkg install command line: Works, fetches the binary package


samdphillips
2020-1-24 17:47:28

That was installing rebellion. Unfortunately rash still has problems because it looks like one of the dependent packages is not in the built server


samdphillips
2020-1-24 17:47:42

But I can probably work around that.


notjack
2020-1-24 17:49:03

:man-facepalming:


samdphillips
2020-1-24 17:51:54

actually it’s several packages that are part of racket, and could be harder than I thought


samdphillips
2020-1-24 17:53:06

rackunit-lib scribble-lib scribble-doc racket-doc make


soegaard2
2020-1-24 18:10:25

I have deployed an update to Racket Stories. The new feature is “Send me a password reset link in a mail” when you have forgotten your password.


soegaard2
2020-1-24 18:10:37

Can I persuade someone to test it?


chris956
2020-1-24 18:10:47

@chris956 has joined the channel


ben
2020-1-24 18:13:00

I tried to reset with my email address and got an exception. I think this means I didn’t have an account.


soegaard2
2020-1-24 18:14:13

Thanks. I didn’t test that… I thought I handled that situation in the code though.

If you make an account and then try the same, what happens?


notjack
2020-1-24 18:33:54

hmm. I think this is worth filling a bug in the package manager.


notjack
2020-1-24 18:33:59

It should handle this better


deactivateduser60718
2020-1-24 19:22:26

Here’s my attempt at a contract that needs a procedure of arity N, where N is the length of the list in the first argument. Is there an error or gotcha? (provide (contract-out [with-dependencies (->i ([deps (non-empty-listof (or/c url? string?))] [proc procedure?]) #:pre/name (proc deps) "A procedure with arity matching the number of dependencies." (procedure-arity-includes? proc (length deps) #f) [result any/c])]))


notjack
2020-1-24 19:25:38

@deactivateduser60718 It looks good, though you could make it a little simpler using the procedure-arity-includes/c contract


deactivateduser60718
2020-1-24 19:27:08

Yep, thanks. (provide (contract-out [with-dependencies (->i ([deps (non-empty-listof (or/c url? string?))] [proc (deps) (procedure-arity-includes/c (length deps))]) [result any/c])]))


soegaard2
2020-1-24 19:33:42

I fixed a bug and deployed the new version of Racket Stories. Anyone willing to test the “Reset Password” mail?


deactivateduser60718
2020-1-24 19:39:45

Trying now.


deactivateduser60718
2020-1-24 19:41:35

I got the email and was able to follow the link to the password reset field.


deactivateduser60718
2020-1-24 19:41:51

Do you need me to reset the password, or was getting the mail enough?


soegaard2
2020-1-24 19:42:44

I’d like to test the the resetting too. You can always reset twice - if you want the original password back.


samdphillips
2020-1-24 19:44:31

The bug should just be for the handling of the catalog right?


deactivateduser60718
2020-1-24 19:45:08

Ok, one sec.


deactivateduser60718
2020-1-24 19:46:02

Reset and logged in successfully.


soegaard2
2020-1-24 19:46:11

Great!


deactivateduser60718
2020-1-24 19:46:43

One bit of feedback though: I used my email instead of my username on the login screen as force of habit. My credentials are rejected with no visible error in that case.


soegaard2
2020-1-24 19:47:16

Rejected?


deactivateduser60718
2020-1-24 19:47:49

When I use my email on the login page and submit, the login page refreshes and the text fields are cleared. No error message appears.


deactivateduser60718
2020-1-24 19:48:07

In other words, submitting with my email looks like a normal refresh.


soegaard2
2020-1-24 19:48:13

The intention was that entering either the username or the email should send a mail.


notjack
2020-1-24 19:48:15

Right. If you have multiple catalogs, and one of them has the package you want but not in the right form, that shouldn’t stop raco pkg from trying other catalogs.


deactivateduser60718
2020-1-24 19:48:30

No no, I’m not talking about the reset screen.


soegaard2
2020-1-24 19:48:54

Ah!


deactivateduser60718
2020-1-24 19:49:06

See it?


soegaard2
2020-1-24 19:49:31

Yep. I’ll make a github issue, so I can remember it.


deactivateduser60718
2020-1-24 19:49:38

Thanks muchly


alexisbaudron2020
2020-1-24 21:12:28

@alexisbaudron2020 has joined the channel


gknauth
2020-1-24 21:26:03

This docs error is new: https://docs.racket-lang.org/ricoeur-tei-utils/X-Expression_and_XML_Operations.html > ((uncaught-exception-handler) (*(+(*)(*(+(*)(*)(*)(*)(*))(+(*)(*)(*)(*)(*))(+(*)(*)(*)(*))))(+(*)(*)(*)(*)))) uncaught exception: 404


wunglee2021
2020-1-24 22:53:29

@wunglee2021 has joined the channel


ben
2020-1-24 22:54:08

I made an account without an email address (because it’s optional) and got this error


soegaard2
2020-1-24 22:57:14

Oh! I forgot emails are optional. I didn’t have a way to send “validate email address” mails, but I now I do.

Thanks for pointing this out.


matthewparas2020
2020-1-25 00:18:53

@matthewparas2020 has joined the channel


philip.mcgrath
2020-1-25 00:32:06

I have a script (attached) that runs fine at the command line but fails in DrRacket 7.5 CS with the error /Users/pltbuild/build/plt-release-cs-64/bundle/racket/collects/compiler/private/cm-minimal.rkt:428:0: returned two values to single value return context. Running raco setup didn’t help. Is there some other way this might be my fault, or is this perhaps a known issue?


mflatt
2020-1-25 01:34:37

I haven’t been able to provoke that error (tried DrRacket or DrRacket CS, development version of 7.5, with “populate compiled” enabled), so I’m not sure. Do you have anything open in DrRacket other than this code?


mflatt
2020-1-25 01:37:22

Meanwhile, racket/base now exports struct/derived, which conflicts with exports in your modules. New exports are not supposed to be added to racket/base if they cause any conflicts with registered packages (but it’s difficult for everyone to keep track, and the check that happens at release time hasn’t happened, yet). Would you prefer to make changes to avoid the conflict and have struct/derived in racket/base, or should we take that back out before v7.6?


philip.mcgrath
2020-1-25 04:55:07

I definitely think struct/derived should be in racket/base: https://github.com/racket/racket/issues/1699#issuecomment-305980428 I documented my struct/derived as “experimental” and “subject to breaking changes without notice,” so I’ll just remove it as an export. I’d forgotten there would be a conflict, though: thanks for pointing it out!


philip.mcgrath
2020-1-25 05:03:22

I haven’t had anything else open in DrRacket, and my colleague was also able to run the script without issues (but on traditional Racket).


philip.mcgrath
2020-1-25 06:43:53

I’ve just tried raco setup --clean followed by raco setup, and I still have the problem in DrRacket.


p.kushwaha97
2020-1-25 07:35:57

I’m trying to work with for/fold in typed racket. I’ve modified an example from docs, but it gives an error (paste link): [1]: https://docs.racket-lang.org/reference/for.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for%2Ffold%29%29 [2]: http://pasterack.org/pastes/54369 (for/fold: : (Listof Integer) ([acc : (Listof Integer) (cast '() (Listof Integer))] [seen : (HashTable Integer Boolean) (cast (hash) (HashTable Integer Boolean))] #:result (reverse acc)) ([x : Integer (in-list '(0 1 1 2 3 4 4 4))]) (cond [(hash-ref seen x #f) (values acc seen)] [else (values (cons x acc) (hash-set seen x #t))])) Error:

stdin::331-730: for/fold:: expected optionally type-annotated identifier ; at: #:result ; in: (for/fold: : (Listof Integer) ((acc : (Listof Integer) (cast (quote ()) (Listof Integer))) (seen : (HashTable Integer Boolean) (cast (hash) (HashTable Integer Boolean))) #:result (reverse acc)) ((x : Integer (in-list (quote (0 1 1 2 3 4 4 4))))) (cond (... ; parsing context: ; while parsing accumumulator binding ; term: #:result ; location: stdin::520-528 ; while parsing accumumulator bindings ; term: ((acc : (Listof Integer) (cast (quote ()) (List... ; location: stdin::365-543 ; Context: ; /usr/share/racket/collects/syntax/parse/private/runtime-report.rkt:731:0 error/report ; /usr/share/racket/collects/syntax/parse/private/runtime-report.rkt:28:0 call-current-failure-handle


p.kushwaha97
2020-1-25 07:37:00

I can’t make sense of what it’s expecting. It reads like it wanted me to not use #:result and instead define one more accumulator variable


p.kushwaha97
2020-1-25 07:44:24

Can anyone point me to where for/list family of functions’ type signature is defined? I suspect it may be incomplete, not accounting for keywords