text:
package main

import (
	"imgo/libs/proto"
	"net/http"
	"strconv"
	"time"

	log "code.google.com/p/log4go"
)

// GetOfflineMsg get offline mesage http handler.
func GetOfflineMsg(w http.ResponseWriter, r *http.Request) {
	if r.Method != "GET" {
		http.Error(w, "Method Not Allowed", 405)
		return
	}
	params := r.URL.Query()
	uidStr := params.Get("uid")
	midStr := params.Get("mid")
	callback := params.Get("cb")
	token := params.Get("token")
	res := map[string]interface{}{"ret": OK}
	defer retWrite(w, r, res, callback, time.Now())

	if uidStr == "" || midStr == "" || token == "" {
		res["ret"] = ParamErr
		return
	}

	uid, err := strconv.ParseInt(uidStr, 10, 64)
	if err != nil {
		res["ret"] = ParamErr
		return
	}

	//check token
	ok, err := IsTokenValid(uid, token)
	if err != nil {
		res["ret"] = InternalErr
		return
	}
	if !ok {
		res["ret"] = TokenErr
		return
	}

	mid, err := strconv.ParseInt(midStr, 10, 64)
	if err != nil {
		res["ret"] = ParamErr
		log.Error("strconv.ParseInt(\"%s\", 10, 64) error(%v)", midStr, err)
		return
	}

	var msgs []*proto.Message
	msgs, err = UseStorage.GetPrivate(uidStr, mid)
	if err != nil {
		res["ret"] = InternalErr
		log.Error("UseStorage.GetPrivate(\"%s\",%v) error(%v)", uidStr, mid, err)
		return
	}

	if len(msgs) == 0 {
		return
	}

	res["data"] = map[string]interface{}{"msgs": msgs}
	return
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Hartwegia purpurea Lindl.

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
namespace Algorithms
{
template <typename T>
struct HasConstantIterator
{
private:
    template <typename C>
    static char Test(typename C::const_iterator*) {}

    template <typename C>
    static int Test(...) {}

public:
    enum { Value = sizeof(Test<T>(0)) == sizeof(char) };
};
}


text:
title: "Pink Halite Chunk"
product-category: crystals
sitemap: true
name: "Pink Halite Chunk #4"
description: "3.5oz"
image-url: "/assets/img/products/crystals/pink-halite-4.jpg"
image-large-url: "/assets/img/products/crystals/large/pink-halite-4.jpg"
price: 10
price_wholesale: 10
weight: 100
display_order: 120
cell_layout: "small"
orderable: true
hidden: false
new: false
is_crystal: true
stackable: false

long_description: Different from all the other Pink Halite pieces, this baby has small crystal formations that remind me of Rose Quartz. Pink Halite this size is amazing in the bath - one stone will give you multiple uses. Simply place it in your next ritual bath to help cleanse the aura and disperse negativity.

ingredients: blank

product-notes: This is an extremely fragile specimen, we will do my best to package it as safely as possible but please be aware some little pieces may break off in transit.

history: blank

healing-properties: Halite is a rock salt known for it's cleansing and purifying properties, it aids in clarifying energy blocks and balancing energy fields. This makes it perfect for cleansing your other crystals! Similar to Selenite, you can rest your other crystals on it to remove unwanted/negative energies. In meditation, Pink Halite connects to the heart and solar plexus chakras allowing a self-loving awareness which aids in the release of emotional issues and attachments.
---


text:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "ch.h"
#include "hal.h"

#include "gps.h"
#include "motor.h"
#include "battery.h"
#include "sensors.h"
#include "vcom_usb.h"
#include "flight_control.h"

static THD_WORKING_AREA(waHeartbeatThread, 128);
static THD_FUNCTION(heartbeatThread, arg) {

  (void)arg;
  chRegSetThreadName("heartbeat");

  while(TRUE) {
    palSetPad(GPIOB, GPIOB_HEARTBEAT_LED);
    chThdSleepMilliseconds(500);
    palClearPad(GPIOB, GPIOB_HEARTBEAT_LED);
    chThdSleepMilliseconds(500);
  }
}

/*
 * Application entry point.
 */
int main(void) {

  /*
   * System initializations.
   * - HAL initialization, this also initializes the configured device drivers
   *   and performs the board-specific initializations.
   * - Kernel initialization, the main() function becomes a thread and the
   *   RTOS is active.
   */
  halInit();
  chSysInit();

  chThdCreateStatic(waHeartbeatThread, sizeof(waHeartbeatThread), NORMALPRIO, heartbeatThread, NULL);

  /*
   * Motor initialization.
   */
  motorInit();

  /*
   * Battery initialization.
   */
  //batteryInit();

  /*
   * Flight Controller initialization.
   */
  flightControlInit();

  while(TRUE) {
    chThdSleepMilliseconds(500);
  }

}


text:
package com.git.huanghaifeng.java.kafka.streams.pageview;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.kafka.common.errors.SerializationException;
import org.apache.kafka.common.serialization.Serializer;

import java.util.Map;

public class JsonPOJOSerializer<T> implements Serializer<T> {
	private final ObjectMapper objectMapper = new ObjectMapper();

	private Class<T> tClass;

	/**
	 * Default constructor needed by Kafka
	 */
	public JsonPOJOSerializer() {

	}

	@SuppressWarnings("unchecked")
	@Override
	public void configure(Map<String, ?> props, boolean isKey) {
		tClass = (Class<T>) props.get("JsonPOJOClass");
	}

	@Override
	public byte[] serialize(String topic, T data) {
		if (data == null)
			return null;

		try {
			return objectMapper.writeValueAsBytes(data);
		} catch (Exception e) {
			throw new SerializationException("Error serializing JSON message", e);
		}
	}

	@Override
	public void close() {
	}

}


text:
package org.onosproject.pcepio;

import org.junit.Test;
import org.onosproject.pcepio.types.PathKeySubObject;

import com.google.common.testing.EqualsTester;

/**
 * Test of the PathKeySubObject.
 */
public class PathKeySubObjectTest {

    private final PathKeySubObject tlv1 = new PathKeySubObject((short) 0x0A, 0x0A);
    private final PathKeySubObject sameAsTlv1 = PathKeySubObject.of((short) 0x0A, 0x0A);
    private final PathKeySubObject tlv2 = new PathKeySubObject((short) 0x0B, 0x0B);

    @Test
    public void basics() {
        new EqualsTester()
        .addEqualityGroup(tlv1, sameAsTlv1)
        .addEqualityGroup(tlv2)
        .testEquals();
    }
}


text:
export default {
    "ajs.datepicker.localisations.day-names.sunday": "Duminică",
    "ajs.datepicker.localisations.day-names.monday": "Luni",
    "ajs.datepicker.localisations.day-names.tuesday": "Marţi",
    "ajs.datepicker.localisations.day-names.wednesday": "Miercuri",
    "ajs.datepicker.localisations.day-names.thursday": "Joi",
    "ajs.datepicker.localisations.day-names.friday": "Vineri",
    "ajs.datepicker.localisations.day-names.saturday": "Sâmbătă",
    "ajs.datepicker.localisations.day-names-min.sunday": "Dum",
    "ajs.datepicker.localisations.day-names-min.monday": "Lun",
    "ajs.datepicker.localisations.day-names-min.tuesday": "Mar",
    "ajs.datepicker.localisations.day-names-min.wednesday": "Mie",
    "ajs.datepicker.localisations.day-names-min.thursday": "Joi",
    "ajs.datepicker.localisations.day-names-min.friday": "Vin",
    "ajs.datepicker.localisations.day-names-min.saturday": "Sâm",
    "ajs.datepicker.localisations.first-day": 1,
    "ajs.datepicker.localisations.is-RTL": false,
    "ajs.datepicker.localisations.month-names.january": "Ianuarie",
    "ajs.datepicker.localisations.month-names.february": "Februarie",
    "ajs.datepicker.localisations.month-names.march": "Martie",
    "ajs.datepicker.localisations.month-names.april": "Aprilie",
    "ajs.datepicker.localisations.month-names.may": "Mai",
    "ajs.datepicker.localisations.month-names.june": "Iunie",
    "ajs.datepicker.localisations.month-names.july": "Iulie",
    "ajs.datepicker.localisations.month-names.august": "August",
    "ajs.datepicker.localisations.month-names.september": "Septembrie",
    "ajs.datepicker.localisations.month-names.october": "Octombrie",
    "ajs.datepicker.localisations.month-names.november": "Noiembrie",
    "ajs.datepicker.localisations.month-names.december": "Decembrie",
    "ajs.datepicker.localisations.show-month-after-year": false,
    "ajs.datepicker.localisations.year-suffix": null
}


text:
//======================================================================================
// Copyright 5AM Solutions Inc, Yale University
//
// Distributed under the OSI-approved BSD 3-Clause License.
// See http://ncip.github.com/caarray/LICENSE.txt for details.
//======================================================================================
package caarray.client.test.suite;

import gov.nih.nci.caarray.external.v1_0.AbstractCaArrayEntity;
import gov.nih.nci.caarray.external.v1_0.experiment.Person;

import java.io.File;
import java.util.List;

import caarray.client.test.ApiFacade;
import caarray.client.test.TestProperties;
import caarray.client.test.TestResult;
import caarray.client.test.search.ExampleSearch;
import caarray.client.test.search.PersonSearch;

/**
 * @author vaughng
 * Jul 10, 2009
 */
public class PersonTestSuite extends SearchByExampleTestSuite
{
    private static final String CONFIG_FILE = TestProperties.CONFIG_DIR
    + File.separator + "Person.csv";

    private static final String LAST_NAME = "Last Name";

    private static final String[] COLUMN_HEADERS = new String[] { TEST_CASE,
        API, LAST_NAME, EXPECTED_RESULTS, MIN_RESULTS };

    /**
     * @param apiFacade
     */
    public PersonTestSuite(ApiFacade apiFacade)
    {
        super(apiFacade);
    }

    /* (non-Javadoc)
     * @see caarray.client.test.suite.SearchByExampleTestSuite#evaluateResults(java.util.List, caarray.client.test.search.ExampleSearch, caarray.client.test.TestResult)
     */
    @Override
    protected void evaluateResults(
            List<? extends AbstractCaArrayEntity> resultsList,
            ExampleSearch search, TestResult testResult)
    {
        PersonSearch personSearch = (PersonSearch)search;
        List<Person> personResults = (List<Person>)resultsList;
        int namedResults = 0;
        for (Person person : personResults)
        {
            if (person.getLastName() != null)
                namedResults++;
        }
        if (personSearch.getExpectedResults() != null)
        {
            if (namedResults != personSearch.getExpectedResults())
            {
                String errorMessage = "Failed with unexpected number of results, expected: "
                        + personSearch.getExpectedResults()
                        + ", actual number of results: " + namedResults;
                setTestResultFailure(testResult, personSearch, errorMessage);
            }
            else
            {
                String detail = "Found expected number of results: "
                        + namedResults;
                testResult.addDetail(detail);
            }
        }
        if (personSearch.getMinResults() != null)
        {
            if (namedResults < personSearch.getMinResults())
            {
                String errorMessage = "Failed with unexpected number of results, expected minimum: "
                        + personSearch.getMinResults()
                        + ", actual number of results: " + namedResults;
                setTestResultFailure(testResult, personSearch, errorMessage);
            }
            else
            {
                String detail = "Found expected number of results: "
                        + namedResults;
                testResult.addDetail(detail);
            }
        }
    }

    /* (non-Javadoc)
     * @see caarray.client.test.suite.SearchByExampleTestSuite#getExampleSearch()
     */
    @Override
    protected ExampleSearch getExampleSearch()
    {
        return new PersonSearch();
    }

    /* (non-Javadoc)
     * @see caarray.client.test.suite.SearchByExampleTestSuite#populateAdditionalSearchValues(java.lang.String[], caarray.client.test.search.ExampleSearch)
     */
    @Override
    protected void populateAdditionalSearchValues(String[] input,
            ExampleSearch exampleSearch)
    {
        //NOOP
    }

    /* (non-Javadoc)
     * @see caarray.client.test.suite.SearchByExampleTestSuite#populateSearch(java.lang.String[], caarray.client.test.search.ExampleSearch)
     */
    @Override
    protected void populateSearch(String[] input, ExampleSearch exampleSearch)
    {
        PersonSearch search = (PersonSearch)exampleSearch;
        Person example = new Person();
        if (headerIndexMap.get(API) < input.length
                && !input[headerIndexMap.get(API)].equals(""))
        {
            search.setApi(input[headerIndexMap.get(API)].trim());
        }

        if (headerIndexMap.get(LAST_NAME) < input.length && !input[headerIndexMap.get(LAST_NAME)].equals(""))
        {
            example.setLastName(input[headerIndexMap.get(LAST_NAME)].trim());
        }

        search.setPerson(example);
        if (headerIndexMap.get(TEST_CASE) < input.length
                && !input[headerIndexMap.get(TEST_CASE)].equals(""))
            search.setTestCase(Float.parseFloat(input[headerIndexMap.get(TEST_CASE)]
                    .trim()));
        if (headerIndexMap.get(EXPECTED_RESULTS) < input.length
                && !input[headerIndexMap.get(EXPECTED_RESULTS)].equals(""))
            search.setExpectedResults(Integer
                    .parseInt(input[headerIndexMap.get(EXPECTED_RESULTS)].trim()));
        if (headerIndexMap.get(MIN_RESULTS) < input.length
                && !input[headerIndexMap.get(MIN_RESULTS)].equals(""))
            search.setMinResults(Integer.parseInt((input[headerIndexMap.get(MIN_RESULTS)].trim())));

    }

    /* (non-Javadoc)
     * @see caarray.client.test.suite.ConfigurableTestSuite#getColumnHeaders()
     */
    @Override
    protected String[] getColumnHeaders()
    {
        return COLUMN_HEADERS;
    }

    /* (non-Javadoc)
     * @see caarray.client.test.suite.ConfigurableTestSuite#getConfigFilename()
     */
    @Override
    protected String getConfigFilename()
    {
        return CONFIG_FILE;
    }

    /* (non-Javadoc)
     * @see caarray.client.test.suite.ConfigurableTestSuite#getType()
     */
    @Override
    protected String getType()
    {
        return "Person";
    }

}


text:
<ion-view view-title="TASKS" hide-back-button="true">
	<ion-nav-buttons side="right">

	</ion-nav-buttons>
	<ion-content class="padding">
		<ion-refresher pulling-text="Pull To Refresh" on-refresh="refreshTab()" refreshing-text="Fetching ..." refreshing-icon="ion-loading-b"></ion-refresher>

        <button class="button button-full button-positive" ng-click="createTask()">Create Task</button>

	    	ALL TASKS

	    <ion-list>
		    <ion-item ng-repeat="item in taskList" ng-click="viewTaskDetails(item)" ng-tap="viewTaskDetails(item)">
		    	Task Name: {{ item.taskName }}
		    </ion-item>
	    </ion-list>
    </ion-content>
</ion-view>


text: 2017 - front-end labs Light IT


text:
package org.xcolab.view.widgets.feeds.dataProviders;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.ui.Model;

import org.xcolab.client.activity.IActivityClient;
import org.xcolab.client.activity.pojo.IActivityEntry;
import org.xcolab.client.user.IUserCategoryClient;
import org.xcolab.client.user.IUserClient;
import org.xcolab.client.user.permissions.SystemRole;
import org.xcolab.client.user.pojo.wrapper.MemberCategoryWrapper;
import org.xcolab.client.user.pojo.wrapper.UserWrapper;
import org.xcolab.view.activityentry.ActivityEntryHelper;
import org.xcolab.view.util.entity.ActivityUtil;
import org.xcolab.view.util.pagination.SortFilterPage;
import org.xcolab.view.widgets.feeds.FeedType;
import org.xcolab.view.widgets.feeds.FeedTypeDataProvider;
import org.xcolab.view.widgets.feeds.FeedsPreferences;
import org.xcolab.view.widgets.feeds.wrappers.SocialActivityWrapper;

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

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Component
public class ActivitiesFeedDataProvider implements FeedTypeDataProvider {

    private final ActivityEntryHelper activityEntryHelper;
    private final IActivityClient activityClient;

    private final IUserClient userClient;

    private final IUserCategoryClient userCategoryClient;

    @Autowired
    public ActivitiesFeedDataProvider(ActivityEntryHelper activityEntryHelper,
            IUserClient userClient, IActivityClient activityClient,
            IUserCategoryClient userCategoryClient) {
        this.activityEntryHelper = activityEntryHelper;
        this.userClient = userClient;
        this.activityClient = activityClient;
        this.userCategoryClient = userCategoryClient;
    }

    @Override
    public void populateModel(HttpServletRequest request, HttpServletResponse response,
            SortFilterPage sortFilterPage, FeedsPreferences feedsPreferences, Model model) {

        Map<String, String[]> parameters = request.getParameterMap();
        final int pageSize = feedsPreferences.getFeedSize();
        String userIdStr = null;
        if (parameters.containsKey("userId")) {
            userIdStr = parameters.get("userId")[0];
        } else if (request.getParameter("userId") != null) {
            userIdStr = request.getParameter("userId");
        }
        long filterUserId = 0L;
        if (userIdStr != null) {
            try {
                filterUserId = Long.parseLong(userIdStr);
                UserWrapper filterUser = userClient.getMember(filterUserId);
                model.addAttribute("filterUserId", filterUserId);
                model.addAttribute("filterUser", filterUser);
            } catch (Throwable ignored) {
            }
        }
        HashMap<Long, Long> idsToExclude = new HashMap<>();
        if (feedsPreferences.getRemoveAdmin()) {//STAFF
            final MemberCategoryWrapper memberCategory =
                    userCategoryClient.getMemberCategory(SystemRole.ADMINISTRATOR.getRoleId());

            List<UserWrapper> adminList = userClient.listMembers(memberCategory.getCategoryName(),
                    null, null, null, true,
                    0, Integer.MAX_VALUE);
            for (UserWrapper m : adminList) {
                idsToExclude.put(m.getId(), m.getId());
            }
        }

        final MemberCategoryWrapper memberCategory =
                userCategoryClient.getMemberCategory(SystemRole.STAFF.getRoleId());

        List<UserWrapper> staffList = userClient
                .listMembers(memberCategory.getCategoryName(), null, null, null, true,
                        0, Integer.MAX_VALUE);
        if (staffList != null && !staffList.isEmpty()) {
            for (UserWrapper m : staffList) {
                idsToExclude.put(m.getId(), m.getId());
            }
        }

        int startRetrievalAt = sortFilterPage.getPage() * pageSize;
        int endRetrievalAt = (sortFilterPage.getPage() + 1) * pageSize;
        List<IActivityEntry> windowedActivities = activityClient.getActivityEntries(
                startRetrievalAt, endRetrievalAt, filterUserId > 0 ? filterUserId : null,
                new ArrayList<>(idsToExclude.keySet()));

        List<SocialActivityWrapper> activities = new ArrayList<>();
        for (IActivityEntry activity : windowedActivities) {
            if (activities.size() >= feedsPreferences.getFeedSize()) {
                break;
            }

            String activityBody = activityEntryHelper.getActivityBody(activity);
            if (activityBody.isEmpty()) {
                continue;
            }

            activities.add(new SocialActivityWrapper(activity, activityBody));
        }

        model.addAttribute("activities", activities);

        final int allActivitiesCount = filterUserId > 0
                ? ActivityUtil.getActivitiesCount(filterUserId)
                : ActivityUtil.getAllActivitiesCount();

        model.addAttribute("isLastPage",
                ((pageSize * (sortFilterPage.getPage() + 1)) >= allActivitiesCount));
    }

    @Override
    public String getViewName() {
        return "feedswidget/activities";
    }

    @Override
    public FeedType getFeedType() {
        return FeedType.ACTIVITIES;
    }
}


text:
{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />

{$main_title}

	<input type="button" class="button" value="{%ADD}" onclick="add();" />
	<input type="button" class="button" value="{%FOREVERDEL}" onclick="foreverdel();" />

{$page}

<include file="Public:footer" />


text:
<?xml version="1.0" encoding="UTF-8"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.netthreads.transportation</groupId>
	<artifactId>transportation-json-glasgow</artifactId>
	<version>1.0.0-SNAPSHOT</version>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<build>
		<resources>
			<resource>
				<directory>src/main/java</directory>
				<includes>
					<include>**/*.java</include>
					<include>**/*.gwt.xml</include>
				</includes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-eclipse-plugin</artifactId>
				<version>2.8</version>
				<configuration>
					<downloadSources>true</downloadSources>
					<downloadJavadocs>true</downloadJavadocs>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
		</plugins>

	</build>

	<dependencies>
		<dependency>
			<groupId>org.codehaus.jackson</groupId>
			<artifactId>jackson-core-asl</artifactId>
			<version>1.9.13</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>


text:
import Ember from 'ember';
import d3 from 'npm:d3';
import d3lper from 'khartis/utils/d3lper';
import Struct from './struct';
import Projection from './projection';
import Basemap from './basemap';
import ImportedBasemap from './imported-basemap';
import LegendLayout from './legend/legend-layout';
import DrawingFactory from './drawing/factory';

const MARGIN_DEFAULTS = {t: 30, b: 30, l: 16, r: 16};

var Margin = Struct.extend({

  manual: false,
  l: MARGIN_DEFAULTS.l,
  r: MARGIN_DEFAULTS.r,
  t: MARGIN_DEFAULTS.t,
  b: MARGIN_DEFAULTS.b,

  h: function() {
    return this.get('l') + this.get('r');
  }.property('l', 'r'),

  v: function() {
    return this.get('t') + this.get('b');
  }.property('t', 'b'),

  getInitialValue(k) {
    return MARGIN_DEFAULTS[k];
  },

  resetValue(k) {
    this.set(k, MARGIN_DEFAULTS[k]);
  },

  deferredChange: Ember.debouncedObserver(
    'l', 'r', 't', 'b', 'h', 'v',
    function() {
      this.notifyDefferedChange();
    },
    50),

  export() {
    return this._super({
      manual: this.get('manual'),
      l: this.get('l'),
      r: this.get('r'),
      t: this.get('t'),
      b: this.get('b')
    });
  }

});

Margin.reopenClass({

  restore(json, refs = {}) {
      let o = this._super(json, refs);
      o.setProperties({
          manual: json.manual,
          l: json.l,
          r: json.r,
          t: json.t,
          b: json.b
      });
      return o;
  }

});

var GraphLayout = Struct.extend({

  basemap: null,

	stroke: "#ffffff",
	strokeWidth: 1,

	backgroundColor: "#ffffff",
  backmapColor: "#dad5cc",

  // backlandsColor: function() {
  //   return "#e3e0d9";
  // }.property('backmapColor'),

  showBorders: true,

	showParallel: true,
  parallelColor: "#d9d9d9",

  showGrid: true,
  gridColor: "#d9d9d9",

	showSphere: true,
	sphereColor: "#d9d9d9",

	showSea: false,
	seaColor: "#f2f6f9",

  showLegend: null,
  legendLayout: null,

  drawings: null,

	autoCenter: false,

  canDisplayGrid: function() {
    return !this.get('projection.isComposite') && this.get('basemap.type') !== "imported";
  }.property('projection', 'projection.isComposite'),

  canDisplaySphere: function() {
    return !this.get('projection.isComposite') && this.get('basemap.type') !== "imported";
  }.property('projection', 'projection.isComposite'),

	canDisplaySea: function() {
    return !this.get('projection.isComposite') && this.get('basemap.type') !== "imported";
  }.property('projection', 'projection.isComposite'),

	canDisplayParallel: function() {
    return !this.get('projection.isComposite') && this.get('basemap.type') !== "imported";
  }.property('projection', 'projection.isComposite'),

  tx: 0,
  ty: 0,
	width: 900,
	height: 700,
	margin: null,
  zoom: 1,
  precision: 2.5,

  projection: null,

  init() {
    this._super();
    if (!this.get('legendLayout')) {
      this.set('legendLayout', LegendLayout.create());
    }
    if (!this.get('drawings')) {
      this.set('drawings', Em.A());
    }
  },

	hOffset: function(screenWidth) {
		return (screenWidth - this.get('width')) / 2;
	},

	vOffset: function(screenHeight) {
		return (screenHeight - this.get('height')) / 2;
	},

  setBasemap(basemap) {
    return this.set('basemap', basemap)
      .setup()
      .then( res => {
        this.set('projection', basemap.assumeProjection());
      });
  },

  export() {
    return this._super({
      basemap: this.get('basemap') ? this.get('basemap').export() : null,
      projection: this.get('projection') ? this.get('projection').export() : null,
      margin: this.get('margin') ? this.get('margin').export() : null,
      backgroundColor: this.get('backgroundColor'),
      backmapColor: this.get('backmapColor'),
      gridColor: this.get('gridColor'),
			sphereColor: this.get('sphereColor'),
			seaColor: this.get('seaColor'),
      stroke: this.get('stroke'),
      tx: this.get('tx'),
      ty: this.get('ty'),
      width: this.get('width'),
      height: this.get('height'),
      zoom: this.get('zoom'),
      precision: this.get('precision'),
      showBorders: this.get('showBorders'),
      showGrid: this.get('showGrid'),
      showLegend: this.get('showLegend'),
      legendStacking : this.get('legendStacking'),
      legendTx: this.get('legendTx'),
      legendTy: this.get('legendTy'),
      legendOpacity: this.get('legendOpacity'),
      legendLayout: this.get('legendLayout').export(),
      drawings: this.get('drawings').map( d => d.export() )
    });
  },

  restoreLegend(json, refs) {
    if (json.legendLayout) {
      this.set('legendLayout', LegendLayout.restore(json.legendLayout, refs));
    }
  }

});

GraphLayout.reopenClass({

  createDefault() {
    let o = GraphLayout.create({margin: Margin.create()});
    return o;
  },

  restoreBasemap(json) {
    if (json) {
      return (json.type === "imported" ? ImportedBasemap : Basemap).restore(json);
    }
    return null;
  },

  restore(json, refs = {}) {
      let o = this._super(json, refs, {
        basemap: GraphLayout.restoreBasemap(json.basemap),
        backgroundColor: json.backgroundColor,
        backmapColor: json.backmapColor,
        gridColor: json.gridColor,
				sphereColor: json.sphereColor,
				seaColor: json.seaColor,
        stroke: json.stroke,
        projection: json.projection ? Projection.restore(json.projection) : null,
        margin: json.margin ? Margin.restore(json.margin) : null,
        width: json.width,
        tx: json.tx,
        ty: json.ty,
        height: json.height,
        zoom: json.zoom,
        precision: json.precision,
        showBorders: json.showBorders,
        showGrid: json.showGrid,
        showLegend: json.showLegend,
        drawings: (json.drawings && json.drawings.map( d => DrawingFactory.restoreInstance(d, refs) )) || null
      });
      return o;
  }

});

export default GraphLayout;


text:
#include "h2o.h"

struct st_headers_filter_t {
    h2o_filter_t super;
    h2o_headers_command_t *cmds;
};

static h2o_header_t *find_header(h2o_headers_t *headers, h2o_headers_command_t *cmd)
{
    size_t index;

    if (h2o_iovec_is_token(cmd->name)) {
        index = h2o_find_header(headers, (void *)cmd->name, SIZE_MAX);
    } else {
        index = h2o_find_header_by_str(headers, cmd->name->base, cmd->name->len, SIZE_MAX);
    }
    if (index == SIZE_MAX)
        return NULL;
    return headers->entries + index;
}

static void remove_header(h2o_headers_t *headers, h2o_headers_command_t *cmd)
{
    size_t src, dst = 0;

    for (src = 0; src != headers->size; ++src) {
        if (h2o_iovec_is_token(cmd->name)) {
            if (headers->entries[src].name == cmd->name)
                continue;
        } else {
            if (h2o_memis(headers->entries[src].name->base, headers->entries[src].name->len, cmd->name->base, cmd->name->len))
                continue;
        }
        /* not matched */
        if (dst != src)
            headers->entries[dst] = headers->entries[src];
        ++dst;
    }
    headers->size = dst;
}

static void rewrite_headers(h2o_mem_pool_t *pool, h2o_headers_t *headers, h2o_headers_command_t *cmd)
{
    h2o_header_t *target;

    switch (cmd->cmd) {
    case H2O_HEADERS_CMD_ADD:
        goto AddHeader;
    case H2O_HEADERS_CMD_APPEND:
        if ((target = find_header(headers, cmd)) == NULL)
            goto AddHeader;
        goto AppendToken;
    case H2O_HEADERS_CMD_MERGE:
        if ((target = find_header(headers, cmd)) == NULL)
            goto AddHeader;
        if (h2o_contains_token(target->value.base, target->value.len, cmd->value.base, cmd->value.len, ','))
            return;
        goto AppendToken;
    case H2O_HEADERS_CMD_SET:
        remove_header(headers, cmd);
        goto AddHeader;
    case H2O_HEADERS_CMD_SETIFEMPTY:
        if (find_header(headers, cmd) != NULL)
            return;
        goto AddHeader;
    case H2O_HEADERS_CMD_UNSET:
        remove_header(headers, cmd);
        return;
    }

    assert(!"FIXME");
    return;

AddHeader:
    if (h2o_iovec_is_token(cmd->name)) {
        h2o_add_header(pool, headers, (void *)cmd->name, cmd->value.base, cmd->value.len);
    } else {
        h2o_add_header_by_str(pool, headers, cmd->name->base, cmd->name->len, 0, cmd->value.base, cmd->value.len);
    }
    return;

AppendToken:
    if (target->value.len != 0) {
        h2o_iovec_t v;
        v.len = target->value.len + 2 + cmd->value.len;
        v.base = h2o_mem_alloc_pool(pool, v.len);
        memcpy(v.base, target->value.base, target->value.len);
        v.base[target->value.len] = ',';
        v.base[target->value.len + 1] = ' ';
        memcpy(v.base + target->value.len + 2, cmd->value.base, cmd->value.len);
        target->value = v;
    } else {
        target->value = cmd->value;
    }
    return;
}

static void on_setup_ostream(h2o_filter_t *_self, h2o_req_t *req, h2o_ostream_t **slot)
{
    struct st_headers_filter_t *self = (void *)_self;
    h2o_headers_command_t *cmd;

    for (cmd = self->cmds; cmd->cmd != H2O_HEADERS_CMD_NULL; ++cmd)
        rewrite_headers(&req->pool, &req->res.headers, cmd);

    h2o_setup_next_ostream(&self->super, req, slot);
}

void h2o_headers_register(h2o_pathconf_t *pathconf, h2o_headers_command_t *cmds)
{
    struct st_headers_filter_t *self = (void *)h2o_create_filter(pathconf, sizeof(*self));

    self->super.on_setup_ostream = on_setup_ostream;
    self->cmds = cmds;
}

int h2o_headers_is_prohibited_name(const h2o_token_t *token)
{
    /* prohibit connection-specific headers */
    if (token == H2O_TOKEN_CONNECTION || token == H2O_TOKEN_CONTENT_LENGTH || token == H2O_TOKEN_TRANSFER_ENCODING)
        return 1;
    /* prohibit headers added at protocol layer */
    if (token == H2O_TOKEN_DATE || token == H2O_TOKEN_SERVER)
        return 1;
    /* all others are permitted */
    return 0;
}


text:
package com.amazonaws.services.redshiftserverless.model;

import javax.annotation.Generated;

/**
 *
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum UsageLimitPeriod {

    Daily("daily"),
    Weekly("weekly"),
    Monthly("monthly");

    private String value;

    private UsageLimitPeriod(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return UsageLimitPeriod corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static UsageLimitPeriod fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (UsageLimitPeriod enumEntry : UsageLimitPeriod.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text: SELECT coalesce(min(rowid),999) FROM t3;


text:
package com.google.errorprone.bugpatterns.time;

import static com.google.errorprone.BugPattern.SeverityLevel.WARNING;
import static com.google.errorprone.matchers.Matchers.allOf;
import static com.google.errorprone.matchers.Matchers.anyOf;
import static com.google.errorprone.matchers.Matchers.instanceMethod;
import static com.google.errorprone.matchers.Matchers.not;
import static com.google.errorprone.matchers.Matchers.packageStartsWith;

import com.google.errorprone.BugPattern;
import com.google.errorprone.VisitorState;
import com.google.errorprone.bugpatterns.BugChecker;
import com.google.errorprone.bugpatterns.BugChecker.MethodInvocationTreeMatcher;
import com.google.errorprone.fixes.SuggestedFix;
import com.google.errorprone.fixes.SuggestedFixes;
import com.google.errorprone.matchers.Description;
import com.google.errorprone.matchers.Matcher;
import com.google.errorprone.matchers.method.MethodMatchers;
import com.google.errorprone.util.ASTHelpers;
import com.sun.source.tree.ExpressionTree;
import com.sun.source.tree.MethodInvocationTree;

/**
 * Check for calls to JodaTime's {@code type.withDurationAdded(long, int)} where {@code <type> =
 * {Duration,Instant,DateTime}}.
 */
@BugPattern(
    name = "JodaWithDurationAddedLong",
    summary =
        "Use of JodaTime's type.withDurationAdded(long, int) (where <type> = "
            + "{Duration,Instant,DateTime}). Please use "
            + "type.withDurationAdded(Duration.millis(long), int) instead.",
    explanation =
        "JodaTime's type.withDurationAdded(long, int) is often a source of bugs "
            + "because the units of the parameters are ambiguous. Please use "
            + "type.withDurationAdded(Duration.millis(long), int) instead.",
    severity = WARNING)
public final class JodaWithDurationAddedLong extends BugChecker
    implements MethodInvocationTreeMatcher {

  private static final Matcher<ExpressionTree> MATCHER =
      allOf(
          anyOf(
              instanceMethod()
                  .onExactClass("org.joda.time.DateTime")
                  .named("withDurationAdded")
                  .withParameters("long", "int"),
              instanceMethod()
                  .onExactClass("org.joda.time.Duration")
                  .named("withDurationAdded")
                  .withParameters("long", "int"),
              instanceMethod()
                  .onExactClass("org.joda.time.Instant")
                  .named("withDurationAdded")
                  .withParameters("long", "int")),
          // Allow usage by JodaTime itself
          not(packageStartsWith("org.joda.time")));

  private static final Matcher<ExpressionTree> DURATION_GET_MILLIS_MATCHER =
      MethodMatchers.instanceMethod()
          .onDescendantOf("org.joda.time.ReadableDuration")
          .named("getMillis");

  @Override
  public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) {
    if (!MATCHER.matches(tree, state)) {
      return Description.NO_MATCH;
    }

    String receiver = state.getSourceForNode(ASTHelpers.getReceiver(tree));

    // Get the constant scalar, if there is one.
    Integer scalar = ASTHelpers.constValue(tree.getArguments().get(1), Integer.class);

    SuggestedFix.Builder builder = SuggestedFix.builder();

    if (Integer.valueOf(0).equals(scalar)) {
      // This is adding zero times a duration to the receiver: we can replace this with just the
      // receiver.
      builder.replace(tree, receiver);
    } else {
      ExpressionTree firstArgumentTree = tree.getArguments().get(0);
      String firstArgumentReplacement;
      if (DURATION_GET_MILLIS_MATCHER.matches(firstArgumentTree, state)) {
        // This is passing {@code someDuration.getMillis()} as the parameter. we can replace this
        // with {@code someDuration}.
        firstArgumentReplacement =
            state.getSourceForNode(ASTHelpers.getReceiver(firstArgumentTree));
      } else {
        // Wrap the long as a Duration.
        firstArgumentReplacement =
            SuggestedFixes.qualifyType(state, builder, "org.joda.time.Duration")
                + ".millis("
                + state.getSourceForNode(firstArgumentTree)
                + ")";
      }

      if (Integer.valueOf(1).equals(scalar)) {
        // Use plus instead of adding 1 times the duration.
        builder.replace(tree, receiver + ".plus(" + firstArgumentReplacement + ")");
      } else if (Integer.valueOf(-1).equals(scalar)) {
        // Use minus instead of adding -1 times the duration.
        builder.replace(tree, receiver + ".minus(" + firstArgumentReplacement + ")");
      } else {
        builder.replace(firstArgumentTree, firstArgumentReplacement);
      }
    }
    return describeMatch(tree, builder.build());
  }
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for C:\wamp\www\MG\Symf\Symfony\src/Ens/JobeetBundle</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="../../css/bootstrap.min.css" rel="stylesheet">
  <link href="../../css/style.css" rel="stylesheet">

C:\wamp\www\MG\Symf\Symfony\src

Ens

JobeetBundle

(Dashboard)

Code Coverage

Lines

Functions and Methods

Classes and Traits

      Total

           34.43% covered (danger)

34.43%

136 / 395

           35.29% covered (danger)

35.29%

36 / 102

           37.50% covered (danger)

37.50%

6 / 16

       Controller

           0.00% covered (danger)

0.00%

0 / 136

           0.00% covered (danger)

0.00%

0 / 16

           0.00% covered (danger)

0.00%

0 / 4

       DataFixtures

           100.00% covered (success)

100.00%

70 / 70

           100.00% covered (success)

100.00%

4 / 4

           100.00% covered (success)

100.00%

2 / 2

       DependencyInjection

           100.00% covered (success)

100.00%

8 / 8

           100.00% covered (success)

100.00%

2 / 2

           100.00% covered (success)

100.00%

2 / 2

       Entity

           47.01% covered (danger)

47.01%

55 / 117

           39.73% covered (danger)

39.73%

29 / 73

           0.00% covered (danger)

0.00%

0 / 3

       Form

           0.00% covered (danger)

0.00%

0 / 28

           0.00% covered (danger)

0.00%

0 / 3

           0.00% covered (danger)

0.00%

0 / 1

       Repository

           0.00% covered (danger)

0.00%

0 / 33

           0.00% covered (danger)

0.00%

0 / 3

           0.00% covered (danger)

0.00%

0 / 2

       Utils

           100.00% covered (success)

100.00%

3 / 3

           100.00% covered (success)

100.00%

1 / 1

           100.00% covered (success)

100.00%

1 / 1

       EnsJobeetBundle.php

           100.00% covered (success)

100.00%

1 / 1

Legend

     Low: 0% to 50%
     Medium: 50% to 90%
     High: 90% to 100%

     Generated by PHP_CodeCoverage 2.0.15 using PHP 5.5.12 and PHPUnit 4.5.1 at Tue Mar 31 11:56:46 CEST 2015.


text:
Download it from the site in a zip or install via package manager

## Create your config file

mongod.conf:
```
processManagement:
   fork: true
net:
   bindIp: 127.0.0.1
   port: 27017
storage:
   dbPath: ./data
systemLog:
   destination: file
   path: ./log/mongod.log
   logAppend: true
storage:
   journal:
      enabled: true
```
Start up the server and you are good to go

## Standalone from file download

use the following script to make it run

```
#!/bin/bash
PIDF="processid"
start () {
  ./bin/mongod --config mongod.conf
}
stop () {
  ./bin/mongod --config mongod.conf --shutdown
}
if [ "$1" == "start" ]; then
    start
elif [ "$1" == "stop" ]; then
    stop
elif [ "$1" == "restart" ]; then
    stop
    start
fi
```


text:
using SitecoreCognitiveServices.Foundation.IBMSDK.LanguageTranslator.Models;

namespace SitecoreCognitiveServices.Foundation.IBMSDK.LanguageTranslator
{
    public interface ILanguageTranslatorRepository
    {
        /// <summary>
        /// Translates the input text from the source language to the target language.
        /// </summary>
        /// <param name="body">The translate request containing the text, with optional source, target, and model_id.</param>
        /// <returns><see cref="TranslationResult" />TranslationResult</returns>
        TranslationResult Translate(TranslateRequest body);
        /// <summary>
        /// Identifies the language of the input text.
        /// </summary>
        /// <param name="text">Input text in UTF-8 format.</param>
        /// <returns><see cref="IdentifiedLanguages" />IdentifiedLanguages</returns>
        IdentifiedLanguages Identify(string text);

        /// <summary>
        /// Lists all languages that can be identified by the API. Lists all languages that the service can identify. Returns the two-letter code (for example, `en` for English or `es` for Spanish) and name of each language.
        /// </summary>
        /// <returns><see cref="IdentifiableLanguages" />IdentifiableLanguages</returns>
        IdentifiableLanguages ListIdentifiableLanguages();
        /// <summary>
        /// Uploads a TMX glossary file on top of a domain to customize a translation model.
        /// </summary>
        /// <param name="baseModelId">Specifies the domain model that is used as the base for the training. To see current supported domain models, use the GET /v2/models parameter.</param>
        /// <param name="name">The model name. Valid characters are letters, numbers, -, and _. No spaces. (optional)</param>
        /// <param name="forcedGlossary">A TMX file with your customizations. The customizations in the file completely overwrite the domain data translation, including high frequency or high confidence phrase translations. You can upload only one glossary with a file size less than 10 MB per call. (optional)</param>
        /// <param name="parallelCorpus">A TMX file that contains entries that are treated as a parallel corpus instead of a glossary. (optional)</param>
        /// <param name="monolingualCorpus">A UTF-8 encoded plain text file that is used to customize the target language model. (optional)</param>
        /// <returns><see cref="TranslationModel" />TranslationModel</returns>
        TranslationModel CreateModel(string baseModelId, string name = null, System.IO.Stream forcedGlossary = null, System.IO.Stream parallelCorpus = null, System.IO.Stream monolingualCorpus = null);

        /// <summary>
        /// Deletes a custom translation model.
        /// </summary>
        /// <param name="modelId">The model identifier.</param>
        /// <returns><see cref="DeleteModelResult" />DeleteModelResult</returns>
        DeleteModelResult DeleteModel(string modelId);

        /// <summary>
        /// Get information about the given translation model, including training status.
        /// </summary>
        /// <param name="modelId">Model ID to use.</param>
        /// <returns><see cref="TranslationModel" />TranslationModel</returns>
        TranslationModel GetModel(string modelId);

        /// <summary>
        /// Lists available standard and custom models by source or target language.
        /// </summary>
        /// <param name="source">Filter models by source language. (optional)</param>
        /// <param name="target">Filter models by target language. (optional)</param>
        /// <param name="defaultModels">Valid values are leaving it unset, `true`, and `false`. When `true`, it filters models to return the defaultModels model or models. When `false`, it returns the non-defaultModels model or models. If not set, it returns all models, defaultModels and non-defaultModels. (optional)</param>
        /// <returns><see cref="TranslationModels" />TranslationModels</returns>
        TranslationModels ListModels(string source = null, string target = null, bool? defaultModels = null);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace SampleMVCSolution
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Exchanges.Range",
                url: "Exchanges/Range/{startDate}/{endDate}/{targetCurrencyCode}",
                defaults: new
                {
                    controller = "Exchanges",
                    action = "Range",
                }
            );

            routes.MapRoute(
                name: "Exchanges.Range.Root",
                url: "Exchanges/Range",
                defaults: new
                {
                    controller = "Exchanges",
                    action = "RangeRoot",
                }
            );

            routes.MapRoute(
                name: "Exchanges.Default",
                url: "Exchanges/{action}/{date}/{targetCurrencyCode}",
                defaults: new {
                    controller = "Exchanges",
                    action = "Details",
                }
            );

            routes.MapRoute(
                name: "Exchanges.Action.Root",
                url: "Exchanges/{action}",
                defaults: new
                {
                    controller = "Exchanges",
                }
            );

            routes.MapRoute(
                name: "Exchanges.Root",
                url: "Exchanges",
                defaults: new
                {
                    controller = "Exchanges",
                    action = "RangeRoot",
                }
            );

            routes.MapRoute(
                name: "Default",
                url: "",
                defaults: new { controller = "Redirect", action = "Redirect", url = "Exchanges/" }
            );

        }
    }
}


text:
A Font Bakery Profile (an instance of the type `fontbakery.checkrunner.Profile`) is a container for a set of checks to be run on font files.

A profile usually lives inside a Python module: one module contains one profile. Font Bakery comes with a number of profiles, located in [`fontbakery.profiles.*`](https://github.com/googlefonts/fontbakery/blob/master/Lib/fontbakery/profiles), which can be used directly, but you can also create a custom profile. A custom profile can include your own checks, written in Python, and/or checks included from other profiles. Writing a custom Font Bakery profile can be a good way to either ensure the quality of a **single font project**, or for a **font foundry** or **maintainer of a font library** to establish comprehensive quality standards and quality monitoring.

Font Bakery comes with a set of checks that can be included into such a custom profile according to the requirements of the author. These checks are mainly organized in profile modules named after OpenType tables, and can be found at [`fontbakery.profiles.*`](https://github.com/googlefonts/fontbakery/blob/master/Lib/fontbakery/profiles).

When you decide to include a profile or a single check from a Font Bakery profile into your own custom profile, you'll end up reading and reviewing the profile's Python code. We welcome questions, remarks, improvements, additions, **more documentation** and other contributions. Please use our [issue tracker](https://github.com/googlefonts/fontbakery/issues) to contact us or send **pull requests**.

[`fontbakery.profiles.googlefonts`](https://github.com/googlefonts/fontbakery/blob/master/Lib/fontbakery/profiles/googlefonts.py) is a custom profile and can be an interesting piece of code to inspect for some inspiration.

## From automatic discovery to full control

To create your own profile we added tools that reduce boilerplate code to a minimum. These tools are fully optional. But it is possible to use them if you need more control over the creation of a profile. This automatic discovery can be enabled or disabled based on the presence (and value) of some special names in the module of the profile:

* `profile`
* `profile_factory`
* `profile_imports`

To get or create a profile from a module, the function `get_module_profile(module)` in `fontbakery.checkrunner` is used:

> If the name `module.profile` is present the value of that is returned.
> Otherwise, if the name `module.profile_factory` is present, a new profile is created using `module.profile_factory` and then `profile.auto_register` is called with the module namespace.

Thus, the presence of the name `profile` disables the automatic use of `profile_factory` plus `profile.auto_register`. But you can consider calling `profile.auto_register(globals())` explicitly yourself near the end of your profile module or you can register the profile contents yourself.

```py
# profile = Profile(...)
# globals is a Python builtin
profile.auto_register(globals())
```

### `profile.auto_register(symbol_table, filter_func=None)`

Whether you call `auto_register` yourself or if it is called automatically for you, it is important to understand how it operates: It looks at all values of its `symbol_table` argument (a namespace dict as returned from `globals()` or `module.__dict__`) and at all values imported using `profile_imports` (described below) if present in `symbol_table`.

If one of the items is an instance of one of `FontBakeryCheck`, `FontBakeryCondition`, `FontBakeryExpectedValue` the respective (public) interface methods: `profile.register_check`, `profile.profile` and `profile.register_expected_value` are called.

If an item is a python module (an instance of `types.ModuleType`) it is tried to get a profile from that module using `sub_profile = get_module_profile(item)`. This, in many cases, invokes `get_module_profile` recursively, which itself calls `auto_register` when indicated (see above). That new sub-profile is then included into the current auto-registering profile using `profile.merge_profile(sub_profile)` (see below).

When you are calling `profile.auto_register` explicitly yourself, you can also use the `filter_func` argument. This gives you finer control over which items are loaded into your profile, you can use it to implement blacklist and/or whitelist filtering.

Here is an example where [`filter_func` was needed due to a namespace clash.](https://github.com/googlefonts/fontbakery/pull/1770#issuecomment-380122216)

If a `filter_func` argument is defined it is called like `filter_func(type, name_or_id, item)` where:

* `type` is one of `"check"`, `"module"`, `"condition"`, `"expected_value"`, `"iterarg"`, `"derived_iterable"`, `"alias"`
* `name_or_id` is the name at which the item will be registered
* * `if type == 'check'`: the `check.id`
* * `if type == 'module'`: the module name (`module.__name__`)
* `item` is the item to be registered

If `filter_func` returns a falsy value for an item, the item will not be registered.

#### `profile_imports` used by `profile.auto_register`

If `profile_imports` is defined in a module namespace, `profile.auto_register` will use it to import modules and attributes of a module into the profile.

You could also use just the regular python `import` statement, which puts imports into the current module namespace and by that makes them discoverable for `profile.auto_register`. However, with that approach static linters like [flake8](https://gitlab.com/pycqa/flake8) and [pylint](https://www.pylint.org/) will complain about unused imports in your profile. That's why we added `profile_imports`.

`profile_imports` must be a list or tuple of import instructions, mimicking the `import module_name` and `from module_name import (identifier, ...)` syntax. *Disclaimer:* It could be more compatible to the python `import` statements, but the algorithm of python is rather complicated (feel free to contribute).

If an import instruction entry in `profile_imports` is a string: just try to import that module.
If an import instruction is not a string it is expected to be a two items iterable (tuple or list): `(module_name, (identifier, ...))`.

* If `module_name` consists of only "dots" (`.`) all `identifers` are imported as module names relative from the current module.
* Otherwise all `identifiers` are treated as attributes of the module with `module_name`, which also can be a relative import when using leading dots.

***NOTE:** one common pitfall is the python syntax for tuple literals. If a tuple has just one item, it still needs a comma after that item to make it a tuple and not just parentheses i.e. `("my_identifier", )`. For that reason the following examples use lists, although tuples, being immutable, are semantically a better fit.*

```py
# profile_imports examples

# Import relative to the current module the
# modules shared_conditions and ufo_sources.
# This includes all of the shared_conditions
# and ufo_sources profile into the
# current profile:
profile_imports = [".shared_conditions", ".ufo_sources"]

# The following is equivalent to the previous statement:
profile_imports = [
    [".", ["shared_conditions", "ufo_sources"]]
]

# Also same as above:
profile_imports = [
    ".shared_conditions",
    [".", [ "ufo_sources"]]
]
```

```py
# Here's an example copied from fontbakery.profiles.googlefonts
# This includes all of our Open Type profiles and some more into
# the googlefonts profile:
profile_imports = (
    ('.', ('general', 'cmap', 'head', 'os2', 'post', 'name',
       'hhea', 'dsig', 'hmtx', 'gpos', 'gdef', 'kern', 'glyf',
       'prep', 'fvar', 'shared_conditions')
    ), # IMPORTANT: this must be a tuple, note the trailing comma
)
```

```py
# Import just certain attributes from modules.
# Also, using absolute import module names:
profile_imports = [
    # like we do in fontbakery.profiles.fvar
    ('fontbakery.profiles.shared_conditions', ('is_variable_font',
            'regular_wght_coord', 'regular_wdth_coord', 'regular_slnt_coord',
            'regular_ital_coord', 'regular_opsz_coord', 'bold_wght_coord')),
    # just as an example: import a check and a dependency/condition of
    # that check from the googlefonts specific profile:
    ('fontbakery.profiles.googlefonts', (
        # "License URL matches License text on name table?"
        'com_google_fonts_check_030',
        # This condition is a dependency of the check above:
        'familyname',
    ))
]
```

### `profile.merge_profile(other_profile, filter_func=None)`

Copy all namespace items from `other_profile` to `profile`.

Namespace items are: `iterargs`, `derived_iterables`, `aliases`, `conditions`, `expected_values`.

Don't change any contents of `other_profile`, it may modify the loaded python module! That means sections are cloned not used directly.

Optional argument `filter_func`: see description in `auto_register`.

### `profile.test_expected_checks(expected_check_ids, exclusive=True)`

Self-test to make a sure profile maintainer is aware of changes in the profile.

Raises `SetupError` if expected check ids are missing in the profile, e.g. removed by an update.
If `exclusive=True` also raises `SetupError` if check ids are in the profile that are not in `expected_check_ids` e.g. newly added by an update.

This is handy if `profile.auto_register` is used and the profile maintainer is looking for a high level of control over the profile contents, especially for a warning when the profile contents have changed after an update of a dependency profile but it also makes profile maintenance a bit more laborious.

### `Section`

An ordered set of checks with a name.

Used to structure checks in a profile. A profile consists of one or more sections.

## Running profiles

```sh
$ fontbakery check-profile fontbakery ./path/to/fonts/*
```

## Writing Profiles: Quick start

A very basic profile with no apparent use but to document profiles, checks and conditions. For real world use cases look into the modules at [`fontbakery.profiles.*`](https://github.com/googlefonts/fontbakery/tree/master/Lib/fontbakery/profiles)

Execute:

```sh
# The example and other custom profiles can be executed with this command:
$ fontbakery check-profile ./path/to/my/example_profile.py ./path/to/fonts/*

# But if you have installed your profile as a package, then use:
$ fontbakery check-profile my_package.example_profile ./path/to/fonts/*
```

Commented line by line:

```py
# We are going to define checks and conditons
from fontbakery.callable import check, condition
# All possible statuses a check can yield, in order of
# severity. The least severe being DEBUG. The most severe
# status emitted by a check is the end result of that check.
# DEBUG can't be an end result, the least severe status
# allowed as a check is PASS.
from fontbakery.checkrunner import (DEBUG, PASS,
               INFO, SKIP, WARN, FAIL, ERROR)
# Used to inform get_module_profile whether and
# how to create a profile. This
# example will create an instance of `FontsProfile`.
# The comment at the end of the line disables flake8
# and pylint to complain about unused imports.
from fontbakery.fonts_profile import profile_factory # NOQA pylint: disable=unused-import

# At this point we already have a importable profile
# It needs some checks though, to be useful.

# profile_imports can be used to mix other profiles
# into this profile. We are only using two profiles
# for this example, containing checks for the accordingly
# named tables
profile_imports = [
    ['fontbakery.profiles', ['cmap', 'head']]
]

# Now we picked some checks from other profiles, but
# what about defining checks ourselves.

# We use `check` as a decorator to wrap an ordinary python
# function into an instance of FontBakeryCheck to prepare
# and mark it as a check.
# A check id is mandatory and must be globally and timely
# unique. See "Naming Things: check-ids" below.
@check(id='de.graphicore.fontbakery/examples/hello')
# This check will run only once as it has no iterable
# arguments. Since it has no arguments at all and because
# checks should be idempotent (and this one is), there's
# not much sense in having it all. It will run once
# and always yield the same result.
def hello_world():
  """Simple "Hello World" example."""
  # The function name of a check is not very important
  # to create it, only to import it from another module
  # or to call it directly, However, a short line of
  # human readable description is mandatory, preferable
  # via the docstring of the check.

  # A status of a check can be `return`ed or `yield`ed
  # depending on the nature of the check, `return`
  # can only return just one status while `yield`
  # makes a generator out of it and it can produce
  # many statuses.
  # A status also always must be a tuple of (Status, Message)
  # For `Message` a string is OK, but for unit testing
  # it turned out that an instance of `fontbakery.message.Message`
  # can be very useful. It can additionally provide
  # a status code, better suited to figure out the exact
  # check result.
  yield PASS, 'Hello World'

@check(id='de.graphicore.fontbakery/examples/has-R')
# This check will run once for each item in `fonts`.
# This is achieved via the iterag definition of font: fonts
def has_cap_r_in_name(font):
  """Filename contains an "R"."""
  # This check is not very useful again, but for each
  # input it can result in a PASS or a FAIL.
  if 'R' not in font:
    # This is our first check that can potentially fail.
    # To document this: return is also ok in a check.
    return FAIL, '"R" is not in font filename.'
  else:
    # since you can't return at one point in a function
    # and yield at another point, we always have to
    # use return within this check.
    return PASS, '"R" is in font filename.'

# conditions are used for the dependency injection as arguments
# and to decide if a check will be skipped
@condition
# ttFont is a condition built into FontProfile
# it returns an instance of fontTools.TTLib.TTFont
def is_ttf(ttFont):
   return 'glyf' in ttFont

@check(
    id='de.graphicore.fontbakery/examples/ttf_has_glyphs',
    # this check will be skipped if the font is not a ttf
    conditions=["is_ttf"]
)
# this also runs once per font in fonts, but its called with
# the ttFont instance
def has_ttf_glyphs(ttFont):
  """ It's bad when there are no glyphs in the TTF."""
  # savely use the "glyf" table, because of conditions="is_ttf"
  # we know it's available
  if not len(ttFont['glyf'].glyphs):
    return FAIL, "There are no glyphs in this TTF."
  return PASS, "Some gLyphs are in this TTF."
```

Now to disable the automatic creation and registration while creating an equivalent result:

```py
# maybe at the top of the file
from fontbakery.checkrunner import Section

# you can use a another name for the default section
# but this is what get_module_profile would do
profile = profile_factory(default_section=Section(__name__))
# IMPORTANT: after all checks etc. have ben defined:
profile.auto_register(globals())
```

Since we have the `profile` reference we can also use the `expected_check_ids` self check method.

```py
# putting this at the top of the file
# can give a guick overview:
expected_check_ids = (
    'de.graphicore.fontbakery/examples/hello',
    'de.graphicore.fontbakery/examples/has-R'
)
```

```py
# this must be at the end of the module,
# after all checks were added:
profile.test_expected_checks(expected_check_ids, exclusive=True)
```

You can also explicitly import and merge a profile:

```py
from fontbakery.profiles import os2
from fontbakery.checkrunner import get_module_profile
# using get_module_profile is the recommended way to get a
# profile from a module, because it takes care of creating it
# automatically if not explicitly defined.
os2_profile = get_module_profile(os2)
profile.merge_profile(os2_profile)
```

### Naming Things: check-ids

Check IDs should ideally be **globally and temporally unique**. This means we once assign them and we never change them again. We plan to start enforcing this after FontBakery version 1.0.0 is released. This can then be used to keep track of the history of checks and check-results. We already rely on this feature for our tooling and we'll rely more on it in the future. within a profile a check id must be unique as well, to make sharing of checks and mixing of profiles easier. Globally unique names are a good thing.

We want to encourage authors to contribute their own checks to the Font Bakery collection, if they are generally useful and fit into it. Therefore an agreement on how to create check ids is needed to avoid id-collisions.

[Reverse domain name notation](https://en.wikipedia.org/wiki/Reverse_domain_name_notation) has proven useful and a nice side effect is that contributors to Font Bakery will stay appreciated. Here are some examples:

`com.daltonmaag/check/required-fields` and `de.graphicore.fontbakery/profile-examples/hello`: both examples are valid and more or less descriptive.

Of course, after your personal prefix, organizing names is up to you. One proposal is e.g. for checks that are specific to certain tables, the table name could be used as part of the check id.

### Naming Things: The Dependency Injection Namespace

***IMPORTANT:** Names can and will clash e.g. when sharing between profiles.* This is a good thing, because we need to be sure the right definitions are used for our profile. On the other hand, namespace hygiene will stay an ongoing topic.

The dependency injection of the Font Bakery Check Runner is a feature that makes it easy to write actual check implementations.

**Example:** Run a check once for each `fontTools.ttLib.TTFont` instance of all `fonts`: Just use `ttFont` as a parameter name.

```py
# example from fontbakery.profiles.post
@check(id='com.google.fonts/check/post_table_version')
def com_google_fonts_check_post_table_version(ttFont):
  """Font has post table version 2?"""
  if ttFont['post'].formatType != 2:
    yield FAIL, ("Post table should be version 2 instead of {}."
                 " More info at https://github.com/google/fonts/"
                 "issues/215").format(ttFont['post'].formatType)
  else:
    yield PASS, "Font has post table version 2."
```

To achieve this, Font Bakery uses inspection (meta programming) to get the parameter names of a check (or condition) and then resolves these dependencies using the matching definitions in the profile namespace.

There's a collection of different types that together populate the profile namespace. We need almost all of them to make our example from above work. Yet in this case they are already predefined in `FontsProfile`, making this also a documentation of those.

#### `fonts` Expected Value

`FontProfile` also defines a command line argument `fonts`, which is then passed as a value to the check runner.

In order to to make the namespace aware of a value that's going to be provided when the check is executed, a `FontBakeryExpectedValue` is defined and added to the profile.

```py
from fontbakery.callable import FontBakeryExpectedValue
fonts_expected_value = FontBakeryExpectedValue(
      'fonts'
    , default=[]
    , description='A list of the font file paths to check.'
    , validator=lambda fonts: (True, None) if len(fonts) \
                                    else (False, 'Value is empty.')
)
# somehow added to profile, e.g.:
# profile.register_expected_value(fonts_expected_value)
```

`fonts` when used as a check argument will be something like:
```py
['Myfont-Regular.ttf', 'Myfont-Italic.ttf', ...]
```

#### `font` Iterarg

Iterargs (iterable arguments) are defined via the `Profile` constructor.

```py
profile = FontsProfile(
      ...,
      iterargs={'font': 'fonts'},
      ...
      )
```

This tells Font Bakery when we use `font` as a check parameter, to call the check once for each `font` in `fonts`.

```py
@check(id=...)
def once_per_font(font):
 ...

# Will be executed something along these lines:
once_per_font('Myfont-Regular.ttf')
once_per_font('Myfont-Italic.ttf')
once_per_font(...)
```

#### `ttFont` Condition

Conditions are somehow similar to checks: they are also functions and they are also using the same dependency injection mechanism like checks for their parameters. But they are also part of the namespace and dependency injection.

```
@condition
def ttFont(font):
   from fontTools.ttLib import TTFont
   return TTFont(font)

# somehow added to profile, e.g.:
# profile.register_condition(ttFont)
```

This, when used in a check as parameter, will inherit from the `font` iterarg, that the check will be executed once for each `font` in `fonts`. However, the argument passed will be an instance of `TTFont`:

```
@check(id=...)
def once_per_ttfont(ttFont):
 ...

# will be called like:
once_per_font(ttFont('Myfont-Regular.ttf'))
once_per_font(ttFont('Myfont-Italic.ttf'))
once_per_font( ttFont(...))
```

#### `ttFonts` Derived Iterables

Derived Iterables are not used in the example above, they however make it possible for a condition like `ttFont` to create an iterator for all of it values:

```py
profile = FontsProfile(
      ...,
      derived_iterables={'ttFonts': ('ttFont', True)}
      ...
      )
```

Makes it possible to:

```
@check(id=...)
def once_for_all_ttfonts(ttFonts):
 ...

# is called much like:
once_for_all_ttfonts([ttFont(font) for font in [
                  'Myfont-Regular.ttf', 'Myfont-Italic.ttf', ...]])
```

#### Aliases

Not used at the moment but meant to provide a mechanism to map existing names to new names. Maybe this feature will disappear again when we don't find a use case for it.

```py
profile = FontsProfile(
      ...,
      aliases={'new_name': 'old_name'},
      ...
      )
```

#### Explicit Namespace Overrides `force=True`

In order to make it possible to create checks and conditions that depend on values unknown in advance, it is possible to forcefully override certain namespace entries with a later definition. For this `FontBakeryCondition` and `FontBakeryExpected` value have an `force=True` optional parameter and for the other namespace types `profile.add_to_namespace` can be used directly, which provides the same parameter. *Just don't over do it and take care of namspace clashes carefully!*


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycol. eur. (Erlanga) 3: 21 (1828)

#### Original name
Petrona conchacea Scop.

### Remarks
null


text:
<?xml version="1.0" encoding="utf-8"?>

<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
    android:keyWidth="15%p"
    android:keyHeight="25%p">
    <Row>
        <Key
            android:codes="1108"
            android:keyEdgeFlags="left"
            android:keyLabel="" />
        <!-- lowercase Ye with acute accent -->
        <Key
            android:keyLabel="є́"
            android:keyOutputText="є́" />
        <!-- uppercase Ye with acute accent -->
        <Key
            android:keyEdgeFlags="right"
            android:keyLabel="Є́"
            android:keyOutputText="Є́" />
    </Row>
</Keyboard>


text:
#include <aws/ec2/model/DescribeDhcpOptionsRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

using namespace Aws::EC2::Model;
using namespace Aws::Utils;

DescribeDhcpOptionsRequest::DescribeDhcpOptionsRequest() :
    m_dryRun(false),
    m_dryRunHasBeenSet(false),
    m_dhcpOptionsIdsHasBeenSet(false),
    m_filtersHasBeenSet(false)
{
}

Aws::String DescribeDhcpOptionsRequest::SerializePayload() const
{
  Aws::StringStream ss;
  ss << "Action=DescribeDhcpOptions&";
  if(m_dryRunHasBeenSet)
  {
    ss << "DryRun=" << m_dryRun << "&";
  }
  if(m_dhcpOptionsIdsHasBeenSet)
  {
    unsigned dhcpOptionsIdsCount = 1;
    for(auto& item : m_dhcpOptionsIds)
    {
      ss << "DhcpOptionsIds.member." << dhcpOptionsIdsCount << "="
          << StringUtils::URLEncode(item.c_str()) << "&";
      dhcpOptionsIdsCount++;
    }
  }
  if(m_filtersHasBeenSet)
  {
    unsigned filtersCount = 1;
    for(auto& item : m_filters)
    {
      item.OutputToStream(ss, "Filters.member.", filtersCount, "");
      filtersCount++;
    }
  }
  ss << "Version=2015-04-15";
  return ss.str();
}


text:
import { ActivatedRoute, Router } from '@angular/router';
import { FamilyTestingService } from 'src/app/etl-api/family-testing-resource.service';
import { Component, OnInit } from '@angular/core';
import * as _ from 'lodash';
import * as Moment from 'moment';
import { PatientService } from 'src/app/patient-dashboard/services/patient.service';

@Component({
  selector: 'app-contact-list',
  templateUrl: './contact-list.component.html',
  styleUrls: ['./contact-list.component.css']
})
export class ContactListComponent implements OnInit {
  private patientUuid: string;
  public indexContacts: Array<any> = [];
  public gridOptions = { columnDefs: [] };
  public maxElicitationDate = '';
  public children_status = '';
  public children_elicitation_status = '';
  public partner_status = '';
  public hasChildrenBeenElicited = '';
  public hasContacts = true;
  public childrenTestingConsentGiven = '';
  public gender = '';
  private columnDefs = [
    {
      headerName: '#',
      colId: 'rowNum',
      valueGetter: 'node.rowIndex + 1',
      width: 60,
      pinned: 'left'
    },
    { field: 'fm_name', headerName: 'Contact Name' },
    { field: 'fm_gender', headerName: 'Gender', width: 100 },
    { field: 'relationship_type', headerName: 'Relationship' },
    { field: 'fm_age', headerName: 'Age', width: 100 },
    { field: 'fm_gender', headerName: 'Gender', width: 80 },
    {
      field: 'preferred_testing_date',
      headerName: 'Preferred date of testing',
      width: 180
    },
    {
      field: 'modified_current_test_date',
      headerName: 'Current test date',
      width: 150
    },
    {
      field: 'test_result_value',
      headerName: 'Current test results',
      width: 150
    },
    {
      field: 'date_elicited',
      headerName: 'Date Elicited',
      width: 100,
      cellRenderer: (column) => {
        return Moment(column.value).format('DD/MM/YYYY');
      }
    }
  ];

  constructor(
    private familyTestingService: FamilyTestingService,
    public route: ActivatedRoute,
    public router: Router,
    private patientService: PatientService
  ) {}

  ngOnInit() {
    this.patientService.currentlyLoadedPatient.subscribe((patient) => {
      if (patient) {
        this.patientUuid = patient.person.uuid;
        this.gender = patient.person.gender;
        this.getFamilyTestingContactListData(this.patientUuid);
      }
    });
    this.gridOptions.columnDefs = this.columnDefs;
  }

  public getFamilyTestingContactListData(patientId: string) {
    this.familyTestingService
      .getFamilyTestingReportData(patientId)
      .subscribe((data) => {
        if (data.result && data.result.length > 0) {
          this.getContacts(data.result);
          if (data.result !== undefined && data.result.length > 0) {
            this.hasContacts = true;
          } else {
            this.hasContacts = false;
          }
          if (data.result[0].children_elicited_by_partner === 'YES') {
            this.children_elicitation_status = 'YES';
          } else if (data.result[0].children_elicited_by_partner === 'NO') {
            this.children_elicitation_status = `NO. Partner  ${data.result[0].female_partner_status}`;
          }
          data.result[0].child_status_reason
            ? (this.children_status =
                data.result[0].child_status +
                ', ' +
                data.result[0].child_status_reason)
            : (this.children_status = data.result[0].child_status);

          if (data.result[0].child_status !== 'YES' || this.gender === 'F') {
            this.children_elicitation_status = '';
          }
          this.maxElicitationDate = Moment(
            this.getMaxElicitationDate(data.result)
          ).format('DD/MM/YYYY');
          this.hasChildrenBeenElicited = data.result[0].children_elicited;
          if (data.result[0].child_status === 'YES') {
            this.childrenTestingConsentGiven =
              data.result[0].children_testing_consent_given;
          }
        }
      });
  }

  public getMaxElicitationDate(contacts) {
    const dates = [];
    _.each(contacts, (c) => {
      dates.push(new Date(c.encounter_datetime));
      dates.push(new Date(c.date_elicited));
      dates.push(new Date(c.updated_elicitation_date));
      dates.push(new Date(c.updated_elicitation_date_alert));
    });

    return new Date(Math.max.apply(null, dates));
  }

  public getContacts(contacts) {
    _.each(contacts, (c) => {
      if (c.obs_group_id != null) {
        this.indexContacts = contacts;
      }
    });
  }
}


text:
 __Don't consider using this tutorial for anything else than inner-loop testing of corefx/coreclr binaries. Prefer using the official .NET Core SDK: https://docs.microsoft.com/en-us/dotnet/core/tools/?tabs=netcore2x__

This tutorial describes how to build and run application code that targets self-compiled .NET Core binaries without using Visual Studio,  the .NET Core SDK Host (`dotnet.exe`) or a project file (e.g. `csproj`). Follow these steps to quickly validate changes you've made in the product e.g. by running benchmarks or tests on it.

If you are on Windows you currently need to use the `Developer Command Prompt for VS 2017` to build corefx/coreclr! For the sake of completeness, we have placed our repositories under `d:\git\`.

## Compile corefx with self-compiled coreclr binaries
If you've made changes to coreclr make sure to also build it and pass its binaries to corefx.
```
coreclr\build -release
corefx\build -release -- /p:CoreCLROverridePath=d:\git\coreclr\bin\Product\Windows_NT.x64.Release\
```

## Compile corefx with pre-compiled coreclr binaries
If you haven't made any changes to coreclr you're fine with just building corefx. This automatically picks pre-compiled coreclr binaries from MyGet.
```
corefx\build -release
```

## Create and prepare your application
We will build a sample application which outputs `Hello World!` to the console.

1. Create an application directory (in our example under `d:\git\`):
```
mkdir core-demo
cd core-demo
```
2. Save the following C# code to a file called `Program.cs` into your application folder:
```csharp
using System;

public class Program
{
    public static void Main()
    {
        Console.WriteLine("Hello World!");
    }
}
```

3. Copy the just built corefx assemblies into your application directory. When using Visual Studio or the .NET Core SDK Host (`dotnet.exe`) you usually compile against *reference assemblies*. For simplicity we compile against the same assembly set that we use during run time.
```
xcopy ..\corefx\bin\testhost\netcoreapp-Windows_NT-Release-x64\shared\Microsoft.NETCore.App\9.9.9 runtime /e /i /y /s
```

You don't need all the assemblies that are built by corefx but copying the entire directory makes it easier if you want to reference additional ones. At a minimum, this app will need the following assemblies to run:

- CoreClr assemblies: `clrjit.dll`, `CoreRun.exe`, `coreclr.dll`, `System.Private.CoreLib.dll`. For more information about the CoreClr parts, visit [Using your build](https://github.com/dotnet/coreclr/blob/master/Documentation/workflow/UsingYourBuild.md)
- CoreFx assemblies: `System.Runtime.dll`, `System.Runtime.Extensions.dll`, `System.Runtime.InteropServices.dll`, `System.Text.Encoding.Extensions.dll`, `System.Threading.dll`

## Compile your application
Use the C# Compiler (`csc`) to compile your C# code (`Program.cs`) against the copied assemblies. For our Hello World example we need to compile our application code against `System.Private.Corelib.dll`, `System.Runtime.dll`, `System.Runtime.Extensions.dll` and `System.Console.dll`. As described above these assemblies have dependencies on two other assemblies: `System.Text.Encoding.Extensions.dll` and `System.Threading.dll`.
```
.\runtime\corerun ..\corefx\tools\csc.dll /noconfig /r:runtime\System.Private.Corelib.dll /r:runtime\System.Runtime.dll /r:runtime\System.Runtime.Extensions.dll /r:runtime\System.Console.dll /out:runtime\Program.dll Program.cs
```

If you want to compile Visual Basic code simply replace `csc.dll` with `vbc.dll`.

## Run your application
`Corerun.exe` is part of the coreclr binaries and is best described as the host of your .NET Core application. Find more information at [Using CoreRun](https://github.com/dotnet/coreclr/blob/master/Documentation/workflow/UsingCoreRun.md).
```
cd runtime
.\corerun Program.dll
```

> Hello World!


text:
<!doctype html>

    <title>Code coverage report for javascripts/welcome.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../prettify.css" />
    <link rel="stylesheet" href="../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

      All files / javascripts welcome.js

        0%
        Statements
        0/33

        100%
        Branches
        0/0

        0%
        Functions
        0/6

        0%
        Lines
        0/33

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

const $ = window.$ = require('jquery');
/* eslint no-unused-vars: 0 */
const jQuery = window.jQuery = $;
require('../stylesheets/welcome.css');
require('bootstrap');
require('datatables.net-bs');
require('../node_modules/datatables-bootstrap3-plugin/media/css/datatables-bootstrap3.css');
const d3 = require('d3');
function modelViewTable(selector, modelView, orderCol, order) {
  // Builds a dataTable from a flask appbuilder api endpoint
  let url = '/' + modelView.toLowerCase() + '/api/read';
  url += '?_oc_' + modelView + '=' + orderCol;
  url += '&_od_' + modelView + '=' + order;
  $.getJSON(url, function (data) {
    const columns = ['dashboard_link', 'creator', 'modified'];
    const tableData = $.map(data.result, function (el) {
      const row = $.map(columns, function (col) {
        return el[col];
      });
      return [row];
    });
    const cols = $.map(columns, function (col) {
      return { sTitle: data.label_columns[col] };
    });
    const panel = $(selector).parents('.panel');
    panel.find('img.loading').remove();
    $(selector).DataTable({
      aaData: tableData,
      aoColumns: cols,
      bPaginate: true,
      pageLength: 10,
      bLengthChange: false,
      aaSorting: [],
      searching: true,
      bInfo: false,
    });
    // Hack to move the searchbox in the right spot
    const search = panel.find('.dataTables_filter input');
    search.addClass('form-control').detach();
    search.appendTo(panel.find('.search'));
    panel.find('.dataTables_filter').remove();
    // Hack to display the page navigator properly
    panel.find('.col-sm-5').remove();
    const nav = panel.find('.col-sm-7');
    nav.removeClass('col-sm-7');
    nav.addClass('col-sm-12');
    $(selector).slideDown();
    $('[data-toggle="tooltip"]').tooltip({ container: 'body' });
  });
}
$(document).ready(function () {
  modelViewTable('#dash_table', 'DashboardModelViewAsync', 'changed_on', 'desc');
});

  Code coverage
  generated by istanbul at Mon Sep 26 2016 23:09:10 GMT+0800 (CST)


text:
import os
import sys

def main():
  print 'with_flag: Verify the test data files were mapped properly'
  assert len(sys.argv) == 2
  mode = sys.argv[1]
  assert mode in ('run', 'trace')
  expected = {
    os.path.join('subdir', '42.txt'):
        'the answer to life the universe and everything\n',
    'test_file1.txt': 'Foo\n',
    'test_file2.txt': 'Bar\n',
  }

  root = 'files1'
  actual = {}
  for relroot, dirnames, filenames in os.walk(root):
    for filename in filenames:
      fullpath = os.path.join(relroot, filename)
      actual[fullpath[len(root)+1:]] = open(fullpath, 'rb').read()
    if mode == 'trace' and '.svn' in dirnames:
      dirnames.remove('.svn')

  if actual != expected:
    print 'Failure'
    print actual
    print expected
    return 1

  root_dir = os.path.dirname(os.path.abspath(__file__))
  parent_dir, base = os.path.split(root_dir)
  if mode == 'trace':
    # Verify the parent directory.
    parent_dir, base2 = os.path.split(parent_dir)
    if base != 'isolate' or base2 != 'tests':
      print 'mode trace: Invalid root dir %s' % root_dir
      return 4
  else:
    # Verify that we are not inside a checkout.
    if base == 'tests':
      print 'mode run: Invalid root dir %s' % root_dir
      return 5
  return 0

if __name__ == '__main__':
  sys.exit(main())


text:
"use strict";
module.exports = function(ngModule){
	ngModule.controller('DealerEditCtrl', function(ModalService, DealerService, StoreService, AppConfig, $filter, $state, $stateParams, Loader, dealer, level, responser, StoreDecrationStatus) {
		var vm = this;
    vm.data = dealer;
		vm.level = level;
		vm.responser = responser;
		vm.joindate = new Date(vm.data.joindate);
		vm.location = {
			province: dealer.province,
			city: dealer.city,
			district: dealer.area
		};
		_.extend(vm, {
			edit: function() {
				Loader.show();
        var id = $stateParams.id;
				vm.data.province = vm.location.province;
				vm.data.city = vm.location.city;
				vm.data.area = vm.location.district;
				vm.data.joindate = $filter('date')(vm.joindate, "yyyy-MM-dd");
				DealerService.update(id, vm.data).then(function() {
					Loader.hide();
          $state.go('app.dealer.list');
				}, function(error) {
					Loader.hide();
          vm.error = error.response.error;
				});
			},
			filterStatus: function(status) {
				var statusArray = $filter('dealerStatusFilter').mapper;
				return statusArray[status];
			},
			addStore: function() {
				ModalService.show({
					title: '添加门店',
					okButtonLabel: '添加',
					cancelButtonLabel: "取消",
					cancelCls: 'btn btn-lg btn-primary',
					okCls: 'btn btn-lg btn-primary',
					html: require('./../templates/popup/store-create.jade'),
					controller: "StoreCreatePopupCtrl as vm",
					size: 'lg'
				}, {
					store: {dealer_id: dealer.id}
				}).then(function(store) {
					Loader.show();
					StoreService.create(store).then(function (data) {
						Loader.hide();
						vm.data.store.push(data.response.data.data);
					}, function(error) {
						Loader.hide();
						ModalService.alert(error.response.error);
					});
				});
			},
			editStore: function(index) {
				ModalService.show({
          title: '编辑门店',
          okButtonLabel: '确定',
          cancelButtonLabel: "取消",
          cancelCls: 'btn btn-lg btn-primary',
          okCls: 'btn btn-lg btn-primary',
          html: require('./../templates/popup/store-create.jade'),
          controller: "StoreCreatePopupCtrl as vm",
					size: 'lg'
				}, {
					store: vm.data.store[index]
				}).then(function(store) {
					Loader.show();
					StoreService.update(store.id, store).then(function () {
						Loader.hide();
						vm.data.store.splice(index, 1, store);
					}, function(error) {
						Loader.hide();
						ModalService.alert(error.response.error);
					});
				});
			},
			startDecorate: function(index) {
				var store = vm.data.store[index];
				var copiedStore = angular.copy(store);
				copiedStore.status = StoreDecrationStatus.start;
				ModalService.alert('确定发起装修?').then(function () {
					Loader.show();
					StoreService.update(copiedStore.id, copiedStore).then(function() {
						Loader.hide();
						store.status = StoreDecrationStatus.start;
					});
				});
			}
    });
  });
};


text:
package main

import (
	_ "github.com/docker/infrakit/cmd/cli/event"
	_ "github.com/docker/infrakit/cmd/cli/flavor"
	_ "github.com/docker/infrakit/cmd/cli/group"
	_ "github.com/docker/infrakit/cmd/cli/info"
	_ "github.com/docker/infrakit/cmd/cli/instance"
	_ "github.com/docker/infrakit/cmd/cli/manager"
	_ "github.com/docker/infrakit/cmd/cli/metadata"
	_ "github.com/docker/infrakit/cmd/cli/plugin"
	_ "github.com/docker/infrakit/cmd/cli/resource"
	_ "github.com/docker/infrakit/cmd/cli/template"
	_ "github.com/docker/infrakit/cmd/cli/util"
)


text:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <record id="open_account_charts_modules" model="ir.actions.act_window">
            <field name="name">Chart Templates</field>
            <field name="res_model">ir.module.module</field>
            <field name="view_mode">kanban,tree,form</field>
            <field name="context" eval="{'search_default_category_id': ref('base.module_category_localization_account_charts')}"/>
            <field name="search_view_id" ref="base.view_module_filter"/>
        </record>

        <record id="view_account_config_settings" model="ir.ui.view">
            <field name="name">account settings</field>
            <field name="model">account.config.settings</field>
            <field name="arch" type="xml">
                <form string="Configure Accounting" version="7.0" class="oe_form_configuration">

                        <button string="Apply" type="object" name="execute" class="oe_highlight"/>
                        or
                        <button string="Cancel" type="object" name="cancel" class="oe_link"/>

                    <field name="has_default_company" invisible="1" />
                    <field name="has_chart_of_accounts" invisible="1"/>
                    <field name="complete_tax_set" invisible="1"/>
                    <field name="has_fiscal_year" invisible="1"/>
                    <separator string="Chart of Accounts" groups="base.group_multi_company"/>
                    <group groups="base.group_multi_company">

                                <field name="company_id"
                                    widget="selection"
                                    on_change="onchange_company_id(company_id, context)"
                                    class="oe_inline"/>

                                <field name="expects_chart_of_accounts" class="oe_inline"/>

                    </group>
                    <separator string="Chart of Accounts" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_chart_of_accounts','=',True)]}"/>
                    <group attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_chart_of_accounts','=',True)]}">

                                <field name="chart_template_id"
                                    widget="selection"
                                    domain="[('visible','=', True)]"
                                    on_change="onchange_chart_template_id(chart_template_id)"
                                    class="oe_inline"/>
                                <button string="Install more chart templates"
                                    icon="gtk-go-forward"
                                    name="%(open_account_charts_modules)d"
                                    type="action"
                                    class="oe_link"/>

                                <field name="code_digits" class="oe_inline"/>

                                <field name="sale_tax"
                                    domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('sale','all'))]"
                                    class="oe_inline"/>

                                <field name="purchase_tax"
                                    domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('purchase', 'all'))]"
                                    class="oe_inline"/>

                                <field name="sale_tax_rate" on_change="onchange_tax_rate(sale_tax_rate)"/>

                                <field name="purchase_tax_rate" />

                    </group>
                    <separator string="No Fiscal Year Defined for This Company" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_fiscal_year','=',True)]}"/>
                    <group attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_fiscal_year','=',True)]}">

                                <field name="date_start"
                                    on_change="onchange_start_date(date_start)"
                                    class="oe_inline"/> -
                                <field name="date_stop" class="oe_inline"/>

                                <field name="period" class="oe_inline"/>

                    </group>
                    <separator string="Accounting & Finance"/>
                    <group>

                                <field name="currency_id" class="oe_inline"/>

                                <field name="decimal_precision" class="oe_inline"/>

                                <field name="tax_calculation_rounding_method" class="oe_inline"/>

                                <field name="group_multi_currency" class="oe_inline"/>

                                <field name="module_account_accountant" class="oe_inline"/>

                                <field name="group_analytic_accounting" class="oe_inline"/>

                                <field name="module_account_asset" class="oe_inline"/>

                                <field name="module_account_budget" class="oe_inline"/>

                    </group>
                    <separator string="eInvoicing & Payments"/>
                    <group>

                                <field name="default_sale_tax"
                                    domain="[('type_tax_use','=','sale'), ('company_id','=',company_id)]"
                                    class="oe_inline"/>

                                <field name="sale_sequence_prefix"
                                    class="oe_inline"
                                    help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
                                <field name="sale_sequence_next"
                                    class="oe_inline"
                                    attrs="{'readonly': [('sale_journal_id','=',False)]}"/>

                                <field name="sale_refund_sequence_prefix"
                                    class="oe_inline"
                                    help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
                                <field name="sale_refund_sequence_next"
                                    class="oe_inline"
                                    attrs="{'readonly': [('sale_refund_journal_id','=',False)]}"/>

                                <field name="group_proforma_invoices" class="oe_inline"/>

                                <field name="module_account_voucher" class="oe_inline"/>

                                <field name="module_account_followup" class="oe_inline"/>

                    </group>
                    <group>

                                <field name="default_purchase_tax"
                                    domain="[('type_tax_use','=','purchase'), ('company_id','=',company_id)]"
                                    class="oe_inline"/>

                                <field name="purchase_sequence_prefix"
                                    class="oe_inline"
                                    help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
                                <field name="purchase_sequence_next"
                                    class="oe_inline"
                                    attrs="{'readonly': [('purchase_journal_id','=',False)]}"/>

                                <field name="purchase_refund_sequence_prefix"
                                    class="oe_inline"
                                    help='If you put "%%(year)s" in the prefix, it will be replaced by the current year.'/>
                                <field name="purchase_refund_sequence_next"
                                    class="oe_inline"
                                    attrs="{'readonly': [('purchase_refund_journal_id','=',False)]}"/>

                                <field name="module_account_payment" class="oe_inline"/>

                                <field name="module_account_check_writing" class="oe_inline"/>

                                <field name="group_check_supplier_invoice_total" class="oe_inline"/>

                    </group>
                    <separator string="Bank & Cash"/>
                    <group name="bank_cash">

                                <button name="open_company_form" type="object"
                                    string="Configure your company bank accounts" icon="gtk-go-forward"
                                    class="oe_inline oe_link"/>
                                <field name="company_footer"/>

                                <field name="paypal_account" placeholder="e.g. sales@openerp.com" class="oe_inline"/>

                    </group>
                    <separator name="analytic_account" string="Analytic Accounting" invisible="1"/>
                    <group name="analytic_account_sale" invisible="1">

                    </group>
                    <group name="analytic_account_purchase" invisible="1">

                    </group>
                    <field name="sale_journal_id" invisible="1"/>
                    <field name="sale_refund_journal_id" invisible="1"/>
                    <field name="purchase_journal_id" invisible="1"/>
                    <field name="purchase_refund_journal_id" invisible="1"/>
                </form>
            </field>
        </record>

        <record id="action_account_config" model="ir.actions.act_window">
            <field name="name">Configure Accounting</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">account.config.settings</field>
            <field name="view_mode">form</field>
            <field name="target">inline</field>
        </record>

        <menuitem id="menu_account_config" name="Invoicing" parent="base.menu_config"
            sequence="14" action="action_account_config"/>

    </data>
</openerp>


text:
<?php

namespace TheSeer\phpDox\Generator\Enricher {

    use TheSeer\fDOM\fDOMElement;
    use TheSeer\phpDox\GeneratorConfig;

    class PHPUnitConfig {

        /**
         * @var GeneratorConfig
         */
        private $generator;

        /**
         * @var fDOMElement
         */
        private $context;

        public function __construct(GeneratorConfig $generator, fDOMElement $ctx) {
            $this->context = $ctx;
            $this->generator = $generator;
        }

        public function getCoveragePath() {
            $basedirDefault = dirname($this->context->ownerDocument->baseURI);
            $path = $basedirDefault . '/build/logs';
            if ($this->context->parentNode->hasAttribute('base')) {
                $path = $this->context->parentNode->getAttribute('base');
            }
            if ($path != '') { $path .= '/'; }
            $coverage = $this->context->queryOne('cfg:coverage');
            if ($coverage && $coverage->hasAttribute('path')) {
                $path .= $coverage->getAttribute('path');
            } else {
                $path .= 'coverage';
            }
            return $path;
        }

        public function getSourceDirectory() {
            return $this->generator->getProjectConfig()->getSourceDirectory();
        }
    }

}


text:
-- Added early in 1.5 alpha development, removed 2005-04-25

ALTER TABLE /*$wgDBprefix*/user DROP COLUMN user_emailauthenticationtimestamp;