text:
const format = require('./format');

const NONE = 'NONE';
const PAIR = 'PAIR';
const THREE = 'THREE';
const FOUR = 'FOUR';
const FIVE = 'FIVE';

const hasSameRanks = cards => {
  const ranks = cards.map(({rank}) => rank);
  const uniques = format.uniq(ranks);

  console.log(ranks.length - uniques.length)

  switch (ranks.length - uniques.length) {
    case 1:
      return PAIR;

    case 2:
      return THREE;

    case 3:
      return FOUR;

    case 4:
      return FIVE;

    default:
      return NONE;
  }
};

module.exports = {
  constants: {NONE, PAIR, THREE, FOUR, FIVE},
  fn: {hasSameRanks}
};


text:
package com.sine_x.material_wecenter;

import android.support.annotation.NonNull;
import android.util.Log;

import com.google.gson.Gson;
import com.sine_x.material_wecenter.models.Action;
import com.sine_x.material_wecenter.models.Ajax;
import com.sine_x.material_wecenter.models.AnswerComment;
import com.sine_x.material_wecenter.models.AnswerDetail;
import com.sine_x.material_wecenter.models.Article;
import com.sine_x.material_wecenter.models.Chat;
import com.sine_x.material_wecenter.models.Conversation;
import com.sine_x.material_wecenter.models.Dynamic;
import com.sine_x.material_wecenter.models.ExploreItem;
import com.sine_x.material_wecenter.models.LoginProcess;
import com.sine_x.material_wecenter.models.PublishAnswer;
import com.sine_x.material_wecenter.models.PublishQuestion;
import com.sine_x.material_wecenter.models.QuestionDetail;
import com.sine_x.material_wecenter.models.Response;
import com.sine_x.material_wecenter.models.Responses;
import com.sine_x.material_wecenter.models.SearchResult;
import com.sine_x.material_wecenter.models.Topic;
import com.sine_x.material_wecenter.models.UserInfo;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.net.ssl.HttpsURLConnection;

public class Client {

    public static int PUBLISH = 101;
    public static int ANSWER = 201;
    private static Client client;
    private String cooike;

    /**
     * 获得一个实例
     *
     * @return Client对象
     */
    public static Client getInstance() {
        if (client == null)
            client = new Client();
        return client;
    }

    public @NonNull
    <T> Response<T> parseResponse(String json, Class<T> type) {
        Response<T> response = new Response<>();
        try {
            JSONObject jsonObject = new JSONObject(json);
            response.setErrno(jsonObject.getInt("errno"));
            response.setErr(jsonObject.getString("err"));
            if (response.getErrno() == 1 && !jsonObject.isNull("rsm")) {
                Gson gson = new Gson();
                response.setRsm(gson.fromJson(jsonObject.getJSONObject("rsm").toString(), type));
            } else {
                response.setRsm(null);
            }
        } catch (Exception e) {
            e.printStackTrace();
            response.setErr("未知错误");
            response.setErrno(-1);
        }
        return response;
    }

    private <T> Responses<T> parseResponses(String json, @NonNull Class<T> classType) {
        Responses<T> responses = new Responses<>();
        try {
            JSONObject jsonObject = new JSONObject(json);
            responses.setErrno(jsonObject.getInt("errno"));
            responses.setErr(jsonObject.getString("err"));
            if (responses.getErrno() == 1) {
                ArrayList<T> list = new ArrayList<>();
                JSONObject rsm = jsonObject.getJSONObject("rsm");
                JSONArray array = rsm.getJSONArray("rows");
                int total_rows = rsm.getInt("total_rows");
                Gson gson = new Gson();
                for (int i = 0; i < total_rows; i++) {
                    JSONObject item = array.getJSONObject(i);
                    list.add(gson.fromJson(item.toString(), classType));
                }
                responses.setRsm(list);
            } else {
                responses.setRsm(null);
            }
        } catch (JSONException e) {
            responses.setRsm(null);
            responses.setErrno(-1);
            responses.setErr("未知错误");
        }
        return responses;
    }

    public String getSign(String apis) {
        if (Config.KEEP_SECRET) {
            String text = apis + Config.APP_SECRET;
            try {
                MessageDigest md = MessageDigest.getInstance("MD5");
                String cipher = byteArrayToHex(md.digest(text.getBytes()));
                Log.d("sign", cipher);
                return cipher;
            } catch (NoSuchAlgorithmException e) {
                return "";
            }
        } else {
            return "";
        }
    }

    public static String byteArrayToHex(byte[] byteArray) {
        // 首先初始化一个字符数组,用来存放每个16进制字符
        char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
        // new一个字符数组,这个就是用来组成结果字符串的(解释一下:一个byte是八位二进制,也就是2位十六进制字符(2的8次方等于16的2次方))
        char[] resultCharArray = new char[byteArray.length * 2];
        // 遍历字节数组,通过位运算(位运算效率高),转换成字符放到字符数组中去
        int index = 0;
        for (byte b : byteArray) {
            resultCharArray[index++] = hexDigits[b >>> 4 & 0xf];
            resultCharArray[index++] = hexDigits[b & 0xf];
        }
        // 字符数组组合成字符串返回
        return new String(resultCharArray);
    }

    /**
     * loginProcess 用户登录
     *
     * @param user_name 用户名
     * @param password  用户密码
     * @return 包含LoginProcess的Result对象
     */
    public @NonNull
    Response<LoginProcess> loginProcess(@NonNull String user_name, @NonNull String password) {
        Map<String, String> params = new HashMap<>();
        params.put("user_name", user_name);
        params.put("password", password);
        String json = apiPost(Config.API_CAT_ACCOUNT, Config.API_LOGIN_PROCESS, params);
        return parseResponse(json, LoginProcess.class);
    }

    public @NonNull
    Response<LoginProcess> registerProcess(@NonNull String userName, @NonNull String password, @NonNull String email, @NonNull String iCode) {
        Map<String, String> params = new HashMap<>();
        params.put("user_name", userName);
        params.put("password", password);
        params.put("email", email);
        params.put("icode", iCode);
        String json = apiPost(Config.API_CAT_ACCOUNT, Config.API_REGISTER_PROCESS, params);
        return parseResponse(json, LoginProcess.class);
    }

    /**
     * getUserInfo 获取用户信息
     *
     * @param uid 用户ID
     * @return 包含UserInfo的Result对象
     */
    public Response<UserInfo> getUserInfo(long uid) {
        Map<String, String> params = new HashMap<>();
        params.put("uid", String.valueOf(uid));
        String json = apiGet(Config.API_CAT_ACCOUNT, Config.API_GET_USERINFO, params);
        return parseResponse(json, UserInfo.class);
    }

    /**
     * getUserActions获取用户回答或提问记录
     *
     * @param uid     用户ID
     * @param actions 101-获取用户提问列表 201-获取用户回答列表
     * @return 包含Action对象数组的Result对象
     */
    public Responses<Action> getUserActions(long uid, int actions, int page) {
        Map<String, String> params = new HashMap<>();
        params.put("uid", String.valueOf(uid));
        params.put("actions", String.valueOf(actions));
        params.put("page", String.valueOf(page));
        String json = apiGet(Config.API_CAT_PEOPLE, Config.API_USER_ACTIONS, params);
        return parseResponses(json, Action.class);
    }

    /**
     * explore 发现页面
     *
     * @param page 页数
     * @return Result对象
     */
    public Responses<ExploreItem> explore(int page) {
        Map<String, String> params = new HashMap<>();
        params.put("page", String.valueOf(page));
        params.put("per_page", String.valueOf(Config.ITEM_PER_PAGE));
        String json = apiGet(Config.API_CAT_EXPLORE, params);
        return parseResponses(json, ExploreItem.class);
    }

    /**
     * getQuestion 获取问题详情
     *
     * @param id 问题的编号
     * @return Result对象
     */
    public Response<QuestionDetail> getQuestion(int id) {
        Map<String, String> params = new HashMap<>();
        params.put("id", String.valueOf(id));
        String json = apiGet(Config.API_CAT_QUESTION, "", params);
        return parseResponse(json, QuestionDetail.class);
    }

    public Response<Article> getArticle(int id) {
        Map<String, String> params = new HashMap<>();
        params.put("id", String.valueOf(id));
        String json = apiGet(Config.API_CAT_ARTICLE, params);
        return parseResponse(json, Article.class);
    }

    public Response<Object> saveComment(int article_id, String message) {
        Map<String, String> params = new HashMap<>();
        params.put("article_id", String.valueOf(article_id));
        params.put("message", message);
        String json = apiPost(Config.API_CAT_ARTICLE, Config.API_SAVE_COMMENT, params);
        return parseResponse(json, Object.class);
    }

    /**
     * getAnswer 获取答案详情
     *
     * @param answer_id 答案的编号
     * @return Result对象
     */
    public Response<AnswerDetail> getAnswer(int answer_id) {
        Map<String, String> params = new HashMap<>();
        params.put("answer_id", String.valueOf(answer_id));
        String json = apiGet(Config.API_CAT_QUESTION, Config.API_ANSWER, params);
        return parseResponse(json, AnswerDetail.class);
    }

    /**
     * getAnswer 获取答案评论列表
     *
     * @param answer_id 答案的编号
     * @return Result对象
     */
    public Responses<AnswerComment> getAnswerComments(int answer_id) {
        // 请求
        Map<String, String> params = new HashMap<>();
        params.put("answer_id", String.valueOf(answer_id));
        String json = apiGet(Config.API_CAT_QUESTION, Config.API_ANSWER_COMMENTS, params);
        // 解析
        Responses<AnswerComment> responses = new Responses<>();
        try {
            JSONObject jsonObject = new JSONObject(json);
            responses.setErrno(jsonObject.getInt("errno"));
            responses.setErr(jsonObject.getString("err"));
            if (responses.getErrno() == 1) {
                ArrayList<AnswerComment> list = new ArrayList<>();
                JSONArray array = jsonObject.getJSONArray("rsm");
                Gson gson = new Gson();
                for (int i = 0; i < array.length(); i++) {
                    JSONObject item = array.getJSONObject(i);
                    list.add(gson.fromJson(item.toString(), AnswerComment.class));
                }
                responses.setRsm(list);
            } else {
                responses.setRsm(null);
            }
        } catch (JSONException e) {
            responses.setRsm(null);
            responses.setErrno(-1);
            responses.setErr("未知错误");
        }
        return responses;
    }

    /**
     * getDynamic 首页动态(home)页面
     *
     * @return Result对象
     */
    public Responses<Dynamic> getDynamic(int page) {
        Map<String, String> params = new HashMap<>();
        params.put("page", String.valueOf(page));
        String json = apiGet(Config.API_CAT_HOME, "", params);
        return parseResponses(json, Dynamic.class);
    }

    /**
     * publishQuestion 发起问题
     *
     * @param content 问题的标题
     * @param detail  问题的内容
     * @param topics  问题的话题
     * @return 包含PublishQuestion对象的Result对象
     */
    public Response<PublishQuestion> publishQuestion(String content, String detail, ArrayList<String> topics) {
        Map<String, String> params = new HashMap<>();
        params.put("question_content", content);
        params.put("question_detail", detail);
        // 生成话题列表
        StringBuilder topic = new StringBuilder();
        if (!topics.isEmpty()) {
            topic.append(topics.get(0));
            for (int i = 1; i < topics.size(); i++)
                topic.append(',').append(topics.get(i));
        }
        params.put("topics", topic.toString());
        String json = apiPost(Config.API_CAT_PUBLISH, Config.API_PUBLISH_QUESTION, params);
        return parseResponse(json, PublishQuestion.class);
    }

    /**
     * publishAnswer 添加问题答案
     *
     * @param questionID 问题编号
     * @param content    答案的内容
     * @return 包含PublishAnswer对象的Result对象
     */

    public Response<PublishAnswer> publishAnswer(int questionID, String content) {
        Map<String, String> params = new HashMap<>();
        params.put("question_id", questionID + "");
        params.put("answer_content", content);
        String json = apiPost(Config.API_CAT_PUBLISH, Config.API_PUBLISH_ANSWER, params);
        return parseResponse(json, PublishAnswer.class);
    }

    public Response<Ajax> follow(int uid) {
        Map<String, String> params = new HashMap<>();
        params.put("uid", String.valueOf(uid));
        String json = ajax(Config.AJAX_FOLLOW_PEOPLE, params);
        return parseResponse(json, Ajax.class);
    }

    /**
     * postAction 对问题或答案进行感谢、点赞等动作
     *
     * @param type      动作的类型
     * @param classType 类类型
     * @param strs      动作所需参的数列表
     * @return Result2(如果有错误,返回NULL)
     */

    public <T> Response<T> postAction(Config.ActionType type, @NonNull Class<T> classType, ArrayList<String> strs) {
        Map<String, String> params = new HashMap<>();
        String json;
        if (type == Config.ActionType.QUESTION_FOCUS) {
            params.put("question_id", strs.get(0));
            json = ajax(Config.AJAX_QUESTION_FOCUS, params);
            return parseResponse(json, classType);
        } else if (type == Config.ActionType.QUESTION_THANKS) {
            params.put("question_id", strs.get(0));
            json = ajax(Config.AJAX_QUESTION_THANKS, params);
            return parseResponse(json, classType);
        } else if (type == Config.ActionType.PUBLISH_ANSWER_COMMENT) {
            params.put("answer_id", strs.get(0));
            params.put("message", strs.get(1));
            json = apiPost(Config.API_CAT_QUESTION, Config.API_PUBLISH_ANSWER_COMMENT, params);
            return parseResponse(json, classType);
        } else if (type == Config.ActionType.ANSWER_VOTE) {
            params.put("answer_id", strs.get(0));
            params.put("value", strs.get(1));
            json = ajax(Config.AJAX_ANSWER_VOTE, params);
            return parseResponse(json, classType);
        } else if (type == Config.ActionType.ANSWER_RATE) {
            params.put("type", strs.get(0));
            params.put("answer_id", strs.get(1));
            json = ajax(Config.AJAX_ANSWER_RATE, params);
            return parseResponse(json, classType);
        } else if (type == Config.ActionType.ARTICLE_VOTE) {
            params.put("type", strs.get(0));
            params.put("item_id", strs.get(1));
            params.put("rating", strs.get(2));
            json = ajax(Config.AJAX_ARTICLE_VOTE, params);
            return parseResponse(json, classType);
        }
        return null;
    }

    public Response<Ajax> focus(long questionID) {
        Map<String, String> params = new HashMap<>();
        params.put("question_id", String.valueOf(questionID));
        String json = ajax(Config.AJAX_QUESTION_FOCUS, params);
        return parseResponse(json, Ajax.class);
    }

    public Response<Ajax> thanks(long questionID) {
        Map<String, String> params = new HashMap<>();
        params.put("question_id", String.valueOf(questionID));
        String json = ajax(Config.AJAX_QUESTION_THANKS, params);
        return parseResponse(json, Ajax.class);
    }

    public Response<Ajax> articleVote(int id, int rating) {
        Map<String, String> params = new HashMap<>();
        params.put("type", "article");
        params.put("item_id", String.valueOf(id));
        params.put("rating", String.valueOf(rating));
        String json = ajax(Config.AJAX_ARTICLE_VOTE, params);
        return parseResponse(json, Ajax.class);
    }

    public Response<Ajax> articleCommentVote(int id, int rating) {
        Map<String, String> params = new HashMap<>();
        params.put("type", "comment");
        params.put("item_id", String.valueOf(id));
        params.put("rating", String.valueOf(rating));
        String json = ajax(Config.AJAX_ARTICLE_VOTE, params);
        return parseResponse(json, Ajax.class);
    }

    public Response<Ajax> articleSaveComment(int id, String message) {
        Map<String, String> params = new HashMap<>();
        params.put("article_id", String.valueOf(id));
        params.put("message", message);
        String json = apiPost(Config.API_CAT_ARTICLE, Config.API_SAVE_COMMENT, params);
        return parseResponse(json, Ajax.class);
    }

    public Responses<Topic> hotTopics() {
        Map<String, String> params = new HashMap<>();
        String json = apiGet(Config.API_CAT_TOPIC, Config.API_HOT_TOPICS, params);
        return parseResponses(json, Topic.class);
    }

    public Responses<Conversation> inbox() {
        Map<String, String> params = new HashMap<>();
        String json = apiGet(Config.API_CAT_INBOX, params);
        return parseResponses(json, Conversation.class);
    }

    public Responses<Chat> read(int id) {
        Map<String, String> params = new HashMap<>();
        params.put("id", String.valueOf(id));
        String json = apiGet(Config.API_CAT_INBOX, Config.API_READ, params);
        return parseResponses(json, Chat.class);
    }

    public Responses<SearchResult> search(String q) {
        Map<String, String> params = new HashMap<>();
        params.put("q", q);
        String json = apiGet(Config.API_CAT_SEARCH, params);
        return parseResponses(json, SearchResult.class);
    }

    public Response<Object> send(String message, String recipient) {
        Map<String, String> params = new HashMap<>();
        params.put("message", message);
        params.put("recipient", recipient);
        String json = apiPost(Config.API_CAT_INBOX, Config.API_SEND, params);
        return parseResponse(json, Object.class);
    }

    public Responses<ExploreItem> posts(int topicID) {
        Map<String, String> params = new HashMap<>();
        params.put("id", String.valueOf(topicID));
        String json = apiGet(Config.API_CAT_TOPIC, Config.API_POSTS, params);
        return parseResponses(json, ExploreItem.class);
    }

    private String ajax(String url, Map<String, String> params) {
        return doPost(Config.HOST_NAME + url, params);
    }

    private String apiPost(String apiCat, Map<String, String> params) {
        return apiPost(apiCat, "", params);
    }

    private String apiPost(String apiCat, String api, Map<String, String> params) {
        // 组合链接
        String apiUrl = Config.API_ROOT + apiCat + '/' + api + '/';
        if (Config.KEEP_SECRET) {
            apiUrl += "?mobile_sign=" + getSign(apiCat);
        }
        return doPost(apiUrl, params);
    }

    private String doPost(String apiUrl, Map<String, String> params) {
        Log.d("POST REQUEST", apiUrl);
        // 建立请求内容
        StringBuilder builder = new StringBuilder();
        for (Map.Entry<String, String> entry : params.entrySet()) {
            builder.append(entry.getKey())
                    .append("=")
                    .append(URLEncoder.encode(entry.getValue()))
                    .append("&");
        }
        builder.deleteCharAt(builder.length() - 1);
        byte[] data = builder.toString().getBytes();
        // 发出请求
        try {
            URL url = new URL(apiUrl);
            HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
            connection.setConnectTimeout(Config.TIME_OUT);
            connection.setDoInput(true);
            connection.setDoOutput(true);
            connection.setRequestMethod("POST");
            connection.setUseCaches(false);
            // 附上Cookie
            connection.setRequestProperty("Cookie", cooike);
            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            connection.setRequestProperty("Content-Length", String.valueOf(data.length));
            // 发送请求内容
            OutputStream output = connection.getOutputStream();
            output.write(data);
            // 接收返回信息
            int response = connection.getResponseCode();
            if (response == HttpsURLConnection.HTTP_OK) {
                // 保存Cookie
                Map<String, List<String>> header = connection.getHeaderFields();
                List<String> cookies = header.get("Set-Cookie");
                if (cookies.size() == 3)
                    cooike = cookies.get(2);
                // 处理返回的字符串流
                InputStream input = connection.getInputStream();
                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                byte[] buffer = new byte[Config.MAX_LINE_BUFFER];
                int len = 0;
                while ((len = input.read(buffer)) != -1)
                    byteArrayOutputStream.write(buffer, 0, len);
                String str = new String(byteArrayOutputStream.toByteArray());
                Log.d("POST RESPONSE", str);
                return str;
            }
        } catch (IOException e) {
            return null;
        }
        return null;
    }

    private String apiGet(String apiCat, Map<String, String> params) {
        return apiGet(apiCat, "", params);
    }

    private String apiGet(String apiCat, String api, Map<String, String> params) {
        // 组合链接
        StringBuilder builder = new StringBuilder();
        builder.append(Config.API_ROOT);
        builder.append(apiCat);
        builder.append('/');
        builder.append(api);
        builder.append("/?");
        if (Config.KEEP_SECRET) {
            params.put("mobile_sign", getSign(apiCat));
        }
        for (Map.Entry<String, String> entry : params.entrySet()) {
            builder.append(entry.getKey())
                    .append("=")
                    .append(URLEncoder.encode(entry.getValue()))
                    .append("&");
        }
        builder.deleteCharAt(builder.length() - 1);
        return doGet(builder.toString());
    }

    private String doGet(String apiUrl) {
        try {
            // 组合链接
            Log.d("GET REQUEST", apiUrl);
            URL url = new URL(apiUrl);
            HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
            // 附上Cookie
            connection.setRequestProperty("Cookie", cooike);
            InputStreamReader input = new InputStreamReader(connection.getInputStream());
            BufferedReader reader = new BufferedReader(input);
            StringBuilder builder = new StringBuilder();
            String line;
            while ((line = reader.readLine()) != null)
                builder.append(line);
            String str = builder.toString();
            Log.d("GET RESPONSE", str);
            return str;
        } catch (IOException e) {
            return null;
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
package com.opensoc.alerts.interfaces;

import java.util.Map;

import org.json.simple.JSONObject;

public interface AlertsAdapter {

	boolean initialize();

	boolean refresh() throws Exception;

	Map<String, JSONObject> alert(JSONObject raw_message);

	boolean containsAlertId(String alert);
}


text:
\n
void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
static int __init acpi_parse_entries_array(char *id, unsigned long table_size, struct acpi_table_header *table_header, struct acpi_subtable_proc *proc, int proc_num, unsigned int max_entries)
int __init acpi_table_parse_entries_array(char *id, unsigned long table_size, struct acpi_subtable_proc *proc, int proc_num, unsigned int max_entries)
int __init acpi_table_parse_entries(char *id, unsigned long table_size, int entry_id, acpi_tbl_entry_handler handler, unsigned int max_entries)
int __init acpi_table_parse_madt(enum acpi_madt_type id, acpi_tbl_entry_handler handler, unsigned int max_entries)
int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
static void __init check_multiple_madt(void)
static void acpi_table_taint(struct acpi_table_header *table)
static u8 __init acpi_table_checksum(u8 *buffer, u32 length)
void __init acpi_table_upgrade(void)
static acpi_status acpi_table_initrd_override(struct acpi_table_header *existing_table, acpi_physical_address *address, u32 *length)
static void __init acpi_table_initrd_scan(void)
pr_info("Table Upgrade: install [%4.4s-%6.6s-%8.8s]\n", table->signature, table->oem_id, table->oem_table_id)
; acpi_os_unmap_memory(table, ACPI_HEADER_SIZE)
; acpi_install_table(acpi_tables_addr + table_offset, TRUE)
; next_table: table_offset += table_length; table_index++;} } static acpi_status acpi_table_initrd_override(struct acpi_table_header *existing_table, acpi_physical_address *address, u32 *table_length)
static void __init acpi_table_initrd_scan(void)
acpi_status acpi_os_physical_table_override(struct acpi_table_header *existing_table, acpi_physical_address *address, u32 *table_length)
acpi_status acpi_os_table_override(struct acpi_table_header *existing_table, struct acpi_table_header **new_table)
int __init acpi_table_init(void)
static int __init acpi_parse_apic_instance(char *str)
static int __init acpi_force_table_verification_setup(char *s)
static int __init acpi_force_32bit_fadt_addr(char *s)
\n
      5 void
      4 unsigned int max_entries
      4 struct acpi_table_header *existing_table
      4 char *id
      3 unsigned long table_size
      3 acpi_physical_address *address
      2 u32 *table_length
      2 struct acpi_subtable_proc *proc
      2 int proc_num
      2 char *s
      2 acpi_tbl_entry_handler handler
      1 u8 *buffer
      1 u32 *length
      1 u32 length
      1 TRUE
      1 "Table Upgrade: install [%4.4s-%6.6s-%8.8s]\n"
      1 table->signature
      1 table->oem_table_id
      1 table->oem_id
      1 table
      1 struct acpi_table_header *table_header
      1 struct acpi_table_header *table
      1 struct acpi_table_header **new_table
      1 struct acpi_subtable_header *header
      1 int entry_id
      1 enum acpi_madt_type id
      1 char *str
      1 acpi_tbl_table_handler handler
      1 acpi_tables_addr + table_offset
      1 ACPI_HEADER_SIZE


text:
import { tryParseSpreadsheet } from "../charts";

describe("tryParseSpreadsheet", () => {
  it("works for numbers with comma in them", () => {
    const result = tryParseSpreadsheet(
      `Week Index${"\t"}Users
Week 1${"\t"}814
Week 2${"\t"}10,301
Week 3${"\t"}4,264`,
    );
    expect(result).toMatchSnapshot();
  });
});


text:
layout: page
title: Roach Llc. Executive Retreat
date: 2016-05-24
author: Joe Decker
tags: weekly links, java
status: published
summary: Maecenas non ullamcorper odio, egestas consectetur.
banner: images/banner/leisure-05.jpg
booking:
  startDate: 03/22/2017
  endDate: 03/27/2017
  ctyhocn: SZZSWHX
  groupCode: RLER
published: true
---
Fusce diam mi, sagittis et rhoncus semper, pulvinar molestie mi. Nunc tempus leo nibh, in imperdiet ante ornare et. Duis vel sem non justo tristique finibus a sit amet ante. Aenean sit amet varius magna. Vivamus pulvinar nisi quis vehicula rutrum. Aliquam justo dui, hendrerit sed magna quis, accumsan placerat massa. Morbi feugiat neque metus, at malesuada purus efficitur vitae. Donec nec eros sit amet eros sollicitudin scelerisque. Nunc egestas pulvinar massa, vitae molestie sapien varius tincidunt. Duis ultricies convallis fringilla. Curabitur semper lorem tempor, fringilla nisl eget, maximus lacus. Praesent posuere nibh ut neque varius imperdiet. Aenean convallis enim quis rhoncus pretium.
Praesent nec porta odio. Proin in metus non erat commodo tristique vel sed orci. Nulla tempor pretium luctus. Etiam et tortor vehicula, scelerisque lectus a, tempor augue. Pellentesque dignissim, mauris sed mollis posuere, diam dui fermentum massa, et pulvinar felis est quis eros. Vivamus tempus turpis lectus, sed porttitor ex luctus ac. Quisque id quam a turpis consequat lacinia. Nam sit amet tellus et ante aliquam pharetra.

* Fusce nec justo eu diam malesuada rutrum
* Mauris ultricies diam vel eros finibus, eu aliquam ex lobortis
* In quis dui eu tortor porttitor congue fringilla lacinia nunc
* Pellentesque viverra mauris at erat aliquam scelerisque
* Fusce nec eros auctor, aliquet enim non, vulputate ante.

Suspendisse potenti. Suspendisse finibus dolor dapibus, sodales magna eu, molestie arcu. Nulla mollis condimentum libero. Etiam malesuada, erat vitae consequat commodo, dui elit ornare orci, et congue est felis id felis. Integer vel egestas ante, non volutpat sapien. Maecenas aliquet volutpat mi, et scelerisque nisl hendrerit vel. Nunc eget consectetur eros. Suspendisse ut sagittis velit. Cras facilisis mi lectus, sit amet mattis massa faucibus semper. Donec at purus dui. Quisque mollis magna vel velit aliquam condimentum. Sed lobortis sapien ligula, sed consectetur nibh semper et. Praesent fermentum lorem a venenatis rutrum. Interdum et malesuada fames ac ante ipsum primis in faucibus. Sed interdum rhoncus ullamcorper.


text:
#include <aws/appintegrations/model/DeleteDataIntegrationRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::AppIntegrationsService::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

DeleteDataIntegrationRequest::DeleteDataIntegrationRequest() :
    m_dataIntegrationIdentifierHasBeenSet(false)
{
}

Aws::String DeleteDataIntegrationRequest::SerializePayload() const
{
  return {};
}


text:
package net.katsuster.strview.util;

/**
 *

 * int 型で扱える長さを超えるリストの部分列を表します。
 *

 */
public class SubLargeList<T> extends AbstractLargeListBase<T>
        implements LargeList<T>, Cloneable {
    /**
     *

     * 指定された名前を持った部分列を作成します。
     *

     *
     * @param n 名前
     */
    public SubLargeList(String n) {
        this(n, null, 0, 0);
    }

    /**
     *

     * 指定されたリストの
     * from から len の長さの部分列を作成します。
     *

     *
     * @param buf  リスト
     * @param from 部分列の開始点
     * @param len  部分列の長さ
     */
    public SubLargeList(LargeList<T> buf, long from, long len) {
        this(null, buf, from, len);
    }

    /**
     *

     * 指定されたリストの
     * from から len の長さの部分列を作成します。
     *

     *
     * @param n    名前
     * @param buf  リスト
     * @param from 部分列の開始点
     * @param len  部分列の長さ
     */
    public SubLargeList(String n, LargeList<T> buf, long from, long len) {
        super(n, len);

        long bufLen = 0;
        if (buf != null) {
            bufLen = buf.length();
        }

        if (from < 0 || from + len > bufLen) {
            throw new IndexOutOfBoundsException("from:" + from
                    + ", len:" + len + " is too large.");
        }

        getRange().setBuffer(buf);
        getRange().setStart(from);
    }

    /**
     *

     * 指定されたリストの範囲から部分列を作成します。
     *

     *
     * @param r リストの範囲
     */
    public SubLargeList(Range<LargeList<T>> r) {
        this(r.getBuffer(), r.getStart(), r.getLength());
    }

    @Override
    public Object clone()
            throws CloneNotSupportedException {
        SubLargeList<T> obj = (SubLargeList<T>)super.clone();

        return obj;
    }

    @Override
    public String getTypeName() {
        return "SubList";
    }

    @Override
    public T get(long index) {
        Range<? extends LargeList<T>> r = getRange();

        checkIndex(index);

        return r.getBuffer().get(index + r.getStart());
    }

    @Override
    public int get(long index, T[] dest, int offset, int length) {
        Range<? extends LargeList<T>> r = getRange();

        checkRemaining(index, length);

        return r.getBuffer().get(index + r.getStart(), dest, offset, length);
    }

    @Override
    public int get(long index, LargeList<T> dest, int offset, int length) {
        Range<? extends LargeList<T>> r = getRange();

        checkRemaining(index, length);

        return r.getBuffer().get(index + r.getStart(), dest, offset, length);
    }

    @Override
    public void set(long index, T data) {
        Range<? extends LargeList<T>> r = getRange();

        checkIndex(index);

        r.getBuffer().set(index + r.getStart(), data);
    }

    @Override
    public int set(long index, T[] src, int offset, int length) {
        Range<? extends LargeList<T>> r = getRange();

        checkRemaining(index, length);

        return r.getBuffer().set(index + r.getStart(), src, offset, length);
    }

    @Override
    public int set(long index, LargeList<T> src, int offset, int length) {
        Range<? extends LargeList<T>> r = getRange();

        checkRemaining(index, length);

        return r.getBuffer().set(index + r.getStart(), src, offset, length);
    }

    @Override
    public LargeList<T> subLargeList(long from, long len) {
        return new SubLargeList<>(this, from, len);
    }
}


text:
from model import *

class Function(Concept):
    """Give an x value and eval() it."""
    def eval(self, x):
        pass

class RuleFunc(Function):
    """The eval() rule is defined by a Python expression"""
    rule = TR.Callable
    class_template = {K.fill_color: 'Asparagus'}
    def eval(self, x):
        return self.rule(x)

class Transform(Function):
    source = Instance(Function)
    pass

class ShiftX(Transform):
    """A function whose value is the x-shifted value of another."""
    by = Int
    class_template = {K.fill_color: 'Red'}

    def label(self): return "ShiftX\nby: " + str(self.by)

    def eval(self, x):
        return self.source.eval(x + self.by)

class Bump(Transform):
    """A function whose value is the same as another, except for a flat 'bump'."""
    start = Int
    end = Int
    val = Int
    def label(self):
        return "Bump\nstart:%s\nend:%s\nval:%s" % (self.start, self.end, self.val)
    def eval(self, x):
        if x < self.start or x > self.end:
            return self.source.eval(x)
        else:
            return self.val
    class_template = {K.fill_color: 'Blue'}

def square(x):
    return x ** 2

t = RuleFunc(rule=square)

s = ShiftX(source=t, by=3)

u = Bump(source=s, start=0, end=5, val=100)

m = Model(ShiftX, Function, Transform, RuleFunc, Bump)
m.addInstances(s, t, u)

for x in [s,t,u]:
    m.showGraph(x,'eval','x',(-10,10))

m.showMethod(s,'eval')
m.showMethod(u,'eval')
#im.show_function_value(s,'eval',5)
#im.show_function_value(t,'eval',5)
m.display()


text:
"""Covertype Keras WideDeep Classifier.

See additional TFX example pipelines, including the Penguin Pipeline Kubeflow GCP example
that this pipeline is based upon: https://github.com/tensorflow/tfx/blob/master/tfx/examples.

"""

import functools
import absl
import os
from typing import List, Text

import tensorflow as tf
import tensorflow_model_analysis as tfma
import tensorflow_transform as tft
from tensorflow_transform.tf_metadata import schema_utils
import kerastuner
from tensorflow_cloud import CloudTuner

from tfx.components.trainer.executor import TrainerFnArgs
from tfx.components.trainer.fn_args_utils import DataAccessor
from tfx.components.tuner.component import TunerFnResult
from tfx_bsl.tfxio import dataset_options

from models import features
from models.keras.constants import (
  EPOCHS,
  TRAIN_BATCH_SIZE,
  EVAL_BATCH_SIZE,
  LOCAL_LOG_DIR,
)

def _gzip_reader_fn(filenames):
  """Small utility returning a record reader that can read gzip'ed files."""
  return tf.data.TFRecordDataset(filenames, compression_type='GZIP')

def _get_serve_tf_examples_fn(model, tf_transform_output):
  """Returns a function that parses a serialized tf.Example and applies TFT."""

  model.tft_layer = tf_transform_output.transform_features_layer()

  @tf.function
  def serve_tf_examples_fn(serialized_tf_examples):
    """Returns the output to be used in the serving signature."""
    feature_spec = tf_transform_output.raw_feature_spec()
    feature_spec.pop(features.LABEL_KEY)
    parsed_features = tf.io.parse_example(serialized_tf_examples, feature_spec)

    transformed_features = model.tft_layer(parsed_features)

    return model(transformed_features)

  return serve_tf_examples_fn

def _input_fn(file_pattern: List[Text],
              data_accessor: DataAccessor,
              tf_transform_output: tft.TFTransformOutput,
              batch_size: int = 200) -> tf.data.Dataset:
  """Generates features and label for tuning/training.

  Args:
    file_pattern: List of paths or patterns of input tfrecord files.
    data_accessor: DataAccessor for converting input to RecordBatch.
    tf_transform_output: A TFTransformOutput.
    batch_size: representing the number of consecutive elements of returned
      dataset to combine in a single batch.

  Returns:
    A dataset that contains (features, indices) tuple where features is a
      dictionary of Tensors, and indices is a single Tensor of label indices.
  """
  dataset = data_accessor.tf_dataset_factory(
      file_pattern,
      dataset_options.TensorFlowDatasetOptions(
          batch_size=batch_size, label_key=features.transformed_name(features.LABEL_KEY)),
      tf_transform_output.transformed_metadata.schema)

  return dataset

def _get_hyperparameters() -> kerastuner.HyperParameters:
  """Returns hyperparameters for building Keras model.

  This function defines a conditional hyperparameter space and default values
  that are used to build the model.

  Args:
    None.
  Returns:
    A kerastuner HyperParameters object.
  """
  hp = kerastuner.HyperParameters()
  # Defines hyperparameter search space.
  hp.Float('learning_rate', min_value=1e-4, max_value=1e-2, sampling='log', default=1e-3)
  hp.Int('n_layers', 1, 2, default=1)
  # Based on n_layers, search for the optimal number of hidden units in each layer.
  with hp.conditional_scope('n_layers', 1):
        hp.Int('n_units_1', min_value=8, max_value=128, step=8, default=8)
  with hp.conditional_scope('n_layers', 2):
        hp.Int('n_units_1', min_value=8, max_value=128, step=8, default=8)
        hp.Int('n_units_2', min_value=8, max_value=128, step=8, default=8)

  return hp

def _build_keras_model(hparams: kerastuner.HyperParameters,
                       tf_transform_output: tft.TFTransformOutput) -> tf.keras.Model:
  """Creates a Keras WideDeep Classifier model.
  Args:
    hparams: Holds HyperParameters for tuning.
    tf_transform_output: A TFTransformOutput.
  Returns:
    A keras Model.
  """
  # Defines deep feature columns and input layers.
  deep_columns = [
      tf.feature_column.numeric_column(
          key=features.transformed_name(key),
          shape=())
      for key in features.NUMERIC_FEATURE_KEYS
  ]

  input_layers = {
      column.key: tf.keras.layers.Input(name=column.key, shape=(), dtype=tf.float32)
      for column in deep_columns
  }

  # Defines wide feature columns and input layers.
  categorical_columns = [
      tf.feature_column.categorical_column_with_identity(
          key=features.transformed_name(key),
          num_buckets=tf_transform_output.num_buckets_for_transformed_feature(features.transformed_name(key)),
          default_value=0)
      for key in features.CATEGORICAL_FEATURE_KEYS
  ]

  wide_columns = [
      tf.feature_column.indicator_column(categorical_column)
      for categorical_column in categorical_columns
  ]

  input_layers.update({
      column.categorical_column.key: tf.keras.layers.Input(name=column.categorical_column.key, shape=(), dtype=tf.int32)
      for column in wide_columns
  })

  # Build Keras model using hparams.
  deep = tf.keras.layers.DenseFeatures(deep_columns)(input_layers)
  for n in range(int(hparams.get('n_layers'))):
    deep = tf.keras.layers.Dense(units=hparams.get('n_units_' + str(n + 1)))(deep)

  wide = tf.keras.layers.DenseFeatures(wide_columns)(input_layers)

  output = tf.keras.layers.Dense(features.NUM_CLASSES, activation='softmax')(
               tf.keras.layers.concatenate([deep, wide]))

  model = tf.keras.Model(input_layers, output)
  model.compile(
      loss='sparse_categorical_crossentropy',
      optimizer=tf.keras.optimizers.Adam(lr=hparams.get('learning_rate')),
      metrics=[tf.keras.metrics.SparseCategoricalAccuracy()])
  model.summary(print_fn=absl.logging.info)

  return model

# TFX Tuner will call this function.
def tuner_fn(fn_args: TrainerFnArgs) -> TunerFnResult:
  """Build the tuner using CloudTuner (KerasTuner instance).
  Args:
    fn_args: Holds args used to train and tune the model as name/value pairs. See
      https://www.tensorflow.org/tfx/api_docs/python/tfx/components/trainer/fn_args_utils/FnArgs.
  Returns:
    A namedtuple contains the following:
      - tuner: A BaseTuner that will be used for tuning.
      - fit_kwargs: Args to pass to tuner's run_trial function for fitting the
                    model , e.g., the training and validation dataset. Required
                    args depend on the above tuner's implementation.
  """
  transform_graph = tft.TFTransformOutput(fn_args.transform_graph_path)

  # Construct a build_keras_model_fn that just takes hyperparams from get_hyperparameters as input.
  build_keras_model_fn = functools.partial(
      _build_keras_model, tf_transform_output=transform_graph)

  # CloudTuner is a subclass of kerastuner.Tuner which inherits from BaseTuner.
  tuner = CloudTuner(
      build_keras_model_fn,
      project_id=fn_args.custom_config['ai_platform_training_args']['project'],
      region=fn_args.custom_config['ai_platform_training_args']['region'],
      max_trials=50,
      hyperparameters=_get_hyperparameters(),
      objective=kerastuner.Objective('val_sparse_categorical_accuracy', 'max'),
      directory=fn_args.working_dir)

  train_dataset = _input_fn(
      fn_args.train_files,
      fn_args.data_accessor,
      transform_graph,
      batch_size=TRAIN_BATCH_SIZE)

  eval_dataset = _input_fn(
      fn_args.eval_files,
      fn_args.data_accessor,
      transform_graph,
      batch_size=EVAL_BATCH_SIZE)

  return TunerFnResult(
      tuner=tuner,
      fit_kwargs={
          'x': train_dataset,
          'validation_data': eval_dataset,
          'steps_per_epoch': fn_args.train_steps,
          'validation_steps': fn_args.eval_steps
      })

def _copy_tensorboard_logs(local_path: str, gcs_path: str):
    """Copies Tensorboard logs from a local dir to a GCS location.

    After training, batch copy Tensorboard logs locally to a GCS location. This can result
    in faster pipeline runtimes over streaming logs per batch to GCS that can get bottlenecked
    when streaming large volumes.

    Args:
      local_path: local filesystem directory uri.
      gcs_path: cloud filesystem directory uri.
    Returns:
      None.
    """
    pattern = '{}/*/events.out.tfevents.*'.format(local_path)
    local_files = tf.io.gfile.glob(pattern)
    gcs_log_files = [local_file.replace(local_path, gcs_path) for local_file in local_files]
    for local_file, gcs_file in zip(local_files, gcs_log_files):
        tf.io.gfile.copy(local_file, gcs_file)

# TFX Trainer will call this function.
def run_fn(fn_args: TrainerFnArgs):
  """Train the model based on given args.
  Args:
    fn_args: Holds args used to train and tune the model as name/value pairs. See
      https://www.tensorflow.org/tfx/api_docs/python/tfx/components/trainer/fn_args_utils/FnArgs.
  """

  tf_transform_output = tft.TFTransformOutput(fn_args.transform_output)

  train_dataset = _input_fn(
      fn_args.train_files,
      fn_args.data_accessor,
      tf_transform_output,
      TRAIN_BATCH_SIZE)

  eval_dataset = _input_fn(
      fn_args.eval_files,
      fn_args.data_accessor,
      tf_transform_output,
      EVAL_BATCH_SIZE)

  if fn_args.hyperparameters:
    hparams = kerastuner.HyperParameters.from_config(fn_args.hyperparameters)
  else:
    # This is a shown case when hyperparameters is decided and Tuner is removed
    # from the pipeline. User can also inline the hyperparameters directly in
    # _build_keras_model.
    hparams = _get_hyperparameters()
  absl.logging.info('HyperParameters for training: %s' % hparams.get_config())

  # Distribute training over multiple replicas on the same machine.
  mirrored_strategy = tf.distribute.MirroredStrategy()
  with mirrored_strategy.scope():
        model = _build_keras_model(
            hparams=hparams,
            tf_transform_output=tf_transform_output)

  tensorboard_callback = tf.keras.callbacks.TensorBoard(
      log_dir=LOCAL_LOG_DIR, update_freq='batch')

  model.fit(
      train_dataset,
      epochs=EPOCHS,
      steps_per_epoch=fn_args.train_steps,
      validation_data=eval_dataset,
      validation_steps=fn_args.eval_steps,
      verbose=2,
      callbacks=[tensorboard_callback])

  signatures = {
      'serving_default':
          _get_serve_tf_examples_fn(model,
                                    tf_transform_output).get_concrete_function(
                                        tf.TensorSpec(
                                            shape=[None],
                                            dtype=tf.string,
                                            name='examples')),
  }

  model.save(fn_args.serving_model_dir, save_format='tf', signatures=signatures)
  _copy_tensorboard_logs(LOCAL_LOG_DIR, fn_args.serving_model_dir + '/logs')


text:
package org.jboss.wise.core.client.impl.reflection;

import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Future;
import javax.jws.Oneway;
import javax.jws.WebParam;
import net.jcip.annotations.Immutable;
import net.jcip.annotations.ThreadSafe;

import org.apache.log4j.Logger;
import org.jboss.wise.core.client.InvocationResult;
import org.jboss.wise.core.client.WSEndpoint;
import org.jboss.wise.core.client.WSMethod;
import org.jboss.wise.core.exception.InvocationException;
import org.jboss.wise.core.exception.MappingException;
import org.jboss.wise.core.mapper.WiseMapper;

/**
 * Represent a webservice operation invocation
 *
 * @author stefano.maestri@javalinux.it
 * @since 23-Aug-2007
 */
@ThreadSafe
@Immutable
public class WSMethodImpl implements WSMethod {

    private final Method method;

    private final WSEndpoint endpoint;

    private final Map<String, WebParameterImpl> parameters = Collections.synchronizedMap(new HashMap<String, WebParameterImpl>());

    public WSMethodImpl(Method method, WSEndpoint endpoint) throws IllegalArgumentException {
	if (method == null || endpoint == null) {
	    throw new IllegalArgumentException();
	}
	this.method = method;
	this.endpoint = endpoint;
	this.initWebParams();
    }

    /**
     * Invokes this method with the provided arguments
     *
     * @param args @return @throws WiseException If an unknown exception is
     * received
     */
    InvocationResultImpl invoke(Map<String, Object> args) throws InvocationException, IllegalArgumentException {
//	Method methodPointer = null;
	InvocationResultImpl result = null;
	Map<String, Object> emptyHolder = Collections.emptyMap();

	try {
	    EndpointMethodCaller caller = new EndpointMethodCaller(this.getEndpoint(), this.getMethod(), this
		    .getParametersInRightPositionArray(args));
	    Future<Object> invocation = ((WSEndpointImpl) this.getEndpoint()).getService().submit(caller);
	    if (isOneWay()) {
		invocation.get();
		result = new InvocationResultImpl(null, null, null, emptyHolder);
	    } else {
		result = new InvocationResultImpl(RESULT, method.getGenericReturnType(), invocation.get(), getHoldersResult(args));

	    }
	} catch (Exception ite) {
	    Logger.getLogger(WSMethodImpl.class).info("Error invoking method " + this.getMethod() + ", arguments: " + args != null ? args.values().toArray() : null);
//	    if (methodPointer != null && methodPointer.getExceptionTypes() != null) {
//		for (int i = 0; i < methodPointer.getExceptionTypes().length; i++) {
//		    Class<?> excType = methodPointer.getExceptionTypes()[i];
//		    if (ite.getCause().getClass().isAssignableFrom(excType)) {
//			result = new InvocationResultImpl("exception", excType, ite.getCause(), emptyHolder);
//			return result;
//		    }
//		}
//	    }
	    throw new InvocationException("Unknown exception received: " + ite.getMessage(), ite);
	} catch (Throwable e) {
	    throw new InvocationException("Generic Error during method invocation!", e);
	}
	return result;
    }

    @Override
    public void writeRequestPreview(Map<String, Object> args, OutputStream os) throws InvocationException {
	try {
	    EndpointMethodPreview caller = new EndpointMethodPreview(this.getEndpoint(), this.getMethod(), this
		    .getParametersInRightPositionArray(args), os);
	    ((WSEndpointImpl) this.getEndpoint()).getService().submit(caller).get();
	} catch (Exception ite) {
	    throw new InvocationException("Unknown exception received: " + ite.getMessage(), ite);
	} catch (Throwable e) {
	    throw new InvocationException("Generic Error during method invocation!", e);
	}
    }

    /**
     * Invokes this method with the provided arguments applying provided mapper
     *
     * @param args
     * @param mapper
     *            if null no mappings are applied method will be invoked using
     *            args directly. in this case the keys of the map gotta be the
     *            parameters names as defined in wsdl/wsconsume generated
     *            classes
     * @return {@link InvocationResultImpl}
     * @throws InvocationException
     * @throws IllegalArgumentException
     * @throws MappingException
     */
    @SuppressWarnings("unchecked")
    public InvocationResultImpl invoke(Object args, WiseMapper mapper) throws InvocationException, IllegalArgumentException, MappingException {
	if (mapper == null) {
	    return this.invoke((Map<String, Object>) args);
	}
	ClassLoader oldLoader = SecurityActions.getContextClassLoader();
	Map<String, Object> mappingResults;
	try {
	    SecurityActions.setContextClassLoader(this.getEndpoint().getClassLoader());
	    mappingResults = mapper.applyMapping(args);
	} finally {
	    SecurityActions.setContextClassLoader(oldLoader);
	}
	return this.invoke(mappingResults);

    }

    /**
     * {@inheritDoc}
     *
     * @see org.jboss.wise.core.client.WSMethod#invoke(java.lang.Object)
     */
    public InvocationResult invoke(Object args) throws InvocationException, IllegalArgumentException, MappingException {
	return this.invoke(args, null);
    }

    /**
     * Gets the map of WebParameters for a selected method
     *
     * @return a map representing valide webparameters
     */
    public Map<String, WebParameterImpl> getWebParams() {
	return parameters;
    }

    private void initWebParams() {
	Method method = this.getMethod();
	Annotation[][] annotations = method.getParameterAnnotations();
	Type[] methodparameterTypes = method.getGenericParameterTypes();
	for (int i = 0; i < annotations.length; i++) {
	    for (int j = 0; j < annotations[i].length; j++) {
		if (annotations[i][j] instanceof WebParam) {
		    WebParam webParaAnno = (WebParam) annotations[i][j];
		    WebParameterImpl parameter = new WebParameterImpl(methodparameterTypes[i], webParaAnno.name(), i, webParaAnno
			    .mode());
		    parameters.put(parameter.getName(), parameter);
		    break;
		}
	    }
	}

    }

    /*
     * package protected method, for test purpose
     */
    /* package */Object[] getParametersInRightPositionArray(Map<String, Object> originalParams) {
	Map<String, WebParameterImpl> webParams = this.getWebParams();
	Object[] arrayToReturn = new Object[webParams.size()];
	Arrays.fill(arrayToReturn, null);

	for (String key : webParams.keySet()) {
	    WebParameterImpl webPara = webParams.get(key);
	    int position = webPara.getPosition();
	    arrayToReturn[position] = originalParams.get(key);
	}
	return arrayToReturn;
    }

    /*
     * package protected method, for test purpose
     */
    Map<String, Object> getHoldersResult(Map<String, Object> paras) {
	Map<String, Object> holders = new HashMap<String, Object>();
	Map<String, WebParameterImpl> webParams = this.getWebParams();

	for (String key : paras.keySet()) {
	    WebParameterImpl wisePara = webParams.get(key);
	    if (wisePara != null && (wisePara.getMode() == WebParam.Mode.INOUT || wisePara.getMode() == WebParam.Mode.OUT)) {
		holders.put(key, paras.get(key));
		holders.put(TYPE_PREFIX + key, wisePara.getType());
	    }
	}
	return holders;
    }

    public synchronized boolean isOneWay() {
	return method.getAnnotation(Oneway.class) != null;
    }

    public Method getMethod() {
	return method;
    }

    public WSEndpoint getEndpoint() {
	return endpoint;
    }

}


text:
module RuboCop
  module Cop
    module Performance
      # This cop is used to identify usages of `count` on an `Enumerable` that
      # follow calls to `select`, `find_all`, `filter` or `reject`. Querying logic can instead be
      # passed to the `count` call.
      #
      # @example
      #   # bad
      #   [1, 2, 3].select { |e| e > 2 }.size
      #   [1, 2, 3].reject { |e| e > 2 }.size
      #   [1, 2, 3].select { |e| e > 2 }.length
      #   [1, 2, 3].reject { |e| e > 2 }.length
      #   [1, 2, 3].select { |e| e > 2 }.count { |e| e.odd? }
      #   [1, 2, 3].reject { |e| e > 2 }.count { |e| e.even? }
      #   array.select(&:value).count
      #
      #   # good
      #   [1, 2, 3].count { |e| e > 2 }
      #   [1, 2, 3].count { |e| e < 2 }
      #   [1, 2, 3].count { |e| e > 2 && e.odd? }
      #   [1, 2, 3].count { |e| e < 2 && e.even? }
      #   Model.select('field AS field_one').count
      #   Model.select(:value).count
      #
      # `ActiveRecord` compatibility:
      # `ActiveRecord` will ignore the block that is passed to `count`.
      # Other methods, such as `select`, will convert the association to an
      # array and then run the block on the array. A simple work around to
      # make `count` work with a block is to call `to_a.count {...}`.
      #
      # Example:
      #   `Model.where(id: [1, 2, 3]).select { |m| m.method == true }.size`
      #
      #   becomes:
      #
      #   `Model.where(id: [1, 2, 3]).to_a.count { |m| m.method == true }`
      class Count < Base
        include RangeHelp
        extend AutoCorrector

        MSG = 'Use `count` instead of `%<selector>s...%<counter>s`.'

        def_node_matcher :count_candidate?, <<~PATTERN
          {
            (send (block $(send _ ${:select :filter :find_all :reject}) ...) ${:count :length :size})
            (send $(send _ ${:select :filter :find_all :reject} (:block_pass _)) ${:count :length :size})
          }
        PATTERN

        def on_send(node)
          count_candidate?(node) do |selector_node, selector, counter|
            return unless eligible_node?(node)

            range = source_starting_at(node) do
              selector_node.loc.selector.begin_pos
            end

            add_offense(range, message: format(MSG, selector: selector, counter: counter)) do |corrector|
              autocorrect(corrector, node, selector_node, selector)
            end
          end
        end

        private

        def autocorrect(corrector, node, selector_node, selector)
          selector_loc = selector_node.loc.selector

          return if selector == :reject

          range = source_starting_at(node) { |n| n.loc.dot.begin_pos }

          corrector.remove(range)
          corrector.replace(selector_loc, 'count')
        end

        def eligible_node?(node)
          !(node.parent && node.parent.block_type?)
        end

        def source_starting_at(node)
          begin_pos = if block_given?
                        yield node
                      else
                        node.source_range.begin_pos
                      end

          range_between(begin_pos, node.source_range.end_pos)
        end
      end
    end
  end
end


text:
$:.unshift(File.dirname(__FILE__)) unless
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))

require 'dget'
module DGet

  class GitHubDoc
    include DGet
    attr_reader :user, :project_name, :pages, :root_doc

    def initialize user, project_name
      @user = user
      @project_name = project_name
    end

    def root_doc
      @root_doc ||= proc {
        doc = N('http://wiki.github.com/%s/%s' % [@user, @project_name])
        doc.css('.main').first.fmap { |c| clean_links c }
        doc
      }.call
    end

    def pages
      @pages ||= root_doc.css(".sidebar ul li b a").map do |link|
        [
          link.content,
          link['href'][/#{@project_name}\/(.*)/, 1] || "home",
          proc {
            content = N(link['href']).css('.main').first
            clean_links content
            content
          }
        ]
      end
    end

    private

    def clean_links doc
      # rewrites internal links to use the local navigation
      doc.css('a').each do |some_a|
        some_a['href'].fmap { |href| href[/#{@project_name}\/(.*)/, 1].fmap { |id|
            some_a['href'] = "javascript:go(\'#{id}\')"
          }
        }
      end
    end

  end

  class GitHubEngine
    def do project_spec, file = nil
      user, project_name = *project_spec.split('/')

      gh_doc = GitHubDoc.new(user, project_name)
      file ||= file_for(user, project_name)

      puts "Building wiki: #{user}/#{project_name} => #{file}"

      content = build_content gh_doc
      File.open(file, 'w') { |f| f.puts content }
    end

    private

    def build_content gh_doc
      build_doc(gh_doc.root_doc, gh_doc.pages, gh_doc.project_name, gh_doc.user)
    end

    def file_for user, project_name
      "#{project_name}_#{user}.html"
    end

    def template
      IO.read(File.dirname(__FILE__) / 'github.html')
    end

    def build_doc root, pages, project_name, user
      # Template variables, note: project_name and user are also used in the template
      project_description = root.css("#repository_description").first.fmap(&:content)
      main_content = root.css('.main').first.fmap(&:inner_html)
      page_list = sidebar(pages)
      i = 0 #todo better way to trace this?
      puts "Getting #{pages.size} pages."
      page_content = pages.pmap(5) { |title, id, content_f|
        # i += 1
        # puts "  * [#{i}/#{pages.size}] #{title}"
        "
#{content_f[]}
"
      }.join

      ERB.new(template()).result(binding)
    end

    def sidebar pages
      "
" +
      pages.map { |title, id, _|
        "
#{title}
"
      }.join +
      "
"
    end

  end

end


text:
class AddProjectId < ActiveRecord::Migration
  def self.up
    add_column :nodes, :project_id, :integer
    execute "UPDATE nodes SET project_id = section_id"
    execute "UPDATE nodes SET section_id = 1"
  end

  def self.down
    execute "UPDATE nodes SET section_id = project_id"
    remove_column :nodes, :project_id
  end
end


text:
<configuration>
    <appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%-5level [%logger{0}] %msg%n</pattern>
        </encoder>
        <target>System.err</target>
    </appender>

    <root level="${org.wquery.log.level:-info}">
        <appender-ref ref="STDERR"/>
    </root>
</configuration>


text:
/**
 * Autogenerated by Thrift Compiler (0.9.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.kaaproject.kaa.server.common.thrift.gen.operations;

import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class EndpointEvent implements org.apache.thrift.TBase<EndpointEvent, EndpointEvent._Fields>, java.io.Serializable, Cloneable, Comparable<EndpointEvent> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("EndpointEvent");

  private static final org.apache.thrift.protocol.TField UUID_FIELD_DESC = new org.apache.thrift.protocol.TField("uuid", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField SENDER_FIELD_DESC = new org.apache.thrift.protocol.TField("sender", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField EVENT_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("eventData", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField CREATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("createTime", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)5);

  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new EndpointEventStandardSchemeFactory());
    schemes.put(TupleScheme.class, new EndpointEventTupleSchemeFactory());
  }

  public String uuid; // required
  public ByteBuffer sender; // required
  public ByteBuffer eventData; // required
  public long createTime; // required
  public int version; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    UUID((short)1, "uuid"),
    SENDER((short)2, "sender"),
    EVENT_DATA((short)3, "eventData"),
    CREATE_TIME((short)4, "createTime"),
    VERSION((short)5, "version");

    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // UUID
          return UUID;
        case 2: // SENDER
          return SENDER;
        case 3: // EVENT_DATA
          return EVENT_DATA;
        case 4: // CREATE_TIME
          return CREATE_TIME;
        case 5: // VERSION
          return VERSION;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __CREATETIME_ISSET_ID = 0;
  private static final int __VERSION_ISSET_ID = 1;
  private byte __isset_bitfield = 0;
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.UUID, new org.apache.thrift.meta_data.FieldMetaData("uuid", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SENDER, new org.apache.thrift.meta_data.FieldMetaData("sender", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , "endpoint_id")));
    tmpMap.put(_Fields.EVENT_DATA, new org.apache.thrift.meta_data.FieldMetaData("eventData", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    tmpMap.put(_Fields.CREATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("createTime", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "Long")));
    tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32        , "Integer")));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(EndpointEvent.class, metaDataMap);
  }

  public EndpointEvent() {
  }

  public EndpointEvent(
    String uuid,
    ByteBuffer sender,
    ByteBuffer eventData,
    long createTime,
    int version)
  {
    this();
    this.uuid = uuid;
    this.sender = sender;
    this.eventData = eventData;
    this.createTime = createTime;
    setCreateTimeIsSet(true);
    this.version = version;
    setVersionIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public EndpointEvent(EndpointEvent other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetUuid()) {
      this.uuid = other.uuid;
    }
    if (other.isSetSender()) {
      this.sender = other.sender;
    }
    if (other.isSetEventData()) {
      this.eventData = org.apache.thrift.TBaseHelper.copyBinary(other.eventData);
;
    }
    this.createTime = other.createTime;
    this.version = other.version;
  }

  public EndpointEvent deepCopy() {
    return new EndpointEvent(this);
  }

  @Override
  public void clear() {
    this.uuid = null;
    this.sender = null;
    this.eventData = null;
    setCreateTimeIsSet(false);
    this.createTime = 0;
    setVersionIsSet(false);
    this.version = 0;
  }

  public String getUuid() {
    return this.uuid;
  }

  public EndpointEvent setUuid(String uuid) {
    this.uuid = uuid;
    return this;
  }

  public void unsetUuid() {
    this.uuid = null;
  }

  /** Returns true if field uuid is set (has been assigned a value) and false otherwise */
  public boolean isSetUuid() {
    return this.uuid != null;
  }

  public void setUuidIsSet(boolean value) {
    if (!value) {
      this.uuid = null;
    }
  }

  public byte[] getSender() {
    setSender(org.apache.thrift.TBaseHelper.rightSize(sender));
    return sender == null ? null : sender.array();
  }

  public ByteBuffer bufferForSender() {
    return sender;
  }

  public EndpointEvent setSender(byte[] sender) {
    setSender(sender == null ? (ByteBuffer)null : ByteBuffer.wrap(sender));
    return this;
  }

  public EndpointEvent setSender(ByteBuffer sender) {
    this.sender = sender;
    return this;
  }

  public void unsetSender() {
    this.sender = null;
  }

  /** Returns true if field sender is set (has been assigned a value) and false otherwise */
  public boolean isSetSender() {
    return this.sender != null;
  }

  public void setSenderIsSet(boolean value) {
    if (!value) {
      this.sender = null;
    }
  }

  public byte[] getEventData() {
    setEventData(org.apache.thrift.TBaseHelper.rightSize(eventData));
    return eventData == null ? null : eventData.array();
  }

  public ByteBuffer bufferForEventData() {
    return eventData;
  }

  public EndpointEvent setEventData(byte[] eventData) {
    setEventData(eventData == null ? (ByteBuffer)null : ByteBuffer.wrap(eventData));
    return this;
  }

  public EndpointEvent setEventData(ByteBuffer eventData) {
    this.eventData = eventData;
    return this;
  }

  public void unsetEventData() {
    this.eventData = null;
  }

  /** Returns true if field eventData is set (has been assigned a value) and false otherwise */
  public boolean isSetEventData() {
    return this.eventData != null;
  }

  public void setEventDataIsSet(boolean value) {
    if (!value) {
      this.eventData = null;
    }
  }

  public long getCreateTime() {
    return this.createTime;
  }

  public EndpointEvent setCreateTime(long createTime) {
    this.createTime = createTime;
    setCreateTimeIsSet(true);
    return this;
  }

  public void unsetCreateTime() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATETIME_ISSET_ID);
  }

  /** Returns true if field createTime is set (has been assigned a value) and false otherwise */
  public boolean isSetCreateTime() {
    return EncodingUtils.testBit(__isset_bitfield, __CREATETIME_ISSET_ID);
  }

  public void setCreateTimeIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATETIME_ISSET_ID, value);
  }

  public int getVersion() {
    return this.version;
  }

  public EndpointEvent setVersion(int version) {
    this.version = version;
    setVersionIsSet(true);
    return this;
  }

  public void unsetVersion() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VERSION_ISSET_ID);
  }

  /** Returns true if field version is set (has been assigned a value) and false otherwise */
  public boolean isSetVersion() {
    return EncodingUtils.testBit(__isset_bitfield, __VERSION_ISSET_ID);
  }

  public void setVersionIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VERSION_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case UUID:
      if (value == null) {
        unsetUuid();
      } else {
        setUuid((String)value);
      }
      break;

    case SENDER:
      if (value == null) {
        unsetSender();
      } else {
        setSender((ByteBuffer)value);
      }
      break;

    case EVENT_DATA:
      if (value == null) {
        unsetEventData();
      } else {
        setEventData((ByteBuffer)value);
      }
      break;

    case CREATE_TIME:
      if (value == null) {
        unsetCreateTime();
      } else {
        setCreateTime((Long)value);
      }
      break;

    case VERSION:
      if (value == null) {
        unsetVersion();
      } else {
        setVersion((Integer)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case UUID:
      return getUuid();

    case SENDER:
      return getSender();

    case EVENT_DATA:
      return getEventData();

    case CREATE_TIME:
      return Long.valueOf(getCreateTime());

    case VERSION:
      return Integer.valueOf(getVersion());

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case UUID:
      return isSetUuid();
    case SENDER:
      return isSetSender();
    case EVENT_DATA:
      return isSetEventData();
    case CREATE_TIME:
      return isSetCreateTime();
    case VERSION:
      return isSetVersion();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof EndpointEvent)
      return this.equals((EndpointEvent)that);
    return false;
  }

  public boolean equals(EndpointEvent that) {
    if (that == null)
      return false;

    boolean this_present_uuid = true && this.isSetUuid();
    boolean that_present_uuid = true && that.isSetUuid();
    if (this_present_uuid || that_present_uuid) {
      if (!(this_present_uuid && that_present_uuid))
        return false;
      if (!this.uuid.equals(that.uuid))
        return false;
    }

    boolean this_present_sender = true && this.isSetSender();
    boolean that_present_sender = true && that.isSetSender();
    if (this_present_sender || that_present_sender) {
      if (!(this_present_sender && that_present_sender))
        return false;
      if (!this.sender.equals(that.sender))
        return false;
    }

    boolean this_present_eventData = true && this.isSetEventData();
    boolean that_present_eventData = true && that.isSetEventData();
    if (this_present_eventData || that_present_eventData) {
      if (!(this_present_eventData && that_present_eventData))
        return false;
      if (!this.eventData.equals(that.eventData))
        return false;
    }

    boolean this_present_createTime = true;
    boolean that_present_createTime = true;
    if (this_present_createTime || that_present_createTime) {
      if (!(this_present_createTime && that_present_createTime))
        return false;
      if (this.createTime != that.createTime)
        return false;
    }

    boolean this_present_version = true;
    boolean that_present_version = true;
    if (this_present_version || that_present_version) {
      if (!(this_present_version && that_present_version))
        return false;
      if (this.version != that.version)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder();

    boolean present_uuid = true && (isSetUuid());
    builder.append(present_uuid);
    if (present_uuid)
      builder.append(uuid);

    boolean present_sender = true && (isSetSender());
    builder.append(present_sender);
    if (present_sender)
      builder.append(sender);

    boolean present_eventData = true && (isSetEventData());
    builder.append(present_eventData);
    if (present_eventData)
      builder.append(eventData);

    boolean present_createTime = true;
    builder.append(present_createTime);
    if (present_createTime)
      builder.append(createTime);

    boolean present_version = true;
    builder.append(present_version);
    if (present_version)
      builder.append(version);

    return builder.toHashCode();
  }

  @Override
  public int compareTo(EndpointEvent other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetUuid()).compareTo(other.isSetUuid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUuid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uuid, other.uuid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSender()).compareTo(other.isSetSender());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSender()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sender, other.sender);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetEventData()).compareTo(other.isSetEventData());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEventData()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eventData, other.eventData);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCreateTime()).compareTo(other.isSetCreateTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreateTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createTime, other.createTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetVersion()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("EndpointEvent(");
    boolean first = true;

    sb.append("uuid:");
    if (this.uuid == null) {
      sb.append("null");
    } else {
      sb.append(this.uuid);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("sender:");
    if (this.sender == null) {
      sb.append("null");
    } else {
      sb.append(this.sender);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("eventData:");
    if (this.eventData == null) {
      sb.append("null");
    } else {
      org.apache.thrift.TBaseHelper.toString(this.eventData, sb);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("createTime:");
    sb.append(this.createTime);
    first = false;
    if (!first) sb.append(", ");
    sb.append("version:");
    sb.append(this.version);
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class EndpointEventStandardSchemeFactory implements SchemeFactory {
    public EndpointEventStandardScheme getScheme() {
      return new EndpointEventStandardScheme();
    }
  }

  private static class EndpointEventStandardScheme extends StandardScheme<EndpointEvent> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, EndpointEvent struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // UUID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.uuid = iprot.readString();
              struct.setUuidIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // SENDER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.sender = iprot.readBinary();
              struct.setSenderIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // EVENT_DATA
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.eventData = iprot.readBinary();
              struct.setEventDataIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // CREATE_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.createTime = iprot.readI64();
              struct.setCreateTimeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // VERSION
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.version = iprot.readI32();
              struct.setVersionIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, EndpointEvent struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.uuid != null) {
        oprot.writeFieldBegin(UUID_FIELD_DESC);
        oprot.writeString(struct.uuid);
        oprot.writeFieldEnd();
      }
      if (struct.sender != null) {
        oprot.writeFieldBegin(SENDER_FIELD_DESC);
        oprot.writeBinary(struct.sender);
        oprot.writeFieldEnd();
      }
      if (struct.eventData != null) {
        oprot.writeFieldBegin(EVENT_DATA_FIELD_DESC);
        oprot.writeBinary(struct.eventData);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC);
      oprot.writeI64(struct.createTime);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(VERSION_FIELD_DESC);
      oprot.writeI32(struct.version);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class EndpointEventTupleSchemeFactory implements SchemeFactory {
    public EndpointEventTupleScheme getScheme() {
      return new EndpointEventTupleScheme();
    }
  }

  private static class EndpointEventTupleScheme extends TupleScheme<EndpointEvent> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, EndpointEvent struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetUuid()) {
        optionals.set(0);
      }
      if (struct.isSetSender()) {
        optionals.set(1);
      }
      if (struct.isSetEventData()) {
        optionals.set(2);
      }
      if (struct.isSetCreateTime()) {
        optionals.set(3);
      }
      if (struct.isSetVersion()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetUuid()) {
        oprot.writeString(struct.uuid);
      }
      if (struct.isSetSender()) {
        oprot.writeBinary(struct.sender);
      }
      if (struct.isSetEventData()) {
        oprot.writeBinary(struct.eventData);
      }
      if (struct.isSetCreateTime()) {
        oprot.writeI64(struct.createTime);
      }
      if (struct.isSetVersion()) {
        oprot.writeI32(struct.version);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, EndpointEvent struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.uuid = iprot.readString();
        struct.setUuidIsSet(true);
      }
      if (incoming.get(1)) {
        struct.sender = iprot.readBinary();
        struct.setSenderIsSet(true);
      }
      if (incoming.get(2)) {
        struct.eventData = iprot.readBinary();
        struct.setEventDataIsSet(true);
      }
      if (incoming.get(3)) {
        struct.createTime = iprot.readI64();
        struct.setCreateTimeIsSet(true);
      }
      if (incoming.get(4)) {
        struct.version = iprot.readI32();
        struct.setVersionIsSet(true);
      }
    }
  }

}


text:
(function() {
  var url = window.location,
    body = document.body,
    slides = document.querySelectorAll('div.slide'),
    progress = document.querySelector('div.progress div'),
    slideList = [],
    l = slides.length,
    i;
  if (typeof keysalive === 'undefined') {
    keysalive = true;
  }

  for (i = 0; i < l; i++) {
    var cb = document.createElement('button');
    cb.className = 'cb';
    cb.innerHTML = 'x';
    slides[i].appendChild(cb);
    slideList.push({
      id: slides[i].id,
      hasInnerNavigation: null !== slides[i].querySelector('.inner')
    });
  }

  /* Encode code blocks */
  function encode() {
    var codes = document.querySelectorAll('code');
    var all = codes.length;
    while (all--) {
      var tc = codes[all].innerHTML;
      if (tc.indexOf('<') !== -1) {
        tc = tc.replace(/</g, '&lt');
        tc = tc.replace(/>/g, '&gt');
        codes[all].innerHTML = tc;
      }
    }
  }
  encode();

  var demos = document.querySelectorAll('[contenteditable]'),
    alldemos = demos.length;

  function dokeys(ev) {
    keysalive = true;
  }

  function stopkeys(ev) {
    keysalive = false;
  }
  while (alldemos--) {
    demos[alldemos].addEventListener('focus', stopkeys, false);
    demos[alldemos].addEventListener('blur', dokeys, false);
  }

  function getTransform() {
    var denominator = Math.max(
      body.clientWidth / window.innerWidth,
      body.clientHeight / window.innerHeight
    );

    return 'scale(' + (1 / denominator) + ')';
  }

  function applyTransform(transform) {
    body.style.WebkitTransform = transform;
    body.style.MozTransform = transform;
    body.style.msTransform = transform;
    body.style.OTransform = transform;
    body.style.transform = transform;
  }

  function enterSlideMode() {
    body.className = 'full';
    applyTransform(getTransform());
  }

  function enterListMode() {
    body.className = 'list';
    applyTransform('none');
  }

  function getCurrentSlideNumber() {
    var i, l = slideList.length,
      currentSlideId = url.hash.substr(1);

    for (i = 0; i < l; ++i) {
      if (currentSlideId === slideList[i].id) {
        return i;
      }
    }

    return -1;
  }

  function scrollToSlide(slideNumber) {
    if (-1 === slideNumber) {
      return;
    }
    var currentSlide = document.getElementById(slideList[slideNumber].id);
    if (null !== currentSlide) {
      window.scrollTo(0, currentSlide.offsetTop);
    }
  }

  function isListMode() {
    // Should use `URLSearchParams` but modern browser support is poor.
    return url.search.indexOf('?full') !== -1 || url.search.indexOf('&full') !== -1;
  }

  function normalizeSlideNumber(slideNumber) {
    if (0 > slideNumber) {
      return slideList.length - 1;
    } else if (slideList.length <= slideNumber) {
      return 0;
    } else {
      return slideNumber;
    }
  }

  function updateProgress(slideNumber) {
    if (null === progress) {
      return;
    }
    progress.style.width = (100 / (slideList.length - 1) * normalizeSlideNumber(slideNumber)).toFixed(2) + '%';
  }

  function getSlideHash(slideNumber) {
    return '#' + slideList[normalizeSlideNumber(slideNumber)].id;
  }

  function goToSlide(slideNumber) {
    var currentSlide = document.getElementById(slideList[slideNumber].id);
    if (currentSlide.classList.contains('inactive')) {
      goToSlide(slides[slideNumber + 1] ? slideNumber + 1 : 0);
    } else {
      url.hash = getSlideHash(slideNumber);
      lognotes(slideNumber);
      if (!isListMode()) {
        updateProgress(slideNumber);
        GIFrefresh(slideNumber);
        playVideoIfAutoplay(slideNumber);
      }
    }
  }

  function GIFrefresh(slideNumber) {
    if (slides[slideNumber]) {
      var img = slides[slideNumber].querySelector('img');
      if (img && img.src.indexOf('gif') !== -1) {
        img.src = img.src;
      }
    }
  }

  function playVideoIfAutoplay(slideNumber) {
    if (slides[slideNumber] &&
      slides[slideNumber].className.indexOf('autoplay') !== -1) {
      var video = slides[slideNumber].querySelector('video');
      if (video) {
        video.play();
      }
    }
  }

  function getContainingSlideId(el) {
    var node = el;
    while ('BODY' !== node.nodeName && 'HTML' !== node.nodeName) {
      if (node.classList.contains('slide')) {
        return node.id;
      } else {
        node = node.parentNode;
      }
    }

    return '';
  }

  function dispatchSingleSlideMode(e) {
    var slideId = getContainingSlideId(e.target);

    if ('' !== slideId && isListMode()) {
      e.preventDefault();

      if (e.target.tagName === 'BUTTON' && e.target.className === 'cb') {
        toggleSlide(e.target.parentNode);
      } else {
        // NOTE: we should update hash to get things work properly
        url.hash = '#' + slideId;
        history.replaceState(null, null, url.pathname + '?full#' + slideId);
        enterSlideMode();

        updateProgress(getCurrentSlideNumber());
      }
    }
  }

  function toggleSlide(elm) {
    if (elm.classList.contains('inactive')) {
      elm.classList.remove('inactive');
    } else {
      elm.classList.add('inactive');
    }
  }

  // Increases inner navigation by adding 'active' class to next inactive inner navigation item
  function increaseInnerNavigation(slideNumber) {
    // Shortcut for slides without inner navigation
    if (true !== slideList[slideNumber].hasInnerNavigation) {
      return -1;
    }

    var activeNodes = document.querySelectorAll(getSlideHash(slideNumber) + ' .active'),
      // NOTE: we assume there is no other elements in inner navigation
      node = activeNodes[activeNodes.length - 1].nextElementSibling;

    if (null !== node) {
      node.classList.add('active');
      return activeNodes.length + 1;
    } else {
      return -1;
    }
  }

  function lognotes(slideNumber) {
    if (window.console && slideList[slideNumber]) {
      var notes = document.querySelector('#' + slideList[slideNumber].id + ' .notes');
      if (notes) {
        console.info(notes.innerHTML.replace(/\n\s+/g, '\n'));
      }
      if (slideList[slideNumber + 1]) {
        var next = document.querySelector('#' + slideList[slideNumber + 1].id + ' header');
        if (next) {
          next = next.innerHTML.replace(/^\s+|<[^>]+>/g, '');
          console.info('NEXT: ' + next);
        }
      }
    }
  }

  // Event handlers

  window.addEventListener('DOMContentLoaded', function() {
    if (!isListMode()) {
      // "?full" is present without slide hash, so we should display first slide
      if (-1 === getCurrentSlideNumber()) {
        history.replaceState(null, null, url.pathname + '?full' + getSlideHash(0));
      }
      enterSlideMode();
      updateProgress(getCurrentSlideNumber());
    }
  }, false);

  window.addEventListener('popstate', function(e) {
    if (isListMode()) {
      enterListMode();
      scrollToSlide(getCurrentSlideNumber());
    } else {
      enterSlideMode();
    }
  }, false);

  window.addEventListener('resize', function(e) {
    if (!isListMode()) {
      applyTransform(getTransform());
    }
  }, false);

  document.addEventListener('keydown', function(e) {
    if (!keysalive) {
      return;
    }
    // Shortcut for alt, shift and meta keys
    if (e.altKey || e.ctrlKey || e.metaKey) {
      return;
    }

    var currentSlideNumber = getCurrentSlideNumber();
    switch (e.which) {
      case 116: // F5
      case 13: // Enter
        if (isListMode() && -1 !== currentSlideNumber) {
          e.preventDefault();

          history.pushState(null, null, url.pathname + '?full' + getSlideHash(currentSlideNumber));
          enterSlideMode();

          updateProgress(currentSlideNumber);
        }
        break;

      case 27: // Esc
        if (!isListMode()) {
          e.preventDefault();

          history.pushState(null, null, url.pathname + getSlideHash(currentSlideNumber));
          enterListMode();
          scrollToSlide(currentSlideNumber);
        }
        break;

      case 33: // PgUp
      case 38: // Up
      case 37: // Left
      case 72: // h
      case 75: // k
        e.preventDefault();

        currentSlideNumber--;
        goToSlide(currentSlideNumber);
        break;

      case 34: // PgDown
      case 40: // Down
      case 39: // Right
      case 76: // l
      case 74: // j
        e.preventDefault();

        // Only go to next slide if current slide have no inner
        // navigation or inner navigation is fully shown
        // NOTE: But first of all check if there is no current slide
        if (-1 === currentSlideNumber ||
          !slideList[currentSlideNumber].hasInnerNavigation ||
          -1 === increaseInnerNavigation(currentSlideNumber)
        ) {
          currentSlideNumber++;
          goToSlide(currentSlideNumber);
        }
        break;

      case 36: // Home
        e.preventDefault();

        currentSlideNumber = 0;
        goToSlide(currentSlideNumber);
        break;

      case 35: // End
        e.preventDefault();

        currentSlideNumber = slideList.length - 1;
        goToSlide(currentSlideNumber);
        break;

      case 9: // Tab = +1; Shift + Tab = -1
      case 32: // Space = +1; Shift + Space = -1
        e.preventDefault();

        currentSlideNumber += e.shiftKey ? -1 : 1;
        goToSlide(currentSlideNumber);
        break;
      case 78:
        slides[currentSlideNumber].classList.toggle('peek');
        break;
      default:
        // Behave as usual
    }
  }, false);

  document.addEventListener('click', dispatchSingleSlideMode, false);
  document.addEventListener('touchend', dispatchSingleSlideMode, false);

  document.addEventListener('touchstart', function(e) {
    if (!isListMode()) {
      var currentSlideNumber = getCurrentSlideNumber(),
        x = e.touches[0].pageX;
      if (x > window.innerWidth / 2) {
        currentSlideNumber++;
      } else {
        currentSlideNumber--;
      }

      goToSlide(currentSlideNumber);
    }
  }, false);

  document.addEventListener('touchmove', function(e) {
    if (!isListMode()) {
      e.preventDefault();
    }
  }, false);

}());

function goFullScreen() {
  document.fullscreenEnabled = document.fullscreenEnabled ||
    document.mozFullScreenEnabled ||
    document.documentElement.webkitRequestFullScreen;

  function requestFullscreen(element) {
    if (element.requestFullscreen) {
      element.requestFullscreen();
    } else if (element.mozRequestFullScreen) {
      element.mozRequestFullScreen();
    } else if (element.webkitRequestFullScreen) {
      element.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
    }
  }
  if (document.fullscreenEnabled) {
    requestFullscreen(document.documentElement);
  }
}

var lang = 'en-US';
try {
  lang = new URL(window.location).searchParams.get('lang');
} catch (ex) {
  // searchParams isn't supported in all browsers
}

// Pre-selects the correct current language on the dropdown menu
document.getElementById('langMenuId').value = lang;

function changeLanguage() {
  var langObj = document.getElementById('langMenuId');
  document.documentElement.lang = langObj.value;

  // Update the language code in the URL bar
  try {
    var url = new URL(window.location);
    url.searchParams.set('lang', langObj.value);
    history.replaceState({}, document.title, url);
  } catch (ex) {
    // This might not be supported in all browsers
  }
}

changeLanguage();


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Ann. bot. Soc. Zool. -Bot. fenn. Vanamo 1(3): 52 (1921)

#### Original name
Graphis siamensis Vain.

### Remarks
null


text:
<!doctype html>

        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />

        <title>Alerts Canada – Zachary Seguin</title>

        <link rel="icon" href="https://zacharyseguin.ca/favicon.png" />

        <link href="https://zacharyseguin.ca/images/apple-touch-icon.png" rel="apple-touch-icon" />
        <link href="https://zacharyseguin.ca/images/apple-touch-icon-76x76.png" rel="apple-touch-icon" sizes="76x76" />
        <link href="https://zacharyseguin.ca/images/apple-touch-icon-120x120.png" rel="apple-touch-icon" sizes="120x120" />
        <link href="https://zacharyseguin.ca/images/apple-touch-icon-152x152.png" rel="apple-touch-icon" sizes="152x152" />

        <link href='//fonts.googleapis.com/css?family=Roboto:100,300,400,500,700' rel='stylesheet' type='text/css'>

        <link rel="stylesheet" href="resources/stylesheets/reset.css" />
        <link rel="stylesheet" href="resources/stylesheets/960.css" />
        <link rel="stylesheet" href="resources/stylesheets/font-awesome.css" />
        <link rel="stylesheet" href="resources/stylesheets/alerts.css" />

Alerts Canada

                <menu class="grid_8">

This application is under development and should not be relied upon for emergency alerts.

                </menu>

Alerts

{{info.headline | uppercase}}

Issued by {{info.senderName}} on {{info.effective | date:"EEEE, MMMM d, yyyy 'at' h:mm a"}}

Expires {{info.expires | date:"EEEE, MMMM d, yyyy 'at' h:mm a"}}

For {{area.description}}.

{{info.instruction}}

Additional Information

Copyright © 2014 – Zachary Seguin
All Rights Reserved.


text:
import pwm_scan
import time

if __name__ == '__main__':

    scan = pwm_scan.PWMScan()

    # Load binding sites to generate a position weight matrix
    scan.load_pwm(filename='example_target_sites.txt')

    # Load genome sequence (fasta)
    scan.load_sequence(seq='example_genome_sequence.fna')

    # Load annotation (csv)
    scan.load_annotation(filename='example_genome_annotation.gtf')

    t0 = time.time()
    # Launch scan and output a .csv file
    scan.launch_scan(filename='output.csv', threshold=12)

    print('Genome size = {} bp'.format(scan.sequence.shape[0]))
    print('Binding site = {} bp'.format(scan.pwm.shape[1]))
    print('Elapsed time = {} seconds'.format(time.time() - t0))


text:
<?php

class createCampaignResponse
{

    /**
     * @var Campaign $return
     * @access public
     */
    public $return = null;
}