Skip to content

Instantly share code, notes, and snippets.

View thamht4190's full-sized avatar

gubee thamht4190

View GitHub Profile
@thamht4190
thamht4190 / build android
Created March 14, 2020 13:33
Build Android toolchain with fortran
#armv7
./build.py --dist-dir=/home/tham/android-gcc-build/arm --toolchain arm-linux-androideabi
#aarch64
./build.py --dist-dir=/home/tham/android-gcc-build/aarch64 --toolchain aarch64-linux-android
#x86
./build.py --dist-dir=/home/tham/android-gcc-build/x86 --toolchain x86
#x86_64
@thamht4190
thamht4190 / out.txt
Last active March 14, 2020 03:25
Build OpenBLAS with Android toolchain with fortran
make[1]: Entering directory '/home/tham/workspace/OpenBLAS/interface'
arm-linux-androideabi-gcc --sysroot=/home/tham/android-gcc/prebuilts/ndk/current/platforms/android-24/arch-arm -O2 -DMAX_STACK_ALLOC=2048 -marm -Wall -DF_INTERFACE_G77 -fPIC -DNO_WARMUP -DMAX_CPU_NUMBER=1 -DMAX_PARALLEL_NUMBER=1 -DVERSION=\"0.3.9.dev\" -mfpu=neon -march=armv7-a -DASMNAME=saxpy -DASMFNAME=saxpy_ -DNAME=saxpy_ -DCNAME=saxpy -DCHAR_NAME=\"saxpy_\" -DCHAR_CNAME=\"saxpy\" -DNO_AFFINITY -I.. -I. -UDOUBLE -UCOMPLEX -c axpy.c -o saxpy.o
arm-linux-androideabi-gcc --sysroot=/home/tham/android-gcc/prebuilts/ndk/current/platforms/android-24/arch-arm -O2 -DMAX_STACK_ALLOC=2048 -marm -Wall -DF_INTERFACE_G77 -fPIC -DNO_WARMUP -DMAX_CPU_NUMBER=1 -DMAX_PARALLEL_NUMBER=1 -DVERSION=\"0.3.9.dev\" -mfpu=neon -march=armv7-a -DASMNAME=sswap -DASMFNAME=sswap_ -DNAME=sswap_ -DCNAME=sswap -DCHAR_NAME=\"sswap_\" -DCHAR_CNAME=\"sswap\" -DNO_AFFINITY -I.. -I. -UDOUBLE -UCOMPLEX -c swap.c -o sswap.o
arm-linux-androideabi-gcc --sysroot=/home/tham/andro
(base) E:\Source\OpenBLAS>conda update -n base conda
(base) E:\Source\OpenBLAS>conda config --add channels conda-forge
Warning: 'conda-forge' already in 'channels' list, moving to the top
(base) E:\Source\OpenBLAS>conda install -y cmake flang clangdev perl libflang
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
@thamht4190
thamht4190 / crypto.cc
Created April 9, 2019 04:27
arrow/parquet crypto.cc
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
@thamht4190
thamht4190 / Github move a patch to a PR
Created September 13, 2018 04:11
Github move a patch to a PR
I have to move a PR from this repo to another repo with slight difference in structure. That was how I did:
1. Go to github page of the PR, add .patch to url to get the patch file
E.g: http://github.com/<name>/<repo>/pull/<id>.patch
2. Download as <id>.patch then open that file, edit changed file path (in old repo) to new file path (in new repo).
You don't need to do this step if 2 repos have the same structure.
3. git am -3 <id>.patch
the -3 will do a three-way merge if there are conflicts.
@thamht4190
thamht4190 / parquet_properties.h
Last active September 24, 2018 01:23
parquet/properties.h
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
@thamht4190
thamht4190 / amazon_instock_checker.js
Created May 30, 2018 16:44
Check if amazon.com item in stock
var ids = [
"B07BKZCR35",
"B07BKZCR35"
]
var urlPrefix = "https://www.amazon.com/gp/product/";
function run() {
var notInStockIds = [];
var count = 0;
0. mv a/submodule a/submodule_tmp
1. git submodule deinit -f -- a/submodule
2. rm -rf .git/modules/a/submodule
3. git rm -f a/submodule
# Note: a/submodule (no trailing slash)
# or, if you want to leave it in your working tree and have done step 0
3. git rm --cached a/submodule
3bis mv a/submodule_tmp a/submodule
@thamht4190
thamht4190 / dynamic_submodule_lib_wrapper.qbs
Created March 8, 2018 17:54
[QBS] qbs wrapper for libraries built by cmake
/* [QBS] qbs wrapper for dynamic library built by cmake */
import qbs
Product {
name: "dynamicsubmodulelib"
type: ["dynamiclibrary"]
Group {
files: ["subdir/CMakeLists.txt"]
fileTags: ["cmake_project"]

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream