Skip to content

Instantly share code, notes, and snippets.

@pncnmnp
pncnmnp / random_episode.py
Last active Apr 12, 2019
edit the 'path' variable to the place where your tv show directories are, then edit command line options accordingly.
View random_episode.py
from random import choice
from os import listdir, chdir, system
from os.path import isdir
from glob import glob
#from subprocess import Popen
from readline import parse_and_bind
from pprint import pprint
from sys import argv
'''
@pncnmnp
pncnmnp / game_of_life.py
Last active Feb 28, 2019
conway's game of life ( simple implementation )
View game_of_life.py
from termcolor import colored
import matplotlib.pyplot as plt
import matplotlib.animation as animation
class Conway:
def __init__(self):
self.N = 60
self.generations = 300
self.curr_board = [[0 for i in range(self.N)] for j in range(self.N)]
self.prev_board = [[0 for i in range(self.N)] for j in range(self.N)]
@pncnmnp
pncnmnp / news_corpus.txt
Last active Jun 10, 2020
22 years ( 1995 - 2017 ) worth of news scrapped from Wikipedia ( with dates )
View news_corpus.txt
This file has been truncated, but you can view the full file.
Current events of September 3, 1995 (1995-09-03) (Sunday) :
eBay is founded.
Current events of September 6, 1995 (1995-09-06) (Wednesday) :
NATO air strikes against Bosnian Serb forces continue, after repeated attempts at a solution to the Bosnian War fail.
Current events of September 19, 1995 (1995-09-19) (Tuesday) :
The Washington Post and The New York Times publish the Unabomber's manifesto.
Current events of September 22, 1995 (1995-09-22) (Friday) :
American millionaire Steve Forbes announces his candidacy for the 1996 Republican presidential nomination.
Current events of September 23, 1995 (1995-09-23) (Saturday) :
@pncnmnp
pncnmnp / 2d_tranformation.c
Last active Apr 21, 2019
"computer graphics" lab's code
View 2d_tranformation.c
#include<stdio.h>
#include<graphics.h>
#include<math.h>
// with math module don't forget to use '-lm'
// For a triangle
int trans_sx = 30;
int trans_sy = 30;
@pncnmnp
pncnmnp / output.gif
Last active May 31, 2019
Popup Encyclopedia : demos
@pncnmnp
pncnmnp / bit_stuffing.c
Created Nov 6, 2019
Computer Network practical practise problems
View bit_stuffing.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 100
int main(void) {
char data[MAX], output_data[MAX+MAX];
printf("Enter the data: ");
scanf("%s", data);
View ASCBCD.ASM
.model small
.data
res1 db 10,13,"Enter the bcd value: $"
iresult db 10,13,"Hex value is: $"
result db 10,13,"Ascii value is: $"
.code
mov ax,@data
mov ds,ax
lea dx,res1
View 11_train.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
,text
0,"Alice’s Adventures in Wonderland
by Lewis Carroll
THE MILLENNIUM FULCRUM EDITION 3.0
Contents
CHAPTER I. Down the Rabbit-Hole
View 1777_train.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
,text
0,"1595
THE TRAGEDY OF ROMEO AND JULIET
by William Shakespeare
Dramatis Personae