text:
load("test/mjsunit/wasm/wasm-constants.js");
load("test/mjsunit/wasm/wasm-module-builder.js");

var kPageSize = 0x10000;

function genGrowMemoryBuilder() {
  var builder = new WasmModuleBuilder();
  builder.addFunction("grow_memory", kSig_i_i)
      .addBody([kExprGetLocal, 0, kExprGrowMemory])
      .exportFunc();
  builder.addFunction("load", kSig_i_i)
      .addBody([kExprGetLocal, 0, kExprI32LoadMem, 0, 0])
      .exportFunc();
  builder.addFunction("store", kSig_i_ii)
      .addBody([kExprGetLocal, 0, kExprGetLocal, 1, kExprI32StoreMem, 0, 0])
      .exportFunc();
  return builder;
}

function testGrowMemoryReadWrite() {
  var builder = genGrowMemoryBuilder();
  builder.addMemory(1, 1, false);
  var module = builder.instantiate();
  var offset;
  function peek() { return module.exports.load(offset); }
  function poke(value) { return module.exports.store(offset, value); }
  function growMem(pages) { return module.exports.grow_memory(pages); }

  for(offset = 0; offset <= (kPageSize - 4); offset++) {
    poke(20);
    assertEquals(peek(), 20);
  }
  for (offset = kPageSize - 3; offset < kPageSize + 4; offset++) {
    assertTraps(kTrapMemOutOfBounds, poke);
    assertTraps(kTrapMemOutOfBounds, peek);
  }

  try {
    assertEquals(growMem(3), 1);
  } catch (e) {
    assertEquals("object", typeof e);
    assertEquals(e.message, kTrapMsgs[kTrapMemAllocationFail]);
    return;
  }

  for (offset = kPageSize; offset <= 4*kPageSize -4; offset++) {
    poke(20);
    assertEquals(peek(), 20);
  }
  for (offset = 4*kPageSize - 3; offset < 4*kPageSize + 4; offset++) {
    assertTraps(kTrapMemOutOfBounds, poke);
    assertTraps(kTrapMemOutOfBounds, peek);
  }

  try {
    assertEquals(growMem(15), 4);
  } catch (e) {
    assertEquals("object", typeof e);
    assertEquals(e.message, kTrapMsgs[kTrapMemAllocationFail]);
    return;
  }

  for (offset = 4*kPageSize - 3; offset <= 4*kPageSize + 4; offset++) {
    poke(20);
    assertEquals(peek(), 20);
  }
  for (offset = 19*kPageSize - 10; offset <= 19*kPageSize - 4; offset++) {
    poke(20);
    assertEquals(peek(), 20);
  }
  for (offset = 19*kPageSize - 3; offset < 19*kPageSize + 5; offset++) {
    assertTraps(kTrapMemOutOfBounds, poke);
    assertTraps(kTrapMemOutOfBounds, peek);
  }
}

testGrowMemoryReadWrite();

function testGrowMemoryZeroInitialSize() {
  var builder = genGrowMemoryBuilder();
  var module = builder.instantiate();
  var offset;
  function peek() { return module.exports.load(offset); }
  function poke(value) { return module.exports.store(offset, value); }
  function growMem(pages) { return module.exports.grow_memory(pages); }

  assertTraps(kTrapMemOutOfBounds, peek);
  assertTraps(kTrapMemOutOfBounds, poke);

  try {
    assertEquals(growMem(1), 0);
  } catch (e) {
    assertEquals("object", typeof e);
    assertEquals(e.message, kTrapMsgs[kTrapMemAllocationFail]);
    return;
  }

  for(offset = 0; offset <= kPageSize - 4; offset++) {
    poke(20);
    assertEquals(peek(), 20);
  }

  //TODO(gdeepti): Fix tests with correct write boundaries
  //when runtime function is fixed.
  for(offset = kPageSize; offset <= kPageSize + 5; offset++) {
    assertTraps(kTrapMemOutOfBounds, peek);
  }
}

testGrowMemoryZeroInitialSize();

function testGrowMemoryTrapMaxPagesZeroInitialMemory() {
  var builder = genGrowMemoryBuilder();
  var module = builder.instantiate();
  var maxPages = 16385;
  function growMem() { return module.exports.grow_memory(maxPages); }
  assertTraps(kTrapMemOutOfBounds, growMem);
}

testGrowMemoryTrapMaxPagesZeroInitialMemory();

function testGrowMemoryTrapMaxPages() {
  var builder = genGrowMemoryBuilder();
  builder.addMemory(1, 1, false);
  var module = builder.instantiate();
  var maxPages = 16384;
  function growMem() { return module.exports.grow_memory(maxPages); }
  assertTraps(kTrapMemOutOfBounds, growMem);
}

testGrowMemoryTrapMaxPages();


text:
package gov.nih.nci.cabig.ctms.acegi.csm.authorization;

/**
 * @author Joshua Phillips
 *
 */
public interface CSMPrivilegeGenerator {

	/**
	 * Returns a CSM privilege name, given an object.
	 *
	 * @param object from which to determine privilege
	 * @return CSM privilege name
	 */
	String generatePrivilege(Object object);

}

redpajama_set_name: RedPajamaGithub


text:
""" This module serves as a placeholder for the global AppRunner
object, which only exists when we are running a .p3d file via
runp3d.py or via the Panda3D plugin or standalone executable.

This is needed for apps that start themselves by importing
DirectStart; it provides a place for these apps to look for
the AppRunner at startup. """

appRunner = None


text:
package org.apache.felix.bundlerepository.impl;

import java.util.Dictionary;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;

import org.apache.felix.bundlerepository.Capability;
import org.apache.felix.bundlerepository.LocalResource;
import org.apache.felix.bundlerepository.Resource;
import org.osgi.framework.Bundle;
import org.osgi.framework.Constants;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.wiring.BundleRevision;

public class LocalResourceImpl extends ResourceImpl implements LocalResource
{
    private Bundle m_bundle = null;

    LocalResourceImpl(Bundle bundle) throws InvalidSyntaxException
    {
        m_bundle = bundle;
        initialize();
    }

    public boolean isLocal()
    {
        return true;
    }

    public Bundle getBundle()
    {
        return m_bundle;
    }

    private void initialize() throws InvalidSyntaxException
    {
        final Dictionary dict = m_bundle.getHeaders();

        DataModelHelperImpl.populate(new DataModelHelperImpl.Headers()
        {
            public String getHeader(String name)
            {
                return (String) dict.get(name);
            }
            public void close() { }
        }, this);

        // Convert export service declarations and services into capabilities.
        convertExportServiceToCapability(dict, m_bundle);

        // For the system bundle, add a special platform capability.
        if (m_bundle.getBundleId() == 0)
        {
            // add the alias bundle symbolic name "system.bundle"
            CapabilityImpl sysBundleCap = new CapabilityImpl(Capability.BUNDLE);
            sysBundleCap.addProperty(Resource.SYMBOLIC_NAME, Constants.SYSTEM_BUNDLE_SYMBOLICNAME);
            addCapability(sysBundleCap);

            // set the execution environment(s) as Capability ee of the
            // system bundle to resolve bundles with specific requirements
            String ee = m_bundle.getBundleContext().getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT);
            if (ee != null)
            {
                StringTokenizer tokens = new StringTokenizer(ee, ",");
                while (tokens.hasMoreTokens()) {
                    CapabilityImpl cap = new CapabilityImpl(Capability.EXECUTIONENVIRONMENT);
                    cap.addProperty(Capability.EXECUTIONENVIRONMENT, tokens.nextToken().trim());
                    addCapability(cap);
                }
            }

            // Add all the OSGi capabilities from the system bundle as repo capabilities
            BundleRevision br = m_bundle.adapt(BundleRevision.class);
            for (org.osgi.resource.Capability cap : br.getCapabilities(null))
            {
                CapabilityImpl bcap = new CapabilityImpl(cap.getNamespace());
                for (Map.Entry<String, Object> entry : cap.getAttributes().entrySet())
                {
                    bcap.addProperty(new FelixPropertyAdapter(entry));
                }
                for (Map.Entry<String, String> entry : cap.getDirectives().entrySet())
                {
                    bcap.addDirective(entry.getKey(), entry.getValue());
                }
                addCapability(bcap);
            }
        }
    }

    private void convertExportServiceToCapability(Dictionary dict, Bundle bundle)
    {
        Set services = new HashSet();

        // add actual registered services
        ServiceReference[] refs = bundle.getRegisteredServices();
        for (int i = 0; refs != null && i < refs.length; i++)
        {
            String[] cls = (String[]) refs[i].getProperty(Constants.OBJECTCLASS);
            for (int j = 0; cls != null && j < cls.length; j++)
            {
                CapabilityImpl cap = new CapabilityImpl();
                cap.setName(Capability.SERVICE);
                cap.addProperty(new PropertyImpl(Capability.SERVICE, null, cls[j]));
                // TODO: add service properties
                addCapability(cap);
            }
        }
        // TODO: check duplicates with service-export properties
    }

    public String toString()
    {
        return m_bundle.toString();
    }
}


text:
<?php

return [
    /*
    |--------------------------------------------------------------------------
    | Validation Language Lines
    |--------------------------------------------------------------------------
    |
    | The following language lines contain the default error messages used by
    | the validator class. Some of these rules have multiple versions such
    | as the size rules. Feel free to tweak each of these messages here.
    |
    */
    "accepted" => ":attribute qəbul edilməlidir.",
    "active_url" => ":attribute etibarlı URL deyil.",
    "after" => ":attribute :date tarixindən sonra bir tarix olmalıdır.",
    "alpha" => ":attribute sadəcə hərflərdən ibarət ola bilər.",
    "alpha_dash" => ":attribute sadəcə hərf, rəqəm və tiredən ibarət ola bilər.",
    "alpha_num" => ":attribute sadəcə hərf və rəqəmlərdən ibarət ola bilər.",
    "array" => ":attribute ardıcıllıq olmalıdır.",
    "before" => ":attribute :date tarixindən əvvəl bir tarix olmalıdır.",
    "between" => [
        "numeric" => ":attribute :min və :max arasında bir dəyər olmalıdır.",
        "file" => ":attribute :min və :max kilobayt arasında olmalıdır.",
        "string" => ":attribute :min və :max arasında xanadan ibarət olmalıdır.",
        "array" => ":attribute :min və :max arasında elementə sahib ola bilər.",
    ],
    "boolean" => ":attribute sahəsi ya doğru, ya da səhv dəyərə sahib olmalıdır.",
    "confirmed" => ":attribute təsdiqi ilə uyğun gəlmir.",
    "date" => ":attribute etibarlı tarix deyil.",
    "date_format" => ":attribute :format formatına uyğun gəlmir.",
    "different" => ":attribute və :other fərqli olmalıdır.",
    "digits" => ":attribute :digits rəqəmli olmalıdır.",
    "digits_between" => ":attribute ən az :min və ən çox :max rəqəmli olmalıdır.",
    "email" => ":attribute etibarlı e-poçt adresi olmalıdır.",
    "filled" => ":attribute sahəsi məcburidir.",
    "exists" => "Seçilmiş :attribute etibarli deyil.",
    "image" => ":attribute şəkil olmalıdır.",
    "in" => "Seçilmiş :attribute etibarli deyil.",
    "integer" => ":attribute tam ədəd olmalıdır.",
    "ip" => ":attribute etibarlı IP (İnternet Protokol) adresi olmalıdır.",
    "max" => [
        "numeric" => ":attribute ən çox :max ola bilər.",
        "file" => ":attribute :max kilobaytdan çox olmamalıdır.",
        "string" => ":attribute ən çox :max xanalı ola bilər.",
        "array" => ":attribute ən çox :max elementə sahib ola bilər.",
    ],
    "mimes" => ":attribute :values tiplərindən birində fayl olmalıdır.",
    "min" => [
        "numeric" => ":attribute ən az :min ola bilər.",
        "file" => ":attribute :min kilobaytdan az olmamalıdır.",
        "string" => ":attribute ən az :min xanalı ola bilər.",
        "array" => ":attribute ən az :min elementə sahib ola bilər.",
    ],
    "not_in" => "Seçilmiş :attribute etibarli deyil.",
    "numeric" => ":attribute rəqəmlərdən ibarət olmalıdır.",
    "regex" => ":attribute formatı düzgün deyil.",
    "required" => ":attribute sahəsi məcburidir.",
    "required_if" => ":attribute sahəsi, :other :value dəyəri aldığında məcburidir.",
    "required_with" => ":attribute sahəsi :values dəyəri mövcud olduğunda məcburidir.",
    "required_with_all" => ":attribute sahəsi :values dəyərləri mövcud olduğunda məcburidir.",
    "required_without" => ":attribute sahəsi :values dəyəri mövcud olmadığında məcburidir.",
    "required_without_all" => ":attribute sahəsi :values dəyərlərinin heç biri mövcud olmadığında məcburidir.",
    "same" => ":attribute və :other eyni olmalıdır.",
    "size" => [
        "numeric" => ":attribute :size rəqəmli olmalıdır.",
        "file" => ":attribute :size kilobayt olmalıdır.",
        "string" => ":attribute :size xanalı olmalıdır.",
        "array" => ":attribute :size elementə sahib olmalıdır.",
    ],
    "unique" => ":attribute artıq istifadə olunmaqdadır.",
    "url" => ":attribute formatı səhvdir.",
    "timezone" => ":attribute etibarlı saat qurşağı deyil.",

    /*
    |--------------------------------------------------------------------------
    | Custom Validation Language Lines
    |--------------------------------------------------------------------------
    |
    | Here you may specify custom validation messages for attributes using the
    | convention "attribute.rule" to name the lines. This makes it quick to
    | specify a specific custom language line for a given attribute rule.
    |
    */
    'custom' => [
        'attribute-name' => [
            'rule-name' => 'custom-message',
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Custom Validation Attributes
    |--------------------------------------------------------------------------
    |
    | The following language lines are used to swap attribute place-holders
    | with something more reader friendly such as E-Mail Address instead
    | of "email". This simply helps us make messages a little cleaner.
    |
    */
    'attributes' => [],
];


text:
def someFunction(user, password="Admin"):
    print("Hi " + user)

def someFunction2(password):
    if password == "root":
        print("OK, logged in")

def noMatch(password):
    if password == '':
        print("No password!")

def NoMatch2(password):
    if password == "ajklawejrkl42348swfgkg":
        print("Nice password!")

def doLogin(password="blerg"):
    pass

def NoMatch3(a, b):
    pass

doLogin(password="blerg")
password = "blerg"
d["password"] = "blerg"


text:
require([
	'underscore',
	'handlebars',
	'moment'
], function (_, Handlebars, moment) {
	Handlebars.registerHelper('groupByDate', function (items, options) {

		// First, group intervals by date
		var grouped = {};
		for (var i = 0; i < items.length; i++) {
			var date = moment(items[i].from).format('YYYY.MM.DD');

			if (!(date in grouped)) {
				grouped[date] = [];
			}

			grouped[date].push(items[i]);
		}

		// Then sort them
		var sorted = [];
		for (var date in grouped) {
			sorted.push({
				date: date,
				times: _(grouped[date]).sortBy(function (interval) {
					return interval.from;
				}).reverse()
			});
		}

		sorted = _(sorted).sortBy(function (date) {
			return date;
		});

		var output = "";
		// Pass object to function
		for (var i = sorted.length - 1; i >= 0; i--) {
			output += options.fn(sorted[i]);
		}

		return output;
	});
});


text:
layout: assets-test-new-async
---


text:
from werkzeug.urls import url_decode
import requests
import foauth.providers

class Pocket(foauth.providers.OAuth2):
    # General info about the provider
    provider_url = 'http://getpocket.com/'
    docs_url = 'http://getpocket.com/developer/docs/overview'
    category = 'News'

    # URLs to interact with the API
    request_token_url = 'https://getpocket.com/v3/oauth/request'
    authorize_url = 'https://getpocket.com/auth/authorize'
    access_token_url = 'https://getpocket.com/v3/oauth/authorize'
    api_domain = 'getpocket.com'

    available_permissions = [
        (None, 'access your saved articles'),
    ]
    supports_state = False

    def get_authorize_params(self, redirect_uri, scopes):
        params = super(Pocket, self).get_authorize_params(redirect_uri, scopes)
        r = requests.post(self.request_token_url, data={
                'consumer_key': params['client_id'],
                'redirect_uri': redirect_uri,
            })
        data = url_decode(r.content)
        redirect_uri = '%s&code=%s' % (params['redirect_uri'], data['code'])
        return {
            'request_token': data['code'],
            'redirect_uri': redirect_uri,
        }

    def get_access_token_response(self, redirect_uri, data):
        return requests.post(self.get_access_token_url(), {
            'consumer_key': self.client_id,
            'code': data['code'],
            'redirect_uri': redirect_uri
        })

    def parse_token(self, content):
        data = url_decode(content)
        data['service_user_id'] = data['username']
        return data

    def bearer_type(self, token, r):
        r.prepare_url(r.url, {'consumer_key': self.client_id, 'access_token': token})
        return r


text:
package es.sandwatch.trim;

import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Contains all the relevant information about an API, namely endpoints and headers.
 *
 * @author Ismael Alonso
 * @version 1.0.0
 */
public class Specification{
    /**
     * The current version of the app
     */
    private int appVersion;

    /**
     * The list of models to be inspected.
     */
    private List<Class<?>> models;

    /**
     * The headers that apply to all endpoints in the API.
     */
    private Map<String, String> headers;

    /**
     * Control flag. Indicates whether the user has run this specification, if so, prevents him from modifying it.
     */
    private boolean locked;

    /**
     * Constructor.
     */
    public Specification(){
        appVersion = -1;
        models = new ArrayList<>();
        headers = new HashMap<>();
        locked = false;
    }

    /**
     * Sets the current application version.
     *
     * @param appVersion the current version of the application.
     */
    public Specification setCurrentApplicationVersion(int appVersion){
        this.appVersion = appVersion;
        return this;
    }

    /**
     * Adds a model to the specification.
     *
     * @param model the model to be added.
     * @return this object.
     */
    public Specification addModel(@NotNull Class<?> model){
        if (!locked){
            models.add(model);
        }
        return this;
    }

    /**
     * Adds a header to this specification.
     *
     * @param header the header to be added.
     * @param value the value of the header to be added.
     * @return this object.
     */
    public Specification addHeader(@NotNull String header, @NotNull String value){
        if (!locked){
            headers.put(header, value);
        }
        return this;
    }

    /**
     * Locks the specification.
     */
    void lock(){
        locked = true;
    }

    /**
     * Application version getter.
     *
     * @return the application version.
     */
    int getAppVersion(){
        return appVersion;
    }

    /**
     * Model list getter.
     *
     * @return the list of models in this specification.
     */
    @NotNull List<Class<?>> getModels(){
        return models;
    }

    /**
     * Header map getter.
     *
     * @return a map containing the headers that apply to all endpoints in this specification.
     */
    @NotNull Map<String, String> getHeaders(){
        return headers;
    }
}


text:
<?php

/**
 *
 * @package    symfony
 * @subpackage plugin
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @version    SVN: $Id: PluginsfGuardGroupPermission.php 9999 2008-06-29 21:24:44Z fabien $
 */
class PluginsfGuardGroupPermission extends BasesfGuardGroupPermission
{
}


text:
import sys
import facenet
import numpy as np

def sample_people(dataset, people_per_batch, images_per_person):
    nrof_images = people_per_batch * images_per_person

    # Sample classes from the dataset
    nrof_classes = len(dataset)
    class_indices = np.arange(nrof_classes)
    np.random.shuffle(class_indices)

    i = 0
    image_paths = []
    num_per_class = []
    sampled_class_indices = []
    # Sample images from these classes until we have enough
    while len(image_paths)<nrof_images:
        print i,nrof_images,len(dataset)
        class_index = class_indices[i]
        nrof_images_in_class = len(dataset[class_index])
        image_indices = np.arange(nrof_images_in_class)
        np.random.shuffle(image_indices)
        nrof_images_from_class = min(nrof_images_in_class, images_per_person, nrof_images-len(image_paths))
        idx = image_indices[0:nrof_images_from_class]
        image_paths_for_class = [dataset[class_index].image_paths[j] for j in idx]
        sampled_class_indices += [class_index]*nrof_images_from_class
        image_paths += image_paths_for_class
        num_per_class.append(nrof_images_from_class)
        i+=1

    return image_paths, num_per_class

train_set = facenet.get_dataset(sys.argv[1])

sample_people(train_set,45,40)


text:
package mezz.jei.api.gui.handlers;

import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.Rect2i;

import mezz.jei.api.registration.IGuiHandlerRegistration;
import mezz.jei.api.registration.IModIngredientRegistration;

/**
 * Allows plugins to change how JEI is displayed next to their mod's guis.
 * Register your implementation with {@link IGuiHandlerRegistration#addGuiContainerHandler(Class, IGuiContainerHandler)}.
 */
public interface IGuiContainerHandler<T extends AbstractContainerScreen<?>> {
	/**
	 * Give JEI information about extra space that the {@link AbstractContainerScreen} takes up.
	 * Used for moving JEI out of the way of extra things like gui tabs.
	 *
	 * @return the space that the gui takes up besides the normal rectangle defined by {@link AbstractContainerScreen}.
	 */
	default List<Rect2i> getGuiExtraAreas(T containerScreen) {
		return Collections.emptyList();
	}

	/**
	 * Return anything under the mouse that JEI could not normally detect, used for JEI recipe lookups.
	 *
	 * This is useful for guis that don't have normal slots (which is how JEI normally detects items under the mouse).
	 *
	 * This can also be used to let JEI look up liquids in tanks directly, by returning a FluidStack.
	 * Works with any ingredient type that has been registered with {@link IModIngredientRegistration}.
	 *
	 * @param mouseX the current X position of the mouse in screen coordinates.
	 * @param mouseY the current Y position of the mouse in screen coordinates.
	 */
	@Nullable
	default Object getIngredientUnderMouse(T containerScreen, double mouseX, double mouseY) {
		return null;
	}

	/**
	 * Return the JEI-controlled clickable areas for this GUI.
	 * This is useful when you want to add a spot on your GUI that opens JEI and shows recipes.
	 *
	 * Optionally, you can restrict what you return here based on the current mouse position.
	 * @param guiMouseX the current X position of the mouse in gui-relative coordinates.
	 * @param guiMouseY the current Y position of the mouse in gui-relative coordinates.
	 * @since 6.0.1
	 */
	default Collection<IGuiClickableArea> getGuiClickableAreas(T containerScreen, double guiMouseX, double guiMouseY) {
		return Collections.emptyList();
	}
}


text:
<?php
include("BDMySQL.class.php");
include("ARUtilizador.class.php");
?>
Logout

A sua sessão foi terminada...

<?php
session_destroy();
?>


text:
require 'active_support/concern'

module UniqueId
  module Base
    extend ActiveSupport::Concern

    def unique_type
      self.class.to_s
    end

    def unique_scope
      if scope = self.class.unique.scope
        @unique_scope ||= case scope
          when Symbol then self.send(scope)
          when Proc   then self.instance_exec(&scope)
          else scope
        end
      end
    end

    def unique_format(value)
      if f = self.class.unique.formatter
        return self.instance_exec(self.unique_scope, value, &f)
      end
      value
    end

    def generate_unique
      value = unique_format(self.class.unique.next(scope:self.unique_scope, type:self.unique_type))
      write_attribute self.class.unique.attribute, value
    end

    module ClassMethods
      attr_accessor :unique

      def has_unique(*args)
        opts = args.extract_options!
        @unique = ::Unique::Generator.new(args.first, opts)

        before_create :generate_unique
      end

    end
  end
end


text:
using EasyPost;

using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace EasyPostTest {

    [TestClass]
    public class CustomsInfoTest {
        [TestInitialize]
        public void Initialize() {
            Client.apiKey = "cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi";
        }

        [TestMethod]
        public void TestCreateAndRetrieve() {
            Dictionary<string, object> item = new Dictionary<string, object>() {
                {"description", "TShirt"}, {"quantity", 1}, {"weight", 8}, {"origin_country", "US"}
            };

            CustomsInfo info = CustomsInfo.Create(new Dictionary<string, object>() {
                {"customs_certify", true}, {"eel_pfc", "NOEEI 30.37(a)"},
                {"customs_items", new List<Dictionary<string, object>>() {item}}
            });

            CustomsInfo retrieved = CustomsInfo.Retrieve(info.id);
            Assert.AreEqual(info.id, retrieved.id);
            Assert.IsNotNull(retrieved.customs_items);
        }

        [TestMethod]
        public void TestCreateWithIResource() {
            CustomsItem item = new CustomsItem() { description = "description" };
            CustomsInfo info = CustomsInfo.Create(
                new Dictionary<string, object>() {
                    {"customs_certify", true},
                    {"eel_pfc", "NOEEI 30.37(a)"},
                    {"customs_items", new List<IResource>() {item}}
                }
            );

            Assert.IsNotNull(info.id);
            Assert.AreEqual(info.customs_items.Count, 1);
            Assert.AreEqual(info.customs_items[0].description, item.description);
        }
    }
}


text:
**[Open online tool](https://googlecloudplatform.github.io/migrate-from-app-engine-to-cloud-run/)**

Helper tool to migrate an App Engine service to a Cloud Run service.

## How to use

### User interface

* Open index.html or [click here](https://googlecloudplatform.github.io/migrate-from-app-engine-to-cloud-run/)
* Copy paste your `app.yaml`
* Enter other information (project ID, region...)
* Get your Cloud Run configuration file and deployment commands.

### Programatically

Load the `app-to-run.js` module in your codebase with:

```
import { appToRun } from './app-to-run.js';
```

Then invoke `appToRun()` with an object containing the App Engine configuration. See [this example](https://github.com/GoogleCloudPlatform/app-engine-cloud-run-converter/blob/master/index.js#L28)

TODO: document the exact API when it is stable.

## Demo

See it in action in this end to end demo on Youtube:

[![App Engine to Cloud Run on Youtube](https://img.youtube.com/vi/XXP6QIS8VME/0.jpg)](https://www.youtube.com/watch?v=XXP6QIS8VME)

This is not an officially supported Google product.


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace CodeTorch.Core
{
    [Serializable]
    public enum WorkflowSelectionMode
    {
        Static,
        DataCommand
    }

    [Serializable]
    public class WorkflowStatusControl: Widget
    {
        bool _ReloadAfterStatusChange = true;
        ScreenInputType _EntityInputType = ScreenInputType.QueryString;

        [TypeConverter("CodeTorch.Core.Design.WorkflowTypeConverter,CodeTorch.Core.Design")]
        public string WorkflowCode { get; set; }

        [TypeConverter("CodeTorch.Core.Design.ScreenDataCommandTypeConverter,CodeTorch.Core.Design")]
        public string WorkflowSelectionCommandName { get; set; }

        [TypeConverter("CodeTorch.Core.Design.DataCommandColumnTypeConverter,CodeTorch.Core.Design")]
        public string WorkflowSelectionFieldName { get; set; }

        public WorkflowSelectionMode WorkflowSelectionMode { get; set; }

        [Category("Entity")]
        public string EntityID { get; set; }

        [Category("Entity")]
        public ScreenInputType EntityInputType
        {
            get { return _EntityInputType; }
            set { _EntityInputType = value; }
        }

        public bool ReloadAfterStatusChange
        {
            get { return _ReloadAfterStatusChange; }
            set { _ReloadAfterStatusChange = value; }
        }

        public override string Type
        {
            get
            {
                return "WorkflowStatus";
            }
            set
            {
                base.Type = value;
            }
        }

        public static IEnumerable<ResourceItem> GetResourceKeys(Screen Screen, WorkflowStatusControl Control, String Prefix)
        {
            List<ResourceItem> retVal = new List<ResourceItem>();

            //add title
            AddResourceKey(retVal, Screen, Control, Prefix, "WorkflowChangeStatusButton.Label", "Change Status");

            return retVal;
        }

    }
}


text:
CC=gcc
CFLAGS= -g -fPIC -lrt -lpthread
PWD=$(shell pwd)

libmrw: clean
	gcc $(CFLAGS) -c -Werror mrwlock.c
	gcc $(CFLAGS) -shared -o libmrw.so mrwlock.o

mrw: clean libmrw thread_test.o
	gcc -L$(PWD) -Wl,-rpath=$(PWD) -o thread_test thread_test.c $(CFLAGS) -lmrw -DMRW

rw: clean thread_test.o
	gcc -o thread_test thread_test.c $(CFLAGS) -DRW

mutex: clean thread_test.o
	gcc -o thread_test thread_test.c $(CFLAGS)

clean:
	rm -rf *.o
	rm -rf *.so
	rm -f thread_test


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">

  <title>Qt 4.3: List of All Members for Q3SqlRecordInfo</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />

  	Home · All Classes · Main Classes · Grouped Classes · Modules · Functions

List of All Members for Q3SqlRecordInfo

This is the complete list of members for Q3SqlRecordInfo, including inherited members.

Q3SqlRecordInfo ()

Q3SqlRecordInfo ( const Q3SqlFieldInfoList & )

Q3SqlRecordInfo ( const QSqlRecord & )

contains ( const QString & ) const : size_type

find ( const QString & ) const : Q3SqlFieldInfo

toRecord () const : QSqlRecord

<address>

Copyright © 2008 Trolltech
Trademarks

Qt 4.3.5

</address>


text:
[![Build Status](https://travis-ci.org/iTimeTraveler/hexo-theme-hipaper.svg?branch=master)](https://travis-ci.org/iTimeTraveler/hexo-theme-hipaper)		[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/iTimeTraveler/hexo-theme-hipaper/blob/master/LICENSE)

**A fashional newspaper, blog theme for Hexo**. [**☞ 点击预览**](https://itimetraveler.github.io/hexo-theme-hipaper/)

![](https://raw.githubusercontent.com/iTimeTraveler/iTimeTraveler.github.io/master/gallery/hipaper-demo-screen.png)

![](https://raw.githubusercontent.com/iTimeTraveler/hexo-theme-hipaper/master/source/preview/mobile-preview.png)

![](https://raw.githubusercontent.com/iTimeTraveler/hexo-theme-hipaper/master/source/preview/hipaper-preview.png)

<!--more-->

## 安装步骤

 1. 从Github上获取源码

 ```shell
 $ git clone https://github.com/iTimeTraveler/hexo-theme-hipaper.git themes/hipaper
 ```
 2. 启用主题

 把Hexo主目录下 `_config.yml` 文件中的`theme`字段改为 `hipaper`,如下:
 ```
 # Extensions
 ## Plugins: http://hexo.io/plugins/
 ## Themes: http://hexo.io/themes/
 theme: hipaper
 ```
 3. 更新到最新

 ```shell
 $ cd themes/hipaper
 $ git pull
 ```

## 特性

### 支持图片Logo

就像下面这样:

![](https://raw.githubusercontent.com/iTimeTraveler/hexo-theme-hipaper/master/source/preview/logo-preview.jpg)

只用在hipaper/_config.yml中设置 `avatar`字段的`eanble`为true,然后设置图片的`url`就好了。

```yml
# Put your avatar.jpg into `hexo-site/themes/hipaper/source/` directory.
# url is target link (E.g. `url: https://hexo.io/logo.svg` or `url: css/images/mylogo.jpg`)
avatar:
  enable: true
  width: 124
  height: 124
  bottom: 10
  url: https://hexo.io/logo.svg
```

### 代码高亮

Hipaper 使用 [Tomorrow Theme](https://github.com/chriskempson/tomorrow-theme) 作为代码主题. 共有以下六种选项: `default`, `normal`, `night`, `night blue`, `night bright`, `night eighties`

![code `default` theme Preview](https://raw.githubusercontent.com/iTimeTraveler/hexo-theme-hipaper/master/source/preview/code-theme-default.png)

默认高亮配色如上图, 另外的五种配色如下.

![code themes](https://raw.githubusercontent.com/iTimeTraveler/hexo-theme-hipaper/master/source/preview/code-theme.jpg?raw=true)

您可以在本主题的 hipaper/_config.yml 文件中更改 `highlight_theme` 字段.

```yml
# Code Highlight theme
# Available value:
#    default | normal | night | night eighties | night blue | night bright
# https://github.com/chriskempson/tomorrow-theme
highlight_theme: default
```

### 侧边栏

主题_config.yml文件中的 `sidebar` 字段可以设置为 `left`或`right`,用来控制侧边栏显示在页面左侧还是右侧。
Hipaper 拥有以下7种侧边栏组件:

- search (搜索框)
- social (社交网站链接)
- recent_posts (最新文章)
- category (分类)
- tag (标签)
- tagcloud (标签云)
- archive (归档栏)

以上组件在主题中均已默认启用.您可以在 `widget` 字段中设置显示哪些以及顺序。

### 站内搜索

Hipaper 使用 `Insight Search` 来帮助大家使用站内搜索.

![](https://raw.githubusercontent.com/iTimeTraveler/hexo-theme-hipaper/master/source/preview/search-preview.png)

```yml
# Search
search:
    insight: true # you need to install `hexo-generator-json-content` before using Insight Search
    swiftype: # enter swiftype install key here
    baidu: false # you need to disable other search engines to use Baidu search, options: true, false
```

> !!注意: 使用搜索工具之前您必须使用 `hexo-generator-json-content` 来安装,在Hexo根目录下执行命令如下:

```bash
$ npm install -S hexo-generator-json-content
```

### Fancybox

Hipaper 使用 [Fancybox] 来提供文章图片预览.

```
![img caption](img url)

{% fancybox img_url [img_thumbnail] [img_caption] %}
```

### 评论功能

Hipaper 已完全支持原生的多说、 Disqus评论功能. 您可以在 `hipaper/_config.yml` 文件中更改以下字段:

```yml
# comment ShortName, you can choose only ONE to display.
duoshuo_shortname: iTimeTraveler
disqus_shortname:
```

## 支持的浏览器

![](https://raw.githubusercontent.com/iTimeTraveler/hexo-theme-hipaper/master/source/preview/browser-support.png?raw=true)

## 贡献

> 本主题源于Wordpress作者 ATHEMES, 原生主题点击查看 [FASHIONISTA for Wordpress](http://athemes.com/theme/fashionista/).

大家有各种问题和改进建议的,直接提issue或者评论,或者pull request都行。我会尽量抽时间和大家交流。刚接触Hexo不久,疏忽不足之处,还望大家海涵!

## License

Hipaper is under the MIT license. See the [LICENSE](https://github.com/iTimeTraveler/hexo-theme-hipaper/blob/master/LICENSE) file for details.

[Hexo]: https://hexo.io/
[Fancybox]: http://fancyapps.com/fancybox/
[Font Awesome]: http://fontawesome.io/


text:
package team2485.comp;

import edu.wpi.first.wpilibj.AnalogChannel;

/**
 * Represents a pressure transducer.
 * @author Marty Kausas
 */
public class PressureTransducer extends AnalogChannel {

    /**
     * Creates a new pressure transducer, with the specified analog channel.
     * @param channel the analog channel
     */
    public PressureTransducer(int channel) {
        super(channel);
    }

    /**
     * Returns the PSI reading, converted from the analog value.
     * @return PSI
     */
    public double getPressure() {
        return (super.getValue() * -2.6243) + 1102.6;
    }
}


text:
#include <cstdlib>
#include "UInt64.h"

namespace CLDEPlus {
    namespace Foundation {
        namespace Data {
            namespace Type {

                UInt64::UInt64(uint64_t value) : _value(value),
                                                 NumericValue(ValueType::UInt64, sizeof(uint64_t)) {
                    //
                }

                void *UInt64::PointerToBuffer() {
                    return &this->_value;
                }

                string UInt64::ToString() const {
                    return std::to_string(_value);
                }

                Value &UInt64::operator+(Value const &rhs) {
                    auto cast = dynamic_cast< UInt64 const &>(rhs);
                    this->_value = this->_value + cast._value;
                    return *this;
                }

                Value &UInt64::operator-(Value const &rhs) {
                    auto cast = dynamic_cast< UInt64 const &>(rhs);
                    this->_value = this->_value - cast._value;
                    return *this;
                }

                Value &UInt64::operator*(Value const &rhs) {
                    auto cast = dynamic_cast< UInt64 const &>(rhs);
                    this->_value = this->_value * cast._value;
                    return *this;
                }

                Value &UInt64::operator/(Value const &rhs) {
                    auto cast = dynamic_cast< UInt64 const &>(rhs);
                    this->_value = this->_value / cast._value;
                    return *this;
                }

                Value &UInt64::operator%(Value const &rhs) {
                    auto cast = dynamic_cast< UInt64 const &>(rhs);
                    this->_value = this->_value % cast._value;
                    return *this;
                }

                Value &UInt64::operator=(bool value) {
                    _value = (uint64_t) value;
                    return *this;
                }

                Value &UInt64::operator=(double value) {
                    _value = (uint64_t) value;
                    return *this;
                }

                Value &UInt64::operator=(float value) {
                    _value = (uint64_t) value;
                    return *this;
                }

                Value &UInt64::operator=(int16 value) {
                    _value = (uint64_t) value;
                    return *this;
                }

                Value &UInt64::operator=(int32 value) {
                    _value = (uint64_t) value;
                    return *this;
                }

                Value &UInt64::operator=(int64 value) {
                    _value = (uint64_t) value;
                    return *this;
                }

                Value &UInt64::operator=(uint16 value) {
                    _value = (uint64_t) value;
                    return *this;
                }

                Value &UInt64::operator=(uint32 value) {
                    _value = (uint64_t) value;
                    return *this;
                }

                Value &UInt64::operator=(uint64 value) {
                    _value = (uint64_t) value;
                    return *this;
                }
            }
        }
    }
}


text:
package edu.ur.tag.repository;

import java.io.IOException;

import javax.servlet.ServletContext;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;

import org.springframework.beans.factory.BeanFactoryUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import edu.ur.ir.web.util.WebBrowserFileViewerHelper;

/**
 * Determines the target for the file download.  If the file
 * can be shown in the browser a new target is opened otherwise
 * nothing is done
 *
 * @author Nathan Sarr
 *
 */
public class FileDownloadTag extends SimpleTagSupport{

	private String extension;

	public void doTag() throws JspException
	{
		PageContext pageContext = (PageContext)this.getJspContext();
		ServletContext servletContext = pageContext.getServletContext();
		ApplicationContext context =  WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);

        String[] beans = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(context,
       		 WebBrowserFileViewerHelper.class, false, false);

        if (beans.length == 0) {
            throw new JspException("No web browser file viewer was found in the application context: "
           		 + context.toString());
        }

        WebBrowserFileViewerHelper viewHelper = (WebBrowserFileViewerHelper) context.getBean(beans[0]);

        if( extension != null && viewHelper.canShowFileTypeInBrowser(extension) )
        {
		    try {
		    	JspWriter out = this.getJspContext().getOut();
			    String output = "target=\"_blank\"";
				out.write(output);
			} catch (IOException e) {
				throw new JspException(e);
			}
        }

	}

	public String getExtension() {
		return extension;
	}

	public void setExtension(String extension) {
		this.extension = extension;
	}
}


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>
#include <assert.h>
#include <exception>

// UnityStandardAssets.ImageEffects.TiltShift
struct TiltShift_t1314848311;
// UnityEngine.RenderTexture
struct RenderTexture_t1963041563;

#include "codegen/il2cpp-codegen.h"
#include "UnityEngine_UnityEngine_RenderTexture1963041563.h"

// System.Void UnityStandardAssets.ImageEffects.TiltShift::.ctor()
extern "C"  void TiltShift__ctor_m3235347972 (TiltShift_t1314848311 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Boolean UnityStandardAssets.ImageEffects.TiltShift::CheckResources()
extern "C"  bool TiltShift_CheckResources_m2646334321 (TiltShift_t1314848311 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void UnityStandardAssets.ImageEffects.TiltShift::OnRenderImage(UnityEngine.RenderTexture,UnityEngine.RenderTexture)
extern "C"  void TiltShift_OnRenderImage_m1843784666 (TiltShift_t1314848311 * __this, RenderTexture_t1963041563 * ___source0, RenderTexture_t1963041563 * ___destination1, const MethodInfo* method) IL2CPP_METHOD_ATTR;


text:
package com.bpl.tucao.entity;

import com.bpl.tucao.dto.HotCommentDto;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 吐槽评论Entity
 * @author bpl
 * @version 2017-08-10
 */
public class BplComment extends DataEntity<BplComment> {

	private static final long serialVersionUID = 1L;
	private Integer hotid;		// hotid
	private Integer userid;		// userid
	private String nickName;		// nick_name
	private String content;		// content
	private Date createTime;		// create_time
	private Date updateTime;		// update_time

	public BplComment() {
		super();
	}

	public BplComment(HotCommentDto hotCommentDto) {
		this.hotid = hotCommentDto.getHotId();
		this.userid = hotCommentDto.getUserId();
		this.nickName = hotCommentDto.getNickName();
		this.content = hotCommentDto.getContent();
	}

	public BplComment(String id){
		super(id);
	}

	public Integer getHotid() {
		return hotid;
	}

	public void setHotid(Integer hotid) {
		this.hotid = hotid;
	}

	public Integer getUserid() {
		return userid;
	}

	public void setUserid(Integer userid) {
		this.userid = userid;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	@Length(min=0, max=512, message="content长度必须介于 0 和 512 之间")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

}


text:
package org.drools.planner.examples.manners2009.domain;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import org.apache.commons.lang.builder.CompareToBuilder;
import org.drools.planner.examples.common.domain.AbstractPersistable;

@XStreamAlias("HobbyPractician")
public class HobbyPractician extends AbstractPersistable {

    private Guest guest;
    private Hobby hobby;

    public Guest getGuest() {
        return guest;
    }

    public void setGuest(Guest guest) {
        this.guest = guest;
    }

    public Hobby getHobby() {
        return hobby;
    }

    public void setHobby(Hobby hobby) {
        this.hobby = hobby;
    }

    @Override
    public String toString() {
        return guest + "-" + hobby;
    }

}


text:
<!doctype html>
<html lang="sv">
<meta charset="utf-8" />
<title>Kmom03 SQL | Kursen databas</title>

<!-- Mithril HTML Slideshow styles -->
<link href="../css/mithril-slideshow.css" rel="stylesheet" />

<!-- Code formatting using highlight.js -->
<link rel="stylesheet" href="../css/default.css">
<link rel="stylesheet" href="../css/tomorrow.css">
<script src="../js/highlight.pack.js"></script>

<!-- Text formatting using Markdown through showdown.js -->
<script src="../js/showdown.min.js"></script>

<!-- Here comes the slides in order -->
<script data-role="slide" data-markdown type="text/html">
# Kursen databas
## Kmom03 SQL
### Mikael Roos, dbwebb
</script>

<script data-role="slide" data-markdown type="text/html">
# Agenda

* Samla DDL
* INNER/OUTER JOIN
* Subquery
* UNION
* LOAD LOCAL INFILE
* Import/export Excel
* mysqldump

</script>

<script data-role="slide" data-markdown type="text/html">
# Avslutningsvis

* Frågor på det?

</script>

<script data-role="slide" data-markdown type="text/html">
<!-- empty slide by intention -->
</script>

<!-- include essential js-script -->
<script src="../js/mithril.min.js"></script>
<script src="../js/mithril-slideshow.js"></script>

</html>


text:
class Exercism
  class Assignment

    def self.save(data, path)
      data['assignments'].map do |attributes|
        Assignment.new(attributes.merge('project_dir' => path)).save
      end
    end

    attr_reader :track, :slug, :readme, :test_file, :tests, :project_dir

    def initialize(attributes)
      @track = attributes['track']
      @slug = attributes['slug']
      @readme = attributes['readme']
      @test_file = attributes['test_file']
      @tests = attributes['tests']
      @project_dir = attributes['project_dir']
    end

    def save
      FileUtils.mkdir_p assignment_dir
      save_readme
      save_tests unless File.exist?(tests_path)
      self
    end

    def save_readme
      File.open readme_path, 'w' do |f|
        f.write readme
      end
    end

    def save_tests
      File.open tests_path, 'w' do |f|
        f.write tests
      end
    end

    def assignment_dir
      @assignment_dir ||= File.join(project_dir, track, slug)
    end

    private

    def readme_path
      File.join(assignment_dir, 'README.md')
    end

    def tests_path
      File.join(assignment_dir, test_file)
    end
  end
end


text:
layout: post
title:  "AWS Data Pipeline Resources"
date:   2017-02-09 11:10:47
categories: aws
tags: data-pipeline pipeline
excerpt:  Just some links
---

1. [ETL with Data Pipeline, EMR and Redshift](http://www.slideshare.net/AmazonWebServices/bdt303-construct-your-etl-pipeline-with-aws-data-pipeline-amazon-emr-and-amazon-redshift-aws-reinvent-2014)
2. [Recommendation engine using Data Pipeline, Elastic Map Reduce and Spark](https://medium.com/@HubbaDev/building-a-recommendation-engine-with-aws-data-pipeline-elastic-mapreduce-and-spark-ad886b0a1434#.lspmb5kh5)
3. [File transfer between S3 and EC2 with Data Pipeline](http://stackoverflow.com/questions/30207339/transfer-files-between-s3-to-ec2-using-aws-data-pipeline)
4. [Task Runner for connecting computational resources with Data Pipeline](http://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-how-task-runner-user-managed.html)


text:
/* maps with type twms are mapped to basemaps.json which is used by ADAGUC WebMapJS TileRenderer */

const KNMI_NATURALEARTH2 = {
  name: 'NaturalEarth2',
  title: 'KNMI Natural Earth Map',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const MWS_STYLE = {
  service: 'http://geoservices.knmi.nl/cgi-bin/worldmaps.cgi?',
  name: 'mwsmap',
  transparent: true,
  title: 'KNMI MWS map',
  format: 'image/png',
  enabled: true,
  dimensions: []
};

const WORLDMAP_LIGHT_GREY_CANVAS = {
  name: 'WorldMap_Light_Grey_Canvas',
  title: 'KNMI GeoWeb WorldMap Light Grey Canvas (Mercator)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const OPENSTREETMAP_NL = {
  name: 'OpenStreetMap_NL',
  title: 'KNMI GeoWeb OpenStreetMap NL (Mercator)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const OPENSTREETS_NL = {
  name: 'OpenStreets_NL',
  title: 'KNMI GeoWeb OpenStreets NL  (Mercator / RD)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const POSITRON_NL = {
  name: 'Positron_NL',
  title: 'KNMI GeoWeb Positron NL (Mercator)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const POSITRON_NL_NOLABELS = {
  name: 'Positron_NL_NoLabels',
  title: 'KNMI GeoWeb Positron NL No Labels (Mercator)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const KLOKANTECH_BASIC_NL = {
  name: 'Klokantech_Basic_NL',
  title: 'KNMI GeoWeb Klokantech Basic NL (Mercator)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const KLOKANTECH_BASIC_NL_NOLABELS = {
  name: 'Klokantech_Basic_NL_NoLabels',
  title: 'KNMI GeoWeb Klokantech Basic NL No Labels (Mercator)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const OSM_BLOSSOM_NL = {
  name: 'OSM_Blossom_NL',
  title: 'KNMI GeoWeb OSM Blossom NL (Mercator)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const WORLDMAP = {
  name: 'WorldMap',
  title: 'KNMI GeoWeb WorldMap',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const OSM_ANTARCTICA = {
  name: 'OSM_Antarctica',
  title: 'KNMI GeoWeb OSM Antarctica (EPSG:3412)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const OPENSTREETMAP_SERVICE = {
  name: 'OpenStreetMap_Service',
  title: 'OSM OpenStreetMap (Mercator)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const ESRI_ARCGIS_CANVAS = {
  name: 'arcGisCanvas',
  title: 'ESRI ArcGIS canvas map (Mercator)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const ESRI_ARCGIS_TOPO = {
  name: 'arcGisTopo',
  title: 'ESRI ArcGIS topgraphical map (Mercator)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const ESRI_ARCGIS_SAT = {
  name: 'arcGisSat',
  title: 'ESRI ArcGIS satellite map (Mercator/LatLon)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

const ESRI_ARCGIS_OCEAN = {
  name: 'arcGisOceanBaseMap',
  title: 'ESRI ArcGIS ocean map (Mercator)',
  type: 'twms',
  enabled: true,
  dimensions: []
};

export const MAP_STYLES = [WORLDMAP, POSITRON_NL, POSITRON_NL_NOLABELS, OPENSTREETMAP_SERVICE, KNMI_NATURALEARTH2, MWS_STYLE, OPENSTREETS_NL,
  OSM_BLOSSOM_NL, OPENSTREETMAP_NL, WORLDMAP_LIGHT_GREY_CANVAS, KLOKANTECH_BASIC_NL,
  KLOKANTECH_BASIC_NL_NOLABELS, OSM_ANTARCTICA, ESRI_ARCGIS_CANVAS, ESRI_ARCGIS_TOPO, ESRI_ARCGIS_SAT, ESRI_ARCGIS_OCEAN];


text:
#ifndef FIRESTORE_CORE_SRC_CORE_EVENT_LISTENER_H_
#define FIRESTORE_CORE_SRC_CORE_EVENT_LISTENER_H_

#include <memory>
#include <mutex>  // NOLINT(build/c++11)
#include <utility>

#include "Firestore/core/src/util/executor.h"
#include "Firestore/core/src/util/status_fwd.h"
#include "Firestore/core/src/util/statusor.h"
#include "absl/memory/memory.h"

namespace firebase {
namespace firestore {
namespace core {

/**
 * A general interface for listening to events internally.
 */
template <typename T>
class EventListener {
 public:
  static std::unique_ptr<EventListener<T>> Create(
      util::StatusOrCallback<T> callback);

  virtual ~EventListener() = default;

  /**
   * OnEvent will be called with the new value or the error if an error
   * occurred.
   *
   * @param maybe_value The value of the event or the error.
   */
  virtual void OnEvent(util::StatusOr<T> maybe_value) = 0;
};

/**
 * A wrapper around another EventListener that dispatches events asynchronously.
 */
template <typename T>
class AsyncEventListener
    : public EventListener<T>,
      public std::enable_shared_from_this<AsyncEventListener<T>> {
 public:
  using DelegateListener = std::unique_ptr<EventListener<T>>;

  AsyncEventListener(const std::shared_ptr<util::Executor>& executor,
                     DelegateListener&& delegate)
      : executor_(executor), delegate_(std::move(delegate)) {
  }

  static std::shared_ptr<AsyncEventListener<T>> Create(
      std::shared_ptr<util::Executor> executor, DelegateListener&& delegate);

  static std::shared_ptr<AsyncEventListener<T>> Create(
      std::shared_ptr<util::Executor> executor, EventListener<T>&& delegate) {
    return Create(executor,
                  absl::make_unique<EventListener>(std::move(delegate)));
  }

  void OnEvent(util::StatusOr<T> maybe_value) override;

  /**
   * Synchronously mutes the listener and raises no further events. This method
   * is thread safe and can be called from any queue.
   */
  void Mute();

 private:
  // PORTING NOTE: Android uses a volatile here but that's not enough in C++.
  //
  // In C++, the user can call `ListenerRegistration::Remove` (which calls
  // `Mute`) and then immediately delete the state backing the listener. Using
  // a mutex here instead of an atomic ensures that `Mute` won't return until
  // it's safe to delete the state backing a listener. In Java this is safe
  // because the state backing the listener is garbage collected so it doesn't
  // matter if the mute is concurrent with a callback.
  //
  // Use a recursive mutex instead of `std::mutex` to avoid deadlock in the case
  // where a user calls `Remove` from within a callback on that listener.
  std::recursive_mutex mutex_;
  bool muted_ = false;
  std::shared_ptr<util::Executor> executor_;
  DelegateListener delegate_;
};

template <typename T>
std::unique_ptr<EventListener<T>> EventListener<T>::Create(
    util::StatusOrCallback<T> callback) {
  class CallbackEventListener : public EventListener<T> {
   public:
    explicit CallbackEventListener(util::StatusOrCallback<T>&& callback)
        : callback_(std::move(callback)) {
    }

    void OnEvent(util::StatusOr<T> maybe_value) override {
      callback_(std::move(maybe_value));
    }

   private:
    util::StatusOrCallback<T> callback_;
  };

  return absl::make_unique<CallbackEventListener>(std::move(callback));
}

template <typename T>
std::shared_ptr<AsyncEventListener<T>> AsyncEventListener<T>::Create(
    std::shared_ptr<util::Executor> executor, DelegateListener&& delegate) {
  return std::make_shared<AsyncEventListener<T>>(executor, std::move(delegate));
}

template <typename T>
void AsyncEventListener<T>::Mute() {
  std::lock_guard<std::recursive_mutex> lock(mutex_);
  muted_ = true;
}

template <typename T>
void AsyncEventListener<T>::OnEvent(util::StatusOr<T> maybe_value) {
  // Retain a strong reference to this. If the EventManager is sending an error
  // it will immediately clear its strong reference to this after posting the
  // event. The strong reference here allows the AsyncEventListener to survive
  // until the executor gets around to calling.
  std::shared_ptr<AsyncEventListener<T>> shared_this = this->shared_from_this();

  executor_->Execute([shared_this, maybe_value]() {
    std::lock_guard<std::recursive_mutex> lock(shared_this->mutex_);
    if (!shared_this->muted_) {
      shared_this->delegate_->OnEvent(std::move(maybe_value));
    }
  });
}

}  // namespace core
}  // namespace firestore
}  // namespace firebase

#endif  // FIRESTORE_CORE_SRC_CORE_EVENT_LISTENER_H_


text:
package com.algomized.springframework.test.util;

import java.nio.charset.Charset;
import org.springframework.http.MediaType;
import org.springframework.security.crypto.codec.Base64;

/**
 * Static utility methods for testing.
 *
 * @author Poh Kah Kong
 */
public class TestUtils {
	/**
	 * Media type for json utf8
	 */
	public static final MediaType APPLICATION_JSON_UTF8 = new MediaType(
			MediaType.APPLICATION_JSON.getType(),
			MediaType.APPLICATION_JSON.getSubtype(),
			Charset.forName("utf8")
			);

	/**
	 * Creates a string with the given length
	 *
	 * @param length the length of the string
	 * @return a string of the given length
	 */
	public static String createStringWithLength(int length) {
        StringBuilder builder = new StringBuilder();
        for (int index = 0; index < length; index++) {
            builder.append("a");
        }
        return builder.toString();
    }

	/**
	 * Encodes the username and password for Http Basic Authentication.
	 *
	 * @param username the username
	 * @param password the password
	 * @return the encoded token
	 */
	public static String encodeForHttpBasicAuth(String username, String password) {
		String text = username + ":" + password;
		return new String(Base64.encode(text.getBytes()));
	}
}


text:
package main

import (
	"fmt"
	"os"
	"path/filepath"

	"github.com/ktsimpso/spriter/css"
	"github.com/ktsimpso/spriter/imagestitcher"
)

func main() {

	cssFileName := "css/styles.css"
	t, err := css.GetParseTree(cssFileName)
	if err != nil {
		fmt.Println(err)
		return
	}

	imagePaths := css.GetPaths(t)
	fmt.Println(imagePaths)

	err = os.Chdir(filepath.Dir(cssFileName))
	if err != nil {
		fmt.Println(err)
		return
	}

	m, err := imagestitcher.Combine(imagePaths, "../img/sprite.png")
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(m)

	css.AddSpriteToCss(t, "../img/sprite.png", m)

	err = t.WriteToFile("sprited.css")
	if err != nil {
		fmt.Println(err)
	}
}


text:
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */

/*************************************************************
 *
 *  MathJax/extensions/Safe.js
 *
 *  Implements a "Safe" mode that disables features that could be
 *  misused in a shared environment (such as href's to javascript URL's).
 *  See the CONFIG variable below for configuration options.
 *
 *  ---------------------------------------------------------------------
 *
 *  Copyright (c) 2013-2016 The MathJax Consortium
 *
 *  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
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

(function (HUB,AJAX) {
  var VERSION = "2.7.0-beta";

  var CONFIG = MathJax.Hub.CombineConfig("Safe",{
    allow: {
      //
      //  Values can be "all", "safe", or "none"
      //
      URLs: "safe",      // safe are in safeProtocols below
      classes: "safe",   // safe start with MJX-
      cssIDs: "safe",    // safe start with MJX-
      styles: "safe",    // safe are in safeStyles below
      fontsize: "all",   // safe are between sizeMin and sizeMax em's
      require: "safe"    // safe are in safeRequire below
    },
    sizeMin: .7,        // \scriptsize
    sizeMax: 1.44,      // \large
    lengthMax: 3,       // largest padding/border/margin, etc. in em's
    safeProtocols: {
      http: true,
      https: true,
      file: true,
      javascript: false
    },
    safeStyles: {
      color: true,
      backgroundColor: true,
      border: true,
      cursor: true,
      margin: true,
      padding: true,
      textShadow: true,
      fontFamily: true,
      fontSize: true,
      fontStyle: true,
      fontWeight: true,
      opacity: true,
      outline: true
    },
    safeRequire: {
      action: true,
      amscd: true,
      amsmath: true,
      amssymbols: true,
      autobold: false,
      "autoload-all": false,
      bbox: true,
      begingroup: true,
      boldsymbol: true,
      cancel: true,
      color: true,
      enclose: true,
      extpfeil: true,
      HTML: true,
      mathchoice: true,
      mhchem: true,
      newcommand: true,
      noErrors: false,
      noUndefined: false,
      unicode: true,
      verb: true
    },
    //
    //  CSS styles that have Top/Right/Bottom/Left versions
    //
    styleParts: {
      border: true,
      padding: true,
      margin: true,
      outline: true
    },
    //
    //  CSS styles that are lengths needing max/min testing
    //    A string value means test that style value;
    //    An array gives [min,max] in em's
    //    Otherwise use [-lengthMax,lengthMax] from above
    //
    styleLengths: {
      borderTop: "borderTopWidth",
      borderRight: "borderRightWidth",
      borderBottom: "borderBottomWidth",
      borderLeft: "borderLeftWidth",
      paddingTop: true,
      paddingRight: true,
      paddingBottom: true,
      paddingLeft: true,
      marginTop: true,
      marginRight: true,
      marginBottom: true,
      marginLeft: true,
      outlineTop: true,
      outlineRight: true,
      outlineBottom: true,
      outlineLeft: true,
      fontSize: [.7,1.44]
    }
  });

  var ALLOW = CONFIG.allow;
  if (ALLOW.fontsize !== "all") {CONFIG.safeStyles.fontSize = false}

  var SAFE = MathJax.Extension.Safe = {
    version: VERSION,
    config: CONFIG,
    div1: document.createElement("div"),  // for CSS processing
    div2: document.createElement("div"),

    //
    //  Methods called for MathML attribute processing
    //
    filter: {
      href:                 "filterURL",
      src:                  "filterURL",
      altimg:               "filterURL",
      "class":              "filterClass",
      style:                "filterStyles",
      id:                   "filterID",
      fontsize:             "filterFontSize",
      mathsize:             "filterFontSize",
      scriptminsize:        "filterFontSize",
      scriptsizemultiplier: "filterSizeMultiplier",
      scriptlevel:          "filterScriptLevel"
    },

    //
    //  Filter HREF URL's
    //
    filterURL: function (url) {
      var protocol = (url.match(/^\s*([a-z]+):/i)||[null,""])[1].toLowerCase();
      if (ALLOW.URLs === "none" ||
         (ALLOW.URLs !== "all" && !CONFIG.safeProtocols[protocol])) {url = null}
      return url;
    },

    //
    //  Filter class names and css ID's
    //
    filterClass: function (CLASS) {
      if (ALLOW.classes === "none" ||
         (ALLOW.classes !== "all" && !CLASS.match(/^MJX-[-a-zA-Z0-9_.]+$/))) {CLASS = null}
      return CLASS;
    },
    filterID: function (id) {
      if (ALLOW.cssIDs === "none" ||
         (ALLOW.cssIDs !== "all" && !id.match(/^MJX-[-a-zA-Z0-9_.]+$/))) {id = null}
      return id;
    },

    //
    //  Filter style strings
    //
    filterStyles: function (styles) {
      if (ALLOW.styles === "all") {return styles}
      if (ALLOW.styles === "none") {return null}
      try {
        //
        //  Set the div1 styles to the given styles, and clear div2
        //
        var STYLE1 = this.div1.style, STYLE2 = this.div2.style, value;
        STYLE1.cssText = styles; STYLE2.cssText = "";
        //
        //  Check each allowed style and transfer OK ones to div2
        //  If the style has Top/Right/Bottom/Left, look at all four separately
        //
        for (var name in CONFIG.safeStyles) {if (CONFIG.safeStyles.hasOwnProperty(name)) {
          if (CONFIG.styleParts[name]) {
            for (var i = 0; i < 4; i++) {
              var NAME = name+["Top","Right","Bottom","Left"][i]
              value = this.filterStyle(NAME,STYLE1);
              if (value) {STYLE2[NAME] = value}
            }
          } else {
            value = this.filterStyle(name,STYLE1);
            if (value) {STYLE2[name] = value}
          }
        }}
        //
        //  Return the div2 style string
        //
        styles = STYLE2.cssText;
      } catch (e) {styles = null}
      return styles;
    },
    //
    //  Filter an individual name:value style pair
    //
    filterStyle: function (name,styles) {
      var value = styles[name];
      if (typeof value !== "string" || value === "") {return null}
      if (value.match(/^\s*expression/)) {return null}
      if (value.match(/javascript:/)) {return null}
      var NAME = name.replace(/Top|Right|Left|Bottom/,"");
      if (!CONFIG.safeStyles[name] && !CONFIG.safeStyles[NAME]) {return null}
      if (!CONFIG.styleLengths[name]) {return value}
      return (this.filterStyleLength(name,value,styles) ? value : null);
    },
    filterStyleLength: function (name,value,styles) {
      if (typeof CONFIG.styleLengths[name] === "string") value = styles[CONFIG.styleLengths[name]];
      value = this.length2em(value);
      if (value == null) return false;
      var mM = [-CONFIG.lengthMax,CONFIG.lengthMax];
      if (MathJax.Object.isArray(CONFIG.styleLengths[name])) mM = CONFIG.styleLengths[name];
      return (value >= mM[0] && value <= mM[1]);
    },
    //
    //  Conversion of units to em's
    //
    unit2em: {
      em: 1,
      ex: .5,         // assume 1ex = .5em
      ch: .5,         // assume 1ch = .5em
      rem: 1,         // assume 1rem = 1em
      px: 1/16,       // assume 1em = 16px
      mm: 96/25.4/16, // 25.4mm = 96px
      cm: 96/2.54/16, // 2.54cm = 96px
      'in': 96/16,      // 1in = 96px
      pt: 96/72/16,   // 72pt = 1in
      pc: 96/6/16     // 1pc = 12pt
    },
    length2em: function (value) {
      var match = value.match(/(.+)(em|ex|ch|rem|px|mm|cm|in|pt|pc)/);
      if (!match) return null;
      return parseFloat(match[1])*this.unit2em[match[2]];
    },

    //
    //  Filter TeX font size values (in em's)
    //
    filterSize: function (size) {
      if (ALLOW.fontsize === "none") {return null}
      if (ALLOW.fontsize !== "all")
        {size = Math.min(Math.max(size,CONFIG.sizeMin),CONFIG.sizeMax)}
      return size;
    },
    filterFontSize: function (size) {
      return (ALLOW.fontsize === "all" ? size: null);
    },

    //
    //  Filter scriptsizemultiplier
    //
    filterSizeMultiplier: function (size) {
      if (ALLOW.fontsize === "none") {size = null}
      else if (ALLOW.fontsize !== "all") {size = Math.min(1,Math.max(.6,size)).toString()}
      return size;
    },
    //
    //  Filter scriptLevel
    //
    filterScriptLevel: function (level) {
      if (ALLOW.fontsize === "none") {level = null}
      else if (ALLOW.fontsize !== "all") {level = Math.max(0,level).toString()}
      return level;
    },

    //
    //  Filter TeX extension names
    //
    filterRequire: function (name) {
      if (ALLOW.require === "none" ||
         (ALLOW.require !== "all" && !CONFIG.safeRequire[name.toLowerCase()]))
           {name = null}
      return name;
    }

  };

  HUB.Register.StartupHook("TeX HTML Ready",function () {
    var TEX = MathJax.InputJax.TeX;

    TEX.Parse.Augment({

      //
      //  Implements \href{url}{math} with URL filter
      //
      HREF_attribute: function (name) {
        var url = SAFE.filterURL(this.GetArgument(name)),
            arg = this.GetArgumentMML(name);
        if (url) {arg.With({href:url})}
        this.Push(arg);
      },

      //
      //  Implements \class{name}{math} with class-name filter
      //
      CLASS_attribute: function (name) {
        var CLASS = SAFE.filterClass(this.GetArgument(name)),
            arg   = this.GetArgumentMML(name);
        if (CLASS) {
          if (arg["class"] != null) {CLASS = arg["class"] + " " + CLASS}
          arg.With({"class":CLASS});
        }
        this.Push(arg);
      },

      //
      //  Implements \style{style-string}{math} with style filter
      //
      STYLE_attribute: function (name) {
        var style = SAFE.filterStyles(this.GetArgument(name)),
            arg   = this.GetArgumentMML(name);
        if (style) {
          if (arg.style != null) {
            if (style.charAt(style.length-1) !== ";") {style += ";"}
            style = arg.style + " " + style;
          }
          arg.With({style: style});
        }
        this.Push(arg);
      },

      //
      //  Implements \cssId{id}{math} with ID filter
      //
      ID_attribute: function (name) {
        var ID  = SAFE.filterID(this.GetArgument(name)),
            arg = this.GetArgumentMML(name);
        if (ID) {arg.With({id:ID})}
        this.Push(arg);
      }

    });

  });

  HUB.Register.StartupHook("TeX Jax Ready",function () {
    var TEX = MathJax.InputJax.TeX,
        PARSE = TEX.Parse, METHOD = SAFE.filter;

    PARSE.Augment({

      //
      //  Implements \require{name} with filtering
      //
      Require: function (name) {
        var file = this.GetArgument(name).replace(/.*\//,"").replace(/[^a-z0-9_.-]/ig,"");
        file = SAFE.filterRequire(file);
        if (file) {this.Extension(null,file)}
      },

      //
      //  Controls \mmlToken attributes
      //
      MmlFilterAttribute: function (name,value) {
        if (METHOD[name]) {value = SAFE[METHOD[name]](value)}
        return value;
      },

      //
      //  Handles font size macros with filtering
      //
      SetSize: function (name,size) {
        size = SAFE.filterSize(size);
        if (size) {
          this.stack.env.size = size;
          this.Push(TEX.Stack.Item.style().With({styles: {mathsize: size+"em"}}));
        }
      }

    });
  });

  HUB.Register.StartupHook("TeX bbox Ready",function () {
    var TEX = MathJax.InputJax.TeX;

    //
    //  Filter the styles for \bbox
    //
    TEX.Parse.Augment({
      BBoxStyle: function (styles) {return SAFE.filterStyles(styles)},
      BBoxPadding: function (pad) {
        var styles = SAFE.filterStyles("padding: "+pad);
        return (styles ? pad : 0);
      }
    });

  });

  HUB.Register.StartupHook("MathML Jax Ready",function () {
    var PARSE = MathJax.InputJax.MathML.Parse,
        METHOD = SAFE.filter;

    //
    //  Filter MathML attributes
    //
    PARSE.Augment({
      filterAttribute: function (name,value) {
        if (METHOD[name]) {value = SAFE[METHOD[name]](value)}
        return value;
      }
    });

  });

  // MathML input (href, style, fontsize, class, id)

  HUB.Startup.signal.Post("Safe Extension Ready");
  AJAX.loadComplete("[MathJax]/extensions/Safe.js");

})(MathJax.Hub,MathJax.Ajax);


text:
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
    <title>seed-element Demo</title>

    <link rel="import" href="/components/leaflet-element/bower_components/leaflet-map/leaflet-map.html">
    <link rel="import" href="/components/leaflet-element/bower_components/iron-ajax/iron-ajax.html">

    <title>Catalog of Components</title>

    <link rel="stylesheet" href="https://code.getmdl.io/1.1.3/material.deep_orange-orange.min.css">

    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

                        <input class="mdl-textfield__input" type="text" name="sample" id="fixed-header-drawer-exp">

            GeoComponents

                Home
                GeoLink: Person
                GeoLink: Person Overlay
                GeoLink: Datasets
                GeoLink: Leaflet Polygon
                GeoLink: Leaflet IODP call
                GeoLink: OCD Search
                Open Core: Deep Dive
                Open Core: Gplates

                        This component and the other leaflet component on this site use the well crafted Leaflet package web component (
   https://leaflet-extras.github.io/leaflet-map/demo.html). This is not developed by GeoLink but is used as a component and then data bound to the Polymer (

   https://www.polymer-project.org/1.0/) Iron-Ajax component. When connected to services that expose the GeoLink data holdings a simple approach to data visualization is the result. This approach is also easy for others to
                        incorporate into their work.

1
2
3
4
5
6
7
8
9

 <leaflet-map latitude="16.5" longitude="-80" zoom="3">
        <leaflet-tilelayer url="https://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/tile/{z}/{y}/{x}" max-zoom="13">
                            Tiles &copy; Esri &mdash; Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri
        </leaflet-tilelayer>
        <template is="dom-bind">
            <iron-ajax url="http://opencoredata.org/api/v1/spatial/expedition/165" auto last-response="{{data}}"></iron-ajax>
            <leaflet-geojson color="#FF0000" data="[[data]]"></leaflet-geojson>
        </template>
</leaflet-map>

                    <leaflet-map latitude="16.5" longitude="-80" zoom="3">
                        <leaflet-tilelayer url="https://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/tile/{z}/{y}/{x}" max-zoom="13">
                            Tiles © Esri — Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri
                        </leaflet-tilelayer>
                        <template is="dom-bind">
                                  <iron-ajax url="http://opencoredata.org/api/v1/spatial/expedition/165" auto last-response="{{data}}"></iron-ajax>
                                  <leaflet-geojson color="#FF0000" data="[[data]]"></leaflet-geojson>
                         </template>
                    </leaflet-map>


text:
using System.Web.Mvc;

namespace BookLibrary.Controllers
{using System.Web.Mvc;
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return RedirectToAction("Index", "Book");
        }
    }
}


text:
package io.jpress.core;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.math.BigInteger;

import com.jfinal.kit.StrKit;
import com.jfinal.log.Log;
import com.jfinal.plugin.activerecord.Page;

import io.jpress.model.core.JModel;

public class JBaseCRUDController<M extends JModel<? extends JModel<?>>> extends JBaseController {

	private static final Log logger = Log.getLog(JBaseCRUDController.class);;
	private final Class<M> mClazz;
//	protected final M mDao;

	@SuppressWarnings("unchecked")
	public JBaseCRUDController() {
		ParameterizedType type = getParameterizedType(getClass());
		mClazz = (Class<M>) type.getActualTypeArguments()[0];
//		mDao = getDao();
	}

	private ParameterizedType getParameterizedType(Class<?> clazz) {
		if (clazz == Object.class) {
			logger.error("get ParameterizedType error in _BaseController.class");
			return null;
		}
		Type genericSuperclass = clazz.getGenericSuperclass();
		if (genericSuperclass instanceof ParameterizedType) {
			return (ParameterizedType) genericSuperclass;
		} else {
			return getParameterizedType(clazz.getSuperclass());
		}
	}

	@SuppressWarnings("unchecked")
	public void index() {
		Page<M> page = onIndexDataLoad(getPageNumber(), getPageSize());
		if (null == page) {
			page = (Page<M>) getDao().doPaginate(getPageNumber(), getPageSize());
		}
		setAttr("page", page);
		render("index.html");
	}

	public void edit() {
		BigInteger id = getParaToBigInteger("id");
		if (id != null) {
			setAttr(StrKit.firstCharToLowerCase(mClazz.getSimpleName()), getDao().findById(id));
		}
		render("edit.html");
	}

	public void save() {
		if (isMultipartRequest()) {
			getFile();
		}

		M m = getModel(mClazz);

		if (!onModelSaveBefore(m)) {
			renderAjaxResultForError();
			return;
		}
		m.saveOrUpdate();

		if (!onModelSaveAfter(m)) {
			renderAjaxResultForError();
			return;
		}

		renderAjaxResultForSuccess("ok");
	}

	public void delete() {
		BigInteger id = getParaToBigInteger("id");
		if (id != null) {
			getDao().deleteById(id);
			renderAjaxResultForSuccess("删除成功");
		} else {
			renderAjaxResultForError();
		}
	}

	private M getDao() {
		M m = null;
		try {
			m = mClazz.newInstance();
		} catch (Exception e) {
			logger.error("get DAO error.", e);
		}
		return m;
	}

	public Page<M> onIndexDataLoad(int pageNumber, int pageSize) {
		return null;
	}

	public boolean onModelSaveBefore(M m) {
		// do nothing
		return true;
	}

	public boolean onModelSaveAfter(M m) {
		// do nothing
		return true;
	}

}


text:
'use babel';

import URL from 'url';
import _s from 'underscore.string';

/**
 * Class of objects containing DB connection configuration which can be serialised to
 * and from a URL.
 */
export default class DbConnectionConfig {
  constructor() {
    if (typeof(arguments[0]) == 'string') {
      this.constructFromUrl(arguments[0]);
      // console.debug('DbConnectionConfig constructed from url string : ' + JSON.stringify(this));
    } else {
      this.constructFromObject(arguments[0]);
      // console.debug('DbConnectionConfig constructed from object : ' + JSON.stringify(this));
    }
  }

  constructFromUrl(url) {
    var urlObj = URL.parse(url, true);

    this.protocol = _s.rtrim(urlObj.protocol, ':');

    if (urlObj.auth) {
      var auth = urlObj.auth.split(':');
      this.user = auth[0];

      if (auth.length > 1)
        this.password = auth[1];
    }

    this.server = urlObj.hostname;
    this.port = urlObj.port;

    if (urlObj.pathname) {
      var instancename = urlObj.pathname.split('/').slice(1);
      this.database = instancename[instancename.length - 1];

      if (instancename.length > 1)
        this.instance = instancename[0];
    }

    if (urlObj.search)
      this.options = _s.ltrim(urlObj.search, '?').replace('&', ',');
  }

  constructFromObject(obj) {
    this.name = obj.name;
    this.protocol = obj.protocol;
    this.user = obj.user;
    this.password = obj.password;

    var serverInstance = obj.server.split('\\');

    this.server = serverInstance[0];

    if (serverInstance.length > 1)
      this.instance = serverInstance[1];

    this.port = obj.port;
    this.database = obj.database;
    this.options = obj.options;
  }

  // getConnectionName() {
  //   return this.user + '@' + this.server;
  // }

  getUrl() {
    return this.getUrlWithDb(this.database);
  }

  getUrlWithDb(database) {
    var auth = this.user ? encodeURIComponent(this.user) + ':' + encodeURIComponent(this.password) + '@' : '';

    return encodeURIComponent(this.protocol) +
      '://' +
      auth +
      encodeURIComponent(this.server) +
      (this.port ? ':' + encodeURIComponent(this.port) : '') +
      (this.instance ? '/' + encodeURIComponent(this.instance) : '') +
      '/' + database +
      (this.options ? '?' + this.options.split(',').join('&') : '');
  }
}


text:
#ifndef _TEGLQUERYCONFIGTESTS_HPP
#define _TEGLQUERYCONFIGTESTS_HPP
/*!
 * \file
 * \brief Surface query tests.
 *//*--------------------------------------------------------------------*/

#include "tcuDefs.hpp"
#include "teglTestCase.hpp"

namespace deqp
{
namespace egl
{

class QueryConfigTests : public TestCaseGroup
{
public:
							QueryConfigTests			(EglTestContext& eglTestCtx);
	virtual					~QueryConfigTests			(void);

	void					init						(void);
};

} // egl
} // deqp

#endif // _TEGLQUERYCONFIGTESTS_HPP


text:
package com.datapine.dao;

import com.datapine.domain.Item;
import java.util.List;

/**
 * Storage related operations on {@link Item}'s.
 *
 * @author Alexey Saenko (alexey.saenko@gmail.com)
 * @version $Id$
 */
public interface ItemDAO {

    /**
     * Saves an item.
     * @param item The specified item.
     * @return Saved item instance.
     */
    Item save(Item item);

    /**
     * Deletes an item.
     * @param item The specified item.
     */
    void delete(Item item);

    /**
     * Finds an item by the id.
     * @param iid The specified item id.
     * @return Found item.
     */
    Item findById(Long iid);

    /**
     * Returns all items ordered by id.
     * @return List of items.
     */
    List<Item> findAllOrderById();

}


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>Converters</title>

    <link href="bindingconverters.css" rel="stylesheet" />

            <button data-win-control="WinJS.UI.BackButton"></button>

                Welcome to converters

A converter changes the value of the property of a data binding to something that makes sense in the view. For example, you may be binding a Boolean property to an input field where it should say either "Yes" or "No". The converter would convert true to "Yes" and false to "No".