text:
package com.photon.phresco.util;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.List;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.zip.ZipEntry;

import javax.xml.parsers.ParserConfigurationException;

import org.apache.commons.lang.StringUtils;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DefaultArtifact;
import org.xml.sax.SAXException;

import com.photon.phresco.api.ApplicationProcessor;
import com.photon.phresco.api.DynamicPageParameter;
import com.photon.phresco.api.DynamicParameter;
import com.photon.phresco.api.DynamicParameterForModule;
import com.photon.phresco.commons.model.ArtifactGroup;
import com.photon.phresco.commons.model.ArtifactInfo;
import com.photon.phresco.commons.model.RepoInfo;
import com.photon.phresco.exception.ConfigurationException;
import com.photon.phresco.exception.PhrescoException;

public class PhrescoDynamicLoader {
	RepoInfo repoInfo;
	List<ArtifactGroup> plugins;

	public PhrescoDynamicLoader(RepoInfo repoInfo, List<ArtifactGroup> plugins) {
		this.repoInfo = repoInfo;
		this.plugins = plugins;
	}

	public DynamicParameter getDynamicParameter(String className)
			throws PhrescoException {
		DynamicParameter dynamicParameter = null;
		try {
			Class loadClass = getClassFromLocal(className);
			if(loadClass != null ) {
				dynamicParameter = (DynamicParameter) loadClass.newInstance();
			}
			if (dynamicParameter == null) {
				Class<DynamicParameter> apiClass = (Class<DynamicParameter>) Class
				.forName(className, true, getURLClassLoader());
				dynamicParameter = (DynamicParameter) apiClass.newInstance();
			}
		} catch (Exception e) {
			throw new PhrescoException(e);
		}
		return dynamicParameter;
	}

	private Class getClassFromLocal(String className) {
		ClassLoader classLoader = this.getClass().getClassLoader();
		try {
			return classLoader.loadClass(className);
		} catch (ClassNotFoundException e) {
			return null;
		}
	}
	public DynamicParameterForModule getDynamicParameterModule(String className)
			throws PhrescoException {
		DynamicParameterForModule dynamicParameter = null;
		try {
			Class loadClass = getClassFromLocal(className);
			if(loadClass != null ) {
				dynamicParameter = (DynamicParameterForModule) loadClass.newInstance();
			}
			if (dynamicParameter == null) {
				Class<DynamicParameterForModule> apiClass = (Class<DynamicParameterForModule>) Class
						.forName(className, true, getURLClassLoader());
				dynamicParameter = (DynamicParameterForModule) apiClass
						.newInstance();
			}
		} catch (Exception e) {
			throw new PhrescoException(e);
		}
		return dynamicParameter;
	}

	public DynamicPageParameter getDynamicPageParameter(String className)
			throws PhrescoException {
		DynamicPageParameter dynamicPageParameter = null;
		try {
			Class loadClass = getClassFromLocal(className);
			if(loadClass != null ) {
				dynamicPageParameter = (DynamicPageParameter) loadClass.newInstance();
			}
			if (dynamicPageParameter == null) {
				Class<DynamicPageParameter> apiClass = (Class<DynamicPageParameter>) Class
						.forName(className, true, getURLClassLoader());
				dynamicPageParameter = (DynamicPageParameter) apiClass
						.newInstance();
			}
		} catch (Exception e) {
			e.printStackTrace();
			throw new PhrescoException(e);
		}
		return dynamicPageParameter;
	}

	public ApplicationProcessor getApplicationProcessor(String className)
			throws PhrescoException {
		ApplicationProcessor applicationProcessor = null;
		try {
			Class loadClass = getClassFromLocal(className);
			if(loadClass != null ) {
				applicationProcessor = (ApplicationProcessor) loadClass.newInstance();
			}
			if (applicationProcessor == null) {
				Class<ApplicationProcessor> apiClass = (Class<ApplicationProcessor>) Class
						.forName(className, true, getURLClassLoader());
				ApplicationProcessor newInstance = apiClass.newInstance();
				applicationProcessor = (ApplicationProcessor) newInstance;
			}
		} catch (Exception e) {
			e.printStackTrace();
			throw new PhrescoException(e);
		}
		return applicationProcessor;
	}

	public InputStream getResourceAsStream(String fileName)
			throws PhrescoException {
		InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream(fileName);
		if(resourceAsStream != null) {
			return resourceAsStream;
		}
		List<Artifact> artifacts = new ArrayList<Artifact>();
		Artifact foundArtifact = null;
		String destFile = "";
		JarFile jarfile = null;
		for (ArtifactGroup plugin : plugins) {
			List<ArtifactInfo> versions = plugin.getVersions();
			for (ArtifactInfo artifactInfo : versions) {

				foundArtifact = createArtifact(plugin.getGroupId(),
						plugin.getArtifactId(), "jar",
						artifactInfo.getVersion());
				artifacts.add(foundArtifact);
			}
		}
		try {
			URL artifactURLs = MavenArtifactResolver.resolveSingleArtifact(
					repoInfo.getGroupRepoURL(), repoInfo.getRepoUserName(),
					repoInfo.getRepoPassword(), artifacts);
			File jarFile = new File(artifactURLs.toURI());
			if (jarFile.getName().equals(
					foundArtifact.getArtifactId() + "-"
							+ foundArtifact.getVersion() + "."
							+ foundArtifact.getType())) {
				jarfile = new JarFile(jarFile);
				for (Enumeration<JarEntry> em = jarfile.entries(); em
						.hasMoreElements();) {
					JarEntry jarEntry = em.nextElement();
					if (jarEntry.getName().endsWith(fileName)) {
						destFile = jarEntry.getName();
					}
				}
			}
			if (StringUtils.isNotEmpty(destFile)) {
				ZipEntry entry = jarfile.getEntry(destFile);
				return jarfile.getInputStream(entry);
			}
		} catch (Exception e) {
			e.printStackTrace();
			throw new PhrescoException(e);
		}
		return null;
	}

	private URLClassLoader getURLClassLoader() throws PhrescoException,
			URISyntaxException {
		List<Artifact> artifacts = new ArrayList<Artifact>();
		for (ArtifactGroup plugin : plugins) {
			List<ArtifactInfo> versions = plugin.getVersions();
			for (ArtifactInfo artifactInfo : versions) {
				Artifact artifact = createArtifact(plugin.getGroupId(), plugin.getArtifactId(), "jar", artifactInfo.getVersion());
				artifacts.add(artifact);
			}
		}

		URL artifactURL;
		try {
			artifactURL = MavenArtifactResolver.resolveSingleArtifact(
					repoInfo.getGroupRepoURL(), repoInfo.getRepoUserName(),
					repoInfo.getRepoPassword(), artifacts);
		} catch (Exception e) {
			e.printStackTrace();
			throw new PhrescoException(e);
		}
		ClassLoader clsLoader = Thread.currentThread().getContextClassLoader();
		if (clsLoader == null) {
			clsLoader = this.getClass().getClassLoader();
		}
		URLClassLoader classLoader = new URLClassLoader(new URL[]{artifactURL}, clsLoader);
		return classLoader;
	}

	private Artifact createArtifact(String groupId, String artifactId, String packaging, String version) {
		return new DefaultArtifact(groupId, artifactId, version,
				"", packaging, "", null);
	}

	public static void main(String[] args) throws PhrescoException,
			IOException, ParserConfigurationException, SAXException,
			ConfigurationException {
		RepoInfo repoinfo = new RepoInfo();
		repoinfo.setRepoName("releases");
		repoinfo.setRepoUserName("admin");
		// repoinfo.setRepoPassword("ZGV2cmVwbzI=");
		repoinfo.setRepoPassword("devrepo2");
		repoinfo.setGroupRepoURL("http://172.16.17.226:8080/repository/content/groups/public/");
		ArtifactGroup group = new ArtifactGroup();
		group.setGroupId("com.photon.sample.appprocessor");
		group.setArtifactId("testappprocessor");
		group.setPackaging("jar");
		ArtifactInfo info = new ArtifactInfo();
		info.setVersion("1.0.0");
		group.setVersions(Arrays.asList(info));
		PhrescoDynamicLoader loader = new PhrescoDynamicLoader(repoinfo,
				Arrays.asList(group));
		ApplicationProcessor applicationProcessor = loader
				.getApplicationProcessor("com.photon.sample.appprocessor.testappprocessor.TestApplicationProcessor");
		applicationProcessor.preCreate(null);
	}

}


text:
class TestResultsController < ApplicationController
  protect_from_forgery with: :exception

  before_action :load_ivars

  def index
    @results = @results.order("updated_at desc").limit(50)
  end

  def show
    render json: TestResult.new
  end

  def create
    Rails.logger.debug params
    tr = TestResult.create(
      {
        params:      cleaned_params,
        test_name:   params[:test_name],
        test_value:  params[:test_value],
        request_url: params[:request_url],
        user_agent:  request.user_agent,
        ip_address:  request.remote_ip,
      }
    )

    if tr.valid?
      render json: tr
    else
      render json: { errors: tr.errors }, status: 422
    end
  end

  private
  def cleaned_params
    params.reject { |(k,v)| k == 'authenticity_token' }
  end

  def load_ivars
    only = params[:test_name]

    if !!only
      @results = TestResult.where(test_name: only)
    else
      @results = TestResult.all
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
@interface MyGamesViewController : UITableViewController <NSURLConnectionDelegate>

@property (nonatomic, strong) NSMutableData *webData;
@property (nonatomic, strong) NSString *username;
@property (nonatomic, strong) UIActivityIndicatorView *activityIndicator;
@property (nonatomic, strong) GameDetailViewController *gameDetailViewController;

@end


text:
@echo off
@REM you need to set env variables : JAVAHOME, or modify the 2 values here

set SAMPLEDIR=.

setlocal

:SETENV
set PATH=%JAVAHOME%\bin;%PATH%
set LOCALCLASSPATH=%CD%\lib;%CD%\build\classes
for %%i in ("lib\*.jar") do call lcp.bat %CD%\%%i
set LOCALCLASSPATH=%LOCALCLASSPATH%;%CLASSPATH%

:next
if [%1]==[] goto argend
   set ARG=%ARG% %1
   shift
   goto next
:argend

:DORUN

%JAVAHOME%\bin\java -cp "%LOCALCLASSPATH%;.\src\main\java" -Xmx256M %ARG%
popd

endlocal

:END


text:
FROM centos/s2i-base-centos7

# This image provides a Node.JS environment you can use to run your Node.JS
# applications.

EXPOSE 8080

# Add $HOME/node_modules/.bin to the $PATH, allowing user to make npm scripts
# available on the CLI without using npm's --global installation mode
# This image will be initialized with "npm run $NPM_RUN"
# See https://docs.npmjs.com/misc/scripts, and your repo's package.json
# file for possible values of NPM_RUN
ENV NODEJS_VERSION=6 \
    NPM_RUN=start \
    NPM_CONFIG_PREFIX=$HOME/.npm-global \
    PATH=$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:$PATH

ENV SUMMARY="Platform for building and running Node.js $NODEJS_VERSION applications" \
    DESCRIPTION="Node.js $NODEJS_VERSION available as docker container is a base platform for \
building and running various Node.js $NODEJS_VERSION applications and frameworks. \
Node.js is a platform built on Chrome's JavaScript runtime for easily building \
fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model \
that makes it lightweight and efficient, perfect for data-intensive real-time applications \
that run across distributed devices."

LABEL summary="$SUMMARY" \
      description="$DESCRIPTION" \
      io.k8s.description="$DESCRIPTION" \
      io.k8s.display-name="Node.js $NODEJS_VERSION" \
      io.openshift.expose-services="8080:http" \
      io.openshift.tags="builder,nodejs,nodejs$NODEJS_VERSION" \
      com.redhat.dev-mode="DEV_MODE:false" \
      com.redhat.deployments-dir="/opt/app-root/src" \
      com.redhat.dev-mode.port="DEBUG_PORT:5858"\
      com.redhat.component="rh-nodejs6-docker" \
      name="centos/nodejs-6-centos7" \
      version="6" \
      release="1" \
      maintainer="SoftwareCollections.org <sclorg@redhat.com>"

RUN yum install -y centos-release-scl-rh && \
    yum-config-manager --enable centos-sclo-rh-testing && \
    INSTALL_PKGS="rh-nodejs6 rh-nodejs6-npm rh-nodejs6-nodejs-nodemon nss_wrapper libaio" && \
    ln -s /usr/lib/node_modules/nodemon/bin/nodemon.js /usr/bin/nodemon && \
    yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
    rpm -V $INSTALL_PKGS && \
    yum clean all -y

# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
COPY ./s2i/bin/ $STI_SCRIPTS_PATH

# Copy extra files to the image.
COPY ./root/ /

ADD oracle-instantclient*.rpm /tmp/

RUN  yum -y install /tmp/oracle-instantclient*.rpm && \
     yum clean all && \
     rm -f /tmp/oracle-instantclient*.rpm && \
     echo /usr/lib/oracle/12.2/client64/lib > /etc/ld.so.conf.d/oracle-instantclient12.2.conf && \
     ldconfig

ENV PATH=$PATH:/usr/lib/oracle/12.2/client64/bin

# Drop the root user and make the content of /opt/app-root owned by user 1001
RUN chown -R 1001:0 /opt/app-root && chmod -R ug+rwx /opt/app-root
USER 1001

# Set the default CMD to print the usage of the language image
CMD $STI_SCRIPTS_PATH/usage


text:
module WorldCat
  module Discovery

    # A generic resource corresponding to the document representing a bibliographic resource.
    # This class should not be used by clients, rather WorldCat::Discovery::Bib objects should
    # be used instead.

    class GenericResource < Spira::Base

      property :about, :predicate => SCHEMA_ABOUT, :type => 'Bib'
      has_many :datasets, :predicate => VOID_IN_DATASET, :type => RDF::URI
      property :date_modified, :predicate => SCHEMA_DATE_MODIFIED, :type => XSD.string

    end
  end
end


text:
LibGdx Utils
============
Some utility classes/tests that I have created for, and using, LibGdx.


text:
<!DOCTYPE html>

{% include head.html %}

  {% include analytics.html %}
  {% include header.html %}

  {{ content }}

  {% include footer.html %}


text:
var { generateClientCode, JS_TYPE } = require("../generateClient")
var fs = require("fs")

function withExampleClient(mapName, callback) {
  // Generate some code and write it to a file
  var exampleOperations = [
    {name: "a", alias: "b"},
    {name: "c-d", alias: "e-f"}
  ]
  var jsCode = generateClientCode("example-client", exampleOperations, JS_TYPE)
  var filename = "./" + mapName + ".js"
  fs.writeFileSync(filename, jsCode)

  // Load the module and use it
  var exampleModule = require("../../" + mapName)
  callback(exampleModule)

  // Clean up the generated file
  fs.unlinkSync(filename)
}

it("generates a valid JavaScript module that maps names to operations", () => {
  withExampleClient("map1", (exampleClient) => {
    // It does the mapping
    expect(exampleClient.getPersistedQueryAlias("a")).toEqual("b")
    expect(exampleClient.getPersistedQueryAlias("c-d")).toEqual("e-f")
    // It returns a param
    expect(exampleClient.getOperationId("a")).toEqual("example-client/b")
  })
})

it("generates an Apollo middleware", () => {
  withExampleClient("map2", (exampleClient) => {
    var nextWasCalled = false
    var next = () => {
      nextWasCalled = true
    }
    var req = {
      operationName: "a",
      query: "x"
    }

    exampleClient.apolloMiddleware.applyMiddleware({request: req}, next)

    expect(nextWasCalled).toEqual(true)
    expect(req.query).toBeUndefined()
    expect(req.operationId).toEqual("example-client/b")
  })
})

it("generates an Apollo Link", () => {
  var fakeOperation = {
    operationName: "a",
    context: null,
    setContext: function(c) {
      this.context = c
    },
    extensions: {},
  }

  var forwardedOperation = null
  var fakeForward = function(operation) {
    forwardedOperation = operation
  }

  withExampleClient("map3", (exampleClient) => {
    exampleClient.apolloLink(fakeOperation, fakeForward)

    expect(fakeOperation.extensions.operationId).toEqual("example-client/b")
    expect(fakeOperation.context.http).toEqual({includeQuery: false, includeExtensions: true})
    expect(forwardedOperation).toEqua;(fakeOperation)
  })
})


text:
#ifndef _LINUX_SUNRPC_XPRT_RDMA_H
#define _LINUX_SUNRPC_XPRT_RDMA_H

#include <linux/wait.h> 		/* wait_queue_head_t, etc */
#include <linux/spinlock.h> 		/* spinlock_t, etc */
#include <linux/atomic.h>			/* atomic_t, etc */

#include <rdma/rdma_cm.h>		/* RDMA connection api */
#include <rdma/ib_verbs.h>		/* RDMA verbs api */

#include <linux/sunrpc/clnt.h> 		/* rpc_xprt */
#include <linux/sunrpc/rpc_rdma.h> 	/* RPC/RDMA protocol */
#include <linux/sunrpc/xprtrdma.h> 	/* xprt parameters */

#define RDMA_RESOLVE_TIMEOUT	(5000)	/* 5 seconds */
#define RDMA_CONNECT_RETRY_MAX	(2)	/* retries if no listener backlog */

/*
 * Interface Adapter -- one per transport instance
 */
struct rpcrdma_ia {
	struct rdma_cm_id 	*ri_id;
	struct ib_pd		*ri_pd;
	struct ib_mr		*ri_bind_mem;
	u32			ri_dma_lkey;
	int			ri_have_dma_lkey;
	struct completion	ri_done;
	int			ri_async_rc;
	enum rpcrdma_memreg	ri_memreg_strategy;
};

/*
 * RDMA Endpoint -- one per transport instance
 */

struct rpcrdma_ep {
	atomic_t		rep_cqcount;
	int			rep_cqinit;
	int			rep_connected;
	struct rpcrdma_ia	*rep_ia;
	struct ib_cq		*rep_cq;
	struct ib_qp_init_attr	rep_attr;
	wait_queue_head_t 	rep_connect_wait;
	struct ib_sge		rep_pad;	/* holds zeroed pad */
	struct ib_mr		*rep_pad_mr;	/* holds zeroed pad */
	void			(*rep_func)(struct rpcrdma_ep *);
	struct rpc_xprt		*rep_xprt;	/* for rep_func */
	struct rdma_conn_param	rep_remote_cma;
	struct sockaddr_storage	rep_remote_addr;
};

#define INIT_CQCOUNT(ep) atomic_set(&(ep)->rep_cqcount, (ep)->rep_cqinit)
#define DECR_CQCOUNT(ep) atomic_sub_return(1, &(ep)->rep_cqcount)

/*
 * struct rpcrdma_rep -- this structure encapsulates state required to recv
 * and complete a reply, asychronously. It needs several pieces of
 * state:
 *   o recv buffer (posted to provider)
 *   o ib_sge (also donated to provider)
 *   o status of reply (length, success or not)
 *   o bookkeeping state to get run by tasklet (list, etc)
 *
 * These are allocated during initialization, per-transport instance;
 * however, the tasklet execution list itself is global, as it should
 * always be pretty short.
 *
 * N of these are associated with a transport instance, and stored in
 * struct rpcrdma_buffer. N is the max number of outstanding requests.
 */

/* temporary static scatter/gather max */
#define RPCRDMA_MAX_DATA_SEGS	(64)	/* max scatter/gather */
#define RPCRDMA_MAX_SEGS 	(RPCRDMA_MAX_DATA_SEGS + 2) /* head+tail = 2 */
#define MAX_RPCRDMAHDR	(\
	/* max supported RPC/RDMA header */ \
	sizeof(struct rpcrdma_msg) + (2 * sizeof(u32)) + \
	(sizeof(struct rpcrdma_read_chunk) * RPCRDMA_MAX_SEGS) + sizeof(u32))

struct rpcrdma_buffer;

struct rpcrdma_rep {
	unsigned int	rr_len;		/* actual received reply length */
	struct rpcrdma_buffer *rr_buffer; /* home base for this structure */
	struct rpc_xprt	*rr_xprt;	/* needed for request/reply matching */
	void (*rr_func)(struct rpcrdma_rep *);/* called by tasklet in softint */
	struct list_head rr_list;	/* tasklet list */
	wait_queue_head_t rr_unbind;	/* optional unbind wait */
	struct ib_sge	rr_iov;		/* for posting */
	struct ib_mr	*rr_handle;	/* handle for mem in rr_iov */
	char	rr_base[MAX_RPCRDMAHDR]; /* minimal inline receive buffer */
};

/*
 * struct rpcrdma_req -- structure central to the request/reply sequence.
 *
 * N of these are associated with a transport instance, and stored in
 * struct rpcrdma_buffer. N is the max number of outstanding requests.
 *
 * It includes pre-registered buffer memory for send AND recv.
 * The recv buffer, however, is not owned by this structure, and
 * is "donated" to the hardware when a recv is posted. When a
 * reply is handled, the recv buffer used is given back to the
 * struct rpcrdma_req associated with the request.
 *
 * In addition to the basic memory, this structure includes an array
 * of iovs for send operations. The reason is that the iovs passed to
 * ib_post_{send,recv} must not be modified until the work request
 * completes.
 *
 * NOTES:
 *   o RPCRDMA_MAX_SEGS is the max number of addressible chunk elements we
 *     marshal. The number needed varies depending on the iov lists that
 *     are passed to us, the memory registration mode we are in, and if
 *     physical addressing is used, the layout.
 */

struct rpcrdma_mr_seg {		/* chunk descriptors */
	union {				/* chunk memory handles */
		struct ib_mr	*rl_mr;		/* if registered directly */
		struct rpcrdma_mw {		/* if registered from region */
			union {
				struct ib_mw	*mw;
				struct ib_fmr	*fmr;
				struct {
					struct ib_fast_reg_page_list *fr_pgl;
					struct ib_mr *fr_mr;
					enum { FRMR_IS_INVALID, FRMR_IS_VALID  } state;
				} frmr;
			} r;
			struct list_head mw_list;
		} *rl_mw;
	} mr_chunk;
	u64		mr_base;	/* registration result */
	u32		mr_rkey;	/* registration result */
	u32		mr_len;		/* length of chunk or segment */
	int		mr_nsegs;	/* number of segments in chunk or 0 */
	enum dma_data_direction	mr_dir;	/* segment mapping direction */
	dma_addr_t	mr_dma;		/* segment mapping address */
	size_t		mr_dmalen;	/* segment mapping length */
	struct page	*mr_page;	/* owning page, if any */
	char		*mr_offset;	/* kva if no page, else offset */
};

struct rpcrdma_req {
	size_t 		rl_size;	/* actual length of buffer */
	unsigned int	rl_niovs;	/* 0, 2 or 4 */
	unsigned int	rl_nchunks;	/* non-zero if chunks */
	unsigned int	rl_connect_cookie;	/* retry detection */
	struct rpcrdma_buffer *rl_buffer; /* home base for this structure */
	struct rpcrdma_rep	*rl_reply;/* holder for reply buffer */
	struct rpcrdma_mr_seg rl_segments[RPCRDMA_MAX_SEGS];/* chunk segments */
	struct ib_sge	rl_send_iov[4];	/* for active requests */
	struct ib_sge	rl_iov;		/* for posting */
	struct ib_mr	*rl_handle;	/* handle for mem in rl_iov */
	char		rl_base[MAX_RPCRDMAHDR]; /* start of actual buffer */
	__u32 		rl_xdr_buf[0];	/* start of returned rpc rq_buffer */
};
#define rpcr_to_rdmar(r) \
	container_of((r)->rq_buffer, struct rpcrdma_req, rl_xdr_buf[0])

/*
 * struct rpcrdma_buffer -- holds list/queue of pre-registered memory for
 * inline requests/replies, and client/server credits.
 *
 * One of these is associated with a transport instance
 */
struct rpcrdma_buffer {
	spinlock_t	rb_lock;	/* protects indexes */
	atomic_t	rb_credits;	/* most recent server credits */
	unsigned long	rb_cwndscale;	/* cached framework rpc_cwndscale */
	int		rb_max_requests;/* client max requests */
	struct list_head rb_mws;	/* optional memory windows/fmrs/frmrs */
	int		rb_send_index;
	struct rpcrdma_req	**rb_send_bufs;
	int		rb_recv_index;
	struct rpcrdma_rep	**rb_recv_bufs;
	char		*rb_pool;
};
#define rdmab_to_ia(b) (&container_of((b), struct rpcrdma_xprt, rx_buf)->rx_ia)

/*
 * Internal structure for transport instance creation. This
 * exists primarily for modularity.
 *
 * This data should be set with mount options
 */
struct rpcrdma_create_data_internal {
	struct sockaddr_storage	addr;	/* RDMA server address */
	unsigned int	max_requests;	/* max requests (slots) in flight */
	unsigned int	rsize;		/* mount rsize - max read hdr+data */
	unsigned int	wsize;		/* mount wsize - max write hdr+data */
	unsigned int	inline_rsize;	/* max non-rdma read data payload */
	unsigned int	inline_wsize;	/* max non-rdma write data payload */
	unsigned int	padding;	/* non-rdma write header padding */
};

#define RPCRDMA_INLINE_READ_THRESHOLD(rq) \
	(rpcx_to_rdmad(rq->rq_task->tk_xprt).inline_rsize)

#define RPCRDMA_INLINE_WRITE_THRESHOLD(rq)\
	(rpcx_to_rdmad(rq->rq_task->tk_xprt).inline_wsize)

#define RPCRDMA_INLINE_PAD_VALUE(rq)\
	rpcx_to_rdmad(rq->rq_task->tk_xprt).padding

/*
 * Statistics for RPCRDMA
 */
struct rpcrdma_stats {
	unsigned long		read_chunk_count;
	unsigned long		write_chunk_count;
	unsigned long		reply_chunk_count;

	unsigned long long	total_rdma_request;
	unsigned long long	total_rdma_reply;

	unsigned long long	pullup_copy_count;
	unsigned long long	fixup_copy_count;
	unsigned long		hardway_register_count;
	unsigned long		failed_marshal_count;
	unsigned long		bad_reply_count;
};

/*
 * RPCRDMA transport -- encapsulates the structures above for
 * integration with RPC.
 *
 * The contained structures are embedded, not pointers,
 * for convenience. This structure need not be visible externally.
 *
 * It is allocated and initialized during mount, and released
 * during unmount.
 */
struct rpcrdma_xprt {
	struct rpc_xprt		xprt;
	struct rpcrdma_ia	rx_ia;
	struct rpcrdma_ep	rx_ep;
	struct rpcrdma_buffer	rx_buf;
	struct rpcrdma_create_data_internal rx_data;
	struct delayed_work	rdma_connect;
	struct rpcrdma_stats	rx_stats;
};

#define rpcx_to_rdmax(x) container_of(x, struct rpcrdma_xprt, xprt)
#define rpcx_to_rdmad(x) (rpcx_to_rdmax(x)->rx_data)

/* Setting this to 0 ensures interoperability with early servers.
 * Setting this to 1 enhances certain unaligned read/write performance.
 * Default is 0, see sysctl entry and rpc_rdma.c rpcrdma_convert_iovs() */
extern int xprt_rdma_pad_optimize;

/*
 * Interface Adapter calls - xprtrdma/verbs.c
 */
int rpcrdma_ia_open(struct rpcrdma_xprt *, struct sockaddr *, int);
void rpcrdma_ia_close(struct rpcrdma_ia *);

/*
 * Endpoint calls - xprtrdma/verbs.c
 */
int rpcrdma_ep_create(struct rpcrdma_ep *, struct rpcrdma_ia *,
				struct rpcrdma_create_data_internal *);
int rpcrdma_ep_destroy(struct rpcrdma_ep *, struct rpcrdma_ia *);
int rpcrdma_ep_connect(struct rpcrdma_ep *, struct rpcrdma_ia *);
int rpcrdma_ep_disconnect(struct rpcrdma_ep *, struct rpcrdma_ia *);

int rpcrdma_ep_post(struct rpcrdma_ia *, struct rpcrdma_ep *,
				struct rpcrdma_req *);
int rpcrdma_ep_post_recv(struct rpcrdma_ia *, struct rpcrdma_ep *,
				struct rpcrdma_rep *);

/*
 * Buffer calls - xprtrdma/verbs.c
 */
int rpcrdma_buffer_create(struct rpcrdma_buffer *, struct rpcrdma_ep *,
				struct rpcrdma_ia *,
				struct rpcrdma_create_data_internal *);
void rpcrdma_buffer_destroy(struct rpcrdma_buffer *);

struct rpcrdma_req *rpcrdma_buffer_get(struct rpcrdma_buffer *);
void rpcrdma_buffer_put(struct rpcrdma_req *);
void rpcrdma_recv_buffer_get(struct rpcrdma_req *);
void rpcrdma_recv_buffer_put(struct rpcrdma_rep *);

int rpcrdma_register_internal(struct rpcrdma_ia *, void *, int,
				struct ib_mr **, struct ib_sge *);
int rpcrdma_deregister_internal(struct rpcrdma_ia *,
				struct ib_mr *, struct ib_sge *);

int rpcrdma_register_external(struct rpcrdma_mr_seg *,
				int, int, struct rpcrdma_xprt *);
int rpcrdma_deregister_external(struct rpcrdma_mr_seg *,
				struct rpcrdma_xprt *, void *);

/*
 * RPC/RDMA connection management calls - xprtrdma/rpc_rdma.c
 */
void rpcrdma_conn_func(struct rpcrdma_ep *);
void rpcrdma_reply_handler(struct rpcrdma_rep *);

/*
 * RPC/RDMA protocol calls - xprtrdma/rpc_rdma.c
 */
int rpcrdma_marshal_req(struct rpc_rqst *);

#endif				/* _LINUX_SUNRPC_XPRT_RDMA_H */


text:
package gssp

type CSSSelector struct {
	Selector        string `json:"selector"`
	ControlSelector bool   `json:"atrule"`
	Before          string `json:"before"`
	After           string `json:"after"`
	RawData         string `json:"raw"`
	RawOffset       int    `json:"-"`
}

func NewSelector(selBytes []byte) *CSSSelector {
	before, selector, after, offset := parseBytes(selBytes)
	var isControl bool

	if len(selector) > 0 && selector[0] == CONTROL_SIGNATURE {
		isControl = true
	} else {
		isControl = false
	}

	return &CSSSelector{
		Before:          string(before),
		Selector:        string(selector),
		ControlSelector: isControl,
		After:           string(after),
		RawData:         string(selBytes),
		RawOffset:       offset,
	}
}

func (s *CSSSelector) String() string {
	return s.Selector
}

func (s *CSSSelector) IsControlSelector() bool {
	return s.ControlSelector
}


text:
import type { CSpellSettings, DictionaryId, LocaleId } from '@cspell/cspell-types';
import { genSequence } from 'gensequence';
import { LanguageId } from './LanguageIds';
import { finalizeSettings, mergeSettings } from './Settings';
import { calcSettingsForLanguageId } from './Settings/LanguageSettings';
import { getDictionary, HasOptions, SpellingDictionaryCollection } from './SpellingDictionary';
import * as util from './util/util';

export interface TraceResult {
    word: string;
    found: boolean;
    foundWord: string | undefined;
    forbidden: boolean;
    noSuggest: boolean;
    dictName: string;
    dictSource: string;
    dictActive: boolean;
    configSource: string;
    errors: Error[] | undefined;
}

export interface TraceOptions {
    languageId?: LanguageId | LanguageId[];
    locale?: LocaleId;
    ignoreCase?: boolean;
}

export async function traceWords(
    words: string[],
    settings: CSpellSettings,
    options: TraceOptions | undefined
): Promise<TraceResult[]> {
    const { languageId, locale: language, ignoreCase = true } = options || {};

    async function finalize(config: CSpellSettings): Promise<{
        activeDictionaries: DictionaryId[];
        config: CSpellSettings;
        dicts: SpellingDictionaryCollection;
    }> {
        const withLocale = mergeSettings(config, { language });
        const withLanguageId = calcSettingsForLanguageId(
            withLocale,
            languageId ?? withLocale.languageId ?? 'plaintext'
        );
        const settings = finalizeSettings(withLanguageId);
        const dictionaries = (settings.dictionaries || [])
            .concat((settings.dictionaryDefinitions || []).map((d) => d.name))
            .filter(util.uniqueFn);
        const dictSettings: CSpellSettings = { ...settings, dictionaries };
        const dictBase = await getDictionary(settings);
        const dicts = await getDictionary(dictSettings);
        const activeDictionaries = dictBase.dictionaries.map((d) => d.name);
        return {
            activeDictionaries,
            config: settings,
            dicts,
        };
    }
    const { config, dicts, activeDictionaries } = await finalize(settings);

    const setOfActiveDicts = new Set(activeDictionaries);
    const opts: HasOptions = { ignoreCase, useCompounds: config.allowCompoundWords };

    const r = await Promise.all(
        genSequence(words)
            // Combine the words with the configs
            .map((word) => ({ word, config, dicts }))
            .toArray()
    );

    function normalizeErrors(errors: Error[] | undefined): Error[] | undefined {
        if (!errors?.length) return undefined;
        return errors;
    }

    // Search each dictionary for the word
    const s = genSequence(r)
        .concatMap((p) => {
            const { word, config, dicts } = p;
            return dicts.dictionaries
                .map((dict) => ({ dict, findResult: dict.find(word, opts) }))
                .map(({ dict, findResult }) => ({
                    word,
                    found: !!findResult?.found,
                    foundWord: findResult?.found || undefined,
                    forbidden: findResult?.forbidden || false,
                    noSuggest: findResult?.noSuggest || false,
                    dictName: dict.name,
                    dictSource: dict.source,
                    dictActive: setOfActiveDicts.has(dict.name),
                    configSource: config.name || '',
                    errors: normalizeErrors(dict.getErrors?.()),
                }));
        })
        .toArray();

    return s;
}


text:
import os
import stat
import unittest

from testfixtures import TempDirectory

from cosmos.cli.home_dir import HomeDir
import cosmos.cli.home_dir as home_dir
from cosmos.common.tests.util import collect_outputs

class PathHomeDir(HomeDir):
    """Concrete class for testing the functionality of HomeDir"""

    def __init__(self, path):
        self.path = path

    def get_path(self):
        return self.path

    def get_default_config_filename(self):
        return ".cosmosrc"

    def get_last_cluster_filename(self):
        return ".cosmoslast"

class HomeDirTest(unittest.TestCase):

    def setUp(self):
        self.temp_dir = TempDirectory(create=True)
        self.home = PathHomeDir(self.temp_dir.path)

    def tearDown(self):
        self.temp_dir.cleanup()

    def test_read(self):
        self.temp_dir.write("filename", "contents")
        self.assertEquals(self.home.read("filename"), "contents")

    def test_write(self):
        self.temp_dir.write("existing_file", "existing_contents")
        self.home.write("new_file", "contents")
        self.home.write("existing_file", "new_contents")
        self.assertEquals(self.temp_dir.read("existing_file"),
                          "new_contents")
        self.assertEquals(self.temp_dir.read("new_file"), "contents")

    def test_config_file(self):
        with collect_outputs() as outputs:
            self.home.write_config_file("new config")
            self.temp_dir.check(".cosmosrc")
            self.assertEquals(self.home.read_config_file(), "new config")
            self.assertIn("Settings saved", outputs.stdout.getvalue())
            file_mode = os.stat(self.temp_dir.getpath(".cosmosrc")).st_mode
            self.assertEquals(file_mode, stat.S_IFREG | stat.S_IRUSR | stat.S_IWUSR)

    def test_override_config_file(self):
        with collect_outputs():
            other_config = self.temp_dir.write("path/other", "config")
            self.assertEquals(
                self.home.read_config_file(filename_override=other_config),
                "config")

    def test_warn_on_unprotected_config_file(self):
        with collect_outputs() as outputs:
            self.home.write_config_file("new config")
            config_path = self.temp_dir.getpath(".cosmosrc")
            os.chmod(config_path, 0777)
            self.home.read_config_file()
            assertFunc = (self.assertNotIn if os.name=='nt' else self.assertIn)
            assertFunc("WARNING", outputs.stderr.getvalue())

    def test_last_cluster(self):
        self.home.write_last_cluster("0000000")
        self.temp_dir.check(".cosmoslast")
        self.assertEquals(self.home.read_last_cluster(), "0000000")

class SelectHomeDirTest(unittest.TestCase):

    def test_get_home_dir(self):
        self.assertIsNotNone(home_dir.get(), "Must select a home directory")


text:
package v3

import (
	"context"
	"sync"

	"github.com/rancher/norman/controller"
	"github.com/rancher/norman/objectclient"
	"github.com/rancher/norman/objectclient/dynamic"
	"github.com/rancher/norman/restwatch"
	"k8s.io/client-go/rest"
)

type (
	contextKeyType        struct{}
	contextClientsKeyType struct{}
)

type Interface interface {
	RESTClient() rest.Interface
	controller.Starter

	ServiceAccountTokensGetter
	DockerCredentialsGetter
	CertificatesGetter
	BasicAuthsGetter
	SSHAuthsGetter
	NamespacedServiceAccountTokensGetter
	NamespacedDockerCredentialsGetter
	NamespacedCertificatesGetter
	NamespacedBasicAuthsGetter
	NamespacedSSHAuthsGetter
	WorkloadsGetter
	AppsGetter
	AppRevisionsGetter
	SourceCodeProvidersGetter
	SourceCodeProviderConfigsGetter
	SourceCodeCredentialsGetter
	PipelinesGetter
	PipelineExecutionsGetter
	PipelineSettingsGetter
	SourceCodeRepositoriesGetter
}

type Clients struct {
	Interface Interface

	ServiceAccountToken           ServiceAccountTokenClient
	DockerCredential              DockerCredentialClient
	Certificate                   CertificateClient
	BasicAuth                     BasicAuthClient
	SSHAuth                       SSHAuthClient
	NamespacedServiceAccountToken NamespacedServiceAccountTokenClient
	NamespacedDockerCredential    NamespacedDockerCredentialClient
	NamespacedCertificate         NamespacedCertificateClient
	NamespacedBasicAuth           NamespacedBasicAuthClient
	NamespacedSSHAuth             NamespacedSSHAuthClient
	Workload                      WorkloadClient
	App                           AppClient
	AppRevision                   AppRevisionClient
	SourceCodeProvider            SourceCodeProviderClient
	SourceCodeProviderConfig      SourceCodeProviderConfigClient
	SourceCodeCredential          SourceCodeCredentialClient
	Pipeline                      PipelineClient
	PipelineExecution             PipelineExecutionClient
	PipelineSetting               PipelineSettingClient
	SourceCodeRepository          SourceCodeRepositoryClient
}

type Client struct {
	sync.Mutex
	restClient rest.Interface
	starters   []controller.Starter

	serviceAccountTokenControllers           map[string]ServiceAccountTokenController
	dockerCredentialControllers              map[string]DockerCredentialController
	certificateControllers                   map[string]CertificateController
	basicAuthControllers                     map[string]BasicAuthController
	sshAuthControllers                       map[string]SSHAuthController
	namespacedServiceAccountTokenControllers map[string]NamespacedServiceAccountTokenController
	namespacedDockerCredentialControllers    map[string]NamespacedDockerCredentialController
	namespacedCertificateControllers         map[string]NamespacedCertificateController
	namespacedBasicAuthControllers           map[string]NamespacedBasicAuthController
	namespacedSshAuthControllers             map[string]NamespacedSSHAuthController
	workloadControllers                      map[string]WorkloadController
	appControllers                           map[string]AppController
	appRevisionControllers                   map[string]AppRevisionController
	sourceCodeProviderControllers            map[string]SourceCodeProviderController
	sourceCodeProviderConfigControllers      map[string]SourceCodeProviderConfigController
	sourceCodeCredentialControllers          map[string]SourceCodeCredentialController
	pipelineControllers                      map[string]PipelineController
	pipelineExecutionControllers             map[string]PipelineExecutionController
	pipelineSettingControllers               map[string]PipelineSettingController
	sourceCodeRepositoryControllers          map[string]SourceCodeRepositoryController
}

func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error) {
	c, err := NewForConfig(config)
	if err != nil {
		return ctx, nil, err
	}

	cs := NewClientsFromInterface(c)

	ctx = context.WithValue(ctx, contextKeyType{}, c)
	ctx = context.WithValue(ctx, contextClientsKeyType{}, cs)
	return ctx, c, nil
}

func ClientsFrom(ctx context.Context) *Clients {
	return ctx.Value(contextClientsKeyType{}).(*Clients)
}

func From(ctx context.Context) Interface {
	return ctx.Value(contextKeyType{}).(Interface)
}

func NewClients(config rest.Config) (*Clients, error) {
	iface, err := NewForConfig(config)
	if err != nil {
		return nil, err
	}
	return NewClientsFromInterface(iface), nil
}

func NewClientsFromInterface(iface Interface) *Clients {
	return &Clients{
		Interface: iface,

		ServiceAccountToken: &serviceAccountTokenClient2{
			iface: iface.ServiceAccountTokens(""),
		},
		DockerCredential: &dockerCredentialClient2{
			iface: iface.DockerCredentials(""),
		},
		Certificate: &certificateClient2{
			iface: iface.Certificates(""),
		},
		BasicAuth: &basicAuthClient2{
			iface: iface.BasicAuths(""),
		},
		SSHAuth: &sshAuthClient2{
			iface: iface.SSHAuths(""),
		},
		NamespacedServiceAccountToken: &namespacedServiceAccountTokenClient2{
			iface: iface.NamespacedServiceAccountTokens(""),
		},
		NamespacedDockerCredential: &namespacedDockerCredentialClient2{
			iface: iface.NamespacedDockerCredentials(""),
		},
		NamespacedCertificate: &namespacedCertificateClient2{
			iface: iface.NamespacedCertificates(""),
		},
		NamespacedBasicAuth: &namespacedBasicAuthClient2{
			iface: iface.NamespacedBasicAuths(""),
		},
		NamespacedSSHAuth: &namespacedSshAuthClient2{
			iface: iface.NamespacedSSHAuths(""),
		},
		Workload: &workloadClient2{
			iface: iface.Workloads(""),
		},
		App: &appClient2{
			iface: iface.Apps(""),
		},
		AppRevision: &appRevisionClient2{
			iface: iface.AppRevisions(""),
		},
		SourceCodeProvider: &sourceCodeProviderClient2{
			iface: iface.SourceCodeProviders(""),
		},
		SourceCodeProviderConfig: &sourceCodeProviderConfigClient2{
			iface: iface.SourceCodeProviderConfigs(""),
		},
		SourceCodeCredential: &sourceCodeCredentialClient2{
			iface: iface.SourceCodeCredentials(""),
		},
		Pipeline: &pipelineClient2{
			iface: iface.Pipelines(""),
		},
		PipelineExecution: &pipelineExecutionClient2{
			iface: iface.PipelineExecutions(""),
		},
		PipelineSetting: &pipelineSettingClient2{
			iface: iface.PipelineSettings(""),
		},
		SourceCodeRepository: &sourceCodeRepositoryClient2{
			iface: iface.SourceCodeRepositories(""),
		},
	}
}

func NewForConfig(config rest.Config) (Interface, error) {
	if config.NegotiatedSerializer == nil {
		config.NegotiatedSerializer = dynamic.NegotiatedSerializer
	}

	restClient, err := restwatch.UnversionedRESTClientFor(&config)
	if err != nil {
		return nil, err
	}

	return &Client{
		restClient: restClient,

		serviceAccountTokenControllers:           map[string]ServiceAccountTokenController{},
		dockerCredentialControllers:              map[string]DockerCredentialController{},
		certificateControllers:                   map[string]CertificateController{},
		basicAuthControllers:                     map[string]BasicAuthController{},
		sshAuthControllers:                       map[string]SSHAuthController{},
		namespacedServiceAccountTokenControllers: map[string]NamespacedServiceAccountTokenController{},
		namespacedDockerCredentialControllers:    map[string]NamespacedDockerCredentialController{},
		namespacedCertificateControllers:         map[string]NamespacedCertificateController{},
		namespacedBasicAuthControllers:           map[string]NamespacedBasicAuthController{},
		namespacedSshAuthControllers:             map[string]NamespacedSSHAuthController{},
		workloadControllers:                      map[string]WorkloadController{},
		appControllers:                           map[string]AppController{},
		appRevisionControllers:                   map[string]AppRevisionController{},
		sourceCodeProviderControllers:            map[string]SourceCodeProviderController{},
		sourceCodeProviderConfigControllers:      map[string]SourceCodeProviderConfigController{},
		sourceCodeCredentialControllers:          map[string]SourceCodeCredentialController{},
		pipelineControllers:                      map[string]PipelineController{},
		pipelineExecutionControllers:             map[string]PipelineExecutionController{},
		pipelineSettingControllers:               map[string]PipelineSettingController{},
		sourceCodeRepositoryControllers:          map[string]SourceCodeRepositoryController{},
	}, nil
}

func (c *Client) RESTClient() rest.Interface {
	return c.restClient
}

func (c *Client) Sync(ctx context.Context) error {
	return controller.Sync(ctx, c.starters...)
}

func (c *Client) Start(ctx context.Context, threadiness int) error {
	return controller.Start(ctx, threadiness, c.starters...)
}

type ServiceAccountTokensGetter interface {
	ServiceAccountTokens(namespace string) ServiceAccountTokenInterface
}

func (c *Client) ServiceAccountTokens(namespace string) ServiceAccountTokenInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ServiceAccountTokenResource, ServiceAccountTokenGroupVersionKind, serviceAccountTokenFactory{})
	return &serviceAccountTokenClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type DockerCredentialsGetter interface {
	DockerCredentials(namespace string) DockerCredentialInterface
}

func (c *Client) DockerCredentials(namespace string) DockerCredentialInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &DockerCredentialResource, DockerCredentialGroupVersionKind, dockerCredentialFactory{})
	return &dockerCredentialClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type CertificatesGetter interface {
	Certificates(namespace string) CertificateInterface
}

func (c *Client) Certificates(namespace string) CertificateInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &CertificateResource, CertificateGroupVersionKind, certificateFactory{})
	return &certificateClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type BasicAuthsGetter interface {
	BasicAuths(namespace string) BasicAuthInterface
}

func (c *Client) BasicAuths(namespace string) BasicAuthInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &BasicAuthResource, BasicAuthGroupVersionKind, basicAuthFactory{})
	return &basicAuthClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type SSHAuthsGetter interface {
	SSHAuths(namespace string) SSHAuthInterface
}

func (c *Client) SSHAuths(namespace string) SSHAuthInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &SSHAuthResource, SSHAuthGroupVersionKind, sshAuthFactory{})
	return &sshAuthClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type NamespacedServiceAccountTokensGetter interface {
	NamespacedServiceAccountTokens(namespace string) NamespacedServiceAccountTokenInterface
}

func (c *Client) NamespacedServiceAccountTokens(namespace string) NamespacedServiceAccountTokenInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &NamespacedServiceAccountTokenResource, NamespacedServiceAccountTokenGroupVersionKind, namespacedServiceAccountTokenFactory{})
	return &namespacedServiceAccountTokenClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type NamespacedDockerCredentialsGetter interface {
	NamespacedDockerCredentials(namespace string) NamespacedDockerCredentialInterface
}

func (c *Client) NamespacedDockerCredentials(namespace string) NamespacedDockerCredentialInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &NamespacedDockerCredentialResource, NamespacedDockerCredentialGroupVersionKind, namespacedDockerCredentialFactory{})
	return &namespacedDockerCredentialClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type NamespacedCertificatesGetter interface {
	NamespacedCertificates(namespace string) NamespacedCertificateInterface
}

func (c *Client) NamespacedCertificates(namespace string) NamespacedCertificateInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &NamespacedCertificateResource, NamespacedCertificateGroupVersionKind, namespacedCertificateFactory{})
	return &namespacedCertificateClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type NamespacedBasicAuthsGetter interface {
	NamespacedBasicAuths(namespace string) NamespacedBasicAuthInterface
}

func (c *Client) NamespacedBasicAuths(namespace string) NamespacedBasicAuthInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &NamespacedBasicAuthResource, NamespacedBasicAuthGroupVersionKind, namespacedBasicAuthFactory{})
	return &namespacedBasicAuthClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type NamespacedSSHAuthsGetter interface {
	NamespacedSSHAuths(namespace string) NamespacedSSHAuthInterface
}

func (c *Client) NamespacedSSHAuths(namespace string) NamespacedSSHAuthInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &NamespacedSSHAuthResource, NamespacedSSHAuthGroupVersionKind, namespacedSshAuthFactory{})
	return &namespacedSshAuthClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type WorkloadsGetter interface {
	Workloads(namespace string) WorkloadInterface
}

func (c *Client) Workloads(namespace string) WorkloadInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &WorkloadResource, WorkloadGroupVersionKind, workloadFactory{})
	return &workloadClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type AppsGetter interface {
	Apps(namespace string) AppInterface
}

func (c *Client) Apps(namespace string) AppInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &AppResource, AppGroupVersionKind, appFactory{})
	return &appClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type AppRevisionsGetter interface {
	AppRevisions(namespace string) AppRevisionInterface
}

func (c *Client) AppRevisions(namespace string) AppRevisionInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &AppRevisionResource, AppRevisionGroupVersionKind, appRevisionFactory{})
	return &appRevisionClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type SourceCodeProvidersGetter interface {
	SourceCodeProviders(namespace string) SourceCodeProviderInterface
}

func (c *Client) SourceCodeProviders(namespace string) SourceCodeProviderInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &SourceCodeProviderResource, SourceCodeProviderGroupVersionKind, sourceCodeProviderFactory{})
	return &sourceCodeProviderClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type SourceCodeProviderConfigsGetter interface {
	SourceCodeProviderConfigs(namespace string) SourceCodeProviderConfigInterface
}

func (c *Client) SourceCodeProviderConfigs(namespace string) SourceCodeProviderConfigInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &SourceCodeProviderConfigResource, SourceCodeProviderConfigGroupVersionKind, sourceCodeProviderConfigFactory{})
	return &sourceCodeProviderConfigClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type SourceCodeCredentialsGetter interface {
	SourceCodeCredentials(namespace string) SourceCodeCredentialInterface
}

func (c *Client) SourceCodeCredentials(namespace string) SourceCodeCredentialInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &SourceCodeCredentialResource, SourceCodeCredentialGroupVersionKind, sourceCodeCredentialFactory{})
	return &sourceCodeCredentialClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type PipelinesGetter interface {
	Pipelines(namespace string) PipelineInterface
}

func (c *Client) Pipelines(namespace string) PipelineInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &PipelineResource, PipelineGroupVersionKind, pipelineFactory{})
	return &pipelineClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type PipelineExecutionsGetter interface {
	PipelineExecutions(namespace string) PipelineExecutionInterface
}

func (c *Client) PipelineExecutions(namespace string) PipelineExecutionInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &PipelineExecutionResource, PipelineExecutionGroupVersionKind, pipelineExecutionFactory{})
	return &pipelineExecutionClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type PipelineSettingsGetter interface {
	PipelineSettings(namespace string) PipelineSettingInterface
}

func (c *Client) PipelineSettings(namespace string) PipelineSettingInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &PipelineSettingResource, PipelineSettingGroupVersionKind, pipelineSettingFactory{})
	return &pipelineSettingClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}

type SourceCodeRepositoriesGetter interface {
	SourceCodeRepositories(namespace string) SourceCodeRepositoryInterface
}

func (c *Client) SourceCodeRepositories(namespace string) SourceCodeRepositoryInterface {
	objectClient := objectclient.NewObjectClient(namespace, c.restClient, &SourceCodeRepositoryResource, SourceCodeRepositoryGroupVersionKind, sourceCodeRepositoryFactory{})
	return &sourceCodeRepositoryClient{
		ns:           namespace,
		client:       c,
		objectClient: objectClient,
	}
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>dev.html</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">

	<link href="../bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet" type="text/css">

	<link href="../less/fuelux.less" rel="stylesheet/less" type="text/css"/>

			Awesome Repeater

					<input type="search" class="form-control" placeholder="Search"/>

						<button class="btn btn-default" type="button">

							Search
						</button>

				<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">

					Toggle Filters
				</button>

All

Some

Others

				<input class="hidden hidden-field" name="filterSelection" readonly="readonly" aria-hidden="true" type="text"/>

					<input name="repeaterViews" type="radio" value="list">

					<input name="repeaterViews" type="radio" value="thumbnail">

				 -  of  items

					<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">

						Toggle Dropdown
					</button>

5

10

20

50

					<input class="hidden hidden-field" name="itemsPerPage" readonly="readonly" aria-hidden="true" type="text"/>

				Per Page

				<button type="button" class="btn btn-default btn-sm repeater-prev">

					Previous Page
				</button>
				Page

						<input type="text" class="form-control" aria-labelledby="myPageLabel1">

							<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">

								Toggle Dropdown
							</button>

				<input type="text" class="form-control repeater-secondaryPaging" aria-labelledby="myPageLabel1">
				of
				<button type="button" class="btn btn-default btn-sm repeater-next">

					Next Page
				</button>


text:
package org.flxbox2d.examples;

import org.flixel.FlxButton;
import org.flixel.FlxG;
import org.flixel.FlxState;
import org.flixel.FlxText;
import org.flixel.FlxU;
import org.flixel.event.IFlxButton;
import org.flxbox2d.B2FlxB;
import org.flxbox2d.B2FlxState;
import org.flxbox2d.collision.shapes.B2FlxBox;
import org.flxbox2d.collision.shapes.B2FlxShape;
import org.flxbox2d.dynamics.joints.B2FlxMouseJoint;
import org.flxbox2d.system.debug.B2FlxDebug;

import com.badlogic.gdx.Application;
import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.Gdx;

/**
 * A parent class for testing.
 *
 * @author Ka Wing Chin
 */
public class PlayState extends B2FlxState
{
	public static int currentTest = 0;
	private static final int AMOUNT_OF_TESTS = 24;
	public FlxText title;
	public FlxText info;
	public B2FlxMouseJoint mouse;
	public final short WALL = 0x0001;

	@Override
	public void create()
	{
		super.create();

		Gdx.app.setLogLevel(Application.LOG_DEBUG);

		if(!FlxG.mobile)
			FlxG.mouse.show();

		B2FlxB.setGravity(0, 9.8f);
		FlxG.visualDebug = true;
		FlxG.setBgColor(0xff000000);

		if(FlxG.mobile || Gdx.app.getType() == ApplicationType.WebGL)
			B2FlxDebug.drawCollisions = false;

//		B2FlxDebug.drawAABBs = true;

		B2FlxB.world.setWarmStarting(true);

		FlxG.camera.setBounds(0,0,1024,640,true);

		FlxText text = new FlxText(FlxG.width-190, 5, 180, "FlxBox2D for 2.55").setFormat(null, 8, 0xFFFFFF, "right");
		text.scrollFactor.x = text.scrollFactor.y = 0;
		text.ignoreDrawDebug = true;
		add(text);

		add(text = new FlxText(-10, 16, FlxG.width, "'Left/Right' arrows to go to previous/next example\n 'R' to reset.")
		.setFormat(null, 8, 0xFFFFFF, "right"));
		text.scrollFactor.x = text.scrollFactor.y = 0;
		text.ignoreDrawDebug = true;

		add(title = new FlxText(-10, 48, FlxG.width, "").setFormat(null, 16, 0x00CCFF, "right"));
		title.scrollFactor.x = title.scrollFactor.y = 0;
		title.ignoreDrawDebug = true;
		add(info = new FlxText(10, 5, FlxG.width, "").setFormat(null, 8, 0xFFFFFF));
		info.scrollFactor.x = info.scrollFactor.y = 0;
		info.ignoreDrawDebug = true;

		// Create walls
		// Left
		add(new B2FlxBox(0, 0, 5, FlxG.height).setType(B2FlxShape.STATIC).setCategoryBits((short) WALL).create());
		// Right
		add(new B2FlxBox(FlxG.width-5, 0, 5, FlxG.height).setType(B2FlxShape.STATIC).setCategoryBits((short) WALL).create());
		// Top
		add(new B2FlxBox(0, 0, FlxG.width, 5).setType(B2FlxShape.STATIC).setCategoryBits((short) WALL).create());
		// Bottom
		add(new B2FlxBox(0, FlxG.height-5, FlxG.width, 5).setType(B2FlxShape.STATIC).setCategoryBits((short) WALL).create());

		// Add mouse joint.
		add(mouse = new B2FlxMouseJoint());

		// Mobile
		if(FlxG.mobile)
		{
			add(createButton(2, FlxG.height - 20, "Previous", new IFlxButton(){@Override public void callback(){prev();}}));
			add(createButton(82, FlxG.height - 20, "Next", new IFlxButton(){@Override public void callback(){next();}}));
			add(createButton(162, FlxG.height - 20, "Reset", new IFlxButton(){@Override public void callback(){reset();}}));
		}
		String className = FlxU.getClassName(this, true);
		if(className.equals("PlayState") || className.equals("org.flxbox2d.examples.PlayState"))
		{
			try
			{
				switchState(currentTest);
			}
			catch(Exception e)
			{
				FlxG.log(e.getMessage());
				return;
			}
		}
	}

	public B2FlxBox createBox(float x, float y, float width, float height)
	{
		return new B2FlxBox(x, y, width, height)
		.setFriction(.8f)
		.setRestitution(.3f)
		.setDensity(.7f)
		.setDraggable(true)
		.create();
	}

	public FlxButton createButton(float x, float y, String label, IFlxButton callback)
	{
		FlxButton button = new FlxButton(x, y, label, callback);
		button.ignoreDrawDebug = true;
		button.scrollFactor.x = button.scrollFactor.y = 0;
		button.setSolid(false);
		button.moves = false;
		return button;
	}

	@Override
	public void update()
	{
		if(FlxG.keys.justPressed("RIGHT"))
			next();
		else if(FlxG.keys.justPressed("LEFT"))
			prev();
		else if(FlxG.keys.justPressed("R"))
			reset();
		super.update();
	}

	private void next()
	{
		if(AMOUNT_OF_TESTS <= ++currentTest)
			currentTest = 0;
		try
		{
			switchState(currentTest);
		}
		catch(Exception e)
		{
			FlxG.log(e.getMessage());
			return;
		}
	}

	private void prev()
	{
		if(0 > --currentTest)
			currentTest = AMOUNT_OF_TESTS-1;
		try
		{
			switchState(currentTest);
		}
		catch(Exception e)
		{
			FlxG.log(e.getMessage());
			return;
		}
	}

	private void switchState(int current)
	{
		FlxState state = null;
		switch(current)
		{
			case 0:
				state = new TestShapes();
				break;
			case 1:
				state = new TestDistanceJoint();
				break;
			case 2:
				state = new TestRopeJoint();
				break;
			case 3:
				state = new TestRevoluteJoint();
				break;
			case 4:
				state = new TestPrismaticJoint();
				break;
			case 5:
				state = new TestPulleyJoint();
				break;
			case 6:
				state = new TestGearJoint();
				break;
			case 7:
				state = new TestFrictionJoint();
				break;
			case 8:
				state = new TestWeldJoint();
				break;
			case 9:
				state = new TestWheelJoint();
				break;
			case 10:
				state = new TestCart();
				break;
			case 11:
				state = new TestRagdolls();
				break;
			case 12:
				state = new TestCompound();
				break;
			case 13:
				state = new TestCrankGearsPulley();
				break;
			case 14:
				state = new TestBridge();
				break;
			case 15:
				state = new TestStack();
				break;
			case 16:
				state = new TestCCD(); // Continuous Collision Detection
				break;
			case 17:
				state = new TestBuoyancy();
				break;
			case 18:
				state = new TestGravity();
				break;
			case 19:
				state = new TestOneSidedPlatform();
				break;
			case 20:
				state = new TestBreakable();
				break;
			case 21:
				state = new TestSensor();
				break;
			case 22:
				state = new TestCollisionDetection();
				break;
			case 23:
				state = new TestExplosion(); // Explosion & Implosion
				break;
			default:
				break;
		}
		if(state != null)
			FlxG.switchState(state);
//		TheoJansen.class 			// Theo Jansen
//		TestEdges.class,			// Edges
//		TestRaycast.class,			// Raycast
	}

	private void reset()
	{
		FlxG.resetState();
	}

	@Override
	public void destroy()
	{
		super.destroy();
		title = null;
		info = null;
		mouse = null;
	}
}


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.container.model;

/**
 * This operation resource represents operations that may have happened or are happening on the
 * cluster. All fields are output only.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Kubernetes Engine API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class Operation extends com.google.api.client.json.GenericJson {

  /**
   * Which conditions caused the current cluster state.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<StatusCondition> clusterConditions;

  /**
   * Detailed operation progress, if available.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String detail;

  /**
   * [Output only] The time the operation completed, in
   * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String endTime;

  /**
   * [Output only] The name of the Google Compute Engine
   * [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) or
   * [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) in which
   * the cluster resides.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String location;

  /**
   * The server-assigned ID for the operation.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String name;

  /**
   * Which conditions caused the current node pool state.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<StatusCondition> nodepoolConditions;

  /**
   * The operation type.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String operationType;

  /**
   * Output only. [Output only] Progress information for an operation.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private OperationProgress progress;

  /**
   * Server-defined URL for the resource.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String selfLink;

  /**
   * [Output only] The time the operation started, in
   * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String startTime;

  /**
   * The current status of the operation.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String status;

  /**
   * Output only. If an error has occurred, a textual description of the error.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String statusMessage;

  /**
   * Server-defined URL for the target of the operation.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String targetLink;

  /**
   * The name of the Google Compute Engine
   * [zone](https://cloud.google.com/compute/docs/zones#available) in which the operation is taking
   * place. This field is deprecated, use location instead.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String zone;

  /**
   * Which conditions caused the current cluster state.
   * @return value or {@code null} for none
   */
  public java.util.List<StatusCondition> getClusterConditions() {
    return clusterConditions;
  }

  /**
   * Which conditions caused the current cluster state.
   * @param clusterConditions clusterConditions or {@code null} for none
   */
  public Operation setClusterConditions(java.util.List<StatusCondition> clusterConditions) {
    this.clusterConditions = clusterConditions;
    return this;
  }

  /**
   * Detailed operation progress, if available.
   * @return value or {@code null} for none
   */
  public java.lang.String getDetail() {
    return detail;
  }

  /**
   * Detailed operation progress, if available.
   * @param detail detail or {@code null} for none
   */
  public Operation setDetail(java.lang.String detail) {
    this.detail = detail;
    return this;
  }

  /**
   * [Output only] The time the operation completed, in
   * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
   * @return value or {@code null} for none
   */
  public java.lang.String getEndTime() {
    return endTime;
  }

  /**
   * [Output only] The time the operation completed, in
   * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
   * @param endTime endTime or {@code null} for none
   */
  public Operation setEndTime(java.lang.String endTime) {
    this.endTime = endTime;
    return this;
  }

  /**
   * [Output only] The name of the Google Compute Engine
   * [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) or
   * [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) in which
   * the cluster resides.
   * @return value or {@code null} for none
   */
  public java.lang.String getLocation() {
    return location;
  }

  /**
   * [Output only] The name of the Google Compute Engine
   * [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) or
   * [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) in which
   * the cluster resides.
   * @param location location or {@code null} for none
   */
  public Operation setLocation(java.lang.String location) {
    this.location = location;
    return this;
  }

  /**
   * The server-assigned ID for the operation.
   * @return value or {@code null} for none
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * The server-assigned ID for the operation.
   * @param name name or {@code null} for none
   */
  public Operation setName(java.lang.String name) {
    this.name = name;
    return this;
  }

  /**
   * Which conditions caused the current node pool state.
   * @return value or {@code null} for none
   */
  public java.util.List<StatusCondition> getNodepoolConditions() {
    return nodepoolConditions;
  }

  /**
   * Which conditions caused the current node pool state.
   * @param nodepoolConditions nodepoolConditions or {@code null} for none
   */
  public Operation setNodepoolConditions(java.util.List<StatusCondition> nodepoolConditions) {
    this.nodepoolConditions = nodepoolConditions;
    return this;
  }

  /**
   * The operation type.
   * @return value or {@code null} for none
   */
  public java.lang.String getOperationType() {
    return operationType;
  }

  /**
   * The operation type.
   * @param operationType operationType or {@code null} for none
   */
  public Operation setOperationType(java.lang.String operationType) {
    this.operationType = operationType;
    return this;
  }

  /**
   * Output only. [Output only] Progress information for an operation.
   * @return value or {@code null} for none
   */
  public OperationProgress getProgress() {
    return progress;
  }

  /**
   * Output only. [Output only] Progress information for an operation.
   * @param progress progress or {@code null} for none
   */
  public Operation setProgress(OperationProgress progress) {
    this.progress = progress;
    return this;
  }

  /**
   * Server-defined URL for the resource.
   * @return value or {@code null} for none
   */
  public java.lang.String getSelfLink() {
    return selfLink;
  }

  /**
   * Server-defined URL for the resource.
   * @param selfLink selfLink or {@code null} for none
   */
  public Operation setSelfLink(java.lang.String selfLink) {
    this.selfLink = selfLink;
    return this;
  }

  /**
   * [Output only] The time the operation started, in
   * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
   * @return value or {@code null} for none
   */
  public java.lang.String getStartTime() {
    return startTime;
  }

  /**
   * [Output only] The time the operation started, in
   * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
   * @param startTime startTime or {@code null} for none
   */
  public Operation setStartTime(java.lang.String startTime) {
    this.startTime = startTime;
    return this;
  }

  /**
   * The current status of the operation.
   * @return value or {@code null} for none
   */
  public java.lang.String getStatus() {
    return status;
  }

  /**
   * The current status of the operation.
   * @param status status or {@code null} for none
   */
  public Operation setStatus(java.lang.String status) {
    this.status = status;
    return this;
  }

  /**
   * Output only. If an error has occurred, a textual description of the error.
   * @return value or {@code null} for none
   */
  public java.lang.String getStatusMessage() {
    return statusMessage;
  }

  /**
   * Output only. If an error has occurred, a textual description of the error.
   * @param statusMessage statusMessage or {@code null} for none
   */
  public Operation setStatusMessage(java.lang.String statusMessage) {
    this.statusMessage = statusMessage;
    return this;
  }

  /**
   * Server-defined URL for the target of the operation.
   * @return value or {@code null} for none
   */
  public java.lang.String getTargetLink() {
    return targetLink;
  }

  /**
   * Server-defined URL for the target of the operation.
   * @param targetLink targetLink or {@code null} for none
   */
  public Operation setTargetLink(java.lang.String targetLink) {
    this.targetLink = targetLink;
    return this;
  }

  /**
   * The name of the Google Compute Engine
   * [zone](https://cloud.google.com/compute/docs/zones#available) in which the operation is taking
   * place. This field is deprecated, use location instead.
   * @return value or {@code null} for none
   */
  public java.lang.String getZone() {
    return zone;
  }

  /**
   * The name of the Google Compute Engine
   * [zone](https://cloud.google.com/compute/docs/zones#available) in which the operation is taking
   * place. This field is deprecated, use location instead.
   * @param zone zone or {@code null} for none
   */
  public Operation setZone(java.lang.String zone) {
    this.zone = zone;
    return this;
  }

  @Override
  public Operation set(String fieldName, Object value) {
    return (Operation) super.set(fieldName, value);
  }

  @Override
  public Operation clone() {
    return (Operation) super.clone();
  }

}


text:
module Smithers
  module ConfigurationItems
    class Publishers
      class ExtMailer
        include LoggingHelper::LogToTerminal
        include Attributes::Mixin::Method
        extend Plugin::Registrar::Registrant

        register :job_publishers, :ext_mailer, self.inspect

        attr_reader :job, :configuration_block

        def initialize(job, parent, &block)
          @job = job
          @configuration_block = block
        end

        attr_method :recipients_list
        attr_method :subject
        attr_method :content
        attr_method :fail_trigger_recipients_list
        attr_method :always_trigger_recipients_list
         attr_method(
          {
            fail_trigger_notify_developer: "true"
          },
          {
            always_trigger: "true"
          }
        )

        def configure
          instance_exec(&configuration_block)

          triggers = {}
          fail_trigger_list_item = {}
          if fail_trigger_recipients_list == ""
            fail_trigger_list_item["recipientList"] = {}
          else
            fail_trigger_list_item["recipientList"] = fail_trigger_recipients_list
          end
          triggers["hudson.plugins.emailext.plugins.trigger.FailureTrigger"] = {
                    "email" => {
                        "recipientList"      =>fail_trigger_list_item["recipientList"],
                        "subject"            => "$PROJECT_DEFAULT_SUBJECT",
                        "body"               => "$PROJECT_DEFAULT_CONTENT",
                        "recipientProviders" => {},
                        "attachmentsPattern" => {},
                        "attachBuildLog"     => "false",
                        "compressBuildLog"   => "false",
                        "replyTo"            => "$PROJECT_DEFAULT_REPLYTO",
                        "contentType"        => "project"
                    }
                  }

          if fail_trigger_notify_developer == 'true'
             triggers["hudson.plugins.emailext.plugins.trigger.FailureTrigger"]["email"]["recipientProviders"] = {
                            "hudson.plugins.emailext.plugins.recipients.DevelopersRecipientProvider" => {}
                        }
          end
          if always_trigger == 'true'
            always_trigger_list_item = {}
            if always_trigger_recipients_list == ""
              always_trigger_list_item["recipientList"] = {}
            else
              always_trigger_list_item["recipientList"] = always_trigger_recipients_list
            end
            triggers["hudson.plugins.emailext.plugins.trigger.AlwaysTrigger"] = {
                    "email" => {
                        "recipientList"      =>always_trigger_list_item["recipientList"],
                        "subject"            => "$PROJECT_DEFAULT_SUBJECT",
                        "body"               => "$PROJECT_DEFAULT_CONTENT",
                        "recipientProviders" => {
                            "hudson.plugins.emailext.plugins.recipients.ListRecipientProvider" => {}
                        },
                        "attachmentsPattern" => {},
                        "attachBuildLog"     => "false",
                        "compressBuildLog"   => "false",
                        "replyTo"            => "$PROJECT_DEFAULT_REPLYTO",
                        "contentType"        => "project"
                   }
            }
          end

          job.configuration['publishers'].deep_merge!({
            "hudson.plugins.emailext.ExtendedEmailPublisher"                   => {
              "recipientList"      => recipients_list,
              "configuredTriggers" => triggers,
            "contentType"        => "text/html",
            "defaultSubject"     => subject,
            "defaultContent"     => content,
            "attachmentsPattern" => {},
            "presendScript"      => "$DEFAULT_PRESEND_SCRIPT",
            "postsendScript"     => "$DEFAULT_POSTSEND_SCRIPT",
            "attachBuildLog"     => "false",
            "compressBuildLog"   => "false",
            "replyTo"            => "$DEFAULT_REPLYTO",
            "saveOutput"         => "false",
            "disabled"           => "false"

        }

          })
        end

      end
    end
  end
end


text:
package org.wallride.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Lock;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import org.wallride.domain.Tag;

import javax.persistence.LockModeType;
import java.util.List;

@Repository
@Transactional
public interface TagRepository extends JpaRepository<Tag, Long>, TagRepositoryCustom {

	Tag findOneByIdAndLanguage(Long id, String language);

	@Lock(LockModeType.PESSIMISTIC_WRITE)
	Tag findOneForUpdateByIdAndLanguage(Long id, String language);

	Tag findOneByNameAndLanguage(String name, String language);

	@Lock(LockModeType.PESSIMISTIC_WRITE)
	Tag findOneForUpdateByNameAndLanguage(String name, String language);

	List<Tag> findAllByLanguage(String language);

	@Query("select count(tag.id) from Tag tag where tag.language = :language ")
	long count(@Param("language") String language);
}


text:
package org.apache.cassandra.stress.operations.userdefined;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;

import com.datastax.driver.core.BoundStatement;
import com.datastax.driver.core.ColumnDefinitions;
import com.datastax.driver.core.DataType;
import com.datastax.driver.core.LocalDate;
import com.datastax.driver.core.PreparedStatement;
import org.apache.cassandra.db.ConsistencyLevel;
import org.apache.cassandra.stress.Operation;
import org.apache.cassandra.stress.generate.Row;
import org.apache.cassandra.stress.settings.StressSettings;
import org.apache.cassandra.stress.util.JavaDriverClient;
import org.apache.cassandra.stress.util.Timer;
import org.apache.cassandra.transport.SimpleClient;

public abstract class SchemaStatement extends Operation
{

    final PreparedStatement statement;
    final Integer thriftId;
    final ConsistencyLevel cl;
    final int[] argumentIndex;
    final Object[] bindBuffer;
    final ColumnDefinitions definitions;

    public SchemaStatement(Timer timer, StressSettings settings, DataSpec spec,
                           PreparedStatement statement, Integer thriftId, ConsistencyLevel cl)
    {
        super(timer, settings, spec);
        this.statement = statement;
        this.thriftId = thriftId;
        this.cl = cl;
        argumentIndex = new int[statement.getVariables().size()];
        bindBuffer = new Object[argumentIndex.length];
        definitions = statement.getVariables();
        int i = 0;
        for (ColumnDefinitions.Definition definition : definitions)
            argumentIndex[i++] = spec.partitionGenerator.indexOf(definition.getName());

        statement.setConsistencyLevel(JavaDriverClient.from(cl));
    }

    BoundStatement bindRow(Row row)
    {
        for (int i = 0 ; i < argumentIndex.length ; i++)
        {
            Object value = row.get(argumentIndex[i]);
            if (definitions.getType(i).getName().equals(DataType.date().getName()))
            {
                // the java driver only accepts com.datastax.driver.core.LocalDate for CQL type "DATE"
                value= LocalDate.fromDaysSinceEpoch((Integer) value);
            }
            bindBuffer[i] = value;
            if (bindBuffer[i] == null && !spec.partitionGenerator.permitNulls(argumentIndex[i]))
                throw new IllegalStateException();
        }
        return statement.bind(bindBuffer);
    }

    List<ByteBuffer> thriftRowArgs(Row row)
    {
        List<ByteBuffer> args = new ArrayList<>();
        for (int i : argumentIndex)
            args.add(spec.partitionGenerator.convert(i, row.get(i)));
        return args;
    }

    @Override
    public void run(SimpleClient client) throws IOException
    {
        throw new UnsupportedOperationException();
    }

    abstract class Runner implements RunOp
    {
        int partitionCount;
        int rowCount;

        @Override
        public int partitionCount()
        {
            return partitionCount;
        }

        @Override
        public int rowCount()
        {
            return rowCount;
        }
    }

}


text:
namespace Tangram {

constexpr float View::s_maxZoom; // Create a stack reference to the static member variable

double invLodFunc(double d) {
    return exp2(d) - 1.0;
}

View::View(int _width, int _height, ProjectionType _projType) :
    m_width(0),
    m_height(0),
    m_changed(false) {

    setMapProjection(_projType);
    setSize(_width, _height);
    setZoom(m_initZoom); // Arbitrary zoom for testing

    setPosition(0.0, 0.0);
}

void View::setMapProjection(ProjectionType _projType) {

    switch(_projType) {
        case ProjectionType::mercator:
            m_projection.reset(new MercatorProjection());
            break;
        default:
            logMsg("Error: not a valid map projection specified.\n Setting map projection to mercator by default");
            m_projection.reset(new MercatorProjection());
            break;
    }

    m_dirtyMatrices = true;
    m_dirtyTiles = true;

}

const MapProjection& View::getMapProjection() const {
    return *m_projection.get();
}

void View::setPixelScale(float _pixelsPerPoint) {

    m_pixelScale = _pixelsPerPoint;
    m_dirtyMatrices = true;
    m_dirtyTiles = true;

}

void View::setSize(int _width, int _height) {

    m_vpWidth = _width;
    m_vpHeight = _height;
    m_aspect = (float)_width / (float)_height;
    m_dirtyMatrices = true;
    m_dirtyTiles = true;

    // Screen space orthographic projection matrix, top left origin, y pointing down
    m_orthoViewport = glm::ortho(0.f, (float)m_vpWidth, (float)m_vpHeight, 0.f, -1.f, 1.f);

}

void View::setPosition(double _x, double _y) {

    m_pos.x = _x;
    m_pos.y = _y;
    m_dirtyTiles = true;

}

void View::setZoom(float _z) {

    // ensure zoom value is allowed
    m_zoom = glm::clamp(_z, 0.0f, s_maxZoom);
    m_dirtyMatrices = true;
    m_dirtyTiles = true;

}

void View::setRoll(float _roll) {

    m_roll = glm::mod(_roll, (float)TWO_PI);
    m_dirtyMatrices = true;
    m_dirtyTiles = true;

}

void View::setPitch(float _pitch) {

    m_pitch = glm::clamp(_pitch, 0.f, (float)HALF_PI);
    m_dirtyMatrices = true;
    m_dirtyTiles = true;

}

void View::translate(double _dx, double _dy) {

    setPosition(m_pos.x + _dx, m_pos.y + _dy);

}

void View::zoom(float _dz) {

    setZoom(m_zoom + _dz);

}

void View::roll(float _droll) {

    setRoll(m_roll + _droll);

}

void View::pitch(float _dpitch) {

    setPitch(m_pitch + _dpitch);

}

void View::update() {

    if (m_dirtyMatrices) {

        updateMatrices(); // Resets dirty flag
        m_changed = true;

    }

    if (m_dirtyTiles && !Tangram::getDebugFlag(Tangram::DebugFlags::freeze_tiles)) {

        updateTiles(); // Resets dirty flag
        m_changed = true;

    }

}

glm::dmat2 View::getBoundsRect() const {

    double hw = m_width * 0.5;
    double hh = m_height * 0.5;
    return glm::dmat2(m_pos.x - hw, m_pos.y - hh, m_pos.x + hw, m_pos.y + hh);

}

float View::screenToGroundPlane(float& _screenX, float& _screenY) {

    if (m_dirtyMatrices) { updateMatrices(); } // Need the view matrices to be up-to-date

    // Cast a ray and find its intersection with the z = 0 plane,
    // following the technique described here: http://antongerdelan.net/opengl/raycasting.html

    glm::vec4 ray_clip = { 2.f * _screenX / m_vpWidth - 1.f, 1.f - 2.f * _screenY / m_vpHeight, -1.f, 1.f }; // Ray from camera in clip space
    glm::vec4 ray_eye = m_invViewProj * ray_clip;
    glm::vec3 ray_world = glm::vec3(ray_eye / ray_eye.w) - m_eye;

    float t = 0; // Distance along ray to ground plane
    if (ray_world.z != 0.f) {
        t = -m_eye.z / ray_world.z;
    }

    ray_world *= fabs(t);

    // Determine the maximum distance from the view position at which tiles can be drawn; If the projected point
    // is farther than this maximum or if the point is above the horizon (t < 0) then we set the distance of the
    // point to always be this maximum distance.
    float maxTileDistance = invLodFunc(MAX_LOD + 1) * 2 * MapProjection::HALF_CIRCUMFERENCE * pow(2, -m_zoom);
    float rayDistanceXY = sqrtf(ray_world.x * ray_world.x + ray_world.y * ray_world.y);
    if (rayDistanceXY > maxTileDistance || t < 0) {
        ray_world *= maxTileDistance / rayDistanceXY;
    }

    _screenX = ray_world.x + m_eye.x;
    _screenY = ray_world.y + m_eye.y;

    return t;
}

void View::updateMatrices() {

    // find dimensions of tiles in world space at new zoom level
    float worldTileSize = 2 * MapProjection::HALF_CIRCUMFERENCE * pow(2, -m_zoom);

    // viewport height in world space is such that each tile is [m_pixelsPerTile] px square in screen space
    float screenTileSize = m_pixelsPerTile * m_pixelScale;
    m_height = (float)m_vpHeight * worldTileSize / screenTileSize;
    m_width = m_height * m_aspect;

    // set vertical field-of-view
    float fovy = PI * 0.25;

    // we assume portrait orientation by default, so in landscape
    // mode we scale the vertical FOV such that the wider dimension
    // gets the intended FOV
    if (m_width > m_height) {
        fovy /= m_aspect;
    }

    // set camera z to produce desired viewable area
    m_pos.z = m_height * 0.5 / tan(fovy * 0.5);

    // set near clipping distance as a function of camera z
    // TODO: this is a simple heuristic that deserves more thought
    float near = m_pos.z / 50.0;

    // set far clipping distance to the distance of the intersection of
    // the "top" face of the view frustum with the ground plane

    // NOTE: far here can go to infinity and hence a std::min below!
    float far = m_pos.z / std::max(0., cos(m_pitch + 0.5 * fovy));

    // limit the far clipping distance to be no greater than the maximum
    // distance of visible tiles
    float maxTileDistance = worldTileSize * invLodFunc(MAX_LOD + 1);
    far = std::min(far, maxTileDistance);

    m_eye = glm::rotateZ(glm::rotateX(glm::vec3(0.f, 0.f, m_pos.z), m_pitch), m_roll);
    glm::vec3 at = { 0.f, 0.f, 0.f };
    glm::vec3 up = glm::rotateZ(glm::rotateX(glm::vec3(0.f, 1.f, 0.f), m_pitch), m_roll);

    // update view and projection matrices
    m_view = glm::lookAt(m_eye, at, up);
    m_proj = glm::perspective(fovy, m_aspect, near, far);

    m_viewProj = m_proj * m_view;
    m_invViewProj = glm::inverse(m_viewProj);

    // The matrix that transforms normals from world space to camera space is the transpose of the inverse of the view matrix,
    // but since our view matrix is orthonormal transposing is equivalent to inverting, so the normal matrix is just the
    // original view matrix (cropped to the top-left 3 rows and columns, since we're applying it to 3d vectors)
    m_normalMatrix = glm::mat3(m_view);

    m_dirtyMatrices = false;

}

// Triangle rasterization adapted from Polymaps: https://github.com/simplegeo/polymaps/blob/master/src/Layer.js#L333-L383

struct edge { // An edge between two points; oriented such that y is non-decreasing
    double x0 = 0, y0 = 0;
    double x1 = 0, y1 = 0;
    double dx = 0, dy = 0;

    edge(glm::dvec2 _a, glm::dvec2 _b) {
        if (_a.y > _b.y) { std::swap(_a, _b); }
        x0 = _a.x;
        y0 = _a.y;
        x1 = _b.x;
        y1 = _b.y;
        dx = x1 - x0;
        dy = y1 - y0;
    }
};

typedef std::function<void (int, int)> Scan;

static void scanLine(int _x0, int _x1, int _y, Scan _s) {

    for (int x = _x0; x < _x1; x++) {
        _s(x, _y);
    }
}

static void scanSpan(edge _e0, edge _e1, int _min, int _max, Scan& _s) {

    // _e1 has a shorter y-span, so we'll use it to limit our y coverage
    int y0 = fmax(_min, floor(_e1.y0));
    int y1 = fmin(_max, ceil(_e1.y1));

    // sort edges by x-coordinate
    if (_e0.x0 == _e1.x0 && _e0.y0 == _e1.y0) {
        if (_e0.x0 + _e1.dy / _e0.dy * _e0.dx < _e1.x1) { std::swap(_e0, _e1); }
    } else {
        if (_e0.x1 - _e1.dy / _e0.dy * _e0.dx < _e1.x0) { std::swap(_e0, _e1); }
    }

    // scan lines!
    double m0 = _e0.dx / _e0.dy;
    double m1 = _e1.dx / _e1.dy;
    double d0 = _e0.dx > 0 ? 1.0 : 0.0;
    double d1 = _e1.dx < 0 ? 1.0 : 0.0;
    for (int y = y0; y < y1; y++) {
        double x0 = m0 * fmax(0.0, fmin(_e0.dy, y + d0 - _e0.y0)) + _e0.x0;
        double x1 = m1 * fmax(0.0, fmin(_e1.dy, y + d1 - _e1.y0)) + _e1.x0;
        scanLine(fmax(_min, floor(x1)), fmin(_max, ceil(x0)), y, _s);
    }

}

static void scanTriangle(glm::dvec2& _a, glm::dvec2& _b, glm::dvec2& _c, int _min, int _max, Scan& _s) {

    edge ab = edge(_a, _b);
    edge bc = edge(_b, _c);
    edge ca = edge(_c, _a);

    // place edge with greatest y distance in ca
    if (ab.dy > ca.dy) { std::swap(ab, ca); }
    if (bc.dy > ca.dy) { std::swap(bc, ca); }

    // scan span! scan span!
    if (ab.dy > 0) { scanSpan(ca, ab, _min, _max, _s); }
    if (bc.dy > 0) { scanSpan(ca, bc, _min, _max, _s); }

}

void View::updateTiles() {

    m_visibleTiles.clear();

    // Bounds of view trapezoid in world space (i.e. view frustum projected onto z = 0 plane)
    glm::vec2 viewBL = { 0.f,       m_vpHeight }; // bottom left
    glm::vec2 viewBR = { m_vpWidth, m_vpHeight }; // bottom right
    glm::vec2 viewTR = { m_vpWidth, 0.f        }; // top right
    glm::vec2 viewTL = { 0.f,       0.f        }; // top left

    float t0 = screenToGroundPlane(viewBL.x, viewBL.y);
    float t1 = screenToGroundPlane(viewBR.x, viewBR.y);
    float t2 = screenToGroundPlane(viewTR.x, viewTR.y);
    float t3 = screenToGroundPlane(viewTL.x, viewTL.y);

    // if all of our raycasts have a negative intersection distance, we have no area to cover
    if (t0 < .0f && t1 < 0.f && t2 < 0.f && t3 < 0.f) {
        return;
    }

    // Transformation from world space to tile space
    double hc = MapProjection::HALF_CIRCUMFERENCE;
    double invTileSize = double(1 << int(m_zoom)) / (hc * 2);
    glm::dvec2 tileSpaceOrigin(-hc, hc);
    glm::dvec2 tileSpaceAxes(invTileSize, -invTileSize);

    // Bounds of view trapezoid in tile space
    glm::dvec2 a = (glm::dvec2(viewBL.x + m_pos.x, viewBL.y + m_pos.y) - tileSpaceOrigin) * tileSpaceAxes;
    glm::dvec2 b = (glm::dvec2(viewBR.x + m_pos.x, viewBR.y + m_pos.y) - tileSpaceOrigin) * tileSpaceAxes;
    glm::dvec2 c = (glm::dvec2(viewTR.x + m_pos.x, viewTR.y + m_pos.y) - tileSpaceOrigin) * tileSpaceAxes;
    glm::dvec2 d = (glm::dvec2(viewTL.x + m_pos.x, viewTL.y + m_pos.y) - tileSpaceOrigin) * tileSpaceAxes;

    // Location of the view center in tile space
    glm::dvec2 e = (glm::dvec2(m_pos.x, m_pos.y) - tileSpaceOrigin) * tileSpaceAxes;

    // Determine zoom reduction for tiles far from the center of view
    double tilesAtFullZoom = std::max(m_width, m_height) * invTileSize * 0.5;
    double viewCenterX = (m_pos.x + hc) * invTileSize;
    double viewCenterY = (m_pos.y - hc) * -invTileSize;

    int x_l_pos[MAX_LOD] = { 0 };
    int x_l_neg[MAX_LOD] = { 0 };
    int y_l_pos[MAX_LOD] = { 0 };
    int y_l_neg[MAX_LOD] = { 0 };

    for (int i = 0; i < MAX_LOD; i++) {
        int j = i + 1;
        x_l_neg[i] = ((int(viewCenterX - tilesAtFullZoom - invLodFunc(i)) >> j) - 1) << j;
        y_l_pos[i] = ((int(viewCenterY + tilesAtFullZoom + invLodFunc(i)) >> j) + 1) << j;
        y_l_neg[i] = ((int(viewCenterY - tilesAtFullZoom - invLodFunc(i)) >> j) - 1) << j;
        x_l_pos[i] = ((int(viewCenterX + tilesAtFullZoom + invLodFunc(i)) >> j) + 1) << j;
    }

    Scan s = [&](int x, int y) {

        int lod = 0;
        while (lod < MAX_LOD && x >= x_l_pos[lod]) { lod++; }
        while (lod < MAX_LOD && x <  x_l_neg[lod]) { lod++; }
        while (lod < MAX_LOD && y >= y_l_pos[lod]) { lod++; }
        while (lod < MAX_LOD && y <  y_l_neg[lod]) { lod++; }

        int z = int(m_zoom);

        x >>= lod;
        y >>= lod;
        z = glm::clamp((z-lod), 0, (int)s_maxZoom);

        m_visibleTiles.emplace(x, y, z);

    };

    // Rasterize view trapezoid into tiles
    int maxTileIndex = 1 << int(m_zoom);
    scanTriangle(a, b, c, 0, maxTileIndex, s);
    scanTriangle(c, d, a, 0, maxTileIndex, s);

    // Rasterize the area bounded by the point under the view center and the two nearest corners
    // of the view trapezoid. This is necessary to not cull any geometry with height in these tiles
    // (which should remain visible, even though the base of the tile is not).
    scanTriangle(a, b, e, 0, maxTileIndex, s);

    m_dirtyTiles = false;

}

}


text:
package battlesys.move.MoveNormal;

import battlesys.exception.BattleSysException;
import battlesys.*;import java.io.IOException;
 import java.util.*;

/**
 *
 * @author Peter
 */
public class StrongAtk extends MoveNormal {

    /**
     *
     * @param owner
     */
    public StrongAtk(Player owner) throws IOException{
        super(owner);
        damage = 8;
        accurancy = 45;
    }

    public CompleteMoveResult useMove(Player target, PlayerList attackers, PlayerList defenders) throws BattleSysException{
        String s = preMove();
        List<SingleMoveResult> r = super.useMove(owner, target, attackers, defenders);
        postMove(r);
        return new CompleteMoveResult(r, s + SingleMoveResult.combineMoveResultString(r));
    }

}