text:
package controllers;

import com.avaje.ebean.Ebean;
import com.avaje.ebean.Query;
import com.avaje.ebean.RawSql;
import com.avaje.ebean.RawSqlBuilder;
import com.fasterxml.jackson.databind.node.ObjectNode;
import controllers.annotation.AnonymousCheck;
import models.*;
import models.enumeration.ResourceType;
import models.support.IssueLabelAggregate;
import org.apache.commons.lang.StringUtils;
import play.Configuration;
import play.libs.F;
import play.libs.F.Promise;
import play.libs.Json;
import play.libs.ws.WS;
import play.mvc.Result;
import utils.ErrorViews;
import views.html.migration.home;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import java.util.stream.Collectors;

import static play.libs.Json.toJson;
import static play.mvc.Http.Context.Implicit.request;
import static play.mvc.Results.forbidden;
import static play.mvc.Results.ok;

@AnonymousCheck
public class MigrationApp {

    static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'");
    private static final String YONA_SERVER = "/";

    @AnonymousCheck(requiresLogin = true, displaysFlashMessage = true)
    public static Promise<Result> migration() {
        final boolean isAllowed = Configuration.root().getBoolean("github.allow.migration", false);
        if(!isAllowed){
            return Promise.pure(forbidden(ErrorViews.Forbidden.render("error.forbidden.or.not.allowed")));
        }
        String authProcessingCode = request().getQueryString("code");

        if(StringUtils.isNotBlank(authProcessingCode)){
            return getOAuthToken(authProcessingCode).map((F.Function<String, Result>) token
                    -> ok(home.render("Migration", authProcessingCode, token)));
        } else {
            return Promise.promise((F.Function0<Result>) ()
                    -> ok(home.render("Migration", null, null)));
        }
    }

    private static Promise<String> getOAuthToken(String code) {
        final String ACCESS_TOKEN_URL = "https://github.com/login/oauth/access_token";
        final String CLIENT_ID = Configuration.root().getString("github.client.id");
        final String CLIENT_SECRET = Configuration.root().getString("github.client.secret");

        return WS.url(ACCESS_TOKEN_URL)
                .setContentType("application/x-www-form-urlencoded")
                .setHeader("Accept", "application/json,application/x-www-form-urlencoded,text/html,*/*")
                .post("client_id=" + CLIENT_ID + "&client_secret=" + CLIENT_SECRET + "&code=" + code)
                .map(response -> {
                    play.Logger.debug(response.getBody());
                    String accessToken = "";
                    try {
                        Pattern p = Pattern.compile("access_token=([^&]+)");
                        Matcher m = p.matcher(response.getBody());
                        if(m.find() ){
                            accessToken = m.group(1);
                        }
                    } catch (PatternSyntaxException ex) {
                        play.Logger.error("Couldn't find access_token");
                    }
                    play.Logger.error("token=" + accessToken);
                    return accessToken;
                });
    }

    @AnonymousCheck(requiresLogin = true, displaysFlashMessage = true)
    public static Result projects(){
        Set<Project> sourceProjects = new HashSet<>();

        getheringOrgProjects(sourceProjects);
        gatheringUserProjects(sourceProjects);

        List<ObjectNode> projects = new ArrayList<>();
        for(Project project: sortProjectsByOwnerAndName(sourceProjects)){
            ObjectNode projectNode = Json.newObject();
            projectNode.put("owner", project.owner);
            projectNode.put("projectName", project.name);
            projectNode.put("private", project.isPrivate());
            projectNode.put("members", project.members().size());
            projectNode.put("full_name", project.owner + "/" + project.name);
            projects.add(projectNode);
        }
        return ok(toJson(projects));
    }

    private static List<Project> sortProjectsByOwnerAndName(Set<Project> projects) {
        Comparator<Project> comparator = Comparator.comparing(project -> project.owner);
        comparator = comparator.thenComparing(Comparator.comparing(project -> project.name));
        List<Project> list = new ArrayList<>(projects);
        Collections.sort(list, comparator);
        return list;
    }

    @AnonymousCheck(requiresLogin = true, displaysFlashMessage = true)
    public static Result project(String owner, String projectName){
        Project project = Project.findByOwnerAndProjectName(owner, projectName);

        ObjectNode result = Json.newObject();
        result.put("owner", project.owner);
        result.put("projectName", project.name);
        result.put("full_name", project.owner + "/" + project.name);
        result.put("assignees", toJson(getAssginees(project).toArray()));
        result.put("memberCount", project.members().size());
        result.put("issueCount", project.issues.size());
        result.put("postCount", project.posts.size());
        result.put("milestoneCount", project.milestones.size());
        return ok(result);
    }

    public static List<ObjectNode> getAssginees(Project project) {
        List<ObjectNode> members = new ArrayList<>();
        for(Assignee assignee: project.assignees){
            ObjectNode member = Json.newObject();
            member.put("name", assignee.user.name);
            member.put("login", assignee.user.loginId);
            member.put("email", assignee.user.email);
            members.add(member);
        }
        return members;
    }

    public static List<ObjectNode> getAuthors(Project project) {
        List<ObjectNode> authors = new ArrayList<>();
        for(User user: project.findAuthors()){
            ObjectNode member = Json.newObject();
            member.put("name", user.name);
            member.put("login", user.loginId);
            member.put("email", user.email);
            authors.add(member);
        }
        return authors;
    }

    @AnonymousCheck(requiresLogin = true, displaysFlashMessage = true)
    public static Result exportIssueLabelPairs(String owner, String projectName){
        ObjectNode issueLabelPairs = composeIssueLabelPairJson(owner, projectName);
        return ok(issueLabelPairs);
    }

    public static ObjectNode composeIssueLabelPairJson(String owner, String projectName) {
        Project project = Project.findByOwnerAndProjectName(owner, projectName);

        Query<IssueLabelAggregate> query = Ebean.find(IssueLabelAggregate.class);
        String sql = "select issue_id, issue_label_id \n" +
                "from issue i, issue_issue_label iil \n" +
                "where project_id = " + project.id + "\n" +
                "and i.id = iil.issue_id";
        RawSql rawSql = RawSqlBuilder.parse(sql).create();
        query.setRawSql(rawSql);
        List<IssueLabelAggregate> results = query.findList();

        ObjectNode issueLabelPairs = Json.newObject();
        issueLabelPairs.put("issueLabelPairs", toJson(results));
        return issueLabelPairs;
    }

    @AnonymousCheck(requiresLogin = true, displaysFlashMessage = true)
    public static Result exportLabels(String owner, String projectName){
        Project project = Project.findByOwnerAndProjectName(owner, projectName);

        ObjectNode labels = Json.newObject();
        for (IssueLabel label : IssueLabel.findByProject(project)) {
            ObjectNode node = Json.newObject();
            node.put("id", label.id);
            node.put("name", label.name);
            node.put("categoryId", label.category.id);
            node.put("categoryName", label.category.name);
            labels.put(String.valueOf(label.id), node);
        }

        ObjectNode exportData = Json.newObject();
        exportData.put("labels", toJson(labels));
        return ok(exportData);
    }

    @AnonymousCheck(requiresLogin = true, displaysFlashMessage = true)
    public static Result exportMilestones(String owner, String projectName){
        Project project = Project.findByOwnerAndProjectName(owner, projectName);

        List<ObjectNode> milestones = project.milestones.stream()
                .map(MigrationApp::composeMilestoneJson).collect(Collectors.toList());

        ObjectNode exportData = Json.newObject();
        exportData.put("milestones", toJson(milestones));
        return ok(exportData);
    }

    @AnonymousCheck(requiresLogin = true, displaysFlashMessage = true)
    public static Result exportPosts(String owner, String projectName){
        Project project = Project.findByOwnerAndProjectName(owner, projectName);

        List<ObjectNode> issues = project.posts.stream()
                .map(MigrationApp::composePostJson).collect(Collectors.toList());

        ObjectNode exportData = Json.newObject();
        exportData.put("issues", toJson(issues));
        return ok(exportData);
    }

    @AnonymousCheck(requiresLogin = true, displaysFlashMessage = true)
    public static Result exportIssues(String owner, String projectName){
        Project project = Project.findByOwnerAndProjectName(owner, projectName);

        List<ObjectNode> issues = project.issues.stream()
                .map(MigrationApp::composeIssueJson).collect(Collectors.toList());

        ObjectNode exportData = Json.newObject();
        exportData.put("issues", toJson(issues));
        return ok(exportData);
    }

    public static ObjectNode composeMilestoneJson(Milestone m) {

        ObjectNode milestoneJson = Json.newObject();
        milestoneJson.put("milestone", getMilestoneNode(m));
        return milestoneJson;
    }

    public static ObjectNode getMilestoneNode(Milestone m) {
        ObjectNode node = Json.newObject();
        node.put("id", m.id);
        node.put("title", m.title);
        node.put("state", m.state.state());
        node.put("description", m.contents);
        Optional.ofNullable(m.dueDate).ifPresent(dueDate -> node.put("due_on",
                LocalDateTime.ofInstant(m.dueDate.toInstant(), ZoneId.systemDefault()).format(formatter)));
        return node;
    }

    private static String addOriginalAuthorName(String bodyText, String authorLoginId,
                                                String authorName, String type, String link){
        return String.format("@%s (%s) 님이 작성한 [%s](%s)입니다. \n\\---\n\n%s",
                authorLoginId, authorName, type, link, bodyText);
    }

    private static String relativeLinksToAbsolutePath(String text){
        // replace relative img tag src to absolute path
        // and replace relative markdown link path to absolute path
        return text.replaceAll("(<img src=[\"\'])/(?<link>.*)([\"\']>)", "$1" + YONA_SERVER + "$2$3")
                .replaceAll("\\[(?<text>[^\\]]*)\\]\\(/(?<link>[^\\)]*)\\)", "[$1](" + YONA_SERVER + "$2)");
    }

    private static String relativeLinksToWikiCommitPath(String text){
        // replace relative img tag src to absolute path
        // and replace relative markdown link path to wiki commit file path
        return text.replaceAll("(<img src=[\"\'])/(?<link>.*)([\"\']>)", "$1" + YONA_SERVER + "$2$3")
                .replaceAll("\\[(?<text>[^\\]]*)\\]\\(/(?<link>[^\\)]*)\\)", "[$1](../wiki/$2/$1)");
    }

    private static StringBuilder addAttachmentsString(@NotNull StringBuilder sb, ResourceType type, String id){
        try {
            List<Map<String, String>> attachments = AttachmentApp.getFileList(type.toString(), id).get("attachments");
            if(attachments.size()>0){
                addListHeader(sb);
            }
            for(Map<String, String> attachment: attachments){
                sb.append(String.format("\n[%s](%s)", attachment.get("name"), YONA_SERVER + attachment.get("url")));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return sb;
    }

    private static void addListHeader(@NotNull StringBuilder sb) {
        sb.append("\n\n--- attachments ---");
    }

    private static StringBuilder addAttachmentsStringUsingWikiCommit(@NotNull StringBuilder sb, ResourceType type, String id){
        try {
            List<Map<String, String>> attachments = AttachmentApp.getFileList(type.toString(), id).get("attachments");
            if(attachments.size()>0){
                addListHeader(sb);
            }
            for(Map<String, String> attachment: attachments){
                sb.append(String.format("\n[%s](../wiki/files/%s/%s)", attachment.get("name"), attachment.get("id"),
                        attachment.get("name").replaceAll("#", "%23")));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return sb;
    }

    private static ObjectNode composePostJson(Posting posting) {
        String originalPostingLink = String.format("%s/%s/post/%s",
                YONA_SERVER + posting.project.owner, posting.project.name, posting.getNumber());

        ObjectNode node = Json.newObject();
        node.put("title", posting.title);

        // body 작성
        StringBuilder sb = new StringBuilder();

        if(usingWikiCommitForAttachment()){
            sb.append(addOriginalAuthorName(
                    relativeLinksToWikiCommitPath(posting.body), posting.authorLoginId,
                    posting.authorName, "게시글", originalPostingLink));
            sb = addAttachmentsStringUsingWikiCommit(sb, ResourceType.BOARD_POST, posting.id.toString());
        } else {
            sb.append(addOriginalAuthorName(
                    relativeLinksToAbsolutePath(posting.body), posting.authorLoginId, posting.authorName,
                    "게시글", originalPostingLink));
            sb = addAttachmentsString(sb, ResourceType.BOARD_POST, posting.id.toString());
        }
        node.put("body", sb.toString());
        node.put("created_at", LocalDateTime.ofInstant(posting.createdDate.toInstant(),
                ZoneId.systemDefault()).format(formatter));

        ObjectNode postingJson = Json.newObject();
        postingJson.put("issue", node);  // intentionally 'issue' key name is used for Github api compatibility
        postingJson.put("comments", toJson(composeCommentsJson(posting, originalPostingLink, ResourceType.NONISSUE_COMMENT)));
        return postingJson;
    }

    private static boolean usingWikiCommitForAttachment() {
        String withWikiCommit = request().getQueryString("withWikiCommit");
        boolean usingWikiCommit = StringUtils.isNotBlank(withWikiCommit) && withWikiCommit.endsWith("true");
        return usingWikiCommit;
    }

    private static ObjectNode composeIssueJson(Issue issue) {
        String originalIssueLink = String.format("%s/%s/issue/%s",
                YONA_SERVER + issue.project.owner, issue.project.name, issue.getNumber());

        ObjectNode node = Json.newObject();
        node.put("id", issue.id);
        node.put("title", issue.title);

        // body 작성
        StringBuilder sb = new StringBuilder();

        if(usingWikiCommitForAttachment()){
            sb.append(addOriginalAuthorName(
                    relativeLinksToWikiCommitPath(issue.body), issue.authorLoginId, issue.authorName, "이슈", originalIssueLink));
            sb = addAttachmentsStringUsingWikiCommit(sb, ResourceType.ISSUE_POST, issue.id.toString());
        } else {
            sb.append(addOriginalAuthorName(
                    relativeLinksToAbsolutePath(issue.body), issue.authorLoginId, issue.authorName, "이슈", originalIssueLink));
            sb = addAttachmentsString(sb, ResourceType.ISSUE_POST, issue.id.toString());
        }
        node.put("body", sb.toString());

        node.put("created_at", LocalDateTime.ofInstant(issue.createdDate.toInstant(),
                ZoneId.systemDefault()).format(formatter));
        Optional.ofNullable(issue.assignee).ifPresent(assignee -> node.put("assignee", assignee.user.loginId));
        Optional.ofNullable(issue.milestone).ifPresent(milestone -> node.put("milestone", milestone.title));
        Optional.ofNullable(issue.milestone).ifPresent(milestone -> node.put("milestoneId", milestone.id));

        node.put("closed", issue.isClosed());

        ObjectNode issueJson = Json.newObject();
        issueJson.put("issue", node);
        issueJson.put("comments", toJson(composeCommentsJson(issue, originalIssueLink, ResourceType.ISSUE_COMMENT)));
        return issueJson;
    }

    public static List<ObjectNode> composeCommentsJson(AbstractPosting posting, String orgLink, ResourceType type) {
        List<ObjectNode> comments = new ArrayList<>();
        for (Comment comment : posting.getComments()) {
            StringBuilder sb = new StringBuilder();
            ObjectNode commentNode = Json.newObject();
            commentNode.put("created_at", LocalDateTime.ofInstant(comment.createdDate.toInstant(),
                    ZoneId.systemDefault()).format(formatter));

            if(usingWikiCommitForAttachment()){
                sb.append(addOriginalAuthorName(
                        relativeLinksToWikiCommitPath(comment.contents), comment.authorLoginId, comment.authorName,
                        "코멘트", orgLink + "#comment-" + comment.id));
                sb = addAttachmentsStringUsingWikiCommit(sb, type, comment.id.toString());
            } else {
                sb.append(addOriginalAuthorName(
                        relativeLinksToAbsolutePath(comment.contents), comment.authorLoginId, comment.authorName,
                        "코멘트", orgLink + "#comment-" + comment.id));
                sb = addAttachmentsString(sb, type, comment.id.toString());
            }
            commentNode.put("body", sb.toString());
            comments.add(commentNode);
        }
        return comments;
    }

    public static List<ObjectNode> composePlainCommentsJson(AbstractPosting posting, ResourceType type) {
        List<ObjectNode> comments = new ArrayList<>();
        for (Comment comment : posting.getComments()) {
            ObjectNode commentNode = Json.newObject();
            commentNode.put("id", comment.id);
            commentNode.put("type", comment.asResource().getType().toString());
            commentNode.put("authorId", comment.authorLoginId);
            commentNode.put("authorName", comment.authorName);
            commentNode.put("created_at",comment.createdDate.getTime());
            commentNode.put("body", comment.contents);

            List<Attachment> attachments = Attachment.findByContainer(comment.asResource());
            if(attachments.size() > 0) {
                commentNode.put("attachments", toJson(attachments));
            }
            comments.add(commentNode);
        }
        return comments;
    }

    private static void gatheringUserProjects(Set<Project> targetProjects) {
        User worker = UserApp.currentUser();
        targetProjects.addAll(worker.projectUser.stream().
                filter(projectUser -> ProjectUser.isAllowedToSettings(worker.loginId, projectUser.project))
                .map(projectUser -> projectUser.project).collect(Collectors.toList()));
    }

    private static void getheringOrgProjects(Set<Project> targetProjects) {
        User worker = UserApp.currentUser();
        for (OrganizationUser organizationUser : OrganizationUser.findByAdmin(worker.id)) {
            targetProjects.addAll(organizationUser.organization.projects);
        }
    }
}


text:
require_relative 'model'
Record.where(version: 32).delete_all

redpajama_set_name: RedPajamaGithub


text:
package net.yoojia.asynchttp.support;

import net.yoojia.asynchttp.ResponseCallback;

import java.net.CookieStore;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.SocketAddress;

/**
 * @author : 桥下一粒砂
 * email  : chenyoca@gmail.com
 * date   : 2012-10-23
 * Http请求执行者,Http请求由此接口的实现类处理。
 */
public abstract class RequestInvoker implements Runnable{

	public enum HttpMethod{
		GET,POST,PUT,DELETE,OPTIONS,HEAD,TRACE,CONNECT;
	}

	private final static int HTTP_CONNECT_TIMEOUT = 10 * 1000;
	private final static int HTTP_SOCKET_TIMEOUT = 10 * 1000;

	protected HttpMethod method;
	protected String url;
	protected ParamsWrapper params;
	protected ResponseCallback callback;
	protected Proxy httpProxy;
    protected CookieStore customCookieStore;

    protected int httpConnectTimeout = HTTP_CONNECT_TIMEOUT;
	protected int httpSocketTimeout = HTTP_SOCKET_TIMEOUT;

	/**
	 * 设置Http代理
	 * @param httpProxy Http代理
	 */
	public void setHttpProxy (Proxy httpProxy) {
		this.httpProxy = httpProxy;
	}

    /**
     * 设置Cookie
     * @param customCookieStore
     */
    public void setCustomCookieStore(CookieStore customCookieStore) {
        this.customCookieStore = customCookieStore;
    }

	/**
	 * 设置Http代理
	 * @param host 代理主机
	 * @param port 代理端口
	 */
	public void setProxy(String host,int port){
		SocketAddress socketAddr = new InetSocketAddress(host, port);
		this.httpProxy = new Proxy(Proxy.Type.HTTP, socketAddr);
	}

	/**
	 * 设置连接超时
	 * @param httpConnectTimeout 超时时间,单位ms.
	 */
	public void setHttpConnectTimeout (int httpConnectTimeout) {
		this.httpConnectTimeout = httpConnectTimeout;
	}

	/**
	 * 设置Socket读取超时
	 * @param httpSocketTimeout 超时时间,单位ms.
	 */
	public void setHttpSocketTimeout (int httpSocketTimeout) {
		this.httpSocketTimeout = httpSocketTimeout;
	}

	public void init (HttpMethod method, String url, ParamsWrapper params,ResponseCallback callback){
		this.method = method;
		this.url = url;
		this.params = params;
		this.callback = callback;
	}

	/**
	 * 隐藏Runnable的实现而已
	 */
	@Override
	public final void run() {
		execute();
	}

	protected abstract void execute();

}


text:
namespace llvm {
  template <typename Info> class OnDiskIterableChainedHashTable;
}

namespace swift {
  class SILDeserializer {
    using TypeID = serialization::TypeID;

    ModuleFile *MF;
    SILModule &SILMod;
    DeserializationNotificationHandlerSet *Callback;

    /// The cursor used to lazily load SILFunctions.
    llvm::BitstreamCursor SILCursor;
    llvm::BitstreamCursor SILIndexCursor;

    class FuncTableInfo;
    using SerializedFuncTable =
      llvm::OnDiskIterableChainedHashTable<FuncTableInfo>;

    std::unique_ptr<SerializedFuncTable> FuncTable;
    std::vector<ModuleFile::PartiallySerialized<SILFunction*>> Funcs;

    std::unique_ptr<SerializedFuncTable> VTableList;
    std::vector<ModuleFile::Serialized<SILVTable*>> VTables;

    std::unique_ptr<SerializedFuncTable> GlobalVarList;
    std::vector<ModuleFile::Serialized<SILGlobalVariable*>> GlobalVars;

    std::unique_ptr<SerializedFuncTable> WitnessTableList;
    std::vector<ModuleFile::PartiallySerialized<SILWitnessTable *>>
    WitnessTables;

    std::unique_ptr<SerializedFuncTable> DefaultWitnessTableList;
    std::vector<ModuleFile::PartiallySerialized<SILDefaultWitnessTable *>>
    DefaultWitnessTables;

    std::vector<ModuleFile::PartiallySerialized<SILProperty *>>
    Properties;

    /// A declaration will only
    llvm::DenseMap<NormalProtocolConformance *, SILWitnessTable *>
    ConformanceToWitnessTableMap;

    /// Data structures used to perform name lookup for local values.
    llvm::DenseMap<uint32_t, ValueBase*> LocalValues;
    llvm::DenseMap<uint32_t, ValueBase*> ForwardLocalValues;
    serialization::ValueID LastValueID = 0;

    /// Data structures used to perform lookup of basic blocks.
    llvm::DenseMap<unsigned, SILBasicBlock*> BlocksByID;
    llvm::DenseMap<SILBasicBlock*, unsigned> UndefinedBlocks;
    unsigned BasicBlockID = 0;

    /// Return the SILBasicBlock of a given ID.
    SILBasicBlock *getBBForReference(SILFunction *Fn, unsigned ID);
    SILBasicBlock *getBBForDefinition(SILFunction *Fn, SILBasicBlock *Prev,
                                      unsigned ID);

    /// Read a SIL function.
    SILFunction *readSILFunction(serialization::DeclID, SILFunction *InFunc,
                                 StringRef Name, bool declarationOnly,
                                 bool errorIfEmptyBody = true);
    /// Read a SIL function.
    llvm::Expected<SILFunction *>
    readSILFunctionChecked(serialization::DeclID, SILFunction *InFunc,
                           StringRef Name, bool declarationOnly,
                           bool errorIfEmptyBody = true);

    /// Read a SIL basic block within a given SIL function.
    SILBasicBlock *readSILBasicBlock(SILFunction *Fn,
                                     SILBasicBlock *Prev,
                                     SmallVectorImpl<uint64_t> &scratch);
    /// Read a SIL instruction within a given SIL basic block.
    bool readSILInstruction(SILFunction *Fn, SILBasicBlock *BB,
                            SILBuilder &Builder,
                            unsigned RecordKind,
                            SmallVectorImpl<uint64_t> &scratch);

    /// Read the SIL function table.
    std::unique_ptr<SerializedFuncTable>
    readFuncTable(ArrayRef<uint64_t> fields, StringRef blobData);

    /// When an instruction or block argument is defined, this method is used to
    /// register it and update our symbol table.
    void setLocalValue(ValueBase *Value, serialization::ValueID Id);
    /// Get a reference to a local value with the specified ID and type.
    SILValue getLocalValue(serialization::ValueID Id,
                           SILType Type);

    SILFunction *getFuncForReference(StringRef Name, SILType Ty);
    SILFunction *getFuncForReference(StringRef Name);
    SILVTable *readVTable(serialization::DeclID);
    SILGlobalVariable *getGlobalForReference(StringRef Name);
    SILGlobalVariable *readGlobalVar(StringRef Name);
    SILWitnessTable *readWitnessTable(serialization::DeclID,
                                      SILWitnessTable *existingWt);
    SILProperty *readProperty(serialization::DeclID);
    SILDefaultWitnessTable *
    readDefaultWitnessTable(serialization::DeclID,
                            SILDefaultWitnessTable *existingWt);

    Optional<KeyPathPatternComponent>
    readKeyPathComponent(ArrayRef<uint64_t> ListOfValues, unsigned &nextValue);

public:
    Identifier getModuleIdentifier() const {
      return MF->getAssociatedModule()->getName();
    }
    FileUnit *getFile() const {
      return MF->getFile();
    }
    SILFunction *lookupSILFunction(SILFunction *InFunc);
    SILFunction *lookupSILFunction(StringRef Name,
                                   bool declarationOnly = false);
    bool hasSILFunction(StringRef Name, Optional<SILLinkage> Linkage = None);
    SILVTable *lookupVTable(Identifier Name);
    SILWitnessTable *lookupWitnessTable(SILWitnessTable *wt);
    SILDefaultWitnessTable *
    lookupDefaultWitnessTable(SILDefaultWitnessTable *wt);

    /// Invalidate all cached SILFunctions.
    void invalidateFunctionCache();

    /// Invalidate a specific cached SILFunction.
    bool invalidateFunction(SILFunction *F);

    /// Deserialize all SILFunctions, VTables, WitnessTables, and
    /// DefaultWitnessTables inside the module, and add them to SILMod.
    ///
    /// TODO: Globals.
    void getAll(bool UseCallback = true) {
      llvm::SaveAndRestore<DeserializationNotificationHandlerSet *> SaveCB(
          Callback);

      if (!UseCallback)
        Callback = nullptr;

      getAllSILFunctions();
      getAllSILGlobalVariables();
      getAllVTables();
      getAllWitnessTables();
      getAllDefaultWitnessTables();
      getAllProperties();
    }

    /// Deserialize all SILFunctions inside the module and add them to SILMod.
    void getAllSILFunctions();

    /// Deserialize all SILGlobalVariables inside the module and add them to
    /// SILMod.
    void getAllSILGlobalVariables();

    /// Deserialize all VTables inside the module and add them to SILMod.
    void getAllVTables();

    /// Deserialize all WitnessTables inside the module and add them to SILMod.
    void getAllWitnessTables();

    /// Deserialize all DefaultWitnessTables inside the module and add them
    /// to SILMod.
    void getAllDefaultWitnessTables();

    /// Deserialize all Property descriptors inside the module and add them
    /// to SILMod.
    void getAllProperties();

    SILDeserializer(ModuleFile *MF, SILModule &M,
                    DeserializationNotificationHandlerSet *callback);

    // Out of line to avoid instantiation OnDiskChainedHashTable here.
    ~SILDeserializer();
  };
} // end namespace swift


text:
package com.v_standard.scalikejdbc.orm.condition

import org.scalatest.FunSpec
import org.scalatest.matchers.ShouldMatchers

/**
 * ValueOperatorCondition テストスペッククラス。
 */
class ValueOperatorConditionSpec extends FunSpec with ShouldMatchers {
	describe("ValueOperatorCondition") {
		describe("tableAlias 省略") {
			it("条件式を返す") {
				val cond = new ValueOperatorCondition("col1", Option(5), "=", "") {}

				val actual = cond.sql(true, null)
				actual._1 should be ("col1 = ?")
				actual._2 should have size(1)
				actual._2(0) should be (5)
			}
		}

		describe("useAlias true で tableAlias 指定") {
			it("条件式を返す") {
				val cond = new ValueOperatorCondition("col1", Option(5), "=", "t1") {}

				val actual = cond.sql(true, null)
				actual._1 should be ("t1.col1 = ?")
				actual._2 should have size(1)
				actual._2(0) should be (5)
			}
		}

		describe("useAlias false で tableAlias 指定") {
			it("条件式を返す") {
				val cond = new ValueOperatorCondition("col1", Option(5), "=", "t1") {}

				val actual = cond.sql(false, null)
				actual._1 should be ("col1 = ?")
				actual._2 should have size(1)
				actual._2(0) should be (5)
			}
		}

		describe("値 が None") {
			it("空を返す") {
				val cond = new ValueOperatorCondition("col1", None, "=", "") {}

				val actual = cond.sql(true, null)
				actual should be (("", Nil))
			}
		}

		describe("値 が null") {
			it("空を返す") {
				val cond = new ValueOperatorCondition("col1", null, "=", "") {}

				val actual = cond.sql(true, null)
				actual should be (("", Nil))
			}
		}
	}

	describe("ValueEqualCondition") {
		describe("値を指定") {
			it("条件式を返す") {
				val cond = new ValueEqualCondition("col1", Option(5), "t1")

				val actual = cond.sql(true, null)
				actual._1 should be ("t1.col1 = ?")
				actual._2 should have size(1)
				actual._2(0) should be (5)
			}
		}

		describe("値 が null") {
			it("IS NULL 条件式 を返す") {
				val cond = new ValueEqualCondition("col1", null, "t1")

				val actual = cond.sql(true, null)
				actual._1 should be ("t1.col1 IS NULL")
				actual._2 should have size(0)
			}
		}
	}

	describe("ValueNotEqualCondition") {
		describe("値を指定") {
			it("条件式を返す") {
				val cond = new ValueNotEqualCondition("col1", Option(5))

				val actual = cond.sql(true, null)
				actual._1 should be ("col1 <> ?")
				actual._2 should have size(1)
				actual._2(0) should be (5)
			}
		}

		describe("値 が null") {
			it("IS NULL 条件式 を返す") {
				val cond = new ValueNotEqualCondition("col1", null)

				val actual = cond.sql(true, null)
				actual._1 should be ("col1 IS NOT NULL")
				actual._2 should have size(0)
			}
		}
	}

	describe("ValueLessCondition") {
		describe("値を指定") {
			it("条件式を返す") {
				val cond = new ValueLessCondition("col1", Option(5), "t1")

				val actual = cond.sql(true, null)
				actual._1 should be ("t1.col1 < ?")
				actual._2 should have size(1)
				actual._2(0) should be (5)
			}
		}
	}

	describe("ValueGreaterCondition") {
		describe("値を指定") {
			it("条件式を返す") {
				val cond = new ValueGreaterCondition("col1", Option(5), "t1")

				val actual = cond.sql(true, null)
				actual._1 should be ("t1.col1 > ?")
				actual._2 should have size(1)
				actual._2(0) should be (5)
			}
		}
	}

	describe("ValueLessEqualCondition") {
		describe("値を指定") {
			it("条件式を返す") {
				val cond = new ValueLessEqualCondition("col1", Option(5), "t1")

				val actual = cond.sql(true, null)
				actual._1 should be ("t1.col1 <= ?")
				actual._2 should have size(1)
				actual._2(0) should be (5)
			}
		}
	}

	describe("ValueGreaterEqualCondition") {
		describe("値を指定") {
			it("条件式を返す") {
				val cond = new ValueGreaterEqualCondition("col1", Option(5), "t1")

				val actual = cond.sql(true, null)
				actual._1 should be ("t1.col1 >= ?")
				actual._2 should have size(1)
				actual._2(0) should be (5)
			}
		}
	}
}


text:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { NglCarouselModule, NglButtonsModule } from 'ng-lightning';
import { NglDemoExampleModule } from 'src/app/example/example.module';

import { DemoCarouselComponent } from './carousel.component';

// Examples
import { DemoCarouselBasic } from './examples/basic';

const routes: Routes = [
  { path: '', component: DemoCarouselComponent },
];

@NgModule({
  imports: [
    CommonModule,
    RouterModule.forChild(routes),
    NglCarouselModule,
    NglButtonsModule,
    NglDemoExampleModule,
  ],
  declarations: [
    DemoCarouselComponent,
    DemoCarouselBasic,
  ],
})
export class NglDemoCarouselModule {}


text:
<html>
  <head>
    <title>form#enctype#multipart/form-data</title>
  </head>
  <body>
    <script type="text/javascript">
    <!--
    // -->
    </script>
    <form method="POST" action="/cgi-bin/action.cgi" enctype="multipart/form-data">
      <input type="text" name="key1" value="value1">
      <input type="file" name="filename">
      <input type="text" name="key2" value="value2">
      <input type="submit" value="submit">
    </form>
  </body>
</html>


text:
/*@font-face {
  font-family: AvenirNextPro;
  src: url("../font/AvenirLTStd-Light.woff") format("opentype");
}*/

/* overriding bootstrap default styles */
#navbar-margin {
  margin-bottom:0;
}

.navbar {
  margin-bottom: 0px;
}

/*.search-container .searchForm-submit:focus{
   outline: none !important;
}*/

/* prevents unintentional routing in Angular via href tags on empty anchors Bootstrap uses for styling */
.nav, .pagination, .carousel, .panel-title a { cursor: pointer; }

/* default styles */

body {
  /*background-color: #d3d3d3;*/
  overflow-x: hidden;
  font-family: AvenirNextPro, cursive;  /* Todo: change this  */
}

 ul {
  list-style-type: none;
}

a, a:hover, a:focus {
  color: #274D6F;
  text-decoration: none;
  cursor:pointer;
}

small {
  font-style: italic;
}

.main-color {
  color:#274D6F;
}


text:
from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(980, 642)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(660, 10, 261, 571))
        self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.groupBox_2 = QtWidgets.QGroupBox(self.verticalLayoutWidget)
        self.groupBox_2.setObjectName("groupBox_2")
        self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.groupBox_2)
        self.verticalLayout_4.setObjectName("verticalLayout_4")
        self.plot_treeWidget = QtWidgets.QTreeWidget(self.groupBox_2)
        self.plot_treeWidget.setObjectName("plot_treeWidget")
        self.plot_treeWidget.headerItem().setText(0, "1")
        self.verticalLayout_4.addWidget(self.plot_treeWidget)
        self.verticalLayout.addWidget(self.groupBox_2)
        self.btn_run_plotfcn = QtWidgets.QPushButton(self.verticalLayoutWidget)
        self.btn_run_plotfcn.setObjectName("btn_run_plotfcn")
        self.verticalLayout.addWidget(self.btn_run_plotfcn)
        self.verticalLayoutWidget_2 = QtWidgets.QWidget(self.centralwidget)
        self.verticalLayoutWidget_2.setGeometry(QtCore.QRect(20, 20, 341, 551))
        self.verticalLayoutWidget_2.setObjectName("verticalLayoutWidget_2")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_2)
        self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.groupBox = QtWidgets.QGroupBox(self.verticalLayoutWidget_2)
        self.groupBox.setObjectName("groupBox")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.groupBox)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.data_treeWidget = QtWidgets.QTreeWidget(self.groupBox)
        self.data_treeWidget.setObjectName("data_treeWidget")
        self.data_treeWidget.headerItem().setText(0, "1")
        self.verticalLayout_3.addWidget(self.data_treeWidget)
        self.verticalLayout_2.addWidget(self.groupBox)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.pushButton_2 = QtWidgets.QPushButton(self.verticalLayoutWidget_2)
        self.pushButton_2.setObjectName("pushButton_2")
        self.horizontalLayout.addWidget(self.pushButton_2)
        self.pushButton_3 = QtWidgets.QPushButton(self.verticalLayoutWidget_2)
        self.pushButton_3.setObjectName("pushButton_3")
        self.horizontalLayout.addWidget(self.pushButton_3)
        self.verticalLayout_2.addLayout(self.horizontalLayout)
        self.verticalLayoutWidget.raise_()
        self.verticalLayoutWidget_2.raise_()
        self.groupBox.raise_()
        self.groupBox.raise_()
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 980, 25))
        self.menubar.setObjectName("menubar")
        self.menuFile = QtWidgets.QMenu(self.menubar)
        self.menuFile.setObjectName("menuFile")
        self.menuSettings = QtWidgets.QMenu(self.menubar)
        self.menuSettings.setObjectName("menuSettings")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.actionOpen_Data_File = QtWidgets.QAction(MainWindow)
        self.actionOpen_Data_File.setObjectName("actionOpen_Data_File")
        self.actionSet_default_directory = QtWidgets.QAction(MainWindow)
        self.actionSet_default_directory.setObjectName("actionSet_default_directory")
        self.actionAdd_plotting_module = QtWidgets.QAction(MainWindow)
        self.actionAdd_plotting_module.setObjectName("actionAdd_plotting_module")
        self.actionReset_User_Settings = QtWidgets.QAction(MainWindow)
        self.actionReset_User_Settings.setObjectName("actionReset_User_Settings")
        self.actionAdd_loading_module = QtWidgets.QAction(MainWindow)
        self.actionAdd_loading_module.setObjectName("actionAdd_loading_module")
        self.menuSettings.addAction(self.actionSet_default_directory)
        self.menuSettings.addAction(self.actionAdd_plotting_module)
        self.menuSettings.addAction(self.actionAdd_loading_module)
        self.menuSettings.addAction(self.actionReset_User_Settings)
        self.menubar.addAction(self.menuFile.menuAction())
        self.menubar.addAction(self.menuSettings.menuAction())

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.groupBox_2.setTitle(_translate("MainWindow", "Plot Functions"))
        self.btn_run_plotfcn.setText(_translate("MainWindow", "Run"))
        self.groupBox.setTitle(_translate("MainWindow", "Data"))
        self.pushButton_2.setText(_translate("MainWindow", "Plot 1"))
        self.pushButton_3.setText(_translate("MainWindow", "Plot2"))
        self.menuFile.setTitle(_translate("MainWindow", "File"))
        self.menuSettings.setTitle(_translate("MainWindow", "Settings"))
        self.actionOpen_Data_File.setText(_translate("MainWindow", "Open Data File"))
        self.actionSet_default_directory.setText(_translate("MainWindow", "Set default directory"))
        self.actionAdd_plotting_module.setText(_translate("MainWindow", "Add plotting module"))
        self.actionReset_User_Settings.setText(_translate("MainWindow", "Reset User Settings"))
        self.actionAdd_loading_module.setText(_translate("MainWindow", "Add loading module"))


text:
package gov.niarl.his.xsd;

/**
 * This class serves as a central location for the context string used to
 * marshal and un-marshal.
 * @author syelama
 * @version Crossbow
 *
 */
public class JAXBContextPCR_DifferenceString {
	/**
	 * This string is a delimited list of classes used by the marshaler
	 * and un-marshaler.
	 */
	public static String contextString = getContextString();

	private static String getContextString() {
		StringBuffer stringBuffer = new StringBuffer();
		stringBuffer.append("gov.niarl.his.xsd.pcr_difference");
//		stringBuffer.append(":gov.niarl.his.xsd.integrity_Report_v1_0.org.trustedcomputinggroup.xml.schema.core_Integrity_v1_0_1");
		return stringBuffer.toString();
	}
}


text:
namespace XenAdmin.Dialogs
{
    partial class PvsCacheConfigurationDialog
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PvsCacheConfigurationDialog));
            this.BlurbLabel = new System.Windows.Forms.Label();
            this.AddButton = new System.Windows.Forms.Button();
            this.addSiteButton = new System.Windows.Forms.Button();
            this.ContentPanel.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
            this.splitContainer.Panel1.SuspendLayout();
            this.splitContainer.Panel2.SuspendLayout();
            this.splitContainer.SuspendLayout();
            this.blueBorder.SuspendLayout();
            this.SuspendLayout();
            //
            // ContentPanel
            //
            resources.ApplyResources(this.ContentPanel, "ContentPanel");
            this.ContentPanel.Controls.Add(this.addSiteButton);
            //
            // verticalTabs
            //
            this.verticalTabs.BorderStyle = System.Windows.Forms.BorderStyle.None;
            resources.ApplyResources(this.verticalTabs, "verticalTabs");
            this.verticalTabs.MouseClick += new System.Windows.Forms.MouseEventHandler(this.verticalTabs_MouseClick);
            this.verticalTabs.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.verticalTabs_DrawItem);
            this.verticalTabs.MouseMove += new System.Windows.Forms.MouseEventHandler(this.verticalTabs_MouseMove);
            //
            // cancelButton
            //
            this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            resources.ApplyResources(this.cancelButton, "cancelButton");
            //
            // okButton
            //
            resources.ApplyResources(this.okButton, "okButton");
            this.okButton.Click += new System.EventHandler(this.okButton_Click);
            //
            // splitContainer
            //
            this.splitContainer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            resources.ApplyResources(this.splitContainer, "splitContainer");
            //
            // splitContainer.Panel1
            //
            this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Window;
            this.splitContainer.Panel1.Controls.Add(this.AddButton);
            this.splitContainer.Panel1.Resize += new System.EventHandler(this.splitContainer_Panel1_Resize);
            //
            // blueBorder
            //
            this.blueBorder.BorderStyle = System.Windows.Forms.BorderStyle.None;
            resources.ApplyResources(this.blueBorder, "blueBorder");
            //
            // BlurbLabel
            //
            resources.ApplyResources(this.BlurbLabel, "BlurbLabel");
            this.BlurbLabel.Name = "BlurbLabel";
            this.BlurbLabel.UseMnemonic = false;
            //
            // AddButton
            //
            resources.ApplyResources(this.AddButton, "AddButton");
            this.AddButton.BackColor = System.Drawing.SystemColors.Window;
            this.AddButton.Cursor = System.Windows.Forms.Cursors.Hand;
            this.AddButton.FlatAppearance.BorderSize = 0;
            this.AddButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent;
            this.AddButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent;
            this.AddButton.Image = global::XenAdmin.Properties.Resources._000_AddSite_h32bit_16;
            this.AddButton.Name = "AddButton";
            this.AddButton.UseVisualStyleBackColor = false;
            this.AddButton.Click += new System.EventHandler(this.AddButton_Click);
            //
            // addSiteButton
            //
            resources.ApplyResources(this.addSiteButton, "addSiteButton");
            this.addSiteButton.BackColor = System.Drawing.Color.Transparent;
            this.addSiteButton.Cursor = System.Windows.Forms.Cursors.Hand;
            this.addSiteButton.FlatAppearance.BorderSize = 0;
            this.addSiteButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent;
            this.addSiteButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent;
            this.addSiteButton.Image = global::XenAdmin.Properties.Resources._000_AddSite_h32bit_16;
            this.addSiteButton.Name = "addSiteButton";
            this.addSiteButton.UseVisualStyleBackColor = false;
            this.addSiteButton.Click += new System.EventHandler(this.AddButton_Click);
            //
            // PvsCacheConfigurationDialog
            //
            resources.ApplyResources(this, "$this");
            this.Controls.Add(this.BlurbLabel);
            this.Name = "PvsCacheConfigurationDialog";
            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.PvsCacheConfigurationDialog_FormClosed);
            this.Controls.SetChildIndex(this.okButton, 0);
            this.Controls.SetChildIndex(this.cancelButton, 0);
            this.Controls.SetChildIndex(this.splitContainer, 0);
            this.Controls.SetChildIndex(this.BlurbLabel, 0);
            this.ContentPanel.ResumeLayout(false);
            this.ContentPanel.PerformLayout();
            this.splitContainer.Panel1.ResumeLayout(false);
            this.splitContainer.Panel1.PerformLayout();
            this.splitContainer.Panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
            this.splitContainer.ResumeLayout(false);
            this.blueBorder.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Label BlurbLabel;
        private System.Windows.Forms.Button AddButton;
        private System.Windows.Forms.Button addSiteButton;
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
AddFilterAction
</TITLE>

<META NAME="keywords" CONTENT="apollo.gui.detailviewers.sequencealigner.actions.AddFilterAction class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

apollo.gui.detailviewers.sequencealigner.actions

Class AddFilterAction

java.lang.Object
  javax.swing.AbstractAction
      apollo.gui.detailviewers.sequencealigner.actions.AddFilterAction

All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public class AddFilterAction
extends javax.swing.AbstractAction

See Also:
Serialized Form

Field Summary

Fields inherited from class javax.swing.AbstractAction

changeSupport, enabled

Fields inherited from interface javax.swing.Action

ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON

Constructor Summary

AddFilterAction(MultiSequenceAlignerPanel msap,
                AddFilterPanel.TYPES t)

Method Summary

 void
actionPerformed(java.awt.event.ActionEvent arg0)

Methods inherited from class javax.swing.AbstractAction

addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled

Methods inherited from class java.lang.Object

equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AddFilterAction

public AddFilterAction(MultiSequenceAlignerPanel msap,
                       AddFilterPanel.TYPES t)

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent arg0)

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
Currently data pertaining to access control is stored in the main database, with an XML namespace of `http://jackjansen.nl/igor/authentication` (usually encoded with the `xmlns:au` prefix).

This data is hidden from normal Igor access (unless query parameter `.VARIANT=raw` is used). In principle this should be safe,
because an external call cannot modify the capabilities and there is no secret information contained in the capability data.
There is however an issue that a call with the right permissions can accidentally delete a capability be replacing a subtree (with `PUT`).

## Capability structure

A capability is stored in an `au:capability` element.

* `comment` textual description, to keep us sane during development.
* `cid` unique ID of this capability.
* `child` one entry for each child (delegated) capability of this capability.
* `parent` parent of this capability.
* `delegate` boolean, if `true` this capability can be delegated. If the value is the string `external` this capability can be the parent of any capability as long as that new capability has an `aud` field.
* `obj` an XPath referencing a single element (or a nonexisting element with a single existing parent element) to which this capability refers. Rights on that object and its descendants are governed by a number of other fields:
	* `get` Together with `obj` defines on which elements this capability grants `GET` rights:
		* empty (or non-existent): none.
		* `self` the element itself only.
		* `descendant-or-self` the whole subtree rooted at the element (the element itself, its children, its grandchildren, etc).
		* `descendant` the whole subtree rooted at the element except the element itself.
		* `child` direct children of the element.
		* More values may be added later.
	* `put` Together with `obj` defines on which elements this capability grants `PUT` rights. Values as for `get`.
	* `post` Together with `obj` defines on which elements this capability grants `POST` rights. Values as for `get`.
	* `delete` Together with `obj` defines on which elements this capability grants `DELETE` rights. Values as for `get`.

The `obj` field will usually be an absolute XPath (starting with `/data`) but there are a number of other values used for non-database accesses (REST and other):

* `/action` is the virtual object tree of actions (the REST `/action` entrypoints)
* `/internal` is the virtual object tree of internal actions (the REST `/internal` entrypoints)
* `/plugin` is the virtual object tree of plugins (the REST `/plugin` entrypoint)
* `/filesystem` is the right to do operations that modify the filesystem. Checking this capability is currently only implemented for installing plugins.

Capabilities that have an external representation may have a few extra fields:

* `iss` Issuer of this capability. Usually the URL of `/issuer` on this igor.
* `aud` Audience of this capability. Required for capabilities that Igor will encode as a JWT (Json Web Token, <https://en.wikipedia.org/wiki/JSON_Web_Token>) in an outgoing `Authentication: Bearer` header.
* `sub` Subject of this capability. Required for capabilities that Igor receives as JWT in an incoming `Authentication: Bearer` header.
* For outgoing capabilities there may be other fields that are meaningful to the _audience_ of the capability.

External capabilities are protected using a symmetric key that is shared between Issuer and Audience (for outgoing capabilities) or Issuer and Subject (for incoming keys). This key is used to sign the JWT.

## Database schema additions

### /internal/accessControl

Not really part of the database, but this is the entry point to manage (list, delegate, revoke) capabilities.

### /data/au:access

Required for further schema requirements.

### /data/au:access/au:defaultCapabilities

Capabilities that will be used for any action, user or request that has no `Authentication: Bearer` header. For users and actions this set of capabilities is also valid if they have their own set. In other words: their own set augments the set of capabilities, it does not replace it.

These capabilities should be here:

- get(descendant-or-self), /data/environment
- get(descendant-or-self), /data/status
- get(descendant-or-self), /data/services/igor
- get(child), /static
- get(child), /internal/accessControl
- get(descendant-or-self)/put(descendant)/post(descendant)/delete(descendant), /data/sandbox

### /data/au:access/au:exportedCapabilities

Stores each `au:capability` for which an external representation has been created. Mainly so that each capability has an "owner".

### /data/au:access/au:revokedCapabilities

Stores all external capabilities that have been revoced. For each such capability there is a `au:revokedCapability` with at least a field `cid` that holds the capability ID. Optionally there is an `nva` field, Not Valid After, copied from the original capability, that indicates when this revoked capability can be cleaned up because the original is no longer valid.

### /data/au:access/au:unusedCapabilities

This is an optional area to store capabilities that  are valid but currently not used, and that have no owner. For Igor development, really.

### /data/au:access/au:sharedKeys

Empty placeholder for the secret shared key data in the _shadow.xml_ database (see below).

### /data/identities

Capabilities carried by all users that are logged in. Contains at least:

- get(descendent-or-self), /data/people

### /data/identities/admin

User that holds the master capabilities, capabilities with fairly unlimited access from which more limited capabilities are descended (through delegation).

There are at least the following capabilities, of which most other capabilities are descended (through delegation and narrowing the scope):

- get(descendant-or-self)+put(descendant)+post(descendant)+delete(descendant), /data
- get(descendant), /action
- get(descendant), /plugin
- get(descendant), /pluginscript
- get(descendant), /internal
- an empty capability (no rights, no object) with `cid=root` and no parent. This is the root of the capability tree.

### /data/identities/_user_

Capabilities this user will carry when logged in. Contains at least:

- get(descendent-or-self)+put(descendent)+post(descendent)+delete(descendent), /data/identities/_user_
- put(descendent)+post(descendent)+delete(descendent), /data/people/_user_

### /data/actions

Capabilities that are carried by all actions. Contains at least:

- get(descendant), /plugin
- get(child), /action

### /data/actions/action

Capabilities this action will carry when executing.

### /data/plugindata/_pluginname_/au:capability

Capabilities this plugin will carry when executing. Also available to the template pages and scripts for this plugin.

## Shadow database

The main igor database `.igor/database.xml` does not contain any secret information, so that access control secrets cannot be leaked accidentally through the REST interface.
Therefore, all secret information is kept in a separate database `.igor/shadow.xml` which has in principle the same structure as the main database, but only contains secret information.

In practice, the shadow database contains only the shared secret keys:

### /data/au:access/au:sharedKeys

Stores symmetric keys shared between Igor and a single external party. These keys are used to sign outgoing capabilities (and check incoming capabilities). Each key is stored in an `au:sharedKey` element with the following fields:

* `iss` Issuer.
* `aud` (optional) Audience.
* `sub` (optional) Subject.
* `externalKey` Symmteric key to use.

Keys are looked up either by the combination of _iss_ and _aud_ (for outgoing keys) or _iss_ and _sub_ (for incoming keys).

## Implementation details

This section lists some of the ideas that came up when designing the capability structure. They may not be true anymore, but the text is kept here because it is not currently stored anywhere else.

### Capability consistency checks

Capabilities need to be checked for consistency, and for adherence to the schema.

The following checks are done as a first order check, and ensure the base infrastructure for the schema is in place:

- `/data/au:access` exists.
- `/data/au:access/au:defaultCapabilities` exists.
- `/data/au:access/au:exportedCapabilities` exists.
- `/data/au:access/au:revokedCapabilities` exists.
- `/data/au:access/au:unusedCapabilities` exists.
- `/data/au:access/au:sharedKeys` exists.
- `/data/identities` exists.
- `/data/identities/admin` exists.
- `/data/identities/admin/au:capability[cid='root']` exists.
- `/data/actions` exists.

As a second check we test that the default set of capabilities (as per the schema above) exist and are in their correct location.

As a third check we enumerate all capabilities and check the following assertions. These ensure that the tree of all capabilities is consistent:

-  Each capability must have a `cid`.
-  This `cid` must be unique.
- Each capability (except `cid=root`) must have an existing `parent`, if not the capability is given `parent=root`.
- Each capability must have its `cid` listed in the parent `child` fields. If not it is added.
- Each `child` of each capability must exist. If not the `child` is removed.

As a fourth check we check that every capability is in an expected location. In other words, the DOM parent of the capability is one of:

- Any of the containers in the first check, or
- `/data/identities/*`
- `/data/plugindata/*`
- `/data/actions/action`

Capabilities that fail this check are moved into `/data/au:access/au:unusedCapabilities`.

### Actions on adding a new user

To be refined, but at least:

- Create `/data/people` entry.
- Create `/data/identities` entry,
	- Fill with capabilities mentioned above
	- Create password

The API will need at least _name_ and _password_. Because of access control policies it is implied that only the _admin_ user can call this API (or any agent that the _admin_ user has granted the corresponding capabilities to).

### Actions on deleting a user

- Move any non-standard capabilities (really: any capability with `aud` not the current Igor) to a safe place (probably the _admin_ user).
- Delete `/data/people` and `/data/identities` entries.

The API will need just the user name, and the same access control rules as for adding users will apply.

### Actions on adding a new device

- Create SSL key with `igorCA` (or `iotsa/extras/make-igor-signed-cert.sh` or via `/plugin/ca`) and copy the key and certificate to the device.
- Create a shared secret key with new device as audience, via `/capabilities.html` or `/internal/accessControl`, and copy the secret key to the device.
- Create an initial "allow all API actions" capability for the device (TBD) and store it in some users' space (current user? admin user?)
	- Igor should automatically pick up the correct secret key and encode the capability with it, when talking to the device.
- If the device is also a _sensor_, i.e. if it can also trigger actions in Igor, all of the _sensor_ actions must also be done.

### Actions on adding a new sensor

- Create a shared secret key with the new sensor as subject, via `/capabilities.html` or `/internal/accessControl`, and copy the secret key to the device.
- Create a capability (with the sensor as subject and audience Igor) for each action the sensor should be able to trigger.
- Export these capabilities (Igor will pick up the correct secret key based on the subject) and copy them to the sensor.

### Generalized API for adding a device or sensor

Data to be supplied to this action:

- Name of the device/sensor.
- Boolean _isSensor_.
- Boolean _isDevice_.
- Hostname or IP address of the sensor (defaults to name with _.local_ appended).
	- if _isDevice_ this will be used as the _audience_ of the first shared key.
	- If _isSensor_ this will be used as the _subject_ of the second shared key.
- if _isDevice_: Partial URL of the API of this device (such as `/api`). Will be the _object_ of the device access capability stored in the users' _identities_ entry.
- if _isSensor_: List of (_name_, _verb_, _object_) this sensor will contact (or empty for non-sensor devices). If non-empty the sensor shared key (audience Igor, subject the sensor) will be used to sign these.

Data returned:

- if _isDevice_:
	- SSL key
	- SSL certificate
	- shared device key
- if _isSensor_:
	- List of (_name_, _verb_, _url_, signed capability).

Data saved in Igor database:

- Shared keys (in the hidden area)
- if _isDevice_: Capability for accessing the device
- Entry in either `/data/devices` or `/data/sensors`.

It needs to be worked out what the access control rights are that are needed for this API. It seems as though no special rights are needed for devices, and for sensors the caller needs to have capabilities (with `delegate=true`) for each of the verb/object combinations.

It also needs to be worked out whether the user (or other agent) that calls this API gets permissions to the `/data/devices` or `/data/sensors` areas.

### Deleting a device or sensor

- The entries in `/data/devices` and `/data/sensors` should be deleted.
- The shared keys should be deleted.
- The SSL certificate should be revoked.

### Other actions on agent changes

To be determined what is needed when adding/removing/changing plugins and actions.

Also to be determined whether anything needs to be done when certificates expire or are revoked.

Also to be determined what to do when secret keys are deleted and re-added.


text:
FROM centos/systemd
MAINTAINER Dan Kirkwood
# Default values for RPM -- override with `docker build --build-arg RPM=...'
ARG RPM=traffic_monitor.rpm
ADD $RPM /

RUN yum install -y initscripts /$(basename $RPM)
RUN rm /$(basename $RPM)

# jq is used by the run.sh script
RUN curl -L jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 > /usr/bin/jq
RUN chmod +x /usr/bin/jq

EXPOSE 80
ADD run.sh /
ENTRYPOINT /run.sh


text:
import traceback

def stacktrace(line_separator = '\n'):
    s = []
    for line in traceback.format_stack():
        s.append(line.strip())
    return line_separator.join(s)


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <HorizontalScrollView
        android:id="@+id/scroll_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scrollbars="none">

        <LinearLayout
            android:id="@+id/linear_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

        </LinearLayout>

    </HorizontalScrollView>

    <ImageView
        android:id="@+id/image1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@mipmap/pay_barcode_guide_shake_icon"/>

    <ImageView
        android:layout_marginTop="10dp"
        android:id="@+id/image2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@mipmap/pay_barcode_guide_shake_icon"/>

</LinearLayout>


text:
package org.diirt.support.ca;

import gov.aps.jca.Channel;
import org.diirt.datasource.DataSourceTypeSupport;
import org.diirt.datasource.ValueCache;

/**
 *
 * Given a set of {@link JCATypeAdapter} prepares type support for the
 * JCA data source.
 *
 * @author carcassi
 */
public class JCATypeSupport extends DataSourceTypeSupport {

    private final JCATypeAdapterSet adapters;

    /**
     * A new type support for the jca type support.
     *
     * @param adapters a set of jca adapters
     */
    public JCATypeSupport(JCATypeAdapterSet adapters) {
        this.adapters = adapters;
    }

    /**
     * Returns a matching type adapter for the given
     * cache and channel.
     *
     * @param cache the cache that will store the data
     * @param channel the jca channel
     * @return the matched type adapter
     */
    protected JCATypeAdapter find(ValueCache<?> cache, JCAConnectionPayload channel) {
        return find(adapters.getAdapters(), cache, channel);
    }

}


text:
/* ====== CSS Reset/Normalize ====== */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
    display: block;
}

audio,
canvas,
video {
    display: inline-block;
}

audio:not([controls]) {
    display: none;
    height: 0;
}

[hidden],
template {
    display: none;
}

html {
    font-family: sans-serif; /* 1 */
    -ms-text-size-adjust: 100%; /* 2 */
    -webkit-text-size-adjust: 100%; /* 2 */
}

body {
    margin: 0;
}

a {
    background: transparent;
}

a:focus {
    outline: thin dotted;
}

a:active,
a:hover {
    outline: 0;
}

h1 {
    font-size: 2em;
    margin: 0.67em 0;
}

abbr[title] {
    border-bottom: 1px dotted;
}

b,
strong {
    font-weight: bold;
}

dfn {
    font-style: italic;
}

hr {
    -moz-box-sizing: content-box;
    box-sizing: content-box;
    height: 0;
}

mark {
    background: #ff0;
    color: #000;
}

code,
kbd,
pre,
samp {
    font-family: monospace, serif;
    font-size: 1em;
}

pre {
    white-space: pre-wrap;
}

q {
    quotes: "\201C" "\201D" "\2018" "\2019";
}

small {
    font-size: 80%;
}

sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sup {
    top: -0.5em;
}

sub {
    bottom: -0.25em;
}

img {
    border: 0;
}

svg:not(:root) {
    overflow: hidden;
}

figure {
    margin: 0;
}

fieldset {
    border: 1px solid #c0c0c0;
    margin: 0 2px;
    padding: 0.35em 0.625em 0.75em;
}

legend {
    border: 0; /* 1 */
    padding: 0; /* 2 */
}

button,
input,
select,
textarea {
    font-family: inherit; /* 1 */
    font-size: 100%; /* 2 */
    margin: 0; /* 3 */
}

button,
input {
    line-height: normal;
}

button,
select {
    text-transform: none;
}

button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
    -webkit-appearance: button; /* 2 */
    cursor: pointer; /* 3 */
}

button[disabled],
html input[disabled] {
    cursor: default;
}

input[type="checkbox"],
input[type="radio"] {
    box-sizing: border-box; /* 1 */
    padding: 0; /* 2 */
}

input[type="search"] {
    -webkit-appearance: textfield; /* 1 */
    -moz-box-sizing: content-box;
    -webkit-box-sizing: content-box; /* 2 */
    box-sizing: content-box;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

button::-moz-focus-inner,
input::-moz-focus-inner {
    border: 0;
    padding: 0;
}

textarea {
    overflow: auto; /* 1 */
    vertical-align: top; /* 2 */
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}
/* ====== END CSS Reset/Normalize ====== */

	   /*
		|=================================|======
	====|Template Styles by: Ronnie Darmis|=========
		|=================================|======
	   */

/* ====== Template Styles ====== */
/* ====== Positioning & Gen ====== */
html, body { height: 100%; width: 100%; } /* Ensures the HTML document renders correctly on screen. */

body { /* Sets the background color of the page, ensures correct spacing, and sets font and font sizing. */
	font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
	background: #DDD;
	margin: 0;
	padding: 0;
	color: #000;
}

ul, ol, dl { /* Corrects spacing of all types of lists */
	padding: 0;
	margin: 0;
}

h1, h2, h3, h4, h5, h6, p { /* Corrects default spacing of headings and paragraphs. */
	margin-top: 0;
	padding-right: 15px;
	padding-left: 15px;
}

a img { /* Cleans up ugly borders on images with links wrapped around them */
	border: none;
}

a:hover, a:active, a:focus { /* Removes ugly borders on links */
	text-decoration: none;
}

.header { /* Wraps the Nav and the banner across the entire page. */
	width: 100%;
}

.content { /* Sets the height and width, as well as the color of the content box, which is where your text and photographs go. */
	min-height: 79%;
	width: 66.5%;
	background: #FFF;
	margin: 0 auto;
	box-shadow: 0 0 1em #888888;
	clear: both;
	padding-top: 10px;

}

.footer { /* Sets the footer up and spans it across the bottom of the page. Also sticks the footer to the bottom of the page even when scrolled. */
	height: 25px;
	width: 100%;
	margin: 0 auto;
	background: #f2f2f2;
	border-top: 1px solid #ccc;
	box-shadow: 0 -2px 2px -2px #888;
	position: fixed;
	bottom: 0;
}

.footer a { /* Sets the color of the "Contact Us" link in the footer. */
	color: #990000;
}

.footer a:hover { /* Sets the color of the "Contact Us" link when hovered over. */
	color: #700000;
	text-decoration: underline;
}

.footer * { /* Algins ALL footer content. */
	text-align: center;
	text-decoration: none;
}

.mobi-nav{ /* Removes icons from the nav. These are added back in when the width of the page is too small for the full nav bar. */
	display: none;
}
/* ====== END Positioning & Gen ====== */

/* ====== Nav Styles ====== */
/* ====== Main Nav ====== */
#nav { /* Nav container, spans the nav across the screen and adds a drop shadow below it. */
	width: 100%;
	float: left;
	background-color: #f2f2f2;
	border-bottom: 1px solid #ccc;
	border-top: 1px solid #ccc;
	box-shadow: 0 2px 2px -2px #888888;
}

#nav ul { /* Actual nav bar. Removes list styling. */
	padding: 0;
	list-style: none;
	position:relative;
	margin:0 auto;
	width: 66.5%;
}

#nav ul li:first-child a { /* Adds border to the first link in the nav. */
	border-left: 1px solid #ccc;
}

#nav ul li { /* Positions each list item horizontally and to the left. */
	float: left;
	position: relative;
}

#nav ul li a { /* Makes the link look pretty! */
	display: block;
	padding: 8px 15px;
	text-decoration: none;
	font-weight: bold;
	color: #990000;
	border-right: 1px solid #ccc;
}

#nav ul li a:hover, #nav ul li.active, #nav ul li.active a { /* Changes color of link when moused over, adds .active, which can be applied to the link of the page you're on. */
	color: #700000;
	background-color: #fff;
}
/* ====== END Main Nav ====== */

/* ====== Sub Nav ====== */
#nav ul ul { /* Positions sub nav. */
	display: none;
	background-color: #F2F2F2;
	position: absolute;
	max-width: 150%;
	width: auto;
	text-align: center;
	margin-left: -1px;
	white-space: nowrap;
}

#nav ul:after { /* More sub nav positioning */
	content: ""; clear: both; display: block;
}

#nav ul li:hover > ul { /* Displays sub nav when parent list item is hovered over */
	display: block;
}

#nav ul ul li { /* Positions sub nav list items */
	float: none;
	position: relative;
	min-width: 100%;
}

#nav ul ul li a { /* Corrects text size issues and adds consistant borders to both sides */
	font-size: 1em;
	border-left: 1px solid #ccc;
	border-top: 1px solid #ccc;
}

#nav ul ul li:last-child a { /* finishes up border correction */
	border-bottom: 1px solid #ccc;
}

#nav ul ul li:hover a { /* Styles sub nav links when hovered over */
	color: #630102;
	background-color: #fff;
	overflow: hidden;
}
/* ====== END Sub Nav ====== */

/* ====== Sticky Nav Classes ====== */
#nav.sticky { /* Sticks nav to top of page when scrolled beyond */
     position: fixed;
     top: 0;
  }
/* ====== END Sticky Nav Classes ====== */

/* ====== Nav Site Name ====== */
#name-wrap { /* Positions Site Name within sticky nav */
	width: 16.75%;
	float: left;
}

.name { /* Nav-Name styles */
	font-size: 1em;
	float: right;
	margin: 0 auto;
	margin-right: 5px;
	padding: 7px 0;
	color: #A5A5A5;
	display: none;
}

.name-show { /* Displays Site-Name when sticky nav is applied */
	display: block !important;
}
/* ====== END Nav Site Name ====== */

/* ====== Back To Top Styles ====== */
.to-top {
	height: 80px;
	width: 70px;
	background-color: rgb(105, 105, 105);
	display: none;
	position: fixed;
	top: 75px;
	right: 40px;
	border-radius: 4px;
	opacity: 0.3;
	cursor: pointer;
}

.to-top a {
	text-decoration: none;
	color: #FFF;
}

.to-top i{
	margin-left: 12px;
	color: #FFF;
}

.to-top p {
	font-size: 10px;
	text-align: center;
	font-weight: bold;
}

.to-top:hover {
	-webkit-box-shadow: 0 3px 8px rgba(0, 0, 0, .25);
	box-shadow: 0 3px 8px rgba(0, 0, 0, .25);
}

.to-top-s {
	display: block !important;
}
/* ====== End Back To Top Styles ====== */

/* ====== Tool Tip Styles ====== */
i.tip {
	background: rgb(59, 59, 59);
	padding: 5px 8px;
	font-size: 0.7em;
	border: 1px solid #282828;
	color: #FFF;
	border-radius: 7px;
	margin-top: 0px;
	position: absolute;
	text-align: center;
	white-space: nowrap;
	display: none;
	margin-left: -8px;
	z-index: 100;
}

a:hover > i.tip {
	display: block;
}
/* ====== End Tool Tip Styles ====== */
/* ====== End Nav Styles ====== */

.content table {
	width: 80%;
	margin: 0 auto;
	text-align: center;
	margin-bottom: 25px;
	border-bottom: 1px solid black;
}

#SCHEDULE  .content table tr:first-child td {
	padding-bottom: 10px;
	font-weight: bold;
	border-bottom: 1px solid black;
}

#SCHEDULE .content table tr td:first-child, .content table tr td:nth-child(3){
	font-weight: bold;
}

/* ====== Responsive Styles ====== */
@media screen /* Fixes Nav breaks and corrects content width when page is > 951px. */
and (max-width: 950px) {
	#nav ul {
		width: 85%;
	}
	.content {
		width: 85%;
	}
	.to-top {
		width: 65px;
		right: 0 !important;
	}
	.to-top i {
		margin-left: 9.5px;
	}
}

@media only screen /* Fixes nav breaks, displays name always, removes banner, removes footer, spans content further across the screen for easier viewing on smaller screen sizes */
and (max-width: 885px) {
    /* ====== Nav Styles ====== */
	#nav ul {
		width: 100%;
	}

	#nav.sticky {
		position: fixed;
		top: 0;
	}
	#name-wrap {
		width: 25%;
	}
	.name {
		display: block;
	}
	.name-show {
		display: block !important;
	}
	/* ====== End Nav Styles ====== */
	.content {
		width: 90%;
		padding-top: 10px;
		min-height: 92%;
	}
	.footer {
		display: none;
	}
	.banner {
		display: none;
	}
	.to-top-s {
		display: none !important;
	}
}

@media all /* Removes last two list items, adds mobi icons to replace them */
and (max-width: 820px)
and (orientation: portrait) {
	#nav ul li:nth-child(4) a {
		display: none;
	}
	#nav ul li:nth-child(5) a {
		display: none;
	}
	.mobi-nav {
		display: block !important;
	}
	.mobi-nav li:first-child a{
		border-left: none !important;
	}

}

@media all /* Fixes Site-Name in nav breaks */
and (max-width: 480px) {
	#name-wrap h5.name  {
		font-size: 75% !important;
		margin-top: 2.8px;
	}
	.mobi-nav a:last-child {
		display: none !important;
	}
}

@media all /* Fixes bug where last two nav links would display in heights > 480 */
and (max-height: 480px) {
	#nav ul li:nth-child(4) a {
		display: none;
	}
	#nav ul li:nth-child(5) a {
		display: none;
	}
}

@media all /* Fixes bug where content created scrollbar when > 735px height */
and (max-height: 735px) {
	.content {
		min-height: 93%;
	}
}
/* ====== END Responsive Styles ====== */

/*---------------------------------|
Template Code above this point.    |
								   |
WARNING: BEFORE EDITING ABOVE CODE |
BE SURE YOU KNOW WHAT YOU'RE DOING |
                                   |
NOTICE: Do not edit above code if  |
you have little CSS experience.    |
----------------------------------*/

/* ====== END Template Styles ====== */

.banner { /* Space for banner image */
	width: 100%;
	background-color: #990000;
	height: 150px;
}

.placeholder {
	background: rgb('255, 255, 255');
	height: 300px;
	width: 175px;
}


text:
goog.provide('lf.proc.DeleteStep');

goog.require('lf.proc.PhysicalQueryPlanNode');
goog.require('lf.proc.Relation');

/**
 * @constructor @struct
 * @extends {lf.proc.PhysicalQueryPlanNode}
 *
 * @param {!lf.schema.Table} table
 */
lf.proc.DeleteStep = function(table) {
  lf.proc.DeleteStep.base(this, 'constructor',
      1,
      lf.proc.PhysicalQueryPlanNode.ExecType.FIRST_CHILD);

  /** @private {!lf.schema.Table} table */
  this.table_ = table;
};
goog.inherits(lf.proc.DeleteStep, lf.proc.PhysicalQueryPlanNode);

/** @override */
lf.proc.DeleteStep.prototype.toString = function() {
  return 'delete(' + this.table_.getName() + ')';
};

/** @override */
lf.proc.DeleteStep.prototype.execInternal = function(relations, journal) {
  var rows = relations[0].entries.map(function(entry) {
    return entry.row;
  });
  journal.remove(this.table_, rows);
  return [lf.proc.Relation.createEmpty()];
};


text:
"""
Tests communication with and data acquisition from a Measurement Computing
USB1608G DAQ.

DAQFlex needs to be installed in addition to pydaqflex, and on Linux, a udev
rule needs to be added (see `tools/60-mcc.rules` in the main repo directory).
Of course, the device should be connected to the computer.

The tests run by this script are very simple and are by no means exhaustive. It
just sets different numbers of channels and ensures the data received is the
correct shape.
"""

try:
    from pygesture import daq
except ImportError:
    sys.path.insert(0, '..')
    from pygesture import daq

# test single-channel first
dev = daq.MccDaq(2048, 1, (0, 0), 1024)
dev.start()
for i in range(4):
    data = dev.read()
    assert data.shape == (1, 1024)
dev.stop()

# test multi-channel
dev.set_channel_range((0, 3))
dev.start()
for i in range(4):
    data = dev.read()
    assert data.shape == (4, 1024)
dev.stop()


text:
<!DOCTYPE html>
<meta charset=utf-8>
<title>Setting the target effect tests</title>
<link rel='help' href='https://w3c.github.io/web-animations/#setting-the-target-effect'>


text:
package com.skysport.interfaces.model.permission.roleinfo.helper;

import com.skysport.core.bean.permission.RoleInfo;
import com.skysport.core.bean.permission.RoleUser;
import com.skysport.core.bean.permission.ZTreeNode;
import com.skysport.core.bean.system.SelectItem2;

import java.util.ArrayList;
import java.util.List;

/**
 * 说明:
 * Created by zhangjh on 2015/10/28.
 */
public enum RoleInfoHelper {
    SINGLETONE;

    public List<ZTreeNode> buildZTreeNodes(List<RoleInfo> roleInfos, List<RoleUser> roleUsers) {

        /**
         * @param roleInfos
         * @param roleUsers
         * @return
         */
        List<ZTreeNode> zTreeNodes = new ArrayList<>();
        for (RoleInfo roleInfo : roleInfos) {
            ZTreeNode zTreeNode = new ZTreeNode();
            zTreeNode.setId(roleInfo.getNatrualkey());
            zTreeNode.setName(roleInfo.getName());
            zTreeNode.setPId(roleInfo.getParentId());
            zTreeNode.setOpen(false);
            zTreeNode.setChecked(false);
            if (null != roleUsers && !roleUsers.isEmpty()) {
                for (RoleUser roleUser : roleUsers) {
                    if (roleUser.getRoleId().equals(roleInfo.getNatrualkey())) {
                        zTreeNode.setChecked(true);
                        break;
                    }
                }
            }
            zTreeNodes.add(zTreeNode);
        }
        return zTreeNodes;
    }

    /**
     * 直接在id位置替换成name就可以,前段页面用id来展示名字
     * 1,将部门id转换成部门名
     * 2,将父角色id转换成角色名
     *
     * @param roleInfos
     */
    public void turnSomeIdToNameInList(List<RoleInfo> roleInfos, List<SelectItem2> deptList) {
        if (null != roleInfos && !roleInfos.isEmpty()) {
            for (RoleInfo roleInfo : roleInfos) {
                //将部门id转换成部门名
                String deptId = roleInfo.getDeptId();
                String deptName = "";
                for (SelectItem2 selectItem2 : deptList) {
                    String deptIdBase = selectItem2.getNatrualkey();
                    if (deptIdBase.equals(deptId)) {
                        deptName = selectItem2.getName();
                        break;
                    }
                }
                deptId = deptName;//替换内容
                roleInfo.setDeptId(deptId);
                turnRoleIdToRoleName(roleInfo, roleInfos);
            }
        }

    }

    /**
     * 将父角色id转换成角色名
     *
     * @param roleInfo
     * @param roleInfos
     */
    private void turnRoleIdToRoleName(RoleInfo roleInfo, List<RoleInfo> roleInfos) {
        String parentId = roleInfo.getParentId();
        if (null != parentId) {
            for (RoleInfo roleInfo2 : roleInfos) {
                String roleid = roleInfo2.getNatrualkey();
                String name = roleInfo2.getName();
                //找到父角色id对应的角色信息
                if (parentId.equals(roleid)) {
                    roleInfo.setParentId(name);
                }
            }
        }

    }

}


text:
package amazons3

import (
	"testing"

	"github.com/containerops/wrench/setting"
)

func Test_amazons3save(t *testing.T) {
	var err error
	var url string

	if err = setting.SetConfig("../../../conf/containerops.conf"); err != nil {
		t.Error(err)
	}

	file := "amazons3_test.go"
	url, err = amazons3save(file)
	if err != nil {
		t.Error(err)
	}
	t.Log(url)
}


text:
/* http://keith-wood.name/timeEntry.html
   Catalan initialisation for the jQuery time entry extension
   Written by Gabriel Guzman (gabriel@josoft.com.ar). */
(function($) {
	$.timeEntry.regional['ca'] = {show24Hours: true, separator: ':',
		ampmPrefix: '', ampmNames: ['AM', 'PM'],
		spinnerTexts: ['Ara', 'Camp anterior', 'Següent camp', 'Augmentar', 'Disminuir']};
	$.timeEntry.setDefaults($.timeEntry.regional['ca']);
})(jQuery);


text:
package com.simplegeo.client.test;

public class TestEnvironment {

       private static final String TESTING_LAYER =  "com.testing.my";

       private static final String ACCESS_KEY = "my-key";
       private static final String SECRET_KEY = "my-secret";

       public static String getKey() throws Exception {
    	   if(ACCESS_KEY.equals("my-key"))
    		   throw new Exception("Please replace ACCESS_KEY with a valid String");

    	   return ACCESS_KEY;
       }

       public static String getSecret() throws Exception {

    	   if(SECRET_KEY.equals("my-secret"))
    		   throw new Exception("Please replace SECRET_KEY with a valid String");

    	   return SECRET_KEY;
       }

       public static String getLayer() throws Exception {

    	   if(TESTING_LAYER.equals("com.testing.my"))
    		   throw new Exception("Please replace TESTING_LAYER with a valid layer");

    	   return TESTING_LAYER;
       }
}


text:
:orphan:

.. Auto-generated by help-rst from "mirtk convert-pointset-to-mat -h" output

convert-pointset-to-mat
=======================

.. program:: convert-pointset-to-mat

Synopsis
--------

::

    convert-pointset-to-mat <input> <mat> [options]

Description
-----------

.. include:: _descriptions/convert-pointset-to-mat.rst

Arguments
---------

.. option:: input

   File name of input dataset.

.. option:: mat

   File name of output MAT file.

Command options
---------------

.. option:: -points [<var>]

   Name of points variable. (default: X)

.. option:: -nopoints

   Exclude points from MAT file.

.. option:: -faces [<var>]

   Name of faces variable. (default: F)

.. option:: -nofaces

   Exclude faces from MAT file.

.. option:: -pointdata <name> [<var>]

   Include named point data. (default: none)

.. option:: -celldata  <name> [<var>]

   Include named cell  data. (default: none)


text:
"""Unit tests for spatial padding utilities"""

import numpy as np
import pytest

from improver.utilities.neighbourhood_tools import (
    boxsum,
    pad_and_roll,
    pad_boxsum,
    rolling_window,
)

@pytest.fixture
def array_size_5():
    return np.arange(25).astype(np.int32).reshape((5, 5))

@pytest.fixture
def array_size_3():
    return np.arange(9).astype(np.int32).reshape((3, 3))

def test_rolling_window_neighbourhood_size_2(array_size_5):
    """Test producing a 2 * 2 neighbourhood."""
    windows = rolling_window(array_size_5, (2, 2))
    expected = np.zeros((4, 4, 2, 2), dtype=np.int32)
    for i in range(4):
        for j in range(4):
            expected[i, j] = array_size_5[i : i + 2, j : j + 2]
    np.testing.assert_array_equal(windows, expected)

def test_rolling_window_exception_too_many_dims(array_size_5):
    """Test an exception is raised if shape has too many dimensions."""
    msg = (
        "Number of dimensions of the input array must be greater than or "
        "equal to the length of the neighbourhood shape used for "
        "constructing rolling window neighbourhoods."
    )
    with pytest.raises(ValueError) as exc_info:
        rolling_window(array_size_5, (2, 2, 2))
    assert msg in str(exc_info.value)

def test_rolling_window_exception_dims_too_large(array_size_5):
    """Test an exception is raised if dimensions of shape are larger than
    corresponding dimensions of input array."""
    msg = (
        "The calculated shape of the output array view contains a "
        "dimension that is negative or zero. Each dimension of the "
        "neighbourhood shape must be less than or equal to the "
        "corresponding dimension of the input array."
    )
    with pytest.raises(RuntimeError) as exc_info:
        rolling_window(array_size_5, (2, 6))
    assert msg in str(exc_info.value)

def test_rolling_window_writable(array_size_5):
    """Test that result is writable if and only if `writable` is True."""
    windows = rolling_window(array_size_5, (2, 2))
    msg = "assignment destination is read-only"
    with pytest.raises(ValueError) as exc_info:
        windows[0, 0, 0, 0] = -1
    assert msg in str(exc_info.value)
    windows = rolling_window(array_size_5, (2, 2), writeable=True)
    windows[0, 0, 0, 0] = -1
    assert windows[0, 0, 0, 0] == -1

def test_padding_neighbourhood_size_2(array_size_5):
    """Test that result is same as result of rolling_window with a border of zeros."""
    padded = pad_and_roll(array_size_5, (2, 2), mode="constant")
    window = rolling_window(array_size_5, (2, 2))
    inner_part = padded[1:-1, 1:-1, ::]
    np.testing.assert_array_equal(inner_part, window)
    border_index = (
        [[0, i, 0, j] for i in range(5) for j in [0, 1]]
        + [[5, i, 1, j] for i in range(5) for j in [0, 1]]
        + [[i, 0, j, 0] for i in range(5) for j in [0, 1]]
        + [[i, 5, j, 1] for i in range(5) for j in [0, 1]]
    )
    outer_part = padded[list(zip(*border_index))]
    np.testing.assert_array_equal(outer_part, np.zeros(40, dtype=np.int32))

def test_padding_non_zero(array_size_5):
    """Test padding with a number other than the default of 0."""
    padded = pad_and_roll(array_size_5, (2, 2), mode="constant", constant_values=1)
    border_index = (
        [[0, i, 0, j] for i in range(5) for j in [0, 1]]
        + [[5, i, 1, j] for i in range(5) for j in [0, 1]]
        + [[i, 0, j, 0] for i in range(5) for j in [0, 1]]
        + [[i, 5, j, 1] for i in range(5) for j in [0, 1]]
    )
    outer_part = padded[list(zip(*border_index))]
    np.testing.assert_array_equal(outer_part, np.ones(40, dtype=np.int32))

def test_pad_boxsum(array_size_3):
    """Test that padded array consists of input array surrounded by border of zeros."""
    padded = pad_boxsum(array_size_3, 3, mode="constant")
    expected = np.zeros((6, 6), dtype=np.int32)
    expected[2:5, 2:5] = array_size_3
    np.testing.assert_array_equal(padded, expected)

def test_pad_boxsum_non_zero(array_size_3):
    """Test padding with a number other than the default of 0."""
    padded = pad_boxsum(array_size_3, 3, mode="constant", constant_values=2)
    expected = 2 * np.ones((6, 6), dtype=np.int32)
    expected[2:5, 2:5] = array_size_3
    np.testing.assert_array_equal(padded, expected)

def test_boxsum_with_automatic_cumsum(array_size_5):
    """Test that boxsum correctly calculates neighbourhood sums using raw array."""
    result = boxsum(array_size_5, 3)
    expected = np.array(
        [
            [np.sum(array_size_5[i - 1 : i + 2, j - 1 : j + 2]) for j in [2, 3]]
            for i in [2, 3]
        ]
    )
    np.testing.assert_array_equal(result, expected)

def test_boxsum_non_square(array_size_5):
    """Test that boxsum correctly calculates neighbourhood sums using
    non-square box."""
    result = boxsum(array_size_5, (1, 3))
    expected = np.array(
        [[np.sum(array_size_5[i, j - 1 : j + 2]) for j in [2, 3]] for i in range(1, 5)]
    )
    np.testing.assert_array_equal(result, expected)

def test_boxsum_with_precalculated_cumsum(array_size_5):
    """Test that boxsum correctly calculates neighbourhood sums using
    pre-calculated cumsum."""
    cumsum_arr = np.array(
        [[np.sum(array_size_5[: i + 1, : j + 1]) for j in range(5)] for i in range(5)]
    )
    result = boxsum(cumsum_arr, 3, cumsum=False)
    expected = np.array(
        [
            [np.sum(array_size_5[i - 1 : i + 2, j - 1 : j + 2]) for j in [2, 3]]
            for i in [2, 3]
        ]
    )
    np.testing.assert_array_equal(result, expected)

def test_boxsum_with_padding(array_size_5):
    """Test that boxsum correctly calculates neighbourhood sums when adding padding to array."""
    result = boxsum(array_size_5, 3, mode="constant", constant_values=0)
    expected = np.array(
        [
            [
                np.sum(array_size_5[max(0, i - 1) : i + 2, max(0, j - 1) : j + 2])
                for j in range(5)
            ]
            for i in range(5)
        ]
    )
    np.testing.assert_array_equal(result, expected)

def test_boxsum_exception_non_integer(array_size_5):
    """Test that an exception is raised if `boxsize` is not an integer."""
    msg = "The size of the neighbourhood must be of an integer type."
    with pytest.raises(ValueError) as exc_info:
        boxsum(array_size_5, 1.5)
    assert msg in str(exc_info.value)

def test_boxsum_exception_not_odd(array_size_5):
    """Test that an exception is raised if `boxsize` contains a number that is not odd."""
    msg = "The size of the neighbourhood must be an odd number."
    with pytest.raises(ValueError) as exc_info:
        boxsum(array_size_5, (1, 2))
    assert msg in str(exc_info.value)


text:
package org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb;

import org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.UnRegisterNodeManagerResponseProto;
import org.apache.hadoop.yarn.server.api.protocolrecords.UnRegisterNodeManagerResponse;

/**
 * PBImpl class for UnRegisterNodeManagerResponse.
 */
public class UnRegisterNodeManagerResponsePBImpl extends
    UnRegisterNodeManagerResponse {
  private UnRegisterNodeManagerResponseProto proto =
      UnRegisterNodeManagerResponseProto.getDefaultInstance();
  private UnRegisterNodeManagerResponseProto.Builder builder = null;
  private boolean viaProto = false;

  private boolean rebuild = false;

  public UnRegisterNodeManagerResponsePBImpl() {
    builder = UnRegisterNodeManagerResponseProto.newBuilder();
  }

  public UnRegisterNodeManagerResponsePBImpl(
      UnRegisterNodeManagerResponseProto proto) {
    this.proto = proto;
    viaProto = true;
  }

  public UnRegisterNodeManagerResponseProto getProto() {
    if (rebuild) {
      mergeLocalToProto();
    }
    proto = viaProto ? proto : builder.build();
    viaProto = true;
    return proto;
  }

  private void mergeLocalToProto() {
    if (viaProto) {
      maybeInitBuilder();
    }
    proto = builder.build();
    rebuild = false;
    viaProto = true;
  }

  private void maybeInitBuilder() {
    if (viaProto || builder == null) {
      builder = UnRegisterNodeManagerResponseProto.newBuilder(proto);
    }
    viaProto = false;
  }
}


text:
package org.apache.slide.store.mem;

import org.apache.slide.common.Uri;
import org.apache.slide.content.NodeRevisionNumber;

/**
 * Class to hold an URI and a version number to be used as key in maps.
 *
 */
class VersionedUriKey {
   private String uri;
   private String version;
   VersionedUriKey(Uri uri, NodeRevisionNumber number)
   {
      this.uri = uri.toString();
      if (number == null) {
          this.version = "null";
      } else {
          this.version = number.toString();
      }
   }
   public boolean equals(Object obj)
   {
      if (obj == this) return true;
      if (obj instanceof VersionedUriKey) {
         VersionedUriKey that = (VersionedUriKey)obj;
         return this.uri.equals(that.uri) && this.version.equals(that.version);
      }
      return false;
   }
   public int hashCode()
   {
      return (uri.hashCode() ^ version.hashCode());
   }
   public String toString()
   {
      return uri + " - " + version;
   }
}


text:
package org.jetbrains.jps.model;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.model.library.JpsLibraryReference;
import org.jetbrains.jps.model.library.JpsLibraryType;
import org.jetbrains.jps.model.library.sdk.JpsSdkType;
import org.jetbrains.jps.model.library.JpsTypedLibrary;
import org.jetbrains.jps.model.library.sdk.JpsSdk;
import org.jetbrains.jps.model.library.sdk.JpsSdkReference;
import org.jetbrains.jps.model.module.*;
import org.jetbrains.jps.service.JpsServiceManager;

/**
 * @author nik
 */
public abstract class JpsElementFactory {
  public static JpsElementFactory getInstance() {
    return JpsServiceManager.getInstance().getService(JpsElementFactory.class);
  }

  public abstract JpsModel createModel();

  public abstract <P extends JpsElement> JpsModule createModule(@NotNull String name, @NotNull JpsModuleType<P> type, @NotNull P properties);

  public abstract <P extends JpsElement> JpsTypedLibrary<P> createLibrary(@NotNull String name, @NotNull JpsLibraryType<P> type, @NotNull P properties);

  public abstract <P extends JpsElement> JpsTypedLibrary<JpsSdk<P>> createSdk(@NotNull String name, @Nullable String homePath, @Nullable String versionString,
                                                                              @NotNull JpsSdkType<P> type, @NotNull P properties);

  @NotNull
  public abstract <P extends JpsElement> JpsModuleSourceRoot createModuleSourceRoot(@NotNull String url, @NotNull JpsModuleSourceRootType<P> type, @NotNull P properties);

  @NotNull
  public abstract JpsModuleReference createModuleReference(@NotNull String moduleName);

  @NotNull
  public abstract JpsLibraryReference createLibraryReference(@NotNull String libraryName,
                                                             @NotNull JpsElementReference<? extends JpsCompositeElement> parentReference);

  @NotNull
  public abstract <P extends JpsElement> JpsSdkReference<P> createSdkReference(@NotNull String sdkName,
                                                                                @NotNull JpsSdkType<P> sdkType);

  @NotNull
  public abstract JpsElementReference<JpsProject> createProjectReference();

  @NotNull
  public abstract JpsElementReference<JpsGlobal> createGlobalReference();

  @NotNull
  public abstract JpsDummyElement createDummyElement();

  @NotNull
  public abstract <D> JpsSimpleElement<D> createSimpleElement(@NotNull D data);
}


text:
           Dashboard NEW

          UI Elements

           Components

               Buttons

               Social Buttons

               Cards

               Forms

               Modals

               Switches

               Tables

               Tabs

           Icons

               Font Awesome

               Simple Line Icons

           Widgets NEW

           Charts

          Extras

           Pages

               Login

               Register

               Error 404

               Error 500