Testing math
\(\int_0^{2\pi}\cos(x)\mathrm{d}x = 0\)
Rules for Programming C
- Headers may contain only type definitions and function declarations. They may not contain function definitions.
- If a header <f.h> contains a function declaration, there must be a source file <f.c> that imports <f.h> and defines all functions declared in <f.h>.
- The preprocessor may only be used to
#includeheader files and guard against multiple-inclusion of headers. - A source file <f.c> may contain at most a single
#include, and if present that#includemust be#include "f.h". If <f.c> contains themainfunction then it need not#include<f.h>. If <f.c> does not contain themainfunction then it must#include<f.h>. - All header files <f.h> must be guarded, and they must be guarded with the
#ifndef F_H,#define F_H,#endifconvention. The first two directives must appear at the top of the file on consecutive lines with no lines before them or between them. The last directive must be the last line of the file. - All
#includes in a header file must appear at the top of the file immediately after the second guard directive, with no blank lines between. Every#includemust appear on its own line. All#includes of header files defined in the project must appear, with no blank lines between them, before all#includes of header files not defined in the project. The#includes of header files not defined in the project must appear with no blank lines between them, and exactly one blank line must appear between the#includes of headers defined in the project and the#includes of headers not defined in the project. - For each source file <f.c>, a corresponding object file <f.o> must be created (for example, with
gcc -c f.c). - [CONJECTURE] In creating an executable from the object file <f.o> with corresponding source file <f.c> that contains a definition of
main, link all object files in the collection C = {<c1.o>, …, <cn.0>} (for example, withgcc c1.o ... cn.o) defined to be the smallest collection S such that- <f.o> is in S
- for each function
func, for each object file <g.o> in S, and for each source file <h.c>, iffuncis called or a pointer tofuncis created in <g.c> andfuncis defined in <h.c> then <h.o> is in S.
I would also suggest that typedef never be used, and that variables of pointer type be declared with the asterisk directly adjacent to the type name, not the variable name (write int* my_int; instead of int *my_int;).
Getting NVIDIA drivers working on RHEL 9.5
To install NVIDIA drivers on a fresh install of RHEL 9.5, I tried following the directions at the first Google result for “install nvidia drivers rhel9” that was a page from the NVIDIA docs. No matter which version of the directions I followed, the drivers would not install correctly (and sometimes I would be left with a system that boots to a blank screen). Finally I tried installing from the page everyone gets their NVIDIA drivers from normally when not using Linux, and it appears that things are working well enough.