Coder Social home page Coder Social logo

pack-density's People

Contributors

dastone16 avatar

Watchers

 avatar

pack-density's Issues

E-mail Processing

Code to automatically run in VM when e-mail is received:

From StackOverflow, https://stackoverflow.com/a/41977960

`import imapclient, pyzmail, html2text

def latestMail():
imapObj = imapclient.IMAPClient('imap.yourServer.com', ssl=False)
imapObj.login('imapUser', 'imapPass')
imapObj.select_folder('Inbox', readonly=False)
UIDs = imapObj.search(criteria='ALL', charset=None)
rawMessages = imapObj.fetch(UIDs[0], ['BODY[]', 'FLAGS'])
message = pyzmail.PyzMessage.factory(rawMessages[UIDs[0]]['BODY[]'])
return message

def parser(message):
if message.text_part is not None and message.html_part is not None:
multipart = True
else:
multipart = False

if message.text_part is not None:
    try:
        body = message.text_part.get_payload().decode(message.text_part.charset)
    except TypeError:
        body = message.text_part.get_payload()

if message.html_part is not None and multipart is False:
    try:
        body = html2text.html2text(message.html_part.get_payload().decode(message.html_part.charset))
    except Exception:
        raise Systemexit
return body

try:
message = latestMail()
clean = parser(message)
print clean
except IndexError:
print "No messages left"
raise os._exit(0)
except Exception as e:
print e`

Angled Picture

Test if angled picture will still calculate correct pack density.

Possible solution if not:

  • Calculate angle of picture and compensate by treating circles as elipses.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.