text:
package at.alladin.rmbt.shared.model;

import java.util.UUID;

import org.joda.time.DateTime;

public class Measurement
{
    protected int uid;
    protected UUID uuid;
    protected Integer client_id;
    protected String client_version;
    protected String client_name;
    protected String client_language;
    protected String client_local_ip;
    protected String token;
    protected Integer server_id;
    protected Integer port;
    protected boolean use_ssl;
    protected DateTime time;
    protected Long speed_upload;
    protected Long speed_download;
    protected Long ping_shortest;
    protected String encryption;
    protected String client_public_ip;
    protected String plattform;
    protected String os_version;
    protected String api_level;
    protected String device;
    protected String model;
    protected String product;
    protected Integer phone_type;
    protected Integer data_state;
    protected String network_country;
    protected String network_operator;
    protected String network_operator_name;
    protected String network_sim_country;
    protected String network_sim_operator;
    protected String network_sim_operator_name;
    protected String wifi_ssid;
    protected String wifi_bssid;
    protected String wifi_network_id;
    protected Integer duration;
    protected Integer num_threads;
    protected String status;
    protected String timezone;
    protected Long bytes_download;
    protected Long bytes_upload;
    protected Long nsec_download;
    protected Long nsec_upload;
    protected String server_ip;
    protected String client_software_version;
    protected Double geo_lat;
    protected Double geo_long;
    protected Integer network_type;
    protected Integer signal_strength;
    protected String software_revision;
    protected Long client_test_counter;
    protected String nat_type;
    protected String client_previous_test_status;
    protected Long public_ip_asn;
    protected Double speed_upload_log;
    protected Double speed_download_log;
    protected Long total_bytes_download;
    protected Long total_bytes_upload;
    protected Integer wifi_link_speed;
    protected String public_ip_rdns;
    protected String public_ip_as_name;
    protected Integer test_slot;
    protected Integer provider_id;
    protected Boolean network_is_roaming;
    protected Double ping_shortest_log;
    protected Boolean run_ndt;
    protected Integer num_threads_requested;
    protected String client_public_ip_anonymized;
    protected Integer zip_code;
    protected String geo_provider;
    protected Double geo_accuracy;
    protected boolean deleted;
    protected String comment;
    protected UUID open_uuid;
    protected DateTime client_time;
    protected Integer zip_code_geo;
    protected Integer mobile_provider_id;
    protected Integer roaming_type;
    protected UUID open_test_uuid;
    protected String country_asn;
    protected String country_location;
    protected Long test_if_bytes_download;
    protected Long test_if_bytes_upload;
    protected boolean implausible;
    protected Long testdl_if_bytes_download;
    protected Long testdl_if_bytes_upload;
    protected Long testul_if_bytes_download;
    protected Long testul_if_bytes_upload;
    protected String country_geoip;
    protected Integer location_max_distance;
    protected Integer location_max_distance_gps;
    protected String network_group_name;
    protected String network_group_type;
    protected Long time_dl_ns;
    protected Long time_ul_ns;
    protected Integer num_threads_ul;
    protected DateTime timestamp;
    protected String source_ip;
    protected Integer lte_rsrp;
    protected Integer lte_rsrq;
    protected Integer mobile_network_id;
    protected Integer mobile_sim_id;
    protected Double dist_prev;
    protected Double speed_prev;
    protected String tag;
    protected Long ping_median;
    protected Double ping_median_log;
    protected String source_ip_anonymized;
    protected String client_ip_local;
    protected String client_ip_local_anonymized;
    protected String client_ip_local_type;
    protected String hidden_code;

    public int getUid()
    {
        return uid;
    }
    public void setUid(int uid)
    {
        this.uid = uid;
    }
    public UUID getUuid()
    {
        return uuid;
    }
    public void setUuid(UUID uuid)
    {
        this.uuid = uuid;
    }
    public Integer getClient_id()
    {
        return client_id;
    }
    public void setClient_id(Integer client_id)
    {
        this.client_id = client_id;
    }
    public String getClient_version()
    {
        return client_version;
    }
    public void setClient_version(String client_version)
    {
        this.client_version = client_version;
    }
    public String getClient_name()
    {
        return client_name;
    }
    public void setClient_name(String client_name)
    {
        this.client_name = client_name;
    }
    public String getClient_language()
    {
        return client_language;
    }
    public void setClient_language(String client_language)
    {
        this.client_language = client_language;
    }
    public String getClient_local_ip()
    {
        return client_local_ip;
    }
    public void setClient_local_ip(String client_local_ip)
    {
        this.client_local_ip = client_local_ip;
    }
    public String getToken()
    {
        return token;
    }
    public void setToken(String token)
    {
        this.token = token;
    }
    public Integer getServer_id()
    {
        return server_id;
    }
    public void setServer_id(Integer server_id)
    {
        this.server_id = server_id;
    }
    public Integer getPort()
    {
        return port;
    }
    public void setPort(Integer port)
    {
        this.port = port;
    }
    public boolean isUse_ssl()
    {
        return use_ssl;
    }
    public void setUse_ssl(boolean use_ssl)
    {
        this.use_ssl = use_ssl;
    }
    public DateTime getTime()
    {
        return time;
    }
    public void setTime(DateTime time)
    {
        this.time = time;
    }
    public Long getSpeed_upload()
    {
        return speed_upload;
    }
    public void setSpeed_upload(Long speed_upload)
    {
        this.speed_upload = speed_upload;
    }
    public Long getSpeed_download()
    {
        return speed_download;
    }
    public void setSpeed_download(Long speed_download)
    {
        this.speed_download = speed_download;
    }
    public Long getPing_shortest()
    {
        return ping_shortest;
    }
    public void setPing_shortest(Long ping_shortest)
    {
        this.ping_shortest = ping_shortest;
    }
    public String getEncryption()
    {
        return encryption;
    }
    public void setEncryption(String encryption)
    {
        this.encryption = encryption;
    }
    public String getClient_public_ip()
    {
        return client_public_ip;
    }
    public void setClient_public_ip(String client_public_ip)
    {
        this.client_public_ip = client_public_ip;
    }
    public String getPlattform()
    {
        return plattform;
    }
    public void setPlattform(String plattform)
    {
        this.plattform = plattform;
    }
    public String getOs_version()
    {
        return os_version;
    }
    public void setOs_version(String os_version)
    {
        this.os_version = os_version;
    }
    public String getApi_level()
    {
        return api_level;
    }
    public void setApi_level(String api_level)
    {
        this.api_level = api_level;
    }
    public String getDevice()
    {
        return device;
    }
    public void setDevice(String device)
    {
        this.device = device;
    }
    public String getModel()
    {
        return model;
    }
    public void setModel(String model)
    {
        this.model = model;
    }
    public String getProduct()
    {
        return product;
    }
    public void setProduct(String product)
    {
        this.product = product;
    }
    public Integer getPhone_type()
    {
        return phone_type;
    }
    public void setPhone_type(Integer phone_type)
    {
        this.phone_type = phone_type;
    }
    public Integer getData_state()
    {
        return data_state;
    }
    public void setData_state(Integer data_state)
    {
        this.data_state = data_state;
    }
    public String getNetwork_country()
    {
        return network_country;
    }
    public void setNetwork_country(String network_country)
    {
        this.network_country = network_country;
    }
    public String getNetwork_operator()
    {
        return network_operator;
    }
    public void setNetwork_operator(String network_operator)
    {
        this.network_operator = network_operator;
    }
    public String getNetwork_operator_name()
    {
        return network_operator_name;
    }
    public void setNetwork_operator_name(String network_operator_name)
    {
        this.network_operator_name = network_operator_name;
    }
    public String getNetwork_sim_country()
    {
        return network_sim_country;
    }
    public void setNetwork_sim_country(String network_sim_country)
    {
        this.network_sim_country = network_sim_country;
    }
    public String getNetwork_sim_operator()
    {
        return network_sim_operator;
    }
    public void setNetwork_sim_operator(String network_sim_operator)
    {
        this.network_sim_operator = network_sim_operator;
    }
    public String getNetwork_sim_operator_name()
    {
        return network_sim_operator_name;
    }
    public void setNetwork_sim_operator_name(String network_sim_operator_name)
    {
        this.network_sim_operator_name = network_sim_operator_name;
    }
    public String getWifi_ssid()
    {
        return wifi_ssid;
    }
    public void setWifi_ssid(String wifi_ssid)
    {
        this.wifi_ssid = wifi_ssid;
    }
    public String getWifi_bssid()
    {
        return wifi_bssid;
    }
    public void setWifi_bssid(String wifi_bssid)
    {
        this.wifi_bssid = wifi_bssid;
    }
    public String getWifi_network_id()
    {
        return wifi_network_id;
    }
    public void setWifi_network_id(String wifi_network_id)
    {
        this.wifi_network_id = wifi_network_id;
    }
    public Integer getDuration()
    {
        return duration;
    }
    public void setDuration(Integer duration)
    {
        this.duration = duration;
    }
    public Integer getNum_threads()
    {
        return num_threads;
    }
    public void setNum_threads(Integer num_threads)
    {
        this.num_threads = num_threads;
    }
    public String getStatus()
    {
        return status;
    }
    public void setStatus(String status)
    {
        this.status = status;
    }
    public String getTimezone()
    {
        return timezone;
    }
    public void setTimezone(String timezone)
    {
        this.timezone = timezone;
    }
    public Long getBytes_download()
    {
        return bytes_download;
    }
    public void setBytes_download(Long bytes_download)
    {
        this.bytes_download = bytes_download;
    }
    public Long getBytes_upload()
    {
        return bytes_upload;
    }
    public void setBytes_upload(Long bytes_upload)
    {
        this.bytes_upload = bytes_upload;
    }
    public Long getNsec_download()
    {
        return nsec_download;
    }
    public void setNsec_download(Long nsec_download)
    {
        this.nsec_download = nsec_download;
    }
    public Long getNsec_upload()
    {
        return nsec_upload;
    }
    public void setNsec_upload(Long nsec_upload)
    {
        this.nsec_upload = nsec_upload;
    }
    public String getServer_ip()
    {
        return server_ip;
    }
    public void setServer_ip(String server_ip)
    {
        this.server_ip = server_ip;
    }
    public String getClient_software_version()
    {
        return client_software_version;
    }
    public void setClient_software_version(String client_software_version)
    {
        this.client_software_version = client_software_version;
    }
    public Double getGeo_lat()
    {
        return geo_lat;
    }
    public void setGeo_lat(Double geo_lat)
    {
        this.geo_lat = geo_lat;
    }
    public Double getGeo_long()
    {
        return geo_long;
    }
    public void setGeo_long(Double geo_long)
    {
        this.geo_long = geo_long;
    }
    public Integer getNetwork_type()
    {
        return network_type;
    }
    public void setNetwork_type(Integer network_type)
    {
        this.network_type = network_type;
    }
    public Integer getSignal_strength()
    {
        return signal_strength;
    }
    public void setSignal_strength(Integer signal_strength)
    {
        this.signal_strength = signal_strength;
    }
    public String getSoftware_revision()
    {
        return software_revision;
    }
    public void setSoftware_revision(String software_revision)
    {
        this.software_revision = software_revision;
    }
    public Long getClient_test_counter()
    {
        return client_test_counter;
    }
    public void setClient_test_counter(Long client_test_counter)
    {
        this.client_test_counter = client_test_counter;
    }
    public String getNat_type()
    {
        return nat_type;
    }
    public void setNat_type(String nat_type)
    {
        this.nat_type = nat_type;
    }
    public String getClient_previous_test_status()
    {
        return client_previous_test_status;
    }
    public void setClient_previous_test_status(String client_previous_test_status)
    {
        this.client_previous_test_status = client_previous_test_status;
    }
    public Long getPublic_ip_asn()
    {
        return public_ip_asn;
    }
    public void setPublic_ip_asn(Long public_ip_asn)
    {
        this.public_ip_asn = public_ip_asn;
    }
    public Double getSpeed_upload_log()
    {
        return speed_upload_log;
    }
    public void setSpeed_upload_log(Double speed_upload_log)
    {
        this.speed_upload_log = speed_upload_log;
    }
    public Double getSpeed_download_log()
    {
        return speed_download_log;
    }
    public void setSpeed_download_log(Double speed_download_log)
    {
        this.speed_download_log = speed_download_log;
    }
    public Long getTotal_bytes_download()
    {
        return total_bytes_download;
    }
    public void setTotal_bytes_download(Long total_bytes_download)
    {
        this.total_bytes_download = total_bytes_download;
    }
    public Long getTotal_bytes_upload()
    {
        return total_bytes_upload;
    }
    public void setTotal_bytes_upload(Long total_bytes_upload)
    {
        this.total_bytes_upload = total_bytes_upload;
    }
    public Integer getWifi_link_speed()
    {
        return wifi_link_speed;
    }
    public void setWifi_link_speed(Integer wifi_link_speed)
    {
        this.wifi_link_speed = wifi_link_speed;
    }
    public String getPublic_ip_rdns()
    {
        return public_ip_rdns;
    }
    public void setPublic_ip_rdns(String public_ip_rdns)
    {
        this.public_ip_rdns = public_ip_rdns;
    }
    public String getPublic_ip_as_name()
    {
        return public_ip_as_name;
    }
    public void setPublic_ip_as_name(String public_ip_as_name)
    {
        this.public_ip_as_name = public_ip_as_name;
    }
    public Integer getTest_slot()
    {
        return test_slot;
    }
    public void setTest_slot(Integer test_slot)
    {
        this.test_slot = test_slot;
    }
    public Integer getProvider_id()
    {
        return provider_id;
    }
    public void setProvider_id(Integer provider_id)
    {
        this.provider_id = provider_id;
    }
    public Boolean getNetwork_is_roaming()
    {
        return network_is_roaming;
    }
    public void setNetwork_is_roaming(Boolean network_is_roaming)
    {
        this.network_is_roaming = network_is_roaming;
    }
    public Double getPing_shortest_log()
    {
        return ping_shortest_log;
    }
    public void setPing_shortest_log(Double ping_shortest_log)
    {
        this.ping_shortest_log = ping_shortest_log;
    }
    public Boolean getRun_ndt()
    {
        return run_ndt;
    }
    public void setRun_ndt(Boolean run_ndt)
    {
        this.run_ndt = run_ndt;
    }
    public Integer getNum_threads_requested()
    {
        return num_threads_requested;
    }
    public void setNum_threads_requested(Integer num_threads_requested)
    {
        this.num_threads_requested = num_threads_requested;
    }
    public String getClient_public_ip_anonymized()
    {
        return client_public_ip_anonymized;
    }
    public void setClient_public_ip_anonymized(String client_public_ip_anonymized)
    {
        this.client_public_ip_anonymized = client_public_ip_anonymized;
    }
    public Integer getZip_code()
    {
        return zip_code;
    }
    public void setZip_code(Integer zip_code)
    {
        this.zip_code = zip_code;
    }
    public String getGeo_provider()
    {
        return geo_provider;
    }
    public void setGeo_provider(String geo_provider)
    {
        this.geo_provider = geo_provider;
    }
    public Double getGeo_accuracy()
    {
        return geo_accuracy;
    }
    public void setGeo_accuracy(Double geo_accuracy)
    {
        this.geo_accuracy = geo_accuracy;
    }
    public boolean isDeleted()
    {
        return deleted;
    }
    public void setDeleted(boolean deleted)
    {
        this.deleted = deleted;
    }
    public String getComment()
    {
        return comment;
    }
    public void setComment(String comment)
    {
        this.comment = comment;
    }
    public UUID getOpen_uuid()
    {
        return open_uuid;
    }
    public void setOpen_uuid(UUID open_uuid)
    {
        this.open_uuid = open_uuid;
    }
    public DateTime getClient_time()
    {
        return client_time;
    }
    public void setClient_time(DateTime client_time)
    {
        this.client_time = client_time;
    }
    public Integer getZip_code_geo()
    {
        return zip_code_geo;
    }
    public void setZip_code_geo(Integer zip_code_geo)
    {
        this.zip_code_geo = zip_code_geo;
    }
    public Integer getMobile_provider_id()
    {
        return mobile_provider_id;
    }
    public void setMobile_provider_id(Integer mobile_provider_id)
    {
        this.mobile_provider_id = mobile_provider_id;
    }
    public Integer getRoaming_type()
    {
        return roaming_type;
    }
    public void setRoaming_type(Integer roaming_type)
    {
        this.roaming_type = roaming_type;
    }
    public UUID getOpen_test_uuid()
    {
        return open_test_uuid;
    }
    public void setOpen_test_uuid(UUID open_test_uuid)
    {
        this.open_test_uuid = open_test_uuid;
    }
    public String getCountry_asn()
    {
        return country_asn;
    }
    public void setCountry_asn(String country_asn)
    {
        this.country_asn = country_asn;
    }
    public String getCountry_location()
    {
        return country_location;
    }
    public void setCountry_location(String country_location)
    {
        this.country_location = country_location;
    }
    public Long getTest_if_bytes_download()
    {
        return test_if_bytes_download;
    }
    public void setTest_if_bytes_download(Long test_if_bytes_download)
    {
        this.test_if_bytes_download = test_if_bytes_download;
    }
    public Long getTest_if_bytes_upload()
    {
        return test_if_bytes_upload;
    }
    public void setTest_if_bytes_upload(Long test_if_bytes_upload)
    {
        this.test_if_bytes_upload = test_if_bytes_upload;
    }
    public boolean isImplausible()
    {
        return implausible;
    }
    public void setImplausible(boolean implausible)
    {
        this.implausible = implausible;
    }
    public Long getTestdl_if_bytes_download()
    {
        return testdl_if_bytes_download;
    }
    public void setTestdl_if_bytes_download(Long testdl_if_bytes_download)
    {
        this.testdl_if_bytes_download = testdl_if_bytes_download;
    }
    public Long getTestdl_if_bytes_upload()
    {
        return testdl_if_bytes_upload;
    }
    public void setTestdl_if_bytes_upload(Long testdl_if_bytes_upload)
    {
        this.testdl_if_bytes_upload = testdl_if_bytes_upload;
    }
    public Long getTestul_if_bytes_download()
    {
        return testul_if_bytes_download;
    }
    public void setTestul_if_bytes_download(Long testul_if_bytes_download)
    {
        this.testul_if_bytes_download = testul_if_bytes_download;
    }
    public Long getTestul_if_bytes_upload()
    {
        return testul_if_bytes_upload;
    }
    public void setTestul_if_bytes_upload(Long testul_if_bytes_upload)
    {
        this.testul_if_bytes_upload = testul_if_bytes_upload;
    }
    public String getCountry_geoip()
    {
        return country_geoip;
    }
    public void setCountry_geoip(String country_geoip)
    {
        this.country_geoip = country_geoip;
    }
    public Integer getLocation_max_distance()
    {
        return location_max_distance;
    }
    public void setLocation_max_distance(Integer location_max_distance)
    {
        this.location_max_distance = location_max_distance;
    }
    public Integer getLocation_max_distance_gps()
    {
        return location_max_distance_gps;
    }
    public void setLocation_max_distance_gps(Integer location_max_distance_gps)
    {
        this.location_max_distance_gps = location_max_distance_gps;
    }
    public String getNetwork_group_name()
    {
        return network_group_name;
    }
    public void setNetwork_group_name(String network_group_name)
    {
        this.network_group_name = network_group_name;
    }
    public String getNetwork_group_type()
    {
        return network_group_type;
    }
    public void setNetwork_group_type(String network_group_type)
    {
        this.network_group_type = network_group_type;
    }
    public Long getTime_dl_ns()
    {
        return time_dl_ns;
    }
    public void setTime_dl_ns(Long time_dl_ns)
    {
        this.time_dl_ns = time_dl_ns;
    }
    public Long getTime_ul_ns()
    {
        return time_ul_ns;
    }
    public void setTime_ul_ns(Long time_ul_ns)
    {
        this.time_ul_ns = time_ul_ns;
    }
    public Integer getNum_threads_ul()
    {
        return num_threads_ul;
    }
    public void setNum_threads_ul(Integer num_threads_ul)
    {
        this.num_threads_ul = num_threads_ul;
    }
    public DateTime getTimestamp()
    {
        return timestamp;
    }
    public void setTimestamp(DateTime timestamp)
    {
        this.timestamp = timestamp;
    }
    public String getSource_ip()
    {
        return source_ip;
    }
    public void setSource_ip(String source_ip)
    {
        this.source_ip = source_ip;
    }
    public Integer getLte_rsrp()
    {
        return lte_rsrp;
    }
    public void setLte_rsrp(Integer lte_rsrp)
    {
        this.lte_rsrp = lte_rsrp;
    }
    public Integer getLte_rsrq()
    {
        return lte_rsrq;
    }
    public void setLte_rsrq(Integer lte_rsrq)
    {
        this.lte_rsrq = lte_rsrq;
    }
    public Integer getMobile_network_id()
    {
        return mobile_network_id;
    }
    public void setMobile_network_id(Integer mobile_network_id)
    {
        this.mobile_network_id = mobile_network_id;
    }
    public Integer getMobile_sim_id()
    {
        return mobile_sim_id;
    }
    public void setMobile_sim_id(Integer mobile_sim_id)
    {
        this.mobile_sim_id = mobile_sim_id;
    }
    public Double getDist_prev()
    {
        return dist_prev;
    }
    public void setDist_prev(Double dist_prev)
    {
        this.dist_prev = dist_prev;
    }
    public Double getSpeed_prev()
    {
        return speed_prev;
    }
    public void setSpeed_prev(Double speed_prev)
    {
        this.speed_prev = speed_prev;
    }
    public String getTag()
    {
        return tag;
    }
    public void setTag(String tag)
    {
        this.tag = tag;
    }
    public Long getPing_median()
    {
        return ping_median;
    }
    public void setPing_median(Long ping_median)
    {
        this.ping_median = ping_median;
    }
    public Double getPing_median_log()
    {
        return ping_median_log;
    }
    public void setPing_median_log(Double ping_median_log)
    {
        this.ping_median_log = ping_median_log;
    }
    public String getSource_ip_anonymized()
    {
        return source_ip_anonymized;
    }
    public void setSource_ip_anonymized(String source_ip_anonymized)
    {
        this.source_ip_anonymized = source_ip_anonymized;
    }
    public String getClient_ip_local()
    {
        return client_ip_local;
    }
    public void setClient_ip_local(String client_ip_local)
    {
        this.client_ip_local = client_ip_local;
    }
    public String getClient_ip_local_anonymized()
    {
        return client_ip_local_anonymized;
    }
    public void setClient_ip_local_anonymized(String client_ip_local_anonymized)
    {
        this.client_ip_local_anonymized = client_ip_local_anonymized;
    }
    public String getClient_ip_local_type()
    {
        return client_ip_local_type;
    }
    public void setClient_ip_local_type(String client_ip_local_type)
    {
        this.client_ip_local_type = client_ip_local_type;
    }
    public String getHidden_code()
    {
        return hidden_code;
    }
    public void setHidden_code(String hidden_code)
    {
        this.hidden_code = hidden_code;
    }
}


text:
Kubeform
========
[![wercker
status](https://app.wercker.com/status/d51be2fb5ae796055969b74d7924a059/s/master
"wercker
status")](https://app.wercker.com/project/bykey/d51be2fb5ae796055969b74d7924a059)

Deploy yourself a high-availability Kubernetes cluster, in minutes.
Built on Terraform, CoreOS and Ansible.

Our recipes for bootstrapping HA Kubernetes clusters on any cloud or on-premise.

Includes the following -

* CoreOS as the base operating system
* Kubernetes (in HA) mode (leader election using Podmaster)
* SSL certs/security for Kubernetes cluster components
* Flannel for networking
* Kubernetes Dashboard
* Sky/KubeDNS

and optionally -

* Heapster, InfluxDB for cluster monitoring
* Fluentd, elasticsearch for cluster logging

See our Roadmap for future features and feel free to help us improve the project
by contributing a Pull Request, or raise an issue if you run into trouble!

## Getting started

## Keep up to date...

Check out the [Capgemini UK Engineering blog](http://capgemini.github.io/) to find out more about the stuff we do!

redpajama_set_name: RedPajamaGithub


text:
import unittest

import stubout
import webob

import nova.api
from nova.api.openstack import flavors
from nova.tests.api.openstack import fakes

class FlavorsTest(unittest.TestCase):
    def setUp(self):
        self.stubs = stubout.StubOutForTesting()
        fakes.FakeAuthManager.auth_data = {}
        fakes.FakeAuthDatabase.data = {}
        fakes.stub_out_networking(self.stubs)
        fakes.stub_out_rate_limiting(self.stubs)
        fakes.stub_out_auth(self.stubs)

    def tearDown(self):
        self.stubs.UnsetAll()

    def test_get_flavor_list(self):
        req = webob.Request.blank('/v1.0/flavors')
        res = req.get_response(fakes.wsgi_app())

    def test_get_flavor_by_id(self):
        pass

if __name__ == '__main__':
    unittest.main()


text:
<?php

namespace UthandoPortfolio\Mapper;

use UthandoCommon\Mapper\AbstractDbMapper;
use Zend\Db\Sql\Select;

/**
 * Class Portfolio
 *
 * @package UthandoPortfolio\Mapper
 */
class PortfolioMapper extends AbstractDbMapper
{
    protected $table = 'portfolio';
    protected $primary = 'portfolioId';

    public function getPortfolioIdByTag($tag)
    {
        $tag = (string) $tag;
        $select = $this->getSelect();
        $select->join(
            'portfolioTagMap',
            'portfolio.portfolioId=portfolioTagMap.portfolioId',
            [],
            Select::JOIN_LEFT
        )->join(
            'portfolioTag',
            'portfolioTag.portfolioTagId=portfolioTagMap.portfolioTagId',
            [],
            Select::JOIN_LEFT
        )->where->equalTo('portfolioTag.name', $tag);

        return $this->fetchResult($select);
    }
}


text:
package org.apache.shindig.common.util;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

/**
 * Performs url encoding / decoding with forced utf-8. Automatically takes care
 * of boilerplate exception handling.
 */
public class Utf8UrlCoder {

  public static String encode(String input) {
    try {
      return URLEncoder.encode(input, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
  }

  public static String decode(String input) {
    try {
      return URLDecoder.decode(input, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
  }

}


text:
<?php

final class PhabricatorPasteSearchEngine
  extends PhabricatorApplicationSearchEngine {

  public function getResultTypeDescription() {
    return pht('Pastes');
  }

  public function buildSavedQueryFromRequest(AphrontRequest $request) {
    $saved = new PhabricatorSavedQuery();
    $saved->setParameter(
      'authorPHIDs',
      $this->readUsersFromRequest($request, 'authors'));

    $languages = $request->getStrList('languages');
    if ($request->getBool('noLanguage')) {
      $languages[] = null;
    }
    $saved->setParameter('languages', $languages);

    $saved->setParameter('createdStart', $request->getStr('createdStart'));
    $saved->setParameter('createdEnd', $request->getStr('createdEnd'));

    return $saved;
  }

  public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) {
    $query = id(new PhabricatorPasteQuery())
      ->needContent(true)
      ->withAuthorPHIDs($saved->getParameter('authorPHIDs', array()))
      ->withLanguages($saved->getParameter('languages', array()));

    $start = $this->parseDateTime($saved->getParameter('createdStart'));
    $end = $this->parseDateTime($saved->getParameter('createdEnd'));

    if ($start) {
      $query->withDateCreatedAfter($start);
    }

    if ($end) {
      $query->withDateCreatedBefore($end);
    }

    return $query;
  }

  public function buildSearchForm(
    AphrontFormView $form,
    PhabricatorSavedQuery $saved_query) {
    $phids = $saved_query->getParameter('authorPHIDs', array());
    $author_handles = id(new PhabricatorHandleQuery())
      ->setViewer($this->requireViewer())
      ->withPHIDs($phids)
      ->execute();

    $languages = $saved_query->getParameter('languages', array());
    $no_language = false;
    foreach ($languages as $key => $language) {
      if ($language === null) {
        $no_language = true;
        unset($languages[$key]);
        continue;
      }
    }

    $form
      ->appendChild(
        id(new AphrontFormTokenizerControl())
          ->setDatasource(new PhabricatorPeopleDatasource())
          ->setName('authors')
          ->setLabel(pht('Authors'))
          ->setValue($author_handles))
      ->appendChild(
        id(new AphrontFormTextControl())
          ->setName('languages')
          ->setLabel(pht('Languages'))
          ->setValue(implode(', ', $languages)))
      ->appendChild(
        id(new AphrontFormCheckboxControl())
          ->addCheckbox(
            'noLanguage',
            1,
            pht('Find Pastes with no specified language.'),
            $no_language));

    $this->buildDateRange(
      $form,
      $saved_query,
      'createdStart',
      pht('Created After'),
      'createdEnd',
      pht('Created Before'));

  }

  protected function getURI($path) {
    return '/paste/'.$path;
  }

  protected function getBuiltinQueryNames() {
    $names = array(
      'all' => pht('All Pastes'),
    );

    if ($this->requireViewer()->isLoggedIn()) {
      $names['authored'] = pht('Authored');
    }

    return $names;
  }

  public function buildSavedQueryFromBuiltin($query_key) {

    $query = $this->newSavedQuery();
    $query->setQueryKey($query_key);

    switch ($query_key) {
      case 'all':
        return $query;
      case 'authored':
        return $query->setParameter(
          'authorPHIDs',
          array($this->requireViewer()->getPHID()));
    }

    return parent::buildSavedQueryFromBuiltin($query_key);
  }

  protected function getRequiredHandlePHIDsForResultList(
    array $pastes,
    PhabricatorSavedQuery $query) {
    return mpull($pastes, 'getAuthorPHID');
  }

  protected function renderResultList(
    array $pastes,
    PhabricatorSavedQuery $query,
    array $handles) {
    assert_instances_of($pastes, 'PhabricatorPaste');

    $viewer = $this->requireViewer();

    $lang_map = PhabricatorEnv::getEnvConfig('pygments.dropdown-choices');

    $list = new PHUIObjectItemListView();
    $list->setUser($viewer);
    foreach ($pastes as $paste) {
      $created = phabricator_date($paste->getDateCreated(), $viewer);
      $author = $handles[$paste->getAuthorPHID()]->renderLink();

      $lines = phutil_split_lines($paste->getContent());

      $preview = id(new PhabricatorSourceCodeView())
        ->setLimit(5)
        ->setLines($lines)
        ->setURI(new PhutilURI($paste->getURI()));

      $source_code = phutil_tag(
        'div',
        array(
          'class' => 'phabricator-source-code-summary',
        ),
        $preview);

      $created = phabricator_datetime($paste->getDateCreated(), $viewer);
      $line_count = count($lines);
      $line_count = pht(
        '%s Line(s)',
        new PhutilNumber($line_count));

      $title = nonempty($paste->getTitle(), pht('(An Untitled Masterwork)'));

      $item = id(new PHUIObjectItemView())
        ->setObjectName('P'.$paste->getID())
        ->setHeader($title)
        ->setHref('/P'.$paste->getID())
        ->setObject($paste)
        ->addByline(pht('Author: %s', $author))
        ->addIcon('none', $created)
        ->addIcon('none', $line_count)
        ->appendChild($source_code);

      $lang_name = $paste->getLanguage();
      if ($lang_name) {
        $lang_name = idx($lang_map, $lang_name, $lang_name);
        $item->addIcon('none', $lang_name);
      }

      $list->addItem($item);
    }

    return $list;
  }
}


text:
Welcome to the Leap JavaScript framework. This is intended for use with the Leap (https://www.leapmotion.com/).

[![Build Status](https://travis-ci.org/leapmotion/leapjs.png)](https://travis-ci.org/leapmotion/leapjs)

For more information, please visit [http://js.leapmotion.com/](http://js.leapmotion.com/).

For examples, please see [http://js.leapmotion.com/examples](http://js.leapmotion.com/examples), as well, there are some basic examples included in the `examples` directory.

## Protocol

Details about the protocol used to communicate with `leapd` are detailed here [PROTOCOL.md](https://github.com/leapmotion/leapjs/blob/master/PROTOCOL.md).

##  Examples

Some examples have been included in the examples/ directory. To run them do the following:

1. Run `npm install`
2. Run `make serve`
3. Point your browser to [http://localhost:8080/examples](http://localhost:8080/examples)

Or in code:

1. Run `node examples/node.js`


text:
#include "curl_setup.h"

#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef __VMS
#include <in.h>
#include <inet.h>
#endif

#ifdef HAVE_PROCESS_H
#include <process.h>
#endif

#include "urldata.h"
#include "sendf.h"
#include "hostip.h"
#include "hash.h"
#include "share.h"
#include "strerror.h"
#include "url.h"
#include "inet_pton.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"

/***********************************************************************
 * Only for plain IPv4 builds
 **********************************************************************/
#ifdef CURLRES_IPV4 /* plain IPv4 code coming up */
/*
 * Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've
 * been set and returns TRUE if they are OK.
 */
bool Curl_ipvalid(struct connectdata *conn)
{
  if(conn->ip_version == CURL_IPRESOLVE_V6)
    /* An IPv6 address was requested and we can't get/use one */
    return FALSE;

  return TRUE; /* OK, proceed */
}

#ifdef CURLRES_SYNCH

/*
 * Curl_getaddrinfo() - the IPv4 synchronous version.
 *
 * The original code to this function was from the Dancer source code, written
 * by Bjorn Reese, it has since been patched and modified considerably.
 *
 * gethostbyname_r() is the thread-safe version of the gethostbyname()
 * function. When we build for plain IPv4, we attempt to use this
 * function. There are _three_ different gethostbyname_r() versions, and we
 * detect which one this platform supports in the configure script and set up
 * the HAVE_GETHOSTBYNAME_R_3, HAVE_GETHOSTBYNAME_R_5 or
 * HAVE_GETHOSTBYNAME_R_6 defines accordingly. Note that HAVE_GETADDRBYNAME
 * has the corresponding rules. This is primarily on *nix. Note that some unix
 * flavours have thread-safe versions of the plain gethostbyname() etc.
 *
 */
Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
                                const char *hostname,
                                int port,
                                int *waitp)
{
  Curl_addrinfo *ai = NULL;

#ifdef CURL_DISABLE_VERBOSE_STRINGS
  (void)conn;
#endif

  *waitp = 0; /* synchronous response only */

  ai = Curl_ipv4_resolve_r(hostname, port);
  if(!ai)
    infof(conn->data, "Curl_ipv4_resolve_r failed for %s\n", hostname);

  return ai;
}
#endif /* CURLRES_SYNCH */
#endif /* CURLRES_IPV4 */

#if defined(CURLRES_IPV4) && !defined(CURLRES_ARES)

/*
 * Curl_ipv4_resolve_r() - ipv4 threadsafe resolver function.
 *
 * This is used for both synchronous and asynchronous resolver builds,
 * implying that only threadsafe code and function calls may be used.
 *
 */
Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname,
                                   int port)
{
#if !defined(HAVE_GETADDRINFO_THREADSAFE) && defined(HAVE_GETHOSTBYNAME_R_3)
  int res;
#endif
  Curl_addrinfo *ai = NULL;
  struct hostent *h = NULL;
  struct in_addr in;
  struct hostent *buf = NULL;

  if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
    /* This is a dotted IP address 123.123.123.123-style */
    return Curl_ip2addr(AF_INET, &in, hostname, port);

#if defined(HAVE_GETADDRINFO_THREADSAFE)
  else {
    struct addrinfo hints;
    char sbuf[12];
    char *sbufptr = NULL;

    memset(&hints, 0, sizeof(hints));
    hints.ai_family = PF_INET;
    hints.ai_socktype = SOCK_STREAM;
    if(port) {
      snprintf(sbuf, sizeof(sbuf), "%d", port);
      sbufptr = sbuf;
    }

    (void)Curl_getaddrinfo_ex(hostname, sbufptr, &hints, &ai);

#elif defined(HAVE_GETHOSTBYNAME_R)
  /*
   * gethostbyname_r() is the preferred resolve function for many platforms.
   * Since there are three different versions of it, the following code is
   * somewhat #ifdef-ridden.
   */
  else {
    int h_errnop;

    buf = calloc(1, CURL_HOSTENT_SIZE);
    if(!buf)
      return NULL; /* major failure */
    /*
     * The clearing of the buffer is a workaround for a gethostbyname_r bug in
     * qnx nto and it is also _required_ for some of these functions on some
     * platforms.
     */

#if defined(HAVE_GETHOSTBYNAME_R_5)
    /* Solaris, IRIX and more */
    h = gethostbyname_r(hostname,
                        (struct hostent *)buf,
                        (char *)buf + sizeof(struct hostent),
                        CURL_HOSTENT_SIZE - sizeof(struct hostent),
                        &h_errnop);

    /* If the buffer is too small, it returns NULL and sets errno to
     * ERANGE. The errno is thread safe if this is compiled with
     * -D_REENTRANT as then the 'errno' variable is a macro defined to get
     * used properly for threads.
     */

    if(h) {
      ;
    }
    else
#elif defined(HAVE_GETHOSTBYNAME_R_6)
    /* Linux */

    (void)gethostbyname_r(hostname,
                        (struct hostent *)buf,
                        (char *)buf + sizeof(struct hostent),
                        CURL_HOSTENT_SIZE - sizeof(struct hostent),
                        &h, /* DIFFERENCE */
                        &h_errnop);
    /* Redhat 8, using glibc 2.2.93 changed the behavior. Now all of a
     * sudden this function returns EAGAIN if the given buffer size is too
     * small. Previous versions are known to return ERANGE for the same
     * problem.
     *
     * This wouldn't be such a big problem if older versions wouldn't
     * sometimes return EAGAIN on a common failure case. Alas, we can't
     * assume that EAGAIN *or* ERANGE means ERANGE for any given version of
     * glibc.
     *
     * For now, we do that and thus we may call the function repeatedly and
     * fail for older glibc versions that return EAGAIN, until we run out of
     * buffer size (step_size grows beyond CURL_HOSTENT_SIZE).
     *
     * If anyone has a better fix, please tell us!
     *
     * -------------------------------------------------------------------
     *
     * On October 23rd 2003, Dan C dug up more details on the mysteries of
     * gethostbyname_r() in glibc:
     *
     * In glibc 2.2.5 the interface is different (this has also been
     * discovered in glibc 2.1.1-6 as shipped by Redhat 6). What I can't
     * explain, is that tests performed on glibc 2.2.4-34 and 2.2.4-32
     * (shipped/upgraded by Redhat 7.2) don't show this behavior!
     *
     * In this "buggy" version, the return code is -1 on error and 'errno'
     * is set to the ERANGE or EAGAIN code. Note that 'errno' is not a
     * thread-safe variable.
     */

    if(!h) /* failure */
#elif defined(HAVE_GETHOSTBYNAME_R_3)
    /* AIX, Digital Unix/Tru64, HPUX 10, more? */

    /* For AIX 4.3 or later, we don't use gethostbyname_r() at all, because of
     * the plain fact that it does not return unique full buffers on each
     * call, but instead several of the pointers in the hostent structs will
     * point to the same actual data! This have the unfortunate down-side that
     * our caching system breaks down horribly. Luckily for us though, AIX 4.3
     * and more recent versions have a "completely thread-safe"[*] libc where
     * all the data is stored in thread-specific memory areas making calls to
     * the plain old gethostbyname() work fine even for multi-threaded
     * programs.
     *
     * This AIX 4.3 or later detection is all made in the configure script.
     *
     * Troels Walsted Hansen helped us work this out on March 3rd, 2003.
     *
     * [*] = much later we've found out that it isn't at all "completely
     * thread-safe", but at least the gethostbyname() function is.
     */

    if(CURL_HOSTENT_SIZE >=
       (sizeof(struct hostent) + sizeof(struct hostent_data))) {

      /* August 22nd, 2000: Albert Chin-A-Young brought an updated version
       * that should work! September 20: Richard Prescott worked on the buffer
       * size dilemma.
       */

      res = gethostbyname_r(hostname,
                            (struct hostent *)buf,
                            (struct hostent_data *)((char *)buf +
                                                    sizeof(struct hostent)));
      h_errnop = SOCKERRNO; /* we don't deal with this, but set it anyway */
    }
    else
      res = -1; /* failure, too smallish buffer size */

    if(!res) { /* success */

      h = buf; /* result expected in h */

      /* This is the worst kind of the different gethostbyname_r() interfaces.
       * Since we don't know how big buffer this particular lookup required,
       * we can't realloc down the huge alloc without doing closer analysis of
       * the returned data. Thus, we always use CURL_HOSTENT_SIZE for every
       * name lookup. Fixing this would require an extra malloc() and then
       * calling Curl_addrinfo_copy() that subsequent realloc()s down the new
       * memory area to the actually used amount.
       */
    }
    else
#endif /* HAVE_...BYNAME_R_5 || HAVE_...BYNAME_R_6 || HAVE_...BYNAME_R_3 */
    {
      h = NULL; /* set return code to NULL */
      free(buf);
    }
#else /* HAVE_GETADDRINFO_THREADSAFE || HAVE_GETHOSTBYNAME_R */
    /*
     * Here is code for platforms that don't have a thread safe
     * getaddrinfo() nor gethostbyname_r() function or for which
     * gethostbyname() is the preferred one.
     */
  else {
    h = gethostbyname((void *)hostname);
#endif /* HAVE_GETADDRINFO_THREADSAFE || HAVE_GETHOSTBYNAME_R */
  }

  if(h) {
    ai = Curl_he2ai(h, port);

    if(buf) /* used a *_r() function */
      free(buf);
  }

  return ai;
}
#endif /* defined(CURLRES_IPV4) && !defined(CURLRES_ARES) */


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lecanora subluta var. perspersa Nyl.

### Remarks
null


text:
require 'simplecov'
SimpleCov.start do
  add_filter '/spec/'
end

Dir[File.dirname(__FILE__) + '/support/**/*.rb'].each { |f| require f }


text:
+++
Title = "Emile van Haaren"
Linkedin = ""
Website = ""
Twitter = ""
image = "emile-vanhaaren.jpg"
type = "speaker"
linktitle = "emile-vanhaaren"
+++

Emile van Haaren, Design Consultant at KPN ICT Consulting, helps teams and clients find their goals and challenges through design thinking. As a scrum master he is interested in building teams in an agile manner. Growing through making mistakes and learning from each other is the most fun way of working.


text:
package api.web.gw2.mapping.v2.pvp.seasons;

import api.web.gw2.mapping.core.EnumValueFactory;

import java.util.stream.IntStream;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

/**
 * Unit test.
 *
 * @author Fabrice Bouyé
 */
public final class PvpSeasonUtilsTest {

    public PvpSeasonUtilsTest() {
    }

    @BeforeAll
    public static void setUpClass() {
    }

    @AfterAll
    public static void tearDownClass() {
    }

    @BeforeEach
    public void setUp() {
    }

    @AfterEach
    public void tearDown() {
    }

    /**
     * Test of PvpSeasonDivisionFlag.
     */
    @Test
    public void testFindPvpSeasonDivisionFlag() {
        System.out.println("findPvpSeasonDivisionFlag");
        final String[] values = {
                "CanLosePoints", // NOI18N.
                "CanLoseTiers", // NOI18N.
                "Repeatable", // NOI18N.
                null,
                "" // NOI18N.
        };
        final PvpSeasonDivisionFlag[] expResults = {
                PvpSeasonDivisionFlag.CAN_LOSE_POINTS,
                PvpSeasonDivisionFlag.CAN_LOSE_TIERS,
                PvpSeasonDivisionFlag.REPEATABLE,
                PvpSeasonDivisionFlag.UNKNOWN,
                PvpSeasonDivisionFlag.UNKNOWN
        };
        assertEquals(values.length, expResults.length);
        IntStream.range(0, values.length).
                forEach(index -> {
                    final String value = values[index];
                    final PvpSeasonDivisionFlag expResult = expResults[index];
                    final PvpSeasonDivisionFlag result = EnumValueFactory.INSTANCE.mapEnumValue(PvpSeasonDivisionFlag.class, value);
                    assertEquals(expResult, result);
                });
    }

    /**
     * Test of PvpSeasonLadderType.
     */
    @Test
    public void testFindPvpSeasonLadderType() {
        System.out.println("findPvpSeasonLadderType");
        final String[] values = {
                "legendary", // NOI18N.
                "guild", // NOI18N.
                "ladder", // NOI18N.
                null,
                "" // NOI18N.
        };
        final PvpSeasonLadderType[] expResults = {
                PvpSeasonLadderType.LEGENDARY,
                PvpSeasonLadderType.GUILD,
                PvpSeasonLadderType.LADDER,
                PvpSeasonLadderType.UNKNOWN,
                PvpSeasonLadderType.UNKNOWN
        };
        assertEquals(values.length, expResults.length);
        IntStream.range(0, values.length).
                forEach(index -> {
                    final String value = values[index];
                    final PvpSeasonLadderType expResult = expResults[index];
                    final PvpSeasonLadderType result = EnumValueFactory.INSTANCE.mapEnumValue(PvpSeasonLadderType.class, value);
                    assertEquals(expResult, result);
                });
    }

    /**
     * Test of PvpSeasonLadderScoringType.
     */
    @Test
    public void testFindPvpSeasonLadderScoringType() {
        System.out.println("findPvpSeasonLadderScoringType");
        final String[] values = {
                "Integer", // NOI18N.
                null,
                "" // NOI18N.
        };
        final PvpSeasonLadderScoringType[] expResults = {
                PvpSeasonLadderScoringType.INTEGER,
                PvpSeasonLadderScoringType.UNKNOWN,
                PvpSeasonLadderScoringType.UNKNOWN
        };
        assertEquals(values.length, expResults.length);
        IntStream.range(0, values.length).
                forEach(index -> {
                    final String value = values[index];
                    final PvpSeasonLadderScoringType expResult = expResults[index];
                    final PvpSeasonLadderScoringType result = EnumValueFactory.INSTANCE.mapEnumValue(PvpSeasonLadderScoringType.class, value);
                    assertEquals(expResult, result);
                });
    }

    /**
     * Test of PvpSeasonLadderScoringOrdering.
     */
    @Test
    public void testFindSeasonLadderScoringOrdering() {
        System.out.println("findPvpSeasonLadderScoringOrdering");
        final String[] values = {
                "LessIsBetter", // NOI18N.
                "MoreIsBetter", // NOI18N.
                null,
                "" // NOI18N.
        };
        final PvpSeasonLadderScoringOrdering[] expResults = {
                PvpSeasonLadderScoringOrdering.LESS_IS_BETTER,
                PvpSeasonLadderScoringOrdering.MORE_IS_BETTER,
                PvpSeasonLadderScoringOrdering.UNKNOWN,
                PvpSeasonLadderScoringOrdering.UNKNOWN
        };
        assertEquals(values.length, expResults.length);
        IntStream.range(0, values.length).
                forEach(index -> {
                    final String value = values[index];
                    final PvpSeasonLadderScoringOrdering expResult = expResults[index];
                    final PvpSeasonLadderScoringOrdering result = EnumValueFactory.INSTANCE.mapEnumValue(PvpSeasonLadderScoringOrdering.class, value);
                    assertEquals(expResult, result);
                });
    }

    /**
     * Test of PvpSeasonLadderSettingsTierType.
     */
    @Test
    public void testFindPvpSeasonLadderSettingsTierType() {
        System.out.println("findPvpSeasonLadderSettingsTierType");
        final String[] values = {
                "Rank", // NOI18N.
                null,
                "" // NOI18N.
        };
        final PvpSeasonLadderSettingsTierType[] expResults = {
                PvpSeasonLadderSettingsTierType.RANK,
                PvpSeasonLadderSettingsTierType.UNKNOWN,
                PvpSeasonLadderSettingsTierType.UNKNOWN
        };
        assertEquals(values.length, expResults.length);
        IntStream.range(0, values.length).
                forEach(index -> {
                    final String value = values[index];
                    final PvpSeasonLadderSettingsTierType expResult = expResults[index];
                    final PvpSeasonLadderSettingsTierType result = EnumValueFactory.INSTANCE.mapEnumValue(PvpSeasonLadderSettingsTierType.class, value);
                    assertEquals(expResult, result);
                });
    }
}


text:
#region Apache License
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to you under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FlexibleLogAnalyzingTool
{
    /// <summary>
    ///
    /// </summary>
    /// <author>Miura Acoustic</author>
    public partial class ImportLogFileDialog : Form
    {
        public ImportLogFileDialog()
        {
            InitializeComponent();
        }

        public string LogFileName
        {
            get
            {
                return LogFileTextBox.Text;
            }
            set
            {
                LogFileTextBox.Text = value;
            }
        }

        public Encoding FileEncoding
        {
            get
            {
                return Encoding.GetEncoding(EncodingCombobox.Text);
            }
        }

        public bool IsFile
        {
            get
            {
                return FileRadioButton.Checked;
            }
        }

        public string FilePattern
        {
            get
            {
                return FilePatternTextBox.Text;
            }
        }

        private void OpenFileButton_Click(object sender, EventArgs e)
        {
            if (FileRadioButton.Checked)
            {
                if (OpenLogFileDialog.ShowDialog(this) == DialogResult.OK)
                {
                    LogFileTextBox.Text = OpenLogFileDialog.FileName;
                }
            }
            else
            {
                if (LogFolderBrowserDialog.ShowDialog(this) == DialogResult.OK)
                {
                    LogFileTextBox.Text = LogFolderBrowserDialog.SelectedPath;
                }
            }
        }

        private void FileRadioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (FileRadioButton.Checked)
            {
                LogTitleLabel.Text = Properties.Resources.LabelFileName;
                FilePatternTextBox.Enabled = false;
            }
            else
            {
                LogTitleLabel.Text = Properties.Resources.LabelFolderName;
                FilePatternTextBox.Enabled = true;
            }
        }

        private void ImportLogFileDialog_Load(object sender, EventArgs e)
        {
            EncodingCombobox.SelectedIndex = 0;
        }
    }
}


text:
/* ###
 * IP: GHIDRA
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ghidra.app.util.bin.format.elf;

public class AVR8_ElfRelocationConstants {

	public static final int R_AVR_NONE = 0;
	public static final int R_AVR_32 = 1;
	public static final int R_AVR_7_PCREL = 2;
	public static final int R_AVR_13_PCREL = 3;
	public static final int R_AVR_16 = 4;
	public static final int R_AVR_16_PM = 5;
	public static final int R_AVR_LO8_LDI = 6;
	public static final int R_AVR_HI8_LDI = 7;
	public static final int R_AVR_HH8_LDI = 8;
	public static final int R_AVR_LO8_LDI_NEG = 9;
	public static final int R_AVR_HI8_LDI_NEG = 10;
	public static final int R_AVR_HH8_LDI_NEG = 11;
	public static final int R_AVR_LO8_LDI_PM = 12;
	public static final int R_AVR_HI8_LDI_PM = 13;
	public static final int R_AVR_HH8_LDI_PM = 14;
	public static final int R_AVR_LO8_LDI_PM_NEG = 15;
	public static final int R_AVR_HI8_LDI_PM_NEG = 16;
	public static final int R_AVR_HH8_LDI_PM_NEG = 17;
	public static final int R_AVR_CALL = 18;
	public static final int R_AVR_LDI = 19;
	public static final int R_AVR_6 = 20;
	public static final int R_AVR_6_ADIW = 21;
	public static final int R_AVR_MS8_LDI = 22;
	public static final int R_AVR_MS8_LDI_NEG = 23;
	public static final int R_AVR_LO8_LDI_GS = 24;
	public static final int R_AVR_HI8_LDI_GS = 25;
	public static final int R_AVR_8 = 26;
	public static final int R_AVR_8_LO8 = 27;
	public static final int R_AVR_8_HI8 = 28;
	public static final int R_AVR_8_HLO8 = 29;
	public static final int R_AVR_DIFF8 = 30;
	public static final int R_AVR_DIFF16 = 31;
	public static final int R_AVR_DIFF32 = 32;
	public static final int R_AVR_LDS_STS_16 = 33;
	public static final int R_AVR_PORT6 = 34;
	public static final int R_AVR_PORT5 = 35;

}


text:
package gnu.CORBA.GIOP.v1_0;

import gnu.CORBA.CDR.AbstractCdrInput;
import gnu.CORBA.CDR.AbstractCdrOutput;
import gnu.CORBA.GIOP.ServiceContext;
import gnu.CORBA.GIOP.CodeSetServiceContext;

import gnu.java.lang.CPStringBuilder;

import org.omg.CORBA.portable.IDLEntity;

/**
 * The GIOP 1.0 request message.
 *
 * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
 */
public class RequestHeader
  extends gnu.CORBA.GIOP.RequestHeader
  implements IDLEntity
{
  /**
   * Creates an empty request header, setting requesting principal
   * to byte[] { 'P' }.
   */
  public RequestHeader()
  {
    requesting_principal = new byte[] { 'P' };
  }

  /**
   * Set if the sender expects any response to this message.
   */
  public void setResponseExpected(boolean expected)
  {
    response_expected = expected;
  }

  /**
   * Return true if response is expected.
   */
  public boolean isResponseExpected()
  {
    return response_expected;
  }

  public String bytes(byte[] array)
  {
    CPStringBuilder b = new CPStringBuilder();
    for (int i = 0; i < array.length; i++)
      {
        b.append(Integer.toHexString(array [ i ] & 0xFF));
        b.append(" ");
      }
    return b.toString();
  }

  /**
   * Get the string representation of all included contexts.
   */
  public String contexts()
  {
    CPStringBuilder b = new CPStringBuilder();
    for (int i = 0; i < service_context.length; i++)
      {
        b.append(service_context [ i ].toString());
        b.append(' ');
      }
    return b.toString();
  }

  /**
   * Reads the header from the stream.
   *
   * Sets the code set of this stream to
   * the code set, specfied in the header.
   *
   * @param in a stream to read from.
   */
  public void read(AbstractCdrInput in)
  {
    service_context = ServiceContext.readSequence(in);
    request_id = in.read_ulong();
    response_expected = in.read_boolean();
    object_key = in.read_sequence();
    operation = in.read_string();
    requesting_principal = in.read_sequence();

    in.setCodeSet(CodeSetServiceContext.find(service_context));
  }

  /**
   * Return a string representation.
   */
  public String toString()
  {
    return "Request " + request_id + ", call '" + operation + "' on " +
           bytes(object_key) + ", " +
           (response_expected ? "wait response" : "one way") + ", from " +
           bytes(requesting_principal) + contexts();
  }

  /**
   * Writes the header to the stream.
   *
   * Sets the code set of this stream to
   * the code set, specfied in the header.
   *
   * @param out a stream to write into.
   */
  public void write(AbstractCdrOutput out)
  {
    ServiceContext.writeSequence(out, service_context);
    out.write_ulong(request_id);
    out.write_boolean(response_expected);
    out.write_sequence(object_key);
    out.write_string(operation);
    out.write_sequence(requesting_principal);

    out.setCodeSet(CodeSetServiceContext.find(service_context));
  }
}


text:
/**
 * Created by lawrencenyakiso on 2016/07/20.
 */
(function () {

    angular
        .module('confirm')
        .controller('ConfirmController', ['$scope', '$stateParams', 'requirements', 'User', '$timeout', '$mdDialog', ConfirmController])

    /**
     * Main Controller
     * @param $scope
     * @param $mdSidenav
     * @param avatarsService
     * @constructor
     */
    function ConfirmController($scope, $stateParams, requirements, User, $timeout, $mdDialog) {
        var self = this;

        //on exit..do not come back here, destroy the state
        if(requirements == false){
            //go to login

        }

        self.confirmUser = confirmUser;
        self.gotoLogin = false;
        self.confirmError = false;

        var confirmation_token = $stateParams.confirmation_token;
        var msp_id = $stateParams.msp_id;

        try{
            //ask user for a new password
            //confirm the user and take them to the login

        }catch(e){

        }

        function confirmUser(user){
            var new_password = user.password;
            var payload = {
                msp_id:msp_id,
                confirmation_token:confirmation_token,
                password: new_password
            }
            User.confirm(payload)
                .then(function(res){

                    self.gotoLogin = true;
                }).catch(function(e){

                self.confirmError = true;
            })
        }

    }
})();


text:
<?php

namespace Pimcore\Db;

class Profiler extends \Zend_Db_Profiler
{
    /**
     * The original label for this profiler.
     * @var string
     */
    protected $_label = null;

    /**
     * The label template for this profiler
     * @var string
     */
    protected $_label_template = '%label% (%totalCount% @ %totalDuration% sec)';

    /**
     * The message envelope holding the profiling summary
     * @var \Zend_Wildfire_Plugin_FirePhp_TableMessage
     */
    protected $_message = null;

    /**
     * The total time taken for all profiled queries.
     * @var float
     */
    protected $_totalElapsedTime = 0;

    protected $_totalQueries = 0;

    /**
     * @var resource
     */
    protected $logFile;

    /**
     * @var int
     */
    protected $connectionId;

    /**
     * @var array
     */
    protected $queries = array();

    /**
     * @param null $label
     */
    public function __construct($label = null)
    {
        $this->_label = $label;
        if(!$this->_label) {
            $this->_label = "Pimcore\\Db\\Profiler";
        }
    }

    /**
     * Enable or disable the profiler.  If $enable is false, the profiler
     * is disabled and will not log any queries sent to it.
     *
     * @param  boolean $enable
     * @return \Zend_Db_Profiler Provides a fluent interface
     */
    public function setEnabled($enable)
    {
        parent::setEnabled($enable);
        return $this;
    }

    /**
     * Intercept the query end and log the profiling data.
     *
     * @param  integer $queryId
     * @throws \Zend_Db_Profiler_Exception
     * @return void
     */
    public function queryEnd($queryId)
    {
        $state = parent::queryEnd($queryId);

        if (!$this->getEnabled() || $state == self::IGNORED) {
            return;
        }

        $profile = $this->getQueryProfile($queryId);
        $this->_totalElapsedTime += $profile->getElapsedSecs();
        $this->_totalQueries++;

        $logEntry = "Process: " . $this->getConnectionId() . " | DB Query (#" . $this->_totalQueries . "): " . (string)round($profile->getElapsedSecs(),5) . " | " . $profile->getQuery() . " | " . implode(",",$profile->getQueryParams());
        \Logger::debug($logEntry);

        $this->queries[] = array(
            "time" => $profile->getElapsedSecs(),
            "query" => $profile->getQuery() . " | " . implode(",",$profile->getQueryParams())
        );
    }

    /**
     *
     */
    public function __destruct() {
        if(is_resource($this->logFile)) {

            // write the total time at the end
            $message = "\n\n\n--------------------\n";
            $message .= "Total Elapsed Time: ". (string)round($this->_totalElapsedTime,5) . "\n";
            $message .= "Total Queries: " . $this->_totalQueries . "\n";
            $message .= "Top Queries: \n";

            uasort($this->queries, function ($x, $y) {
                $a = $x["time"];
                $b = $y["time"];

                if ($a == $b) {
                    return 0;
                }
                return ($b < $a) ? -1 : 1;
            });

            $count = 0;
            foreach ($this->queries as $key => $value) {
                $count++;
                if($count > 5) {
                    break;
                }

                $message .= "#" . $key . ":  " . (string)round($value["time"],5) . " | " . $value["query"] . "\n";
            }
            $message .= "\n";

            $message .= "\n--------------------\n\n";

            fwrite($this->logFile, $message);

            fclose($this->logFile);
        }
    }

    /**
     * Update the label of the message holding the profile info.
     *
     * @return void
     */
    protected function updateMessageLabel()
    {
        if (!$this->_message) {
            return;
        }
        $this->_message->setLabel(str_replace(array('%label%',
                                                    '%totalCount%',
                                                    '%totalDuration%'),
                                              array($this->_label,
                                                    $this->getTotalNumQueries(),
                                                    (string)round($this->_totalElapsedTime,5)),
                                              $this->_label_template));
    }

    /**
     * @param int $connectionId
     */
    public function setConnectionId($connectionId)
    {
        $this->connectionId = $connectionId;
    }

    /**
     * @return int
     */
    public function getConnectionId()
    {
        return $this->connectionId;
    }
}


text:
function convertbinary(outname,inname)
% Accepts a binary image in inname and writes out an assembler file
% of image data
global pos I2

A=double(imread(inname));
fid=fopen(outname,'w');
if (fid<=0)
    return
end
fprintf(fid,'; Generated from %s\n',inname);
fprintf(fid,'.globl fontdata16\n');
fprintf(fid,'.globl fontpos16\n');
fprintf(fid,' .align 32\n');
fprintf(fid,'fontpos16:\n');

% Each character is stored in a length 16 vector of words
[a,b,c]=size(A);
if (a~=16)
    error('Image must be 16 down for font conversion')
end

% Now we search through for lines of all white pixels
I=sum(sum(A,3));
I2=(I==3*255*16);

% Now we search through for horontal lines of all white pixels
Z=sum(sum(255-A,3),2);

% Replace wide gaps between letters with single pixel gap
I3=I2(1:end-1) & I2(2:end);
A(:,I3,:)=[];

% Move black pixels to top
A(Z==0,:,:)=[];
A(size(A,1)+1:16, :,:)=255;

[a,b,c]=size(A);
if (a~=16)
    error('Image must be 16 down for font conversion')
end

% Now we search through for lines of all white pixels
I=sum(sum(A,3));
I2=(I==3*255*16);

% We want to start off with pos pointing at the first black of a character
% and with letterstart at the pos of the start of the letter
pos=1;
findblack

letterend=[];

for letter=1:(128-32)
    % Scan for the beginning of the white
    findwhite
    posa=pos;
    letterend(letter)=floor((posa+pos)/2);
    findblack

    fprintf(fid,'\t.half\t0x%x\n',letterend(letter));

    % Lets display each of these
    if (letter>1)
        subplot(10,10,letter)
        image(uint8(A(:,letterend(letter-1):letterend(letter),:)))
        axis image
        drawnow
    end
end

fprintf(fid,'fontdata16:\n');

for y=1:b
        sum=0;
        for x=16:-1:1
            sum=sum+(A(x,y,1)>50)*(2^(16-x));
        end
        fprintf(fid,'\t.half\t0x%x\n',sum);
end

fclose(fid);

function findblack
global pos I2
% Scan through until we find a black position
% stop with pos==black line
while(I2(pos)==1)
    pos=pos+1;
end

function findwhite
global pos I2
% Scan through until we find a black position
% stop with pos==black line
while(I2(pos)==0)
    pos=pos+1;
end


text:
@interface UIScrollView (IDL_ViewGroup) <IDLDrawableDelegate>

@end


text:
package aio

import java.nio.channels.AsynchronousChannelGroup
import java.util.Collections
import java.util.concurrent.{ AbstractExecutorService, Executors, ScheduledExecutorService, TimeUnit }

import scala.annotation.implicitNotFound
import scala.concurrent.ExecutionContext
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.ExecutionContextExecutorService

/**
 *
 */
package object concurrent {

  object ExecutionContextExecutorServiceBridge {

    final def apply(context: ExecutionContext): ExecutionContextExecutorService = context match {
      case null ⇒ throw null
      case context: ExecutionContextExecutorService ⇒ context
      case other ⇒ new AbstractExecutorService with ExecutionContextExecutorService {
        @inline override def prepare: ExecutionContext = other
        @inline override def isShutdown = false
        @inline override def isTerminated = false
        @inline override def shutdown = ()
        @inline override def shutdownNow = Collections.emptyList[Runnable]
        @inline override def execute(runnable: Runnable): Unit = other execute runnable
        @inline override def reportFailure(t: Throwable): Unit = other reportFailure t
        @inline override def awaitTermination(length: Long, unit: TimeUnit): Boolean = false
      }
    }

  }

  object Implicits {

    implicit final val globalexecutioncontext: ExecutionContextExecutorService = ExecutionContextExecutorServiceBridge(global)

    implicit final val globalscheduledexecutor: ScheduledExecutorService = Executors.newScheduledThreadPool(2)

    implicit final val globalasynchronouschannelgroup: AsynchronousChannelGroup = AsynchronousChannelGroup.withThreadPool(globalexecutioncontext)

  }
}


text:
<?php
/**
 * Disable error reporting
 *
 * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging
 */
error_reporting(0);

$basepath = dirname(__FILE__);

function get_file($path) {

	if ( function_exists('realpath') )
		$path = realpath($path);

	if ( ! $path || ! @is_file($path) )
		return false;

	return @file_get_contents($path);
}

$expires_offset = 31536000;

header('Content-Type: application/x-javascript; charset=UTF-8');
header('Vary: Accept-Encoding'); // Handle proxies
header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
header("Cache-Control: public, max-age=$expires_offset");

if ( isset($_GET['c']) && 1 == $_GET['c'] && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
	&& false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {

	header('Content-Encoding: gzip');
	echo $file;
} else {
	echo get_file($basepath . '/tiny_mce.js');
}
exit;


text:
    returnType functionName() \
    { \
        helperName##_VALIDATE.addInvocation(*this); \
        \
        return helperName##_PROBE(); \
    }\
    \
    ::mockpp::MockProbe<returnType> helperName##_PROBE; \
    ::mockpp::MockValidator<returnType> helperName##_VALIDATE;

#define MOCK_POLY_FUNCTION_VOID(functionName, helperName) \
	void functionName() \
    { \
        helperName##_VALIDATE.addInvocation(*this); \
        \
        return helperName##_PROBE(); \
    }\
    \
    ::mockpp::MockProbe<void> helperName##_PROBE; \
    ::mockpp::MockValidator<void> helperName##_VALIDATE;

#define MOCK_POLY_FUNCTION_VOID_ARGS(functionName,helperName,...) \
	void functionName(MAKE_PARAMS(__VA_ARGS__)) \
    { \
        helperName##_VALIDATE.addInvocation(*this, MAKE_ARGS(__VA_ARGS__)); \
        \
        return helperName##_PROBE(MAKE_ARGS(__VA_ARGS__)); \
    }\
    \
    ::mockpp::MockProbe<void,REMOVE_REFS(__VA_ARGS__)> helperName##_PROBE; \
    ::mockpp::MockValidator<void,REMOVE_REFS(__VA_ARGS__)> helperName##_VALIDATE;

#define MOCK_POLY_FUNCTION_ARGS(returnType,functionName,helperName,...) \
	returnType functionName(MAKE_PARAMS(__VA_ARGS__)) \
    { \
        helperName##_VALIDATE.addInvocation(*this, MAKE_ARGS(__VA_ARGS__)); \
        \
        return helperName##_PROBE(MAKE_ARGS(__VA_ARGS__)); \
    }\
    \
    ::mockpp::MockProbe<returnType,REMOVE_REFS(__VA_ARGS__)> helperName##_PROBE; \
    ::mockpp::MockValidator<returnType,REMOVE_REFS(__VA_ARGS__)> helperName##_VALIDATE;

#define MOCK_POLY_CONST_FUNCTION(returnType, functionName, helperName) \
    returnType functionName() const \
    { \
        helperName##_VALIDATE.addInvocation(*this); \
        \
        return helperName##_PROBE(); \
    }\
    \
    mutable ::mockpp::MockProbe<returnType> helperName##_PROBE; \
    mutable ::mockpp::MockValidator<returnType> helperName##_VALIDATE;

#define MOCK_POLY_CONST_FUNCTION_VOID(functionName, helperName) \
	void functionName() const \
    { \
        helperName##_VALIDATE.addInvocation(*this); \
        \
        return helperName##_PROBE(); \
    }\
    \
    mutable ::mockpp::MockProbe<void> helperName##_PROBE; \
    mutable ::mockpp::MockValidator<void> helperName##_VALIDATE;

#define MOCK_POLY_CONST_FUNCTION_VOID_ARGS(functionName,helperName,...) \
	void functionName(MAKE_PARAMS(__VA_ARGS__)) const \
    { \
        helperName##_VALIDATE.addInvocation(*this, MAKE_ARGS(__VA_ARGS__)); \
        \
        return helperName##_PROBE(MAKE_ARGS(__VA_ARGS__)); \
    }\
    \
    mutable ::mockpp::MockProbe<void,REMOVE_REFS(__VA_ARGS__)> helperName##_PROBE; \
    mutable ::mockpp::MockValidator<void,REMOVE_REFS(__VA_ARGS__)> helperName##_VALIDATE;

#define MOCK_POLY_CONST_FUNCTION_ARGS(returnType,functionName,helperName,...) \
	returnType functionName(MAKE_PARAMS(__VA_ARGS__)) const \
    { \
        helperName##_VALIDATE.addInvocation(*this, MAKE_ARGS(__VA_ARGS__)); \
        \
        return helperName##_PROBE(MAKE_ARGS(__VA_ARGS__)); \
    }\
    \
    mutable ::mockpp::MockProbe<returnType,REMOVE_REFS(__VA_ARGS__)> helperName##_PROBE; \
    mutable ::mockpp::MockValidator<returnType,REMOVE_REFS(__VA_ARGS__)> helperName##_VALIDATE;

#define MOCK_FUNCTION(returnType, functionName) \
    MOCK_POLY_FUNCTION(returnType, functionName, functionName)

#define MOCK_FUNCTION_VOID(functionName) \
    MOCK_POLY_FUNCTION_VOID(functionName, functionName)

#define MOCK_FUNCTION_VOID_ARGS(functionName,...) \
    MOCK_POLY_FUNCTION_VOID_ARGS(functionName,functionName,__VA_ARGS__)

#define MOCK_FUNCTION_ARGS(returnType,functionName,...) \
    MOCK_POLY_FUNCTION_ARGS(returnType,functionName,functionName,__VA_ARGS__)

#define MOCK_CONST_FUNCTION(returnType, functionName) \
    MOCK_POLY_CONST_FUNCTION(returnType,functionName,functionName)

#define MOCK_CONST_FUNCTION_VOID(functionName) \
    MOCK_POLY_CONST_FUNCTION_VOID(functionName,functionName)

#define MOCK_CONST_FUNCTION_VOID_ARGS(functionName,...) \
    MOCK_POLY_CONST_FUNCTION_VOID_ARGS(functionName,functionName,__VA_ARGS__)

#define MOCK_CONST_FUNCTION_ARGS(returnType,functionName,...) \
    MOCK_POLY_CONST_FUNCTION_ARGS(returnType,functionName,functionName,__VA_ARGS__)

#define PROBE(obj, method) (obj).method##_PROBE
#define VALIDATE(obj, method) (obj).method##_VALIDATE.validationBuilder(obj)

#endif //MOCKPP_HELPERS_HEADER_GUARD


text:
simplegridtest
==============

Test site using SimpleGrid HTML CSS responsive layout, jQuery and other goodies


text:
/**
 * Bootstrap tabs: which tab is selected?
 */
$("#tabs-718985").click(function(e){
	$(this).tab("show");
});

// store the currently selected tab in the hash value
$("ul.nav-tabs > li > a").on("shown.bs.tab", function(e) {
	var id = $(e.target).attr("href").substr(1);
	window.location.hash = id;
});

// on load of the page: switch to the currently selected tab
var hash = window.location.hash;
$('#tabs-718985 a[href="' + hash + '"]').tab("show");

// reset button functionality, fixes #711
$(":submit").click(function(e){
	var name = $(this).attr("name");
	var value = $(this).val();
	var form = $(this).parents("form");
	$("<input />").attr("type", "hidden")
		.attr("name", name)
		.attr("value", value)
		.appendTo(form);

	// submit the form
	form.submit();

});


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO.Pipes;
using System.IO;

namespace ReceiveData
{
    class Program
    {
        static void Main(string[] args)
        {
            using (NamedPipeClientStream pipeStream = new NamedPipeClientStream("testpipe"))
            {
                pipeStream.Connect();
                //在client读取server端写的数据
                using (StreamReader rdr = new StreamReader(pipeStream))
                {
                    string temp;
                    while ((temp = rdr.ReadLine()) != "")
                    {
                        Console.WriteLine("{0}:{1}", DateTime.Now, temp);
                    }
                }
            }

            Console.Read();

        }
    }
}


text:
from .. import LinearExplainer
from .. import KernelExplainer
from .. import SamplingExplainer
from .. import TreeExplainer
from .. import DeepExplainer
from .. import GradientExplainer
from .. import kmeans
from ..explainers import other
from .models import KerasWrap
import numpy as np
import sklearn

def linear_shap_corr(model, data):
    """ Linear SHAP (corr 1000)
    """
    return LinearExplainer(model, data, feature_dependence="correlation", nsamples=1000).shap_values

def linear_shap_ind(model, data):
    """ Linear SHAP (ind)
    """
    return LinearExplainer(model, data, feature_dependence="independent").shap_values

def coef(model, data):
    """ Coefficents
    """
    return other.CoefficentExplainer(model).attributions

def random(model, data):
    """ Random
    color = #777777
    linestyle = solid
    """
    return other.RandomExplainer().attributions

def kernel_shap_1000_meanref(model, data):
    """ Kernel SHAP 1000 mean ref.
    color = red_blue_circle(0.5)
    linestyle = solid
    """
    return lambda X: KernelExplainer(model.predict, kmeans(data, 1)).shap_values(X, nsamples=1000, l1_reg=0)

def sampling_shap_1000(model, data):
    """ IME 1000
    color = red_blue_circle(0.5)
    linestyle = dashed
    """
    return lambda X: SamplingExplainer(model.predict, data).shap_values(X, nsamples=1000)

def tree_shap_tree_path_dependent(model, data):
    """ TreeExplainer
    color = red_blue_circle(0)
    linestyle = solid
    """
    return TreeExplainer(model, feature_dependence="tree_path_dependent").shap_values

def tree_shap_independent_200(model, data):
    """ TreeExplainer (independent)
    color = red_blue_circle(0)
    linestyle = dashed
    """
    data_subsample = sklearn.utils.resample(data, replace=False, n_samples=min(200, data.shape[0]), random_state=0)
    return TreeExplainer(model, data_subsample, feature_dependence="independent").shap_values

def mean_abs_tree_shap(model, data):
    """ mean(|TreeExplainer|)
    color = red_blue_circle(0.25)
    linestyle = solid
    """
    def f(X):
        v = TreeExplainer(model).shap_values(X)
        if isinstance(v, list):
            return [np.tile(np.abs(sv).mean(0), (X.shape[0], 1)) for sv in v]
        else:
            return np.tile(np.abs(v).mean(0), (X.shape[0], 1))
    return f

def saabas(model, data):
    """ Saabas
    color = red_blue_circle(0)
    linestyle = dotted
    """
    return lambda X: TreeExplainer(model).shap_values(X, approximate=True)

def tree_gain(model, data):
    """ Gain/Gini Importance
    color = red_blue_circle(0.25)
    linestyle = dotted
    """
    return other.TreeGainExplainer(model).attributions

def lime_tabular_regression_1000(model, data):
    """ LIME Tabular 1000
    color = red_blue_circle(0.75)
    """
    return lambda X: other.LimeTabularExplainer(model.predict, data, mode="regression").attributions(X, nsamples=1000)

def lime_tabular_classification_1000(model, data):
    """ LIME Tabular 1000
    color = red_blue_circle(0.75)
    """
    return lambda X: other.LimeTabularExplainer(model.predict_proba, data, mode="classification").attributions(X, nsamples=1000)[1]

def maple(model, data):
    """ MAPLE
    color = red_blue_circle(0.6)
    """
    return lambda X: other.MapleExplainer(model.predict, data).attributions(X, multiply_by_input=False)

def tree_maple(model, data):
    """ Tree MAPLE
    color = red_blue_circle(0.6)
    linestyle = dashed
    """
    return lambda X: other.TreeMapleExplainer(model, data).attributions(X, multiply_by_input=False)

def deep_shap(model, data):
    """ Deep SHAP (DeepLIFT)
    """
    if isinstance(model, KerasWrap):
        model = model.model
    explainer = DeepExplainer(model, kmeans(data, 1).data)
    def f(X):
        phi = explainer.shap_values(X)
        if type(phi) is list and len(phi) == 1:
            return phi[0]
        else:
            return phi

    return f

def expected_gradients(model, data):
    """ Expected Gradients
    """
    if isinstance(model, KerasWrap):
        model = model.model
    explainer = GradientExplainer(model, data)
    def f(X):
        phi = explainer.shap_values(X)
        if type(phi) is list and len(phi) == 1:
            return phi[0]
        else:
            return phi

    return f