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
function calculateAllCrossProduct(points) { | |
var lastSign = null; | |
for (var i = 2; i < points.length; i++) { | |
//calculate crossproduct from 3 consecutive points | |
var crossproduct = calculateCrossProduct(points[i - 2], points[i - 1], points[i]); | |
console.log(i + ". crossproduct from ("+ points[i - 2].x +" "+points[i - 1].x +" "+points[i].x +"): " + crossproduct); | |
var currentSign = Math.sign(crossproduct); | |
if (lastSign == null) { | |
//last sign init |
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
#!/usr/bin/env python | |
# vim: set sw=4 sts=4 et foldmethod=indent : | |
"""mbox_to_mysql: Import messages from mbox files to a mysql database """ | |
# Mbox message handing is being done by mailbox module, which is a python core module. | |
# However, mbox FILE handling is done internally in this file, because the | |
# mailbox module does far more than we need, and takes up a lot of time to do it. | |
# | |
# Database handling is done through mysql.connector, which is not a core module; |