text:
package org.wso2.carbon.apimgt.core.util;

/**
 * This class represents the constants that are used for APIManager implementation
 */
public class APIMgtConstants {

    public static final String DEPRECATE_PREVIOUS_VERSIONS = "Deprecate old versions after publish the API";
    public static final String REQUIRE_RE_SUBSCRIPTIONS = "Require re-subscription when publish the API";
    public static final String CHECK_LIST_ITEM_CHANGE_EVENT = "CheckListItemChange";
    public static final String IS_EXTERNAL_KEYMANAGER = "IsExternalKeyManager";
    //Swagger v2.0 constants
    public static final String SWAGGER_X_SCOPE = "x-scope";
    public static final String SWAGGER_X_AUTH_TYPE = "x-auth-type";
    public static final String SWAGGER_X_THROTTLING_TIER = "x-throttling-tier";
    public static final String SWAGGER_X_MEDIATION_SCRIPT = "x-mediation-script";
    public static final String SWAGGER_X_WSO2_SECURITY = "x-wso2-security";
    public static final String SWAGGER_X_WSO2_SCOPES = "x-wso2-scopes";
    public static final String SWAGGER_SCOPE_KEY = "key";
    public static final String SWAGGER_NAME = "name";
    public static final String SWAGGER_DESCRIPTION = "description";
    public static final String SWAGGER_ROLES = "roles";
    public static final String SWAGGER_TITLE = "title";
    public static final String SWAGGER_EMAIL = "email";
    public static final String SWAGGER_CONTACT = "contact";
    public static final String SWAGGER_VER = "version";
    public static final String SWAGGER_OBJECT_NAME_APIM = "apim";
    public static final String SWAGGER_PATHS = "paths";
    public static final String SWAGGER_RESPONSES = "responses";
    public static final String SWAGGER = "swagger";
    public static final String SWAGGER_V2 = "2.0";
    public static final String SWAGGER_INFO = "info";
    public static final String SWAGGER_RESPONSE_200 = "200";
    public static final String API = "API";
    public static final String API_LIFECYCLE = "API_LIFECYCLE";
    public static final String AUTH_NO_AUTHENTICATION = "None";
    public static final String AUTH_APPLICATION_LEVEL_TOKEN = "Application";
    public static final String AUTH_APPLICATION_USER_LEVEL_TOKEN = "Application_User";
    public static final String AUTH_APPLICATION_OR_USER_LEVEL_TOKEN = "Any";
    public static final String DEFAULT_API_POLICY = "Unlimited";
    public static final String GLOBAL_ENDPOINT = "GLOBAL";
    public static final String API_SPECIFIC_ENDPOINT = "API";
    public static final String RESOURCE_SPECIFIC_ENDPOINT = "RESOURCE";
    public static final String PRODUCTION_ENDPOINT = "production";

    public static final String DEFAULT_LABEL_NAME = "Default";
    public static final String DEFAULT_LABEL_ACCESS_URL = "https://localhost:9092";

    //workflow executor default executors
    public static final String WF_DEFAULT_APPCREATION_EXEC =
            "org.wso2.carbon.apimgt.core.workflow.ApplicationCreationSimpleWorkflowExecutor";
    public static final String WF_DEFAULT_APISTATE_EXEC =
            "org.wso2.carbon.apimgt.core.workflow.APIStateChangeSimpleWorkflowExecutor";
    public static final String WF_DEFAULT_PRODAPP_EXEC =
            "org.wso2.carbon.apimgt.core.workflow.ApplicationRegistrationSimpleWorkflowExecutor";
    public static final String WF_DEFAULT_SANDBOXAPP_EXEC =
            "org.wso2.carbon.apimgt.core.workflow.ApplicationRegistrationSimpleWorkflowExecutor";
    public static final String WF_DEFAULT_APPDELETE_EXEC =
            "org.wso2.carbon.apimgt.core.workflow.ApplicationDeletionSimpleWorkflowExecutor";
    public static final String WF_DEFAULT_SUBCREATION_EXEC =
            "org.wso2.carbon.apimgt.core.workflow.SubscriptionCreationSimpleWorkflowExecutor";
    public static final String WF_DEFAULT_SUBDELETE_EXEC =
            "org.wso2.carbon.apimgt.core.workflow.SubscriptionDeletionSimpleWorkflowExecutor";

    //workflow executor default executor
    public static final String WF_DEFAULT_WF_EXEC =
            "org.wso2.carbon.apimgt.core.workflow.DefaultWorkflowExecutor";

    //Store constants
    public static final String DEFAULT_APPLICATION_NAME = "DefaultApplication";
    public static final String EMPTY_STRING_VALUE = " ";
    public static final String SUPPORTED_HTTP_VERBS = "GET,POST,PUT,DELETE,PATCH,HEAD,OPTIONS";

    public static final String HTTP_GET = "GET";
    public static final String OVERWRITE_LABELS = "overwrite_labels";

    public static final String TAG_SEARCH_TYPE_PREFIX = "tags";
    public static final String SUBCONTEXT_SEARCH_TYPE_PREFIX = "subcontext";
    public static final String PROVIDER_SEARCH_TYPE_PREFIX = "provider";
    public static final String VERSION_SEARCH_TYPE_PREFIX = "version";
    public static final String CONTEXT_SEARCH_TYPE_PREFIX = "context";
    public static final String DESCRIPTION_SEARCH_TYPE_PREFIX = "description";

    public static final String TAG_NAME_COLUMN = "NAME";
    public static final String URL_PATTERN_COLUMN = "URL_PATTERN";

    public static final String SANDBOX_ENDPOINT = "sandbox";
    public static final String GATEWAY_CONFIG = "GATEWAY_CONFIG";
    public static final String HTTP = "http";
    public static final String HTTPS = "https";

    public static final String HTTP_METHOD = "HTTP_METHOD";

    public static final String NAMESPACE_STORE_API = "wso2.carbon.apimgt.store.rest.api";
    public static final String NAMESPACE_PUBLISHER_API = "wso2.carbon.apimgt.publisher.rest.api";
    public static final String NAMESPACE_ADMIN_API = "wso2.carbon.apimgt.admin.rest.api";

    /**
     * Application statuses.
     */
    public static class ApplicationStatus {
        public static final String APPLICATION_CREATED = "CREATED";
        public static final String APPLICATION_APPROVED = "APPROVED";
        public static final String APPLICATION_REJECTED = "REJECTED";
        public static final String APPLICATION_ONHOLD = "ON_HOLD";
    }

    /**
     * Application registration statuses.
     */
    public enum AppRegistrationStatus {
        CREATED,
        APPROVED,
        REJECTED,
        COMPLETED
    }

    /**
     * Subscription statuses.
     */
    public enum SubscriptionStatus {
        BLOCKED,
        PROD_ONLY_BLOCKED,
        SANDBOX_ONLY_BLOCKED,
        ACTIVE,
        ON_HOLD,
        REJECTED
    }

    /**
     * Subscription types
     */
    public enum SubscriptionType {
        SUBSCRIBE,
        UN_SUBSCRIBE
    }

    /**
     * API workflow statuses.
     */
    public enum APILCWorkflowStatus {
        APPROVED,
        REJECTED,
        PENDING
    }

    /**
     * API File Constants
     */
    public static class APIFileUtilConstants {
        public static final String API_DEFINITION_FILE_PREFIX = "api-";
        public static final String JSON_EXTENSION = ".json";
        public static final String SWAGGER_DEFINITION_FILE_PREFIX = "swagger-";
        public static final String GATEWAY_CONFIGURATION_DEFINITION_FILE = "gateway-configuration";
        public static final String THUMBNAIL_FILE_NAME = "thumbnail";
        public static final String ENDPOINTS_ROOT_DIRECTORY = "Endpoints";
    }

    /**
     * Throttle policy related constants
     */
    public static class ThrottlePolicyConstants {
        public static final String COLUMN_POLICY_ID = "POLICY_ID";

        public static final String COLUMN_UUID = "UUID";

        public static final String COLUMN_NAME = "NAME";

        public static final String COLUMN_DESCRIPTION = "DESCRIPTION";

        public static final String COLUMN_DISPLAY_NAME = "DISPLAY_NAME";

        public static final String COLUMN_TENANT_ID = "TENANT_ID";

        public static final String COLUMN_RATE_LIMIT_COUNT = "RATE_LIMIT_COUNT";

        public static final String COLUMN_RATE_LIMIT_TIME_UNIT = "RATE_LIMIT_TIME_UNIT";

        public static final String COLUMN_QUOTA_POLICY_TYPE = "QUOTA_TYPE";

        public static final String COLUMN_QUOTA = "QUOTA";

        public static final String COLUMN_QUOTA_UNIT = "QUOTA_UNIT";

        public static final String COLUMN_UNIT_TIME = "UNIT_TIME";

        public static final String COLUMN_TIME_UNIT = "TIME_UNIT";

        public static final String COLUMN_APPLICABLE_LEVEL = "APPLICABLE_LEVEL";

        public static final String COLUMN_DEFAULT_QUOTA_POLICY_TYPE = "DEFAULT_QUOTA_TYPE";

        public static final String COLUMN_DEFAULT_UNIT_TIME = "DEFAULT_UNIT_TIME";

        public static final String COLUMN_DEFAULT_TIME_UNIT = "DEFAULT_TIME_UNIT";

        public static final String COLUMN_DEFAULT_QUOTA = "DEFAULT_QUOTA";

        public static final String COLUMN_DEFAULT_QUOTA_UNIT = "DEFAULT_QUOTA_UNIT";

        public static final String COLUMN_SPECIFIC_DATE = "SPECIFIC_DATE";

        public static final String COLUMN_STARTING_DATE = "STARTING_DATE";

        public static final String COLUMN_ENDING_DATE = "ENDING_DATE";

        public static final String COLUMN_SPECIFIC_IP = "SPECIFIC_IP";

        public static final String COLUMN_STARTING_IP = "STARTING_IP";

        public static final String COLUMN_ENDING_IP = "ENDING_IP";

        public static final String COLUMN_HTTP_VERB = "HTTP_VERB";

        public static final String COLUMN_CONDITION_ID = "CONDITION_GROUP_ID";

        public static final String COLUMN_PARAMETER_NAME = "PARAMETER_NAME";

        public static final String COLUMN_PARAMETER_VALUE = "PARAMETER_VALUE";

        public static final String COLUMN_CLAIM_URI = "CLAIM_URI";

        public static final String COLUMN_CLAIM_ATTRIBUTE = "CLAIM_ATTRIB";

        public static final String COLUMN_HEADER_FIELD_NAME = "HEADER_FIELD_NAME";

        public static final String COLUMN_HEADER_FIELD_VALUE = "HEADER_FIELD_VALUE";

        public static final String COLUMN_SIDDHI_QUERY = "SIDDHI_QUERY";

        public static final String COLUMN_KEY_TEMPLATE = "KEY_TEMPLATE";

        public static final String COLUMN_DEPLOYED = "IS_DEPLOYED";

        public static final String COLUMN_WITHIN_IP_RANGE = "WITHIN_IP_RANGE";

        public static final String COLUMN_IS_HEADER_FIELD_MAPPING = "IS_HEADER_FIELD_MAPPING";

        public static final String COLUMN_IS_CLAIM_MAPPING = "IS_CLAIM_MAPPING";

        public static final String COLUMN_IS_PARAM_MAPPING = "IS_PARAM_MAPPING";

        public static final String COLUMN_STOP_ON_QUOTA_REACH = "STOP_ON_QUOTA_REACH";

        public static final String COLUMN_BILLING_PLAN = "BILLING_PLAN";

        public static final String COLUMN_CUSTOM_ATTRIB = "CUSTOM_ATTRIBUTES";
        public static final String API_LEVEL = "api";
        public static final String APPLICATION_LEVEL = "application";
        public static final String SUBSCRIPTION_LEVEL = "subscription";
        public static final String COLUMN_CONDITION_GROUP_ID = "CONDITION_GROUP_ID";
        public static final String BLOCKING_CONDITION_STATE = "state";
        public static final String BLOCKING_CONDITION_KEY = "blockingCondition";
        public static final String BLOCKING_CONDITION_VALUE = "conditionValue";
        public static final String BLOCKING_CONDITIONS_APPLICATION = "APPLICATION";
        public static final String BLOCKING_CONDITIONS_API = "API";
        public static final String BLOCKING_CONDITIONS_USER = "USER";
        public static final String BLOCKING_CONDITIONS_IP = "IP";
        public static final String BLOCKING_CONDITION_IP_RANGE = "IP_RANGE";
    }

    /**
     * Exceptions related constance will be put here
     */
    public static class ExceptionsConstants {

        public static final String API_NAME = "API_NAME";
        public static final String API_CONTEXT = "API_CONTEXT";
        public static final String API_VERSION = "API_VERSION";
        public static final String APPLICATION_NAME = "APPLICATION_NAME";
        public static final String CONSUMER_KEY = "CONSUMER_KEY";
        public static final String APPLICATION_ID = "APPLICATION_ID";
        public static final String APPLICATION_QUERY = "APPLICATION_QUERY";
        public static final String API_ID = "API_ID";
        public static final String TIER = "TIER";
        public static final String SUBSCRIPTION_ID = "SUBSCRIPTION_ID";
        public static final String DOC_ID = "DOC_ID";
        public static final String TIER_LEVEL = "TIER_LEVEL";
        public static final String ENDPOINT_ID = "ENDPOINT_ID";
        public static final String LIFECYCLE_ID = "LIFECYCLE_ID";
        public static final String WORKFLOW_REF_ID = "WORKFLOW_REFERENCE_ID";
        public static final String WORKFLOW_CATEGORY = "WORKFLOW_CATEGORY";
        public static final String COMMENT_ID = "COMMENT_ID";
        public static final String RATING_ID = "RATING_ID";
        public static final String USERNAME = "USERNAME";
    }

    /**
     * Permission related constants
     */
    public static class Permission {
        public static final int SUBSCRIBE_PERMISSION = 8;
        public static final int READ_PERMISSION = 4;
        public static final int UPDATE_PERMISSION = 2;
        public static final int DELETE_PERMISSION = 1;
        public static final String EVERYONE_GROUP = "EVERYONE";
        public static final String GROUP_ID = "groupId";
        public static final String PERMISSION = "permission";
        public static final String READ = "READ";
        public static final String UPDATE = "UPDATE";
        public static final String DELETE = "DELETE";
        public static final String SUBSCRIPTION = "SUBSCRIPTION";

    }

    /**
     * Functions related constants
     */
    public static class FunctionsConstants {
        public static final String API_ID = "apiId";
        public static final String API_NAME = "apiName";
        public static final String API_VERSION = "apiVersion";
        public static final String API_DESCRIPTION = "apiDescription";
        public static final String API_CONTEXT = "apiContext";
        public static final String API_LC_STATUS = "apiStatus";
        public static final String API_PERMISSION = "apiPermission";
        public static final String API_PROVIDER = "apiProvider";
        public static final String EVENT = "event";
        public static final String COMPONENT = "component";
        public static final String EVENT_TIME = "eventTime";
        public static final String GET = "GET";
        public static final String POST = "POST";
        public static final String PUT = "PUT";
        public static final String DELETE = "DELETE";
        public static final String HEAD = "HEAD";
        public static final String OPTIONS = "OPTIONS";
        public static final String CONTENT_TYPE = "Content-Type";
        public static final String ACCEPT = "Accept";
        public static final String USERNAME = "username";
        public static final String PASSWORD = "password";
        public static final String USER_TENANT_DOMAIN = "userTenantDomain";
        public static final String RSA_SIGNED_TOKEN = "rsaSignedToken";
        public static final String SET_COOKIE = "Set-Cookie";
        public static final String COOKIE = "Cookie";
    }

    /**
     * Workflow related constants
     */
    public static class WorkflowConstants {
        public static final String WF_TYPE_AM_SUBSCRIPTION_CREATION = "AM_SUBSCRIPTION_CREATION";
        public static final String WF_TYPE_AM_SUBSCRIPTION_DELETION = "AM_SUBSCRIPTION_DELETION";
        public static final String WF_TYPE_AM_APPLICATION_CREATION = "AM_APPLICATION_CREATION";
        public static final String WF_TYPE_AM_APPLICATION_DELETION = "AM_APPLICATION_DELETION";
        public static final String WF_TYPE_AM_APPLICATION_UPDATE = "AM_APPLICATION_UPDATE";
        public static final String WF_TYPE_AM_API_STATE = "AM_API_STATE";
        public static final String WF_TYPE_AM_APPLICATION_REGISTRATION_PRODUCTION =
                "AM_APPLICATION_REGISTRATION_PRODUCTION";
        public static final String WF_TYPE_AM_APPLICATION_REGISTRATION_SANDBOX = "AM_APPLICATION_REGISTRATION_SANDBOX";
        public static final String ATTRIBUTE_API_CUR_STATE = "apiCurrentState";
        public static final String ATTRIBUTE_API_TARGET_STATE = "apiTargetState";
        public static final String ATTRIBUTE_API_LC_INVOKER = "lcStateChangeInvoker";
        public static final String ATTRIBUTE_API_LAST_UPTIME = "lastUpdatedTime";
        public static final String ATTRIBUTE_APPLICATION_NAME = "name";
        public static final String ATTRIBUTE_APPLICATION_UPDATEDBY = "updatedUser";
        public static final String ATTRIBUTE_APPLICATION_TIER = "tier";
        public static final String ATTRIBUTE_APPLICATION_DESCRIPTION = "description";
        public static final String ATTRIBUTE_APPLICATION_PERMISSION = "permission";
        public static final String ATTRIBUTE_APPLICATION_EXISTIN_APP_STATUS = "status";
        public static final String ATTRIBUTE_APPLICATION_POLICY_ID = "policyId";

    }

    /**
     * ETags related constants
     */
    public static class ETagConstants {
        public static final String MESSAGE_DIGEST_ALGORITHM_MD5 = "MD5";
    }

    /**
     * Gateway event types
     */
    public static class GatewayEventTypes {
        public static final String API_CREATE = "API_CREATE";
        public static final String API_UPDATE = "API_UPDATE";
        public static final String API_DELETE = "API_DELETE";
        public static final String API_STATE_CHANGE = "API_STATE_CHANGE";
        public static final String ENDPOINT_CREATE = "ENDPOINT_CREATE";
        public static final String ENDPOINT_UPDATE = "ENDPOINT_UPDATE";
        public static final String ENDPOINT_DELETE = "ENDPOINT_DELETE";
        public static final String SUBSCRIPTION_CREATE = "SUBSCRIPTION_CREATE";
        public static final String SUBSCRIPTION_DELETE = "SUBSCRIPTION_DELETE";
        public static final String SUBSCRIPTION_STATUS_CHANGE = "SUBSCRIPTION_STATUS_CHANGE";
        public static final String APPLICATION_CREATE = "APPLICATION_CREATE";
        public static final String APPLICATION_UPDATE = "APPLICATION_UPDATE";
        public static final String APPLICATION_DELETE = "APPLICATION_DELETE";
        public static final String POLICY_CREATE = "POLICY_CREATE";
        public static final String POLICY_UPDATE = "POLICY_UPDATE";
        public static final String POLICY_DELETE = "POLICY_DELETE";
        public static final String BLOCK_CONDITION_ADD = "BLOCK_CONDITION_ADD";
        public static final String BLOCK_CONDITION_UPDATE = "BLOCK_CONDITION_UPDATE";
        public static final String BLOCK_CONDITION_DELETE = "BLOCK_CONDITION_DELETE";

    }

    /**
     * HTTP Status Codes
     */
    public static class HTTPStatusCodes {
        public static final int SC_100_CONTINUE = 100;
        public static final int SC_101_SWITCHING_PROTOCOLS = 101;
        public static final int SC_102_PROCESSING = 102;
        public static final int SC_200_OK = 200;
        public static final int SC_201_CREATED = 201;
        public static final int SC_202_ACCEPTED = 202;
        public static final int SC_203_NON_AUTHORITATIVE_INFORMATION = 203;
        public static final int SC_204_NO_CONTENT = 204;
        public static final int SC_205_RESET_CONTENT = 205;
        public static final int SC_206_PARTIAL_CONTENT = 206;
        public static final int SC_207_MULTI_STATUS = 207;
        public static final int SC_300_MULTIPLE_CHOICES = 300;
        public static final int SC_301_MOVED_PERMANENTLY = 301;
        public static final int SC_302_MOVED_TEMPORARILY = 302;
        public static final int SC_303_SEE_OTHER = 303;
        public static final int SC_304_NOT_MODIFIED = 304;
        public static final int SC_305_USE_PROXY = 305;
        public static final int SC_307_TEMPORARY_REDIRECT = 307;
        public static final int SC_400_BAD_REQUEST = 400;
        public static final int SC_401_UNAUTHORIZED = 401;
        public static final int SC_402_PAYMENT_REQUIRED = 402;
        public static final int SC_403_FORBIDDEN = 403;
        public static final int SC_404_NOT_FOUND = 404;
        public static final int SC_405_METHOD_NOT_ALLOWED = 405;
        public static final int SC_406_NOT_ACCEPTABLE = 406;
        public static final int SC_407_PROXY_AUTHENTICATION_REQUIRED = 407;
        public static final int SC_408_REQUEST_TIMEOUT = 408;
        public static final int SC_409_CONFLICT = 409;
        public static final int SC_410_GONE = 410;
        public static final int SC_411_LENGTH_REQUIRED = 411;
        public static final int SC_412_PRECONDITION_FAILED = 412;
        public static final int SC_413_REQUEST_TOO_LONG = 413;
        public static final int SC_414_REQUEST_URI_TOO_LONG = 414;
        public static final int SC_415_UNSUPPORTED_MEDIA_TYPE = 415;
        public static final int SC_416_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
        public static final int SC_417_EXPECTATION_FAILED = 417;
        public static final int SC_419_INSUFFICIENT_SPACE_ON_RESOURCE = 419;
        public static final int SC_420_METHOD_FAILURE = 420;
        public static final int SC_422_UNPROCESSABLE_ENTITY = 422;
        public static final int SC_423_LOCKED = 423;
        public static final int SC_424_FAILED_DEPENDENCY = 424;
        public static final int SC_500_INTERNAL_SERVER_ERROR = 500;
        public static final int SC_501_NOT_IMPLEMENTED = 501;
        public static final int SC_502_BAD_GATEWAY = 502;
        public static final int SC_503_SERVICE_UNAVAILABLE = 503;
        public static final int SC_504_GATEWAY_TIMEOUT = 504;
        public static final int SC_505_HTTP_VERSION_NOT_SUPPORTED = 505;
        public static final int SC_507_INSUFFICIENT_STORAGE = 507;
    }

    /**
     * Type of UUF apps in system
     */
    public static class APPType {
        public static final String PUBLISHER = "publisher";
        public static final String STORE = "store";
        public static final String ADMIN = "admin";
    }
}


text:
package org.hildan.livedoc.core.templating;

import java.io.IOException;
import java.util.Map;

import freemarker.core.Environment;
import freemarker.template.TemplateDirectiveBody;
import freemarker.template.TemplateDirectiveModel;
import freemarker.template.TemplateException;
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;

public abstract class LivedocLinkDirective implements TemplateDirectiveModel {

    private static final String HREF_TEMPLATE = "livedoc://%s";

    private static final String ANCHOR_OPEN_TEMPLATE = "";

    private static final String ANCHOR_CLOSE = "";

    @Override
    public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body)
            throws TemplateException, IOException {
        if (loopVars.length != 0) {
            throw new TemplateModelException("This directive doesn't allow loop variables.");
        }

        String href = String.format(HREF_TEMPLATE, getReferenceUrl(params));
        renderAnchorTag(env, body, href);
    }

    protected abstract String getReferenceUrl(Map params) throws TemplateModelException;

    private static void renderAnchorTag(Environment env, TemplateDirectiveBody body, String href)
            throws IOException, TemplateException {
        String anchorOpen = String.format(ANCHOR_OPEN_TEMPLATE, href);
        env.getOut().write(anchorOpen);
        if (body != null) {
            body.render(env.getOut());
        }
        env.getOut().write(ANCHOR_CLOSE);
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>Rio Sena</logradouro><bairro>Firenze</bairro><cidade>Barreiras</cidade><uf>BA</uf><cep>47804377</cep></feed>


text:
body{
  background: url("../images/background.jpg");
  background-size:cover;
}
.head-info{
  border: 1px;
  border-style:solid;
}
.background{
  border: 1px;
  border-style:solid;
}
#name{
  font-weight:bold;
  font-size:200%;
}
.content{
  background:#FFFFFF;
  opacity:0.9;
}
.contact ul{
  display:inline-block;
}
#contact-span{
  position:relative;
  top:-30px;
}
button{
  border:none;
  background-color: #e7e7e7;
  color: black;
}
.background h3{
  display: inline-block;
}
.editing{
  background-color:#eb9316;
  padding:10px;
  position:absolute;
  left:300px;
}
.avatar-editing{
  background-color:#eb9316;
  padding:10px;
  position:absolute;
  left:50px;
}
.editsummary{
  position:absolute;
}

.background-lists{
  list-style-type: none;
  padding:0px;

}
.background-lists li{
  display:inline-block;
  margin:5px;
  padding:5px;
  border: solid 1px;
  background-color: #9acfea;
}
.del-item{
  cursor: pointer;
}

#experience li{
  border: solid 1px;
  padding:5px;
  margin:10px;
  display:inline-block;
  clear:right;
}
#projects li{
  border: solid 1px;
  padding:5px;
  margin:10px;
  display:inline-block;
  clear: right;
}
#education li{
  border: solid 1px;
  padding:5px;
  margin:10px;
  display:inline-block;
  clear:right;
}
.year-input{
  width:60px;
}
.full-width{
  width:100%;
}
.edit-button{
  position:absolute;
}


text:
public class HardTyre : Tyre
{
    public HardTyre(double hardness) : base("Hard", hardness)
    {
    }
}


text:
// ----- this file has been automatically generated - do not edit
import { Int32 } from "node-opcua-basic-types"
import { ExtensionObject } from "node-opcua-extension-object"
import { DTStructure } from "node-opcua-nodeset-ua/source/dt_structure"
/**
 * |           |                                                  |
 * |-----------|--------------------------------------------------|
 * | namespace |http://opcfoundation.org/UA/AutoID/               |
 * | nodeClass |DataType                                          |
 * | name      |3:LocalCoordinate                                 |
 * | isAbstract|false                                             |
 */
export interface DTLocalCoordinate extends DTStructure {
  x: number; // Double ns=0;i=11
  y: number; // Double ns=0;i=11
  z: number; // Double ns=0;i=11
  /** Optional*/
  timestamp: Date; // DateTime ns=0;i=294
  /** Optional*/
  dilutionOfPrecision: number; // Double ns=0;i=11
  /** Optional*/
  usefulPrecision: Int32; // Int32 ns=0;i=6
}
export interface UDTLocalCoordinate extends ExtensionObject, DTLocalCoordinate {};


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="stylesheet" href="http://homepage.ntu.edu.tw/~r05921104/css/main.css">
    <link rel="stylesheet" href="http://homepage.ntu.edu.tw/~r05921104/css/self.css">
    <title>Professor Sy-Yen Kuo</title>

	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

Sy-Yen Kuo

Welcome to Sy-Yen Kuo Personal Website

            <button class="btn navar-button">Home</button>
            <button class="btn navar-button">Publications</button>
            <button class="btn navar-button">Awards and Honors</button>
            <button class="btn navar-button">Editorship</button>
            <button class="btn navar-button">Activities</button>
            <button class="btn navar-button">Projects</button>

Activities

監事,國際電機電子工程師學會中華民國分會(IEEE Taipei Secti
on),2015-present

常務監事,國際電機電子工程師學會中華民國分會(IEEE Taipei S
ection),2013-2014

理事,國際電機電子工程師學會中華民國分會(IEEE Taipei Secti
on,2003 - 2006, 2011- 2012

理事長,國際電機電子工程師學會中華民國分會(IEEE Taipei Sec
tion),2011 - 2012

監事,中國電機工程師學會, 20105- present

理事, 中國電機工程師學會, 2010 - 2014

主持人, 教育部資通訊人才培育先導型計畫--互動多媒體內容製作
技術教學推動聯盟中心, 2011/4 - 2014/3

主持人,台灣電腦發展先驅口述歷史計畫(與美國加州矽谷電腦博)
,2010-2011

IEEE International Conference on Computer Design (ICCD)

主持人, 教育部RFID科技及應用人才培育先導型計畫--RFID教育暨研發實驗資源中心, 2007/9 - 200/3

主持人, 教育部資通訊人才培育先導型計畫--數位家庭教學推動聯盟中心, 2007/9 - 2011/3

主持人, 教育部校園安全計畫推動辦公室, 2009/3 - 2009/12

資訊領域召集人,經濟部技術處鼓勵中小企業開發新技術推動計畫(SBIR), 2006 - 2008

評鑑暨規劃委員, 系所評鑑電腦科學與資訊工程學門, 財團法人高等教育評鑑中心, 2006 – present

國科會傑出獎複審委員

國科會計畫主持人研究成果審議委員

宏碁基金會龍騰微笑創業競賽評審委員,2011-2017

光寶創新獎評審委員,2016

萬潤創新創意競賽評審委員,2012-2016

國科會資訊學門規劃委員暨計畫複審委員

國家晶片系統設計中心諮詢委員,2005 - 2007

上櫃審議委員,財團法人證券櫃檯買賣中心,2006 - 2008

主任委員, 論文委員會, 中華民國電機工程師學會, 2001 - 2004

資訊組召集人, 教育部全國技術學院評鑑, 2002 - 2006

委員, 會員委員會, 中國工程師學會, 2005 - 2008

委員, 論文委員會, 中國工程師學會, 1997 - 2005

經濟部技術處鼓勵中小企業開發新技術推動計畫(SBIR) 審查委員, 2004 - 2016

經濟部鼓勵國內、外企業在台設立研發中心審查委員,2009 - 2015

經濟部科技研究發展專案優質平價新興市場產品研發與輔導計畫審查委員,2010 - 2015

經濟部法人科技專案計畫審查委員, 2005 - 2010

經濟部產業科技發展獎審查委員, 2007,2009, 2010

中科院軍民通用科技釋商計畫審查委員

理事,建國中學校友會

Consultant, Avery Design Co., Ltd.(亞睿系統), 1998 - present

FORU-TEK, Co., Ltd (馥鈺科技), 2015 – present

Consultant, InterEpoch Co., Ltd.(馳元科技), 2000 - 2005

Consultant, QIC Systems Corp.(寬華資訊), 1999 - 2000

Consultant, Chung Shan Institute of Science and Technology (中山科學院), 1995 - 1996

Member, IEEE Computer Society Board of Governors, 2017

Member, IEEE Computer Society Education Award Committee, 2015-2016

Member, IFIP Working Group 10.4 on Dependable Computing and Fault Tolerance, 2011-present

Member, IEEE Computer Society Fellows Committee, 2007-2010, 2016

Member, IEEE Reliability Society Fellows Committee, 2009, 2010

Member, Steering Committee, IEEE Technical Committee on Fault Tolerant Computing, 2005 – 2009

Chair, Steering Committee, Pacific Rim International Symposium on Dependable Computing (PRDC), 2001 – 2011

Keynote Speech, 2016 International Conference on Behavior Engineering (ICBE 2016)

Keynote Speech, 2015 IEEE Pacific Rim International Symposium on Dependable Computing (PRDC2015)

Conference Coordinator, 2011 41st IEEE/IFIP International Conference on Dependable Systems and Networks (DSN-2011)

Keynote Speech, 2008 Asia-Pacific International Symposium on Advanced Reliability and Maintenance Modeling (APARM2008)

Keynote Speech, 2004 IEEE Pacific Rim International Symposium on Dependable Computing (PRDC2004)

Vice Chair candidate, IEEE Technical Committee on Fault-Tolerant Computing.

General Co-Chair, 2005 Pacific Rim International Symposium on Dependable Computing (PRDC-2005)

Program Chair, Technical Program Committee, 2009 International Conference on Future Information Networks

香港研究資助局外審委員, External Assessor, Research Grants Council, Hong Kong, 2001 - present.

Reviewer, Swiss National Science Foundation, 2007, 2015

Member, Steering Committee, Pacific Rim International Symposium on Dependable Computing (PRDC), 1999 - present

Member, International Advisory Committee, International Conference on Quality Reliability and IT (ICQRIT 2003)

Program Chair, Technical Program Committee, 2002 International Computer Symposium, Workshop on Computer Systems

Program Vice Chair, Technical Program Committee, 2000 International Conference on Distributed Computing Systems(ICDCS-2000)

Program Chair, Technical Program Committee, 1997 Pacific Rim International Symposium on Fault-Tolerant Systems(PRFTS-97)

Officer, Professional Development, IEEE Taipei Section, 1999-2001

Technical program committee member of the following international conferences:

International Conference on Dependable Systems and Networks (DSN)

Symposium on Reliable Distributed Systems (SRDS)

International Conference on World Wide Web (WWW)

International Computer Software and Applications Conference (COMPSAC)

IEEE Global Telecommunications Conference (GLOBECOM)

Pacific Rim International Symposium on Dependable Computing (PRDC)

International Symposium on Fault-Tolerant Computing (FTCS)

International Symposium on Software Reliability Engineering (ISSRE)

International Conference on Parallel Processing (ICPP)

International Conference on Parallel and Distributed Systems (ICPADS)

International Symposium on Parallel and Distributed Processing and Applications (ISPA)

International Computer Symposium (ICS)

IEEE International Conference on Computer-Aided Design (ICCAD)

IEEE International Conference on Computer Design (ICCD)

Pacific Rim International Symposium on Fault-Tolerant Systems (PRFTS)

IEEE International Conference on Wafer Scale Integration(WSI)

Technical referee of the following international journals: IEEE Transactions on Computers, IEEE Transactions on Dependable and Secure Computing, IEEE Journal of Selected Areas in Communications, IEEE Transactions on Parallel and Distributed Systems, IEEE/ACM Transactions on Networking, IEEE Transactions on Software Engineering, IEEE Transactions on Reliability, IEEE Transactions on CAD, IEEE Transactions on VLSI systems, IEEE/OSA Journal of Lightwave Technology, IEEE Computer, IEEE Journal of Solid State Circuits, Journal of Parallel and Distributed Computing, IEE Proceedings, Computers and Digital Techniques, The Transactions of the Society for Computer Simulation, Journal of Information Science and Engineering National Science F
oundation(USA), etc.

2017 @ NTU DSN Lab, All rights reserved


text:
package com.tomtom.speedtools.json;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * This class may serve as a simple base class to implement toString() and equals() (using the JSON string
 * representation).
 */
public class JsonBased {

    public boolean canEqual(@Nonnull final Object obj) {
        assert obj != null;
        return obj instanceof JsonBased;
    }

    @Override
    public boolean equals(@Nullable final Object obj) {
        boolean eq;
        if (this == obj) {
            eq = true;
        } else if ((obj != null) && (obj instanceof JsonBased)) {
            final JsonBased that = (JsonBased) obj;
            eq = that.canEqual(this);
            eq = eq && toString().equals(that.toString());
        } else {
            eq = false;
        }
        return eq;
    }

    @Override
    public int hashCode() {
        return toString().hashCode();
    }

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


text:
package org.dagre.euler

import org.dagre.euler.util.Utils

import scala.collection.mutable

/**
  * Euler Problem 10 - Summation of primes
  *
  * The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
  * Find the sum of all the primes below two million.
  *
  * @author daniel.grech
  */
object Euler10 {
  def apply(max: Int): Long = (2L to max).toStream.filter(Utils.isPrime).sum
}


text:
package org.apache.mina.transport.socket.nio;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.SocketAddress;
import java.nio.channels.ClosedSelectorException;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.Collection;
import java.util.Iterator;
import java.util.concurrent.Executor;

import org.apache.mina.core.polling.AbstractPollingIoAcceptor;
import org.apache.mina.core.service.IoAcceptor;
import org.apache.mina.core.service.IoProcessor;
import org.apache.mina.core.service.IoService;
import org.apache.mina.core.service.SimpleIoProcessorPool;
import org.apache.mina.core.service.TransportMetadata;
import org.apache.mina.transport.socket.DefaultSocketSessionConfig;
import org.apache.mina.transport.socket.SocketAcceptor;

/**
 * {@link IoAcceptor} for socket transport (TCP/IP).  This class
 * handles incoming TCP/IP based socket connections.
 *
 * @author Apache MINA Project
 */
public final class NioSocketAcceptor extends AbstractPollingIoAcceptor<NioSession, ServerSocketChannel>
    implements SocketAcceptor {

    private volatile Selector selector;

    /**
     * Constructor for {@link NioSocketAcceptor} using default parameters (multiple thread model).
     */
    public NioSocketAcceptor() {
        super(new DefaultSocketSessionConfig(), NioProcessor.class);
        ((DefaultSocketSessionConfig) getSessionConfig()).init(this);
    }

    /**
     * Constructor for {@link NioSocketAcceptor} using default parameters, and
     * given number of {@link NioProcessor} for multithreading I/O operations.
     *
     * @param processorCount the number of processor to create and place in a
     * {@link SimpleIoProcessorPool}
     */
    public NioSocketAcceptor(int processorCount) {
        super(new DefaultSocketSessionConfig(), NioProcessor.class, processorCount);
        ((DefaultSocketSessionConfig) getSessionConfig()).init(this);
    }

    /**
    *  Constructor for {@link NioSocketAcceptor} with default configuration but a
     *  specific {@link IoProcessor}, useful for sharing the same processor over multiple
     *  {@link IoService} of the same type.
     * @param processor the processor to use for managing I/O events
     */
    public NioSocketAcceptor(IoProcessor<NioSession> processor) {
        super(new DefaultSocketSessionConfig(), processor);
        ((DefaultSocketSessionConfig) getSessionConfig()).init(this);
    }

    /**
     *  Constructor for {@link NioSocketAcceptor} with a given {@link Executor} for handling
     *  connection events and a given {@link IoProcessor} for handling I/O events, useful for
     *  sharing the same processor and executor over multiple {@link IoService} of the same type.
     * @param executor the executor for connection
     * @param processor the processor for I/O operations
     */
    public NioSocketAcceptor(Executor executor, IoProcessor<NioSession> processor) {
        super(new DefaultSocketSessionConfig(), executor, processor);
        ((DefaultSocketSessionConfig) getSessionConfig()).init(this);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void init() throws Exception {
        selector = Selector.open();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void destroy() throws Exception {
        if (selector != null) {
            selector.close();
        }
    }

    /**
     * {@inheritDoc}
     */
    public TransportMetadata getTransportMetadata() {
        return NioSocketSession.METADATA;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public InetSocketAddress getLocalAddress() {
        return (InetSocketAddress) super.getLocalAddress();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public InetSocketAddress getDefaultLocalAddress() {
        return (InetSocketAddress) super.getDefaultLocalAddress();
    }

    /**
     * {@inheritDoc}
     */
    public void setDefaultLocalAddress(InetSocketAddress localAddress) {
        setDefaultLocalAddress((SocketAddress) localAddress);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected NioSession accept(IoProcessor<NioSession> processor, ServerSocketChannel handle) throws Exception {

        SelectionKey key = handle.keyFor(selector);

        if ((key == null) || (!key.isValid()) || (!key.isAcceptable())) {
            return null;
        }

        // accept the connection from the client
        SocketChannel ch = handle.accept();

        if (ch == null) {
            return null;
        }

        return new NioSocketSession(this, processor, ch);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected ServerSocketChannel open(SocketAddress localAddress) throws Exception {
        // Creates the listening ServerSocket
        ServerSocketChannel channel = ServerSocketChannel.open();

        boolean success = false;

        try {
            // This is a non blocking socket channel
            channel.configureBlocking(false);

            // Configure the server socket,
            ServerSocket socket = channel.socket();

            // Set the reuseAddress flag accordingly with the setting
            socket.setReuseAddress(isReuseAddress());

            // and bind.
            socket.bind(localAddress, getBacklog());

            // Register the channel within the selector for ACCEPT event
            channel.register(selector, SelectionKey.OP_ACCEPT);
            success = true;
        } finally {
            if (!success) {
                close(channel);
            }
        }
        return channel;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected SocketAddress localAddress(ServerSocketChannel handle) throws Exception {
        return handle.socket().getLocalSocketAddress();
    }

    /**
      * Check if we have at least one key whose corresponding channels is
      * ready for I/O operations.
      *
      * This method performs a blocking selection operation.
      * It returns only after at least one channel is selected,
      * this selector's wakeup method is invoked, or the current thread
      * is interrupted, whichever comes first.
      *
      * @return The number of keys having their ready-operation set updated
      * @throws IOException If an I/O error occurs
      * @throws ClosedSelectorException If this selector is closed
      */
    @Override
    protected int select() throws Exception {
        return selector.select();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected Iterator<ServerSocketChannel> selectedHandles() {
        return new ServerSocketChannelIterator(selector.selectedKeys());
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void close(ServerSocketChannel handle) throws Exception {
        SelectionKey key = handle.keyFor(selector);

        if (key != null) {
            key.cancel();
        }

        handle.close();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void wakeup() {
        selector.wakeup();
    }

    /**
     * Defines an iterator for the selected-key Set returned by the
     * selector.selectedKeys(). It replaces the SelectionKey operator.
     */
    private static class ServerSocketChannelIterator implements Iterator<ServerSocketChannel> {
        /** The selected-key iterator */
        private final Iterator<SelectionKey> iterator;

        /**
         * Build a SocketChannel iterator which will return a SocketChannel instead of
         * a SelectionKey.
         *
         * @param selectedKeys The selector selected-key set
         */
        private ServerSocketChannelIterator(Collection<SelectionKey> selectedKeys) {
            iterator = selectedKeys.iterator();
        }

        /**
         * Tells if there are more SockectChannel left in the iterator
         * @return true if there is at least one more
         * SockectChannel object to read
         */
        public boolean hasNext() {
            return iterator.hasNext();
        }

        /**
         * Get the next SocketChannel in the operator we have built from
         * the selected-key et for this selector.
         *
         * @return The next SocketChannel in the iterator
         */
        public ServerSocketChannel next() {
            SelectionKey key = iterator.next();

            if (key.isValid() && key.isAcceptable()) {
                return (ServerSocketChannel) key.channel();
            }

            return null;
        }

        /**
         * Remove the current SocketChannel from the iterator
         */
        public void remove() {
            iterator.remove();
        }
    }
}


text:
$( document ).ready (function() {

  var update = function(){
    $( "#temp" ).text(thermostat.temperature);
    $( "#usage" ).attr('style','color:'+ thermostat.energyUsage());
    $( "#weather_temp" ).text(weathertemp);
    $( "#weather_name" ).text(weathername)
  }

  var pathArray = window.location.search;
  var urlCity = pathArray.replace('?city=', '').replace('&Submit=Submit', '') || 'London';
  var weathertemp;
  var weathername;
  $.ajax('http://api.openweathermap.org/data/2.5/weather?q=' + urlCity, {
    success: function(data) {
      weathertemp = Math.round(data.main.temp - 273.15);
      weathername = data.name;
      update();
    }
  });

  $.ajax('https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=' + urlCity +'&userip=185.53.227.70', {
    success: function(image) {
      console.log(imgurl = image.responseData.results.url);
      update();
    }
  });

  update();

  $( "#increase" ).click(function( event ) {

    thermostat.increaseTemp();
    update();

    });

  $( "#decrease" ).click(function( event ) {

    thermostat.decreaseTemp();
    update();

    });

  $( "#reset" ).click(function( event ) {

    thermostat.reset();
    update();

    });

    $( "#powersave" ).click(function( event ) {

    $( "#powersave" )[0].checked ? thermostat.powerSavingOn() : thermostat.powerSavingOff();
    update();

    });

});


text:
namespace fhicl { class ParameterSet; }

namespace {

  using namespace fhicl;
  struct Config {
    Atom<unsigned long> branchType { Name("branchType") };
  };

}

namespace arttest {

  class ToyProductProducerMultiput : public art::EDProducer {

    art::BranchType branchType_;

  public:

    using Parameters = EDProducer::Table<Config>;
    explicit ToyProductProducerMultiput( Parameters const& p )
      : branchType_( art::BranchType( p().branchType() ) )
    {
      switch (branchType_) {
      case art::InEvent:
        produces<IntProduct>();
        break;
      case art::InSubRun:
        produces<IntProduct, art::InSubRun>();
        break;
      case art::InRun:
        produces<IntProduct, art::InRun>();
        break;
      default:
        throw art::Exception(art::errors::LogicError)
          << "Unknown branch type "
          << branchType_
          << ".\n";
      }
    }

    void produce(art::Event &e) override
    {
      if ( branchType_ != art::InEvent ) return;
      e.put( std::make_unique<IntProduct>(1) );
      e.put( std::make_unique<IntProduct>(2) );
    }

    void endSubRun(art::SubRun &sr) override
    {
      if ( branchType_ != art::InSubRun ) return;
      sr.put( std::make_unique<IntProduct>(3), art::subRunFragment() );
      sr.put( std::make_unique<IntProduct>(4), art::subRunFragment() );
    }

    void endRun(art::Run &r) override
    {
      if ( branchType_ != art::InRun ) return;
      r.put( std::make_unique<IntProduct>(5), art::runFragment() );
      r.put( std::make_unique<IntProduct>(6), art::runFragment() );
    }

  };

}

DEFINE_ART_MODULE(arttest::ToyProductProducerMultiput)


text:
// Author: sligocki@google.com (Shawn Ligocki)

#include "net/instaweb/rewriter/public/css_minify.h"

#include "pagespeed/kernel/base/google_message_handler.h"
#include "pagespeed/kernel/base/gtest.h"
#include "pagespeed/kernel/base/scoped_ptr.h"
#include "pagespeed/kernel/base/string.h"
#include "pagespeed/kernel/base/string_writer.h"
#include "webutil/css/parser.h"

namespace net_instaweb {

namespace {

class CssMinifyTest : public ::testing::Test {
 protected:
  CssMinifyTest() {}
  virtual ~CssMinifyTest() {}

  void RewriteCss(const StringPiece& in_text, GoogleString* out_text) {
    out_text->clear();

    // Parse CSS.
    Css::Parser parser(in_text);
    parser.set_preservation_mode(true);
    parser.set_quirks_mode(false);
    scoped_ptr<Css::Stylesheet> stylesheet(parser.ParseRawStylesheet());

    if (parser.errors_seen_mask() != Css::Parser::kNoError) {
      in_text.CopyToString(out_text);
      return;
    }

    // Re-serialize
    StringWriter out_writer(out_text);
    EXPECT_TRUE(CssMinify::Stylesheet(*stylesheet, &out_writer, &handler_));
  }

  GoogleMessageHandler handler_;
};

TEST_F(CssMinifyTest, RewriteCssIncompleteUnicode) {
  // Test that a css string with an incomplete unicode character doesn't hang.
  // This string should not get minified either due to the error in it.
  static const unsigned char kCssStringData[] = {
      64, 109, 101, 100, 105, 97,  32,  40, 106,
      97, 120, 45,  119, 105, 100, 116, 104, 58,
      32, 88,  200, 194, 143, 135, 41,  32, 0};
  const char* css_string(reinterpret_cast<const char*>(kCssStringData));
  // This string is `echo "QG1lZGlhIChqYXgtd2lkdGg6IFjIwo+HKSA=" |base64 -d`
  GoogleString rewritten;
  RewriteCss(css_string, &rewritten);
  EXPECT_STREQ(rewritten, css_string) << "Should not hang";
}

TEST_F(CssMinifyTest, MinifyStylesheeetCollectingUrls) {
  const char kCss[] =
      ".a {\n"
      "  background-color: darkgreen;\n"
      "  background-image: url(foo.png);\n"
      "}";
  GoogleString minified;
  StringWriter writer(&minified);
  StringVector urls;
  CssMinify minify(&writer, &handler_);
  minify.set_url_collector(&urls);
  EXPECT_TRUE(minify.ParseStylesheet(kCss));
  ASSERT_EQ(1, urls.size());
  EXPECT_STREQ("foo.png", urls[0]);
  EXPECT_STREQ(".a{background-color:#006400;background-image:url(foo.png)}",
               minified);
}

TEST_F(CssMinifyTest, MinifyImportStylesheeetCollectingUrls) {
  const char kCss[] = "@import   'foo.png';";
  GoogleString minified;
  StringWriter writer(&minified);
  StringVector urls;
  CssMinify minify(&writer, &handler_);
  minify.set_url_collector(&urls);
  EXPECT_TRUE(minify.ParseStylesheet(kCss));
  ASSERT_EQ(1, urls.size());
  EXPECT_STREQ("foo.png", urls[0]);
  EXPECT_STREQ("@import url(foo.png);", minified);
}

TEST_F(CssMinifyTest, MinifyInvalid) {
  const char kCss[] = "{";
  GoogleString minified;
  StringWriter writer(&minified);
  CssMinify minify(&writer, &handler_);
  EXPECT_FALSE(minify.ParseStylesheet(kCss));
}

TEST_F(CssMinifyTest, DoNotFixBadColorsOrUnits) {
  const char kCss[] =
      ".a {\n"
      "  width: 10;\n"
      "  height: 20px;;\n"
      "  background-color: 0f0f0f;\n"
      "  foreground-color: #f0f0f0;\n"
      "}";
  GoogleString minified;
  StringWriter writer(&minified);
  CssMinify minify(&writer, &handler_);
  EXPECT_TRUE(minify.ParseStylesheet(kCss));

  // Note that we don't "fix" the '10' by appending a 'px', or the
  // background-color by adding a '#'.  In quirks-mode we would add the #.
  EXPECT_STREQ(
      ".a{width:10;height:20px;"
      "background-color: 0f0f0f;"  // Missing # not added, space is not removed.
      "foreground-color:#f0f0f0}",
      minified);
}

TEST_F(CssMinifyTest, RemoveZeroLengthButNotTimeOrPercentSuffix) {
  const char kCss[] =
      ".a {\n"
      "  width: 0px;\n"
      "  height: 0%;\n"
      "  -moz-transition-delay: 0s, 0s;\n"
      "}";
  GoogleString minified;
  StringWriter writer(&minified);
  CssMinify minify(&writer, &handler_);
  EXPECT_TRUE(minify.ParseStylesheet(kCss));
  // TODO(jmarantz): this CSS is not well minified.  We should strip
  // the spaces around the comma.
  EXPECT_STREQ(".a{width:0;height:0%;-moz-transition-delay:0s , 0s}", minified);
}

TEST_F(CssMinifyTest, ParsingAndMinifyingBackgroundAndFont) {
  const char kCss[] =
      ".a {\n"
      "  font:normal 16px Foo, sans-serif;\n"
      "}\n"
      "body {\n"
      "  background: #fff;\n"
      "}";
  Css::Parser parser(kCss);
  std::unique_ptr<Css::Stylesheet> stylesheet(parser.ParseStylesheet());
  GoogleString minified;
  StringWriter writer(&minified);

  EXPECT_TRUE(CssMinify::Stylesheet(*stylesheet, &writer, &handler_));
  // TODO(peleyal): We are adding more data than required. Should be:
  // ".a{font:normal 16px Foo,sans-serif}"
  // "body{background:#fff}"
  EXPECT_STREQ(
      ".a{font:16px Foo,sans-serif;font-style:normal;font-variant:normal;"
      "font-weight:normal;font-size:16px;line-height:normal;"
      "font-family:Foo,sans-serif}"
      "body{background:#fff;background-color:#fff;background-image:none;"
      "background-repeat:repeat;background-attachment:scroll;"
      "background-position-x:0%;background-position-y:0%}",
      minified);
}

TEST_F(CssMinifyTest, ParsingAndMinifingViewportUnits) {
  const char kCss[] =
      ".a {\n"
      "  margin-top: 70vh;\n"
      "  margin-bottom: 20vw;\n"
      "}\n";

  Css::Parser parser(kCss);
  std::unique_ptr<Css::Stylesheet> stylesheet(parser.ParseStylesheet());
  GoogleString minified;
  StringWriter writer(&minified);

  EXPECT_TRUE(CssMinify::Stylesheet(*stylesheet, &writer, &handler_));
  EXPECT_STREQ(".a{margin-top:70vh;margin-bottom:20vw}", minified);
}

TEST_F(CssMinifyTest, StraySingleQuote1) {
  static const char kCss[] =
      ".view_all a{\n"
      "  display: block;\n"
      "  'width: 100%;\n"
      "  padding: 5px 0 1px 0"
      "}";

  Css::Parser parser(kCss);
  std::unique_ptr<Css::Stylesheet> stylesheet(parser.ParseStylesheet());
  GoogleString minified;
  StringWriter writer(&minified);

  EXPECT_TRUE(CssMinify::Stylesheet(*stylesheet, &writer, &handler_));
  // There are two bits of error recovery happening here:
  // 1) error recovery for the unclosed 'width string eats all the way until
  //    the end of line.
  // 2) error recovery for the declaration starting with 'width eats all the way
  //    until the next semicolon or a closing } (skipping matching ones before)
  // --- which is after the padding declaration, since the first semicolon is
  // just a part of the 'width... string
  EXPECT_STREQ(".view_all a{display:block}", minified);
}

TEST_F(CssMinifyTest, StraySingleQuote2) {
  static const char kCss[] =
      ".view_all a{\n"
      "  display: block;\n"
      "  'width: 100%;\n"
      "  padding: 5px 0 1px 0;"
      "}";

  GoogleString minified;
  StringWriter writer(&minified);
  CssMinify minify(&writer, &handler_);
  StringVector urls;
  minify.set_url_collector(&urls);
  ASSERT_TRUE(minify.ParseStylesheet(kCss));
  EXPECT_STREQ(".view_all a{display:block;'width: 100%;\n"
               "  padding: 5px 0 1px 0}",
               minified);
}

TEST_F(CssMinifyTest, StraySingleQuote3) {
  // Non-permissive mode, should drop anything on the 'width line till \n,
  // and then continue recovery until the next semicolon.
  static const char kCss[] =
      ".view_all a{\n"
      "  display: block;\n"
      "  'width: 100%; border:1px solid red;\n"
      "  padding: 5px 0 1px 0;"
      "  margin: 1px;"
      "}";

  Css::Parser parser(kCss);
  std::unique_ptr<Css::Stylesheet> stylesheet(parser.ParseStylesheet());
  GoogleString minified;
  StringWriter writer(&minified);

  EXPECT_TRUE(CssMinify::Stylesheet(*stylesheet, &writer, &handler_));
  EXPECT_STREQ(".view_all a{display:block;margin:1px}", minified);
}

// checking whether unit is retained for zero value in calc function
TEST_F(CssMinifyTest, CalcFunctionWithZeroValueAndUnit) {
  static const char kCss[] =
      "@font-face {\n"
      " width: calc(600px - 0px)"
      "}";

  GoogleString minified;
  StringWriter writer(&minified);
  CssMinify minify(&writer, &handler_);

  EXPECT_TRUE(minify.ParseStylesheet(kCss));
  EXPECT_HAS_SUBSTR("width:calc(600px - 0px)", minified);
}

// checking unicode-range descriptor minification
TEST_F(CssMinifyTest, CssUnicodeRangeDescriptor) {
  static const char kCss[] =
      "@font-face {\n"
      " unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n"
      "}";

  GoogleString minified;
  StringWriter writer(&minified);
  CssMinify minify(&writer, &handler_);

  EXPECT_TRUE(minify.ParseStylesheet(kCss));
  EXPECT_HAS_SUBSTR("unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116",
      minified);
}

}  // namespace
}  // namespace net_instaweb


text:
angular.module('queup.class_info', [])

.controller('Class_infoController', function($rootScope, $scope, $state,$stateParams, teacherData){
  //console.dir($stateParams, "::stateParams")

  //console.log('rootscope.current class: ', $rootScope.currentClass)
  var currentClass = teacherData.get('currentClass');
  $scope.className = currentClass.name;
  $scope.classID = currentClass.classID;
  console.log('currentClass:', currentClass)
});

// todo: add remove class functionality


text:
using Cas.Common.WPF.Interfaces;
using EFSM.Domain;
using System.Windows;
using System.Windows.Input;

namespace EFSM.Designer.ViewModel
{
    public class SimulationStateMachineViewModel : StateMachineViewModel
    {
        public SimulationStateMachineViewModel(StateMachine model, IViewService viewService, IMessageBoxService messageBoxService) :
            base(model, viewService, null, null, messageBoxService, true)
        {
            this.IsPointerMode = false;
        }

        public override void OnDrop(DragEventArgs e)
        {
        }

        public override void OnPreviewMouseLeftButtonUp(MouseEventArgs e)
        {
        }
    }
}


text:
class AddCircuitBreakerPropertiesToApplicationSettings < ActiveRecord::Migration[4.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def change
    add_column :application_settings,
               :circuitbreaker_failure_count_threshold,
               :integer,
               default: 160
    add_column :application_settings,
               :circuitbreaker_failure_wait_time,
               :integer,
               default: 30
    add_column :application_settings,
               :circuitbreaker_failure_reset_time,
               :integer,
               default: 1800
    add_column :application_settings,
               :circuitbreaker_storage_timeout,
               :integer,
               default: 30
  end
end


text:
using Orchard.ContentManagement.Handlers;
using Orchard.Data;
using Szmyd.Orchard.Modules.Menu.Models;

namespace Szmyd.Orchard.Modules.Menu.Handlers
{
    public class MenuWidgetPartHandler : ContentHandler {
        public MenuWidgetPartHandler(IRepository<MenuWidgetPartRecord> repository)
        {
            Filters.Add(StorageFilter.For(repository));
        }
    }
}