This file contains hidden or 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 java.util.*; | |
public class BTree<Key extends Comparable> | |
{ | |
public BTree(int degree) | |
{ | |
if (degree <= 0) | |
{ | |
throw new IllegalArgumentException("Degree must be greater 0!"); | |
} |
This file contains hidden or 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
template<typename Iterator, typename Value> | |
struct Position | |
{ | |
Position(const Iterator& iterator_, const Value& value_) | |
: iterator(iterator_) | |
, value(value_) | |
{ } | |
Iterator iterator; | |
This file contains hidden or 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
#ifndef UTILITY_HPP | |
#define UTILITY_HPP | |
#include "global.hpp" | |
#include <algorithm> | |
#include <chrono> | |
#include <cmath> | |
#include <ctime> | |
#include <iterator> |
This file contains hidden or 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
bool graph_exists(std::vector<int> degrees) | |
{ | |
auto remaining = degrees.size(); | |
for (auto i = degrees.begin(), end = degrees.end(); i != end; ++i) | |
{ | |
std::sort(i, end, std::greater<int>()); | |
if (*i == 0) return true; | |
This file contains hidden or 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
#include <iostream> | |
#include <netdb.h> | |
#include <netinet/in.h> | |
#include <stdexcept> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <unistd.h> |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function, division | |
import re | |
import sys | |
import numpy as np | |
This file contains hidden or 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
#include <assert.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "hashtable.h" | |
#include <stdio.h> | |
This file contains hidden or 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
#include <arpa/inet.h> | |
#include <asm/byteorder.h> | |
#include <assert.h> | |
#include <errno.h> | |
#include <net/ethernet.h> | |
#include <netinet/ether.h> | |
#include <netinet/icmp6.h> | |
#include <netinet/ip6.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import division | |
import numpy as np | |
def pca(X, cutoff=2): | |
""" | |
Performs principal components analysis on a data-set. |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import math | |
import random | |
WORD_SIZE = 32 | |
WORD_MAX = 1 << 32 | |
WORD_MASK = WORD_MAX - 1 |