text:
#include "wrapper.h"
/************************************
 * Wrappers for Unix signal functions
 ***********************************/

/* $begin sigaction */
handler_t *Signal(int signum, handler_t *handler)
{
    struct sigaction action, old_action;

    action.sa_handler = handler;
    sigemptyset(&action.sa_mask); /* Block sigs of type being handled */
    action.sa_flags = SA_RESTART; /* Restart syscalls if possible */

    if (sigaction(signum, &action, &old_action) < 0)
	unix_error("Signal error");
    return (old_action.sa_handler);
}
/* $end sigaction */

void Sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
{
    if (sigprocmask(how, set, oldset) < 0)
	unix_error("Sigprocmask error");
    return;
}

void Sigemptyset(sigset_t *set)
{
    if (sigemptyset(set) < 0)
	unix_error("Sigemptyset error");
    return;
}

void Sigfillset(sigset_t *set)
{
    if (sigfillset(set) < 0)
	unix_error("Sigfillset error");
    return;
}

void Sigaddset(sigset_t *set, int signum)
{
    if (sigaddset(set, signum) < 0)
	unix_error("Sigaddset error");
    return;
}

void Sigdelset(sigset_t *set, int signum)
{
    if (sigdelset(set, signum) < 0)
	unix_error("Sigdelset error");
    return;
}

int Sigismember(const sigset_t *set, int signum)
{
    int rc;
    if ((rc = sigismember(set, signum)) < 0)
	unix_error("Sigismember error");
    return rc;
}

int Sigsuspend(const sigset_t *set)
{
    int rc = sigsuspend(set); /* always returns -1 */
    if (errno != EINTR)
        unix_error("Sigsuspend error");
    return rc;
}

/*********************************************
 *  * Wrappers for Unix process control functions
 *   ********************************************/

/* $begin forkwrapper */
pid_t Fork(void)
{
	pid_t pid;
	if ((pid = fork()) < 0)
		unix_error("Fork error");
	return pid;
}
/* $end forkwrapper */

void Execve(const char *filename, char *const argv[], char *const envp[])
{
	if (execve(filename, argv, envp) < 0)
		unix_error("Execve error");
}

/* $begin wait */
pid_t Wait(int *status)
{
	pid_t pid;
	if ((pid  = wait(status)) < 0)
		unix_error("Wait error");
	return pid;
}
/* $end wait */

pid_t Waitpid(pid_t pid, int *iptr, int options)
{
	pid_t retpid;
	retpid  = waitpid(pid, iptr, options);
        if (retpid < 0 && errno != ECHILD)
                unix_error("Waitpid error");
	return(retpid);
}

/* $begin kill */
void Kill(pid_t pid, int signum)
{
	int rc;
	if ((rc = kill(pid, signum)) < 0)
		unix_error("Kill error");
}
/* $end kill */

void Pause()
{
	(void)pause();
	return;
}

unsigned int Sleep(unsigned int secs)
{
	return sleep(secs);
}

unsigned int Alarm(unsigned int seconds) {
	return alarm(seconds);
}

void Setpgid(pid_t pid, pid_t pgid) {
	int rc;
	if ((rc = setpgid(pid, pgid)) < 0)
		unix_error("Setpgid error");
	return;
}

pid_t Getpgrp(void) {
	return getpgrp();
}

/**********************************
 *  * Wrappers for robust I/O routines
 *   **********************************/
ssize_t Rio_readn(int fd, void *ptr, size_t nbytes)
{
	ssize_t n;
	if ((n = rio_readn(fd, ptr, nbytes)) < 0)
		unix_error("Rio_readn error");
	return n;
}

void Rio_writen(int fd, void *usrbuf, size_t n)
{
	if (rio_writen(fd, usrbuf, n) != n)
		unix_error("Rio_writen error");
}

void Rio_readinitb(rio_t *rp, int fd)
{
	rio_readinitb(rp, fd);
}

ssize_t Rio_readnb(rio_t *rp, void *usrbuf, size_t n)
{
	ssize_t rc;
	if ((rc = rio_readnb(rp, usrbuf, n)) < 0)
		unix_error("Rio_readnb error");
	return rc;
}

ssize_t Rio_readlineb(rio_t *rp, void *usrbuf, size_t maxlen)
{
    ssize_t rc;
	if ((rc = rio_readlineb(rp, usrbuf, maxlen)) < 0)
		unix_error("Rio_readlineb error");
		return rc;
}

/********************************
 * Wrappers for Unix I/O routines
 ********************************/

int Open(const char *pathname, int flags, mode_t mode)
{
    int rc;

    if ((rc = open(pathname, flags, mode))  < 0)
	unix_error("Open error");
    return rc;
}

ssize_t Read(int fd, void *buf, size_t count)
{
    ssize_t rc;

    if ((rc = read(fd, buf, count)) < 0)
	unix_error("Read error");
    return rc;
}

ssize_t Write(int fd, const void *buf, size_t count)
{
    ssize_t rc;

    if ((rc = write(fd, buf, count)) < 0)
	unix_error("Write error");
    return rc;
}

off_t Lseek(int fildes, off_t offset, int whence)
{
    off_t rc;

    if ((rc = lseek(fildes, offset, whence)) < 0)
	unix_error("Lseek error");
    return rc;
}

void Close(int fd)
{
    int rc;

    if ((rc = close(fd)) < 0)
	unix_error("Close error");
}

int Select(int  n, fd_set *readfds, fd_set *writefds,
	   fd_set *exceptfds, struct timeval *timeout)
{
    int rc;

    if ((rc = select(n, readfds, writefds, exceptfds, timeout)) < 0)
	unix_error("Select error");
    return rc;
}

int Dup2(int fd1, int fd2)
{
    int rc;

    if ((rc = dup2(fd1, fd2)) < 0)
	unix_error("Dup2 error");
    return rc;
}

void Stat(const char *filename, struct stat *buf)
{
    if (stat(filename, buf) < 0)
	unix_error("Stat error");
}

void Fstat(int fd, struct stat *buf)
{
    if (fstat(fd, buf) < 0)
	unix_error("Fstat error");
}

/*********************************
 * Wrappers for directory function
 *********************************/

DIR *Opendir(const char *name)
{
    DIR *dirp = opendir(name);

    if (!dirp)
        unix_error("opendir error");
    return dirp;
}

struct dirent *Readdir(DIR *dirp)
{
    struct dirent *dep;

    errno = 0;
    dep = readdir(dirp);
    if ((dep == NULL) && (errno != 0))
        unix_error("readdir error");
    return dep;
}

int Closedir(DIR *dirp)
{
    int rc;

    if ((rc = closedir(dirp)) < 0)
        unix_error("closedir error");
    return rc;
}

/***************************************
 * Wrappers for memory mapping functions
 ***************************************/
void *Mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
{
    void *ptr;

    if ((ptr = mmap(addr, len, prot, flags, fd, offset)) == ((void *) -1))
	unix_error("mmap error");
    return(ptr);
}

void Munmap(void *start, size_t length)
{
    if (munmap(start, length) < 0)
	unix_error("munmap error");
}

/***************************************************
 * Wrappers for dynamic storage allocation functions
 ***************************************************/

void *Malloc(size_t size)
{
    void *p;

    if ((p  = malloc(size)) == NULL)
	unix_error("Malloc error");
    return p;
}

void *Realloc(void *ptr, size_t size)
{
    void *p;

    if ((p  = realloc(ptr, size)) == NULL)
	unix_error("Realloc error");
    return p;
}

void *Calloc(size_t nmemb, size_t size)
{
    void *p;

    if ((p = calloc(nmemb, size)) == NULL)
	unix_error("Calloc error");
    return p;
}

void Free(void *ptr)
{
    free(ptr);
}

/******************************************
 * Wrappers for the Standard I/O functions.
 ******************************************/
void Fclose(FILE *fp)
{
    if (fclose(fp) != 0)
	unix_error("Fclose error");
}

FILE *Fdopen(int fd, const char *type)
{
    FILE *fp;

    if ((fp = fdopen(fd, type)) == NULL)
	unix_error("Fdopen error");

    return fp;
}

char *Fgets(char *ptr, int n, FILE *stream)
{
    char *rptr;

    if (((rptr = fgets(ptr, n, stream)) == NULL) && ferror(stream))
	app_error("Fgets error");

    return rptr;
}

FILE *Fopen(const char *filename, const char *mode)
{
    FILE *fp;

    if ((fp = fopen(filename, mode)) == NULL)
	unix_error("Fopen error");

    return fp;
}

void Fputs(const char *ptr, FILE *stream)
{
    if (fputs(ptr, stream) == EOF)
	unix_error("Fputs error");
}

size_t Fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
{
    size_t n;

    if (((n = fread(ptr, size, nmemb, stream)) < nmemb) && ferror(stream))
	unix_error("Fread error");
    return n;
}

void Fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
{
    if (fwrite(ptr, size, nmemb, stream) < nmemb)
	unix_error("Fwrite error");
}

/****************************
 * Sockets interface wrappers
 ****************************/

int Socket(int domain, int type, int protocol)
{
    int rc;

    if ((rc = socket(domain, type, protocol)) < 0)
	unix_error("Socket error");
    return rc;
}

void Setsockopt(int s, int level, int optname, const void *optval, int optlen)
{
    int rc;

    if ((rc = setsockopt(s, level, optname, optval, optlen)) < 0)
	unix_error("Setsockopt error");
}

void Bind(int sockfd, struct sockaddr *my_addr, int addrlen)
{
    int rc;

    if ((rc = bind(sockfd, my_addr, addrlen)) < 0)
	unix_error("Bind error");
}

void Listen(int s, int backlog)
{
    int rc;

    if ((rc = listen(s,  backlog)) < 0)
	unix_error("Listen error");
}

int Accept(int s, struct sockaddr *addr, socklen_t *addrlen)
{
    int rc;

    if ((rc = accept(s, addr, addrlen)) < 0)
	unix_error("Accept error");
    return rc;
}

void Connect(int sockfd, struct sockaddr *serv_addr, int addrlen)
{
    int rc;

    if ((rc = connect(sockfd, serv_addr, addrlen)) < 0)
	unix_error("Connect error");
}

/************************
 * DNS interface wrappers
 ***********************/

/* $begin gethostbyname */
struct hostent *Gethostbyname(const char *name)
{
    struct hostent *p;

    if ((p = gethostbyname(name)) == NULL)
		dns_error("Gethostbyname error");
    return p;
}
/* $end gethostbyname */

struct hostent *Gethostbyaddr(const char *addr, int len, int type)
{
    struct hostent *p;

    if ((p = gethostbyaddr(addr, len, type)) == NULL)
		dns_error("Gethostbyaddr error");
    return p;
}

/********************************
 * Client/server helper functions
 ********************************/
/*
 * open_clientfd - open connection to server at <hostname, port>
 *   and return a socket descriptor ready for reading and writing.
 *   Returns -1 and sets errno on Unix error.
 *   Returns -2 and sets h_errno on DNS (gethostbyname) error.
 */
/* $begin open_clientfd */
int open_clientfd(char* hostname, int port)
{
	int clientfd;
	struct hostent* hp;
	struct sockaddr_in serveraddr;
	if((clientfd = socket(AF_INET,SOCK_STREAM,0)) < 0)
		return -1;/*Check errno for cause of error*/

	/* Fill in the server's IP address and port*/
	if((hp = Gethostbyname(hostname)) == NULL)
		return -2;
	bzero((char*)&serveraddr,sizeof(serveraddr));
	serveraddr.sin_family = AF_INET;
	bcopy((char*)hp->h_addr_list[0],(char*)&serveraddr.sin_addr.s_addr,hp->h_length);
	serveraddr.sin_port = htons(port);

	/* Establish a connection with the server*/
	if(connect(clientfd,(SA*)&serveraddr,sizeof(serveraddr)) < 0)
		return -1;
	return clientfd;
}
/*
 * open_listenfd - open and return a listening socket on port
 *     Returns -1 and sets errno on Unix error.
 */
/* $begin open_listenfd */
int open_listenfd(int port)
{
	int listenfd,optval = 1;
	struct sockaddr_in serveraddr;

	/* Create a socket descriptor */
	if((listenfd = socket(AF_INET,SOCK_STREAM,0)) < 0)
		return -1;

	/* Eliminates "Address already in use" error from bind */
	if(setsockopt(listenfd,SOL_SOCKET,SO_REUSEADDR,(const void*)&optval,sizeof(int)) < 0)
		return -1;

	/* Listenfd will be an endpoint for all requests to port on any IP address for this host */
	bzero((char *) &serveraddr, sizeof(serveraddr));
	serveraddr.sin_family = AF_INET;
	serveraddr.sin_addr.s_addr = htonl(INADDR_ANY);
	serveraddr.sin_port = htons((unsigned short)port);
	if (bind(listenfd, (SA *)&serveraddr, sizeof(serveraddr)) < 0)
		return -1;

	/* Make it a listening socket ready to accept connection requests */
	if (listen(listenfd, LISTENQ) < 0)
		return -1;
	return listenfd;
}

/******************************************
 * Wrappers for the client/server helper routines
 ******************************************/
int Open_clientfd(char *hostname, int port)
{
    int rc;

    if ((rc = open_clientfd(hostname, port)) < 0) {
	if (rc == -1)
	    unix_error("Open_clientfd Unix error");
	else
	    dns_error("Open_clientfd DNS error");
    }
    return rc;
}

int Open_listenfd(int port)
{
    int rc;

    if ((rc = open_listenfd(port)) < 0)
	unix_error("Open_listenfd error");
    return rc;
}


text:
package models

import (
	"errors"
	"socialapi/request"
	"time"

	"github.com/koding/bongo"
)

type MessageReply struct {
	// unique identifier of the MessageReply
	Id int64 `json:"id,string"`

	// Id of the interacted message
	MessageId int64 `json:"messageId,string"     sql:"NOT NULL"`

	// Id of the reply
	ReplyId int64 `json:"replyId,string"         sql:"NOT NULL"`

	// holds troll, unsafe, etc
	MetaBits MetaBits `json:"metaBits"`

	// Creation of the MessageReply
	CreatedAt time.Time `json:"createdAt"         sql:"NOT NULL"`

	// is required to identify to request in client side
	ClientRequestId string `json:"clientRequestId,omitempty" sql:"-"`
}

func (m *MessageReply) MarkIfExempt() error {
	if m.MetaBits.Is(Troll) {
		return nil
	}

	if m.ReplyId == 0 {
		return nil
	}

	cm := NewChannelMessage()
	cm.Id = m.ReplyId
	isExempt, err := cm.isExempt()
	if err != nil {
		return err
	}

	if isExempt {
		m.MetaBits.Mark(Troll)
	}

	return nil
}

func (m *MessageReply) Delete() error {
	selector := map[string]interface{}{
		"message_id": m.MessageId,
		"reply_id":   m.ReplyId,
	}

	if err := m.One(bongo.NewQS(selector)); err != nil {
		return err
	}

	err := bongo.B.Delete(m)
	if err != nil {
		return err
	}

	return nil
}

func (m *MessageReply) DeleteByOrQuery(messageId int64) error {
	var messageReplies []MessageReply
	query := bongo.B.DB.Table(m.BongoName())
	query = query.Where("message_id = ? or reply_id = ?", messageId, messageId)

	if err := query.Find(&messageReplies).Error; err != bongo.RecordNotFound && err != nil {
		return err
	}

	if messageReplies == nil {
		return nil
	}

	if len(messageReplies) == 0 {
		return nil
	}

	for _, messageReply := range messageReplies {
		err := bongo.B.Delete(&messageReply)
		if err != nil {
			return err
		}
	}

	return nil
}

func (m *MessageReply) List(query *request.Query) ([]ChannelMessage, error) {
	return m.fetchMessages(query)
}

func (m *MessageReply) ListAll() ([]ChannelMessage, error) {
	query := request.NewQuery()
	query.Limit = 0
	query.Skip = 0
	return m.fetchMessages(query)
}

func (m *MessageReply) fetchMessages(query *request.Query) ([]ChannelMessage, error) {
	if m.MessageId == 0 {
		return nil, ErrMessageIdIsNotSet
	}

	q := &bongo.Query{
		Selector: map[string]interface{}{
			"message_id": m.MessageId,
		},
		Pluck:      "reply_id",
		Pagination: *bongo.NewPagination(query.Limit, query.Skip),
		Sort:       map[string]string{"created_at": "DESC"},
	}

	q.AddScope(RemoveTrollContent(m, query.ShowExempt))

	bongoQuery := bongo.B.BuildQuery(m, q)
	if !query.From.IsZero() {
		bongoQuery = bongoQuery.Where("created_at < ?", query.From)
	}

	var replies []int64
	if err := bongo.CheckErr(
		bongoQuery.Pluck(q.Pluck, &replies),
	); err != nil {
		return nil, err
	}

	parent := NewChannelMessage()
	channelMessageReplies, err := parent.FetchByIds(replies)
	if err != nil {
		return nil, err
	}

	return channelMessageReplies, nil
}

func (m *MessageReply) UnreadCount(messageId int64, addedAt time.Time, showExempt bool) (int, error) {
	if messageId == 0 {
		return 0, ErrMessageIdIsNotSet
	}

	if addedAt.IsZero() {
		return 0, ErrAddedAtIsNotSet
	}

	query := "message_id = ? and created_at > ?"

	if !showExempt {
		query += " and meta_bits = ?"
	} else {
		query += " and meta_bits >= ?"
	}

	var metaBits MetaBits
	return bongo.B.Count(
		m,
		query,
		messageId,
		addedAt.UTC().Format(time.RFC3339Nano),
		metaBits,
	)
}

func (m *MessageReply) Count(q *request.Query) (int, error) {
	if m.MessageId == 0 {
		return 0, ErrMessageIdIsNotSet
	}

	query := &bongo.Query{
		Selector: map[string]interface{}{
			"message_id": m.MessageId,
		},
	}

	query.AddScope(RemoveTrollContent(
		m, q.ShowExempt,
	))

	return m.CountWithQuery(query)
}

func (m *MessageReply) CountWithQuery(q *bongo.Query) (int, error) {
	return bongo.B.CountWithQuery(m, q)
}

func (m *MessageReply) FetchParent() (*ChannelMessage, error) {
	parent := NewChannelMessage()

	if m.MessageId != 0 {
		if err := parent.ById(m.MessageId); err != nil {
			return nil, err
		}

		return parent, nil
	}

	if m.ReplyId == 0 {
		return nil, errors.New("replyId is not set")
	}

	q := &bongo.Query{
		Selector: map[string]interface{}{
			"reply_id": m.ReplyId,
		},
	}

	if err := m.One(q); err != nil {
		return nil, err
	}

	if err := parent.ById(m.MessageId); err != nil {
		return nil, err
	}

	return parent, nil
}

func (m *MessageReply) FetchReply() (*ChannelMessage, error) {
	reply := NewChannelMessage()

	replyId, err := m.getReplyId()
	if err != nil {
		return nil, err
	}

	if err := reply.ById(replyId); err != nil {
		return nil, err
	}

	return reply, nil
}

func (m *MessageReply) getReplyId() (int64, error) {
	if m.Id == 0 && m.ReplyId == 0 {
		return 0, errors.New("required ids are not set")
	}

	if m.ReplyId != 0 {
		return m.ReplyId, nil
	}

	if m.Id == 0 {
		// shouldnt come here
		return 0, errors.New("couldnt fetch replyId")
	}

	if err := m.ById(m.Id); err != nil {
		return 0, err
	}

	return m.ReplyId, nil
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

const MIN_VERSION = [ 2, 3, 1 ];

// Recursive version compare, could be flatter but opted for instant return if
//  comparison is greater rather than continuing to compare to end.
const version_compare = (actual, minimum) => {
  for (let i = 0; i < minimum.length; ++i) {
    if (actual[i] > minimum[i]) {
      return true;
    } else if (actual[i] < minimum[i]) {
      return false;
    }
  }
  return true;
};

// Check that RethinkDB matches version requirements
const rethinkdb_version_check = (version_string) => {
  const rethinkdb_version_regex = /^rethinkdb (\d+)\.(\d+)\.(\d+)/i;
  const matches = rethinkdb_version_regex.exec(version_string);

  if (matches) {
    // Convert strings to ints and remove first match
    const versions = matches.slice(1).map((val) => parseInt(val));

    if (!version_compare(versions, MIN_VERSION)) {
      throw new Error(`RethinkDB (${versions.join('.')}) is below required version ` +
                      `(${MIN_VERSION.join('.')}) for use with Horizon.`);
    }
  } else {
    throw new Error('Unable to determine RethinkDB version, check ' +
                    `RethinkDB is >= ${MIN_VERSION.join('.')}.`);
  }
};

// Used when evaluating things in a different VM context - the errors
// thrown from there will not evaluate as `instanceof Error`, so we recreate them.
const remake_error = (err) => {
  const new_err = new Error(err.message || 'Unknown error when evaluating template.');
  new_err.stack = err.stack || new_err.stack;
  throw new_err;
};

module.exports = {
  rethinkdb_version_check,
  remake_error,
};


text:
import Controller
import Network.Wai.Handler.FastCGI (run)

main :: IO ()
main = withGloop run


text:
module.exports = function(app) {

  // Setup Controllers
  var Controllers = {};

  // Crud
  Controllers.user = require('./controllers/user');

  // Automagically hook up all routes defined in controllers
  _.each(Controllers, function(Controller) {
    var controller = new Controller();
    var routes = controller.routes;

    _.each(routes, function(route, method) {
      _.each(route, function(options, path) {
        if (!options.action) {
          return _.warn("route: [" + method + "]", path, ' is not defined');
        }

        app[method](path, options.middleware || [], controller.before || [], function(req, res, next) {
          options.action.call(controller, req, res, next);
        }, controller.after || []);

        _.verbose(controller.className.green + " [".magenta + method.toUpperCase().magenta + "] ".magenta + path.cyan);
      });
    });
  });

  // Root Route
  app.get("/", function(req, res, next) {
    var context = {
      title: config.title,
      layout: 'home/layout'
    };

    return _.render(req, res, 200, 'home/index', context);
  });

  // Root Route
  app.get("/about", function(req, res, next) {
    var context = {
      title: config.title,
      layout: 'home/layout'
    };

    return _.render(req, res, 200, 'home/about', context);
  });

};


text:
import {Model} from 'chomex';

export default class Workflow extends Model {}


text:
namespace TraktApiSharp.Tests.Requests.Shows.OAuth
{
    using FluentAssertions;
    using System.Collections;
    using System.Collections.Generic;
    using Traits;
    using TraktApiSharp.Requests.Shows.OAuth;
    using Xunit;

    [Category("Requests.Shows.OAuth")]
    public class ShowCollectionProgressRequest_Tests
    {
        [Fact]
        public void Test_ShowCollectionProgressRequest_Has_Valid_UriTemplate()
        {
            var request = new ShowCollectionProgressRequest();
            request.UriTemplate.Should().Be("shows/{id}/progress/collection{?hidden,specials,count_specials}");
        }

        [Theory, ClassData(typeof(ShowCollectionProgressRequest_TestData))]
        public void Test_ShowCollectionProgressRequest_Returns_Valid_UriPathParameters(IDictionary<string, object> values,
                                                                                IDictionary<string, object> expected)
        {
            values.Should().NotBeNull().And.HaveCount(expected.Count);

            if (expected.Count > 0)
                values.Should().Contain(expected);
        }

        public class ShowCollectionProgressRequest_TestData : IEnumerable<object[]>
        {
            private const string _id = "123";
            private const bool _hidden = true;
            private const bool _specials = true;
            private const bool _countSpecials = true;

            private static readonly ShowCollectionProgressRequest _request1 = new ShowCollectionProgressRequest
            {
                Id = _id
            };

            private static readonly ShowCollectionProgressRequest _request2 = new ShowCollectionProgressRequest
            {
                Id = _id,
                Hidden = _hidden
            };

            private static readonly ShowCollectionProgressRequest _request3 = new ShowCollectionProgressRequest
            {
                Id = _id,
                Specials = _specials
            };

            private static readonly ShowCollectionProgressRequest _request4 = new ShowCollectionProgressRequest
            {
                Id = _id,
                CountSpecials = _countSpecials
            };

            private static readonly ShowCollectionProgressRequest _request5 = new ShowCollectionProgressRequest
            {
                Id = _id,
                Hidden = _hidden,
                Specials = _specials
            };

            private static readonly ShowCollectionProgressRequest _request6 = new ShowCollectionProgressRequest
            {
                Id = _id,
                Hidden = _hidden,
                CountSpecials = _countSpecials
            };

            private static readonly ShowCollectionProgressRequest _request7 = new ShowCollectionProgressRequest
            {
                Id = _id,
                Specials = _specials,
                CountSpecials = _countSpecials
            };

            private static readonly ShowCollectionProgressRequest _request8 = new ShowCollectionProgressRequest
            {
                Id = _id,
                Hidden = _hidden,
                Specials = _specials,
                CountSpecials = _countSpecials
            };

            private static readonly List<object[]> _data = new List<object[]>();

            public ShowCollectionProgressRequest_TestData()
            {
                SetupPathParamters();
            }

            private void SetupPathParamters()
            {
                var strHidden = _hidden.ToString().ToLower();
                var strSpecials = _specials.ToString().ToLower();
                var strCountSpecials = _countSpecials.ToString().ToLower();

                _data.Add(new object[] { _request1.GetUriPathParameters(), new Dictionary<string, object>
                    {
                        ["id"] = _id
                    }});

                _data.Add(new object[] { _request2.GetUriPathParameters(), new Dictionary<string, object>
                    {
                        ["id"] = _id,
                        ["hidden"] = strHidden
                    }});

                _data.Add(new object[] { _request3.GetUriPathParameters(), new Dictionary<string, object>
                    {
                        ["id"] = _id,
                        ["specials"] = strSpecials
                    }});

                _data.Add(new object[] { _request4.GetUriPathParameters(), new Dictionary<string, object>
                    {
                        ["id"] = _id,
                        ["count_specials"] = strCountSpecials
                    }});

                _data.Add(new object[] { _request5.GetUriPathParameters(), new Dictionary<string, object>
                    {
                        ["id"] = _id,
                        ["hidden"] = strHidden,
                        ["specials"] = strSpecials
                    }});

                _data.Add(new object[] { _request6.GetUriPathParameters(), new Dictionary<string, object>
                    {
                        ["id"] = _id,
                        ["hidden"] = strHidden,
                        ["count_specials"] = strCountSpecials
                    }});

                _data.Add(new object[] { _request7.GetUriPathParameters(), new Dictionary<string, object>
                    {
                        ["id"] = _id,
                        ["specials"] = strSpecials,
                        ["count_specials"] = strCountSpecials
                    }});

                _data.Add(new object[] { _request8.GetUriPathParameters(), new Dictionary<string, object>
                    {
                        ["id"] = _id,
                        ["hidden"] = strHidden,
                        ["specials"] = strSpecials,
                        ["count_specials"] = strCountSpecials
                    }});
            }

            public IEnumerator<object[]> GetEnumerator() => _data.GetEnumerator();

            IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
        }
    }
}


text:
import java.util.Scanner;

public class Recursion {

	static int factorial(int n) {
		if(n == 0) {
			return 1;
		} else {
			return n*factorial(n-1);
		}
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.close();
        int result = factorial(n);
        System.out.println(result);
    }
}


text:
* **SessionManager** Manages active sessions and session metadata.
* **SaveHandler** Supports filesystem and database storage of session data.
* **Config** manages server's session-related configurations.


text:
package org.jboss.as.quickstarts.loggingToolsQS.loggers;

import java.io.Serializable;
import java.text.ParseException;
import javax.annotation.Generated;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.DelegatingBasicLogger;
import org.jboss.logging.Logger;

/**
 * Warning this class consists of generated code.
 *
 */
@Generated(value = "org.jboss.logging.processor.generator.model.MessageLoggerImplementor", date = "2015-10-14T23:22:02+0200")
public class DateLogger_$logger
    extends DelegatingBasicLogger
    implements Serializable, DateLogger, BasicLogger
{

    private final static long serialVersionUID = 1L;
    private final static java.lang.String FQCN = DateLogger_$logger.class.getName();
    private final static java.lang.String logDaysUntilRequest = "GTRDATES000004: Requested number of days until '%s'";
    private final static java.lang.String logStringCouldntParseAsDate = "GTRDATES000003: Invalid date passed as string: %s";

    public DateLogger_$logger(final Logger log) {
        super(log);
    }

    public final void logDaysUntilRequest(final java.lang.String dateString) {
        super.log.logf(FQCN, (org.jboss.logging.Logger.Level.INFO), null, logDaysUntilRequest$str(), dateString);
    }

    protected java.lang.String logDaysUntilRequest$str() {
        return logDaysUntilRequest;
    }

    public final void logStringCouldntParseAsDate(final java.lang.String datestring, final ParseException exception) {
        super.log.logf(FQCN, (org.jboss.logging.Logger.Level.ERROR), (exception), logStringCouldntParseAsDate$str(), datestring);
    }

    protected java.lang.String logStringCouldntParseAsDate$str() {
        return logStringCouldntParseAsDate;
    }

}


text:
package org.kuali.kfs.coa.document.web;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import org.kuali.kfs.coa.businessobject.ObjectLevel;
import org.kuali.kfs.sys.KFSConstants;
import org.kuali.kfs.sys.context.SpringContext;
import org.kuali.kfs.sys.document.web.CodeDescriptionFormatterBase;
import org.kuali.rice.krad.bo.PersistableBusinessObject;
import org.kuali.rice.krad.service.BusinessObjectService;

/**
 * This class...
 */
public class ObjectLevelCodeDescriptionFormatter extends CodeDescriptionFormatterBase {

    private String chartOfAccountsCode;

    public ObjectLevelCodeDescriptionFormatter(String chartOfAccountsCode) {
        this.chartOfAccountsCode = chartOfAccountsCode;
    }

    /**
     * @see org.kuali.kfs.sys.document.web.CodeDescriptionFormatterBase#getDescriptionOfBO(org.kuali.rice.krad.bo.BusinessObject)
     */
    @Override
    protected String getDescriptionOfBO(PersistableBusinessObject bo) {
        return ((ObjectLevel) bo).getFinancialObjectLevelName();
    }

    /**
     * @see org.kuali.kfs.sys.document.web.CodeDescriptionFormatterBase#getValuesToBusinessObjectsMap(java.util.Set)
     */
    @Override
    protected Map<String, PersistableBusinessObject> getValuesToBusinessObjectsMap(Set values) {
        Map<String, Object> criteria = new HashMap<String, Object>();
        criteria.put(KFSConstants.CHART_OF_ACCOUNTS_CODE_PROPERTY_NAME, chartOfAccountsCode);
        criteria.put(KFSConstants.FINANCIAL_OBJECT_LEVEL_CODE_PROPERTY_NAME, values);
        Collection<ObjectLevel> coll = SpringContext.getBean(BusinessObjectService.class).findMatchingOrderBy(ObjectLevel.class, criteria, KFSConstants.VERSION_NUMBER, true);

        Map<String, PersistableBusinessObject> results = new HashMap<String, PersistableBusinessObject>();
        // TODO: worry about version #s
        for (ObjectLevel ol : coll) {
            results.put(ol.getFinancialObjectLevelCode(), ol);
        }
        return results;
    }

}


text:
layout: category
title: FIRE World
---

Best Places to Live in the World


text:
var ComponentsBootstrapMaxlength = function () {

    var handleBootstrapMaxlength = function() {
        $('#maxlength_defaultconfig').maxlength({
            limitReachedClass: "label label-danger",
        })

        $('#maxlength_thresholdconfig').maxlength({
            limitReachedClass: "label label-danger",
            threshold: 20
        });

        $('#maxlength_alloptions').maxlength({
            alwaysShow: true,
            warningClass: "label label-success",
            limitReachedClass: "label label-danger",
            separator: ' out of ',
            preText: 'You typed ',
            postText: ' chars available.',
            validate: true
        });

        $('#maxlength_textarea').maxlength({
            limitReachedClass: "label label-danger",
            alwaysShow: true
        });

        $('#maxlength_placement').maxlength({
            limitReachedClass: "label label-danger",
            alwaysShow: true,
            placement: App.isRTL() ? 'top-right' : 'top-left'
        });
    }

    return {
        //main function to initiate the module
        init: function () {
            handleBootstrapMaxlength();
        }
    };

}();

jQuery(document).ready(function() {
   ComponentsBootstrapMaxlength.init();
});


text:
package org.pentaho.di.trans.steps.loadsave;

import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import org.pentaho.di.cluster.ClusterSchema;
import org.pentaho.di.cluster.SlaveServer;
import org.pentaho.di.core.Condition;
import org.pentaho.di.core.ProgressMonitorListener;
import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.KettleSecurityException;
import org.pentaho.di.core.logging.LogChannelInterface;
import org.pentaho.di.job.JobMeta;
import org.pentaho.di.partition.PartitionSchema;
import org.pentaho.di.repository.AbstractRepository;
import org.pentaho.di.repository.IRepositoryExporter;
import org.pentaho.di.repository.IRepositoryImporter;
import org.pentaho.di.repository.IRepositoryService;
import org.pentaho.di.repository.IUser;
import org.pentaho.di.repository.ObjectId;
import org.pentaho.di.repository.RepositoryDirectoryInterface;
import org.pentaho.di.repository.RepositoryElementInterface;
import org.pentaho.di.repository.RepositoryElementMetaInterface;
import org.pentaho.di.repository.RepositoryMeta;
import org.pentaho.di.repository.RepositoryObject;
import org.pentaho.di.repository.RepositoryObjectType;
import org.pentaho.di.repository.RepositorySecurityManager;
import org.pentaho.di.repository.RepositorySecurityProvider;
import org.pentaho.di.shared.SharedObjects;
import org.pentaho.di.trans.TransMeta;
import org.pentaho.metastore.api.IMetaStore;

public class MemoryRepository extends AbstractRepository {
  private final Map<ObjectId, Map<Integer, Map<String, String>>> stepAttributeMap =
    new HashMap<ObjectId, Map<Integer, Map<String, String>>>();
  private final Map<ObjectId, Map<Integer, Map<String, String>>> jobAttributeMap =
    new HashMap<ObjectId, Map<Integer, Map<String, String>>>();

  private String getAttribute( Map<ObjectId, Map<Integer, Map<String, String>>> attributeMap, ObjectId id, int nr,
    String code, String def ) {
    String value = null;
    Map<Integer, Map<String, String>> stepMap = attributeMap.get( id );
    if ( stepMap != null ) {
      Map<String, String> numberMap = stepMap.get( nr );
      if ( numberMap != null ) {
        value = numberMap.get( code );
      }
    }
    return value == null ? def : value;
  }

  private void setAttribute( Map<ObjectId, Map<Integer, Map<String, String>>> attributeMap, ObjectId id, int nr,
    String code, String value ) {
    Map<Integer, Map<String, String>> stepMap = attributeMap.get( id );
    if ( stepMap == null ) {
      stepMap = new HashMap<Integer, Map<String, String>>();
      attributeMap.put( id, stepMap );
    }
    Map<String, String> numberMap = stepMap.get( nr );
    if ( numberMap == null ) {
      numberMap = new HashMap<String, String>();
      stepMap.put( nr, numberMap );
    }
    numberMap.put( code, value );
  }

  private String getStepAttribute( ObjectId id_step, int nr, String code, String def ) {
    return getAttribute( stepAttributeMap, id_step, nr, code, def );
  }

  private void setStepAttribute( ObjectId id_transformation, ObjectId id_step, int nr, String code, String value ) {
    setAttribute( stepAttributeMap, id_step, nr, code, value );
  }

  private String getJobAttribute( ObjectId id_job, int nr, String code, String def ) {
    return getAttribute( jobAttributeMap, id_job, nr, code, def );
  }

  private void setJobAttribute( ObjectId id_job, int nr, String code, String value ) {
    setAttribute( jobAttributeMap, id_job, nr, code, value );
  }

  @Override
  public String getName() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String getVersion() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public RepositoryMeta getRepositoryMeta() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public IUser getUserInfo() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public RepositorySecurityProvider getSecurityProvider() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public RepositorySecurityManager getSecurityManager() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public LogChannelInterface getLog() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void connect( String username, String password ) throws KettleException, KettleSecurityException {
    // TODO Auto-generated method stub

  }

  @Override
  public void disconnect() {
    // TODO Auto-generated method stub

  }

  @Override
  public boolean isConnected() {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public void init( RepositoryMeta repositoryMeta ) {
    // TODO Auto-generated method stub
  }

  @Override
  public boolean exists( String name, RepositoryDirectoryInterface repositoryDirectory,
    RepositoryObjectType objectType ) throws KettleException {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public ObjectId getTransformationID( String name, RepositoryDirectoryInterface repositoryDirectory ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public ObjectId getJobId( String name, RepositoryDirectoryInterface repositoryDirectory ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void save( RepositoryElementInterface repositoryElement, String versionComment,
    ProgressMonitorListener monitor, boolean overwrite ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public void save( RepositoryElementInterface repositoryElement, String versionComment, Calendar versionDate,
    ProgressMonitorListener monitor, boolean overwrite ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public RepositoryDirectoryInterface getDefaultSaveDirectory( RepositoryElementInterface repositoryElement ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public RepositoryDirectoryInterface getUserHomeDirectory() throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void clearSharedObjectCache() {
    // TODO Auto-generated method stub

  }

  @Override
  public TransMeta loadTransformation( String transname, RepositoryDirectoryInterface repdir,
    ProgressMonitorListener monitor, boolean setInternalVariables, String revision ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public TransMeta loadTransformation( ObjectId id_transformation, String versionLabel ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public SharedObjects readTransSharedObjects( TransMeta transMeta ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public ObjectId renameTransformation( ObjectId id_transformation, RepositoryDirectoryInterface newDirectory,
    String newName ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void deleteTransformation( ObjectId id_transformation ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public JobMeta loadJob( String jobname, RepositoryDirectoryInterface repdir, ProgressMonitorListener monitor,
    String revision ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public JobMeta loadJob( ObjectId id_job, String versionLabel ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public SharedObjects readJobMetaSharedObjects( JobMeta jobMeta ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public ObjectId renameJob( ObjectId id_job, RepositoryDirectoryInterface newDirectory, String newName ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void deleteJob( ObjectId id_job ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public DatabaseMeta loadDatabaseMeta( ObjectId id_database, String revision ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void deleteDatabaseMeta( String databaseName ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public ObjectId[] getDatabaseIDs( boolean includeDeleted ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String[] getDatabaseNames( boolean includeDeleted ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public List<DatabaseMeta> readDatabases() throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public ObjectId getDatabaseID( String name ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public ClusterSchema loadClusterSchema( ObjectId id_cluster_schema, List<SlaveServer> slaveServers,
    String versionLabel ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public ObjectId[] getClusterIDs( boolean includeDeleted ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String[] getClusterNames( boolean includeDeleted ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public ObjectId getClusterID( String name ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void deleteClusterSchema( ObjectId id_cluster ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public SlaveServer loadSlaveServer( ObjectId id_slave_server, String versionLabel ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public ObjectId[] getSlaveIDs( boolean includeDeleted ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String[] getSlaveNames( boolean includeDeleted ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public List<SlaveServer> getSlaveServers() throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public ObjectId getSlaveID( String name ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void deleteSlave( ObjectId id_slave ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public PartitionSchema loadPartitionSchema( ObjectId id_partition_schema, String versionLabel ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public ObjectId[] getPartitionSchemaIDs( boolean includeDeleted ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String[] getPartitionSchemaNames( boolean includeDeleted ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public ObjectId getPartitionSchemaID( String name ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void deletePartitionSchema( ObjectId id_partition_schema ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public RepositoryDirectoryInterface loadRepositoryDirectoryTree() throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public RepositoryDirectoryInterface findDirectory( String directory ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public RepositoryDirectoryInterface findDirectory( ObjectId directory ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void saveRepositoryDirectory( RepositoryDirectoryInterface dir ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public void deleteRepositoryDirectory( RepositoryDirectoryInterface dir ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public ObjectId renameRepositoryDirectory( ObjectId id, RepositoryDirectoryInterface newParentDir, String newName ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public RepositoryDirectoryInterface createRepositoryDirectory( RepositoryDirectoryInterface parentDirectory,
    String directoryPath ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String[] getTransformationNames( ObjectId id_directory, boolean includeDeleted ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public List<RepositoryElementMetaInterface> getJobObjects( ObjectId id_directory, boolean includeDeleted ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public List<RepositoryElementMetaInterface> getTransformationObjects( ObjectId id_directory, boolean includeDeleted ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public List<RepositoryElementMetaInterface> getJobAndTransformationObjects( ObjectId id_directory,
    boolean includeDeleted ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String[] getJobNames( ObjectId id_directory, boolean includeDeleted ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String[] getDirectoryNames( ObjectId id_directory ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public ObjectId insertLogEntry( String description ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void insertStepDatabase( ObjectId id_transformation, ObjectId id_step, ObjectId id_database ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public void insertJobEntryDatabase( ObjectId id_job, ObjectId id_jobentry, ObjectId id_database ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public void saveConditionStepAttribute( ObjectId id_transformation, ObjectId id_step, String code,
    Condition condition ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public Condition loadConditionFromStepAttribute( ObjectId id_step, String code ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public boolean getStepAttributeBoolean( ObjectId id_step, int nr, String code, boolean def ) throws KettleException {
    return "Y".equalsIgnoreCase( getStepAttribute( id_step, nr, code, def ? "Y" : "N" ) );
  }

  @Override
  public long getStepAttributeInteger( ObjectId id_step, int nr, String code ) throws KettleException {
    return Long.valueOf( getStepAttribute( id_step, nr, code, "0" ) );
  }

  @Override
  public String getStepAttributeString( ObjectId id_step, int nr, String code ) throws KettleException {
    return getStepAttribute( id_step, nr, code, null );
  }

  @Override
  public void saveStepAttribute( ObjectId id_transformation, ObjectId id_step, int nr, String code, String value ) throws KettleException {
    setStepAttribute( id_transformation, id_step, nr, code, value );
  }

  @Override
  public void saveStepAttribute( ObjectId id_transformation, ObjectId id_step, int nr, String code, boolean value ) throws KettleException {
    setStepAttribute( id_transformation, id_step, nr, code, value ? "Y" : "N" );
  }

  @Override
  public void saveStepAttribute( ObjectId id_transformation, ObjectId id_step, int nr, String code, long value ) throws KettleException {
    setStepAttribute( id_transformation, id_step, nr, code, Long.toString( value ) );
  }

  @Override
  public void saveStepAttribute( ObjectId id_transformation, ObjectId id_step, int nr, String code, double value ) throws KettleException {
    setStepAttribute( id_transformation, id_step, nr, code, Double.toString( value ) );
  }

  @Override
  public int countNrStepAttributes( ObjectId id_step, String code ) throws KettleException {
    Map<Integer, Map<String, String>> stepMap = stepAttributeMap.get( id_step );
    int count = 0;
    for ( Entry<Integer, Map<String, String>> entry : stepMap.entrySet() ) {
      if ( entry.getValue().get( code ) != null ) {
        count++;
      }
    }
    return count;
  }

  @Override
  public int countNrJobEntryAttributes( ObjectId id_jobentry, String code ) throws KettleException {
    // TODO Auto-generated method stub
    return 0;
  }

  @Override
  public long getJobEntryAttributeInteger( ObjectId id_jobentry, int nr, String code ) throws KettleException {
    return Long.parseLong( getJobAttribute( id_jobentry, nr, code, "0" ) );
  }

  @Override
  public String getJobEntryAttributeString( ObjectId id_jobentry, int nr, String code ) throws KettleException {
    return getJobAttribute( id_jobentry, nr, code, null );
  }

  @Override
  public void saveJobEntryAttribute( ObjectId id_job, ObjectId id_jobentry, int nr, String code, String value ) throws KettleException {
    setJobAttribute( id_jobentry, nr, code, value );
  }

  @Override
  public void saveJobEntryAttribute( ObjectId id_job, ObjectId id_jobentry, int nr, String code, boolean value ) throws KettleException {
    setJobAttribute( id_jobentry, nr, code, value ? "Y" : "N" );
  }

  @Override
  public void saveJobEntryAttribute( ObjectId id_job, ObjectId id_jobentry, int nr, String code, long value ) throws KettleException {
    setJobAttribute( id_jobentry, nr, code, Long.toString( value ) );
  }

  @Override
  public DatabaseMeta loadDatabaseMetaFromStepAttribute( ObjectId id_step, String code, List<DatabaseMeta> databases ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void saveDatabaseMetaStepAttribute( ObjectId id_transformation, ObjectId id_step, String code,
    DatabaseMeta database ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public DatabaseMeta loadDatabaseMetaFromJobEntryAttribute( ObjectId id_jobentry, String nameCode, int nr,
    String idCode, List<DatabaseMeta> databases ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void saveDatabaseMetaJobEntryAttribute( ObjectId id_job, ObjectId id_jobentry, int nr, String nameCode,
    String idCode, DatabaseMeta database ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public void undeleteObject( RepositoryElementMetaInterface repositoryObject ) throws KettleException {
    // TODO Auto-generated method stub

  }

  @Override
  public List<Class<? extends IRepositoryService>> getServiceInterfaces() throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public IRepositoryService getService( Class<? extends IRepositoryService> clazz ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public boolean hasService( Class<? extends IRepositoryService> clazz ) throws KettleException {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public RepositoryObject getObjectInformation( ObjectId objectId, RepositoryObjectType objectType ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String getConnectMessage() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String[] getJobsUsingDatabase( ObjectId id_database ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String[] getTransformationsUsingDatabase( ObjectId id_database ) throws KettleException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public IRepositoryImporter getImporter() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public IRepositoryExporter getExporter() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public IMetaStore getMetaStore() {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public boolean getJobEntryAttributeBoolean( ObjectId id_jobentry, int nr, String code, boolean def ) throws KettleException {
    return "Y".equalsIgnoreCase( getJobAttribute( id_jobentry, nr, code, def ? "Y" : "N" ) );
  }

}


text:
import sys, traceback, time, re
import os
from django.conf import settings
from django.db.backends.creation import BaseDatabaseCreation, TEST_DATABASE_PREFIX

try:
    import adsdb as Database
except ImportError, e:
    from django.core.exceptions import ImproperlyConfigured
    raise ImproperlyConfigured("Error loading adsdb module: %s" % e)

class DatabaseCreation(BaseDatabaseCreation):
    # This dictionary maps Field objects to their associated Advantage column
    # types, as strings. Column-type strings can contain format strings; they'll
    # be interpolated against the values of Field.__dict__ before being output.
    # If a column type is set to None, it won't be included in the output.
    # NOTE: All char type fields use varchar so that ADS automatically trims trailing spaces
    data_types = {
        'AutoField':         'autoinc',
        'BooleanField':      'logical',
        'NullBooleanField':  'logical',
        'CharField':         'nvarchar(%(max_length)s)',
        'CommaSeparatedIntegerField': 'nvarchar(%(max_length)s)',
        'DateField':         'date',
        'DateTimeField':     'timestamp',
        'DecimalField':      'numeric(%(max_digits)s, %(decimal_places)s)',
        'FileField':         'nvarchar(%(max_length)s)',
        'FilePathField':     'nvarchar(%(max_length)s)',
        'FloatField':        'double',
        'IntegerField':      'integer',
        'BigIntegerField':   'integer',
        'IPAddressField':    'nvarchar(15)',
        'OneToOneField':     'integer',
        'PhoneNubmerField':  'nvarchar(20)',
        'PositiveIntegerField': 'integer',
        'PositiveSmallIntegerField': 'short',
        'SlugField':         'nvarchar(%(max_length)s)',
        'SmallIntegerField': 'short',
        'TextField':         'nmemo',
        'TimeField':         'time',
        'USStateField':      'nvarchar(2)',
    }

    def sql_for_inline_foreign_key_references(self, field, known_models, style):
        """Don't use inline references for Advantage. This makes it
        easier to deal with conditionally creating UNIQUE constraints
        and UNIQUE indexes"""
        return [], True

    def sql_for_inline_many_to_many_references(self, model, field, style):
        from django.db import models
        opts = model._meta
        qn = self.connection.ops.quote_name

        table_output = [
            '    %s %s,' %
                (style.SQL_FIELD(qn(field.m2m_column_name())),
                style.SQL_COLTYPE(models.ForeignKey(model).db_type())),
            '    %s %s,' %
            (style.SQL_FIELD(qn(field.m2m_reverse_name())),
            style.SQL_COLTYPE(models.ForeignKey(field.rel.to).db_type()))
        ]
        deferred = [
            (field.m2m_db_table(), field.m2m_column_name(), opts.db_table,
                opts.pk.column),
            (field.m2m_db_table(), field.m2m_reverse_name(),
                field.rel.to._meta.db_table, field.rel.to._meta.pk.column)
            ]
        return table_output, deferred

    def sql_for_pending_references(self, model, style, pending_references):
        "ADSDB doesn't support constraints"
        return []

    def sql_remove_table_constraints(self, model, references_to_delete, style):
        "ADSDB doesn't support constraints"
        return []

    def _create_test_db(self, verbosity, autoclobber):
        "Internal implementation - creates the test db tables."

        test_database_name = self.connection.settings_dict['TEST_NAME']
        if test_database_name == None :
            test_database_name = 'test_ads.add'

        test_database_path = self.connection.settings_dict['NAME']

        for file in os.listdir( test_database_path ):
            if file.endswith( 'adt' ):
                os.remove( file )
            elif file.endswith( 'adm' ):
                os.remove( file )
            elif file.endswith( 'adi' ):
                os.remove( file )
            elif file.endswith( 'add' ):
                os.remove( file )
            elif file.endswith( 'ai' ):
                os.remove( file )
            elif file.endswith( 'am' ):
                os.remove( file )

        cursor = self.connection.cursor()

        try:
            cursor.execute( "CREATE DATABASE [%s];" % test_database_name )
        except Exception, e:
            traceback.print_exc()
            sys.stderr.write("Got an error creating the test database: %s\n" % e)
            sys.exit(2)

        cursor.close()
        test_database_path = self.connection.settings_dict['NAME']
        self.connection.settings_dict['NAME'] = '%s/%s' % (test_database_path, test_database_name)
        return test_database_name

    def _destroy_test_db(self, test_database_name, verbosity):
        "Internal implementation - remove the test db tables."
        self.connection.close()

    def _rollback_works(self):
        "Test to determine if rollbacks work" # needed by the django test suite
        cursor = self.connection.cursor()
        cursor.execute('CREATE TABLE ROLLBACK_TEST (X INTEGER)')
        self.connection._commit()
        cursor.execute('BEGIN TRANSACTION')
        cursor.execute('INSERT INTO ROLLBACK_TEST (X) VALUES (8)')
        self.connection._rollback()
        cursor.execute('SELECT COUNT(X) FROM ROLLBACK_TEST')
        count, = cursor.fetchone()
        cursor.execute('DROP TABLE ROLLBACK_TEST')
        self.connection._commit()
        return count == 0

    def _unique_swap(self, query, fields, model, style, table=None):
        """
        Fix unique constraints on multiple fields
        Build unique indexes instead of unique constraints

        Follows SQL generation from
        django.db.creation.BaseDatabaseCreation.sql_create_model
        """
        opts = model._meta
        qn = self.connection.ops.quote_name

        if table == None:
            table = opts.db_table

        fields_str = ", ".join([style.SQL_FIELD(qn(f)) for f in fields])
        multi_name = style.SQL_FIELD(qn("_".join(f for f in fields)))
        unique_str = 'UNIQUE (%s)' % fields_str
        unique_re_str = re.escape(unique_str) + '[,]?\n'
        query = re.sub(unique_re_str, '', query)

        idx_query = 'CREATE UNIQUE INDEX %s ON %s (%s);' % \
            (multi_name, style.SQL_FIELD(qn(table)), fields_str)
        return [query, idx_query]

    def _unique_swap_many(self, queries, fields, model, style, table=None):
        for i, query in enumerate(queries):
            changes = self._unique_swap(query, fields, model, style, table=table)
            if changes[0] != query:
                queries[i] = changes[0]
                queries.append(changes[1])

        return queries

    def sql_create_model(self, model, style, known_models=set()):
        """
        Returns the SQL required to create a single model, as a tuple of:
            (list_of_sql, pending_references_dict)
        """

        # Let BaseDatabaseCreation do most of the work
        opts = model._meta

        unique_nullable_fields = []

        for f in opts.local_fields:
            if self.connection.ops.ads_table_type == 'ADT':
                # Set all ADT fields to be nullable so we don't get NOT NULL in the SQL
                f.null = True
            if f.unique and f.null:
                unique_nullable_fields.append(f)
                f._unique = False

        outputs, pending = super(DatabaseCreation,self).sql_create_model(model,style,known_models)

        # Set null to False for BooleanFields so they don't fail validation later
        from django.db import models
        for f in opts.local_fields:
            if isinstance( f, models.BooleanField ):
                f.null = False

        qn = self.connection.ops.quote_name
        for f in unique_nullable_fields:
            f._unique = True
            # Primary key fields automatically get a UNIQUE index, so no need to create another one here
            if not f.primary_key:
                outputs.append("CREATE UNIQUE INDEX %s on %s(%s);" % ("%s_%s_UNIQUE" % (opts.db_table, f.column), qn(opts.db_table), qn(f.column)))

        for field_constraints in opts.unique_together:
            fields = [opts.get_field(f).column for f in field_constraints]
            outputs = self._unique_swap_many(outputs, fields, model, style)

        return outputs, pending

    def sql_for_many_to_many_field(self, model, f, style):
        "ADS doesn't support relations with django"
        return []


text:
namespace TV.Core
{
    public interface IDbStorable
    {
        void Save();
        void Reload();
        void Delete();
    }
}


text:
package br.com.yassuda.rest.service;

import br.com.yassuda.rest.dao.EnderecoDAO;
import br.com.yassuda.rest.dao.UsuarioDAO;
import br.com.yassuda.rest.model.Usuario;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Classe de serviços do Endereço.
 */
@Service
public class UsuarioService {

    private static final Logger logger = LogManager.getLogger(UsuarioService.class);

    @Autowired
    private UsuarioDAO usuarioDAO;

    @Autowired
    private EnderecoDAO enderecoDAO;

    public List<Usuario> lista() {
        List<Usuario> usuarios = usuarioDAO.findAll();
        return usuarioDAO.findAll();
    }

    public Usuario atualiza(Usuario usuario) {
        return usuarioDAO.save(usuario);
    }

    public Usuario persiste(Usuario usuario) {
        return usuarioDAO.save(usuario);
    }

    public void deleta(Long id){
        usuarioDAO.delete(id);
    }
}


text:
START_ATF_NAMESPACE
    namespace Detail
    {
        extern ::std::array<hook_record, 2> _qry_case_alive_char_functions;
    }; // end namespace Detail
END_ATF_NAMESPACE


text:
BOGOTA	ISSUED	BANKS
ORDERS	ISSUED	BANKS
MINISTRY	PLACED	WAVE
MINISTRY	PLACED	AREAS


text:
package leveldb

import (
	"fmt"
	"io/ioutil"
	"runtime"
	"testing"

	"v.io/x/ref/services/syncbase/store"
	"v.io/x/ref/services/syncbase/store/test"
)

func init() {
	runtime.GOMAXPROCS(10)
}

func TestStream(t *testing.T) {
	runTest(t, test.RunStreamTest)
}

func TestSnapshot(t *testing.T) {
	runTest(t, test.RunSnapshotTest)
}

func TestStoreState(t *testing.T) {
	runTest(t, test.RunStoreStateTest)
}

func TestClose(t *testing.T) {
	runTest(t, test.RunCloseTest)
}

func TestReadWriteBasic(t *testing.T) {
	runTest(t, test.RunReadWriteBasicTest)
}

func TestReadWriteRandom(t *testing.T) {
	runTest(t, test.RunReadWriteRandomTest)
}

func TestConcurrentTransactions(t *testing.T) {
	runTest(t, test.RunConcurrentTransactionsTest)
}

func TestTransactionState(t *testing.T) {
	runTest(t, test.RunTransactionStateTest)
}

func TestTransactionsWithGet(t *testing.T) {
	runTest(t, test.RunTransactionsWithGetTest)
}

func TestOpenOptions(t *testing.T) {
	path, err := ioutil.TempDir("", "syncbase_leveldb")
	if err != nil {
		t.Fatalf("can't create temp dir: %v", err)
	}
	// DB is missing => call should fail.
	st, err := Open(path, OpenOptions{CreateIfMissing: false, ErrorIfExists: false})
	if err == nil {
		t.Fatalf("open should've failed")
	}
	// DB is missing => call should succeed.
	st, err = Open(path, OpenOptions{CreateIfMissing: true, ErrorIfExists: false})
	if err != nil {
		t.Fatalf("open failed: %v", err)
	}
	st.Close()
	// DB exists => call should succeed.
	st, err = Open(path, OpenOptions{CreateIfMissing: false, ErrorIfExists: false})
	if err != nil {
		t.Fatalf("open failed: %v", err)
	}
	st.Close()
	// DB exists => call should fail.
	st, err = Open(path, OpenOptions{CreateIfMissing: false, ErrorIfExists: true})
	if err == nil {
		t.Fatalf("open should've failed")
	}
	// DB exists => call should fail.
	st, err = Open(path, OpenOptions{CreateIfMissing: true, ErrorIfExists: true})
	if err == nil {
		t.Fatalf("open should've failed")
	}
	// DB exists => call should succeed.
	st, err = Open(path, OpenOptions{CreateIfMissing: true, ErrorIfExists: false})
	if err != nil {
		t.Fatalf("open failed: %v", err)
	}
	st.Close()
	if err := Destroy(path); err != nil {
		t.Fatalf("destroy failed: %v", err)
	}
}

func runTest(t *testing.T, f func(t *testing.T, st store.Store)) {
	st, dbPath := newDB()
	defer destroyDB(st, dbPath)
	f(t, st)
}

func newDB() (store.Store, string) {
	path, err := ioutil.TempDir("", "syncbase_leveldb")
	if err != nil {
		panic(fmt.Sprintf("can't create temp dir: %v", err))
	}
	st, err := Open(path, OpenOptions{CreateIfMissing: true, ErrorIfExists: true})
	if err != nil {
		panic(fmt.Sprintf("can't open db at %v: %v", path, err))
	}
	return st, path
}

func destroyDB(st store.Store, path string) {
	st.Close()
	if err := Destroy(path); err != nil {
		panic(fmt.Sprintf("can't destroy db at %v: %v", path, err))
	}
}


text:
package com.ja.markdown.modeller.sc.java.lombok;

import lombok.Data;

import com.ja.markdown.modeller.sc.java.JavaModelPlugin;
import com.ja.markdown.modeller.sc.java.model.JavaAnnotation;
import com.ja.markdown.modeller.sc.java.model.JavaClass;
import com.ja.markdown.modeller.sc.java.model.JavaDependency;
import com.ja.markdown.modeller.sc.java.model.JavaMember;
import com.ja.markdown.modeller.sc.java.model.JavaProject;

public class LombokEnhancer implements JavaModelPlugin {

	@Override
	public void execute(final JavaProject project) {
		project.add(JavaDependency.provided("org.projectlombok:lombok:1.12.4"));
		for (final JavaClass jc : project.getJavaModel().getClasses()) {
			jc.add(new JavaAnnotation(new JavaClass(Data.class.getName())));
			for (final JavaMember m : jc.getMembers()) {
				m.setWithGetter(false);
				m.setWithSetter(false);
			}
		}
	}
}


text:
package com.company.professor;

import java.util.List;
import java.util.ArrayList;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.Property;
import de.greenrobot.dao.internal.SqlUtils;
import de.greenrobot.dao.internal.DaoConfig;

import com.company.professor.EvolutionTriggerProse;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
 * DAO for table "evolution_trigger_prose".
*/
public class EvolutionTriggerProseDao extends AbstractDao<EvolutionTriggerProse, Long> {

    public static final String TABLENAME = "evolution_trigger_prose";

    /**
     * Properties of entity EvolutionTriggerProse.<br/>
     * Can be used for QueryBuilder and for referencing column names.
    */
    public static class Properties {
        public final static Property EvolutionTriggerId = new Property(0, long.class, "EvolutionTriggerId", true, "evolution_trigger_id");
        public final static Property LocalLanguageId = new Property(1, long.class, "LocalLanguageId", false, "local_language_id");
        public final static Property Name = new Property(2, String.class, "Name", false, "name");
    };

    private DaoSession daoSession;

    public EvolutionTriggerProseDao(DaoConfig config) {
        super(config);
    }

    public EvolutionTriggerProseDao(DaoConfig config, DaoSession daoSession) {
        super(config, daoSession);
        this.daoSession = daoSession;
    }

    /** Creates the underlying database table. */
    public static void createTable(SQLiteDatabase db, boolean ifNotExists) {
        String constraint = ifNotExists? "IF NOT EXISTS ": "";
        db.execSQL("CREATE TABLE " + constraint + "\"evolution_trigger_prose\" (" + //
                "\"evolution_trigger_id\" INTEGER PRIMARY KEY NOT NULL ," + // 0: EvolutionTriggerId
                "\"local_language_id\" INTEGER NOT NULL ," + // 1: LocalLanguageId
                "\"name\" TEXT NOT NULL );"); // 2: Name
        // Add Indexes
        db.execSQL("CREATE UNIQUE INDEX " + constraint + "IDX_evolution_trigger_prose_evolution_trigger_id_local_language_id ON evolution_trigger_prose" +
                " (\"evolution_trigger_id\",\"local_language_id\");");
    }

    /** Drops the underlying database table. */
    public static void dropTable(SQLiteDatabase db, boolean ifExists) {
        String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"evolution_trigger_prose\"";
        db.execSQL(sql);
    }

    /** @inheritdoc */
    @Override
    protected void bindValues(SQLiteStatement stmt, EvolutionTriggerProse entity) {
        stmt.clearBindings();
        stmt.bindLong(1, entity.getEvolutionTriggerId());
        stmt.bindLong(2, entity.getLocalLanguageId());
        stmt.bindString(3, entity.getName());
    }

    @Override
    protected void attachEntity(EvolutionTriggerProse entity) {
        super.attachEntity(entity);
        entity.__setDaoSession(daoSession);
    }

    /** @inheritdoc */
    @Override
    public Long readKey(Cursor cursor, int offset) {
        return cursor.getLong(offset + 0);
    }

    /** @inheritdoc */
    @Override
    public EvolutionTriggerProse readEntity(Cursor cursor, int offset) {
        EvolutionTriggerProse entity = new EvolutionTriggerProse( //
            cursor.getLong(offset + 0), // EvolutionTriggerId
            cursor.getLong(offset + 1), // LocalLanguageId
            cursor.getString(offset + 2) // Name
        );
        return entity;
    }

    /** @inheritdoc */
    @Override
    public void readEntity(Cursor cursor, EvolutionTriggerProse entity, int offset) {
        entity.setEvolutionTriggerId(cursor.getLong(offset + 0));
        entity.setLocalLanguageId(cursor.getLong(offset + 1));
        entity.setName(cursor.getString(offset + 2));
     }

    /** @inheritdoc */
    @Override
    protected Long updateKeyAfterInsert(EvolutionTriggerProse entity, long rowId) {
        entity.setEvolutionTriggerId(rowId);
        return rowId;
    }

    /** @inheritdoc */
    @Override
    public Long getKey(EvolutionTriggerProse entity) {
        if(entity != null) {
            return entity.getEvolutionTriggerId();
        } else {
            return null;
        }
    }

    /** @inheritdoc */
    @Override
    protected boolean isEntityUpdateable() {
        return true;
    }

    private String selectDeep;

    protected String getSelectDeep() {
        if (selectDeep == null) {
            StringBuilder builder = new StringBuilder("SELECT ");
            SqlUtils.appendColumns(builder, "T", getAllColumns());
            builder.append(',');
            SqlUtils.appendColumns(builder, "T0", daoSession.getEvolutionTriggersDao().getAllColumns());
            builder.append(',');
            SqlUtils.appendColumns(builder, "T1", daoSession.getLanguagesDao().getAllColumns());
            builder.append(" FROM evolution_trigger_prose T");
            builder.append(" LEFT JOIN evolution_triggers T0 ON T.\"evolution_trigger_id\"=T0.\"id\"");
            builder.append(" LEFT JOIN languages T1 ON T.\"local_language_id\"=T1.\"id\"");
            builder.append(' ');
            selectDeep = builder.toString();
        }
        return selectDeep;
    }

    protected EvolutionTriggerProse loadCurrentDeep(Cursor cursor, boolean lock) {
        EvolutionTriggerProse entity = loadCurrent(cursor, 0, lock);
        int offset = getAllColumns().length;

        EvolutionTriggers EvolutionTriggers = loadCurrentOther(daoSession.getEvolutionTriggersDao(), cursor, offset);
         if(EvolutionTriggers != null) {
            entity.setEvolutionTriggers(EvolutionTriggers);
        }
        offset += daoSession.getEvolutionTriggersDao().getAllColumns().length;

        Languages Languages = loadCurrentOther(daoSession.getLanguagesDao(), cursor, offset);
         if(Languages != null) {
            entity.setLanguages(Languages);
        }

        return entity;
    }

    public EvolutionTriggerProse loadDeep(Long key) {
        assertSinglePk();
        if (key == null) {
            return null;
        }

        StringBuilder builder = new StringBuilder(getSelectDeep());
        builder.append("WHERE ");
        SqlUtils.appendColumnsEqValue(builder, "T", getPkColumns());
        String sql = builder.toString();

        String[] keyArray = new String[] { key.toString() };
        Cursor cursor = db.rawQuery(sql, keyArray);

        try {
            boolean available = cursor.moveToFirst();
            if (!available) {
                return null;
            } else if (!cursor.isLast()) {
                throw new IllegalStateException("Expected unique result, but count was " + cursor.getCount());
            }
            return loadCurrentDeep(cursor, true);
        } finally {
            cursor.close();
        }
    }

    /** Reads all available rows from the given cursor and returns a list of new ImageTO objects. */
    public List<EvolutionTriggerProse> loadAllDeepFromCursor(Cursor cursor) {
        int count = cursor.getCount();
        List<EvolutionTriggerProse> list = new ArrayList<EvolutionTriggerProse>(count);

        if (cursor.moveToFirst()) {
            if (identityScope != null) {
                identityScope.lock();
                identityScope.reserveRoom(count);
            }
            try {
                do {
                    list.add(loadCurrentDeep(cursor, false));
                } while (cursor.moveToNext());
            } finally {
                if (identityScope != null) {
                    identityScope.unlock();
                }
            }
        }
        return list;
    }

    protected List<EvolutionTriggerProse> loadDeepAllAndCloseCursor(Cursor cursor) {
        try {
            return loadAllDeepFromCursor(cursor);
        } finally {
            cursor.close();
        }
    }

    /** A raw-style query where you can pass any WHERE clause and arguments. */
    public List<EvolutionTriggerProse> queryDeep(String where, String... selectionArg) {
        Cursor cursor = db.rawQuery(getSelectDeep() + where, selectionArg);
        return loadDeepAllAndCloseCursor(cursor);
    }

}


text:
"use strict";

var RouteChromosomeSplicer = require("./RouteChromosomeSplicer");
var RouteIncubator = require("./RouteIncubator");
var RouteList = require("./RouteList");

/**
 * A finder of a route, consisting of a start path, a list of waypoints and an
 * optional destination. The order of the waypoints will be optimized during
 * the search.
 *
 * @constructor
 * @param {everoute.travel.search.RouteFinderBuilder} builder the builder with all parameters
 * @memberof everoute.travel.search
 */
function RouteFinder(builder) {
  var self = this;

  function onRouteFound(route) {
    self.onRouteFound(route);
  }

  this.rand = builder.getRandomizer();
  this.rule = builder.getRule();

  this.splicer = new RouteChromosomeSplicer(this.rand);
  this.population = new RouteList(this.rule);
  this.incubator = new RouteIncubator(onRouteFound, builder.getCapability(), this.rule,
    builder.getWaypoints(), builder.getDestination(), this.rand);

  this.startPaths = builder.getStartPaths().slice(0);
  this.waypoints = builder.getWaypoints().slice(0);
  this.collector = builder.getCollector();

  this.populationLimit = builder.getPopulationLimit();
  this.generationLimit = builder.getGenerationLimit();
  this.mutationPercentage = builder.getMutationPercentage();
  this.uncontestedLimit = this.generationLimit / 4;

  this.generationCount = 0;
  this.uncontestedCount = 0;

  this.bestRoute = null;
}

/**
 * Continues the search. This method should be called until it returned false.
 *
 * @return {Boolean} false if the search is completed
 * @memberof! everoute.travel.search.RouteFinder.prototype
 */
RouteFinder.prototype.continueSearch = function() {
  var result = false;

  if ((this.generationCount < this.generationLimit) && (this.uncontestedCount < this.uncontestedLimit)) {
    result = true;
    if (!this.incubator.continueGrowth()) {
      this.generationCount++;
      this.uncontestedCount++;

      this.ensurePopulationSize();
      this.createOffsprings();
    }
  }

  return result;
};

/**
 * Called when a route was found.
 *
 * @private
 * @param {everoute.travel.search.Route} route The found route
 * @memberof! everoute.travel.search.RouteFinder.prototype
 */
RouteFinder.prototype.onRouteFound = function(route) {
  var isBest = this.population.add(route);

  if (isBest) {
    this.uncontestedCount = 0;
    this.collector.collect(route);
  }
};

/**
 * Ensures a properly sized population.
 *
 * @private
 * @memberof! everoute.travel.search.RouteFinder.prototype
 */
RouteFinder.prototype.ensurePopulationSize = function() {
  var missing;

  this.population.limit(this.populationLimit);

  missing = this.populationLimit - this.population.getSize();
  while (missing > 0) {
    this.incubator.request(this.createRandomChromosome());
    missing--;
  }
};

/**
 * @private
 * @return {{}} A new, random chromosome
 * @memberof! everoute.travel.search.RouteFinder.prototype
 */
RouteFinder.prototype.createRandomChromosome = function() {
  return this.splicer.createRandom(this.startPaths, this.waypoints.length);
};

/**
 * Creates offsprings from the current population.
 *
 * @private
 * @memberof! everoute.travel.search.RouteFinder.prototype
 */
RouteFinder.prototype.createOffsprings = function() {
  var size = this.population.getSize();
  var crossoverIndex = this.rand.getIndex(this.waypoints.length + 1);
  var shouldMutate = this.rand.getIndex(100) < this.mutationPercentage;
  var parent1;
  var parent2;

  if (size >= 2) {
    parent1 = this.population.get(this.rand.getIndex(size)).getChromosome();
    parent2 = this.population.get(this.rand.getIndex(size)).getChromosome();

    if (shouldMutate) {
      this.createMutatedOffsprings(parent1, parent2, crossoverIndex);
    } else {
      this.incubator.request(this.splicer.createOffspring(parent1, parent2, crossoverIndex));
      this.incubator.request(this.splicer.createOffspring(parent2, parent1, crossoverIndex));
    }
  }
};

/**
 * Creates mutated offsprings using given parameters. The parents are spliced with
 * a new, random chromosome at the given crossover index.
 *
 * @private
 * @param {{}} parent1 The first chromosome
 * @param {{}} parent2 The second chromosome
 * @param {Number} crossoverIndex The waypoint index at which to splice
 * @memberof! everoute.travel.search.RouteFinder.prototype
 */
RouteFinder.prototype.createMutatedOffsprings = function(parent1, parent2, crossoverIndex) {
  var randomChromosome = this.createRandomChromosome();

  this.incubator.request(this.splicer.createOffspring(parent1, randomChromosome, crossoverIndex));
  this.incubator.request(this.splicer.createOffspring(randomChromosome, parent1, crossoverIndex));
  this.incubator.request(this.splicer.createOffspring(parent2, randomChromosome, crossoverIndex));
  this.incubator.request(this.splicer.createOffspring(randomChromosome, parent2, crossoverIndex));
};

module.exports = RouteFinder;


text:
angular.module('HealthFactors', [])
.service('HealthFactors', ['$http', '$rootScope',
function($http, $rootScope){

    const self = this;

    this.data;

    this.getHealthFactors = () => {

        return $http.get('../data/healthfactors.json').then(res => {

            self.data = res.data.rows;

            return self.data;
        })
    }

    this.getHealthFactor = (id) => {
        return self.data.filter(row => row.id === id)
    }
}])


text:
<?php

declare(strict_types=1);

namespace App\Tests\Command;

use App\Command\ListSchoolConfigValuesCommand;
use App\Entity\SchoolConfigInterface;
use App\Entity\SchoolInterface;
use App\Repository\SchoolConfigRepository;
use App\Repository\SchoolRepository;
use RuntimeException;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Tester\CommandTester;
use Mockery as m;

/**
 * Class ListSchoolConfigValuesCommandTest
 * @package App\Tests\Command
 * @group cli
 */
class ListSchoolConfigValuesCommandTest extends KernelTestCase
{
    use m\Adapter\Phpunit\MockeryPHPUnitIntegration;

    private const COMMAND_NAME = 'ilios:list-school-config-values';

    protected $commandTester;
    protected $schoolRepository;
    protected $schoolConfigRepository;

    public function setUp(): void
    {
        parent::setUp();
        $this->schoolRepository = m::mock(SchoolRepository::class);
        $this->schoolConfigRepository = m::mock(SchoolConfigRepository::class);
        $command = new ListSchoolConfigValuesCommand($this->schoolRepository, $this->schoolConfigRepository);
        $kernel = self::bootKernel();
        $application = new Application($kernel);
        $application->add($command);
        $commandInApp = $application->find(self::COMMAND_NAME);
        $this->commandTester = new CommandTester($commandInApp);
    }

    /**
     * Remove all mock objects
     */
    public function tearDown(): void
    {
        parent::tearDown();
        unset($this->schoolRepository);
        unset($this->schoolConfigRepository);
        unset($this->commandTester);
    }

    public function testExecute()
    {
        $mockSchool = m::mock(SchoolInterface::class);
        $this->schoolRepository->shouldReceive('findOneBy')->once()->with(['id' => '1'])->andReturn($mockSchool);
        $mockConfig = m::mock(SchoolConfigInterface::class);
        $mockConfig->shouldReceive('getName')->once()->andReturn('the-name');
        $mockConfig->shouldReceive('getValue')->once()->andReturn('the-value');
        $this->schoolConfigRepository->shouldReceive('findBy')
            ->with(['school' => '1'], ['name' => 'asc'])
            ->once()
            ->andReturn([$mockConfig]);

        $this->commandTester->execute([
            'command'      => self::COMMAND_NAME,
            'school'         => '1'
        ]);
        $output = $this->commandTester->getDisplay();
        $this->assertMatchesRegularExpression(
            '/\sthe-name\s|\sthe-value\s/',
            $output
        );
    }

    public function testSchoolRequired()
    {
        $this->expectException(RuntimeException::class);
        $this->commandTester->execute([
            'command'      => self::COMMAND_NAME,
        ]);
    }
}


text:
/* NickServ core functions
 *
 * (C) 2003-2016 Anope Team
 * Contact us at team@anope.org
 *
 * Please read COPYING and README for further details.
 *
 * Based on the original code of Epona by Lara.
 * Based on the original code of Services by Andy Church.
 */

#include "module.h"

class CommandNSAList : public Command
{
	static bool ChannelSort(ChannelInfo *ci1, ChannelInfo *ci2)
	{
		return ci::less()(ci1->name, ci2->name);
	}

 public:
	CommandNSAList(Module *creator) : Command(creator, "nickserv/alist", 0, 2)
	{
		this->SetDesc(_("List channels you have access on"));
		this->SetSyntax(_("[\037nickname\037]"));
	}

	void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
	{
		Anope::string nick = source.GetNick();
		NickCore *nc = source.nc;

		if (params.size() && source.HasPriv("nickserv/alist"))
		{
			nick = params[0];
			const NickAlias *na = NickAlias::Find(nick);
			if (!na)
			{
				source.Reply(NICK_X_NOT_REGISTERED, nick.c_str());
				return;
			}
			nc = na->nc;
		}

		ListFormatter list(source.GetAccount());
		int chan_count = 0;

		list.AddColumn(_("Number")).AddColumn(_("Channel")).AddColumn(_("Access")).AddColumn(_("Description"));

		std::deque<ChannelInfo *> queue;
		nc->GetChannelReferences(queue);
		std::sort(queue.begin(), queue.end(), ChannelSort);

		for (unsigned i = 0; i < queue.size(); ++i)
		{
			ChannelInfo *ci = queue[i];
			ListFormatter::ListEntry entry;

			if (ci->GetFounder() == nc)
			{
				++chan_count;
				entry["Number"] = stringify(chan_count);
				entry["Channel"] = (ci->HasExt("CS_NO_EXPIRE") ? "!" : "") + ci->name;
				entry["Access"] = Language::Translate(source.GetAccount(), _("Founder"));
				entry["Description"] = ci->desc;
				list.AddEntry(entry);
				continue;
			}

			if (ci->GetSuccessor() == nc)
			{
				++chan_count;
				entry["Number"] = stringify(chan_count);
				entry["Channel"] = (ci->HasExt("CS_NO_EXPIRE") ? "!" : "") + ci->name;
				entry["Access"] = Language::Translate(source.GetAccount(), _("Successor"));
				entry["Description"] = ci->desc;
				list.AddEntry(entry);
				continue;
			}

			AccessGroup access = ci->AccessFor(nc, false);
			if (access.empty())
				continue;

			++chan_count;

			entry["Number"] = stringify(chan_count);
			entry["Channel"] = (ci->HasExt("CS_NO_EXPIRE") ? "!" : "") + ci->name;
			for (unsigned j = 0; j < access.size(); ++j)
				entry["Access"] = entry["Access"] + ", " + access[j]->AccessSerialize();
			entry["Access"] = entry["Access"].substr(2);
			entry["Description"] = ci->desc;
			list.AddEntry(entry);
		}

		std::vector<Anope::string> replies;
		list.Process(replies);

		if (!chan_count)
		{
			source.Reply(_("\002%s\002 has no access in any channels."), nc->display.c_str());
		}
		else
		{
			source.Reply(_("Channels that \002%s\002 has access on:"), nc->display.c_str());

			for (unsigned i = 0; i < replies.size(); ++i)
				source.Reply(replies[i]);

			source.Reply(_("End of list - %d channels shown."), chan_count);
		}
	}

	bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
	{
		this->SendSyntax(source);
		source.Reply(" ");
		source.Reply(_("Lists all channels you have access on.\n"
				" \n"
				"Channels that have the \037NOEXPIRE\037 option set will be\n"
				"prefixed by an exclamation mark. The nickname parameter is\n"
				"limited to Services Operators"));

		return true;
	}
};

class NSAList : public Module
{
	CommandNSAList commandnsalist;

 public:
	NSAList(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
		commandnsalist(this)
	{

	}
};

MODULE_INIT(NSAList)


text:
declare namespace javax {
  namespace swing {
    namespace table {

      class TableRowSorter<M extends javax.swing.table.TableModel> extends javax.swing.DefaultRowSorter<M,java.lang.Integer> {
        public constructor()
        public constructor(arg0: M)
        public setModel(arg0: M): void
        public setStringConverter(arg0: javax.swing.table.TableStringConverter): void
        public getStringConverter(): javax.swing.table.TableStringConverter
        public getComparator(arg0: number | java.lang.Integer): java.util.Comparator<unknown>
        protected useToString(arg0: number | java.lang.Integer): boolean
      }

    }
  }
}


text:
const fs = require('fs');
const path = require('path');

const { bridge } = require('../spring_api');
const { writePath } = require('../spring_platform');

bridge.on('RemoveEmptyDirs', (command) => {
	RemoveEmptyDirs(command);
});

function RemoveEmptyDirs(command) {
	try {
		let absPath = path.join(writePath, command.path);
		if (!IsDirTreeEmpty(absPath)) {
			throw 'Cannot delete directory. Directory tree is not empty.';
		}
		fs.rmdirSync(absPath, { recursive: true });
	} catch (err) {
		bridge.send('CommandFailed', {
			id: command.id,
			error: err
		});
		return;
	}

	bridge.send('CommandFinished', {
		id: command.id
	});
}

function IsDirTreeEmpty(dir) {
	for (const file of fs.readdirSync(dir)) {
		const filePath = path.join(dir, file);
		const stats = fs.statSync(filePath);
		if (stats.isDirectory()) {
			return IsDirTreeEmpty(filePath);
		} else {
			return false;
		}
	}
	return true;
}