greg
2019-1-30 15:33:05

AFAICT GraphQL is actually mostly used to replace resource-oriented (REST-ish) web APIs. Those classic APIs are harder to change casually. Which is great for 3rd party users of the API. But annoying for an in-house team using the API, to make a web or native app.


greg
2019-1-30 15:34:32

So maybe GraphQL is a query language. But I am less interested in whether it is mammal or reptile, than the fact it is pooping on my lawn and should get off it. :grin:


lexi.lambda
2019-1-30 19:24:03

I feel like I’ve asked this question before, but: what is the right way to check if a module exists, given a module path? I thought maybe (module-declared? mod-path #t) was what I was looking for, but that still throws an exception if the module does not exist (and passing #f for the second argument will return #f even if the module exists but has not been loaded). Am I supposed to just catch the exception?


mflatt
2019-1-30 19:29:01

There’s not really a way to ask “would this module exist if I tried to load it?” and I don’t know if a better approach than catching the exception.


lexi.lambda
2019-1-30 19:30:08

Is there some fundamental reason for that? Which is to say, is there some reason that checking for such a thing is considered a bad idea? Or should I just embrace calling (current-module-name-resolver) and catching the exception?


lexi.lambda
2019-1-30 19:31:09

For a little bit of context, I’m writing a function that checks if a submodule exists and loads it if it does, but I want to raise an error (in terms of my function, not the module name resolver) if the base module does not exist.


mflatt
2019-1-30 20:26:56

There are some minor problems with the idea of checking. For example, does a module exists or not if it would be loaded from a particular file, but you don’t have read permissions on the file? Do you care what happens if a file that would implement the module disappears between the time that you check? A module name resolver might take other steps that complicate the question. As a practical matter, the real issue is that the ability to check for a module isn’t part of the API for a module name resolver.


lexi.lambda
2019-1-30 20:37:58

Yes, that makes sense… the race condition certainly came to mind, though the issue of permissions didn’t. Submodules are clearly different, though, in that module-declared? doesn’t complain if the submodule doesn’t exist, which I guess is what allows things like configure-runtime and reader submodules to work? My pattern is similar—if a submodule exists, I want to use it, but if it doesn’t, it isn’t an error—but since the user provides the parent module path and I look up the submodule (and the parent module really does need to exist for this operation to even make any sense), I figured it would be a simple nicety to provide the extra check that the parent module exists in case something else went wrong. I don’t think that check can really hurt here, but maybe it’d be best to attempt to load the parent module but not bother with catching the exception, and I should just let the module name resolver do the error reporting.


mflatt
2019-1-30 20:43:36

Sounds right. As for submodules, there’s a delicate balance that we were able to retrofit into the handlers that makes checking for a submodule possible — but only just.


notjack
2019-1-30 21:25:14

Huh, that sounds really similar to how URL fragments work


a.nastaev
2019-1-30 21:27:48

@a.nastaev has joined the channel


a.nastaev
2019-1-30 21:35:47

Hi guys! I have a question here: Is there a way to make DrRacket code work with git? I mean, I can push everything to the repo, but the way it appears in github is absolutely bizarre. It is not possible to read the code itself. I’ve google it but didn’t find anything helpful. I would appreciate any possible help! Thank you in advance!


soegaard2
2019-1-30 21:36:37

@a.nastaev Does your program contain an image?


a.nastaev
2019-1-30 21:37:48

Yes! I’m following HTDP2 and would love to keep everything on github.


soegaard2
2019-1-30 21:39:11

Programs without images directly inserted in the program looks normal.


soegaard2
2019-1-30 21:39:32

The solution to your problem must be to save the image next to your rkt-file.


soegaard2
2019-1-30 21:39:46

Then use load- ... something ... to load the image.


soegaard2
2019-1-30 21:40:51

I think you want to use, say, (bitmap/file "an image.png") to load your image.


a.nastaev
2019-1-30 21:44:11

I’m here following you. Thanks! Did I understand correctly, that without an image I can push any somename.rkt file to github as I can do it for example with .js file?


soegaard2
2019-1-30 21:44:21

yes


soegaard2
2019-1-30 21:45:05

Note that even when the source contains an image you can still push it to Github - but you can’t read the source on Github.


a.nastaev
2019-1-30 21:46:10

Hmmm… ?! Even without an image, the code appears on github very strangely, means I can’t read it at all


a.nastaev
2019-1-30 21:46:28

Thanks again for your help!


soegaard2
2019-1-30 21:46:49

@a.nastaev It might be that the source file used to contain an image.


soegaard2
2019-1-30 21:47:21

I am not sure of the details, but it could be DrRacket switches mode when the first image is inserted.


soegaard2
2019-1-30 21:47:29

Try with a brand new file.


a.nastaev
2019-1-30 21:48:40

Ok! Thanks a lot! Let me try it one more time and I will get back to you if you don’t mind! Thanks again! Appreciate it!


a.nastaev
2019-1-30 22:00:43

Well, somehow it is not working…


a.nastaev
2019-1-30 22:01:12

a.nastaev
2019-1-30 22:01:23

that is my original file


a.nastaev
2019-1-30 22:01:36

and that is how it appears on github:


a.nastaev
2019-1-30 22:01:54

soegaard2
2019-1-30 22:01:57

The comment box has the same effect. If the source file contains nothing but text, it ought to work.


a.nastaev
2019-1-30 22:02:58

As you see I don’t have any pictures in my file


soegaard2
2019-1-30 22:03:13

Yes. Now the issue is the comment box.


soegaard2
2019-1-30 22:03:32

If you use standard comments it works.


a.nastaev
2019-1-30 22:06:44

you mean this way? :


a.nastaev
2019-1-30 22:07:02

soegaard2
2019-1-30 22:07:11

yes


a.nastaev
2019-1-30 22:09:32

Ok! Thanks again! Let me try it one more time :slightly_smiling_face:


soegaard2
2019-1-30 22:13:00

Also you can test it by opening the rkt file in an text editor on your own computer (it’s not neccessary to upload to Github)


pocmatos
2019-1-30 22:21:58

@greg in frog is there a way to access a list of all the available pages to build the index or these need to be hardcoded?


pocmatos
2019-1-30 22:43:57

also, is there any magic incantation to get an index.html generated? I get it to generate my pages, but not an index.html.


soegaard2
2019-1-30 22:45:51

Do you have an index-template.html ?


soegaard2
2019-1-30 22:46:32

And are you using raco frog -b ?


pocmatos
2019-1-30 22:50:40

yes, I copied post-template.html to index-template.html just for testing.


pocmatos
2019-1-30 22:50:47

raco frog -b not working…


soegaard2
2019-1-30 22:51:05

hmm


pocmatos
2019-1-30 22:51:49

was actually hoping verbose mode would work but with raco frog -bV I get: raco frog -bV Frog 0.29 Very verbose mode


pocmatos
2019-1-30 22:51:52

:slightly_smiling_face:


soegaard2
2019-1-30 22:52:00

!


pocmatos
2019-1-30 22:52:01

… not that verbose.


pocmatos
2019-1-30 22:52:36

my pages are generates but index is not. I have no posts…


pocmatos
2019-1-30 22:52:48

could it be the lack of posts…let me check.


pocmatos
2019-1-30 22:53:35

shame… not that.


greg
2019-1-30 22:55:11

Well the verbosity is mostly per blog post because that is mostly what a static blog generator generates :stuck_out_tongue:


pocmatos
2019-1-30 22:55:34

ah… explains lack of verbosity.


greg
2019-1-30 22:55:49

I have to go AFK in a minute but I will try to look at this with zero blog posts and see if I can repro what you’re seeing.


pocmatos
2019-1-30 22:56:10

i added a blog post… draft. still no index.


greg
2019-1-30 22:57:14

Was this a fresh raco frog --init, or something you had from before?


pocmatos
2019-1-30 22:57:49

ah, yes…


pocmatos
2019-1-30 22:57:51

yes…


pocmatos
2019-1-30 22:57:59

that was from a fresh raco frog --init.


pocmatos
2019-1-30 22:58:07

index is not generated if there are no posts.


pocmatos
2019-1-30 22:58:13

or if the post is draft.


pocmatos
2019-1-30 22:58:24

as soon as i added a non-draft post, it worked.


pocmatos
2019-1-30 22:58:52

i guess you policy was… this is for blogs, no posts => no blog => deserved no index. :slightly_smiling_face:


greg
2019-1-30 22:58:56

Oh. Right. The draft thing means, don’t generate at all. Sorry that was confusing.


pocmatos
2019-1-30 22:59:59

so, to explain. i started a new frog blog. removed example post, copied post-template to index-template and removed footer. added page. no index generated. added post using -N, no index generated. Removed draft tag from dummy post. It worked!


greg
2019-1-30 23:00:05

Frog started as a blog generator that was supposed to be “just works”, Model T, any color so long as the color is black. It’s gotten more configurable over time, but the happy path is definitely a blog. Not a general static site generator.


greg
2019-1-30 23:00:32

Yikes, my phone just did a really loud emergency alert about snow squalls coming there. Startled me.


pocmatos
2019-1-30 23:00:39

sure… will move my no posts config to a all posts, no pages config. :slightly_smiling_face:


pocmatos
2019-1-30 23:01:07

huh, careful with the snow. us storms are all over the news here in germany.


pocmatos
2019-1-30 23:01:40

thanks @greg, time to snooze around here. will take a look at this tomorrow and change the configuration of my frog to have posts instead of pages.


greg
2019-1-30 23:02:10

It’s been crazy cold out in the U.S. mid-West like Chicago and Minneapolis, –30 F wind chill, etc. Some of that headed to Boston now but not quite as bad.


greg
2019-1-30 23:02:32

@pocmatos Sounds good. Good night.


soegaard2
2019-1-30 23:07:34

Yikes –34ºC !


samth
2019-1-31 01:53:37

yeah it was –6 F here today without wind chill


krismicinski
2019-1-31 04:07:30

let’s all stay inside and write code.