text:
#ifndef __PERF_RECORD_H
#define __PERF_RECORD_H

#include <limits.h>
#include <stdio.h>

#include "../perf.h"
#include "map.h"
#include "build-id.h"
#include "perf_regs.h"

struct mmap_event {
	struct perf_event_header header;
	u32 pid, tid;
	u64 start;
	u64 len;
	u64 pgoff;
	char filename[PATH_MAX];
};

struct mmap2_event {
	struct perf_event_header header;
	u32 pid, tid;
	u64 start;
	u64 len;
	u64 pgoff;
	u32 maj;
	u32 min;
	u64 ino;
	u64 ino_generation;
	u32 prot;
	u32 flags;
	char filename[PATH_MAX];
};

struct comm_event {
	struct perf_event_header header;
	u32 pid, tid;
	char comm[16];
};

struct fork_event {
	struct perf_event_header header;
	u32 pid, ppid;
	u32 tid, ptid;
	u64 time;
};

struct lost_event {
	struct perf_event_header header;
	u64 id;
	u64 lost;
};

struct lost_samples_event {
	struct perf_event_header header;
	u64 lost;
};

/*
 * PERF_FORMAT_ENABLED | PERF_FORMAT_RUNNING | PERF_FORMAT_ID
 */
struct read_event {
	struct perf_event_header header;
	u32 pid, tid;
	u64 value;
	u64 time_enabled;
	u64 time_running;
	u64 id;
};

struct throttle_event {
	struct perf_event_header header;
	u64 time;
	u64 id;
	u64 stream_id;
};

#define PERF_SAMPLE_MASK				\
	(PERF_SAMPLE_IP | PERF_SAMPLE_TID |		\
	 PERF_SAMPLE_TIME | PERF_SAMPLE_ADDR |		\
	PERF_SAMPLE_ID | PERF_SAMPLE_STREAM_ID |	\
	 PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD |		\
	 PERF_SAMPLE_IDENTIFIER)

/* perf sample has 16 bits size limit */
#define PERF_SAMPLE_MAX_SIZE (1 << 16)

struct sample_event {
	struct perf_event_header        header;
	u64 array[];
};

struct regs_dump {
	u64 abi;
	u64 mask;
	u64 *regs;

	/* Cached values/mask filled by first register access. */
	u64 cache_regs[PERF_REGS_MAX];
	u64 cache_mask;
};

struct stack_dump {
	u16 offset;
	u64 size;
	char *data;
};

struct sample_read_value {
	u64 value;
	u64 id;
};

struct sample_read {
	u64 time_enabled;
	u64 time_running;
	union {
		struct {
			u64 nr;
			struct sample_read_value *values;
		} group;
		struct sample_read_value one;
	};
};

struct ip_callchain {
	u64 nr;
	u64 ips[0];
};

struct branch_flags {
	u64 mispred:1;
	u64 predicted:1;
	u64 in_tx:1;
	u64 abort:1;
	u64 cycles:16;
	u64 reserved:44;
};

struct branch_entry {
	u64			from;
	u64			to;
	struct branch_flags	flags;
};

struct branch_stack {
	u64			nr;
	struct branch_entry	entries[0];
};

enum {
	PERF_IP_FLAG_BRANCH		= 1ULL << 0,
	PERF_IP_FLAG_CALL		= 1ULL << 1,
	PERF_IP_FLAG_RETURN		= 1ULL << 2,
	PERF_IP_FLAG_CONDITIONAL	= 1ULL << 3,
	PERF_IP_FLAG_SYSCALLRET		= 1ULL << 4,
	PERF_IP_FLAG_ASYNC		= 1ULL << 5,
	PERF_IP_FLAG_INTERRUPT		= 1ULL << 6,
	PERF_IP_FLAG_TX_ABORT		= 1ULL << 7,
	PERF_IP_FLAG_TRACE_BEGIN	= 1ULL << 8,
	PERF_IP_FLAG_TRACE_END		= 1ULL << 9,
	PERF_IP_FLAG_IN_TX		= 1ULL << 10,
};

#define PERF_IP_FLAG_CHARS "bcrosyiABEx"

#define PERF_BRANCH_MASK		(\
	PERF_IP_FLAG_BRANCH		|\
	PERF_IP_FLAG_CALL		|\
	PERF_IP_FLAG_RETURN		|\
	PERF_IP_FLAG_CONDITIONAL	|\
	PERF_IP_FLAG_SYSCALLRET		|\
	PERF_IP_FLAG_ASYNC		|\
	PERF_IP_FLAG_INTERRUPT		|\
	PERF_IP_FLAG_TX_ABORT		|\
	PERF_IP_FLAG_TRACE_BEGIN	|\
	PERF_IP_FLAG_TRACE_END)

struct perf_sample {
	u64 ip;
	u32 pid, tid;
	u64 time;
	u64 addr;
	u64 id;
	u64 stream_id;
	u64 period;
	u64 weight;
	u64 transaction;
	u32 cpu;
	u32 raw_size;
	u64 data_src;
	u32 flags;
	u16 insn_len;
	u8  cpumode;
	void *raw_data;
	struct ip_callchain *callchain;
	struct branch_stack *branch_stack;
	struct regs_dump  user_regs;
	struct regs_dump  intr_regs;
	struct stack_dump user_stack;
	struct sample_read read;
};

#define PERF_MEM_DATA_SRC_NONE \
	(PERF_MEM_S(OP, NA) |\
	 PERF_MEM_S(LVL, NA) |\
	 PERF_MEM_S(SNOOP, NA) |\
	 PERF_MEM_S(LOCK, NA) |\
	 PERF_MEM_S(TLB, NA))

struct build_id_event {
	struct perf_event_header header;
	pid_t			 pid;
	u8			 build_id[PERF_ALIGN(BUILD_ID_SIZE, sizeof(u64))];
	char			 filename[];
};

enum perf_user_event_type { /* above any possible kernel type */
	PERF_RECORD_USER_TYPE_START		= 64,
	PERF_RECORD_HEADER_ATTR			= 64,
	PERF_RECORD_HEADER_EVENT_TYPE		= 65, /* depreceated */
	PERF_RECORD_HEADER_TRACING_DATA		= 66,
	PERF_RECORD_HEADER_BUILD_ID		= 67,
	PERF_RECORD_FINISHED_ROUND		= 68,
	PERF_RECORD_ID_INDEX			= 69,
	PERF_RECORD_AUXTRACE_INFO		= 70,
	PERF_RECORD_AUXTRACE			= 71,
	PERF_RECORD_AUXTRACE_ERROR		= 72,
	PERF_RECORD_THREAD_MAP			= 73,
	PERF_RECORD_CPU_MAP			= 74,
	PERF_RECORD_STAT_CONFIG			= 75,
	PERF_RECORD_STAT			= 76,
	PERF_RECORD_STAT_ROUND			= 77,
	PERF_RECORD_EVENT_UPDATE		= 78,
	PERF_RECORD_TIME_CONV			= 79,
	PERF_RECORD_HEADER_MAX
};

enum auxtrace_error_type {
	PERF_AUXTRACE_ERROR_ITRACE  = 1,
	PERF_AUXTRACE_ERROR_MAX
};

/*
 * The kernel collects the number of events it couldn't send in a stretch and
 * when possible sends this number in a PERF_RECORD_LOST event. The number of
 * such "chunks" of lost events is stored in .nr_events[PERF_EVENT_LOST] while
 * total_lost tells exactly how many events the kernel in fact lost, i.e. it is
 * the sum of all struct lost_event.lost fields reported.
 *
 * The kernel discards mixed up samples and sends the number in a
 * PERF_RECORD_LOST_SAMPLES event. The number of lost-samples events is stored
 * in .nr_events[PERF_RECORD_LOST_SAMPLES] while total_lost_samples tells
 * exactly how many samples the kernel in fact dropped, i.e. it is the sum of
 * all struct lost_samples_event.lost fields reported.
 *
 * The total_period is needed because by default auto-freq is used, so
 * multipling nr_events[PERF_EVENT_SAMPLE] by a frequency isn't possible to get
 * the total number of low level events, it is necessary to to sum all struct
 * sample_event.period and stash the result in total_period.
 */
struct events_stats {
	u64 total_period;
	u64 total_non_filtered_period;
	u64 total_lost;
	u64 total_lost_samples;
	u64 total_aux_lost;
	u64 total_invalid_chains;
	u32 nr_events[PERF_RECORD_HEADER_MAX];
	u32 nr_non_filtered_samples;
	u32 nr_lost_warned;
	u32 nr_unknown_events;
	u32 nr_invalid_chains;
	u32 nr_unknown_id;
	u32 nr_unprocessable_samples;
	u32 nr_auxtrace_errors[PERF_AUXTRACE_ERROR_MAX];
	u32 nr_proc_map_timeout;
};

enum {
	PERF_CPU_MAP__CPUS = 0,
	PERF_CPU_MAP__MASK = 1,
};

struct cpu_map_entries {
	u16	nr;
	u16	cpu[];
};

struct cpu_map_mask {
	u16	nr;
	u16	long_size;
	unsigned long mask[];
};

struct cpu_map_data {
	u16	type;
	char	data[];
};

struct cpu_map_event {
	struct perf_event_header	header;
	struct cpu_map_data		data;
};

struct attr_event {
	struct perf_event_header header;
	struct perf_event_attr attr;
	u64 id[];
};

enum {
	PERF_EVENT_UPDATE__UNIT  = 0,
	PERF_EVENT_UPDATE__SCALE = 1,
	PERF_EVENT_UPDATE__NAME  = 2,
	PERF_EVENT_UPDATE__CPUS  = 3,
};

struct event_update_event_cpus {
	struct cpu_map_data cpus;
};

struct event_update_event_scale {
	double scale;
};

struct event_update_event {
	struct perf_event_header header;
	u64 type;
	u64 id;

	char data[];
};

#define MAX_EVENT_NAME 64

struct perf_trace_event_type {
	u64	event_id;
	char	name[MAX_EVENT_NAME];
};

struct event_type_event {
	struct perf_event_header header;
	struct perf_trace_event_type event_type;
};

struct tracing_data_event {
	struct perf_event_header header;
	u32 size;
};

struct id_index_entry {
	u64 id;
	u64 idx;
	u64 cpu;
	u64 tid;
};

struct id_index_event {
	struct perf_event_header header;
	u64 nr;
	struct id_index_entry entries[0];
};

struct auxtrace_info_event {
	struct perf_event_header header;
	u32 type;
	u32 reserved__; /* For alignment */
	u64 priv[];
};

struct auxtrace_event {
	struct perf_event_header header;
	u64 size;
	u64 offset;
	u64 reference;
	u32 idx;
	u32 tid;
	u32 cpu;
	u32 reserved__; /* For alignment */
};

#define MAX_AUXTRACE_ERROR_MSG 64

struct auxtrace_error_event {
	struct perf_event_header header;
	u32 type;
	u32 code;
	u32 cpu;
	u32 pid;
	u32 tid;
	u32 reserved__; /* For alignment */
	u64 ip;
	char msg[MAX_AUXTRACE_ERROR_MSG];
};

struct aux_event {
	struct perf_event_header header;
	u64	aux_offset;
	u64	aux_size;
	u64	flags;
};

struct itrace_start_event {
	struct perf_event_header header;
	u32 pid, tid;
};

struct context_switch_event {
	struct perf_event_header header;
	u32 next_prev_pid;
	u32 next_prev_tid;
};

struct thread_map_event_entry {
	u64	pid;
	char	comm[16];
};

struct thread_map_event {
	struct perf_event_header	header;
	u64				nr;
	struct thread_map_event_entry	entries[];
};

enum {
	PERF_STAT_CONFIG_TERM__AGGR_MODE	= 0,
	PERF_STAT_CONFIG_TERM__INTERVAL		= 1,
	PERF_STAT_CONFIG_TERM__SCALE		= 2,
	PERF_STAT_CONFIG_TERM__MAX		= 3,
};

struct stat_config_event_entry {
	u64	tag;
	u64	val;
};

struct stat_config_event {
	struct perf_event_header	header;
	u64				nr;
	struct stat_config_event_entry	data[];
};

struct stat_event {
	struct perf_event_header	header;

	u64	id;
	u32	cpu;
	u32	thread;

	union {
		struct {
			u64 val;
			u64 ena;
			u64 run;
		};
		u64 values[3];
	};
};

enum {
	PERF_STAT_ROUND_TYPE__INTERVAL	= 0,
	PERF_STAT_ROUND_TYPE__FINAL	= 1,
};

struct stat_round_event {
	struct perf_event_header	header;
	u64				type;
	u64				time;
};

struct time_conv_event {
	struct perf_event_header header;
	u64 time_shift;
	u64 time_mult;
	u64 time_zero;
};

union perf_event {
	struct perf_event_header	header;
	struct mmap_event		mmap;
	struct mmap2_event		mmap2;
	struct comm_event		comm;
	struct fork_event		fork;
	struct lost_event		lost;
	struct lost_samples_event	lost_samples;
	struct read_event		read;
	struct throttle_event		throttle;
	struct sample_event		sample;
	struct attr_event		attr;
	struct event_update_event	event_update;
	struct event_type_event		event_type;
	struct tracing_data_event	tracing_data;
	struct build_id_event		build_id;
	struct id_index_event		id_index;
	struct auxtrace_info_event	auxtrace_info;
	struct auxtrace_event		auxtrace;
	struct auxtrace_error_event	auxtrace_error;
	struct aux_event		aux;
	struct itrace_start_event	itrace_start;
	struct context_switch_event	context_switch;
	struct thread_map_event		thread_map;
	struct cpu_map_event		cpu_map;
	struct stat_config_event	stat_config;
	struct stat_event		stat;
	struct stat_round_event		stat_round;
	struct time_conv_event		time_conv;
};

void perf_event__print_totals(void);

struct perf_tool;
struct thread_map;
struct cpu_map;
struct perf_stat_config;
struct perf_counts_values;

typedef int (*perf_event__handler_t)(struct perf_tool *tool,
				     union perf_event *event,
				     struct perf_sample *sample,
				     struct machine *machine);

int perf_event__synthesize_thread_map(struct perf_tool *tool,
				      struct thread_map *threads,
				      perf_event__handler_t process,
				      struct machine *machine, bool mmap_data,
				      unsigned int proc_map_timeout);
int perf_event__synthesize_thread_map2(struct perf_tool *tool,
				      struct thread_map *threads,
				      perf_event__handler_t process,
				      struct machine *machine);
int perf_event__synthesize_cpu_map(struct perf_tool *tool,
				   struct cpu_map *cpus,
				   perf_event__handler_t process,
				   struct machine *machine);
int perf_event__synthesize_threads(struct perf_tool *tool,
				   perf_event__handler_t process,
				   struct machine *machine, bool mmap_data,
				   unsigned int proc_map_timeout);
int perf_event__synthesize_kernel_mmap(struct perf_tool *tool,
				       perf_event__handler_t process,
				       struct machine *machine);
int perf_event__synthesize_stat_config(struct perf_tool *tool,
				       struct perf_stat_config *config,
				       perf_event__handler_t process,
				       struct machine *machine);
void perf_event__read_stat_config(struct perf_stat_config *config,
				  struct stat_config_event *event);
int perf_event__synthesize_stat(struct perf_tool *tool,
				u32 cpu, u32 thread, u64 id,
				struct perf_counts_values *count,
				perf_event__handler_t process,
				struct machine *machine);
int perf_event__synthesize_stat_round(struct perf_tool *tool,
				      u64 time, u64 type,
				      perf_event__handler_t process,
				      struct machine *machine);
int perf_event__synthesize_modules(struct perf_tool *tool,
				   perf_event__handler_t process,
				   struct machine *machine);

int perf_event__process_comm(struct perf_tool *tool,
			     union perf_event *event,
			     struct perf_sample *sample,
			     struct machine *machine);
int perf_event__process_lost(struct perf_tool *tool,
			     union perf_event *event,
			     struct perf_sample *sample,
			     struct machine *machine);
int perf_event__process_lost_samples(struct perf_tool *tool,
				     union perf_event *event,
				     struct perf_sample *sample,
				     struct machine *machine);
int perf_event__process_aux(struct perf_tool *tool,
			    union perf_event *event,
			    struct perf_sample *sample,
			    struct machine *machine);
int perf_event__process_itrace_start(struct perf_tool *tool,
				     union perf_event *event,
				     struct perf_sample *sample,
				     struct machine *machine);
int perf_event__process_switch(struct perf_tool *tool,
			       union perf_event *event,
			       struct perf_sample *sample,
			       struct machine *machine);
int perf_event__process_mmap(struct perf_tool *tool,
			     union perf_event *event,
			     struct perf_sample *sample,
			     struct machine *machine);
int perf_event__process_mmap2(struct perf_tool *tool,
			     union perf_event *event,
			     struct perf_sample *sample,
			     struct machine *machine);
int perf_event__process_fork(struct perf_tool *tool,
			     union perf_event *event,
			     struct perf_sample *sample,
			     struct machine *machine);
int perf_event__process_exit(struct perf_tool *tool,
			     union perf_event *event,
			     struct perf_sample *sample,
			     struct machine *machine);
int perf_event__process(struct perf_tool *tool,
			union perf_event *event,
			struct perf_sample *sample,
			struct machine *machine);

struct addr_location;

int machine__resolve(struct machine *machine, struct addr_location *al,
		     struct perf_sample *sample);

void addr_location__put(struct addr_location *al);

struct thread;

bool is_bts_event(struct perf_event_attr *attr);
bool sample_addr_correlates_sym(struct perf_event_attr *attr);
void thread__resolve(struct thread *thread, struct addr_location *al,
		     struct perf_sample *sample);

const char *perf_event__name(unsigned int id);

size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type,
				     u64 read_format);
int perf_event__synthesize_sample(union perf_event *event, u64 type,
				  u64 read_format,
				  const struct perf_sample *sample,
				  bool swapped);

pid_t perf_event__synthesize_comm(struct perf_tool *tool,
				  union perf_event *event, pid_t pid,
				  perf_event__handler_t process,
				  struct machine *machine);

int perf_event__synthesize_mmap_events(struct perf_tool *tool,
				       union perf_event *event,
				       pid_t pid, pid_t tgid,
				       perf_event__handler_t process,
				       struct machine *machine,
				       bool mmap_data,
				       unsigned int proc_map_timeout);

size_t perf_event__fprintf_comm(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_mmap(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_mmap2(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_task(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_aux(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_itrace_start(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_switch(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_thread_map(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_cpu_map(union perf_event *event, FILE *fp);
size_t perf_event__fprintf(union perf_event *event, FILE *fp);

u64 kallsyms__get_function_start(const char *kallsyms_filename,
				 const char *symbol_name);

void *cpu_map_data__alloc(struct cpu_map *map, size_t *size, u16 *type, int *max);
void  cpu_map_data__synthesize(struct cpu_map_data *data, struct cpu_map *map,
			       u16 type, int max);
#endif /* __PERF_RECORD_H */


text:
package fr.eisti.domain;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.Set;

@Entity
public class Course {
    private int id;
    private String name;
    private String subject;
    private int duration;
    private Date start;
    private byte status;
    private Matter matter;
    private Room room;
    private User user;
    private Set<UserCourse> userCourses;

    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "name")
    @NotNull
    @Size(min = 3, max = 255)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "subject")
    @NotNull
    @Size(min = 3, max = 255)
    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    @Basic
    @Column(name = "duration")
    @NotNull
    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    @Basic
    @Column(name = "start")
    @NotNull
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = "dd/mm/yyyy hh:mm")
    public Date getStart() {
        return start;
    }

    public void setStart(Date start) {
        this.start = start;
    }

    @Basic
    @Column(name = "status")
    @NotNull
    public byte getStatus() {
        return status;
    }

    public void setStatus(byte status) {
        this.status = status;
    }

    @ManyToOne
    @JoinColumn(name = "MatterID", referencedColumnName = "ID", nullable = false)
    @JsonBackReference
    public Matter getMatter() {
        return matter;
    }

    public void setMatter(Matter matter) {
        this.matter = matter;
    }

    @ManyToOne
    @JoinColumn(name = "RoomID", referencedColumnName = "ID", nullable = false)
    public Room getRoom() {
        return room;
    }

    public void setRoom(Room room) {
        this.room = room;
    }

    @ManyToOne
    @JoinColumn(name = "UserID", referencedColumnName = "ID", nullable = false)
    @JsonIgnore
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "pk.course", cascade = CascadeType.ALL)
    @JsonIgnore
    public Set<UserCourse> getUserCourses() {
        return userCourses;
    }

    public void setUserCourses(Set<UserCourse> userCourses) {
        this.userCourses = userCourses;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Course course = (Course) o;

        if (id != course.id) return false;
        if (duration != course.duration) return false;
        if (status != course.status) return false;
        if (name != null ? !name.equals(course.name) : course.name != null) return false;
        if (subject != null ? !subject.equals(course.subject) : course.subject != null) return false;
        return start != null ? start.equals(course.start) : course.start == null;

    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (subject != null ? subject.hashCode() : 0);
        result = 31 * result + duration;
        result = 31 * result + (start != null ? start.hashCode() : 0);
        result = 31 * result + (int) status;
        return result;
    }

    @Override
    public String toString() {
        return "Course{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", subject='" + subject + '\'' +
                ", duration=" + duration +
                ", start=" + start +
                ", status=" + status +
                ", matter=" + matter +
                ", room=" + room +
                ", professor=" + user +
                '}';
    }
}

redpajama_set_name: RedPajamaGithub


text:
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%${symbol_escape}features${symbol_escape}org.talend.rcp.branding.%PRODUCTNAME%${symbol_escape}%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package ${package};

/**
 * Enumeration of standard string delimiters
 *
 * This shows possible values for dropdown list UI element i18n message for it
 * should be placed in TableInputProperties.properties file
 */
public enum StringDelimiter {
    SEMICOLON(";"),
    COLON(":"),
    COMMA(",");

    private String delimiter;

    private StringDelimiter(String delimiter) {
        this.delimiter = delimiter;
    }

    public String getDelimiter() {
        return this.delimiter;
    }
}


text:
.class abstract Lcom/payu/android/sdk/internal/is;
.super Ljava/lang/Object;

# instance fields
.field protected a:Lcom/payu/android/sdk/internal/is;

# direct methods
.method constructor <init>()V
    .locals 0

    .line 7
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public final a(Lcom/payu/android/sdk/internal/gq;)Lcom/payu/android/sdk/internal/gp;
    .locals 2

    .line 12
    :goto_0
    invoke-virtual {p0, p1}, Lcom/payu/android/sdk/internal/is;->b(Lcom/payu/android/sdk/internal/gq;)Lcom/payu/android/sdk/internal/sw;

    move-result-object v1

    .line 14
    invoke-virtual {v1}, Lcom/payu/android/sdk/internal/sw;->b()Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/payu/android/sdk/internal/is;->a:Lcom/payu/android/sdk/internal/is;

    if-eqz v0, :cond_0

    .line 15
    iget-object p0, p0, Lcom/payu/android/sdk/internal/is;->a:Lcom/payu/android/sdk/internal/is;

    goto :goto_0

    .line 18
    :cond_0
    invoke-virtual {v1}, Lcom/payu/android/sdk/internal/sw;->c()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/payu/android/sdk/internal/gp;

    return-object v0
.end method

.method public final a(Lcom/payu/android/sdk/internal/is;)Lcom/payu/android/sdk/internal/is;
    .locals 0

    .line 22
    iput-object p1, p0, Lcom/payu/android/sdk/internal/is;->a:Lcom/payu/android/sdk/internal/is;

    .line 23
    return-object p0
.end method

.method protected abstract b(Lcom/payu/android/sdk/internal/gq;)Lcom/payu/android/sdk/internal/sw;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(Lcom/payu/android/sdk/internal/gq;)Lcom/payu/android/sdk/internal/sw<Lcom/payu/android/sdk/internal/gp;>;"
        }
    .end annotation
.end method


text:
#include "Arduino.h"

#ifdef __cplusplus
 extern "C" {
#endif

void pinMode( uint32_t ulPin, uint32_t ulMode )
{
  // Handle the case the pin isn't usable as PIO
  if ( g_APinDescription[ulPin].ulPinType == PIO_NOT_A_PIN )
  {
    return ;
  }

  EPortType port = g_APinDescription[ulPin].ulPort;
  uint32_t pin = g_APinDescription[ulPin].ulPin;
  uint32_t pinMask = (1ul << pin);

  // Set pin mode according to chapter '22.6.3 I/O Pin Configuration'
  switch ( ulMode )
  {
    case INPUT:
      // Set pin to input mode
      PORT->Group[port].PINCFG[pin].reg=(uint8_t)(PORT_PINCFG_INEN) ;
      PORT->Group[port].DIRCLR.reg = pinMask ;
    break ;

    case INPUT_PULLUP:
      // Set pin to input mode with pull-up resistor enabled
      PORT->Group[port].PINCFG[pin].reg=(uint8_t)(PORT_PINCFG_INEN|PORT_PINCFG_PULLEN) ;
      PORT->Group[port].DIRCLR.reg = pinMask ;

      // Enable pull level (cf '22.6.3.2 Input Configuration' and '22.8.7 Data Output Value Set')
      PORT->Group[port].OUTSET.reg = pinMask ;
    break ;

    case INPUT_PULLDOWN:
      // Set pin to input mode with pull-down resistor enabled
      PORT->Group[port].PINCFG[pin].reg=(uint8_t)(PORT_PINCFG_INEN|PORT_PINCFG_PULLEN) ;
      PORT->Group[port].DIRCLR.reg = pinMask ;

      // Enable pull level (cf '22.6.3.2 Input Configuration' and '22.8.6 Data Output Value Clear')
      PORT->Group[port].OUTCLR.reg = pinMask ;
    break ;

    case OUTPUT:
      // enable input, to support reading back values, with pullups disabled
      PORT->Group[port].PINCFG[pin].reg=(uint8_t)(PORT_PINCFG_INEN) ;

      // Set pin to output mode
      PORT->Group[port].DIRSET.reg = pinMask ;
    break ;

    default:
      // do nothing
    break ;
  }
}

void digitalWrite( uint32_t ulPin, uint32_t ulVal )
{
  // Handle the case the pin isn't usable as PIO
  if ( g_APinDescription[ulPin].ulPinType == PIO_NOT_A_PIN )
  {
    return ;
  }

  EPortType port = g_APinDescription[ulPin].ulPort;
  uint32_t pin = g_APinDescription[ulPin].ulPin;
  uint32_t pinMask = (1ul << pin);

  if ( (PORT->Group[port].DIRSET.reg & pinMask) == 0 ) {
    // the pin is not an output, disable pull-up if val is LOW, otherwise enable pull-up
    PORT->Group[port].PINCFG[pin].bit.PULLEN = ((ulVal == LOW) ? 0 : 1) ;
  }

  switch ( ulVal )
  {
    case LOW:
      PORT->Group[port].OUTCLR.reg = pinMask;
    break ;

    default:
      PORT->Group[port].OUTSET.reg = pinMask;
    break ;
  }

  return ;
}

int digitalRead( uint32_t ulPin )
{
  // Handle the case the pin isn't usable as PIO
  if ( g_APinDescription[ulPin].ulPinType == PIO_NOT_A_PIN )
  {
    return LOW ;
  }

  if ( (PORT->Group[g_APinDescription[ulPin].ulPort].IN.reg & (1ul << g_APinDescription[ulPin].ulPin)) != 0 )
  {
    return HIGH ;
  }

  return LOW ;
}

#ifdef __cplusplus
}
#endif


text:
<!DOCTYPE HTML>

<title>Source code</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="source: package: co.aikar.commands, class: ACFSpongeUtil">
<meta name="generator" content="javadoc/SourceToHTMLConverter">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

001package co.aikar.commands;
002
003import org.spongepowered.api.Sponge;
004import org.spongepowered.api.command.CommandSource;
005import org.spongepowered.api.entity.living.player.Player;
006
007import java.util.ArrayList;
008import java.util.Iterator;
009import java.util.List;
010import java.util.stream.Collectors;
011
012@SuppressWarnings("WeakerAccess")
013public class ACFSpongeUtil {
014    public static Player findPlayerSmart(CommandIssuer issuer, String search) {
015        CommandSource requester = issuer.getIssuer();
016        if (search == null) {
017            return null;
018        }
019        String name = ACFUtil.replace(search, ":confirm", "");
020        if (!isValidName(name)) {
021            issuer.sendError(MinecraftMessageKeys.IS_NOT_A_VALID_NAME, "{name}", name);
022            return null;
023        }
024
025        List<Player> matches = matchPlayer(name);
026        List<Player> confirmList = new ArrayList<>();
027        findMatches(search, requester, matches, confirmList);
028
029
030        if (matches.size() > 1 || confirmList.size() > 1) {
031            String allMatches = matches.stream().map(Player::getName).collect(Collectors.joining(", "));
032            issuer.sendError(MinecraftMessageKeys.MULTIPLE_PLAYERS_MATCH,
033                    "{search}", name, "{all}", allMatches);
034            return null;
035        }
036
037        if (matches.isEmpty()) {
038            Player player = ACFUtil.getFirstElement(confirmList);
039            if (player == null) {
040                issuer.sendError(MinecraftMessageKeys.NO_PLAYER_FOUND_SERVER, "{search}", name);
041                return null;
042            } else {
043
044                issuer.sendInfo(MinecraftMessageKeys.PLAYER_IS_VANISHED_CONFIRM, "{vanished}", player.getName());
045                return null;
046            }
047        }
048
049        return matches.get(0);
050    }
051
052    private static void findMatches(String search, CommandSource requester, List<Player> matches, List<Player> confirmList) {
053        // Remove vanished players from smart matching.
054        Iterator<Player> iter = matches.iterator();
055        //noinspection Duplicates
056        while (iter.hasNext()) {
057            Player player = iter.next();
058            if (requester instanceof Player && !((Player) requester).canSee(player)) {
059                if (requester.hasPermission("acf.seevanish")) {
060                    if (!search.endsWith(":confirm")) {
061                        confirmList.add(player);
062                        iter.remove();
063                    }
064                } else {
065                    iter.remove();
066                }
067            }
068        }
069    }
070
071    public static List<Player> matchPlayer(String partialName) {
072        List<Player> matchedPlayers = new ArrayList<>();
073
074        for (Player iterPlayer : Sponge.getServer().getOnlinePlayers()) {
075            String iterPlayerName = iterPlayer.getName();
076
077            if (partialName.equalsIgnoreCase(iterPlayerName)) {
078                // Exact match
079                matchedPlayers.clear();
080                matchedPlayers.add(iterPlayer);
081                break;
082            }
083            if (iterPlayerName.toLowerCase(java.util.Locale.ENGLISH).contains(partialName.toLowerCase(java.util.Locale.ENGLISH))) {
084                // Partial match
085                matchedPlayers.add(iterPlayer);
086            }
087        }
088
089        return matchedPlayers;
090    }
091
092    public static boolean isValidName(String name) {
093        return name != null && !name.isEmpty() && ACFPatterns.VALID_NAME_PATTERN.matcher(name).matches();
094    }
095
096}


text:
package org.jetbrains.plugins.scala
package javaHighlighting

import com.intellij.ide.highlighter.JavaFileType
import com.intellij.lang.annotation.HighlightSeverity
import com.intellij.psi.{PsiDocumentManager, PsiFile}
import org.jetbrains.plugins.scala.annotator.{AnnotatorHolderMock, Error, Message, ScalaAnnotator}
import org.jetbrains.plugins.scala.base.ScalaFixtureTestCase
import org.jetbrains.plugins.scala.extensions.PsiElementExt
import org.jetbrains.plugins.scala.util.assertions.MatcherAssertions
import org.junit.experimental.categories.Category

@Category(Array(classOf[TypecheckerTests]))
abstract class JavaHighlightingTestBase extends ScalaFixtureTestCase with MatcherAssertions {
  override protected def supportedIn(version: ScalaVersion): Boolean = version  >= LatestScalaVersions.Scala_2_11

  private var filesCreated: Boolean = false

  def errorsFromJavaCode(scalaFileText: String, javaFileText: String, javaClassName: String): List[Message] = {
    if (filesCreated) throw new AssertionError("Don't add files 2 times in a single test")

    myFixture.addFileToProject("dummy.scala", scalaFileText)
    val myFile: PsiFile = myFixture.addFileToProject(javaClassName + JavaFileType.DOT_DEFAULT_EXTENSION, javaFileText)
    myFixture.openFileInEditor(myFile.getVirtualFile)
    val allInfo = myFixture.doHighlighting()

    filesCreated = true

    import scala.jdk.CollectionConverters._
    allInfo.asScala.toList.collect {
      case highlightInfo if highlightInfo.`type`.getSeverity(null) == HighlightSeverity.ERROR =>
        Error(highlightInfo.getText, highlightInfo.getDescription)
    }
  }

  def errorsFromScalaCode(scalaFileText: String, javaFileText: String): List[Message] = {
    if (filesCreated) throw new AssertionError("Don't add files 2 times in a single test")

    myFixture.addFileToProject("dummy.java", javaFileText)
    myFixture.configureByText("dummy.scala", scalaFileText)

    filesCreated = true

    PsiDocumentManager.getInstance(getProject).commitAllDocuments()

    implicit val mock: AnnotatorHolderMock = new AnnotatorHolderMock(getFile)
    val annotator = new ScalaAnnotator()

    getFile.depthFirst().foreach(annotator.annotate)
    mock.annotations.filter {
      case Error(_, null) | Error(null, _) => false
      case Error(_, _) => true
      case _ => false
    }
  }
}


text:
package cosmos.trace;

import java.util.Date;
import java.util.List;

import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

import com.google.common.collect.Lists;

/**
 *
 */
public class TracerClientTest {

  private static MockInstance instance;
  private static Connector con;

  @BeforeClass
  public static void initializeMockAccumulo() throws Exception {
    instance = new MockInstance(TracerClientTest.class.getName());
    con = instance.getConnector("foo", new PasswordToken("bar"));

    AccumuloTraceStore.ensureTables(con);
  }

  @Test
  public void singleSince() throws Exception {
    Tracer t1 = new Tracer("1");
    t1.begin = 10l;

    t1.addTiming("t1", 5l);

    AccumuloTraceStore.serialize(t1, con);

    TracerClient tc = new TracerClient(con);

    List<Tracer> regions = Lists.newArrayList(tc.since(11));

    Assert.assertEquals(0, regions.size());

    regions = Lists.newArrayList(tc.since(9));

    Assert.assertEquals(1, regions.size());
  }

  @Test
  public void multipleSince() throws Exception {
    Tracer t1 = new Tracer("1");
    t1.begin = 10l;
    Tracer t2 = new Tracer("2");
    t2.begin = 20l;

    t1.addTiming("t1", 5l);
    t2.addTiming("t2", 5l);

    AccumuloTraceStore.serialize(t1, con);
    AccumuloTraceStore.serialize(t2, con);

    TracerClient tc = new TracerClient(con);

    List<Tracer> regions = Lists.newArrayList(tc.since(11));

    Assert.assertEquals(1, regions.size());

    Tracer tracer = regions.get(0);
    Assert.assertEquals(1, tracer.getTimings().size());
    Assert.assertEquals("t2", tracer.getTimings().get(0).getDescription());

    regions = Lists.newArrayList(tc.since(9));

    Assert.assertEquals(2, regions.size());

    regions = Lists.newArrayList(tc.since(21));

    Assert.assertEquals(0, regions.size());
  }

  @Test
  public void multipleBetween() throws Exception {
    Tracer t1 = new Tracer("1");
    t1.begin = 10l;
    Tracer t2 = new Tracer("2");
    t2.begin = 20l;

    t1.addTiming("t1", 5l);
    t2.addTiming("t2", 5l);

    AccumuloTraceStore.serialize(t1, con);
    AccumuloTraceStore.serialize(t2, con);

    TracerClient tc = new TracerClient(con);

    List<Tracer> regions = Lists.newArrayList(tc.between(19l, 21l));

    Assert.assertEquals(1, regions.size());

    Tracer tracer = regions.get(0);
    Assert.assertEquals(1, tracer.getTimings().size());
    Assert.assertEquals("t2", tracer.getTimings().get(0).getDescription());

    // Ensure equivalency using dates or longs
    Assert.assertEquals(regions, Lists.newArrayList(tc.between(new Date(19), new Date(21))));

    regions = Lists.newArrayList(tc.between(21l, 23l));
    Assert.assertEquals(0, regions.size());
    // Ensure equivalency using dates or longs
    Assert.assertEquals(regions, Lists.newArrayList(tc.between(new Date(21), new Date(23))));

    regions = Lists.newArrayList(tc.between(13l, 18l));
    Assert.assertEquals(0, regions.size());
    // Ensure equivalency using dates or longs
    Assert.assertEquals(regions, Lists.newArrayList(tc.between(new Date(13), new Date(18))));

    regions = Lists.newArrayList(tc.between(2l, 4l));
    Assert.assertEquals(0, regions.size());
    // Ensure equivalency using dates or longs
    Assert.assertEquals(regions, Lists.newArrayList(tc.between(new Date(2), new Date(4))));

    regions = Lists.newArrayList(tc.between(8l, 12l));

    Assert.assertEquals(1, regions.size());

    tracer = regions.get(0);
    Assert.assertEquals(1, tracer.getTimings().size());
    Assert.assertEquals("t1", tracer.getTimings().get(0).getDescription());

    // Ensure equivalency using dates or longs
    Assert.assertEquals(regions, Lists.newArrayList(tc.between(new Date(8), new Date(12))));

    regions = Lists.newArrayList(tc.between(8l, 22l));

    Assert.assertEquals(2, regions.size());

    tracer = regions.get(0);
    Assert.assertEquals(1, tracer.getTimings().size());
    Assert.assertEquals("t2", tracer.getTimings().get(0).getDescription());

    tracer = regions.get(1);
    Assert.assertEquals(1, tracer.getTimings().size());
    Assert.assertEquals("t1", tracer.getTimings().get(0).getDescription());

    // Ensure equivalency using dates or longs
    Assert.assertEquals(regions, Lists.newArrayList(tc.between(new Date(8), new Date(22))));
  }

}


text:
// PathVisio,
// a tool for data visualization and analysis using Biological Pathways
// Copyright 2006-2011 BiGCaT Bioinformatics
//
// 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 org.pathvisio.gui.dialogs;

import java.awt.Component;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutionException;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.SwingWorker;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;

import org.bridgedb.AttributeMapper;
import org.bridgedb.DataSource;
import org.bridgedb.IDMapperException;
import org.bridgedb.IDMapperStack;
import org.bridgedb.Xref;
import org.pathvisio.core.data.XrefWithSymbol;
import org.pathvisio.core.debug.Logger;
import org.pathvisio.core.model.DataNodeType;
import org.pathvisio.core.model.PathwayElement;
import org.pathvisio.core.util.ProgressKeeper;
import org.pathvisio.gui.DataSourceModel;
import org.pathvisio.gui.ProgressDialog;
import org.pathvisio.gui.SwingEngine;
import org.pathvisio.gui.completer.CompleterQueryTextArea;
import org.pathvisio.gui.completer.CompleterQueryTextField;
import org.pathvisio.gui.completer.OptionProvider;
import org.pathvisio.gui.handler.DataSourceHandler;
import org.pathvisio.gui.util.PermissiveComboBox;

/**
 * Dialog for editing DataNodes. In addition to the standard comments and literature tabs,
 * this has a tab for looking up accession numbers for genes and metabolites.
 */
public class DataNodeDialog extends PathwayElementDialog {

	protected DataNodeDialog(SwingEngine swingEngine, PathwayElement e, boolean readonly, Frame frame, Component locationComp) {
		super(swingEngine, e, readonly, frame, "DataNode properties", locationComp);
		getRootPane().setDefaultButton(null);
		setButton.requestFocus();
	}

	CompleterQueryTextArea symText;
	CompleterQueryTextField idText;
	private PermissiveComboBox dbCombo;
	private PermissiveComboBox typeCombo;
	private DataSourceModel dsm;

	public void refresh() {
		super.refresh();
		symText.setText(getInput().getTextLabel());
		idText.setText(getInput().getElementID());
		dsm.setSelectedItem(input.getDataSource());
		String dnType = getInput().getDataNodeType();
		typeCombo.setSelectedItem(DataNodeType.byName(dnType));
		String[] dsType = null; // null is default: no filtering
		if (DataSourceHandler.DSTYPE_BY_DNTYPE.containsKey(dnType)) dsType =
			DataSourceHandler.DSTYPE_BY_DNTYPE.get(dnType);
		dsm.setTypeFilter(dsType);
		pack();
	}

	private void applyAutoFill(XrefWithSymbol ref)
	{
		String sym = ref.getSymbol();
		if (sym == null || sym.equals ("")) sym = ref.getId();
		symText.setText(sym);
		idText.setText(ref.getId());
		String type = ref.getDataSource().getType();
		if ("metabolite".equals(type))
			typeCombo.setSelectedItem(DataNodeType.METABOLITE);
		else if ("gene".equals(type))
			typeCombo.setSelectedItem(DataNodeType.GENEPRODUCT);
		else if ("protein".equals(type))
			typeCombo.setSelectedItem(DataNodeType.PROTEIN);
		else if ("pathway".equals(type))
			typeCombo.setSelectedItem(DataNodeType.PATHWAY);
		dsm.setSelectedItem(ref.getDataSource());
	}

	/**
	 * Search for symbols or ids in the synonym databases that match
	 * the given text
	 */
	private void search(String aText)
	{
		if(aText == null || "".equals(aText.trim())) {
			JOptionPane.showMessageDialog(this, "No search term specified, " +
			"please type something in the 'Search' field");
			return;
		}
		final String text = aText.trim();

		final ProgressKeeper progress = new ProgressKeeper();
		ProgressDialog dialog = new ProgressDialog(this, "Searching", progress, true, true);
		dialog.setLocationRelativeTo(this);

		SwingWorker<List<XrefWithSymbol>, Void> sw = new SwingWorker<List<XrefWithSymbol>, Void>() {
			private static final int QUERY_LIMIT = 200;

			protected List<XrefWithSymbol> doInBackground() throws IDMapperException
			{
				IDMapperStack gdb = swingEngine.getGdbManager().getCurrentGdb();

			    //The result set
				List<XrefWithSymbol> result = new ArrayList<XrefWithSymbol>();

	    		for (Map.Entry<Xref, String> i :
		    		gdb.freeAttributeSearch( text, AttributeMapper.MATCH_ID, QUERY_LIMIT).entrySet())
		    	{
	    			// GO terms are annotated as symbols in BridgeDb databases
		    		// those are filtered from the results
		    		if(!i.getKey().getDataSource().getType().equals("ontology") ||
		    				!i.getKey().getDataSource().getType().equals("probe")) {
		    			result.add (new XrefWithSymbol (i.getKey(), i.getValue()));
		    		}
		    	}
		    	for (Map.Entry<Xref, String> i :
		    		gdb.freeAttributeSearch( text, "Symbol", QUERY_LIMIT).entrySet())
		    	{
		    		// GO terms are annotated as symbols in BridgeDb databases
		    		// those are filtered from the results
		    		if(!i.getKey().getDataSource().getType().equals("ontology") &&
		    				!i.getKey().getDataSource().getType().equals("probe")) {
		    			result.add (new XrefWithSymbol (i.getKey(), i.getValue()));
		    		}

		    	}
				return result;
			}

			@Override
			public void done()
			{
				progress.finished();
				if (!progress.isCancelled())
				{
					List<XrefWithSymbol> results = null;
					try
					{
						results = get();
						//Show results to user
						if(results != null && results.size() > 0) {
							DatabaseSearchDialog resultDialog = new DatabaseSearchDialog("Results", results);
							resultDialog.setVisible(true);
							XrefWithSymbol selected = resultDialog.getSelected();
							if(selected != null) {
								applyAutoFill(selected);
							}
						} else {
							JOptionPane.showMessageDialog(DataNodeDialog.this,
									"No results for '" + text + "'");
						}
					} catch (InterruptedException e) {
						//Ignore, thread interrupted. Same as cancel.
					}
					catch (ExecutionException e) {
						if(swingEngine.getGdbManager().getCurrentGdb().getMappers().size() == 0) {
							JOptionPane.showMessageDialog(DataNodeDialog.this,
									"No identifier mapping database loaded.", "Error",
									JOptionPane.ERROR_MESSAGE);
						} else {
							JOptionPane.showMessageDialog(DataNodeDialog.this,
									"Exception occurred while searching,\n" +
									"see error log for details.", "Error",
									JOptionPane.ERROR_MESSAGE);
							Logger.log.error("Error while searching", e);
						}
					}
				}
			}
		};
		sw.execute();
		dialog.setVisible(true);
	}

	protected void addCustomTabs(JTabbedPane parent) {
		JPanel panel = new JPanel();
		panel.setLayout(new GridBagLayout());

		JPanel searchPanel = new JPanel();
		JPanel fieldPanel = new JPanel();
		searchPanel.setBorder(BorderFactory.createTitledBorder("Search"));
		fieldPanel.setBorder(BorderFactory.createTitledBorder("Manual entry"));
		GridBagConstraints panelConstraints = new GridBagConstraints();
		panelConstraints.fill = GridBagConstraints.BOTH;
		panelConstraints.gridx = 0;
		panelConstraints.weightx = 1;
		panelConstraints.weighty = 1;
		panelConstraints.insets = new Insets(2, 2, 2, 2);
		panelConstraints.gridy = GridBagConstraints.RELATIVE;

		panel.add(searchPanel, panelConstraints);
		panel.add(fieldPanel, panelConstraints);

		//Search panel elements
		searchPanel.setLayout(new GridBagLayout());

		final JTextField searchText = new JTextField();
		final JButton searchButton = new JButton("Search");

		//Key listener to search when user presses Enter
		searchText.addKeyListener(new KeyAdapter() {
			public void keyReleased(KeyEvent e) {
				if (e.getKeyCode() == KeyEvent.VK_ENTER) {
					searchButton.requestFocus();
					search(searchText.getText());
				}
			}
		});

		searchButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				search(searchText.getText());
			}
		});
		searchButton.setToolTipText("Search the synonym database for references, based on the text label");

		GridBagConstraints searchConstraints = new GridBagConstraints();
		searchConstraints.gridx = GridBagConstraints.RELATIVE;
		searchConstraints.fill = GridBagConstraints.HORIZONTAL;
		searchConstraints.weightx = 1;
		searchPanel.add(searchText, searchConstraints);

		searchConstraints.weightx = 0;
		searchPanel.add(searchButton, searchConstraints);

		//Manual entry panel elements
		fieldPanel.setLayout(new GridBagLayout());

		JLabel symLabel = new JLabel("Text label");
		JLabel idLabel = new JLabel("Identifier");
		JLabel dbLabel = new JLabel("Database");
		JLabel typeLabel = new JLabel ("Biological Type");
		symText = new CompleterQueryTextArea(new OptionProvider() {
			public List<String> provideOptions(String text) {
				if(text == null) return Collections.emptyList();

				IDMapperStack gdb = swingEngine.getGdbManager().getCurrentGdb();
				List<String> symbols = new ArrayList<String>();
				try
				{
					if(gdb.getMappers().size() > 0) {
						symbols.addAll
							(gdb.freeAttributeSearch(text, "Symbol", 10).values());
					}
				}
				catch (IDMapperException ignore) {}
				return symbols;
			}
		}, true);
		symText.setColumns(20);
		symText.setRows(2);
		idText = new CompleterQueryTextField(new OptionProvider() {
			public List<String> provideOptions(String text) {
				if(text == null) return Collections.emptyList();

				IDMapperStack gdb = swingEngine.getGdbManager().getCurrentGdb();
				Set<Xref> refs = new HashSet<Xref>();
				try
				{
					if(gdb.getMappers().size() > 0) refs = gdb.freeSearch(text, 100);
				}
				catch (IDMapperException ignore) {}

				//Only take identifiers
				List<String> ids = new ArrayList<String>();
				for (Xref ref : refs) ids.add(ref.getId());
				return ids;
			}
		}, true);
		symText.setCorrectCase(false);
		idText.setCorrectCase(false);

		dsm = new DataSourceModel();
		dsm.setPrimaryFilter(true);
		dsm.setSpeciesFilter(swingEngine.getCurrentOrganism());
		dbCombo = new PermissiveComboBox(dsm);
		typeCombo = new PermissiveComboBox(DataNodeType.getValues());

		GridBagConstraints c = new GridBagConstraints();
		c.ipadx = c.ipady = 5;
		c.anchor = GridBagConstraints.FIRST_LINE_START;
		c.weightx = 0;
		c.gridx = 0;
		c.gridy = GridBagConstraints.RELATIVE;
		fieldPanel.add(symLabel, c);
		fieldPanel.add(typeLabel, c);
		fieldPanel.add(idLabel, c);
		fieldPanel.add(dbLabel, c);
		c.gridx = 1;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.weightx = 1;
		fieldPanel.add(new JScrollPane(symText), c);
		fieldPanel.add(typeCombo, c);
		fieldPanel.add(idText, c);
		fieldPanel.add(dbCombo, c);

		symText.getDocument().addDocumentListener(new DocumentListener() {
			public void changedUpdate(DocumentEvent e) { setText();	}
			public void insertUpdate(DocumentEvent e) {	setText(); }
			public void removeUpdate(DocumentEvent e) { setText(); }
			private void setText() {
				getInput().setTextLabel(symText.getText());
			}
		});

		idText.getDocument().addDocumentListener(new DocumentListener() {
			public void changedUpdate(DocumentEvent e) { setText();	}
			public void insertUpdate(DocumentEvent e) {	setText(); }
			public void removeUpdate(DocumentEvent e) { setText(); }
			private void setText() {
				getInput().setElementID(idText.getText());
			}
		});

		dsm.addListDataListener(new ListDataListener()
		{

			public void contentsChanged(ListDataEvent arg0)
			{
				getInput().setDataSource((DataSource)dsm.getSelectedItem());

			}

			public void intervalAdded(ListDataEvent arg0) {	}

			public void intervalRemoved(ListDataEvent arg0) { }
		});

		typeCombo.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				DataNodeType item = (DataNodeType)typeCombo.getSelectedItem();
				getInput().setDataNodeType(item);
				refresh();
			}
		});

		symText.setEnabled(!readonly);
		idText.setEnabled(!readonly);
		dbCombo.setEnabled(!readonly);
		typeCombo.setEnabled(!readonly);

		parent.add("Annotation", panel);
		parent.setSelectedComponent(panel);
	}
}


text:
<!doctype html>

    <meta charset="utf-8">
    <title>Random</title>
    <link rel="stylesheet" href="../include/style.css">

    <canvas id="canvas" width="400" height="400"></canvas>

      Return to Animation Menu


text:
Reveal-Plugin-for-Xcode
=======================

Plugin for Xcode to integrate the Reveal App to your project automatic(Without any modifications to your project).

## Introduction

**The Reveal Plugin works just like Instruments.**

![ProductMenu](https://github.com/shjborage/Reveal-Plugin-for-Xcode/raw/master/Product-InspectWithReveal.png)

The Reveal app integrates directly into Xcode, so you don't need to add frameworks or modify your project to inspect your app in the iOS Simulator.

If you're in the middle of a debug session and something unexpected happens, you can attach Reveal to see what's going on. No restarting your app, no changing your project. All from inside Xcode.

![DebugMenu](https://github.com/shjborage/Reveal-Plugin-for-Xcode/raw/master/Debug-AttachToReveal.png)

## Install

###Via Alcatraz

Reveal-Plugin-for-XCode is available through the [Alcatraz](http://alcatraz.io/) Xcode plugin management system.

From source

Simply build the Xcode project and restart Xcode. The plugin will automatically install to `~/Library/Application Support/Developer/Shared/Xcode/Plug-ins`.

## Uninstall

To uninstall, just remove the plugin from the above directory, and restart Xcode:

```
rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/RevealPlugin.xcplugin
```

Tested on Xcode 5.1 and Mac OS X 10.9.2.

## Plugins upgrade for new Xcode
```
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add `defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`
```

## Issue
*	When using `Inspect ith Reveal`, if your simulator can't lanuch within 5 seconds, it's will alert an error. Thus, you can alse use Debug->`Attach to Reveal` after your app launched.

* If the plugin is not successfully loaded, it's possible your Xcode version is not supported, Add the build UUIDs for the versions of Xcode you wish to support to `DVTPlugInCompatibilityUUIDs` in `Info.plist`.

	You can get the UUID with this command `defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`, run it in termial.

## Contributors

Welcome to fork and PullRequest to do this better.
We use issues to manage bugs and enhanced features.

## Thanks

+	[Integrating Reveal without modifying your Xcode project](http://blog.ittybittyapps.com/blog/2013/11/07/integrating-reveal-without-modifying-your-xcode-project/)
+	[Xcode 4 插件制作入门](http://onevcat.com/2013/02/xcode-plugin)


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Relative Error</title>
<link rel="stylesheet" href="../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../index.html" title="Math Toolkit 2.1.0">
<link rel="up" href="../backgrounders.html" title="Chapter 16. Backgrounders">
<link rel="prev" href="special_tut/special_tut_test.html" title="Testing">
<link rel="next" href="lanczos.html" title="The Lanczos Approximation">

Home
Libraries
People
FAQ
More

Relative Error

      Given an actual value a and a found value v
      the relative error can be calculated from:

      However the test programs in the library use the symmetrical form:

      which measures relative difference and happens to be less
      error prone in use since we don't have to worry which value is the "true"
      result, and which is the experimental one. It guarantees to return a value
      at least as large as the relative error.

      Special care needs to be taken when one value is zero: we could either take
      the absolute error in this case (but that's cheating as the absolute error
      is likely to be very small), or we could assign a value of either 1 or infinity
      to the relative error in this special case. In the test cases for the special
      functions in this library, everything below a threshold is regarded as "effectively
      zero", otherwise the relative error is assigned the value of 1 if only
      one of the terms is zero. The threshold is currently set at std::numeric_limits<>::min(): in other words all denormalised numbers
      are regarded as a zero.

      All the test programs calculate quantized relative error,
      whereas the graphs in this manual are produced with the actual error.
      The difference is as follows: in the test programs, the test data is rounded
      to the target real type under test when the program is compiled, so the error
      observed will then be a whole number of units in the last place
      either rounded up from the actual error, or rounded down (possibly to zero).
      In contrast the true error is obtained by extending the
      precision of the calculated value, and then comparing to the actual value:
      in this case the calculated error may be some fraction of units in
      the last place.

      Note that throughout this manual and the test programs the relative error is
      usually quoted in units of epsilon. However, remember that units
      in the last place more accurately reflect the number of contaminated
      digits, and that relative error can "wobble"
      by a factor of 2 compared to units in the last place.
      In other words: two implementations of the same function, whose maximum relative
      errors differ by a factor of 2, can actually be accurate to the same number
      of binary digits. You have been warned!

      The
      Impossibility of Zero Error

      For many of the functions in this library, it is assumed that the error is
      "effectively zero" if the computation can be done with a number of
      guard digits. However it should be remembered that if the result is a transcendental
      number then as a point of principle we can never be sure that the
      result is accurate to more than 1 ulp. This is an example of what http://en.wikipedia.org/wiki/William_Kahan
      called http://en.wikipedia.org/wiki/Rounding#The_table-maker.27s_dilemma:
      consider what happens if the first guard digit is a one, and the remaining
      guard digits are all zero. Do we have a tie or not? Since the only thing we
      can tell about a transcendental number is that its digits have no particular
      pattern, we can never tell if we have a tie, no matter how many guard digits
      we have. Therefore, we can never be completely sure that the result has been
      rounded in the right direction. Of course, transcendental numbers that just
      happen to be a tie - for however many guard digits we have - are extremely
      rare, and get rarer the more guard digits we have, but even so....

      Refer to the classic text What
      Every Computer Scientist Should Know About Floating-Point Arithmetic
      for more information.

Copyright © 2006-2010, 2012-2014 Nikhar Agrawal,
      Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert
      Holin, Bruno Lalande, John Maddock, Johan Råde, Gautam Sewani, Benjamin Sobotta,
      Thijs van den Berg, Daryle Walker and Xiaogang Zhang

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
class MessageSummarizer::OrderDetailsInDisputeSummary < MessageSummarizer::FacilityMessageSummary

  private

  def allowed?
    ability.can?(:disputed_orders, Facility)
  end

  def get_count
    facility.order_details_in_dispute.count
  end

  def i18n_key
    "message_summarizer.order_details_in_dispute"
  end

  def path
    controller.facility_disputed_orders_path(facility)
  end

end


text:
package org.osgi.framework;

/**
 * Allows services to provide customized service objects in the OSGi
 * environment.
 *
 *

 * When registering a service, a ServiceFactory object can be
 * used instead of a service object, so that the bundle developer can gain
 * control of the specific service object granted to a bundle that is using the
 * service.
 *
 *

 * When this happens, the
 * BundleContext.getService(ServiceReference) method calls the
 * ServiceFactory.getService method to create a service object
 * specifically for the requesting bundle. The service object returned by the
 * ServiceFactory is cached by the Framework until the bundle
 * releases its use of the service.
 *
 *

 * When the bundle's use count for the service equals zero (including the bundle
 * stopping or the service being unregistered), the
 * ServiceFactory.ungetService method is called.
 *
 *

 * ServiceFactory objects are only used by the Framework and are
 * not made available to other bundles in the OSGi environment. The Framework
 * may concurrently call a ServiceFactory.
 *
 * @see BundleContext#getService
 * @ThreadSafe
 * @version $Revision: 5967 $
 */

public interface ServiceFactory {
	/**
	 * Creates a new service object.
	 *
	 *

	 * The Framework invokes this method the first time the specified
	 * bundle requests a service object using the
	 * BundleContext.getService(ServiceReference) method. The
	 * service factory can then return a specific service object for each
	 * bundle.
	 *
	 *

	 * The Framework caches the value returned (unless it is null),
	 * and will return the same service object on any future call to
	 * BundleContext.getService for the same bundle. This means the
	 * Framework must not allow this method to be concurrently called for the
	 * same bundle.
	 *
	 *

	 * The Framework will check if the returned service object is an instance of
	 * all the classes named when the service was registered. If not, then
	 * null is returned to the bundle.
	 *
	 * @param bundle The bundle using the service.
	 * @param registration The ServiceRegistration object for the
	 *        service.
	 * @return A service object that must be an instance of all
	 *         the classes named when the service was registered.
	 * @see BundleContext#getService
	 */
	public Object getService(Bundle bundle, ServiceRegistration registration);

	/**
	 * Releases a service object.
	 *
	 *

	 * The Framework invokes this method when a service has been released by a
	 * bundle. The service object may then be destroyed.
	 *
	 * @param bundle The bundle releasing the service.
	 * @param registration The ServiceRegistration object for the
	 *        service.
	 * @param service The service object returned by a previous call to the
	 *        ServiceFactory.getService method.
	 * @see BundleContext#ungetService
	 */
	public void ungetService(Bundle bundle, ServiceRegistration registration,
			Object service);
}


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

<title>userService</title>
<meta name="date" content="2016-03-04">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package userService

Interface Summary

Interface
Description

DBService

This class is the interface where define the methods that can be
         implemented

Class Summary

Class
Description

ConnectionDB

This class simulate the connection a DB, only can be created one instance in
 the BD

MainUserService

This is the principal class

Person

This class has the attributes of a Person Is a business logic class

ServicePersons

This class is a class that defines the way for to connect.

UserDB

This class define the user for a connection in DB

UserService

This class implements DBService, is the API with the CRUD methods.

UserServiceTest

This class defines the test for the UserService

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes


text:
package net.padaf.xmpbox.parser;

/**
 * This exception is thrown when a rdf:Description not contains attribute
 * rdf:about
 *
 * @author a183132
 *
 */
public class XmpExpectedRdfAboutAttribute extends Exception {

	/**
	 *
	 */
	private static final long serialVersionUID = 737516114298078255L;

	/**
	 * Build This exception with specified error message
	 *
	 * @param message
	 *            a description of the encountered problem
	 */
	public XmpExpectedRdfAboutAttribute(String message) {
		super(message);

	}

	/**
	 * Build This exception with specified error message and the original cause
	 *
	 * @param message
	 *            a description of the encountered problem
	 * @param cause
	 *            Original Cause of this exception
	 */
	public XmpExpectedRdfAboutAttribute(String message, Throwable cause) {
		super(message, cause);

	}

}


text:
<!doctype html>

        <meta charset="utf-8">
        <base href="<?php echo base_url() ?>">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

        <title><?php echo $controller_name ?> - HijabDept</title>
        <link rel="icon" href="assets/uploads/app_settings/<?php echo $app_favicon_logo; ?>">
        <meta name="description" content="E-Commerce Hijab Dept">
        <meta name="author" content="Hijab Dept">
        <link rel="stylesheet" href="assets/frontend_assets/css/underconstruction/bootstrap.min.css" />
        <link href="assets/frontend_assets/css/underconstruction/animate.css" rel="stylesheet" media="screen">
        <link rel="stylesheet" href="assets/frontend_assets/css/underconstruction/styles.css" />
        <link href="assets/frontend_assets/css/underconstruction/font/css/font-awesome.min.css" rel="stylesheet">

OUR NEW SITE IS COMING SOON

                        STAY TUNED FOR SOMETHING AMAZING

 Copyright 2016 | Hijab Dept


text:
@echo off
title RebuildBoot
SET MSBUILDENABLEALLPROPERTYFUNCTIONS=1
rem %WinDir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe %~dp0\Common\BootTasks.proj /t:BuildBoot /tv:4.0
call "%VSINSTALLDIR%\Common7\Tools\VsDevCmd.bat"
MSBuild.exe %~dp0\Common\BootTasks.proj /t:BuildBoot /tv:4.0 /bl:%~dp0\Boot2\BootTasks.binlog;ProjectImports=Embed /p:BuildTarget=Rebuild
pause


text:
import asyncio

from idiotic import block
import collections
import time

Event = collections.namedtuple("Event", ("source", "state", "time"))

CLOSED = True
OPEN = False

NULL_EVENT = Event(None, None, 0)

class Occupancy(block.Block):
    def __init__(self, *args, threshold=.45, decay=.85, motion=None, doors=None, sound=None, **kwargs):
        # Have some sort of thing that, going a certain distance back, calculates each thing's contribution based on a
        # configurable decay rate for each input / input type
        super().__init__(*args, **kwargs)
        self.motion_events = []
        self.door_events = []
        self.sound_events = []

        self.threshold = threshold
        self.decay = decay

        self.weights = collections.defaultdict(lambda: 1.0)

    def latest_events(self):
        motions = reversed(self.motion_events)
        doors = reversed(self.door_events)
        sounds = reversed(self.sound_events)

        motion, door, sound = next(motions, NULL_EVENT), next(doors, NULL_EVENT), next(sounds, NULL_EVENT)

        while motion != NULL_EVENT or door != NULL_EVENT or sound != NULL_EVENT:
            latest = max(motion.time, door.time, sound.time)
            if motion.time == latest:
                yield motion
                motion = next(motions, NULL_EVENT)
            elif door.time == latest:
                yield door
                door = next(door, NULL_EVENT)
            elif sound.time == latest:
                yield sound
                sound = next(sound, NULL_EVENT)

    def probability(self):
        prob = 0.0
        for evt in self.latest_events():
            if not evt.state:
                continue

            diff = self.weights[evt.source] * self.decay ** (time.time() - evt.time)
            prob += diff

            if prob > 1.0:
                prob = 1
                break

            if diff < .01:
                # Nothing will change significantly to
                break

        print("Probability =", prob)

        return prob

    def value(self):
        return self.probability() >= self.threshold

    def get_recalc_time(self):
        return time.time() + 1

    async def _recalculate(self):
        await self.output(self.value())
        await self.output(self.value(), "occupied")
        await self.output(self.probability(), "probability")

    def __getattr__(self, key):
        if key.startswith("motion_"):
            async def __motion(val):
                self.motion_events.append(Event(key[len("motion_"):], val, time.time()))
                await self._recalculate()

            return __motion
        elif key.startswith("door_"):
            async def __door(val):
                self.door_events.append(Event(key[len("door_"):], val, time.time()))
                await self._recalculate()

            return __door
        elif key.startswith("sound_"):
            async def __sound(val):
                self.sound_events.append(Event(key[len("sound_"):], val, time.time()))
                await self._recalculate()

            return __sound
        else:
            raise ValueError("Parameter name not declared")


text:
captcha [![CircleCI](https://circleci.com/gh/tango-contrib/captcha/tree/master.svg?style=svg)](https://circleci.com/gh/tango-contrib/captcha/tree/master) [![](http://gocover.io/_badge/github.com/tango-contrib/captcha)](http://gocover.io/github.com/tango-contrib/captcha)
====

Middleware captcha a middleware that provides captcha service for [Tango](https://github.com/lunny/tango).

[API Reference](https://gowalker.org/github.com/tango-contrib/captcha)

### Installation

	go get github.com/tango-contrib/captcha

## Usage

```go
// main.go
import (
	"github.com/lunny/tango"
	"github.com/tango-contrib/cache"
	"github.com/tango-contrib/captcha"
)

type CaptchaAction struct {
	captcha.Captcha
	renders.Renderer
}

func (c *CaptchaAction) Get() {
	c.Render("captcha.html", renders.T{
		"captcha": c.CreateHtml(),
	})
}

func (c *CaptchaAction) Post() string {
	if c.Verify() {
		return "true"
	}
	return "false"
}

func main() {
  	t := tango.Classic()
	t.Use(captcha.New())
	t.Any("/", new(CaptchaAction))
	t.Run()
}
```

```html
<!-- templates/captcha.tmpl -->
{{.captcha}}
```

## Options

`captcha.Captchaer` comes with a variety of configuration options:

```go
// ...
t.Use(captcha.New(captcha.Options{
	URLPrefix:			"/captcha/", 	// URL prefix of getting captcha pictures.
	FieldIdName:		"captcha_id", 	// Hidden input element ID.
	FieldCaptchaName:	"captcha", 		// User input value element name in request form.
	ChallengeNums:		6, 				// Challenge number.
	Width:				240,			// Captcha image width.
	Height:				80,				// Captcha image height.
	Expiration:			600, 			// Captcha expiration time in seconds.
	CachePrefix:		"captcha_", 	// Cache key prefix captcha characters.
}, cache))
// ...
```

## License

This project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text.


text:
import accounts
import settings
import argparse

def add_key(key):
    accounts.Manager(settings.DATABASE_PATH).add_api_key(key)

def main():
    parser = argparse.ArgumentParser(
            description='Adds an API key to metadisk-accounts.')

    parser.add_argument('key')

    options = parser.parse_args()

    add_key(options.key)

if __name__ == '__main__':
    main()


text:
<?php
/**
 * Created by IntelliJ IDEA.
 * User: rmiles
 * Date: 6/26/2018
 * Time: 3:21 PM
 */

declare(strict_types=1);

namespace Tests\Feature;

use CarbonPHP\Database;
use CarbonPHP\Error\ErrorCatcher;
use CarbonPHP\Tables\Wp_Users;
use Throwable;

final class RestWordpressTest extends Config
{
    public function testRestInternalPostAndDelete(): void
    {
        self::assertGreaterThan(1, $newUserId = self::createUser());

        self::assertTrue(self::deleteUser($newUserId), 'Failed to delete user.');
    }

    public function testRestCanSimpleSelectWordpressUser(): void
    {
        $return = [];

        self::assertTrue(Wp_Users::Get($return, '1', []));

        self::assertArrayHasKey(Wp_Users::COLUMNS[Wp_Users::USER_PASS], $return);
    }

    public function testRestInternalSelectAndUpdate(): void
    {
        self::assertGreaterThan(1, $primary = self::createUser());

        $db = Database::database(false);

        self::assertFalse($db->inTransaction(), 'Transaction did not commit');

        $return = [];

        self::assertTrue(Wp_Users::Get($return, $primary));

        self::assertArrayHasKey(Wp_Users::COLUMNS[Wp_Users::USER_NICENAME], $return);

        self::assertArrayHasKey(Wp_Users::COLUMNS[Wp_Users::USER_LOGIN], $return);

        $returnUpdated = [];

        self::assertTrue(Wp_Users::Put($returnUpdated, $primary, [
            Wp_Users::USER_LOGIN => $actual = 'Wookiee'
        ]));

        self::assertArrayHasKey(Wp_Users::COLUMNS[Wp_Users::USER_LOGIN], $return);

        self::assertEquals($returnUpdated[Wp_Users::COLUMNS[Wp_Users::USER_LOGIN]], $actual);

        self::assertNotEquals($returnUpdated[Wp_Users::COLUMNS[Wp_Users::USER_LOGIN]], $return[Wp_Users::COLUMNS[Wp_Users::USER_LOGIN]]);

        self::assertTrue(self::deleteUser($primary), 'Failed to delete user.');
    }

    /** @noinspection PhpUnhandledExceptionInspection */
    public static function createUser(array $data = null) : string {
        try {
            $data ??= [
                Wp_Users::USER_LOGIN => 'WookieeWorking',
                Wp_Users::USER_PASS => 'carbon',
                Wp_Users::USER_NICENAME => 'WookieeWorking1',
                Wp_Users::USER_EMAIL => 'support@miles.systems',
                Wp_Users::USER_REGISTERED => date('Y-m-d H:i:s'),
                Wp_Users::USER_URL => '',
            ];

            // an auto incrementing int should be returned
            $primary = Wp_Users::Post($data);

            self::assertGreaterThan(1, $primary, 'Failed to create a new wordpress user.');

            return $primary;

        } catch (Throwable $e) {
            ErrorCatcher::generateLog($e);
            die(1);
        }
    }

    /** @noinspection PhpUnhandledExceptionInspection */
    public static function deleteUser(string $id) : bool {
        try {
            $ignore = [];

            return Wp_Users::Delete($ignore, $id);

        } catch (Throwable $e) {

            ErrorCatcher::generateLog($e);

            die(1);
        }
    }

}


text:
<?php
/**
 * Description of GetJquery
 *
 * @author Sarjono Mukti Aji <me@simukti.net>
 */
use \Zend_View_Helper_Abstract as HelperAbstract;

class View_Helper_GetJquery extends HelperAbstract
{
    public function getJquery()
    {
        $this->view->headScript()->prependFile('/assets/js/jquery-1.7.1.min.js', 'text/javascript');
    }
}


text:
class Unbookable < ActiveRecord::Base
end


text:
'''The Topology module for the HC project.
@version: 1.0
@author: U{Baohua Yang<mailto:yangbaohua@gmail.com>}
@created: Oct 12, 2011
@last update: Oct 22, 2011
@see: U{<https://github.com/yeasy/lazyctrl>}
@TODO: nothing
'''
import networkx as nx
import os.path, sys
from matplotlib import pyplot as plt

class Topo:
    """ Topology class.
    """
    def __init__(self, name, num_port=16):
        """ Generate a topo.
        @param name: Topology name
        @param num_port: Number of ports of each switch
        """
        self.name = name
        self.G = nx.Graph()
        self.num_port = num_port
        self.coreSWList, self.aggSWList, self.edgeSWList = [], [], []

    def importFrom(self,fn):
        """
        Import the topo from outside file.
        @param fn: Name of the outside file
        """
        if not fn:
            return
        f = open(fn,'r')
        try:
            for l in f.readlines():
                src,dst,w = l.split()
                src,dst,w = int(src),int(dst),float(w)
                if src not in self.edgeSWList:
                    self.edgeSWList.append(src)
                if dst not in self.edgeSWList:
                    self.edgeSWList.append(dst)
                self.G.add_edge(src,dst,weight=w) #add new edge
        except:
            print "[Topo.importFrom()]Error in open file",fn
        finally:
            f.close()

    def info(self):
        """ Print information of the topology.
        """
        print "Name=%s" % self.name
        print "#Nodes=%u" % len(self.G.nodes())
        print "#Edges=%u" % len(self.G.edges())

    def exportPng(self, fn='test.png'):
        """ Save the topo into a png file.
        @param fn: The name of exported file
        """
        G = self.G
        if not fn:
            fn = self.name
        if G.is_directed():
            test_graph = G.to_undirected()
        else:
            test_graph = G
        fn_out_png = os.path.splitext(fn)[0] + ".png"
        plt.figure(figsize=(8, 8))
        #pos = nx.graphviz_layout(test_graph, prog='neato')
        #pos = nx.spring_layout(test_graph)
        pos = nx.shell_layout(test_graph)
        nx.draw(test_graph, pos, alpha=1.0, node_size=160, node_color='#eeeeee')
        #xmax = 1.1 * max(xx for xx, yy in pos.values())
        #ymax = 1.1 * max(yy for xx, yy in pos.values())
        #plt.xlim(-1*xmax, xmax)
        #plt.ylim(-1*xmax, ymax)
        plt.savefig(fn_out_png)

    def exportSW(self, k, switchfile='switch.txt'):
        """ Save the switch information into switch.txt.
        @param k: number of ports of each edge switch
        @param switchfile: out file name
        """
        host_id = 0 #start with 0
        with open(switchfile, 'w') as f:
            try:
                for sw in self.aggSWList:
                    for i in range(k):
                        f.write("%u %u\n" % (host_id, sw))
                        host_id += 1
            except:
                    ex = sys.exc_info()[2].tb_frame.f_back
                    print "[file %s, line %s, module %s]: Error when exportSW to %s, " \
                    % (__file__, ex.f_lineno, __name__, switchfile)
        f.close()

class Random(Topo):
    """ Random Topology.
    """
    def __init__(self, n, m, seed=None):
        """ Produces a graph picked randomly
        out of the set of all graphs
        with n nodes and m edges.
        @param n: Number of nodes
        @param m: Number of edges
        @param seed: Seed for random number generator (default=None).
        @return: The Topology
        """
        Topo.__init__(self, name='Random')
        self.n = n
        self.m = m
        self.G = nx.gnm_random_graph(n, m)

class Flat(Topo):
    """ Flat Topology with only edge switches.
    """
    def __init__(self, num_sw=16, num_port=4):
        """ Produces a flat topo with only edge switches.
        @param num_sw: The number of switches
        @param num_port: The number of ports of each switch
        @return: The Topology
        """
        Topo.__init__(self, name='Flat', num_port=num_port)
        self.edgeSWList = range(num_sw)
        self.G.add_nodes_from(self.edgeSWList, type='edge_switch') #edge sw

class FatTree(Topo):
    """ FatTree Topology.
    """
    def __init__(self, k):
        """ Generate the topo.
        @param k: k-port switch supports (k^2)*5/4 sws and (k^3)/4 hosts
        """
        Topo.__init__(self, name='FatTree', num_port=k)
        self.coreSWList = [i for i in range(k ** 2 / 4)]
        self.G.add_nodes_from(self.coreSWList, type='core_switch') #core sw
        self.aggSWList = [i + len(self.coreSWList) for i in range(k ** 2 / 2)]
        self.G.add_nodes_from(self.aggSWList, type='agg_switch') #agg sw
        self.edgeSWList = [i + len(self.coreSWList) + len(self.aggSWList) for i in range(k ** 2 / 2)]
        self.G.add_nodes_from(self.edgeSWList, type='edge_switch') #edge sw
        for p in range(k): #for pod p
            for i in range(k / 2): #for each agg switch
                for j in range(k / 2): #for each port of the agg switch
                    self.G.add_edge(self.aggSWList[i + p * (k / 2)], self.coreSWList[j + i * (k / 2)])
                for j in range(k / 2): #for each edge switch in the pod
                    self.G.add_edge(self.aggSWList[i + p * (k / 2)], self.edgeSWList[j + p * (k / 2)])

if __name__ == "__main__":
    #Random(10,20).info()
    #Topo('test').info()
    #fattree = FatTree(48)
    #fattree.info()
    #fattree.exportSW(48, 'testSW.txt')
    #fattree.export('test.png')
    flat = Flat()
    flat.info()
    topo = Topo('test')
    topo.importFrom("./sw_pair_weight.txt")
    topo.exportPng('sw_pair_weight.png')


text:
namespace Prexonite.Compiler.Ast
{
    /// <summary>
    /// Indicates how an operation behaves with respect to the Prexonite evaluation stack.
    /// </summary>
    /// <remarks>WARNING: Do not extend this enumeration. Users assume that
    /// <see cref="Value"/> and <see cref="Effect"/> are its only two members.</remarks>
    public enum StackSemantics
    {

        /// <summary>
        /// Indicates that the operation pushes a single value onto the
        /// evaluation stack.  May also have side effects.
        /// </summary>
        Value,
        /// <summary>
        /// Indicates that the operation does not modify the
        /// evaluation stack, but may have side effects.
        /// </summary>
        Effect
    }
}


text:
// Copyright (c) 2014, 2015 Adobe Systems Incorporated. All rights reserved.
//
// 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.

/* given an svgOM, generate SVG */

(function () {
    "use strict";

    var svgWriterUtils = require("./svgWriterUtils.js"),
        svgWriterPreprocessor = require("./svgWriterPreprocessor.js"),
        postProcess = require("./svgWriterPostprocessor.js").postProcess,
        Tag = require("./svgWriterTag.js"),
        SVGWriterContext = require("./svgWriterContext.js"),
        toString = svgWriterUtils.toString;

    function getFormatContext(svgOM, writable, cfg, errors) {
        return new SVGWriterContext(svgOM, writable, cfg, errors);
    }

    function stream(svgOM, writable, opt, errors) {
        var ctx = getFormatContext(svgOM, writable, opt || {}, errors);
        try {
            ctx.tick && ctx.tick("start");
            Tag.resetRoot(ctx);
            svgWriterPreprocessor.processSVGOM(ctx);
            var svg = Tag.make(ctx, svgOM),
                hasRules = !ctx.styling && ctx.omStylesheet.hasRules(),
                hasDefines = ctx.omStylesheet.hasDefines();
            if (hasRules || hasDefines) {
                svg.children.unshift(ctx.omStylesheet.getDefsTag());
            }
            postProcess(svg, ctx);
            if (!hasDefines && !ctx.xlinkRequired) {
                delete svg.attrs["xmlns:xlink"];
            }
            svg.write(ctx);
            ctx.tick && ctx.tick("end");
        } catch (ex) {
            console.error("Ex: " + ex);
            ex.stack && console.log(ex.stack);
        }
        return toString(ctx);
    }

    function print(svgOM, opt, errors) {
        function Writable() {
            this.buffer = "";

            this.write = function (chunk) {
                this.buffer += chunk;
            };
        }

        var writable = new Writable();
        stream(svgOM, writable, opt, errors);

        return writable.buffer;
    }

    module.exports.printSVG = print;
    module.exports.streamSVG = stream;
}());


text:
<?php

namespace Oro\Bundle\DataGridBundle\Tests\Behat\Element;

interface GridPaginatorInterface
{
    /**
     * @return int
     */
    public function getTotalRecordsCount();

    /**
     * @return int
     */
    public function getTotalPageCount();
}


text:
#ifndef _UAPI_LINUX_VIRTIO_CONFIG_H
#define _UAPI_LINUX_VIRTIO_CONFIG_H

/* Virtio devices use a standardized configuration space to define their
 * features and pass configuration information, but each implementation can
 * store and access that space differently. */
#include <linux/types.h>

/* Status byte for guest to report progress, and synchronize features. */
/* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */
#define VIRTIO_CONFIG_S_ACKNOWLEDGE	1
/* We have found a driver for the device. */
#define VIRTIO_CONFIG_S_DRIVER		2
/* Driver has used its parts of the config, and is happy */
#define VIRTIO_CONFIG_S_DRIVER_OK	4
/* We've given up on this device. */
#define VIRTIO_CONFIG_S_FAILED		0x80

/* Some virtio feature bits (currently bits 28 through 31) are reserved for the
 * transport being used (eg. virtio_ring), the rest are per-device feature
 * bits. */
#define VIRTIO_TRANSPORT_F_START	28
#define VIRTIO_TRANSPORT_F_END		32

/* Do we get callbacks when the ring is completely used, even if we've
 * suppressed them? */
#define VIRTIO_F_NOTIFY_ON_EMPTY	24

/* Can the device handle any descriptor layout? */
#define VIRTIO_F_ANY_LAYOUT		27

#endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */


text:
package org.javersion.store.jdbc;

import com.querydsl.core.types.Path;
import com.querydsl.core.types.dsl.NumberPath;
import com.querydsl.sql.RelationalPathBase;

public class JDocumentVersion<Id> extends JVersion<Id> {

    public final NumberPath<Long> txOrdinal = createNumber("txOrdinal", Long.class);

    public JDocumentVersion(RelationalPathBase<?> table, Path<Id> docId) {
        super(table, docId);
    }
}


text:
package de.knoppiks.hap.client;

/**
 * @author Jonas Wagner
 */
public class WrongContentTypeException extends Exception {

    public WrongContentTypeException(String message) {
        super(message);
    }
}


text:
description "Silence. The room feels large, but empty. Luckily you have a map of this tower to help find the stairs."
tip "Use warrior.direction_of_stairs to determine which direction stairs are located. Pass this to warrior.walk! to walk in that direction."

time_bonus 20
ace_score 19
size 6, 4
stairs 2, 3

warrior 0, 1, :east do |u|
  u.add_abilities :walk!, :feel, :direction_of_stairs
end


text:
// Copyright 2021 The Bazel Authors. All rights reserved.
//
// 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 com.google.devtools.build.lib.bazel.bzlmod;

import static java.nio.charset.StandardCharsets.UTF_8;

import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.events.ExtendedEventHandler;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

/**
 * Fake implementation of {@link Registry}, where modules can be freely added and stored in memory.
 * The contents of the modules are expected to be located under a given file path as subdirectories.
 */
public class FakeRegistry implements Registry {
  private static final Joiner JOINER = Joiner.on('\n');
  private final String url;
  private final String rootPath;
  private final Map<ModuleKey, String> modules = new HashMap<>();

  public FakeRegistry(String url, String rootPath) {
    this.url = url;
    this.rootPath = rootPath;
  }

  public FakeRegistry addModule(ModuleKey key, String... moduleFileLines) {
    modules.put(key, JOINER.join(moduleFileLines));
    return this;
  }

  @Override
  public String getUrl() {
    return url;
  }

  @Override
  public Optional<byte[]> getModuleFile(ModuleKey key, ExtendedEventHandler eventHandler) {
    return Optional.ofNullable(modules.get(key)).map(value -> value.getBytes(UTF_8));
  }

  @Override
  public RepoSpec getRepoSpec(ModuleKey key, String repoName, ExtendedEventHandler eventHandler) {
    return RepoSpec.builder()
        .setRuleClassName("local_repository")
        .setAttributes(ImmutableMap.of("name", repoName, "path", rootPath + "/" + repoName))
        .build();
  }

  @Override
  public boolean equals(Object other) {
    return other instanceof FakeRegistry
        && this.url.equals(((FakeRegistry) other).url)
        && this.modules.equals(((FakeRegistry) other).modules);
  }

  @Override
  public int hashCode() {
    return Objects.hash(url, modules);
  }

  public static final Factory DEFAULT_FACTORY = new Factory();

  /** Fake {@link RegistryFactory} that only supports {@link FakeRegistry}. */
  public static class Factory implements RegistryFactory {

    private int numFakes = 0;
    private final Map<String, FakeRegistry> registries = new HashMap<>();

    public FakeRegistry newFakeRegistry(String rootPath) {
      FakeRegistry registry = new FakeRegistry("fake:" + numFakes++, rootPath);
      registries.put(registry.getUrl(), registry);
      return registry;
    }

    @Override
    public Registry getRegistryWithUrl(String url) {
      return Preconditions.checkNotNull(registries.get(url), "unknown registry url: %s", url);
    }
  }
}


text:
// Copyright (c) 2020 DHGMS Solutions and Contributors. All rights reserved.
// DHGMS Solutions and Contributors licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

namespace Dhgms.Nucleotide.Generators.PropertyInfo
{
    /// <summary>
    /// This represents a property with range, but allows extracting it for code generation as strings.
    /// This has been done like this because having the code can't use an unbound generic, the language
    /// doesn't support it, and it would probably be a headache to consume anyway.
    /// </summary>
    public interface IPropertyWithRangeAsString
    {
        string MaximumValueAsString { get; }

        string MinimumValueAsString { get; }
    }
}


text:
var App = require('app');
/**
 * Unit conversion mixin for widget views.
 * @type {Em.Mixin}
 */
App.ConvertUnitWidgetViewMixin = Em.Mixin.create(App.BaseUnitConvertMixin, {
  /**
   * Get converted value according to widget value format from specified config property value.
   *
   * @method widgetValueByConfigAttributes
   * @param {String|Number} value - config property value to convert
   * @param {Boolean} [returnObject=false] - returned value should be an array of objects
   * @returns {Number|Object[]}
   */
  widgetValueByConfigAttributes: function(value, returnObject) {
    return this.convertValue(value, this._converterGetPropertyAttributes(), this._converterGetWidgetUnits(), returnObject);
  },

  /**
   * Get converted value according to config property unit format from specified widget value.
   *
   * @param {String|Number|Object[]} value - widget value to convert
   * @returns {String}
   * @method configValueByWidget
   */
  configValueByWidget: function(value) {
    var cfgValue = this.convertValue(value, this._converterGetWidgetUnits(), this._converterGetPropertyAttributes());
    return '' + this.get('config.stackConfigProperty.valueAttributes.type') === 'int' ? Math.round(cfgValue) : cfgValue;
  },

  /**
   * @private
   * @method _converterGetWidgetUnits
   * @throw Error
   * @returns {String|String[]}
   */
  _converterGetWidgetUnits: function() {
    var widgetAttributes = this.get('config.stackConfigProperty.widget');
    var widgetUnits = Em.getWithDefault(widgetAttributes, 'units.0.unit-name', false) || Em.getWithDefault(widgetAttributes, 'units.0.unit', false);
    Em.assert('Invalid widget units for ' + this.get('config.name') + ' widget object: ' + JSON.stringify(widgetAttributes), widgetUnits);
    return widgetUnits;
  },

  /**
   * @private
   * @method _converterGetPropertyAttributes
   * @throw Error
   * @returns {String|String[]}
   */
  _converterGetPropertyAttributes: function() {
    var propertyAttributes = this.get('config.stackConfigProperty.valueAttributes');
    var propertyUnits = Em.getWithDefault(propertyAttributes, 'unit', false) || Em.getWithDefault(propertyAttributes, 'type', false);
    Em.assert('Invalid property unit type for ' + this.get('config.name') + ' valueAttributes: ' + JSON.stringify(propertyAttributes), propertyUnits);
    return propertyUnits;
  }
});


text:
<record><header><identifier>froac:481</identifier><datestamp>2012-09-16T20:22:12Z</datestamp><setSpec>notImplemented</setSpec></header><metadata><lom:lom xmlns:lom="http://ltsc.ieee.org/xsd/LOM" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ltsc.ieee.org/xsd/LOM http://ltsc.ieee.org/xsd/lomv1.0/lom.xsd">
<lom:general>
	<lom:identifier>
		<lom:catalog>NBC</lom:catalog>
		<lom:entry>07.10.01</lom:entry>
	</lom:identifier>
	<lom:title>Analysis and Design using MaSE and agentTool</lom:title>
	<lom:description>Esta investigación se centra en el descubrimiento de métodos y técnicas de la ingeniería práctica  de sistemas multiagente.</lom:description>
	<lom:keyword>Sistemas de software distribuido</lom:keyword>
	<lom:keyword>MaSE</lom:keyword>
	<lom:coverage>Siglo XXI</lom:coverage>
	<lom:structure>5</lom:structure>
	<lom:aggregationlevel>3</lom:aggregationlevel>
</lom:general>

<lom:lifecycle>
	<lom:version> </lom:version>
	<lom:status> </lom:status>
</lom:lifecycle>

<lom:metametadata>
	<lom:metadataschema>LOM</lom:metadataschema>
	<lom:language>none</lom:language>
</lom:metametadata>

<lom:technical>
	<lom:format>pdf</lom:format>
	<lom:size>691224</lom:size>
	<lom:location>http://roap.medellin.unal.edu.co/unalmed/control/download.php?id=59</lom:location>
	<lom:installationremarks> </lom:installationremarks>
	<lom:otherplatformrequirements> </lom:otherplatformrequirements>
	<lom:duration> </lom:duration>
</lom:technical>

<lom:educational>
	<lom:interactivitytype>none</lom:interactivitytype>
	<lom:interactivitylevel> </lom:interactivitylevel>
	<lom:semanticdensity> </lom:semanticdensity>
	<lom:difficulty> </lom:difficulty>
	<lom:typicallearningtime> </lom:typicallearningtime>
</lom:educational>

<lom:rights>
	<lom:cost> </lom:cost>
	<lom:copyrightandotherrestrictions> </lom:copyrightandotherrestrictions>
	<lom:description> </lom:description>
</lom:rights>

<lom:relation>
	<lom:kind> </lom:kind>
</lom:relation>

<lom:annotation>
	<lom:entity> </lom:entity>
	<lom:date> </lom:date>
	<lom:description> </lom:description>
</lom:annotation>

<lom:classification>
	<lom:purpose> </lom:purpose>
	<lom:description> </lom:description>
</lom:classification>
</lom:lom></metadata></record>