are there any good libs with implementations of common algo’s ? i.e. bin packing/First-fit type things ?
@chris613 Apropos bin packing: https://jeapostrophe.github.io/2013-05-06-texture--post.html#%28part._2.D_.Bin_.Packing%29
thanks :smile:
@notjack This seems to be what I need. Thank you for this!
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)))
I think it’s the variable for the data you want to send for your PUT or POST request.
Ok, that makes sense.
• 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
That was installing rebellion. Unfortunately rash still has problems because it looks like one of the dependent packages is not in the built server
But I can probably work around that.
:man-facepalming:
actually it’s several packages that are part of racket, and could be harder than I thought
rackunit-lib scribble-lib scribble-doc racket-doc make
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.
Can I persuade someone to test it?
@chris956 has joined the channel
I tried to reset with my email address and got an exception. I think this means I didn’t have an account.
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?
hmm. I think this is worth filling a bug in the package manager.
It should handle this better
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])]))
@deactivateduser60718 It looks good, though you could make it a little simpler using the procedure-arity-includes/c
contract
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])]))
I fixed a bug and deployed the new version of Racket Stories. Anyone willing to test the “Reset Password” mail?
Trying now.
I got the email and was able to follow the link to the password reset field.
Do you need me to reset the password, or was getting the mail enough?
I’d like to test the the resetting too. You can always reset twice - if you want the original password back.
The bug should just be for the handling of the catalog right?
Ok, one sec.
Reset and logged in successfully.
Great!
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.
Rejected?
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.
In other words, submitting with my email looks like a normal refresh.
The intention was that entering either the username or the email should send a mail.
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.
No no, I’m not talking about the reset screen.
Ah!
See it?
Yep. I’ll make a github issue, so I can remember it.
Thanks muchly
@alexisbaudron2020 has joined the channel
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 has joined the channel
I made an account without an email address (because it’s optional) and got this error
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 has joined the channel
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?
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?
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?
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!
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).
I’ve just tried raco setup --clean
followed by raco setup
, and I still have the problem in DrRacket.
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
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
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