This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ChristinGorman gave this talk at JavaZone: https://vimeo.com/49484333 It's quite good, short, energetic, enthusiastic, | |
intelligent, and completely misses the point. | |
While it's true that the code she produces is much better than the original, and is quite easy to understand; it fails one | |
critical test. It's not polite. | |
Polite code is like a well written newspaper article. It allows you to bail out early. A well written article has a | |
headline, a synopsis, and a set of paragraphs that begin with the high level concepts and get more and more detailed as you | |
read through the article. At any point you can decide: "I get it! I don't need to read further." Indeed, this is how most | |
people read newspapers or magazines. The articles are polite, because they allow you to get out quickly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
So, you have some structure from wild. Say this will be some JSON over API. | |
But you cant change this JSON structure. | |
""" | |
sample_data = { | |
'userNameFirst': 'Adam', | |
'userNameSecond': 'Smith', | |
'userPassword': 'supersecretpassword', | |
'userEmail': '[email protected]', | |
'userRoles': 'teacher, worker, admin', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/rgbcolor.js"></script> | |
<script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/canvg.js"></script> | |
<script> | |
function getImgData(chartContainer) { | |
var chartArea = chartContainer.getElementsByTagName('iframe')[0]. | |
contentDocument.getElementById('chartArea'); | |
var svg = chartArea.innerHTML; | |
var doc = chartContainer.ownerDocument; |