Skip to content

Instantly share code, notes, and snippets.

View p53ud0k0d3's full-sized avatar

Vishnu Ashok p53ud0k0d3

View GitHub Profile
@p53ud0k0d3
p53ud0k0d3 / caesar_wheel.py
Last active August 29, 2015 14:07
This is a cipher that was used by Julius Caesar two thousand years ago. The good news is that it is simple and easy to learn. The bad news is that because it is so simple, it is also easy for a cryptanalyst to break it. But we can use it just as a simple learning exercise. The Caesar Cipher is also explained on Wikipedia here : http://en.wikiped…
"""Caesar_wheel.py
Author : Vishnu Ashok
Contact : [email protected]
[email protected]
This is a cipher that was used by Julius Caesar two thousand years ago. The good news is that it is simple and easy to learn. The bad news is that because it is so simple, it is also easy for a cryptanalyst to break it. But we can use it just as a simple learning exercise. The Caesar Cipher is also explained on Wikipedia here :
http://en.wikipedia.org/wiki/Caesar_cipher
"""
@p53ud0k0d3
p53ud0k0d3 / python-mailer.py
Last active August 24, 2023 01:58
Simple python program for sending emails from Gmail and Hotmail.
"""python-mailer.py
Author : Vishnu Ashok
Contact : [email protected]
[email protected]
GitHub : http://github.com/p53ud0k0d3
This is a simple email client program, which can be used to send emails from Gmail and Hotmail.
You must enable "Allow less secure apps" in Gmail settings.
"""
#Python 2
python -m SimpleHTTPServer 8080
#Python 3
python3 -m http.server 8113
from google.appengine.api import urlfetch
result = urlfetch.fetch("http://software.sopili.net/")
result.content
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@p53ud0k0d3
p53ud0k0d3 / Hackerrank-Minimum-draws.py
Created March 18, 2015 18:05
HackerRank Minimum Draws
pairs = []
for _ in xrange(int(raw_input())):
pairs.append(int(raw_input()))
for item in pairs:
print item+1
@p53ud0k0d3
p53ud0k0d3 / Hackerrank-Handshake.py
Created March 18, 2015 18:12
HackerRank Handshake
people = []
for _ in range(int(raw_input())):
people.append(int(raw_input()))
for n in people:
print ((n*(n-1))/2)
@p53ud0k0d3
p53ud0k0d3 / the-love-letter-mystery.py
Created March 19, 2015 11:46
HackerRank The Love-Letter Mystery
words = []
def evenPal(word):
steps = 0
l = len(word)
w1 = word[:l/2]
w2 = word[l/2:]
w2 = w2[::-1]
for i in xrange(0, len(w1)):
steps += abs(ord(w1[i]) - ord(w2[i]))
@p53ud0k0d3
p53ud0k0d3 / more-on-conditionals.sh
Created March 19, 2015 12:31
HackerRank More On Conditionals
read x
read y
read z
if [ $x -eq $y -a $x -eq $z ]
then
echo "EQUILATERAL"
elif [ $x -ne $y -a $x -ne $z -a $y -ne $z ]
then
echo "SCALENE"
else
@p53ud0k0d3
p53ud0k0d3 / arithmetic-operations.sh
Created March 19, 2015 12:47
HackerRank Arithmetic Operations
read input
printf "%.3f\n" `echo "$input" | bc -l`