text:
body {
	margin:0;
	padding:0;
	background-image:url('../images/bg.png');
	background-repeat:repeat;
	font-size:12px;
	color:#666666;
	font-family:Verdana;
}
.clear { clear:both; }
.fld-left { float:left; width:300px; }
.fld-right { float:left; text-align:left; }
.searchkey {
	padding:10px;
}
.autoscroll { height:200px; overflow:scroll; border:solid 1px #cccccc;}
a { text-decoration:none; }
.errornotif { color:#ff0000; font-style:italic; padding:5px; }
button, input[type="button"], input[type="submit"], input[type="reset"] {
	border:solid 1px #5a799b;
	padding:3px 10px 3px 10px;
	border-radius:4px;
	background: #7899bc;
	background: -moz-linear-gradient(top,  #7899bc 1%, #51779f 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#7899bc), color-stop(100%,#51779f));
	background: -webkit-linear-gradient(top,  #7899bc 1%,#51779f 100%);
	background: -o-linear-gradient(top,  #7899bc 1%,#51779f 100%);
	background: -ms-linear-gradient(top,  #7899bc 1%,#51779f 100%);
	background: linear-gradient(to bottom,  #7899bc 1%,#51779f 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7899bc', endColorstr='#51779f',GradientType=0 );
	font-size:11px;
	color:#ffffff;
	cursor:pointer;
}

fieldset { border:dotted 1px #cccccc; margin:10px 10px 20px 10px; padding:10px; }
legend { color:#000000; font-size:11px; font-weight:bold; border:dotted 1px #cccccc; padding:5px 10px 5px 10px; border-radius:6px;}

form { margin:0; padding:0; }

.search-input { padding:4px 5px 4px 5px; font-size:12px; color:#666666; border:solid 1px #dae1e8;}
.search-select { padding:3px 5px 3px 5px; font-size:12px; color:#666666;border:solid 1px #dae1e8;}
.input-form { padding:5px; font-size:12px; color:#666666;border:solid 1px #c4c9ce; width:98%;}
.input-select { padding:5px; font-size:12px; color:#666666;border:solid 1px #c4c9ce; }

#container { margin:0; padding:0; }
#header { background-image:url('../images/bg-top.png'); background-repeat: repeat-x; height:40px; box-shadow:2px 0 5px #000; margin-bottom:5px; position:relative; z-index:999;}

.header-left { float:left; width:400px; padding:4px 0 0 10px;}
.header-right { float:right; width:auto; padding:12px 80px 0 0; color:#ffffff;}
.header-right a { color:#ffffff; text-decoration:none; }
.header-right a:hover { color:#cccccc; text-decoration:none; }

.hr1 { float:left; width:15px; margin-right:5px;}
.hr2 { float:left; width:50px; margin-right:20px;}
.hr3 { float:left; width:15px; margin-right:5px;}
.hr4 { float:left; width:50px; }
.hr5 { float:left; width:80px; margin-right:20px; }
#content { margin:0; padding:0; position:relative; z-index:1; margin-top:-5px;}
.content-left { float:left; width:21%; }
.content-right { float:right; width:79%; }

.cl-top { padding:5px; height:auto;}
.clt-left { border:dotted 1px #ccc; padding:3px; width:32px; margin-right:4px; float:left;}
.clt-right { padding:3px; float:right; width: 79%; font-size:11px;}
.clt-right h4 { padding:0; margin:0; font-size:12px; color:#2b588d; }
.cl-bottom { background-color:#e9edf1; color:#2b587a; border-top:solid 1px #dae1e8; border-right:solid 1px #dae1e8; border-left:solid 1px #dae1e8;}
.cl-chart { background:none; margin-top:10px; }

.cr-top { background-color:#e9edf1; color:#8b8ba0; padding:5px; height:42px; border:solid 1px #dae1e8;}
.cr-top h4 { padding:0; margin:0; font-size:12px; color:#2b588d; }
.cr-top .breadcrumb {     font-size: 11px;    /* margin-top: 10px; */    color: #666;    text-shadow: 1px 0 1px #dddddd;    padding: 0px;    background: none;    margin: 0;}
.cr-top .breadcrumb a { color:#999; text-decoration:none; }
.cr-top .breadcrumb a:hover { color:#2b588d; text-decoration:none; }
.crt-left { float:left; }
.crt-right { float:right; font-size:11px; padding:7px 10px 0 0;}

.cr-bottom { padding:10px; margin:0; }
.crb-box {  margin-bottom:10px; border:solid 1px #dae1e8; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; box-shadow:0px 0px 8px #ddd; -webkit-box-shadow:0px 0px 8px #ddd; -moz-box-shadow:0px 0px 8px #ddd; -ms-box-shadow:0px 0px 8px #ddd; -o-box-shadow:0px 0px 8px #ddd; background-color:#ffffff;}

.crb-boxSmall { margin-bottom:10px; border:solid 1px #dae1e8; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; box-shadow:0px 0px 8px #ddd; -webkit-box-shadow:0px 0px 8px #ddd; -moz-box-shadow:0px 0px 8px #ddd; -ms-box-shadow:0px 0px 8px #ddd; -o-box-shadow:0px 0px 8px #ddd; background-color:#ffffff; float:left; width:60%; margin-bottom:10px;}
.crb-boxSmall2 { margin-bottom:10px; border:solid 1px #dae1e8; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; box-shadow:0px 0px 8px #ddd; -webkit-box-shadow:0px 0px 8px #ddd; -moz-box-shadow:0px 0px 8px #ddd; -ms-box-shadow:0px 0px 8px #ddd; -o-box-shadow:0px 0px 8px #ddd; background-color:#ffffff; float:right; width:38.6%; margin:0 0 0 0; margin-bottom:10px;}
.crb-boxSmall3 { margin-bottom:10px; border:solid 1px #dae1e8; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; box-shadow:0px 0px 8px #ddd; -webkit-box-shadow:0px 0px 8px #ddd; -moz-box-shadow:0px 0px 8px #ddd; -ms-box-shadow:0px 0px 8px #ddd; -o-box-shadow:0px 0px 8px #ddd; background-color:#ffffff; width:100%; margin:0 0 0 0; margin-bottom:10px;}

.bbox-head { background-color:#f0f1f2; border-bottom:solid 1px #dae1e8; font-size:11px; font-weight:bold; color:#2b588d;}
.bbxh-left { float:left; padding:13px 0 10px 10px; }
.bbxh-right { float:right; }
.bbxhr-toogle { float:left; border-left:solid 1px #dae1e8; padding:15px;}
.bbxhr-close { float:right; border-left:solid 1px #dae1e8; padding:15px;}
.bbox-cont { margin:0; padding:0; }
.bbox-form { padding:20px; }
.bbox-cont table { font-size:14px; width:100%;}.bbox-cont th { background-color:#e6e6e6; padding:10px; text-align:center; text-transform:uppercase; font-size:10px; border-bottom:solid 1px #d5d9de; border-right:solid 1px #d5d9de; }.bbox-cont th.lastTH { border-right:0; }
.bbox-cont td { padding:10px; font-size:11px; border-bottom:solid 1px #dae1e8; border-right:solid 1px #dae1e8; }
.bbox-cont td.lastTD { border-right:0; }
.bbox-cont a { color:#2b588d; }
.bbox-cont a:hover { color:#cccccc; }
.bbox-bottom { background-color:#f0f1f2; padding:5px; text-align:right; min-height:24px; }
.bb-pagination { float:left; padding:5px 0 0 10px; font-size:11px;}
.bb-pagination ul { margin:0; padding:0; list-style:none; }
.bb-pagination ul li { display:inline;  }
.bb-button { float:right; }

.bbox-info { margin:0; padding:20px; font-size:11px;}
.bbi-items { margin:0; padding:5px 0 5px 0; }
.bbii-left { float:left; width:82%; text-align:right; margin-right:10px;}
.bbii-right { float:right; text-align:right; }
.bb-pagination span {
	padding:5px; color:#999999;
	border:solid 1px #cccccc;
	border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px;
}
.bb-pagination a { padding:5px; color:#2b588d;
	border:solid 1px #2b588d;
	border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px;
 }
.bb-pagination a:hover { padding:5px; color:#999999;
	border:solid 1px #cccccc;
	border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; }

.field { margin:0; padding:0; background-color:#ffffff; border-bottom:solid 1px #eeeeee; padding:5px; font-size:11px;}
.fields { margin:0; padding:0; background-color:#f9f9f9; border-bottom:solid 1px #eeeeee; padding:5px; font-size:11px;}
.field-title { float:left; width:28%; margin-right:10px;}
.field-info { float:right; width:69%; }
.fields a { color:#2b588d; text-decoration:none; }
.fields a:hover { color:#cccccc; text-decoration:none; }

.fieldpage { margin:0; padding:0; background-color:#ffffff; border-bottom:solid 1px #eeeeee; padding:5px; font-size:11px;}
.fieldspage { margin:0; padding:0; background-color:#f9f9f9; border-bottom:solid 1px #eeeeee; padding:5px; font-size:11px;}
.fieldpage-title { float:left; width:19%; margin-right:10px; padding:5px 0 0 5px; font-size:11px;}
.fieldpage-info { float:right; width:79%;}
.fieldpage-info ul { margin:0; padding:0; list-style:none; }
.fieldpage-info ul li { display:block; float:left; margin-right:10px; width:100px; border:solid 1px #cccccc; padding:5px; text-align:center; min-height:150px;}
.fieldspage a { color:#2b588d; text-decoration:none; }
.fieldspage a:hover { color:#cccccc; text-decoration:none; }

.box-items { padding:10px; margin:0; color:#ffffff; text-transform:uppercase;}
.box-items a { color:#ffffff; }
.box-items a:hover { color:#cccccc; }
.boxitems-info {
	border:solid 1px #dae1e8; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; box-shadow:0px 0px 8px #ddd; -webkit-box-shadow:0px 0px 8px #ddd; -moz-box-shadow:0px 0px 8px #ddd; -ms-box-shadow:0px 0px 8px #ddd; -o-box-shadow:0px 0px 8px #ddd; background-color:#f0f1f2; color:#666666;
	width:37.1%; float:left; text-align:center; margin:0 5px 10px 5px; padding:10px; font-size:10px;
}
.boxitems-info h3 { margin:0; padding:0; font-size:16px; line-height:16px; color:#6086b2;}

.boxitems-infodue {
	border:solid 1px #dae1e8; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; box-shadow:0px 0px 8px #ddd; -webkit-box-shadow:0px 0px 8px #ddd; -moz-box-shadow:0px 0px 8px #ddd; -ms-box-shadow:0px 0px 8px #ddd; -o-box-shadow:0px 0px 8px #ddd; background-color:#1c5fb9;
	width:37.1%; float:left; text-align:center; margin:0 5px 10px 5px; padding:10px; font-size:10px;
}
.boxitems-infodue h3 { margin:0; padding:0; font-size:16px; line-height:16px;}

.boxitems-infosuspend {
	border:solid 1px #dae1e8; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; box-shadow:0px 0px 8px #ddd; -webkit-box-shadow:0px 0px 8px #ddd; -moz-box-shadow:0px 0px 8px #ddd; -ms-box-shadow:0px 0px 8px #ddd; -o-box-shadow:0px 0px 8px #ddd; background-color:#159dbe;
	width:37.1%; float:left; text-align:center; margin:0 5px 10px 5px; padding:10px; font-size:10px;
}
.boxitems-infosuspend h3 { margin:0; padding:0; font-size:16px; line-height:16px; }

.boxitems-infoseries {
	border:solid 1px #dae1e8; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; box-shadow:0px 0px 8px #ddd; -webkit-box-shadow:0px 0px 8px #ddd; -moz-box-shadow:0px 0px 8px #ddd; -ms-box-shadow:0px 0px 8px #ddd; -o-box-shadow:0px 0px 8px #ddd; background-color:#710000;
	width:37.1%; float:left; text-align:center; margin:0 5px 10px 5px; padding:10px; font-size:10px;
}
.boxitems-infoseries h3 { margin:0; padding:0; font-size:16px; line-height:16px;}

.boxitems-infodone {
	border:solid 1px #dae1e8; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; box-shadow:0px 0px 8px #ddd; -webkit-box-shadow:0px 0px 8px #ddd; -moz-box-shadow:0px 0px 8px #ddd; -ms-box-shadow:0px 0px 8px #ddd; -o-box-shadow:0px 0px 8px #ddd; background-color:#598a0b;
	width:37.1%; float:left; text-align:center; margin:0 5px 10px 5px; padding:10px; font-size:10px;
}
.boxitems-infodone h3 { margin:0; padding:0; font-size:16px; line-height:16px;}
.boxitems-infoon {
	border:solid 1px #dae1e8; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; box-shadow:0px 0px 8px #ddd; -webkit-box-shadow:0px 0px 8px #ddd; -moz-box-shadow:0px 0px 8px #ddd; -ms-box-shadow:0px 0px 8px #ddd; -o-box-shadow:0px 0px 8px #ddd; background-color:#03070b;
	width:37.1%; float:left; text-align:center; margin:0 5px 10px 5px; padding:10px; font-size:10px;
}
.boxitems-infoon h3 { margin:0; padding:0; font-size:16px; line-height:16px;}
.tip {
	color: #000;
	background:#f0f1f2;
	display:none;
	padding:10px;
	position:absolute; z-index:1000;
	margin-top:-50px;
	border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; box-shadow:0px 0px 8px #ddd; -webkit-box-shadow:0px 0px 8px #ddd; -moz-box-shadow:0px 0px 8px #ddd; -ms-box-shadow:0px 0px 8px #ddd; -o-box-shadow:0px 0px 8px #ddd;
	border:solid 1px #dae1e8;
	line-height:16px;
}
.due-date { background-color:#1c5fb9; padding:2px 5px 2px 5px; color:#ffffff; font-weight:bold; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; }
.finish { background-color:#598a0b; padding:2px 5px 2px 5px; color:#ffffff; font-weight:bold; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; }
.on-progress { background-color:#03070b; padding:2px 5px 2px 5px; color:#ffffff; font-weight:bold; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; }
.suspend { background-color:#159dbe; padding:2px 5px 2px 5px; color:#ffffff; font-weight:bold; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; }
.series { background-color:#710000; padding:2px 5px 2px 5px; color:#ffffff; font-weight:bold; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; }
.pilih_file { padding:5px; border: solid 1px #cccccc; margin:5px 0 5px 0;}


text:
package com.maxdemarzi;

import org.junit.Rule;
import org.junit.Test;
import org.neo4j.harness.junit.Neo4jRule;
import org.neo4j.test.server.HTTP;

import java.util.HashMap;

import static org.junit.Assert.assertTrue;

public class HelloWorldTest {
    @Rule
    public Neo4jRule neo4j = new Neo4jRule()
            .withExtension("/v1", Service.class);

    @Test
    public void shouldRespondToHelloWorld() {
        HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/service/helloworld").toString());
        HashMap actual = response.content();
        assertTrue(actual.equals(expected));
    }

    private static final HashMap expected = new HashMap<String, Object>() {{
        put("hello", "world");
    }};

}

redpajama_set_name: RedPajamaGithub


text:
package org.wso2.carbon.identity.application.mgt;

import org.wso2.carbon.identity.application.common.IdentityApplicationManagementException;
import org.wso2.carbon.identity.application.common.model.*;

/**
 *
 * Application management service abstract class.
 *
 */
public abstract class ApplicationManagementService {

    /**
     * Get ApplicationManagementService instance.
     *
     * @return
     */
    public static ApplicationManagementService getInstance() {
        return ApplicationManagementServiceImpl.getInstance();
    }

    /**
     * Creates a service provider with basic information.First we need to create
     * a role with the
     * application name. Only the users in this role will be able to edit/update
     * the application.The
     * user will assigned to the created role.Internal roles used.
     *
     * @param serviceProvider
     *            Service Provider
     * @return
     * @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
     */
    public abstract int createApplication(ServiceProvider serviceProvider)
            throws IdentityApplicationManagementException;

    /**
     * Get Application for given application name
     *
     * @param applicationName
     *            Application Name
     * @return ServiceProvider
     * @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
     */
    public abstract ServiceProvider getApplication(String applicationName)
            throws IdentityApplicationManagementException;

    /**
     * Get All Application Basic Information
     *
     * @return ApplicationBasicInfo[]
     * @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
     */
    public abstract ApplicationBasicInfo[] getAllApplicationBasicInfo()
            throws IdentityApplicationManagementException;

    /**
     * Update Application
     *
     * @param serviceProvider
     *            Service Provider
     * @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
     */
    public abstract void updateApplication(ServiceProvider serviceProvider)
            throws IdentityApplicationManagementException;

    /**
     * Delete Application
     *
     * @param applicationName
     *            Application name
     * @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
     */
    public abstract void deleteApplication(String applicationName)
            throws IdentityApplicationManagementException;

    /**
     * Get Identity Provider
     *
     * @param federatedIdPName
     *            Federated identity provider name
     * @return IdentityProvider
     * @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
     */
    public abstract IdentityProvider getIdentityProvider(String federatedIdPName)
            throws IdentityApplicationManagementException;

    /**
     * Get All Identity Providers
     *
     * @return IdentityProvider[]
     * @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
     */
    public abstract IdentityProvider[] getAllIdentityProviders()
            throws IdentityApplicationManagementException;

    /**
     * Get All Local Authenticators
     *
     * @return LocalAuthenticatorConfig[]
     * @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
     */
    public abstract LocalAuthenticatorConfig[] getAllLocalAuthenticators()
            throws IdentityApplicationManagementException;

    /**
     * Get All Request Path Authenticators
     *
     * @return RequestPathAuthenticatorConfig[]
     * @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
     */
    public abstract RequestPathAuthenticatorConfig[] getAllRequestPathAuthenticators()
            throws IdentityApplicationManagementException;

    /**
     * Get All local claim uris
     *
     * @return String[]
     * @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
     */
    public abstract String[] getAllLocalClaimUris() throws IdentityApplicationManagementException;

    /**
     * Get application data for given client Id and type
     *
     * @param clientId
     *            Client Id
     * @param type
     *            Type
     * @return ServiceProvider
     * @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
     */
    public abstract String getServiceProviderNameByClientId(String clientId, String type)
            throws IdentityApplicationManagementException;
}


text:
package com.devopsjavaspring.config;

import com.devopsjavaspring.backend.service.UserSecurityService;
import com.devopsjavaspring.web.controllers.ForgotMyPasswordController;
import com.devopsjavaspring.web.controllers.SignupController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by stephenasamoah on 9/8/16.
 */
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    private UserSecurityService userSecurityService;

    @Autowired
    private Environment env;

    /** The encryption SALT. */
    private static final String SALT = "SKJDGADGHE838#8QWJSBSGE_UWjbsdugsuutwrf";

    @Bean
    public BCryptPasswordEncoder passwordEncoder(){
        return new BCryptPasswordEncoder(12, new SecureRandom(SALT.getBytes()));
    }

    /** Public URLs. */
    private static final String[] PUBLIC_MATCHERS = {
            "/webjars/**",
            "/css/**",
            "/js/**",
            "/images/**",
            "/",
            "/about/**",
            "contact/**",
            "/error/**/*",
            "/console/**",
            ForgotMyPasswordController.FORGOT_PASSWORD_URL_MAPPING,
            ForgotMyPasswordController.CHANGE_PASSWORD_PATH,
            SignupController.SIGNUP_URL_MAPPING
    };

    @Override
    protected void configure(HttpSecurity http) throws Exception {

        List<String> activeProfiles = Arrays.asList(env.getActiveProfiles());
        if (activeProfiles.contains("dev")) {
            http.csrf().disable();
            http.headers().frameOptions().disable();
        }

        http
                .authorizeRequests()
                .antMatchers(PUBLIC_MATCHERS).permitAll()
                .anyRequest().authenticated()
                .and()
                .formLogin().loginPage("/login").defaultSuccessUrl("/payload")
                .failureUrl("/login?error").permitAll()
                .and()
                .logout().permitAll();
    }

    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        auth
                .userDetailsService(userSecurityService)
                .passwordEncoder(passwordEncoder());
    }
}


text:
@interface GuestService : NSObject

@property (strong, nonatomic, readonly) NSDateFormatter *arrivalDateFormatter;

+ (GuestService *)sharedInstance;
- (void)writeGuestsToDisk;
- (NSArray *)guests;
- (NSInteger)addGuest:(Guest *)guest;
- (void)removeGuest:(Guest *)guest;

@end


text:
package com.hazelcast.security.permission;

import java.security.Permission;
import java.security.PermissionCollection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class ClusterPermissionCollection extends PermissionCollection {

    final Set<Permission> perms = new HashSet<Permission>();
    final Class<? extends Permission> permClass;

    public ClusterPermissionCollection() {
        permClass = null;
    }

    public ClusterPermissionCollection(Class<? extends Permission> permClass) {
        this.permClass = permClass;
    }

    @Override
    public void add(Permission permission) {
        if (isReadOnly()) {
            throw new SecurityException("ClusterPermissionCollection is read-only!");
        }
        boolean shouldAdd = (permClass != null && permClass.equals(permission.getClass()))
                || (permission instanceof ClusterPermission);

        if (shouldAdd && !implies(permission)) {
            perms.add(permission);
        }
    }

    public void add(PermissionCollection permissions) {
        if (isReadOnly()) {
            throw new SecurityException("ClusterPermissionCollection is read-only!");
        }
        if (permissions instanceof ClusterPermissionCollection) {
            for (Permission p : ((ClusterPermissionCollection) permissions).perms) {
                add(p);
            }
        }
    }

    @Override
    public boolean implies(Permission permission) {
        for (Permission p : perms) {
            if (p.implies(permission)) {
                return true;
            }
        }
        return false;
    }

    public void compact() {
        if (isReadOnly()) {
            throw new SecurityException("ClusterPermissionCollection is read-only!");
        }
        final Iterator<Permission> iter = perms.iterator();
        while (iter.hasNext()) {
            final Permission perm = iter.next();
            boolean implies = false;
            for (Permission p : perms) {
                if (p != perm && p.implies(perm)) {
                    implies = true;
                    break;
                }
            }
            if (implies) {
                iter.remove();
            }
        }
        setReadOnly();
    }

    @Override
    public Enumeration<Permission> elements() {
        return Collections.enumeration(perms);
    }

    public Set<Permission> getPermissions() {
        return Collections.unmodifiableSet(perms);
    }

    @Override
    public String toString() {
        return "ClusterPermissionCollection [permClass=" + permClass + "]";
    }
}


text:
This is a Spring Boot [AutoConfiguration](http://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-auto-configuration.html)
module built into the [Spark Streaming Job](../../sparkstreaming-job)
which writes spans to a Zipkin `StorageComponent`.  Internally, this
module wraps the [StorageConsumer](../../consumer/storage) to expose
configuration options via properties.

## Usage

In order to connect, you minimally need to set `zipkin.storage.type` to
a configured backend. You also need to set relevant properties for that.

Ex.
```bash
java -jar zipkin-sparkstreaming-job.jar \
  --zipkin.storage.type=elasticsearch \
  --zipkin.storage.elasticsearch.hosts=http://127.0.0.1:9200 \
  ...
```

### Configuration

Configuration properties can be set via commandline parameters, system
properties or any other alternative [supported by Spring Boot](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html).

Besides setting storage properties, you can also override the following.
All of the below have a prefix of "zipkin.sparkstreaming.consumer.storage"

Property | Default |Description
--- | --- | ---
fail-fast | true | check storage before submitting the job.

## More Examples

Ex. to connect to a local Elasticsearch service:

```bash
java -jar zipkin-sparkstreaming-job.jar \
  --zipkin.storage.type=elasticsearch \
  --zipkin.storage.elasticsearch.hosts=http://127.0.0.1:9200 \
  --zipkin.sparkstreaming.stream.kafka.bootstrap-servers=127.0.0.1:9092
```

Ex. to connect to a local MySQL service:

```bash
java -jar zipkin-sparkstreaming-job.jar \
  --zipkin.storage.type=mysql \
  --zipkin.storage.mysql.host=127.0.0.1 \
  --zipkin.storage.mysql.username=root \
  --zipkin.sparkstreaming.stream.kafka.bootstrap-servers=127.0.0.1:9092
```

Ex. to connect to a local Cassandra service:

```bash
java -jar zipkin-sparkstreaming-job.jar \
  --zipkin.storage.type=cassandra \
  --zipkin.storage.cassandra.contact-points=127.0.0.1 \
  --zipkin.sparkstreaming.stream.kafka.bootstrap-servers=127.0.0.1:9092
```


text:
package org.ms123.launcher;

import java.net.URI;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.jsoup.Jsoup;

import java.net.URLEncoder;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.client.api.Response;
import org.eclipse.jetty.util.Callback;

import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.proxy.ProxyServlet;
import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;

@SuppressWarnings({"unchecked","deprecation"})
public class BridgeServlet extends ProxyServlet {

	private static final long serialVersionUID = -7441088044680657919L;
	private flexjson.JSONSerializer m_js = new flexjson.JSONSerializer();
	private String prefix;

	@Override
	public void init() throws ServletException {
		super.init();
		ServletConfig config = getServletConfig();
		info("BridgeServlet.init");
	}

	@Override
	public void destroy() {
		info("BridgeServlet.destroy");
	}

	@Override
	protected HttpClient newHttpClient() {
		HttpClient httpClient = new HttpClient();
		return httpClient;
	}

	@Override
	protected void customizeProxyRequest(Request proxyRequest, HttpServletRequest request) {
	}

	@Override
	protected void onResponseContent(HttpServletRequest request, HttpServletResponse response, Response proxyResponse, byte[] buffer, int offset, int length, Callback callback) {
		try {
			String pathInfo = request.getPathInfo();
			info("proxying downstream: bytes:" + pathInfo);
			if (pathInfo.endsWith("start.html")) {
				String content = new String(buffer, offset, length, "UTF-8");
				Document doc = Jsoup.parse(content, this.prefix);
				setPrefix(doc, "script", "src");
				setPrefix(doc, "link", "href");
				String html = doc.outerHtml();
				buffer = html.getBytes("UTF-8");
				response.setContentLength(buffer.length);
				response.getOutputStream().write(buffer, 0, buffer.length);
			} else {
				response.getOutputStream().write(buffer, offset, length);
			}
			callback.succeeded();
		} catch (Throwable t) {
			callback.failed(t);
		}
	}

	@Override
	protected URI rewriteURI(HttpServletRequest request) {
		String pathInfo = request.getPathInfo();
		String contextPath = request.getContextPath();
		String servletPath = request.getServletPath();
		info("rewriteURI.contextPath:" + contextPath);
		info("rewriteURI.servletPath:" + servletPath);
		info("rewriteURI.pathInfo:" + pathInfo);
		String basePath = pathInfo;
		this.prefix = contextPath + servletPath;

		String query = request.getQueryString();
		info("rewriteURI.query:" + query);
		info("rewriteURI.basePath:" + basePath);

		URI uri = null;
		String sUri = null;
		if (query != null && query.length() > 0) {
			sUri = OsgiStarter.simpl4BaseUrl + basePath + "?" + query + "&__contextPath=" + this.prefix;
		} else {
			sUri = OsgiStarter.simpl4BaseUrl + basePath + "?__contextPath=" + this.prefix;
		}
		uri = URI.create(sUri);
		info("rewriteURI.uri:" + uri);
		return uri;
	}

	private void setPrefix(Document doc, String tag, String attr) {
		Iterator<Element> it = doc.getElementsByTag(tag).iterator();
		while (it.hasNext()) {
			Element e = it.next();
			if (!e.hasAttr(attr))
				continue;
			String val = e.attr(attr);
			if (val != null && val.length() > 0) {
				String slash = val.startsWith("/") ? "" : "/";
				info("setting:" + this.prefix + slash + val);
				if( val.startsWith("/") ){
					e.attr(attr, this.prefix + slash + val);
				}
			}
		}
	}

	private static void info(String msg) {
		System.out.println("BridgeServlet:" + msg);
	}

}


text:
package org.bouncycastle.tls.crypto.impl.jcajce;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.security.GeneralSecurityException;
import java.security.PublicKey;
import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;
import java.security.interfaces.DSAPublicKey;
import org.bouncycastle.jce.interfaces.ECPublicKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.AlgorithmParameterSpec;

import javax.crypto.interfaces.DHPublicKey;

import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1Encoding;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
import org.bouncycastle.asn1.x509.Certificate;
import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
import org.bouncycastle.jcajce.util.JcaJceHelper;
import org.bouncycastle.tls.AlertDescription;
import org.bouncycastle.tls.HashAlgorithm;
import org.bouncycastle.tls.SignatureAlgorithm;
import org.bouncycastle.tls.SignatureScheme;
import org.bouncycastle.tls.TlsFatalAlert;
import org.bouncycastle.tls.TlsUtils;
import org.bouncycastle.tls.crypto.Tls13Verifier;
import org.bouncycastle.tls.crypto.TlsCertificate;
import org.bouncycastle.tls.crypto.TlsCertificateRole;
import org.bouncycastle.tls.crypto.TlsCryptoException;
import org.bouncycastle.tls.crypto.TlsEncryptor;
import org.bouncycastle.tls.crypto.TlsVerifier;
import org.bouncycastle.tls.crypto.impl.LegacyTls13Verifier;
import org.bouncycastle.tls.crypto.impl.RSAUtil;

/**
 * Implementation class for a single X.509 certificate based on the JCA.
 */
public class JcaTlsCertificate
    implements TlsCertificate
{
    protected static final int KU_DIGITAL_SIGNATURE = 0;
    protected static final int KU_NON_REPUDIATION = 1;
    protected static final int KU_KEY_ENCIPHERMENT = 2;
    protected static final int KU_DATA_ENCIPHERMENT = 3;
    protected static final int KU_KEY_AGREEMENT = 4;
    protected static final int KU_KEY_CERT_SIGN = 5;
    protected static final int KU_CRL_SIGN = 6;
    protected static final int KU_ENCIPHER_ONLY = 7;
    protected static final int KU_DECIPHER_ONLY = 8;

    public static JcaTlsCertificate convert(JcaTlsCrypto crypto, TlsCertificate certificate) throws IOException
    {
        if (certificate instanceof JcaTlsCertificate)
        {
            return (JcaTlsCertificate)certificate;
        }

        return new JcaTlsCertificate(crypto, certificate.getEncoded());
    }

    public static X509Certificate parseCertificate(JcaJceHelper helper, byte[] encoding)
        throws IOException
    {
        try
        {
            /*
             * NOTE: We want to restrict 'encoding' to a binary BER encoding, but
             * CertificateFactory.generateCertificate claims to require DER encoding, and also
             * supports Base64 encodings (in PEM format), which we don't support.
             *
             * Re-encoding validates as BER and produces DER.
             */
            ASN1Primitive asn1 = TlsUtils.readASN1Object(encoding);
            byte[] derEncoding = Certificate.getInstance(asn1).getEncoded(ASN1Encoding.DER);

            ByteArrayInputStream input = new ByteArrayInputStream(derEncoding);
            X509Certificate certificate = (X509Certificate)helper.createCertificateFactory("X.509")
                .generateCertificate(input);
            if (input.available() != 0)
            {
                throw new IOException("Extra data detected in stream");
            }
            return certificate;
        }
        catch (GeneralSecurityException e)
        {
            throw new TlsCryptoException("unable to decode certificate", e);
        }
    }

    protected final JcaTlsCrypto crypto;
    protected final X509Certificate certificate;

    protected DHPublicKey pubKeyDH = null;
    protected ECPublicKey pubKeyEC = null;
    protected PublicKey pubKeyRSA = null;

    public JcaTlsCertificate(JcaTlsCrypto crypto, byte[] encoding)
        throws IOException
    {
        this(crypto, parseCertificate(crypto.getHelper(), encoding));
    }

    public JcaTlsCertificate(JcaTlsCrypto crypto, X509Certificate certificate)
    {
        this.crypto = crypto;
        this.certificate = certificate;
    }

    public TlsEncryptor createEncryptor(int tlsCertificateRole) throws IOException
    {
        validateKeyUsageBit(JcaTlsCertificate.KU_KEY_ENCIPHERMENT);

        switch (tlsCertificateRole)
        {
        case TlsCertificateRole.RSA_ENCRYPTION:
        {
            this.pubKeyRSA = getPubKeyRSA();
            return new JcaTlsRSAEncryptor(crypto, pubKeyRSA);
        }
        // TODO[gmssl]
//        case TlsCertificateRole.SM2_ENCRYPTION:
//        {
//            this.pubKeyEC = getPubKeyEC();
//            return new JcaTlsSM2Encryptor(crypto, pubKeyEC);
//        }
        }

        throw new TlsFatalAlert(AlertDescription.certificate_unknown);
    }

    public TlsVerifier createVerifier(short signatureAlgorithm) throws IOException
    {
        switch (signatureAlgorithm)
        {
        case SignatureAlgorithm.ed25519:
        case SignatureAlgorithm.ed448:
        {
            int signatureScheme = SignatureScheme.from(HashAlgorithm.Intrinsic, signatureAlgorithm);
            Tls13Verifier tls13Verifier = createVerifier(signatureScheme);
            return new LegacyTls13Verifier(signatureScheme, tls13Verifier);
        }
        }

        validateKeyUsageBit(KU_DIGITAL_SIGNATURE);

        switch (signatureAlgorithm)
        {
        case SignatureAlgorithm.dsa:
            return new JcaTlsDSAVerifier(crypto, getPubKeyDSS());

        case SignatureAlgorithm.ecdsa:
            return new JcaTlsECDSAVerifier(crypto, getPubKeyEC());

        case SignatureAlgorithm.rsa:
        {
            validateRSA_PKCS1();
            return new JcaTlsRSAVerifier(crypto, getPubKeyRSA());
        }

        case SignatureAlgorithm.rsa_pss_pss_sha256:
        case SignatureAlgorithm.rsa_pss_pss_sha384:
        case SignatureAlgorithm.rsa_pss_pss_sha512:
        {
            validateRSA_PSS_PSS(signatureAlgorithm);
            int signatureScheme = SignatureScheme.from(HashAlgorithm.Intrinsic, signatureAlgorithm);
            return new JcaTlsRSAPSSVerifier(crypto, getPubKeyRSA(), signatureScheme);
        }

        case SignatureAlgorithm.rsa_pss_rsae_sha256:
        case SignatureAlgorithm.rsa_pss_rsae_sha384:
        case SignatureAlgorithm.rsa_pss_rsae_sha512:
        {
            validateRSA_PSS_RSAE();
            int signatureScheme = SignatureScheme.from(HashAlgorithm.Intrinsic, signatureAlgorithm);
            return new JcaTlsRSAPSSVerifier(crypto, getPubKeyRSA(), signatureScheme);
        }

        default:
            throw new TlsFatalAlert(AlertDescription.certificate_unknown);
        }
    }

    public Tls13Verifier createVerifier(int signatureScheme) throws IOException
    {
        validateKeyUsageBit(KU_DIGITAL_SIGNATURE);

        switch (signatureScheme)
        {
        case SignatureScheme.ecdsa_brainpoolP256r1tls13_sha256:
        case SignatureScheme.ecdsa_brainpoolP384r1tls13_sha384:
        case SignatureScheme.ecdsa_brainpoolP512r1tls13_sha512:
        case SignatureScheme.ecdsa_secp256r1_sha256:
        case SignatureScheme.ecdsa_secp384r1_sha384:
        case SignatureScheme.ecdsa_secp521r1_sha512:
        case SignatureScheme.ecdsa_sha1:
        {
            int cryptoHashAlgorithm = SignatureScheme.getCryptoHashAlgorithm(signatureScheme);
            String digestName = crypto.getDigestName(cryptoHashAlgorithm);
            String sigName = org.bouncycastle.tls.crypto.impl.jcajce.RSAUtil.getDigestSigAlgName(digestName)
                + "WITHECDSA";

            return crypto.createTls13Verifier(sigName, null, getPubKeyEC());
        }

        case SignatureScheme.ed25519:
            return crypto.createTls13Verifier("Ed25519", null, getPubKeyEd25519());

        case SignatureScheme.ed448:
            return crypto.createTls13Verifier("Ed448", null, getPubKeyEd448());

        case SignatureScheme.rsa_pkcs1_sha1:
        case SignatureScheme.rsa_pkcs1_sha256:
        case SignatureScheme.rsa_pkcs1_sha384:
        case SignatureScheme.rsa_pkcs1_sha512:
        {
            validateRSA_PKCS1();

            int cryptoHashAlgorithm = SignatureScheme.getCryptoHashAlgorithm(signatureScheme);
            String digestName = crypto.getDigestName(cryptoHashAlgorithm);
            String sigName = org.bouncycastle.tls.crypto.impl.jcajce.RSAUtil.getDigestSigAlgName(digestName)
                + "WITHRSA";

            return crypto.createTls13Verifier(sigName, null, getPubKeyRSA());
        }

        case SignatureScheme.rsa_pss_pss_sha256:
        case SignatureScheme.rsa_pss_pss_sha384:
        case SignatureScheme.rsa_pss_pss_sha512:
        {
            validateRSA_PSS_PSS(SignatureScheme.getSignatureAlgorithm(signatureScheme));

            int cryptoHashAlgorithm = SignatureScheme.getCryptoHashAlgorithm(signatureScheme);
            String digestName = crypto.getDigestName(cryptoHashAlgorithm);
            String sigName = org.bouncycastle.tls.crypto.impl.jcajce.RSAUtil.getDigestSigAlgName(digestName)
                + "WITHRSAANDMGF1";

            // NOTE: We explicitly set them even though they should be the defaults, because providers vary
            AlgorithmParameterSpec pssSpec = org.bouncycastle.tls.crypto.impl.jcajce.RSAUtil
                .getPSSParameterSpec(cryptoHashAlgorithm, digestName, crypto.getHelper());

            return crypto.createTls13Verifier(sigName, pssSpec, getPubKeyRSA());
        }

        case SignatureScheme.rsa_pss_rsae_sha256:
        case SignatureScheme.rsa_pss_rsae_sha384:
        case SignatureScheme.rsa_pss_rsae_sha512:
        {
            validateRSA_PSS_RSAE();

            int cryptoHashAlgorithm = SignatureScheme.getCryptoHashAlgorithm(signatureScheme);
            String digestName = crypto.getDigestName(cryptoHashAlgorithm);
            String sigName = org.bouncycastle.tls.crypto.impl.jcajce.RSAUtil.getDigestSigAlgName(digestName)
                + "WITHRSAANDMGF1";

            // NOTE: We explicitly set them even though they should be the defaults, because providers vary
            AlgorithmParameterSpec pssSpec = org.bouncycastle.tls.crypto.impl.jcajce.RSAUtil
                .getPSSParameterSpec(cryptoHashAlgorithm, digestName, crypto.getHelper());

            return crypto.createTls13Verifier(sigName, pssSpec, getPubKeyRSA());
        }

        // TODO[RFC 8998]
//        case SignatureScheme.sm2sig_sm3:

        default:
            throw new TlsFatalAlert(AlertDescription.certificate_unknown);
        }
    }

    public byte[] getEncoded() throws IOException
    {
        try
        {
            // DER encoding enforced by provider - as defined by JCA for X.509 certificates.
            return certificate.getEncoded();
        }
        catch (CertificateEncodingException e)
        {
            throw new TlsCryptoException("unable to encode certificate: " + e.getMessage(), e);
        }
    }

    public byte[] getExtension(ASN1ObjectIdentifier extensionOID) throws IOException
    {
        byte[] encoding = certificate.getExtensionValue(extensionOID.getId());
        return encoding == null ? null : ((ASN1OctetString)ASN1Primitive.fromByteArray(encoding)).getOctets();
    }

    public BigInteger getSerialNumber()
    {
        return certificate.getSerialNumber();
    }

    public String getSigAlgOID()
    {
        return certificate.getSigAlgOID();
    }

    public ASN1Encodable getSigAlgParams() throws IOException
    {
        byte[] derEncoding = certificate.getSigAlgParams();
        if (null == derEncoding)
        {
            return null;
        }

        ASN1Primitive asn1 = TlsUtils.readASN1Object(derEncoding);
        // TODO[tls] Without a known ASN.1 type, this is not-quite-right
        TlsUtils.requireDEREncoding(asn1, derEncoding);
        return asn1;
    }

    DHPublicKey getPubKeyDH() throws IOException
    {
        try
        {
            return (DHPublicKey)getPublicKey();
        }
        catch (ClassCastException e)
        {
            throw new TlsFatalAlert(AlertDescription.certificate_unknown, e);
        }
    }

    DSAPublicKey getPubKeyDSS() throws IOException
    {
        try
        {
            return (DSAPublicKey)getPublicKey();
        }
        catch (ClassCastException e)
        {
            throw new TlsFatalAlert(AlertDescription.certificate_unknown, e);
        }
    }

    ECPublicKey getPubKeyEC() throws IOException
    {
        try
        {
            return (ECPublicKey)getPublicKey();
        }
        catch (ClassCastException e)
        {
            throw new TlsFatalAlert(AlertDescription.certificate_unknown, e);
        }
    }

    PublicKey getPubKeyEd25519() throws IOException
    {
        PublicKey publicKey = getPublicKey();
        if (!"Ed25519".equals(publicKey.getAlgorithm()))
        {
            // Oracle provider (Java 15+) returns the key as an EdDSA one
            if (!("EdDSA".equals(publicKey.getAlgorithm()) && publicKey.toString().indexOf("Ed25519") >= 0))
            {
                throw new TlsFatalAlert(AlertDescription.certificate_unknown);
            }
        }
        return publicKey;
    }

    PublicKey getPubKeyEd448() throws IOException
    {
        PublicKey publicKey = getPublicKey();
        if (!"Ed448".equals(publicKey.getAlgorithm()))
        {
            // Oracle provider (Java 15+) returns the key as an EdDSA one
            if (!("EdDSA".equals(publicKey.getAlgorithm()) && publicKey.toString().indexOf("Ed448") >= 0))
            {
                throw new TlsFatalAlert(AlertDescription.certificate_unknown);
            }
        }
        return publicKey;
    }

    PublicKey getPubKeyRSA() throws IOException
    {
        return getPublicKey();
    }

    public short getLegacySignatureAlgorithm() throws IOException
    {
        PublicKey publicKey = getPublicKey();

        if (!supportsKeyUsageBit(KU_DIGITAL_SIGNATURE))
        {
            return -1;
        }

        /*
         * RFC 5246 7.4.6. Client Certificate
         */

        /*
         * RSA public key; the certificate MUST allow the key to be used for signing with the
         * signature scheme and hash algorithm that will be employed in the certificate verify
         * message.
         */
        if (publicKey instanceof RSAPublicKey)
        {
            return SignatureAlgorithm.rsa;
        }

        /*
         * DSA public key; the certificate MUST allow the key to be used for signing with the hash
         * algorithm that will be employed in the certificate verify message.
         */
        if (publicKey instanceof DSAPublicKey)
        {
            return SignatureAlgorithm.dsa;
        }

        /*
         * ECDSA-capable public key; the certificate MUST allow the key to be used for signing with
         * the hash algorithm that will be employed in the certificate verify message; the public
         * key MUST use a curve and point format supported by the server.
         */
        if (publicKey instanceof ECPublicKey)
        {
            // TODO Check the curve and point format
            return SignatureAlgorithm.ecdsa;
        }

        return -1;
    }

    public boolean supportsSignatureAlgorithm(short signatureAlgorithm) throws IOException
    {
        if (!supportsKeyUsageBit(KU_DIGITAL_SIGNATURE))
        {
            return false;
        }

        return implSupportsSignatureAlgorithm(signatureAlgorithm);
    }

    public boolean supportsSignatureAlgorithmCA(short signatureAlgorithm) throws IOException
    {
        return implSupportsSignatureAlgorithm(signatureAlgorithm);
    }

    public TlsCertificate checkUsageInRole(int tlsCertificateRole) throws IOException
    {
        switch (tlsCertificateRole)
        {
        case TlsCertificateRole.DH:
        {
            validateKeyUsageBit(KU_KEY_AGREEMENT);
            this.pubKeyDH = getPubKeyDH();
            return this;
        }

        case TlsCertificateRole.ECDH:
        {
            validateKeyUsageBit(KU_KEY_AGREEMENT);
            this.pubKeyEC = getPubKeyEC();
            return this;
        }
        }

        throw new TlsFatalAlert(AlertDescription.certificate_unknown);
    }

    protected boolean implSupportsSignatureAlgorithm(short signatureAlgorithm) throws IOException
    {
        PublicKey publicKey = getPublicKey();

        switch (signatureAlgorithm)
        {
        case SignatureAlgorithm.rsa:
            return supportsRSA_PKCS1()
                && publicKey instanceof RSAPublicKey;

        case SignatureAlgorithm.dsa:
            return publicKey instanceof DSAPublicKey;

        case SignatureAlgorithm.ecdsa:
        case SignatureAlgorithm.ecdsa_brainpoolP256r1tls13_sha256:
        case SignatureAlgorithm.ecdsa_brainpoolP384r1tls13_sha384:
        case SignatureAlgorithm.ecdsa_brainpoolP512r1tls13_sha512:
            return publicKey instanceof ECPublicKey;

        case SignatureAlgorithm.ed25519:
            return "Ed25519".equals(publicKey.getAlgorithm());

        case SignatureAlgorithm.ed448:
            return "Ed448".equals(publicKey.getAlgorithm());

        case SignatureAlgorithm.rsa_pss_rsae_sha256:
        case SignatureAlgorithm.rsa_pss_rsae_sha384:
        case SignatureAlgorithm.rsa_pss_rsae_sha512:
            return supportsRSA_PSS_RSAE()
                && publicKey instanceof RSAPublicKey;

        case SignatureAlgorithm.rsa_pss_pss_sha256:
        case SignatureAlgorithm.rsa_pss_pss_sha384:
        case SignatureAlgorithm.rsa_pss_pss_sha512:
            return supportsRSA_PSS_PSS(signatureAlgorithm)
                && publicKey instanceof RSAPublicKey;

        default:
            return false;
        }
    }

    protected PublicKey getPublicKey() throws IOException
    {
        try
        {
            return certificate.getPublicKey();
        }
        catch (RuntimeException e)
        {
            throw new TlsFatalAlert(AlertDescription.bad_certificate, e);
        }
    }

    protected SubjectPublicKeyInfo getSubjectPublicKeyInfo() throws IOException
    {
        return SubjectPublicKeyInfo.getInstance(getPublicKey().getEncoded());
    }

    public X509Certificate getX509Certificate()
    {
        return certificate;
    }

    protected boolean supportsKeyUsageBit(int keyUsageBit)
    {
        boolean[] keyUsage = certificate.getKeyUsage();

        return null == keyUsage || (keyUsage.length > keyUsageBit && keyUsage[keyUsageBit]);
    }

    protected boolean supportsRSA_PKCS1()
        throws IOException
    {
        AlgorithmIdentifier pubKeyAlgID = getSubjectPublicKeyInfo().getAlgorithm();
        return RSAUtil.supportsPKCS1(pubKeyAlgID);
    }

    protected boolean supportsRSA_PSS_PSS(short signatureAlgorithm)
        throws IOException
    {
        AlgorithmIdentifier pubKeyAlgID = getSubjectPublicKeyInfo().getAlgorithm();
        return RSAUtil.supportsPSS_PSS(signatureAlgorithm, pubKeyAlgID);
    }

    protected boolean supportsRSA_PSS_RSAE()
        throws IOException
    {
        AlgorithmIdentifier pubKeyAlgID = getSubjectPublicKeyInfo().getAlgorithm();
        return RSAUtil.supportsPSS_RSAE(pubKeyAlgID);
    }

    protected void validateKeyUsageBit(int keyUsageBit)
        throws IOException
    {
        if (!supportsKeyUsageBit(keyUsageBit))
        {
            throw new TlsFatalAlert(AlertDescription.certificate_unknown);
        }
    }

    protected void validateRSA_PKCS1()
        throws IOException
    {
        if (!supportsRSA_PKCS1())
        {
            throw new TlsFatalAlert(AlertDescription.certificate_unknown);
        }
    }

    protected void validateRSA_PSS_PSS(short signatureAlgorithm)
        throws IOException
    {
        if (!supportsRSA_PSS_PSS(signatureAlgorithm))
        {
            throw new TlsFatalAlert(AlertDescription.certificate_unknown);
        }
    }

    protected void validateRSA_PSS_RSAE()
        throws IOException
    {
        if (!supportsRSA_PSS_RSAE())
        {
            throw new TlsFatalAlert(AlertDescription.certificate_unknown);
        }
    }
}


text:
'use strict';

var _supertest = require('supertest');

var _supertest2 = _interopRequireDefault(_supertest);

var _chai = require('chai');

var _chai2 = _interopRequireDefault(_chai);

var _chaiHttp = require('chai-http');

var _chaiHttp2 = _interopRequireDefault(_chaiHttp);

var _models = require('../models');

var _app = require('../app');

var _app2 = _interopRequireDefault(_app);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// During the test the env variable is set to test
process.env.NODE_ENV = 'test'; // Require the dev-dependencies

var server = _supertest2.default.agent(_app2.default);
var should = _chai2.default.should();

_chai2.default.use(_chaiHttp2.default);

describe('GroupsUser', function () {
  var token = '';
  before(function (done) {
    // Before each test we empty the database
    server.post('/api/v1/users/signin').send({
      username: 'kene',
      password: 'kene' }).end(function (err, res) {
      token = res.body.token;
    });
    _models.userGroups.sync({ force: true }).then(function () {
      return done();
    }).catch(function (error) {
      done(error);
    });
  });

  describe('Controller Tests: ', function () {
    // Test for succesful group creation
    describe('Group', function () {
      var groupId = 1;
      it('should add a user to a group', function (done) {
        server.post('/api/v1/groups/' + groupId + '/user').send({
          token: token,
          userId: '1'
        }).end(function (err, res) {
          res.should.have.status(201);
          res.body.should.be.a('object');
          res.body.should.have.property('message').eql('User Added');
          res.body.should.have.property('success').eql(true);
          done();
        });
      });
      it('should add another user to a group', function (done) {
        server.post('/api/v1/groups/' + groupId + '/user').send({
          token: token,
          userId: '2'
        }).end(function (err, res) {
          res.should.have.status(201);
          res.body.should.be.a('object');
          res.body.should.have.property('message').eql('User Added');
          res.body.should.have.property('success').eql(true);
          done();
        });
      });
      it('should not add a user to a group if userId is not supplied', function (done) {
        server.post('/api/v1/groups/' + groupId + '/user').send({
          token: token
          // userId: '1'
        }).end(function (err, res) {
          res.should.have.status(400);
          res.body.should.be.a('object');
          res.body.should.have.property('message').eql('Invalid request. Some column(s) are missing');
          done();
        });
      });
      it('should not add a user who does not exist to a group', function (done) {
        server.post('/api/v1/groups/' + groupId + '/user').send({
          token: token,
          userId: '100' // this userId does not exist
        }).end(function (err, res) {
          res.should.have.status(404);
          res.body.should.be.a('object');
          res.body.should.have.property('message').eql('Cannot add a user who does not exist to a group');
          done();
        });
      });
      it('should not add a user who already exist in a group', function (done) {
        server.post('/api/v1/groups/' + groupId + '/user').send({
          token: token,
          userId: '1' // this userId already exist in a group
        }).end(function (err, res) {
          res.should.have.status(409);
          res.body.should.be.a('object');
          res.body.should.have.property('message').eql('User Already Exist');
          done();
        });
      });
      it('should throw internal server error when a user cannot be added', function (done) {
        server.post('/api/v1/groups/' + undefined + '/user').send({
          token: token,
          userId: '1'
        }).end(function (err, res) {
          res.should.have.status(500);
          res.body.should.be.a('object');
          res.body.should.have.property('message').eql('Error occured while trying to add user');
          done();
        });
      });
      it('should not remove a user if all parameter required is\n          not supplied', function (done) {
        server.post('/api/v1/groups/' + groupId + '/users').send({
          token: token,
          admin: 1
          // user: 6 // user is missing
        }).end(function (err, res) {
          res.should.have.status(400);
          res.body.should.be.a('object');
          res.body.should.have.property('message').eql('Incomplete payload');
          done();
        });
      });
      it('should not remove a user from a group\n          he created', function (done) {
        server.post('/api/v1/groups/' + groupId + '/users').send({
          token: token,
          admin: '1',
          user: '1'
        }).end(function (err, res) {
          res.should.have.status(401);
          res.body.should.be.a('object');
          res.body.should.have.property('message').eql('Cannot remove yourself from the Group you created');
          done();
        });
      });
      it('should not remove a user who does not exist from a group', function (done) {
        server.post('/api/v1/groups/' + groupId + '/users').send({
          token: token,
          admin: '1',
          user: '100' // this user does not exist/belong to group 1
        }).end(function (err, res) {
          res.should.have.status(404);
          res.body.should.be.a('object');
          res.body.should.have.property('message').eql('User not found!');
          done();
        });
      });
      it('should remove a user from a group', function (done) {
        server.post('/api/v1/groups/' + groupId + '/users').send({
          token: token,
          admin: '1',
          user: '2'
        }).end(function (err, res) {
          res.should.have.status(200);
          res.body.should.be.a('object');
          res.body.should.have.property('message').eql('User Removed From Group');
          done();
        });
      });

      it('should return groups a user belonged to\n      by username', function (done) {
        server.post('/api/v1/user/groups').send({
          token: token,
          username: 'kene'
        }).end(function (err, res) {
          res.should.have.status(200);
          res.body.should.be.a('object');
          res.body.should.have.property('id').eql(1);
          res.body.should.have.property('groups').eql([{ id: 1, groupName: 'Group' }]);
          done();
        });
      });
      it('should not return groups a user belonged to\n      by username if username is not supplied', function (done) {
        server.post('/api/v1/user/groups').send({
          token: token
          // username: 'kene',
        }).end(function (err, res) {
          res.should.have.status(400);
          res.body.should.be.a('object');
          res.body.should.have.property('message').eql('Invalid request. Username is missing');
          done();
        });
      });
      it('should not return groups a user belonged to\n      by username if username is empty', function (done) {
        server.post('/api/v1/user/groups').send({
          token: token,
          username: ''
        }).end(function (err, res) {
          res.should.have.status(400);
          res.body.should.be.a('object');
          res.body.should.have.property('message').eql('Invalid request. Username is missing');
          done();
        });
      });

      it('should search a user', function (done) {
        server.post('/api/v1/users/0').send({
          token: token,
          username: 'k'
        }).end(function (err, res) {
          res.should.have.status(200);
          res.body.should.be.a('object');
          res.body.should.have.property('count').eql(2);
          res.body.should.have.property('rows');
          done();
        });
      });
      it('should not search a user if username field is not available', function (done) {
        server.post('/api/v1/users/0').send({
          token: token
          // username: 'k',
        }).end(function (err, res) {
          res.should.have.status(400);
          res.body.should.have.property('message').eql('Invalid request. Some column(s) are missing');
          done();
        });
      });
      it('should not search a user if username field is not empty', function (done) {
        server.post('/api/v1/users/0').send({
          token: token,
          username: ''
        }).end(function (err, res) {
          res.should.have.status(400);
          res.body.should.have.property('message').eql('Invalid request. Some column(s) are missing');
          done();
        });
      });

      it('should unauthorized status code when trying \n        calling the endpoint without toke', function (done) {
        server.post('/api/v1/users/0').send({
          // token, // token is not available
          username: '3'
        }).end(function (err, res) {
          res.should.have.status(403);
          res.body.should.be.a('object');
          done();
        });
      });
      it('should return all groups', function (done) {
        server.get('/api/v1/groups').send({
          token: token
        }).end(function (err, res) {
          res.should.have.status(200);
          res.body.should.be.a('array');
          res.body[0].should.have.property('id').eql(1);
          res.body[0].should.have.property('groupName').eql('Group');
          done();
        });
      });
      it('should fetch members of a group', function (done) {
        server.get('/api/v1/groups/' + groupId + '/users').set({ 'x-access-token': token }).end(function (err, res) {
          res.should.have.status(200);
          res.body.should.be.a('object');
          res.body.should.have.property('id').eql(1);
          res.body.should.have.property('groupName').eql('Group');
          res.body.should.have.property('createdby').eql('1');
          done();
        });
      });
      it('should return not found for a groupId with no Group', function (done) {
        server.get('/api/v1/groups/100/users').set({ 'x-access-token': token }).end(function (err, res) {
          res.should.have.status(500);
          res.body.should.be.a('object');
          res.body.should.have.property('message').eql('Error occured while fetching members in a Group');
          done();
        });
      });
    });
  });
});


text:
/* ** GENEREATED FILE - DO NOT MODIFY ** */
package com.wilutions.mslib.office;
import com.wilutions.com.*;

/**
 * IMsoFloor.
 *
 */
@CoInterface(guid="{000C1716-0000-0000-C000-000000000046}")
public interface IMsoFloor extends IDispatch {
  static boolean __typelib__loaded = __TypeLib.load();
  @DeclDISPID(110)  public String getName() throws ComException;
  @DeclDISPID(235)  public Object Select() throws ComException;
  @DeclDISPID(150)  public IDispatch getParent() throws ComException;
  @DeclDISPID(128)  public IMsoBorder getBorder() throws ComException;
  @DeclDISPID(112)  public Object ClearFormats() throws ComException;
  @DeclDISPID(129)  public IMsoInterior getInterior() throws ComException;
  @DeclDISPID(1663)  public ChartFillFormat getFill() throws ComException;
  @DeclDISPID(161)  public Object getPictureType() throws ComException;
  @DeclDISPID(161)  public void setPictureType(final Object value) throws ComException;
  @DeclDISPID(211)  public void Paste() throws ComException;
  @DeclDISPID(2419)  public Integer getThickness() throws ComException;
  @DeclDISPID(2419)  public void setThickness(final Integer value) throws ComException;
  @DeclDISPID(1610743820)  public IMsoChartFormat getFormat() throws ComException;
  @DeclDISPID(148)  public IDispatch getApplication() throws ComException;
  @DeclDISPID(149)  public Integer getCreator() throws ComException;
}


text:
using Telerik.UI.Xaml.Controls.Data.DataForm;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace SDKExamples.UWP.DataForm
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class CustomEditor : ExamplePageBase
    {
        public CustomEditor()
        {
            this.InitializeComponent();

            this.DataContext = new Item() { ProductName = "Potatoes", Price = 10 };

            this.DataForm.RegisterPropertyEditor("ProductName", typeof(CustomStringEditorDF));
        }

        public class Item
        {
            public string ProductName { get; set; }
            public double Price { get; set; }
        }
    }

    public class CustomStringEditorDF : Control, ITypeEditor
    {
        public string Text
        {
            get { return (string)GetValue(TextProperty); }
            set { SetValue(TextProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Text.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TextProperty =
            DependencyProperty.Register("Text", typeof(string), typeof(CustomStringEditorDF), new PropertyMetadata(null));

        public void BindEditor()
        {
            Binding b = new Binding();
            b.Mode = BindingMode.TwoWay;
            b.Path = new PropertyPath("PropertyValue");
            this.SetBinding(CustomStringEditorDF.TextProperty, b);
        }
    }
}


text:
<?php
class CmcWundergroundSticker extends DataObject {

    private static $singular_name = 'Wunderground Sticker';
    private static $plural_name = 'Wunderground Sticker';

    //WidgetUrl
    //http://www.wunderground.com/swf/pws_mini_rf_nc.swf?station=<WundergroundStation>&freq=2.5&units=english&lang=EN
    //NOAA Url
    //http://forecast.weather.gov/MapClick.php?lat=<DecLat>&lon=<DecLong>&unit=0&lg=english&FcstType=graphical
    //NOAA UrlLabel ExtLabel
    //  NOAA Weather Forecast Graph
    private static $db = array(
        'WidgetTitle'           => 'Varchar(255)',
        'WidgetForecastUrl'     => 'Varchar(255)',
        'WidgetForecastUrlText' => 'Varchar(255)',
        'WidgetImageUrl'        => 'Varchar(255)',
        'WidgetImageAlt'        => 'Varchar(255)',
        'ImageWidth'            => 'Int',
        'ImageHeight'           => 'Int',
        'ExternalUrl'           => 'Varchar(255)',
        'ExternalUrlLabel'      => 'Varchar(255)',

    );

    private static $belongs_to = array(
        'Page'  => 'Page',
    );

    private static $summary_fields = array(
        'WidgetTitle'                     => 'Weather Widget',
    );

    private static $default_sort = array(
        'WidgetTitle',
    );

    private static $display_fields = array(
        'WidgetTitle'  => 'Weather Widget'
    );

    private static $defaults = array(
        'ImageWidth'            => 300,
        'ImageHeight'           => 100,
        'WidgetForecastUrlText' => 'Click for weather forecast',
    );

    public function getTitle() {
        return $this->WidgetTitle;
    }

    /**
     * Optional WeatherWidgets
     *
     * For updated Widgets go to http://www.wunderground.com/
     *  and search for <WundergroundStation>
     *
     * Fahrenheit/MPH
     * <a href="http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=<WundergroundStation>"><img src="http://banners.wunderground.com/cgi-bin/banner/ban/wxBanner?bannertype=pws250&weatherstationcount=<WundergroundStation>" width="250" height="150" border="0" alt="Weather Underground PWS <WundergroundStation>" />
     * Celsius/KPH
     * <a href="http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=<WundergroundStation>"><img src="http://banners.wunderground.com/cgi-bin/banner/ban/wxBanner?bannertype=pws250_metric&weatherstationcount=<WundergroundStation>" width="250" height="150" border="0" alt="Weather Underground PWS <WundergroundStation>" />
     * Fahrenheit and Celsius
     * <a href="http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=<WundergroundStation>"><img src="http://banners.wunderground.com/cgi-bin/banner/ban/wxBanner?bannertype=pws250_both&weatherstationcount=<WundergroundStation>" width="250" height="150" border="0" alt="Weather Underground PWS <WundergroundStation>" />
     * 300x100 with forecast
     * <img src="http://weathersticker.wunderground.com/weathersticker/cgi-bin/banner/ban/wxBanner?bannertype=wu_clean2day_cond&pwscode=<WundergroundStation>&ForcedCity=<City>&ForcedState=<ST>&zip=05826&language=EN" alt="Find more about Weather in <City>, <ST>" width="300" />
Click for weather forecast
     * Night them with Sunrise/Sunset
     * <a href='http://www.wunderground.com/cgi-bin/findweather/getForecast?query=<City>, <ST>' title='<City>, <ST> Weather Forecast'><img src='http://weathersticker.wunderground.com/weathersticker/sunandmoon/language/english/US/<ST>/<City>.gif' alt='Find more about Weather in' />
Click for weather forecast
     *
     * @return HTML string
     *
     *
     */

    public function WeatherWidgetHtml() {

        $strHtml = <<<EOT

        WidgetForecastUrl}" title="{$this->WidgetForecastUrlText}"
            target="_blank">WidgetImageUrl}" alt="{$this->WidgetImageAlt}"
            width="{$this->ImageWidth}" height="{$this->ImageHeight}" />
WidgetForecastUrl}" title="{$this->WidgetForecastUrlText}"
                        target="_blank">{$this->WidgetForecastUrlText}

ExternalUrl}"
			  title="{$this->ExternalUrlLabel}">{$this->ExternalUrlLabel}

EOT;

        return $strHtml;
    }

}


text: node ./dist/mainDev.js &


text:
<meta charset="utf8">
<title>moon orbit</title>
<link type="text/css" href="../../resources/webgl-tutorials.css" rel="stylesheet" />

<canvas id="orbit" width="400" height="300"></canvas>
<canvas id="c" width="400" height="300"></canvas>


text:
package org.apache.hadoop.fs.azure;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.Date;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.azure.metrics.AzureFileSystemInstrumentation;
import org.apache.hadoop.fs.permission.PermissionStatus;

import com.google.common.annotations.VisibleForTesting;

/**
 * <p>
 * An abstraction for a key-based {@link File} store.
 * </p>
 */
@InterfaceAudience.Private
interface NativeFileSystemStore {

  void initialize(URI uri, Configuration conf, AzureFileSystemInstrumentation instrumentation) throws IOException;

  void storeEmptyFolder(String key, PermissionStatus permissionStatus)
      throws AzureException;

  FileMetadata retrieveMetadata(String key) throws IOException;

  InputStream retrieve(String key) throws IOException;

  InputStream retrieve(String key, long byteRangeStart) throws IOException;

  DataOutputStream storefile(String keyEncoded,
      PermissionStatus permissionStatus,
      String key) throws AzureException;

  boolean isPageBlobKey(String key);

  boolean isAtomicRenameKey(String key);

  /**
   * Returns the file block size.  This is a fake value used for integration
   * of the Azure store with Hadoop.
   * @return The file block size.
   */
  long getHadoopBlockSize();

  void storeEmptyLinkFile(String key, String tempBlobKey,
      PermissionStatus permissionStatus) throws AzureException;

  String getLinkInFileMetadata(String key) throws AzureException;

  FileMetadata[] list(String prefix, final int maxListingCount,
      final int maxListingDepth) throws IOException;

  void changePermissionStatus(String key, PermissionStatus newPermission)
      throws AzureException;

  /**
   * API to delete a blob in the back end azure storage.
   * @param key - key to the blob being deleted.
   * @return return true when delete is successful, false if
   * blob cannot be found or delete is not possible without
   * exception.
   * @throws IOException Exception encountered while deleting in
   * azure storage.
   */
  boolean delete(String key) throws IOException;

  void rename(String srcKey, String dstKey) throws IOException;

  void rename(String srcKey, String dstKey, boolean acquireLease, SelfRenewingLease existingLease)
      throws IOException;

  void rename(String srcKey, String dstKey, boolean acquireLease,
              SelfRenewingLease existingLease, boolean overwriteDestination)
      throws IOException;

  /**
   * Delete all keys with the given prefix. Used for testing.
   *
   * @param prefix prefix of objects to be deleted.
   * @throws IOException Exception encountered while deleting keys.
   */
  @VisibleForTesting
  void purge(String prefix) throws IOException;

  /**
   * Diagnostic method to dump state to the console.
   *
   * @throws IOException Exception encountered while dumping to console.
   */
  void dump() throws IOException;

  void close();

  void updateFolderLastModifiedTime(String key, SelfRenewingLease folderLease)
      throws AzureException;

  void updateFolderLastModifiedTime(String key, Date lastModified,
      SelfRenewingLease folderLease) throws AzureException;

  /**
   * API to delete a blob in the back end azure storage.
   * @param key - key to the blob being deleted.
   * @param lease - Active lease on the blob.
   * @return return true when delete is successful, false if
   * blob cannot be found or delete is not possible without
   * exception.
   * @throws IOException Exception encountered while deleting in
   * azure storage.
   */
  boolean delete(String key, SelfRenewingLease lease) throws IOException;

  SelfRenewingLease acquireLease(String key) throws AzureException;

  DataOutputStream retrieveAppendStream(String key, int bufferSize) throws IOException;

  boolean explicitFileExists(String key) throws AzureException;
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace CppSharp.AST
{
    public enum CppAbi
    {
        Itanium,
        Microsoft,
        ARM,
        iOS,
        iOS64
    }

    /// <summary>
    /// An AST context is a container for translation units.
    /// </summary>
    public class ASTContext
    {
        public List<TranslationUnit> TranslationUnits;

        public ASTContext()
        {
            TranslationUnits = new List<TranslationUnit>();
        }

        static private string NormalizeTranslationUnitFilePath(string name)
        {
            if (name.StartsWith("<"))
                return name;

            try
            {
                name = Path.GetFullPath(name);
            }
            catch (ArgumentException)
            {
                // Normalization errors are expected when dealing with virtual
                // compiler files like <built-in>.
            }

            return name;
        }

        /// Finds an existing or creates a new one translation unit given a path.
        public TranslationUnit FindOrCreateTranslationUnit(string file)
        {
            file = NormalizeTranslationUnitFilePath(file);
            var translationUnit = TranslationUnits.Find(m => m.FilePath.Equals(file));

            if (translationUnit == null)
            {
                translationUnit = new TranslationUnit(file);
                TranslationUnits.Add(translationUnit);
            }

            return translationUnit;
        }

        /// Finds an existing enum in the library modules.
        public IEnumerable<Enumeration> FindEnum(string name)
        {
            return TranslationUnits.Select(
                module => module.FindEnum(name)).Where(type => type != null);
        }

        /// Finds the complete declaration of an enum.
        public Enumeration FindCompleteEnum(string name)
        {
            return FindEnum(name).FirstOrDefault(@enum => !@enum.IsIncomplete);
        }

        /// Finds an existing struct/class in the library modules.
        public IEnumerable<Class> FindClass(string name, bool create = false,
            bool ignoreCase = false)
        {
            return TranslationUnits.Select(
                module => module.FindClass(name,
                    ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal))
                .Where(type => type != null);
        }

        /// Finds the complete declaration of a class.
        public Class FindCompleteClass(string name, bool ignoreCase = false)
        {
            return FindClass(name, ignoreCase: ignoreCase).FirstOrDefault(
                @class => !@class.IsIncomplete);
        }

        /// Finds an existing function in the library modules.
        public IEnumerable<Function> FindFunction(string name)
        {
            return TranslationUnits.Select(module => module.FindFunction(name))
                .Where(type => type != null);
        }

        /// Finds an existing typedef in the library modules.
        public IEnumerable<TypedefNameDecl> FindTypedef(string name)
        {
            return TranslationUnits.Select(module => module.FindTypedef(name))
                .Where(type => type != null);
        }

        /// Finds an existing declaration by name.
        public IEnumerable<T> FindDecl<T>(string name) where T : Declaration
        {
            switch (typeof(T).Name)
            {
                case "Enumeration":
                    foreach (var module in TranslationUnits)
                        yield return module.FindEnum(name) as T;
                    break;
                case "Class":
                    foreach (var module in TranslationUnits)
                        yield return module.FindClass(name) as T;
                    break;
                case "ClassTemplate":
                    foreach (var module in TranslationUnits)
                        foreach (var template in module.FindClassTemplate(name))
                            yield return template as T;
                    break;
                case "Function":
                    foreach (var module in TranslationUnits)
                        yield return module.FindFunction(name) as T;
                    break;
                case "Variable":
                    foreach (var variable in from unit in TranslationUnits
                                             from variable in unit.Variables
                                             where variable.Name == name
                                             select variable)
                        yield return variable as T;
                    break;
                default:
                    foreach (var decl in from unit in TranslationUnits
                                         from decl in unit.Declarations
                                         where decl.Name == name
                                         select decl)
                        yield return decl as T;
                    break;
            }
        }

        public void SetEnumAsFlags(string name)
        {
            var enums = FindEnum(name);
            foreach(var @enum in enums)
                @enum.SetFlags();
        }

        public void ExcludeFromPass(string name, System.Type type)
        {
            var decls = FindDecl<Declaration>(name);

            foreach (var decl in decls)
                decl.ExcludeFromPasses.Add(type);
        }

        /// <summary>
        /// Use this to rename namespaces.
        /// </summary>
        public void RenameNamespace(string name, string newName)
        {
            foreach (var unit in TranslationUnits)
            {
                var @namespace = unit.FindNamespace(name);

                if (@namespace != null)
                    @namespace.Name = newName;
            }
        }
    }
}


text:
package com.github.kmbulebu.nicknack.providers.wemo.actions;

import java.util.Arrays;
import java.util.UUID;

import com.github.kmbulebu.nicknack.core.actions.Action;
import com.github.kmbulebu.nicknack.core.actions.ActionFailureException;
import com.github.kmbulebu.nicknack.core.actions.ActionParameterException;
import com.github.kmbulebu.nicknack.core.actions.BasicActionDefinition;
import com.github.kmbulebu.nicknack.core.attributes.AttributeDefinition;
import com.github.kmbulebu.nicknack.providers.wemo.attributes.FriendlyNameAttributeDefinition;

public abstract class AbstractWemoActionDefinition extends BasicActionDefinition {

	public AbstractWemoActionDefinition(UUID uuid, String name, String description, AttributeDefinition... attributeDefinitions) {
		super(uuid, name, description, appendCommonAttributeDefinition(attributeDefinitions));
	}

	private static AttributeDefinition[] appendCommonAttributeDefinition(AttributeDefinition... attributeDefinitions) {
		final AttributeDefinition[] definitions = Arrays.copyOf(attributeDefinitions, attributeDefinitions.length + 1);
		definitions[definitions.length - 1] = FriendlyNameAttributeDefinition.INSTANCE;
		return definitions;
	}

	public abstract void run(Action action) throws ActionFailureException, ActionParameterException;

}


text:
package com.opengamma.strata.report;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;

import org.joda.beans.Bean;
import org.joda.beans.BeanDefinition;
import org.joda.beans.ImmutableBean;
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.MetaProperty;
import org.joda.beans.Property;
import org.joda.beans.PropertyDefinition;
import org.joda.beans.impl.direct.DirectFieldsBeanBuilder;
import org.joda.beans.impl.direct.DirectMetaBean;
import org.joda.beans.impl.direct.DirectMetaProperty;
import org.joda.beans.impl.direct.DirectMetaPropertyMap;

import com.google.common.collect.ImmutableList;
import com.opengamma.strata.engine.Column;
import com.opengamma.strata.engine.calculation.Results;
import com.opengamma.strata.finance.Trade;

/**
 * Stores a set of engine calculation results along with the context required to run reports.
 */
@BeanDefinition
public class ReportCalculationResults implements ImmutableBean {

  /** The valuation date. */
  @PropertyDefinition(validate = "notNull")
  private final LocalDate valuationDate;

  /** The trades on which the results are calculated. */
  @PropertyDefinition(validate = "notNull")
  private final List<Trade> trades;

  /** The columns contained in the results. */
  @PropertyDefinition(validate = "notNull")
  private final List<Column> columns;

  /** The calculation results. */
  @PropertyDefinition(validate = "notNull")
  private final Results calculationResults;

  public static ReportCalculationResults of(
      LocalDate valuationDate,
      List<Trade> trades,
      List<Column> columns,
      Results calculationResults) {

    return ReportCalculationResults.builder()
        .valuationDate(valuationDate)
        .trades(trades)
        .columns(columns)
        .calculationResults(calculationResults)
        .build();
  }

  //------------------------- AUTOGENERATED START -------------------------
  ///CLOVER:OFF
  /**
   * The meta-bean for {@code ReportCalculationResults}.
   * @return the meta-bean, not null
   */
  public static ReportCalculationResults.Meta meta() {
    return ReportCalculationResults.Meta.INSTANCE;
  }

  static {
    JodaBeanUtils.registerMetaBean(ReportCalculationResults.Meta.INSTANCE);
  }

  /**
   * Returns a builder used to create an instance of the bean.
   * @return the builder, not null
   */
  public static ReportCalculationResults.Builder builder() {
    return new ReportCalculationResults.Builder();
  }

  /**
   * Restricted constructor.
   * @param builder  the builder to copy from, not null
   */
  protected ReportCalculationResults(ReportCalculationResults.Builder builder) {
    JodaBeanUtils.notNull(builder.valuationDate, "valuationDate");
    JodaBeanUtils.notNull(builder.trades, "trades");
    JodaBeanUtils.notNull(builder.columns, "columns");
    JodaBeanUtils.notNull(builder.calculationResults, "calculationResults");
    this.valuationDate = builder.valuationDate;
    this.trades = ImmutableList.copyOf(builder.trades);
    this.columns = ImmutableList.copyOf(builder.columns);
    this.calculationResults = builder.calculationResults;
  }

  @Override
  public ReportCalculationResults.Meta metaBean() {
    return ReportCalculationResults.Meta.INSTANCE;
  }

  @Override
  public <R> Property<R> property(String propertyName) {
    return metaBean().<R>metaProperty(propertyName).createProperty(this);
  }

  @Override
  public Set<String> propertyNames() {
    return metaBean().metaPropertyMap().keySet();
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the valuation date.
   * @return the value of the property, not null
   */
  public LocalDate getValuationDate() {
    return valuationDate;
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the trades on which the results are calculated.
   * @return the value of the property, not null
   */
  public List<Trade> getTrades() {
    return trades;
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the columns contained in the results.
   * @return the value of the property, not null
   */
  public List<Column> getColumns() {
    return columns;
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the calculation results.
   * @return the value of the property, not null
   */
  public Results getCalculationResults() {
    return calculationResults;
  }

  //-----------------------------------------------------------------------
  /**
   * Returns a builder that allows this bean to be mutated.
   * @return the mutable builder, not null
   */
  public Builder toBuilder() {
    return new Builder(this);
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    }
    if (obj != null && obj.getClass() == this.getClass()) {
      ReportCalculationResults other = (ReportCalculationResults) obj;
      return JodaBeanUtils.equal(getValuationDate(), other.getValuationDate()) &&
          JodaBeanUtils.equal(getTrades(), other.getTrades()) &&
          JodaBeanUtils.equal(getColumns(), other.getColumns()) &&
          JodaBeanUtils.equal(getCalculationResults(), other.getCalculationResults());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int hash = getClass().hashCode();
    hash = hash * 31 + JodaBeanUtils.hashCode(getValuationDate());
    hash = hash * 31 + JodaBeanUtils.hashCode(getTrades());
    hash = hash * 31 + JodaBeanUtils.hashCode(getColumns());
    hash = hash * 31 + JodaBeanUtils.hashCode(getCalculationResults());
    return hash;
  }

  @Override
  public String toString() {
    StringBuilder buf = new StringBuilder(160);
    buf.append("ReportCalculationResults{");
    int len = buf.length();
    toString(buf);
    if (buf.length() > len) {
      buf.setLength(buf.length() - 2);
    }
    buf.append('}');
    return buf.toString();
  }

  protected void toString(StringBuilder buf) {
    buf.append("valuationDate").append('=').append(JodaBeanUtils.toString(getValuationDate())).append(',').append(' ');
    buf.append("trades").append('=').append(JodaBeanUtils.toString(getTrades())).append(',').append(' ');
    buf.append("columns").append('=').append(JodaBeanUtils.toString(getColumns())).append(',').append(' ');
    buf.append("calculationResults").append('=').append(JodaBeanUtils.toString(getCalculationResults())).append(',').append(' ');
  }

  //-----------------------------------------------------------------------
  /**
   * The meta-bean for {@code ReportCalculationResults}.
   */
  public static class Meta extends DirectMetaBean {
    /**
     * The singleton instance of the meta-bean.
     */
    static final Meta INSTANCE = new Meta();

    /**
     * The meta-property for the {@code valuationDate} property.
     */
    private final MetaProperty<LocalDate> valuationDate = DirectMetaProperty.ofImmutable(
        this, "valuationDate", ReportCalculationResults.class, LocalDate.class);
    /**
     * The meta-property for the {@code trades} property.
     */
    @SuppressWarnings({"unchecked", "rawtypes" })
    private final MetaProperty<List<Trade>> trades = DirectMetaProperty.ofImmutable(
        this, "trades", ReportCalculationResults.class, (Class) List.class);
    /**
     * The meta-property for the {@code columns} property.
     */
    @SuppressWarnings({"unchecked", "rawtypes" })
    private final MetaProperty<List<Column>> columns = DirectMetaProperty.ofImmutable(
        this, "columns", ReportCalculationResults.class, (Class) List.class);
    /**
     * The meta-property for the {@code calculationResults} property.
     */
    private final MetaProperty<Results> calculationResults = DirectMetaProperty.ofImmutable(
        this, "calculationResults", ReportCalculationResults.class, Results.class);
    /**
     * The meta-properties.
     */
    private final Map<String, MetaProperty<?>> metaPropertyMap$ = new DirectMetaPropertyMap(
        this, null,
        "valuationDate",
        "trades",
        "columns",
        "calculationResults");

    /**
     * Restricted constructor.
     */
    protected Meta() {
    }

    @Override
    protected MetaProperty<?> metaPropertyGet(String propertyName) {
      switch (propertyName.hashCode()) {
        case 113107279:  // valuationDate
          return valuationDate;
        case -865715313:  // trades
          return trades;
        case 949721053:  // columns
          return columns;
        case 2096132333:  // calculationResults
          return calculationResults;
      }
      return super.metaPropertyGet(propertyName);
    }

    @Override
    public ReportCalculationResults.Builder builder() {
      return new ReportCalculationResults.Builder();
    }

    @Override
    public Class<? extends ReportCalculationResults> beanType() {
      return ReportCalculationResults.class;
    }

    @Override
    public Map<String, MetaProperty<?>> metaPropertyMap() {
      return metaPropertyMap$;
    }

    //-----------------------------------------------------------------------
    /**
     * The meta-property for the {@code valuationDate} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<LocalDate> valuationDate() {
      return valuationDate;
    }

    /**
     * The meta-property for the {@code trades} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<List<Trade>> trades() {
      return trades;
    }

    /**
     * The meta-property for the {@code columns} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<List<Column>> columns() {
      return columns;
    }

    /**
     * The meta-property for the {@code calculationResults} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<Results> calculationResults() {
      return calculationResults;
    }

    //-----------------------------------------------------------------------
    @Override
    protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
      switch (propertyName.hashCode()) {
        case 113107279:  // valuationDate
          return ((ReportCalculationResults) bean).getValuationDate();
        case -865715313:  // trades
          return ((ReportCalculationResults) bean).getTrades();
        case 949721053:  // columns
          return ((ReportCalculationResults) bean).getColumns();
        case 2096132333:  // calculationResults
          return ((ReportCalculationResults) bean).getCalculationResults();
      }
      return super.propertyGet(bean, propertyName, quiet);
    }

    @Override
    protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) {
      metaProperty(propertyName);
      if (quiet) {
        return;
      }
      throw new UnsupportedOperationException("Property cannot be written: " + propertyName);
    }

  }

  //-----------------------------------------------------------------------
  /**
   * The bean-builder for {@code ReportCalculationResults}.
   */
  public static class Builder extends DirectFieldsBeanBuilder<ReportCalculationResults> {

    private LocalDate valuationDate;
    private List<Trade> trades = ImmutableList.of();
    private List<Column> columns = ImmutableList.of();
    private Results calculationResults;

    /**
     * Restricted constructor.
     */
    protected Builder() {
    }

    /**
     * Restricted copy constructor.
     * @param beanToCopy  the bean to copy from, not null
     */
    protected Builder(ReportCalculationResults beanToCopy) {
      this.valuationDate = beanToCopy.getValuationDate();
      this.trades = ImmutableList.copyOf(beanToCopy.getTrades());
      this.columns = ImmutableList.copyOf(beanToCopy.getColumns());
      this.calculationResults = beanToCopy.getCalculationResults();
    }

    //-----------------------------------------------------------------------
    @Override
    public Object get(String propertyName) {
      switch (propertyName.hashCode()) {
        case 113107279:  // valuationDate
          return valuationDate;
        case -865715313:  // trades
          return trades;
        case 949721053:  // columns
          return columns;
        case 2096132333:  // calculationResults
          return calculationResults;
        default:
          throw new NoSuchElementException("Unknown property: " + propertyName);
      }
    }

    @SuppressWarnings("unchecked")
    @Override
    public Builder set(String propertyName, Object newValue) {
      switch (propertyName.hashCode()) {
        case 113107279:  // valuationDate
          this.valuationDate = (LocalDate) newValue;
          break;
        case -865715313:  // trades
          this.trades = (List<Trade>) newValue;
          break;
        case 949721053:  // columns
          this.columns = (List<Column>) newValue;
          break;
        case 2096132333:  // calculationResults
          this.calculationResults = (Results) newValue;
          break;
        default:
          throw new NoSuchElementException("Unknown property: " + propertyName);
      }
      return this;
    }

    @Override
    public Builder set(MetaProperty<?> property, Object value) {
      super.set(property, value);
      return this;
    }

    @Override
    public Builder setString(String propertyName, String value) {
      setString(meta().metaProperty(propertyName), value);
      return this;
    }

    @Override
    public Builder setString(MetaProperty<?> property, String value) {
      super.setString(property, value);
      return this;
    }

    @Override
    public Builder setAll(Map<String, ? extends Object> propertyValueMap) {
      super.setAll(propertyValueMap);
      return this;
    }

    @Override
    public ReportCalculationResults build() {
      return new ReportCalculationResults(this);
    }

    //-----------------------------------------------------------------------
    /**
     * Sets the valuation date.
     * @param valuationDate  the new value, not null
     * @return this, for chaining, not null
     */
    public Builder valuationDate(LocalDate valuationDate) {
      JodaBeanUtils.notNull(valuationDate, "valuationDate");
      this.valuationDate = valuationDate;
      return this;
    }

    /**
     * Sets the trades on which the results are calculated.
     * @param trades  the new value, not null
     * @return this, for chaining, not null
     */
    public Builder trades(List<Trade> trades) {
      JodaBeanUtils.notNull(trades, "trades");
      this.trades = trades;
      return this;
    }

    /**
     * Sets the {@code trades} property in the builder
     * from an array of objects.
     * @param trades  the new value, not null
     * @return this, for chaining, not null
     */
    public Builder trades(Trade... trades) {
      return trades(ImmutableList.copyOf(trades));
    }

    /**
     * Sets the columns contained in the results.
     * @param columns  the new value, not null
     * @return this, for chaining, not null
     */
    public Builder columns(List<Column> columns) {
      JodaBeanUtils.notNull(columns, "columns");
      this.columns = columns;
      return this;
    }

    /**
     * Sets the {@code columns} property in the builder
     * from an array of objects.
     * @param columns  the new value, not null
     * @return this, for chaining, not null
     */
    public Builder columns(Column... columns) {
      return columns(ImmutableList.copyOf(columns));
    }

    /**
     * Sets the calculation results.
     * @param calculationResults  the new value, not null
     * @return this, for chaining, not null
     */
    public Builder calculationResults(Results calculationResults) {
      JodaBeanUtils.notNull(calculationResults, "calculationResults");
      this.calculationResults = calculationResults;
      return this;
    }

    //-----------------------------------------------------------------------
    @Override
    public String toString() {
      StringBuilder buf = new StringBuilder(160);
      buf.append("ReportCalculationResults.Builder{");
      int len = buf.length();
      toString(buf);
      if (buf.length() > len) {
        buf.setLength(buf.length() - 2);
      }
      buf.append('}');
      return buf.toString();
    }

    protected void toString(StringBuilder buf) {
      buf.append("valuationDate").append('=').append(JodaBeanUtils.toString(valuationDate)).append(',').append(' ');
      buf.append("trades").append('=').append(JodaBeanUtils.toString(trades)).append(',').append(' ');
      buf.append("columns").append('=').append(JodaBeanUtils.toString(columns)).append(',').append(' ');
      buf.append("calculationResults").append('=').append(JodaBeanUtils.toString(calculationResults)).append(',').append(' ');
    }

  }

  ///CLOVER:ON
  //-------------------------- AUTOGENERATED END --------------------------
}


text:
#ifndef _KERNEL_CONFIG_H_
#define _KERNEL_CONFIG_H_

/*
    Memory structure
*/

// Virtual
#define KERNEL_VIRTUAL_STACK 0x0007FFFC
#define KERNEL_VIRTUAL_CODE  0x00080000

// Interrupts
#define KERNEL_ISR 0x00090000

// Shared
#define SHARED_CODE  0x0009C000 // FIXME : 98k to 9Ek tested (Page 152)
#define SHARED_STACK (SHARED_CODE - 0x100)
#define SHARED_PAGE  (SHARED_CODE / 0x1000)

// Base
#define KERNEL_BASE  0x00100000
#define KERNEL_ENTRY 0x00101a10
#define KERNEL_STACK 0x007BFFFC
#define KERNEL_LIMIT 0x00800000

// Memory
#define MEMORY_MAP               0x007C0000
#define MEMORY_DIRECTORIES       0x00800000
#define MEMORY_TABLES            0x00C00000
#define MEMORY_LIMIT             0x01000000
#define MEMORY_DIRECTORIES_COUNT ((MEMORY_TABLES - MEMORY_DIRECTORIES) / 0x1000)
#define MEMORY_TABLES_COUNT      ((MEMORY_LIMIT - MEMORY_TABLES) / 0x1000)

// Video
#define VIDEO_BASE         0xE8000000
#define VIDEO_LIMIT        0xE9000000
#define VIDEO_TABLES_COUNT ((VIDEO_LIMIT - VIDEO_BASE) / 0x1000)

// SVGA
#define SVGA_BASE         0xFE000000
#define SVGA_LIMIT        0xFF000000
#define SVGA_TABLES_COUNT ((VIDEO_LIMIT - VIDEO_BASE) / 0x1000)

// Heap
#define HEAP_BASE         0xC0000000
#define HEAP_SIZE         0x01000000 // x 16 Mo
#define HEAP_LIMIT        0xC1000000

/*
    Debugging
*/

#define TRACE   1
#define DEBUG   2
#define INFO    3
#define WARNING 4
#define ERROR   5

// Kernel
#define DEBUG_TASKING 0
#define DEBUG_MEMORY  ERROR
#define DEBUG_STRING  ERROR
#define DEBUG_API     TRACE
#define DEBUG_FILES   TRACE

// Screen
#define DEBUG_REFRESHES 0

/*
    Settings
*/
#define FRENQUENCY_DIVIDER (DEBUG_TASKING ? 100 : 1)

#endif