Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for djm
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #289864 | Initial revision | — | about 1 year ago |
Answer | — |
A: How does scoping work in R? Unlike some other languages, all scoping in R is dynamic. When R evaluates an expression like `print(b)`, it looks up the function `print` in the current "environment", and later will look up the variable `b` in the same environment. Environments Environments are R objects that have two p... (more) |
— | about 1 year ago |
Edit | Post #289863 | Initial revision | — | about 1 year ago |
Question | — |
How does scoping work in R? If I run `ls()` in R, it shows the variables (including functions) in my workspace. But there are other variables visible too, e.g. functions from packages like `ls` itself. And if I write a function myself, all of those are still visible as well as local variables from that function, but not varia... (more) |
— | about 1 year ago |
Comment | Post #278365 |
Another improvement: you say `<<-` "goes through all environments", but that's not quite right. It goes through the chain of parent environments to the function evaluation environment. If it finds an unlocked variable matching the name you are assigning to, it assigns there. (Package variables ar... (more) |
— | about 1 year ago |
Comment | Post #278365 |
You end up saying `assign()` is safer. You might want to put that first, and leave the `<<-` super-assignment operator for later. The fact that `<<-` assigns to the global environment when it doesn't find the variable in parent environments is more of a design flaw than a good thing. (more) |
— | about 1 year ago |
Comment | Post #289655 |
Does this have something to do with RStudio? (more) |
— | about 1 year ago |
Edit | Post #289861 | Initial revision | — | about 1 year ago |
Answer | — |
A: How do I properly render a quad in OpenGL using a GL_TRIANGLE_STRIP primitive? It looks like your `vertexSizeBytes` stride variable doesn't include `uvSize`. To figure things like this out, use this kind of logic: The shape of the image isn't a square, so something is wrong with the position coordinates. Possible problems: bad offset, bad stride, bad size, bad order o... (more) |
— | about 1 year ago |