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 / lolcode_tutorial.md
Last active October 9, 2024 18:03
LOLCODE tutorial

LOLCODE

LOLCODE is an esoteric programming language inspired by lolcat memes on the internet. The language was created in 2007 by Adam Lindsay, researcher at Lancaster University's Computing Department.

Here I have explained basics of LOLCODE with complete examples. However, you may have questions even after reading them because I have not included all details. For an exhaustive reference, read the official documentation.

Hello World

HAI 1.2
BTW This is the famous 'Hello World' program
@sharmaeklavya2
sharmaeklavya2 / CPSIG14.md
Last active August 31, 2017 12:58
CPSIG 2014 problems

CPSIG 2014 Problems

This is a list of problems suggested by seniors who taught in the 2014 CPSIG. You can read theory from tutorials on Codechef or TopCoder or a book on algorithms.

Stack

Easy:

Transform the expression

Tough:

@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 / 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 / psql_to_csv.sh
Created January 24, 2016 10:00
Export all tables in a postgres database to a set of CSV files
#!/bin/bash
DB_NAME="$USER"
DBMS_SHELL="psql"
#if [ "$1" = '--help' ]; then
if [[ ( "$1" == '--help' ) || ( "$1" == '-h' ) ]]; then
echo "usage: $0 [DB_NAME] [DBMS_SHELL]"
echo "default DB_NAME is your username"
echo "default DBMS_SHELL is 'psql'"
@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 / CP1.md
Last active May 10, 2023 21:26
Getting started with Competitive Programming

Starting out with Competitive Programming

(This guide is meant for beginners. If you have solved 100+ problems and are looking for guidance on how to solve problems involving algorithms and data structures, this document is not for you.)

Competitive Programming is an interesting activity which mixes problem solving with programming. It is not only enjoyable but also very demanded in placements. Competitive programming will make you very good at writing efficient programs quickly.

@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 / trail.py
Last active April 26, 2020 13:21
Rockets using threading
#!/usr/bin/env python
"""
Controls:
Press keys A and D to move rocket 1
Press keys H and K to move rocket 2
Press Ctrl+C to exit
"""
from __future__ import print_function
@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!')