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
from concurrent.futures import ProcessPoolExecutor, wait | |
from multiprocessing import Manager | |
from argparse import ArgumentParser | |
from concurrent.futures import Future | |
from typing import List, Dict | |
import fastparquet | |
import os | |
import pandas as pd | |
import numpy as np |
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
//Finds an unknown point distance L along a quadratic curve from a known point. | |
//Alex Pilafian 2017 - sikanrong@gmail.com - github.com/sikanrong | |
//If you reuse this code please give me attribution, my dude! I worked hard on this. | |
//parabola defined by ax^2 + bx + c, a and b are passed in to constructor while c is omitted because it isn't relevant to our calculations. | |
//u is known point x-value | |
//L is known length to travel down the curve for our unknown point. | |
//v is the unknown point x-value, once we have v we can calculate the correspondiing unknown y just by pluging it | |
//back into our parabola function |
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
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "dumb_agent", | |
"type": "python", | |
"request": "launch", |
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 {Injectable, Inject, Optional} from '@angular/core'; | |
import { | |
HttpInterceptor, | |
HttpHandler, | |
HttpRequest, | |
HttpHeaders, | |
HttpResponse, | |
HttpErrorResponse | |
} from '@angular/common/http'; | |
import {Request} from 'express'; |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
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
iex(14)> ring = HashRing.new() |> HashRing.add_node(:a) |> HashRing.add_node(:b) | |
#<Ring[:a, :b]> | |
iex(15)> [:foo, :bar, :baz, :flop] |> Enum.each(fn(k) -> IO.puts(HashRing.key_to_node(ring, k)) end) | |
b | |
b | |
b | |
a | |
:ok | |
iex(16)> ring = HashRing.add_node(ring, :c) | |
#<Ring[:a, :c, :b]> |
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
//https://www.geeksforgeeks.org/check-if-a-given-number-is-sparse-or-not/ | |
/* | |
* check_sparse.c | |
* | |
* Created on: Aug 2, 2018 | |
* Author: sikanrong | |
*/ | |
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
//https://www.geeksforgeeks.org/rotate-bits-of-an-integer/ | |
/* | |
* rotate_bits.c | |
* | |
* Created on: Aug 2, 2018 | |
* Author: sikanrong | |
*/ | |
#include <stdio.h> |
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
//https://www.geeksforgeeks.org/calculate-square-of-a-number-without-using-and-pow/ | |
//Calculate a number's square without using /, *, or pow(). | |
#include <stdio.h> | |
int main(){ | |
int n; | |
printf("Please enter an integer: "); |
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
//Smallest power of 2 greater than or equal to n | |
//https://www.geeksforgeeks.org/smallest-power-of-2-greater-than-or-equal-to-n/ | |
var smallestPowerOfTwo = function(x){ | |
var bitPlaces = 0; | |
while(x){ | |
bitPlaces++; | |
x >>= 1; | |
} | |
return 1 << bitPlaces; |
NewerOlder