Skip to content

Instantly share code, notes, and snippets.

@jakubtuchol
jakubtuchol / sorting_runtimes.csv
Last active August 8, 2017 16:45
Sorting runtimes
algorithm num_ints time
heap 10 0.000000866
heap 10 0.00000055
heap 10 0.00000045800000000000005
heap 10 0.00000036700000000000004
heap 10 0.00000045000000000000003
heap 100 0.000004853
heap 100 0.000004684
heap 100 0.0000046300000000000006
heap 100 0.000004695
sudo apt-get update
sudo apt-get install -y python-software-properties git
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
git clone https://github.com/react-boilerplate/react-boilerplate
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get -y install yarn
cd react-boilerplate
yarn install
@jakubtuchol
jakubtuchol / EchoServer.java
Created January 27, 2017 21:23
Multithreaded echo server
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.Runnable;
import java.lang.Thread;
import java.net.ServerSocket;
import java.net.Socket;
public class EchoServer {
public static void main (String[] args) {
@jakubtuchol
jakubtuchol / SVN_Tutorial.md
Created January 9, 2017 23:58
Subversion tutorial for MPCS 54001

Subversion Tutorial

Installing Subversion

  • Linux: Subversion should already be installed.

    • Run svn --version in the command line to make sure.
  • Mac: Should also have SVN installed

    • Try running svn --version on the command line terminal
  • If not installed, install XCode and the command line tools (follow up until step 1 of this tutorial).

#!/usr/bin/env bash
cd ~/.vim/bundle
for i in `ls`; do
cd "$i"
git pull
cd ..
done
" editing
set expandtab
set autoindent
set smartindent
set cindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
filetype plugin on
@jakubtuchol
jakubtuchol / NameLister.java
Created November 8, 2016 01:38
Pinterest Interview Question
package com.jakubtuchol.algorithms.questions;
/**
* Created by jakub on 12/12/15.
*/
public class NameLister {
public static String listNames(String[] names) {
if (names.length == 1)
return names[0];
package com.jakubtuchol.algorithms.questions;
/**
* Created by jakub on 12/3/15.
*/
public class QuickUnion {
private int[] parent;
private int[] size;
private int count;
function processData(input) {
var residues = {};
for (var i = 0; i < input.length; i++) {
var curNum = input[i];
var residue = curNum % k;
if (residue in residues) {
residues[residue] += 1;
} else {
residues[residue] = 1;
}
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
struct node {
struct node *next;
int val;
};
struct node *reverse_list(struct node *ll)