carmack | John Carmack Archive | Document Editor library
kandi X-RAY | carmack Summary
kandi X-RAY | carmack Summary
WORKING WITH THE SUB-PAGES AND DATA FILES.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of carmack
carmack Key Features
carmack Examples and Code Snippets
Community Discussions
Trending Discussions on carmack
QUESTION
Background
As an organizational strategy, I like to define function-local lambdas in complicated functions. It's good for encapsulating multi-step logic, repeated operations, etc. (the sorts of things that functions are good for in general), but without creating something that'll be visible outside of the scope where it's used. It's kind of a synthesis of/alternative to the styles John Carmack lays out in his essay on the merits of inlining code in that it keeps everything neatly bottled up in the function it's intended to be used in while also giving a (compiler-recognized) name to document each block of functionality. A simple, contrived example might look like this (just pretend there was actually something complex enough going on here to merit using this sort of style):
...ANSWER
Answered 2019-Mar-28 at 19:52Yes.
Modern compilers use "static single assignment" (SSA) as an optimization pass.
Each time you assign to a value or modify it, a conceptually different value is created. Sometimes these conceptually different values share identity (for the purpose of pointers-to).
Identity, when you take the address of something, is the thing that gets in the way of this.
Simple references are turned into aliases for the value they reference; they have no identity. This is part of the original design intent for references, and why you cannot have a pointer to a reference.
Concretely:
QUESTION
For homework, I am supposed to code a recipe that takes the input of the deserts and spit out how much of the ingredients would be required. I'm still new and keep getting this error code, but could possibly be wrong altogether?
...ANSWER
Answered 2018-Sep-10 at 03:54cakes = int(input('How many cakes? ==> '))
donuts = int(input('How many dozens of donuts? ==> '))
cookies = int(input('How many dozen cookies? ==> '))
cake_eggs = 2
cake_butter = .5
cake_sugar = 1
cake_flour = 1.5
cookie_eggs = 2
cookie_butter = 2.5
cookie_sugar = 2
cookie_flour = 8
donuts_eggs = 3
donuts_butter = .25
donuts_sugar = .5
donuts_flour = 5
total_butter = cake_butter*cakes + cookie_butter*cookies + donuts_butter*donuts
total_eggs = cake_eggs*cakes + cookie_eggs*cookies + donuts_eggs*donuts
total_sugar = cake_sugar*cakes + cookie_sugar*cookies + donuts_sugar*donuts
total_flour = cake_flour*cakes + cookie_flour*cookies + donuts_flour*donuts
print('You need to order : \n' + 'Eggs = ' + str(total_eggs)+'\n' + 'Butter = ' + str(total_butter) +'\n' + 'Sugar : ' + str(total_sugar) + '\n' + 'Flour = ' + str(total_flour) )
QUESTION
In the past few weeks I was wondering what is the point that people trying to re-invent the wheel and spend hours to write their own sqrt function for example. The built-in version is optimized well, precise and stable enough.
I am speaking about the Carmack-style Square Root for example. What is the point? It will lose precision during the approximation and it uses casting.
Intel style SSE Square Root was giving precise results, but was slower in my calculations than the standard SQRT.
By average, all the above tricks were beaten by far the standard SQRT. So my question is, what is the point?
My PC has the below CPU:
Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz.
I've got the following results for each method (I've fixed the performance test according to the below suggestion by the helpful comment, thanks for that n.m.):
(Please keep in mind that if you're using approximation like Newton method, you'll lose precision so you must align your calculation accordingly.)
You can find the source code below for reference.
...ANSWER
Answered 2018-Aug-20 at 11:15For fun and profit?
Based on your question, there is no reason to do so, but if you want to learn a language, it is recommended to solve mathematical problems, because they rely on integers/floats (which are primitives in (mostly) any language) and the algorithms are well documented.
In "real" code, one should use the provided methods by libc as long as you have one. Embedded platforms usually lack of a libc or roll their own, so you have to implement your own.
QUESTION
I get an error when I use the below code:
...ANSWER
Answered 2018-Aug-14 at 23:27Try it like this:
QUESTION
John Carmack recently tweeted:
"Another outdated habit is making separate buffer objects for vertexes and indexes."
I am afraid I don't fully understand what he means. Is he implying that packing all 3D data including vertex, index, and joint data into a single vertex buffer is optimal compared to separate buffers for each? And, if so, would such a technique apply only to OpenGL or could a Vulkan renderer benefit as well?
...ANSWER
Answered 2018-Jan-24 at 07:26I think he means there's no particular need to put them in different buffer objects. You probably don't want to interleave them at fine-granularity, but putting e.g. all the indices for a mesh at the beginning of a buffer and then all the vertex data for the mesh following it is not going to be any worse than using separate buffer objects. Use offsets to point the binding points at the correct location in the buffer.
Whether it's better to put them in one buffer I don't know: if it is, I think it's probably ancillary things like having fewer larger memory allocations tends to be a little more efficient, you (or the driver) can do one large copy instead of two smaller ones when copies are necessary, etc.
Edit: I'd expect this all to apply to both GL and Vulkan.
QUESTION
You are given information about users of your website. The information includes username, a phone number and/or an email. Write a program that takes in a list of tuples where each tuple represents information for a particular user and returns a list of lists where each sublist contains the indices of tuples containing information about the same person. For example:
...ANSWER
Answered 2017-Nov-20 at 07:19I think we can simplify this using sets:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install carmack
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page