Skip to content

Instantly share code, notes, and snippets.

View sharmaeklavya2's full-sized avatar
📚
Not coding actively anymore. Doing math instead.

Eklavya Sharma sharmaeklavya2

📚
Not coding actively anymore. Doing math instead.
View GitHub Profile
@sharmaeklavya2
sharmaeklavya2 / apache_conf.conf
Last active January 24, 2016 10:04
Deploying a django project on Apache
<VirtualHost *:9000>
WSGIDaemonProcess owliver.com python-path=/srv/owliver:/srv/owliver/myvenv3/lib/python3.4/site-packages
WSGIProcessGroup owliver.com
Alias /media/ /srv/owliver/media/
Alias /static/ /srv/owliver/staticfiles/
<Directory /srv/owliver/staticfiles>
Require all granted
</Directory>
@sharmaeklavya2
sharmaeklavya2 / blastoff.py
Created June 5, 2016 12:26
Countdown to Blastoff
from __future__ import print_function
import time
import sys
n = 9
for i in range(n, 0, -1):
print(i, "O"*i + " "*(n-i), end='\r')
sys.stdout.flush()
time.sleep(1)
print('0 \nBlastoff!')
@sharmaeklavya2
sharmaeklavya2 / ttt_ai.py
Last active August 11, 2016 23:33
Tic-Tac-Toe AI
#!/usr/bin/env python
"""
Tic-Tac-Toe
2 players 'a' and 'b' are playing the game. Player 'a' always moves first.
board_state is a 9-character string (row-major), each character representing who marked that cell.
'0' means that the cell is unmarked.
outcome is a one-character string containing 'w', 'l' or '0'.
"""
@sharmaeklavya2
sharmaeklavya2 / clustering.md
Last active October 22, 2016 10:16
Clustering notes

Clustering

Uses of clustering

  • Summarization: Apply algo on cluster prototypes instead of actual data if actual data is large.

  • Compression: Don't store all attributes of all objects. Store all attributes for cluster prototypes.

@sharmaeklavya2
sharmaeklavya2 / ekunc.c
Last active February 10, 2017 11:12
My netcat clone
#define _POSIX_SOURCE
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<arpa/inet.h>
#include<unistd.h>
@sharmaeklavya2
sharmaeklavya2 / gsoc16.md
Last active March 15, 2017 09:54
GSoC 2016 proposal

GSoC Project Proposal

In this project I will add Python 3 support to Zulip, without breaking Python 2 compatibility. I will also add type annotation (see PEP 483 and PEP 484) to all code. If time is left, I will also add support for platforms other than Ubuntu 14.04.

Experience

I am pretty comfortable programming in Python (both Python 2 and 3, but mainly 3). I especially like exploring advanced features of Python. My primary software development experience is with Django. I have used Django in many of my projects. You can view a list of my projects (and more about my skills) at https://sharmaeklavya2.github.io.

@sharmaeklavya2
sharmaeklavya2 / cf_750F_judge.py
Created January 2, 2017 12:47
Codeforces problem 750F
#!/usr/bin/env python3
# Pass the path to a hack file as a command-line argument
import sys
from collections import defaultdict
fobj = open(sys.argv[1])
t = int(fobj.readline())
print(t, flush=True)
@sharmaeklavya2
sharmaeklavya2 / anti-coding-15.md
Last active April 1, 2017 16:05
Anti-Coding 2015 Problems - Round 1

1

What will be the output?

#include <stdio.h>
int main(){
    int c=5;
    printf("%d",main||c);
    return 0;

}

@sharmaeklavya2
sharmaeklavya2 / create_timetable.py
Last active July 23, 2017 11:11
Script to make timetable in HTML using a list of sections
#/usr/bin/env python
'Generate Time Table'
from __future__ import print_function
import sys
import argparse
from collections import defaultdict
START_TIME = 8
# Time when classes start
@sharmaeklavya2
sharmaeklavya2 / adult.ipynb
Last active August 5, 2017 17:13
US Census Income Dataset Analysis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.