Skip to content

Instantly share code, notes, and snippets.

View larryhou's full-sized avatar

larryhou larryhou

  • Tencent
  • Shenzhen, China
View GitHub Profile
@larryhou
larryhou / float.cpp
Last active March 7, 2021 14:06
convert memory layout among half/float/double
#include <iostream>
#include <cmath>
#ifndef DEFINE_FLOAT_TYPE
#define DEFINE_FLOAT_TYPE(_n,_s,_e,_f) \
const uint##_s##_t _n##_SIZE = _s; \
const uint##_s##_t _n##_EXPONENT_SIZE = _e; \
const uint##_s##_t _n##_FRACTION_SIZE = _f; \
const uint##_s##_t _n##_FRACTION_MASK = ((uint##_s##_t)1 << _n##_FRACTION_SIZE) - 1; \

~/.ssh/config

Host github.com *.github.com 
  Port 22
  ProxyCommand corkscrew 127.0.0.1 12639 %h %p 
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
{
"address": "10.32.67.110"
}
@larryhou
larryhou / exportOptionsAdHoc.plist
Created April 4, 2020 11:28 — forked from cocoaNib/exportOptionsAdHoc.plist
Xcode build with exportOptionsPlist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>ad-hoc</string>
</dict>
</plist>
#!/usr/bin/env python
#encoding: utf-8
class Cluster(object):
def __init__(self, name):
self.children = []
self.parent = None # type: Cluster
self.size = 0
self.name = name # type: str
self.framework = False
#!/usr/bin/env python
#encoding:utf-8
from __future__ import print_function
import os, sys, re, io, json, base64
__author__ = 'larryhou'
def load_provision(provision_file, options):
//Print which signing certificates are on computer
security find-identity -v -p codesigning

//Print what was used to codesign an app
codesign -vv -d Example.app

//Print what entitlements are enabled for app
codesign -d --entitlements - Example.app
//Since Xcode 6, the entitlements list you specify is also embedded in the app bundle as Example.app.xcent
@larryhou
larryhou / Mesh.bindposes.md
Last active October 16, 2023 16:39
Unity Mesh bindposes explanation

Unity官方文档对于Mesh.bindposes的解释比较含糊,比较难以理解其含义,在这我用人话解释下。

Mesh.bindposes是一个数组,每个元素是Matrix4x4对象,是对应骨骼初始形变的逆变换,可以消除骨骼初始的形变,这样在骨骼动画里面可以用来实时计算骨骼的形变增量,然后通过骨骼权重把对应的形变作用到顶点上。

对于这个逆变换,官方的示例看起来比较抽象

bindPoses[1] = bones[1].worldToLocalMatrix * transform.localToWorldMatrix;

要理解这行代码,可以做下简单推导