Skip to content

Instantly share code, notes, and snippets.

View Lewuathe's full-sized avatar
🈂️
👍

Kai Sasaki Lewuathe

🈂️
👍
View GitHub Profile
@Lewuathe
Lewuathe / Dockerfile
Created May 31, 2020 02:01
llvm-docker
FROM ubuntu:19.10
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y \
ninja-build \
cmake \
g++ \
python3-minimal
@Lewuathe
Lewuathe / covid-19-SIR.py
Created March 18, 2020 11:50
covid-19-SIR.py
import numpy as np
import pandas as pd
from scipy.integrate import solve_ivp
from scipy.optimize import minimize
import matplotlib.pyplot as plt
from datetime import timedelta, datetime
S_0 = 15000
I_0 = 2
R_0 = 0
@Lewuathe
Lewuathe / radix_sort.py
Created November 18, 2017 08:02
Radix Sort and counting sort
def counting_sort(arr, max_value, get_index):
counts = [0] * max_value
# Counting - O(n)
for a in arr:
counts[get_index(a)] += 1
# Accumulating - O(b)
for i, c in enumerate(counts):
if i == 0:
<html>
<meta>
<title>D3 Test</title>
<style>
.chart div {
font: 10px sans-serif;
background-color: steelblue;
text-align: right;
padding: 3px;
<property>
<name>yarn.scheduler.capacity.root.queues</name>
<value>default,custom,custom2</value>
<description>
The queues at the this level (root is the root queue).
</description>
</property>
<property>
<name>yarn.scheduler.capacity.root.default.capacity</name>
@Lewuathe
Lewuathe / .spacemacs
Created December 23, 2015 09:38
My dot spacemacs
;; -*- mode: dotspacemacs -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (ie. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
@Lewuathe
Lewuathe / spark-defaults.conf
Created December 6, 2015 04:27
Default spark conf
#spark.acls.enable true
#spark.authenticate true
#spark.authenticate.secret mysecret
#spark.admin.acls root,takeshi
#spark.ui.view.acls takeshi,userA
#spark.modify.acls takeshi
spark.ssl.useNodeLocalConf true
spark.ssl.enabled true
spark.ssl.enabledAlgorithms TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA
# java -version
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~precise1)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)
# echo $JAVA_HOME
/usr/lib/jvm/java-7-openjdk-amd64
# mvn clean test -Dtest=hivemall.regression.LogressUDTFTest -DfailIfNoTests=false
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 3 modules...
[INFO] Installing Nexus Staging features:
$ java -version
java version "1.7.0_85"
OpenJDK Runtime Environment (IcedTea 2.6.1) (7u85-2.6.1-5ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode)
$ echo $JAVA_HOME
/usr/lib/jvm/java-1.7.0-openjdk-amd64
$ mvn clean test -Dtest=hivemall.regression.LogressUDTFTest -DfailIfNoTests=false
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 3 modules...
[INFO] Installing Nexus Staging features:
@Lewuathe
Lewuathe / diff.py
Created November 20, 2015 07:46
Take character base difference
#!/usr/bin/env python
import os
def diff(file1, file2):
with open(file1, 'r') as f1:
file1_content = f1.read()
with open(file2, 'r') as f2:
file2_content = f2.read()