- View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
- View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
- HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
- String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
| { | |
| "secret-message": "hello" | |
| } |
| $ node app.js | |
| My specific title | |
| green | |
| undefined |
| #!/bin/bash | |
| # store the current dir | |
| CUR_DIR=$(pwd) | |
| # Let the person running the script know what's going on. | |
| echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" | |
| # Find all git repositories and update it to the master latest revision | |
| for i in $(find . -name ".git" | cut -c 3-); do |
| var x = require('casper').selectXPath; | |
| casper.options.viewportSize = {width: 1920, height: 982}; | |
| casper.on('page.error', function(msg, trace) { | |
| this.echo('Error: ' + msg, 'ERROR'); | |
| for(var i=0; i<trace.length; i++) { | |
| var step = trace[i]; | |
| this.echo(' ' + step.file + ' (line ' + step.line + ')', 'ERROR'); | |
| } | |
| }); | |
| casper.test.begin('Resurrectio test', function(test) { |
CrUX is the Chrome UX Report from Google. This crash course will take you through everything you need to get the most out of the data.
https://developers.google.com/web/tools/chrome-user-experience-report/
| # -*- coding: utf-8 -*- | |
| from zope.component.hooks import getSite | |
| import logging | |
| log = logging.getLogger(__name__) | |
| def unregister_broken_persistent_components(context): | |
| portal = getSite() | |
| sm = portal.getSiteManager() |
Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.
The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.
On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:
####### 1. A low-resolution photo of road signs
| from contextlib import contextmanager | |
| import tempfile | |
| from unittest import mock | |
| import factory | |
| import pytest | |
| from betterevidence import models | |
| import logging | |
| import plone.api as api | |
| logger = logging.getLogger(__name__) | |
| def _update_brain(brains, index, column_index, value): | |
| """ Update the brain directly, modifying only the target field | |
| This is much faster than update_metadata=True, as that rebuilds the | |
| entire brain, calling all indexed attributes. |