This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| <head> | |
| </head> | |
| <body> | |
| </body> |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| """Count ways to make change for cent amounts using sets of coins.""" | |
| def memoize(f): | |
| """Memoize a function of positional arguments.""" | |
| cache = {} | |
| def helper(*args): | |
| if tuple(args) not in cache: | |
| cache[tuple(args)] = f(*args) | |
| return cache[tuple(args)] | |
| return helper |
| (require 'mmm-mode) | |
| (mmm-add-classes | |
| '((jsx | |
| :submode web-mode | |
| :front "\\((\\)[[:space:]\n]*<" | |
| :front-match 1 | |
| :back ">[[:space:]\n]*\\()\\)" | |
| :back-match 1))) |
| #!/usr/bin/env python | |
| import argparse | |
| from pymatgen.core.structure import IStructure | |
| from pymatgen.matproj.rest import MPRester | |
| from pymatgen.analysis.structure_matcher import StructureMatcher,\ | |
| ElementComparator | |
| parser = argparse.ArgumentParser( | |
| description="""find_struct_in_mp is a script that reads structures from |
| var TabularData = React.createClass({ | |
| componentDidMount: function () { | |
| $(this.refs.table.getDOMNode()).DataTable(); | |
| }, | |
| componentDidUpdate: this.componentDidMount, | |
| render: function () { | |
| var headers = _.pluck(this.props.table.columns, 'title') | |
| .map(function (title) { | |
| return D.th({key: title}, title); | |
| }); |
| # coding: utf-8 | |
| # | |
| # Electronic structure (es) image builder: | |
| # | |
| # Build static images (*.png) for plots of bandstructure (BS) and | |
| # density-of-states (DOS) data for materials, storing them in a GridFS | |
| # filesystem (e.g. 'es_plot.files' and 'es_plot.chunks' collections) on the | |
| # same db as that of the source 'materials'/'electronic_structure' collections. | |
| from __future__ import division, unicode_literals, print_function |