Wednesday, May 29, 2013

Workflow to send SMS on new emails

Workflow diagram

Workflow components

There are four components:
  1. mailcheck - checks for unread emails
  2. diffcheck - checks for differences between current and previous list
  3. sms - sends sms
  4. sup - configures sms, diffcheck and mailcheck

Workflow flow

The workflow goes like this:
  1. mailcheck goes and checks for unread emails every n seconds, bundles it into a list and sends it to the input stream for diffcheck
  2. diffcheck compares the current list of emails with the previous list of emails, determines which ones are new, bundles it into a list and sends that off to sms
  3. sms looks at the list of incoming data and sends to phone numbers associated with diffcheck
    • but nothing really happens cos we've not associated the name 'diffcheck' with anything
    • and the incoming data is just discarded
  4. sup sends a command to sms, associating the name 'diffcheck' with a phone number
    • now sms is configured to send out messages associated with 'diffcheck'

Status

Have got a very rough working version.

Areas to improve

  1. diffcheck should just pass-thru instead of polling, the name should also just passthru
    • so instead of send_out() we could call something like pass_thru()

A good name and actionable readme on GitHub is important

A comparison of two projects

Compare jsonschema and json-schema-validator on GitHub for do's and don'ts e.g.:

Short, succinct package names

jsonschema is better than json-schema-validator

Well-thought, actionable readmes


json-schema validator readme

jsonschema readme

Tuesday, May 28, 2013

Useful Python Packages for Sym

List of useful Python Packages

  1. Regular Expressions -- re
    • Very powerful but takes a bit getting used to - Perl hackers should have no problems
  2. Parsing HTML -- lxml | lxml+xpath
    • Install from binaries for Windows platform 
    • lxml expects a clean xml, use regular expressions if your input aren't clean
  3. Logging -- logging  
  4. GUI -- Tkinter | WxPython | Other GUI Toolkits 
  5. JSON-driven GUI --  why? | pytkgen 
  6. JSON schema -- why? | jsonschema | examples | other implementations

Exception Handling Workflow

Exception Handling Workflow

The figure below shows my idea of handling exceptions, thanks to ideas by Rebecca J. Wirf-Brock[1].
Pardon the messy lines:


References:

  1. Toward Exception-Handling Best Practices and Patterns

Monday, May 27, 2013

edX courses of interest

An unsorted list of edX courses of interest:
  1. Globalization’s Winners and Losers: Challenges for Developed and Developing Countries
    • Starts 1 Oct 2013; 7 weeks, GeorgetownX
  2. Take Your Medicine - The Impact of Drug Development
    • Starts 16 Sep 2013, 13 weeks, UTAustinX
  3. Solar Energy
    • Starts 16 Sep 2013, 8 weeks, 8 hrs/wk, DelftX
    • Best student will be invited to the Delft University of Technology for a week
  4. Stat2.3x - Introduction to Statistics: Inference
    • Starts 31 May 2013, 4 weeks, UCBerkeleyX, Prereqs: Stat2.1x and Stat2.2x
  5. Stat2.2x -Introduction to Statistics: Probability
    • Starts 12 Apr 2013, 5 weeks, UCBerkeleyX, No Prereqs: Stat2.1x
  6. Stat2.1x - Introduction to Statistics: Descriptive Statistics
    • Starts 20 Feb 2013, 5 weeks, UCBerkeleyX, Prereqs: High School Arithmetic
  7. Shakespeare: On the Page and in Performance
    •  Starts Oct 2014, 4-5 hrs/wk, WellesleyX, No Prereqs
  8. Was Alexander Great?
    • Starts 27 Jan 2014, 4-6 hrs/wk, WellesleyX, No Prereqs
  9. Genomic Medicine Gets Personal
    • Starts 3 Apr 2014, GeorgetownX
  10. The Ancient Greek Hero
    • Starts 13 Mar 2013, 4-6 hours/week, HarvardX, No Prereqs
  11. Health in Numbers: Quantitative Methods in Clinical & Public Health Research
    1. Starts 15 Oct 2012, 13 weeks, 10hrs/week, Prereqs: Algebra
  12. CS169.1x - Software as a Service
    1. Starts 15 Mar 2013, 4 weeks, Prereqs: OO Programming
  13. CS169.2x - Software as a Service
    1.  Starts 15 Feb 2013, 6 weeks, 12hrs/wk, Prereqs: CS169.1x

Sym Overview with Twilio SMS integrated

A short overview of Sym with Twilio sms integrated.

Overview of Sym with Twilio sms Integrated

The moving parts:
  1. sym checks the cmd_queue every 5 seconds for new commands
  2. if an sms command is found, send it to sym_twilio which will then send an sms out
  3. everything that sym does is logged in sym.log
The top right hand corner is an example of what goes into the cmd_queue and how they end up at sym_twilio and sym.log respectively.

On Grok, Jeff Hawkin's machine intelligence


Recent Videos

Building brains to understand the world's data - Published Mar 10, 2013

Implementations

Open source implementation of Grok here*, - Neocortex_1.4.2c.zip last modified on Dec 14, 2008
  • See also the blog by Neocortex creator, zotric.

Books

There's an online version of the book "On Intelligence".



[*] Thanks to a tip by a fellow Courserian.