|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
On March 11 2018 15:26 spinesheath wrote:Show nested quote +On March 11 2018 10:32 Hanh wrote:On March 11 2018 02:00 nunez wrote: i assumed the idempotency was defined wrt resources, and not responses. the resource, on the server, or the state of the server itself, does not change, but the response sent back to the client is different every time.
consider f.ex. the inclusion of a date-field in the response: it might differ for each corresponding request. An easy way to reason about GET vs POST is to remember that the client (browser) is allowed to cache the response of a GET query. If that affects your expected behavior, GET should be avoided. I have been wondering about this, too. I'm working on something that is similar to a forum in a SPA. The content of a thread necessarily changes over time. So when I request a certain thread (all its comments), do I use a GET (bad because of caching) or a POST (doesn't seem to be what POST is supposed to be for).
Absolutely a GET here. If you're requesting information that doesn't change anything on the server, it's always GET. If you're telling the server to change something, it's one of the other (POST, PUT, DEL). Just because the content you're requesting changes over time or from user to user doesn't change the fact that the command itself doesn't change anything on its own (Logging excluded).
|
On March 11 2018 02:00 nunez wrote: i assumed the idempotency was defined wrt resources, and not responses. the resource, on the server, or the state of the server itself, does not change, but the response sent back to the client is different every time.
consider f.ex. the inclusion of a date-field in the response: it might differ for each corresponding request.
I'm not sure I've seen much in the way of respsonses as an official term in REST discussion. I assumed (maybe incorrectly) that what you're calling a response was a resource.
Which thinking while typing... Might be where the disconnect is coming. When we are writing our apps we want them to do something - that's why we think in algorithm and operations. To make it RESTful we have to stop thinking about what we're doing and more about what we're managing - our resources.
This was a pretty good read about resource modelling. resource modelling
|
|
28057 Posts
|
ocaml second high paying techno after F# :O
|
28057 Posts
Dirty finance devs
|
yeah makes sense, jane street must be like 75% of all industrial ocaml dev lol
|
|
|
I have run into a strange bug(?) while templating with Pug and AWS Lambda.
sometext someothertext
When I render this on a localhost with Pug as the view engine for Express it gets templated just fine, as two separate lines of code.
When I render this on Lambda I retrieve the file from S3 with whitespace intact, and then lose the whitespace as soon as I render.
From what I've been reading Express shouldn't be the difference maker. Does anyone know why else this might be happening?
In Express my rendering is:
res.render("index")
and in Lambda it is:
pug.render( data.Body.toString() )
where data is a retrieved s3 object.
|
|
Yeah, I've been having a hard time tracking down which side to actually blame.
That link might explain my problem but I'm having a hard time wrapping my head around what they mean. Some experimenting I did in their sand box suggests that only a few elements, like <em>, are actually inlined. Also, it seems like a lot of their documentation is wrong - for example, white space in the middle of a line is not retained. In fact, it seems like all of point 2 is incorrect. Am I misunderstanding their documentation?
|
I have it working:
https://9ayj4z17y9.execute-api.ca-central-1.amazonaws.com/Test
The sliders got duplicated for whatever reason, some of the tags are messed up and it loads super slow. I don't know why any of these are problems.
I also found out 5 minutes ago that there is an automatic way to convert Express/Node apps into Lambda, but I was already done. Now I know for next time!
|
Haha, is that Monopoly?
|
Yup! My family got super into it over the Christmas break a few years ago so I wrote up a program that tells you which squares are best depending on the board state (number of houses, etc.) using a DTMC. Once my family found out I did this they coincidentally didn't want to play any more.
I would like to ask for feedback but the current version up there is so janky I'll try to fix it up before asking.
|
Very Janky, like duplicate slide bars. That said the main problem I have is I don't quite understand how to use it. It's not super user friendly, especially without instructions
|
Czech Republic12116 Posts
I spent almost a decade on a non-objective programming language and I would like to get back into a shape. Thus I am looking for several tasks from easy to hard preferably already solved in JAVA to regain my lost powers. Are there any pages with a content like that? Obviously I am not creative enough to just start writing
Obviously my Google skill is low
Thanks!
|
On March 22 2018 19:29 deacon.frost wrote:I spent almost a decade on a non-objective programming language and I would like to get back into a shape. Thus I am looking for several tasks from easy to hard preferably already solved in JAVA to regain my lost powers. Are there any pages with a content like that? Obviously I am not creative enough to just start writing Obviously my Google skill is low Thanks!
https://www.codewars.com is excellent for tasks. You can choose difficulty yourself, or just start off easy and let yourself "rank up" as you go along. After finishing/giving up on a task, you'll be able to see the solutions of other people (And then, inevitably, brood over how awful your code is compared to everyone else's..or maybe that's just me)
|
Czech Republic12116 Posts
On March 22 2018 20:28 Excludos wrote:Show nested quote +On March 22 2018 19:29 deacon.frost wrote:I spent almost a decade on a non-objective programming language and I would like to get back into a shape. Thus I am looking for several tasks from easy to hard preferably already solved in JAVA to regain my lost powers. Are there any pages with a content like that? Obviously I am not creative enough to just start writing Obviously my Google skill is low Thanks! https://www.codewars.com is excellent for tasks. You can choose difficulty yourself, or just start off easy and let yourself "rank up" as you go along. After finishing/giving up on a task, you'll be able to see the solutions of other people (And then, inevitably, brood over how awful your code is compared to everyone else's..or maybe that's just me) Thank you!!!
|
|
|
|
|