Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
using namespace std;
struct MatrixView;
template <class BaseView>
struct MatrixViewTranspose;
template <class BaseView>
#include <iostream>
using namespace std;
template <class T>
struct A;
template <class T, bool is_transposed, bool is_partial>
struct A_View : public A<T> {
struct {
@fenrir-naru
fenrir-naru / f477.c
Last active September 26, 2017 01:54
EGM96 Geoid Fortran to C
void main(){
double AR = AE / RE,
ARN = AR,
AC = 0.0,
A = 0.0,
B = 0.0;
int K = 3;
for(int N = 2; N <= NMAX; N++){ // DO 030 N=2,NMAX
ARN *= AR;
K++;
@fenrir-naru
fenrir-naru / gist:95669cb8fcbf14c22e59
Last active September 21, 2017 20:21
How to install max310x driver for RasPi 3.12.26+
# modify Kconfig to change to tristate
# make driver
sudo make prepare
sudo make modules_prepare KERNELRELEASE=$(uname -r)
sudo make SUBDIRS=drivers/tty/serial modules
sudo make SUBDIRS=drivers/tty/serial modules_install
sudo mv /lib/modules/3.12.26/extra/* /lib/modules/3.12.26+/extra/
sudo rm -r /lib/modules/3.12.26
sudo depmod
@fenrir-naru
fenrir-naru / rb-gsl.install.sh
Last active July 28, 2017 15:03
rb-gsl intall without gem command
gem install bundler
# gem env | grep "EXECUTABLE DIRECTORY" の結果を受けて
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
git clone --depth 1 https://github.com/SciRuby/rb-gsl.git
cd rb-gsl
bundler install
# ソースコードの修正、例えば
patch -p0 << __PATCH_LINE__
--- ext/gsl_native/sf_legendre.c.orig 2017-07-28 23:28:56.944690200 +0900
+++ ext/gsl_native/sf_legendre.c 2017-07-28 23:44:56.284917800 +0900
@fenrir-naru
fenrir-naru / How to use NinjaScan-Light with RTKLIB
Last active May 19, 2017 02:55
How to use NinjaScan-Light with RTKLIB
1. Make an empty file named "direct.gps" in a MicroSD(HC).
2. Make a file named "gps.cfg" in the MicroSD(HC) with containing the following binary (printed in hex format).
B5 62 09 01 10 00 C8 16 00 00 00 00 00 00 97 69 21 00 00 00 02 10 2B 22
B5 62 09 01 10 00 0C 19 00 00 00 00 00 00 83 69 21 00 00 00 02 11 5F F0
B5 62 06 01 08 00 02 10 00 01 01 01 00 00 24 2F
B5 62 06 01 08 00 02 11 00 01 01 01 00 00 25 36
(This information depends on GPS receiver firmware version. please see http://wiki.openstreetmap.org/wiki/UbloxRAW)
3. Insert the MicroSD(HC) to NinjaScan-Light and power-on. NinjaScan-Light will be recognized as COMx.
4. Configure RTKLIB input; Rover from Serial type via COMx and u-blox format.
@fenrir-naru
fenrir-naru / FmServiceUtils.smali
Last active January 10, 2017 12:23
com/miui/fmservice/FmServiceUtils.smali modification for Japan FM band
.class public Lcom/miui/fmservice/FmServiceUtils;
.super Ljava/lang/Object;
.source "FmServiceUtils.java"
# static fields
.field public static final BASE_FREQUENCY:F = 0.1f
.field public static final FRAMEWORK_AUDIOSOURCE_FM:I = 0x7ce
12-24 23:36:02.925 5405 5422 D android_hardware_fm: void ConfigFmThs::SetRxSearchAfThs(const char*, UINT): file name is: /etc/fm/fm_srch_af_th.conf
12-24 23:36:02.928 5405 5422 E android_hardware_fm: File has carriage return
12-24 23:36:02.928 5405 5422 E android_hardware_fm: line is not comment
12-24 23:36:02.928 5405 5422 E android_hardware_fm: group hash code is: 138594
12-24 23:36:02.928 5405 5422 E android_hardware_fm: group index is: 4
12-24 23:36:02.928 5405 5422 E android_hardware_fm: line is grp
12-24 23:36:02.928 5405 5422 E android_hardware_fm: File has carriage return
12-24 23:36:02.928 5405 5422 E android_hardware_fm: line is not comment
12-24 23:36:02.928 5405 5422 E android_hardware_fm: start mark is not '['
12-24 23:36:02.928 5405 5422 E android_hardware_fm: Grp: BANDCONFIG, key: RadioBand, value: 2
.class public Lcom/android/fmradio/FmUtils;
.super Ljava/lang/Object;
.source "FmUtils.java"
# static fields
.field private static final CONVERT_RATE:I = 0xa
.field public static final DEFAULT_STATION:I = 0x3e8
version: 1.0.{build}.{branch}
configuration: Release
build:
project: tool\NinjaScanLight_tools.sln
verbosity: minimal
after_build:
- cmd: 7z a windows.%APPVEYOR_REPO_BRANCH%.zip %APPVEYOR_BUILD_FOLDER%\tool\build_VC\%CONFIGURATION%\*.exe
artifacts:
- path: windows.*.zip
name: x86 binary