This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- google's material design colours from | |
http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
<!--reds--> | |
<color name="md_red_50">#fde0dc</color> | |
<color name="md_red_100">#f9bdbb</color> | |
<color name="md_red_200">#f69988</color> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put this where plugins are at | |
apply plugin: 'maven' | |
// Put this at the bottom of the build.gradle file | |
task generatePom << { | |
pom { | |
project { | |
inceptionYear = '2015' | |
} | |
}.writeTo("pom.xml") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variables | |
def javaVersionLang = 1.8 | |
// Buildscript | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.6.RELEASE") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Number of Combinations for pool size (n) and choosing (k) number per set. | |
# Author arose13 | |
import math | |
def number_of_combinations(n, k): | |
numer = n | |
denom = k | |
for i in range(1, k): | |
numer = numer * (n - i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from collections import Counter | |
from itertools import combinations_with_replacement | |
population = [ | |
'pp', | |
'pp', | |
'qq', | |
'pq', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def swarm(func, bounds, ieqcons=[], f_ieqcons=None, args=(), kwargs={}, | |
swarmsize=100, omega=0.5, phip=0.5, phig=0.5, maxiter=100, | |
minstep=1e-12, minfunc=1e-12, debug=False): | |
""" | |
Perform a particle swarm optimization (PSO) | |
Parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find all unique characters in the string | |
String uniqueLettersInTestString = ""; | |
for (int i = 0; i < testString.length(); i++) { | |
if (!uniqueLettersInTestString.contains(String.valueOf(testString.charAt(i)))) { | |
uniqueLettersInTestString = uniqueLettersInTestString + String.valueOf(testString.charAt(i)); | |
} | |
} | |
System.out.println("Unique Letters are: " + uniqueLettersInTestString); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import serial | |
def serial_ports(): | |
ports = glob.glob('/dev/tty[A-Za-z]*') | |
working_ports = [] | |
for port in ports: | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import warnings | |
import numpy as np | |
import pandas as pd | |
import scipy.stats as st | |
from tqdm import tqdm | |
from scipy.stats import iqr | |
def solve_n_bins(x): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def inverse_normal_cdf(p, mean, std): | |
""" | |
This is the inverse to a normal distribution's CDF. | |
While much slower this means you do not need Scipy as a project requirement. | |
:param p: list of p = (0, 1) | |
:param mean: | |
:param std: | |
:return: | |
""" |
OlderNewer