{{ message }}

Instantly share code, notes, and snippets.

🎯
Focusing

# Jabari DashN02870941

🎯
Focusing
Created Dec 13, 2017 — forked from sstephenson/back_forward.js
How to detect whether a hash change came from the Back or Forward button
View back_forward.js
 var detectBackOrForward = function(onBack, onForward) { hashHistory = [window.location.hash]; historyLength = window.history.length; return function() { var hash = window.location.hash, length = window.history.length; if (hashHistory.length && historyLength == length) { if (hashHistory[hashHistory.length - 2] == hash) { hashHistory = hashHistory.slice(0, -1); onBack();
Created May 1, 2018 — forked from nandajavarma/Timsort
Timsort implementation using Python
View Timsort
 #!/usr/lib/python # -*- coding: utf-8 -*- # # This is a re-implementation of Python's timsort in Python # itself. This is purely for learning purposes. :) # References: [ # https://en.wikipedia.org/wiki/Timsort, # http://wiki.c2.com/?TimSort # ] #
Created Jun 29, 2018
Binary Search Tree in GoLang
View bst.go
 package main import "fmt" import "strconv" //------------------------------------------------------------------------------ type Node struct { data int
Created Aug 3, 2018
Various ways to check is a 2-dimensional ArrayList contains a specified value
View Contains.java
 import java.util.List; import java.util.ArrayList; import java.util.Arrays; import java.util.Objects; import java.util.stream.Collectors; public class Contains {
Created Sep 12, 2018
A few sorting algorithms in Python
View sorting.py
 import math import random #------------------------------------------------------------------------------- ''' Default comparator that sorts numeric values in their natural order. ''' def comparator(one, two):
Last active Sep 12, 2018
Convert decimal integer to binary string
View ToBinary.java
 public class ToBinary { /** * Converts a positive integer to binary. * * @param decimal Decimal number. * @return Binary string. */ public static String binary(int decimal) {
Created Oct 10, 2018
View Quicksort.java
 import java.util.concurrent.ThreadLocalRandom; import java.util.Arrays; /** * Quicksort implementation that counts that * number of comparisons required to perform the sort. * * @author Jabari Dash */ public class QuickSort {
Last active Feb 15, 2019
A simple Java class with a one-liner that utilizes Java 8 lambdas to concisely demonstrate how to use threads and accomplish concurrency in Java.