Skip to content

Instantly share code, notes, and snippets.

View YiqinZhao's full-sized avatar
🎯
Focusing

Yiqin Zhao YiqinZhao

🎯
Focusing
View GitHub Profile
@chenxiaolong
chenxiaolong / DellXPS15_9560_AHCI_RAID.md
Created November 27, 2017 01:33
Switching between AHCI and RAID on the Dell XPS 15 (9560)

Switching between AHCI and RAID on the Dell XPS 15 (9560)

This guide likely applies to other models and, potentially, even laptops from other OEMs that have NVME drives. However, I've only tested this on my Dell XPS 15 (9560) with the OEM Windows installation from the Signature Edition model.

Switching from RAID to AHCI

Switching from RAID to AHCI is significantly simpler than switching from AHCI to RAID. All that's needed is a successful boot to Safe Mode.

  1. To set the default boot mode to Safe Mode, use msconfig.exe or open an admin cmd/PowerShell window and run:
@ditzel
ditzel / KdTree.cs
Last active March 11, 2025 12:50
k-d Tree
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Profiling;
public class KdTree<T> : IEnumerable<T>, IEnumerable where T : Component
{
protected KdNode _root;
protected KdNode _last;
@tarukosu
tarukosu / cameraToWorld.cs
Last active November 30, 2022 17:40
HoloLens カメラ座標から世界座標への変換
void OnPhotoCaptured(PhotoCapture.PhotoCaptureResult result, PhotoCaptureFrame photoCaptureFrame)
{
Matrix4x4 cameraToWorldMatrix;
photoCaptureFrame.TryGetCameraToWorldMatrix(out cameraToWorldMatrix);
Matrix4x4 projectionMatrix;
photoCaptureFrame.TryGetProjectionMatrix(out projectionMatrix);
var imagePosZeroToOne = new Vector2(pixelPos.x / imageWidth, 1 - (pixelPos.y / imageHeight));
var imagePosProjected = (imagePosZeroToOne * 2) - new Vector2(1, 1); // -1 to 1 space
@YiqinZhao
YiqinZhao / bastard.py
Last active December 5, 2018 12:19
GPU Bastard, control the resource belong to you!
import os
import time
import argparse
import GPUtil
from multiprocessing import Process
parser = argparse.ArgumentParser(description='GPU Bastard, control the resource belong to you!')
parser.add_argument('--index',
help='GPU Index',
@Lucifier129
Lucifier129 / monadic-functional-observable.js
Created March 30, 2019 13:16
monadic functional observable supports pullable and pushable
const identity = x => x
const noop = () => {}
const pipe = (...args) => args.reduce((a, f) => f(a))
const create = producer => sink => {
let isFinish = false
let wrap = f => a => {
if (isFinish) return
if (f) f(a)
@Sunmish
Sunmish / fluxtools.py
Last active April 7, 2024 16:59
Measure integrated flux densities in images.
# TODO:
# Add precision options. Currently values are returned at arbitrary precision.
# Add `strip_extra_axes` function for use when reading in FITS images.
# Clean up read_fits and associated FITS file handling functions.
# Fix up documentation.
# This code is years worth of additions and changes that represent my own 'journey' in learning python
# and studying radio astronomy - so some (a lot) of it is horribly ineffecient.
import numpy as np