This file contains 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
/* | |
Vincent Picavet <[email protected]> | |
Work distributed under MIT Licence. | |
Automated generation of edges geometries according to topology and nodes geometry | |
A nodes table and a edges table design a network. | |
Edges are straight lines between id_from and id_to nodes |
This file contains 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
import xml.etree.ElementTree as ET | |
def CDATA(text=None): | |
element = ET.Element('![CDATA[') | |
element.text = text | |
return element | |
ET._original_serialize_xml = ET._serialize_xml |
This file contains 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
/* | |
Copyright 2013 Cameron MacFarland | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains 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
importPackage(java.io); | |
(function(args) { | |
var templateFileExtension = 'handlebars', | |
output = ['// This file is auto-generated and should be ignored from version control.\n'], | |
console = { | |
log: print | |
}, | |
showUsage = function() { | |
console.log('Usage: java -jar <rhino.jar> rhino-handlebars-compiler.js --handlebars <handlebars library path> --templates <templates directory> --output <output file>'); |
This file contains 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
from sqlalchemy import exists, text, exc, select, and_, literal, cast | |
from sqlalchemy.ext.compiler import compiles | |
from sqlalchemy.sql.expression import Executable, ClauseElement | |
class InsertFromSelect(Executable, ClauseElement): | |
""" Insert from select""" | |
def __init__(self, table, select, *fields, **kw): | |
self.table = table | |
self.select = select |
This file contains 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
importPackage(java.io); | |
(function(args) { | |
var templateFileExtension = 'handlebars', | |
output = ['// This file is auto-generated and should be ignored from version control.\n'], | |
console = { | |
log: print | |
}, | |
showUsage = function() { | |
console.log('Usage: java -jar <rhino.jar> rhino-handlebars-compiler.js --handlebars <handlebars library path> --templates <templates directory> --output <output file>'); |
This file contains 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
"""Utilities for managing database sessions.""" | |
from __future__ import with_statement | |
import contextlib | |
import functools | |
@contextlib.contextmanager | |
def temp_session(session_cls, **kwargs): | |
"""Quick and dirty context manager that provides a temporary Session object | |
to the nested block. The session is always closed at the end of the block. |
NewerOlder