Skip to content

Instantly share code, notes, and snippets.

View thegreatshasha's full-sized avatar

Shashwat Kumar thegreatshasha

  • UVA
  • Charlottesville, Virginia
View GitHub Profile
import math as m
t = input()
while(t):
area=0.0
dist=0.0
inp = map(float, raw_input().split(' '))
a=inp[0]
area=a*3.0/2.0*inp[1]
b=area*2.0/(3.0*inp[2])
#include <stdio.h>
int main()
{ long long int r = 1;
while(true)
{
long long int N, num=0, init=0, count=0;
//cin>>N;
scanf("%lld", &N);
if(N==0)
#include <stdio.h>
int main()
{
while(true)
{
int N,r=0, num=0;
long int init=0, count=0;
//cin>>N;
scanf("%d", &N);
char op[]={'+','-','*','/'};
bool eval(int a[],int target,int n,int pos,int prev)
{
if(pos == n) {
if(prev == target) {
return true;
}
return false;
}
for(int i=0;i<;4;i++) {
from threading import Thread
import Queue
import time
class TaskQueue(Queue.Queue):
def __init__(self, num_workers=1):
Queue.Queue.__init__(self)
self.num_workers = num_workers
self.start_workers()
w = a + b
x = c - d
y = 5 * x
z = w / y
from visualize import Plotter
import time
plotly = Plotter({'streaming_token': 'YOUR_STREAMING_TOKEN'})
for i in range(10):
time.sleep(5)
plotly.write(i, i)
import plotly.plotly as p
import datetime
import time
import numpy as np
import json
from plotly.graph_objs import *
import timeit
class Plotter:
@thegreatshasha
thegreatshasha / wrapper.py
Created December 9, 2015 18:46
Plotly wrapper
import plotly.plotly as p
import datetime
import time
import numpy as np
import json
from plotly.graph_objs import *
import timeit
class Plotter:
@thegreatshasha
thegreatshasha / numpy_ring_buffer.py
Created November 5, 2015 23:30
Fixed size circular buffer in python. Contains tests to compare it with the inbuilt deque.
from numpy import ndarray
import numpy as np
from collections import deque
import timeit
class RingBuffer():
def __init__(self, shape, dtype=np.int):
self.shape = shape
self.size = self.shape[0]