Skip to content

Instantly share code, notes, and snippets.

View kbendick's full-sized avatar
🏥
Recovering from surgery

Kyle Bendickson kbendick

🏥
Recovering from surgery
View GitHub Profile
@kbendick
kbendick / mergesort.cpp
Created March 8, 2016 19:44
Implementation of merge sort in c++
// Declare/initialize any useful variables here, including the temporary array
// to merge values into and then copy back into the parameter array.
/*
while the temporary array is not filled
if there are no more values in the left part of a,
move next value from right part of a into next index of the temporary array otherwise, if there are no more values in the right part of a,
move next value from left part of a into next index of the temporary array otherwise (values in each part) compare the first value in each part
move smallest value from a into next index of the temporary array
@kbendick
kbendick / radix_sort.cpp
Last active September 8, 2021 05:46
Implementation of radix sort in c++
#include <queue>
int select_digit (int number, int place)
{ return number/place % 10; }
/*
Create an array of 10 buckets, each storing an empty queue (use ArrayQueue)
for every place (6 digit numbers: 1s, 10s, 100s, 1,000s, 10,000s, and 100,000s)
for every value in array a
@kbendick
kbendick / quicksort.py
Created March 8, 2016 20:08
Simple implementation of quicksort in python
import random
R = random.Random(42)
def qsort(L):
if len(L) < 2: return L
i = R.randrange(len(L)) # Just some random index in the list.
return qsort([x for x in L if x < L[i]]) + [x for x in L if x == L[i]] + qsort([x for x in L if x > L[i]])
@kbendick
kbendick / mergesort.py
Created March 8, 2016 20:11
Merge sort using indexing into arrays to run in O(n log n)
def mergesort(L):
return L if len(L) < 2 else merge(mergesort(L[:len(L)/2]), mergesort(L[len(L)/2:]))
def merge(A,B):
Out = []
iA = iB = 0
while len(A)+len(B) > iA + iB:
if len(B) <= iB or (len(A) > iA and A[iA] < B[iB]):
Out.append(A[iA])
iA = iA + 1
@kbendick
kbendick / bt_lowest_common_ancestor.java
Last active March 8, 2016 20:56
finding lowest common ancestor in a binary tree
// Taken from CtCI-6th-Edition from @careercup
public class bt_lca {
/* One node of a binary tree. The data element stored is a single
* character.
*/
public class TreeNode {
public int data;
@kbendick
kbendick / Step 1
Created July 27, 2020 06:41 — forked from SureshChaganti/Step 1
Install hive on Mac with Homebrew
$ brew update
$ brew install hadoop
$ brew install hive
$ brew install mysql
@kbendick
kbendick / docker-container-reaper.sh
Last active July 30, 2020 06:16
Stop and remove all docker containers
# Ensure that the docker engine is running
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
# Clean up all images
docker rm $(docker images -q)
@kbendick
kbendick / openssl_commands.md
Created January 18, 2022 02:40 — forked from Hakky54/openssl_commands.md
Some list of openssl commands for check and verify your keys

openssl 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@kbendick
kbendick / iceberg-core-current-runtime-classpath.txt
Created March 21, 2022 04:32
Gradle Reported Classpath for iceberg-core without okhttp
➜ iceberg git:(master) ✗ ./gradlew iceberg-core:dependencies --configuration=runtimeClasspath
> Task :iceberg-core:dependencies
------------------------------------------------------------
Project ':iceberg-core'
------------------------------------------------------------
runtimeClasspath - Runtime classpath of source set 'main'.
+--- project :iceberg-api
@kbendick
kbendick / iceberg-1.15-diff-with-1.14-20220421.txt
Created April 21, 2022 21:00
Diff between Iceberg's Flink 1.14 source and Flink 1.15 source as of April 21st, 2022
diff --git a/./flink/v1.14/build.gradle b/./flink/v1.15/build.gradle
index a0e01c8a4..7e0b07bdc 100644
--- a/./flink/v1.14/build.gradle
+++ b/./flink/v1.15/build.gradle
@@ -17,8 +17,8 @@
* under the License.
*/
-String flinkVersion = '1.14.0'
-String flinkMajorVersion = '1.14'