Skip to content

Instantly share code, notes, and snippets.

View jepio's full-sized avatar
🏠
Working from home

Jeremi Piotrowski jepio

🏠
Working from home
View GitHub Profile
@jepio
jepio / ubuntu20-hyperv-enhanced-session.md
Last active September 4, 2023 06:54 — forked from milnak/ubuntu20-hyperv-enhanced-session.md
Verified way of enabling enhanced session in Hyper-V for Ubuntu 20

Setup Hyper-V enhanced session for Ubuntu 20

I couldn't find instructions that were 100% complete, so I put this together.

These instructions worked fine for me. Follow each step carefully.

Download Ubuntu 20.04 desktop

Download Ubuntu Desktop 20.04 LTS from here.

@jepio
jepio / 0main.md
Last active August 29, 2015 14:25 — forked from canton7/0main.md
Git Bisect and Feature Branches

Git Bisect and Feature Branches

There are people out there who claim that merge-based workflows (that is, workflows which contain non-fast-forward merges) are bad. They claim that git bisect gets confused by merge-based workflows, and instead advocate rebase-based workflows without explicit feature branches.

They're wrong.

Furthermore, the "advantages" of their workflows are in fact disadvantages. Let me show you.

import heapq
class Vertex:
def __init__(self, val):
self.val = val
self.adjs = {}
def add_edge(self, j, val):
self.adjs[j] = val
// Define this to turn on error checking
#define CUDA_ERROR_CHECK
#define CudaSafeCall( err ) __cudaSafeCall( err, __FILE__, __LINE__ )
#define CudaCheckError() __cudaCheckError( __FILE__, __LINE__ )
inline void __cudaSafeCall( cudaError err, const char *file, const int line )
{
#ifdef CUDA_ERROR_CHECK
if ( cudaSuccess != err )
#include <mutex>
#include <queue>
#include <iostream>
std::queue<int> q; // Queue which multiple threads might add/remove from
std::mutex m; // Mutex to protect this queue
template <class F> void lock(std::mutex& mut_ex, F f)
{
std::lock_guard<std::mutex> guard{ mut_ex }; // Lock held from here to end of function