Skip to content

Instantly share code, notes, and snippets.

set ns [new Simulator]
set f [open out.tr w]
set nf [open out.nam w]
$ns trace-all $f
$ns namtrace-all $nf
proc finish {} {
global f nf ns
$ns flush-trace
//Here is the program for Lagrange Interpolation using Broadcast
#include<stdio.h>
#include<string.h>
#include "mpi.h"
int main(int argc,char *argv[])
{
int my_rank;
int p,i;
#include <bits/stdc++.h>
using namespace std;
struct combinations {
typedef vector<int> combination_t;
bool completed;
int generated;
#include <bits/stdc++.h>
using namespace std;
struct combinations {
typedef vector<int> combination_t;
bool completed;
int generated;
@zsrinivas
zsrinivas / _.py
Created September 24, 2016 06:57
import threading
import asyncio
from functools import partial
async def task(count, stime):
await asyncio.sleep(stime)
print ('%s: %s' % (threading.current_thread().name, count), flush=True)
def multi_event_loops():
def main():
return 'eightnoteight'
@zsrinivas
zsrinivas / testing.py
Created September 20, 2016 18:35
testing.py
def main():
print('hello')
def whats_my_name():
print("ooooh i'm gonna spell it out for you\n\t\t\t-- deadpool")
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
term term_frequency (tf) inverse_document_frequency (idf) weight (tf * idf)
subdocument_0 ----- ----- -----
CRIMINAL 1 3.258096538021482 3.258096538021482
Criminal 1 3.258096538021482 3.258096538021482
JURISDICTION 1 3.258096538021482 3.258096538021482
APPELLATE 1 3.258096538021482 3.258096538021482
No 1 2.159484249353372 2.159484249353372
Appeal 1 2.159484249353372 2.159484249353372
subdocument_1 ----- ----- -----
of 1 0.6931471805599453 0.6931471805599453
@zsrinivas
zsrinivas / hosts
Created April 20, 2016 11:32
my /etc/hosts
This file has been truncated, but you can view the full file.
# Ad server list for use with hosts files to block ads
#
# For more information about this list, see: http://forum.xda-developers.com/showthread.php?t=509997
# ----
# entries: 69590
# last updated 2015-07-21 22:45:15
# AdFree Version 0.0.0 (0)
# UID: 0
# sources: http://www.mvps.org/winhelp2002/hosts.txt
# http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts