Convert quads from a skolemized form to an external form
@param svc the resource service
@param baseUrl the base URL
@return a mapping function
760372
public static Function<Quad, Quad> unskolemizeQuads(final ResourceService svc, final String baseUrl) {
        return quad -> rdf.createQuad(quad.getGraphName().orElse(PreferUserManaged),
                    (BlankNodeOrIRI) svc.toExternal(svc.unskolemize(quad.getSubject()), baseUrl),
                    quad.getPredicate(), svc.toExternal(svc.unskolemize(quad.getObject()), baseUrl));
    }
910658
public static OGCGeometry createFromEsriCursor(GeometryCursor gc,
			SpatialReference sr) {
		return createFromEsriCursor(gc, sr, false);
	}
775557
protected final StringBuilder getBaseUrl(final HttpServletRequest httpServletRequest) {
        StringBuilder baseURL = new StringBuilder();
        if (httpServletRequest.getContextPath() != null && !httpServletRequest.getContextPath().isEmpty()) {
            baseURL.append(httpServletRequest.getContextPath());
        }
        if (httpServletRequest.getServletPath() != null && !httpServletRequest.getServletPath().isEmpty()) {
            baseURL.append(httpServletRequest.getServletPath());
        }
        return baseURL;
    }
858797
def export_service(self, svc_ref, export_props):
        # type: (ServiceReference, Dict[str, Any]) -> EndpointDescription
        
        ed = EndpointDescription.fromprops(export_props)
        self._export_service(
            self._get_bundle_context().get_service(svc_ref), ed
        )
        return ed
60521
private MapController createVertexController(GeometryEditService editService, GeometryIndex index) {
		CompositeGeometryIndexController controller = new CompositeGeometryIndexController(editService, index,
				editService.getEditingState() == GeometryEditState.DRAGGING);
		for (VertexMapHandlerFactory factory : vertexFactories) {
			controller.addMapHandler(factory.create());
		}
		return controller;
	}
956473
public BeadledomWebTarget buildTarget(String baseUrl) {
    BeadledomClient beadledomClient = build();
    return beadledomClient.target(baseUrl);
  }
574893
public Response.ResponseBuilder getTimeMapBuilder(final LdpRequest req,
            final IOService serializer, final String baseUrl) {

        final List<MediaType> acceptableTypes = req.getHeaders().getAcceptableMediaTypes();
        final String identifier = getBaseUrl(baseUrl, req) + req.getPartition() + req.getPath();
        final List<Link> links = getMementoLinks(identifier, resource.getMementos()).collect(toList());

        final Response.ResponseBuilder builder = Response.ok().link(identifier, ORIGINAL + " " + TIMEGATE);
        builder.links(links.toArray(new Link[0])).link(Resource.getIRIString(), "type")
            .link(RDFSource.getIRIString(), "type").header(ALLOW, join(",", GET, HEAD, OPTIONS));

        final RDFSyntax syntax = getSyntax(acceptableTypes, of(APPLICATION_LINK_FORMAT)).orElse(null);
        if (nonNull(syntax)) {
            final IRI profile = ofNullable(getProfile(acceptableTypes, syntax)).orElse(expanded);

            final List<Triple> extraData = getExtraTriples(identifier);
            for (final Link l : links) {
                if (l.getRels().contains(MEMENTO)) {
                    extraData.add(rdf.createTriple(rdf.createIRI(identifier), Memento.memento,
                                    rdf.createIRI(l.getUri().toString())));
                }
            }

            final StreamingOutput stream = new StreamingOutput() {
                @Override
                public void write(final OutputStream out) throws IOException {
                    serializer.write(concat(links.stream().flatMap(linkToTriples), extraData.stream()), out, syntax,
                            profile);
                }
            };

            return builder.type(syntax.mediaType).entity(stream);
        }

        return builder.type(APPLICATION_LINK_FORMAT)
            .entity(links.stream().map(Link::toString).collect(joining(",\n")) + "\n");
    }
1031705
@Override
   public BaseField create() throws VectorPrintException {
      switch (getFieldtype()) {
         case TEXT:
         case COMBO:
         case LIST:
            return new TextField(getWriter(), null, getName());
         case BUTTON:
            return new PushbuttonField(getWriter(), null, getName());
         case CHECKBOX:
         case RADIO:
            return new RadioCheckField(getWriter(), null, getName(), "Yes");
      }
      throw new VectorPrintException("unable to create BaseField for " + getFieldtype());
   }
294431
private void init(String svcUrl) {
		try {
			serviceUrl = new URL(svcUrl);
		} catch (MalformedURLException e) {
			throw new RuntimeException("It looks like the URL for remote NCBI BLAST service ("
									   + svcUrl + ") is wrong. Cause: " + e.getMessage(), e);
		}
	}
1255960
public static Url getBaseUrl(final Class<? extends Page> pageClass,
		final PageParameters parameters)
	{
		return RequestCycle.get().mapUrlFor(pageClass, parameters);
	}
1026043
public Vector4f transform(Vector4fc vec, Vector4f dest) {
        return transform(vec.x(), vec.y(), vec.z(), dest);
    }
605561
@Override
    public void setBaseUrl(String baseUrl){
        this.endpointUrl = Utils.trimEnd(baseUrl, '/');
        super.setBaseUrl(baseUrl);
    }
1094104
public Vector3d transform(Vector3d vec){
        return transform(vec.x, vec.y, vec.z, vec);
    }
766817
@SuppressWarnings("unused") // called through reflection by RequestServer
  public FramesV3 columnDomain(int version, FramesV3 s) {
    Frame frame = getFromDKV("key", s.frame_id.key());
    Vec vec = frame.vec(s.column);
    if (vec == null)
      throw new H2OColumnNotFoundArgumentException("column", s.frame_id.toString(), s.column);
    s.domain = new String[1][];
    s.domain[0] = vec.domain();
    return s;
  }
1199670
public static URL toAbsolute(URL baseURL, String relative) {
        try {
            return new URL(baseURL, relative);
        } 
        catch (MalformedURLException ex) {
            throw new RuntimeException(ex);
        }
    }
687867
private static URI createSvg(
            final Dimension targetSize,
            final RasterReference rasterReference, final Double rotation,
            final Color backgroundColor, final File workingDir)
            throws IOException {
        // load SVG graphic
        final SVGElement svgRoot = parseSvg(rasterReference.inputStream);

        // create a new SVG graphic in which the existing graphic is embedded (scaled and rotated)
        DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
        Document newDocument = impl.createDocument(SVG_NS, "svg", null);
        SVGElement newSvgRoot = (SVGElement) newDocument.getDocumentElement();
        newSvgRoot.setAttributeNS(null, "width", Integer.toString(targetSize.width));
        newSvgRoot.setAttributeNS(null, "height", Integer.toString(targetSize.height));

        setSvgBackground(backgroundColor, targetSize, newDocument, newSvgRoot);
        embedSvgGraphic(svgRoot, newSvgRoot, newDocument, targetSize, rotation);
        File path = writeSvgToFile(newDocument, workingDir);

        return path.toURI();
    }
1259528
function(relative) {
    var base = this;           // The base url we're resolving against
    var r = new URL(relative); // The relative reference url to resolve
    var t = new URL();         // The absolute target url we will return

    if (r.scheme !== undefined) {
      t.scheme = r.scheme;
      t.username = r.username;
      t.password = r.password;
      t.host = r.host;
      t.port = r.port;
      t.path = remove_dot_segments(r.path);
      t.query = r.query;
    }
    else {
      t.scheme = base.scheme;
      if (r.host !== undefined) {
        t.username = r.username;
        t.password = r.password;
        t.host = r.host;
        t.port = r.port;
        t.path = remove_dot_segments(r.path);
        t.query = r.query;
      }
      else {
        t.username = base.username;
        t.password = base.password;
        t.host = base.host;
        t.port = base.port;
        if (!r.path) { // undefined or empty
          t.path = base.path;
          if (r.query !== undefined)
            t.query = r.query;
          else
            t.query = base.query;
        }
        else {
          if (r.path.charAt(0) === "/") {
            t.path = remove_dot_segments(r.path);
          }
          else {
            t.path = merge(base.path, r.path);
            t.path = remove_dot_segments(t.path);
          }
          t.query = r.query;
        }
      }
    }
    t.fragment = r.fragment;

    return t.toString();


    function merge(basepath, refpath) {
      if (base.host !== undefined && !base.path)
        return "/" + refpath;

      var lastslash = basepath.lastIndexOf("/");
      if (lastslash === -1)
        return refpath;
      else
        return basepath.substring(0, lastslash+1) + refpath;
    }

    function remove_dot_segments(path) {
      if (!path) return path; // For "" or undefined

      var output = "";
      while(path.length > 0) {
        if (path === "." || path === "..") {
          path = "";
          break;
        }

        var twochars = path.substring(0,2);
        var threechars = path.substring(0,3);
        var fourchars = path.substring(0,4);
        if (threechars === "../") {
          path = path.substring(3);
        }
        else if (twochars === "./") {
          path = path.substring(2);
        }
        else if (threechars === "/./") {
          path = "/" + path.substring(3);
        }
        else if (twochars === "/." && path.length === 2) {
          path = "/";
        }
        else if (fourchars === "/../" ||
             (threechars === "/.." && path.length === 3)) {
          path = "/" + path.substring(4);

          output = output.replace(/\/?[^\/]*$/, "");
        }
        else {
          var segment = path.match(/(\/?([^\/]*))/)[0];
          output += segment;
          path = path.substring(segment.length);
        }
      }

      return output;
    }
  }