Skip to content

Instantly share code, notes, and snippets.

@tuckerzp
tuckerzp / format.py
Created July 9, 2021 14:34
Format json schemes using NIST's format
#!/usr/bin/env python3
import json
from typing import Any, Dict, List, Union, TextIO
OSCAL_CATALOG_FILES = [
"oscal_catalog_schema",
"oscal_component_schema",
"oscal_profile_schema",
"oscal_ssp_schema"
]
@tuckerzp
tuckerzp / loop_unrolling.c
Last active December 5, 2019 21:30
Basic Example of loop unrolling
int normal_loop(int[] nums) {
int x = 0;
for (int i = 0; i < 250; i++) {
x += nums[i];
}
return x;
}
int unrolled_loop(int[] nums) {
int x = 0;
/* Compute prefix sum of vector a */
void psum1(float a[], float p[], long n) {
float l_v, v;
l_v = p[0] = a[0];
for (long i = 0; i < n; i++) {
v = l_v + a[i];
p[i] = v;
l_v = v;