Skip to content

Instantly share code, notes, and snippets.

@yfuruyama
yfuruyama / float2fix.c
Last active January 14, 2024 12:08
convert floating point number to fixed point number
#include <stdio.h>
#include <math.h>
#define FIXED_BIT 12
unsigned short int float2fix(float n)
{
unsigned short int int_part = 0, frac_part = 0;
int i;
float t;
@tkolo
tkolo / guide.md
Last active June 27, 2024 16:46
eGPU passthrough to VM for Pop!_OS/Ubuntu

Adapted from Arch wiki

Prerequisites

hardware

The extrnal monitor has to be attached to eGPU, not laptop. Otherwise this won't work.

libvirt & virt-manager

Install virt manager:

sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils

@up1
up1 / example.py
Created February 12, 2020 08:05
Diagrams
from diagrams import Cluster, Diagram
from diagrams.gcp.analytics import BigQuery, Dataflow, PubSub
from diagrams.gcp.compute import AppEngine, Functions
from diagrams.gcp.database import BigTable
from diagrams.gcp.iot import IotCore
from diagrams.gcp.storage import GCS
with Diagram("Message Collecting", show=False):
pubsub = PubSub("pubsub")