Skip to content

Instantly share code, notes, and snippets.

Davide Mastromatteo mastro35

Block or report user

Report or block mastro35

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View engine_peter_rel5.py
"""
Engine class of the RPN Calculator
"""
import math
from inspect import signature
class rpn_engine:
def __init__(self):
""" Constructor """
View engine_peter_rel4.py
"""
Engine class of the RPN Calculator
"""
import math
class rpn_engine:
def __init__(self):
""" Constructor """
self.stack = []
View engine_peter_rel3.py
"""
Engine class of the RPN Calculator
"""
import math
class rpn_engine:
def __init__(self):
""" Constructor """
self.stack = []
View engine_peter_rel2.py
"""
Engine class of the RPN Calculator
"""
import math
class rpn_engine:
def __init__(self):
""" Constructor """
self.stack = []
View engine_peter.py
"""
Engine class of the RPN Calculator
"""
import math
class rpn_engine:
def __init__(self):
""" Constructor """
self.stack = []
@mastro35
mastro35 / devaraj.py
Created Nov 22, 2017
example for devaraj
View devaraj.py
import pickle
class A:
def __init__(self):
pass
class C:
def __init__(self):
print("deva")
pass
View dfs.py
#!/usr/bin/env python
import os
import sys
import errno
from fuse import FUSE, FuseOSError, Operations
from Passthrough import Passthrough
class dfs(Passthrough):
View fuse-snippet-30.py
def readdir(self, path, fh):
dirents = ['.', '..']
full_path = self._full_path(path)
# print("listing " + full_path)
if os.path.isdir(full_path):
dirents.extend(os.listdir(full_path))
if self.fallbackPath not in full_path:
full_path = self._full_path(path, useFallBack=True)
# print("listing_ext " + full_path)
if os.path.isdir(full_path):
View fuse-snippet-20.py
def getattr(self, path, fh=None):
full_path = self._full_path(path)
st = os.lstat(full_path)
return dict((key, getattr(st, key)) for key in ('st_atime', 'st_ctime',
'st_gid', 'st_mode', 'st_mtime', 'st_nlink', 'st_size', 'st_uid', 'st_blocks'))
View fuse-snippet-10.py
def _full_path(self, partial, useFallBack=False):
if partial.startswith("/"):
partial = partial[1:]
# Find out the real path. If has been requesetd for a fallback path,
# use it
path = primaryPath = os.path.join(
self.fallbackPath if useFallBack else self.root, partial)
# If the pah does not exists and we haven't been asked for the fallback path
You can’t perform that action at this time.