Skip to content

Instantly share code, notes, and snippets.

/**
* READ THIS LICENSE AGREEMENT CAREFULLY BEFORE USING THIS PRODUCT. BY USING
* THIS PRODUCT YOU INDICATE YOUR ACCEPTANCE OF THE TERMS OF THE FOLLOWING
* AGREEMENT. THESE TERMS APPLY TO YOU AND ANY SUBSEQUENT LICENSEE OF THIS
* PRODUCT.
*
* License Agreement for FLUTE
*
* Copyright (c) 2004 by Dr. Chris C. N. Chu
* All rights reserved
@rkrishnasanka
rkrishnasanka / chthesis.sh
Last active February 24, 2016 22:08
Fluigi Tools
#!/bin/sh
#java -Xmx5000m -jar runFluigi.jar ../devices/chthesis/64.uf -i fluigi.ini -o eps
#java -Xmx5000m -jar runFluigi.jar ../devices_ali/xgrid_128.uf -i fluigi.ini -o eps
echo "Running Cassie's Thesis Benchmarks 2D"
for f in ../devices/chthesis/*.uf;
do
/*
* This is an basic example show the various parsing and
*/
grammar example;
//Parsing rules
//This is the statement that tells ANTLR the structure of the program.
programBlock
#-------------------------------------------------------------------------------
# PID.py
# A simple implementation of a PID controller
#-------------------------------------------------------------------------------
# Example source code for the book "Real-World Instrumentation with Python"
# by J. M. Hughes, published by O'Reilly Media, December 2010,
# ISBN 978-0-596-80956-0.
#-------------------------------------------------------------------------------
import time
import sys
import base64
import struct
key = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAADQ1IiOUdFSuqJ2l0fhs= root@kali'
# get the second field from the public key file.
keydata = base64.b64decode(
key.split(None)[1])
int g1=12;
int g2=11;
int g3=10;
int g4=9;
float mi,x1,x2,pi,w1,w2;
int count1,count2;
void setup(){
Serial.begin(9600);
pi=(22.0/7.0);
//FFT.cpp
#include<iostream.h>
#include<conio.h>
#include<math.h>
#include<dos.h>
#include<complex.h>
#define pi 3.141592654
void main()
@rkrishnasanka
rkrishnasanka / pdftoimg.py
Created December 31, 2015 21:58
PDF to IMG Conversion script using imagemagick and wand
from wand.image import Image
# Converting first page into JPG
with Image(filename="/thumbnail.pdf[0]") as img:
img.save(filename="/temp.jpg")
# Resizing this image
with Image(filename="/temp.jpg") as img:
img.resize(200, 150)
img.save(filename="/thumbnail_resize.jpg")
@rkrishnasanka
rkrishnasanka / Packet.cs
Created November 21, 2014 01:59
Generic Packet Class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Packet
{
// ----------------
@rkrishnasanka
rkrishnasanka / Synflood.py
Created October 18, 2014 19:45
Synflood Implementation
'''
Syn flood program in python using raw sockets (Linux)
Silver Moon ([email protected])
'''
# some imports
import socket, sys
from struct import *