Skip to content

Instantly share code, notes, and snippets.

View himanshugoel2797's full-sized avatar
๐Ÿ™ƒ
Focusing

Himanshu Goel himanshugoel2797

๐Ÿ™ƒ
Focusing
View GitHub Profile
@himanshugoel2797
himanshugoel2797 / floating_point_err_accum.cpp
Created September 15, 2025 16:57
Floating Point Error Accumulation Demo
#include <stdio.h>
#include <cmath>
void
//__attribute__ ((optimize("-O0")))
CoordsAccumulative(float xMin, float xMax, float yMin, float yMax, int N, float* result)
{
float PerY = (yMax - yMin) / N;
float PerX = N * PerY;;
@himanshugoel2797
himanshugoel2797 / schema.json
Created October 24, 2023 04:43
ESE 481 - Lab 6 - Task 3 Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
#include <stdint.h>
struct b2m_table {
uint32_t byteToMorton[256];
uint8_t mortonToByte[1 << (3 * 4)];
constexpr b2m_table() : byteToMorton(), mortonToByte() {
for (uint32_t i = 0; i < 256; i++) {
uint32_t cur_val = 0;
for (int j = 0; j < 8; j++)
/**
* Demonstrates how can map a 32-bit integer to a range faster than
* a modulo reduction.
* Assumes x64 processor.
* gcc -O3 -o fastrange fastrange.c
*/
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
using Kokoro.Math;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Kokoro.Graphics.Voxel
SAMPLE_COUNT_8_BIT
framebufferNoAttachmentsSampleCounts:
SAMPLE_COUNT_1_BIT
SAMPLE_COUNT_2_BIT
SAMPLE_COUNT_4_BIT
SAMPLE_COUNT_8_BIT
maxColorAttachments = 8
sampledImageColorSampleCounts:
SAMPLE_COUNT_1_BIT
SAMPLE_COUNT_2_BIT
#%%
import keras.backend as K
dtype='float32'
K.set_floatx(dtype)
# default is 1e-7 which is too small for float16. Without adjusting the epsilon, we will get NaN predictions because of divide by zero problems
#K.set_epsilon(1e-4)
import keras
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#define SIDE 128
#define PATH_LEN 10
#define MIN_PATH_LEN 8
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stddef.h>
typedef struct {
uint32_t magic;
uint32_t count;
uint8_t stuff[12];
#!/usr/bin/env python3
import os.path
import struct
from idautils import *
from idc import *
INFO_SIZE = 0x5c
NAME_OFF = 4