Skip to content

Instantly share code, notes, and snippets.

@ssz66666
ssz66666 / notes.md
Last active January 4, 2021 09:49
Building Anbox Android image on Arch Linux

Build Anbox Android image on Arch Linux

Introduction

This is a note for building the anbox Android image on my Arch Linux laptop.

This closely follows the official guide.

Install build dependencies

@ssz66666
ssz66666 / .gitignore
Created June 22, 2019 16:28
橙光工程gitignore
### 橙光相关 ###
Font
Data/*
Library
Backup
Backold
!Data/Story.data
!Data/StoryNew.data
@ssz66666
ssz66666 / requirements.txt
Created June 21, 2019 19:11
把石墨评论导入word
bayoo-docx==0.2.0
@ssz66666
ssz66666 / dir-aria2.sh
Last active December 3, 2019 22:30
Download http directory with aria2c
#!/bin/sh
if [ -z ${1+x} ]; then echo "URL must be specified!" && exit -1; fi
URL=$1
ARGS="${@:2}"
PARENT=$(dirname $URL)/
PARENT_ESCAPED="${PARENT//\//\\\/}"
@ssz66666
ssz66666 / query.txt
Created April 12, 2019 17:00
sql query mhealth
SELECT timestamp, subject_id, activity_id,
chest_acc_x, chest_acc_y, chest_acc_z,
left_ankle_acc_x, left_ankle_acc_y, left_ankle_acc_z,
left_ankle_gyro_x, left_ankle_gyro_y, left_ankle_gyro_z,
left_ankle_magn_x, left_ankle_magn_y, left_ankle_magn_z,
right_lower_arm_acc_x, right_lower_arm_acc_y, right_lower_arm_acc_z,
right_lower_arm_gyro_x, right_lower_arm_gyro_y, right_lower_arm_gyro_z,
right_lower_arm_magn_x, right_lower_arm_magn_y, right_lower_arm_magn_z
FROM uci_mhealth__samples,
(SELECT sample_id as sid_1, acc_x as chest_acc_x, acc_y as chest_acc_y, acc_z as chest_acc_z FROM uci_mhealth__sensor_readings WHERE location = 1),
<html lang="en" class="">
<head>
<meta charset="UTF-8">
<meta name="robots" content="noindex">
<link rel="stylesheet" href="https://cdn.plyr.io/3.4.6/plyr.css">
<style class="cp-pen-styles">/* This is purely for the demo */
.container {
max-width: 800px;
margin: 0 auto;
@ssz66666
ssz66666 / wrapper.jl
Created September 3, 2018 09:54
Partial code of implementing more generic wrapper support with reflection
_collect_union(t::Type,set) = push!(set,t)
_collect_union(t::Union,set) = _collect_union(t.b, push!(set,t.a))
collect_union(t) = _collect_union(t,Set{Type}())
_unpack_abstract(::Type{T}) where {T} = isabstracttype(T) ? Union{map(_unpack_abstract,subtypes(T))...} : T
# query Base.parent methods to find potential wrapper types
const supported_wrappers = collect_union(
Union{map(_unpack_abstract,filter(t->t!=AbstractArray,map(m->m.sig.parameters[2], methods(Base.parent))))...}
@ssz66666
ssz66666 / wrapper_toy_example.jl
Last active August 31, 2018 11:11
Toy example with traits
using SimpleTraits
abstract type MyInterface{T} end # like AbstractArray
abstract type MyGPUStruct{T} <: MyInterface{T} end # like GPUArray
struct MyStruct{T} <: MyGPUStruct{T} # like CuArray
name::String
x::T
end