Skip to content

Instantly share code, notes, and snippets.

View coder46's full-sized avatar
🚀

Faisal Anees coder46

🚀
View GitHub Profile
@coder46
coder46 / egyptian_fractions.py
Created December 12, 2013 22:28
This is just a draft of sympy/ntheory/egyptian_fractions.py . Please tell me how should I arrange the docstrings.
from __future__ import print_function, division
from sympy import Rational
from fractions import gcd
from random import randint
def egypt(rat,choice):
def egypt_greedy():
"""
@coder46
coder46 / hello.py
Created March 8, 2014 00:07
hello.py
import sys
print "HELLO WORLD !!!"
for line in sys.stdin:
print line
@coder46
coder46 / process.py
Created March 8, 2014 00:07
process.py
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.internet import protocol
from twisted.internet import reactor
import re
class MyPP(protocol.ProcessProtocol):
@coder46
coder46 / process.py
Created March 9, 2014 18:44
process.py
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.internet import protocol
from twisted.internet import reactor
import re
from time import sleep
import sys
print "HELLO WORLD !!!"
for line in sys.stdin:
print line
print "ADD 1 2"
for line in sys.stdin:
print "RESULT IS " + line
@coder46
coder46 / process.py
Created March 19, 2014 04:16
process.py
from twisted.internet import protocol
from twisted.internet import reactor
import re
class MyPP(protocol.ProcessProtocol):
def __init__(self, verses):
self.verses = verses
self.data = ""
def connectionMade(self):
print "connectionMade!"
@coder46
coder46 / processprotocol.py
Last active August 29, 2015 13:57
processprotocol
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.internet import protocol
from twisted.internet import reactor
import re
from time import sleep
import sys
import sys
len1 = sys.stdin.readline()
len1 = len1.split('\n')[0]
len1 = int(len1)
print "Len of first msg is "+ str(len1) + "\n"
msg1 = sys.stdin.read(len1)
print "FROM CLIENT: "+msg1