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
/** Represents a value of one of two possible types (a disjoint union.) | |
* Instances of Either are either an instance of [[scala.Left]] or [[scala.Right]]. | |
* | |
* A common use of Either is as an alternative to [[scala.Option]] for dealing | |
* with possible missing values. In this usage, [[scala.None]] is replaced | |
* with a [[scala.Left]] which can contain useful information. | |
* [[scala.Right]] takes the place of [[scala.Some]]. Convention dictates | |
* that Left is used for failure and Right is used for success. | |
* | |
* For example, you could use ``Either[Exception, Int]`` to safely parse a String: |
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
// Run with 'jrunscript fonts.js' or just copy/paste in the jrunscript interactive interpreter | |
var GraphicsEnvironment = Packages.java.awt.GraphicsEnvironment; | |
var fonts = | |
GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); | |
var test = "\u4e00"; // a String, you can replace it with your own test text if you care about a different language. | |
// this value came from http://www.chinesecomputing.com/programming/java.html regarding Chinese text handling in Java | |
for (var i = 0; i < fonts.length; i++) |
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
import org.geoscript._ | |
import layer.Shapefile, support.math.Interpolation, style.combinators._, | |
style.io.SLD, io.Sink | |
import org.geotools.filter.text.ecql.ECQL.{ toFilter => cql } | |
import java.awt.Color | |
val states = Shapefile("geoscript/src/test/resources/data/states.shp") | |
val buckets = | |
(states.features.map(_.get[Double]("PERSONS")).toSeq |
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
wget \ | |
http://developer.mapquest.com/content/static/geotiffs/mercator_tiffs.tar \ | |
http://tile.openstreetmap.org/world_boundaries-spherical.tgz \ | |
http://tile.openstreetmap.org/processed_p.tar.bz2 \ | |
http://tile.openstreetmap.org/shoreline_300.tar.bz2 |
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
#!/usr/bin/env python | |
from geoserver.catalog import Catalog | |
cat = Catalog("http://localhost:8080/geoserver/rest/") | |
for r in cat.get_resources(): | |
print "Resource %s %s %s" % (r.workspace, r.store, r.name) | |
for name in dir(r): | |
print "\t", name + ":", getattr(r, name) |
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
from django.core.management.base import BaseCommand | |
from django.db import transaction | |
from geonode.maps.models import MapLayer | |
import json | |
class Command(BaseCommand): | |
help = """ | |
Changes the OWS url for all layers in geonode maps, useful for when a map | |
server changes. If you use an absolute URL for the GEOSERVER_URL setting | |
this simplifies the process of changing the hostname for your GeoNode site. |
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
sealed trait Breakfast { | |
def beverage: String | |
def dish: String | |
} | |
object LumberJack extends Breakfast { | |
val beverage = "black coffee" | |
val dish = "ham and eggs | |
} |
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
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/POI.svg | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/cul_de_sac.15.png | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/cul_de_sac.16.png | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/cul_de_sac.17.png | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/cul_de_sac.18.png | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/exit-freeway.svg | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/exit.svg | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/ferry.svg | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/golf.svg | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/golf_small.svg |
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
package dwins.web | |
class Unfiltered extends unfiltered.filter.Planify ({ | |
case GET(Path("/")) => Ok ~> TextContent ~> Text("Hello") | |
}) |
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
import geoserver.catalog | |
import os, os.path | |
cat = geoserver.catalog.Catalog( | |
'http://localhost:8080/geoserver/rest', | |
"admin", "geoserver") | |
style_dir = "/home/dwins/Downloads/graphite/" | |
suffix = 'graphite' | |
extant_styles = set(s.name for s in cat.get_styles()) |