Skip to content

Instantly share code, notes, and snippets.

@cloudqq
cloudqq / README.en.md
Created November 13, 2022 03:31 — forked from niw/README.en.md
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

Here is easy steps to try Windows 10 on ARM or Ubuntu for ARM64 on your Apple Silicon Mac. Enjoy!

NOTE: that this is current, 10/1/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac

This is a comparison of the different formatting styles including with clang-format.

Generated via:

styles=( LLVM Google Chromium Mozilla WebKit )
for style in $styles
do
  clang-format -style=$style ChLcpIterativeAPGD.h > ChLcpIterativeAPGD.$style.h

done

@cloudqq
cloudqq / endian.hpp
Created May 15, 2022 06:48 — forked from Alexhuszagh/endian.hpp
Cross-Platform Solution to Determine System Byte-Order
// :copyright: (c) 2014-2016 Mathias Panzenböck
// :license: Public Domain/MIT, see licenses/MIT.txt for more details.
// :modified: Alex Huszagh, 2016. Added Windows-specific pre-processor definitions and byte-swap algorithms.
/** Endian utilties for determining and swapping byte order in
* applications.
*/
#include <algorithm>
#pragma once
# this file contains keys needed for decryption of file system data (WUD/WUX)
# 1 key per line, any text after a '#' character is considered a comment
# the emulator will automatically pick the right key
541b9889519b27d363cd21604b97c67a # example key (can be deleted)
d7b00402659ba2abd2cb0db27fa2b656 # Common
805e6285cd487de0faffaa65a6985e17 # Espresso Ancast
b5d8ab06ed7f6cfc529f2ce1b4ea32fd # Starbuck Ancast
9a164ee15ac7ceb64d3cc130094095f6 # 007 Legends [EUR, NUS]
@cloudqq
cloudqq / opengl.c
Created January 23, 2022 08:41 — forked from surafel911/opengl.c
#include <qubit/platform/platform.h>
#include <qubit/platform/platform_winapi.h>
#include <stdbool.h>
#include <windows.h>
#include <glad/wgl.h>
#include <qubit/qubit.h>
@cloudqq
cloudqq / windows_modern_opengl_context.c
Created January 21, 2022 14:09 — forked from nickrolfe/windows_modern_opengl_context.c
Sample code showing how to create a window using a modern OpenGL core profile context without any libraries other than the standard Win32 wglXXX calls.
// Sample code showing how to create a modern OpenGL window and rendering context on Win32.
#include <windows.h>
#include <gl/gl.h>
#include <stdbool.h>
typedef HGLRC WINAPI wglCreateContextAttribsARB_type(HDC hdc, HGLRC hShareContext,
const int *attribList);
wglCreateContextAttribsARB_type *wglCreateContextAttribsARB;
@cloudqq
cloudqq / isobmff.md
Created April 8, 2021 06:57 — forked from yohhoy/isobmff.md
ISO Base Media File Format

AAC

ISO/IEC 14496-3, 1.6.2.1 AudioSpecificConfig

AudioSpecificConfig() {
	audioObjectType = GetAudioObjectType();
	samplingFrequencyIndex; // 4 bslbf
	if (samplingFrequencyIndex == 0xf) {
		samplingFrequency; // 24 uimsbf
	}
@cloudqq
cloudqq / parse_h265.py
Created April 8, 2021 02:52 — forked from figgis/parse_h265.py
H.265/HEVC bitstream parser
#!/usr/bin/env python
"""
- ae(v): context-adaptive arithmetic entropy-coded syntax element. The parsing process for this descriptor is
specified in clause 9.3.
- b(8): byte having any pattern of bit string (8 bits). The parsing process
for this descriptor is specified by the return value of the function
read_bits( 8 ).
- f(n): fixed-pattern bit string using n bits written (from left to right)
@cloudqq
cloudqq / boilerplate.swift
Created February 13, 2021 01:44 — forked from chriseidhof/boilerplate.swift
QuickMacApp
// Run any SwiftUI view as a Mac app.
import Cocoa
import SwiftUI
NSApplication.shared.run {
VStack {
Text("Hello, World")
.padding()
.background(Capsule().fill(Color.blue))
vec4 pack (float depth)
{
const vec4 bitSh = vec4(256 * 256 * 256,
256 * 256,
256,
1.0);
const vec4 bitMsk = vec4(0,
1.0 / 256.0,
1.0 / 256.0,
1.0 / 256.0);