Skip to content

Instantly share code, notes, and snippets.

View KireinaHoro's full-sized avatar

Pengcheng Xu KireinaHoro

View GitHub Profile
@shankerwangmiao
shankerwangmiao / gcj02towgs84.jq
Created April 24, 2021 11:17
GCJ-02 to WGS-84
def __out_of_china:
.lng > 73.66 and .lng < 135.05 and .lat > 3.86 and .lat < 53.55 | not;
def __PI: 3.1415926535897932384626;
def __transformlng:
300.0 + .lng + 2.0 * .lat + 0.1 * .lng * .lng + 0.1 * .lng * .lat + 0.1 * (.lng | fabs | sqrt) +
(20.0 * (6.0 * .lng * __PI | sin) + 20.0 * (2.0 * .lng * __PI | sin)) * 2.0 / 3.0 +
(20.0 * (.lng * __PI | sin) + 40.0 * (.lng / 3.0 * __PI | sin)) * 2.0 / 3.0 +
(150.0 * (.lng / 12.0 * __PI | sin) + 300.0 * (.lng / 30.0 * __PI | sin)) * 2.0 / 3.0;
@ax3l
ax3l / symbols_cpp.md
Last active January 29, 2024 08:07
Symbol Visibility 101 by Boris Staletic @bstaletic

Visible Symbols in C++ Projects

Intro

This is a spontaneous and verbatime log of a conversion with Boris Staletic @bstaletic from March, 24th 2018 on the pybind11 gitter. Thank you so much, Boris!

To confuse future readers, we decided to write down the discussion and I added typos and unnecessarily long sentences.

The issue came up with linking a CMake (library) target into a pybind11 module (in openPMD-api).

@pachadotdev
pachadotdev / 00-install-intel-mkl-64bit
Last active February 4, 2021 07:59
Install Intel MKL (64 bit) on Ubuntu 17.10
# Option 1: Use apt-get
# keys taken from https://software.intel.com/en-us/articles/installing-intel-free-libs-and-python-apt-repo
cd ~/GitHub/r-with-intel-mkl/
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
sudo apt-get update && sudo apt-get install intel-mkl-64bit
@kentwait
kentwait / cuda-beagle-beast_setup.md
Last active March 27, 2024 14:10
How to set-up CUDA, BEAGLE, and MrBayes/BEAST

Overview

Bayesian phylogentic programs like MrBayes and BEAST work better when the BEAGLE library is installed. BEAGLE provides these programs with an MCMC sampler using CPU-based or GPU-based computation. Therefore, before compiling or using MrBayes and BEAST, BEAGLE and other prerequisites must be set-up and installed first. Unfortunately, setting-up all these software and libraries can become pretty frustrating very quickly.

Here I show how to properly set-up these programs to keep your frustration to a minimum. Broadly speaking, these instructions are applicable for Windows, Mac, and Linux. However, because I am specifically recounting my own experiencing setting-up my Linux machine, the more detailed parts of this guide focuses on installing on Linux.

@ruliana
ruliana / quicksort.rkt
Created February 11, 2016 00:39
Quicksort implemented in Racket
#lang racket
(define/match (quicksort elements)
[('()) '()]
[((list pivot rest ...))
(define (<pivot x) (< x pivot))
(define-values (small large) (partition <pivot rest))
(append (quicksort small)
(list pivot)
(quicksort large))])
@TheGU
TheGU / uploader.go
Created September 11, 2015 10:07
Golang to upload file to google drive with progress bar using Google API
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
@mattratleph
mattratleph / vimdiff.md
Last active March 27, 2024 10:04 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)