JPG:
$ brew install jpegoptim
$ mkdir lowRes
$ sips -Z 1024 *.jpg --out lowRes
$ cd lowRes
$ find . -name "*.jpg" -exec jpegoptim -m80 -o -p --strip-all {} \;
- PNG:
$ brew install optipng
$ mkdir lowRes
// Current implementation: | |
// The variable bestPossibleEval will be equal to the evaluation of the first simplex iteration | |
// displaying the best possible solution to the problem. | |
// The while loop will now be terminated if the current bestEvaluation is smaller (due to negtaive sign) | |
// than the acceptableThreshold -> supposed to be the way its done in GAMS | |
while (branches.length > 0 && toleranceFlag === true) { | |
var acceptableThreshold = this.bestPossibleEval * (1 - (tolerance/100)); | |
// Abort while loop if termination tolerance is both specified and condition is met | |
if (tolerance > 0) { |
/* | |
Vorgewende | |
API Methods | |
lineString (poly, (angle), (distance)) - Returns array consisting of a GeoJSON lineString for each headland for the given field | |
Polygon (poly, workingWidth, (angle), (distance))- Returns an array consisting of a GeoJSON Polygon for each headland using the working width as its width for the given field | |
*/ | |
const GJV = require("geojson-validation") | |
const turf = require('@turf/turf') | |
module.exports = { |
/* | |
Vorgewende | |
API Methods | |
lineString (poly, (angle), (distance)) - Returns array consisting of a GeoJSON lineString for each headland for the given field | |
Polygon (poly, workingWidth, (angle), (distance))- Returns an array consisting of a GeoJSON Polygon for each headland using the working width as its width for the given field | |
*/ | |
const GJV = require("geojson-validation") | |
const turf = require('@turf/turf') | |
module.exports = { |
var resizedPoly = turf.transformScale(polygon, 1000) | |
Draw.add(resizedPoly) | |
Draw.add(turf.simplify(resizedPoly, {tolerance: 0.05, highQuality: true})) | |
Draw.add(turf.simplify(resizedPoly, {tolerance: 0.4, highQuality: true})) | |
vorgewende.lineString(turf.simplify(resizedPoly, {tolerance: 0.05, highQuality: true}),38) | |
map.fitBounds(turf.bbox(resizedPoly)) |
# GAMS run init script | |
# | |
# This atom init script will execute the current GAMS file | |
# and subsequently open the according listing (.lst) file | |
# An example hack to log to the console when each text editor is saved. | |
# You would need to have linter-gams installed and adjust the below filepaths | |
# to your needs | |
atom.commands.add 'atom-text-editor', 'gams:run', => | |
return unless editor = atom.workspace.getActiveTextEditor() |
/************************************************************* | |
* Method: reformatGAMS | |
* Scope: Public: | |
* Agruments: model: The model we want solver to operate on | |
optcr: Termination tolerance | |
* Purpose: Convert a friendly JSON model into a model for a | |
* real solving library...in this case | |
* GAMS | |
**************************************************************/ | |
// this.reformatGAMS = function (model, optcr) { |
/************************************************************* | |
* Method: lstParse | |
* Scope: Public: | |
* Agruments: listingFile: The GAMS listingFile file to interpreted | |
model: The model we want solver to operate on | |
* Purpose: Convert the results of a GAMS CPLEX solve to a | |
* friendly JSON similar to the one generated by | |
* the jsLPsolver | |
**************************************************************/ | |
// Check model status, and only proceed if status code is in modelStatus-Array |
// open the developer console in Atom (ctrl-shift-i on Windows) | |
// and paste the following code in order to get a list of all | |
// active parameters currently used in the GAMS model | |
global.gamsView.filter(elem => { | |
function checkRef(ref) { | |
let flag = false | |
ref.forEach(ref => { | |
if (ref.file.includes('templ.gms') || ref.file.includes('model')) flag = true | |
}) | |
return flag |
JPG:
$ brew install jpegoptim
$ mkdir lowRes
$ sips -Z 1024 *.jpg --out lowRes
$ cd lowRes
$ find . -name "*.jpg" -exec jpegoptim -m80 -o -p --strip-all {} \;
- PNG:
$ brew install optipng
$ mkdir lowRes
var coeff = [ | |
[1,0], | |
[2,0], | |
[3,0], | |
[4,0], | |
[0,1], | |
[1,1], | |
[2,1], | |
[3,1], | |
[0,2], |