text:
package org.lockss.plugin.scalar;

import org.lockss.crawler.BaseCrawlSeed;
import org.lockss.daemon.ConfigParamDescr;
import org.lockss.daemon.Crawler;
import org.lockss.daemon.PluginException;
import org.lockss.extractor.LinkExtractor;
import org.lockss.plugin.ArchivalUnit.ConfigurationException;
import org.lockss.plugin.*;
import org.lockss.plugin.base.SimpleUrlConsumer;
import org.lockss.util.CIProperties;
import org.lockss.util.CharsetUtil;
import org.lockss.util.Constants;
import org.lockss.util.Logger;
import org.lockss.util.urlconn.CacheException;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.*;

public class ScalarRDFCrawlSeed extends BaseCrawlSeed {

    private static final Logger log = Logger.getLogger(ScalarRDFCrawlSeed.class);

    // Documentation: https://scalar.usc.edu/works/guide2/query-scope?path=working-with-the-api
    //http://blackquotidian.supdigital.org/bq/rdf/instancesof/content - list all the content
    //http://blackquotidian.supdigital.org/bq/rdf/instancesof/page - list all text-based nodes (pages)
    //http://blackquotidian.supdigital.org/bq/rdf/instancesof/path - list all paths.

    private static final String COLLECTION_TYPE_KEY = "collection_type";

    protected Crawler.CrawlerFacade facade;

    protected List<String> urlList;

    protected String baseUrl;
    protected String journalID;
    protected String collectionType;
    protected String apiSingleNodeUrl;
    protected int year;

    public ScalarRDFCrawlSeed(Crawler.CrawlerFacade facade) {
        super(facade);
        if (au == null) {
            throw new IllegalArgumentException("Valid archival unit required for crawl seed");
        }
        this.facade = facade;
    }

    @Override
    protected void initialize() throws ConfigurationException, PluginException, IOException {
        super.initialize();
        this.baseUrl = au.getConfiguration().get(ConfigParamDescr.BASE_URL.getKey());
        this.journalID = au.getConfiguration().get(ConfigParamDescr.JOURNAL_ID.getKey());
        this.collectionType = au.getConfiguration().get(COLLECTION_TYPE_KEY);
        this.apiSingleNodeUrl = this.baseUrl;

        this.urlList = null;
    }

    @Override
    public Collection<String> doGetStartUrls() throws PluginException, IOException {
        if (urlList == null) {
            populateUrlList();
        }
        if (urlList.isEmpty()) {
            throw new CacheException.UnexpectedNoRetryFailException("Found no start urls");
        }
        return urlList;
    }

    /**
     *

     * Populates the URL list with start URLs.
     *

     *
     * @throws IOException
     * @since 1.67.5
     */
    protected void populateUrlList() throws IOException {

        urlList = new ArrayList<String>();

        String apiStartUrl = this.baseUrl + this.journalID + "/rdf/instancesof/" + this.collectionType;

        log.debug2("apiStartUrl: " + apiStartUrl);

        ScalarRDFLinkExtractor ple = new ScalarRDFLinkExtractor();

        UrlFetcher uf = makeApiUrlFetcher(ple, apiStartUrl, this.apiSingleNodeUrl);
        log.debug2("Request URL: " + apiStartUrl);
        facade.getCrawlerStatus().addPendingUrl(apiStartUrl);

        // Make request
        UrlFetcher.FetchResult fr = null;
        try {
            fr = uf.fetch();
        }
        catch (CacheException ce) {
            if(ce.getCause() != null && ce.getCause().getMessage().contains("LOCKSS")) {
                log.debug("RDF result errored due to LOCKSS audit proxy. Trying alternate start Url", ce);
                urlList.add(apiStartUrl);
                return;
            } else {
                log.debug2("Stopping due to fatal CacheException", ce);
                Throwable cause = ce.getCause();
                if (cause != null && IOException.class.equals(cause.getClass())) {
                    throw (IOException)cause; // Unwrap IOException
                }
                else {
                    throw ce;
                }
            }
        }
        if (fr == UrlFetcher.FetchResult.FETCHED) {
            facade.getCrawlerStatus().removePendingUrl(apiStartUrl);
            facade.getCrawlerStatus().signalUrlFetched(apiStartUrl);
        }
        else {
            log.debug2("Stopping due to fetch result " + fr);
            Map<String, String> errors = facade.getCrawlerStatus().getUrlsWithErrors();
            if (errors.containsKey(apiStartUrl)) {
                errors.put(apiStartUrl, errors.remove(apiStartUrl));
            }
            else {
                facade.getCrawlerStatus().signalErrorForUrl(apiStartUrl, "Cannot fetch seed URL");
            }
            throw new CacheException("Cannot fetch seed URL");
        }

        Collections.sort(urlList);
        storeStartUrls(urlList, apiStartUrl);
    }

    protected UrlFetcher makeApiUrlFetcher( final ScalarRDFLinkExtractor ple,
                                            final String url,
                                            final String apiSingleNodeUrl) {
        // Make a URL fetcher
        UrlFetcher uf = facade.makeUrlFetcher(url);

        // Set refetch flag
        BitSet permFetchFlags = uf.getFetchFlags();
        permFetchFlags.set(UrlCacher.REFETCH_FLAG);
        uf.setFetchFlags(permFetchFlags);

        // Set custom URL consumer factory
        uf.setUrlConsumerFactory(new UrlConsumerFactory() {
            @Override
            public UrlConsumer createUrlConsumer(Crawler.CrawlerFacade ucfFacade,
                                                 FetchedUrlData ucfFud) {
                // Make custom URL consumer
                return new SimpleUrlConsumer(ucfFacade, ucfFud) {
                    @Override
                    public void consume() throws IOException {
                        // Apply link extractor to URL and output results into a list
                        final Set<String> partial = new HashSet<String>();
                        try {
                            String au_cset = AuUtil.getCharsetOrDefault(fud.headers);
                            String cset = CharsetUtil.guessCharsetFromStream(fud.input,au_cset);
                            if (cset == null) {
                                cset = au_cset;
                            }
                            ple.extractUrls(au,
                                    fud.input,
                                    cset,
                                    url,
                                    new LinkExtractor.Callback() {
                                        @Override
                                        public void foundLink(String nodeUrl) {
                                            log.debug3("nodeUrl is added = " + nodeUrl);
                                            partial.add(nodeUrl);
                                        }
                                    });
                        }
                        catch (IOException ioe) {
                            log.debug2("Link extractor threw", ioe);
                            throw new IOException("Error while parsing response for " + url, ioe);
                        }
                        finally {
                            // Logging
                            log.debug2(String.format("Step ending with %d URLs", partial.size()));
                            if (log.isDebug3()) {
                                log.debug3("URLs from step: " + partial.toString());
                            }
                            // Output accumulated URLs to start URL list
                            urlList.addAll(partial);
                        }
                    }
                };
            }
        });
        return uf;
    }

    protected void storeStartUrls(Collection<String> urlList, String url) throws IOException {
        StringBuilder sb = new StringBuilder();
        sb.append("\n");
        for (String u : urlList) {
            log.debug3("SINGLE_node_API_URL is :"  + u);
            sb.append("" + u + "
\n");
        }
        sb.append("");
        CIProperties headers = new CIProperties();
        //Should use a constant here
        headers.setProperty("content-type", "text/html; charset=utf-8");
        UrlData ud = new UrlData(new ByteArrayInputStream(sb.toString().getBytes(Constants.ENCODING_UTF_8)), headers, url);
        UrlCacher cacher = facade.makeUrlCacher(ud);
        cacher.storeContent();
    }

}


text:
from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('believe_his_prophets', '0002_auto_20181021_0427'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='entidad',
            name='hierarchy_type',
        ),
        migrations.RemoveField(
            model_name='hierarchy',
            name='entity',
        ),
        migrations.RemoveField(
            model_name='hierarchy',
            name='hierarchy_type',
        ),
        migrations.RemoveField(
            model_name='hierarchy',
            name='parent',
        ),
        migrations.RemoveField(
            model_name='hierarchy',
            name='sucursal',
        ),
        migrations.DeleteModel(
            name='Entidad',
        ),
        migrations.DeleteModel(
            name='Hierarchy',
        ),
        migrations.DeleteModel(
            name='HierarchyType',
        ),
        migrations.DeleteModel(
            name='Sucursal',
        ),
    ]

redpajama_set_name: RedPajamaGithub


text:
package com.github.roadmapper.docker.instruction;

import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * Env instruction.
 *
 * @author Vinay Dandekar
 * @see <a href="https://docs.docker.com/engine/reference/builder/#/from">ENV
 *      </a>
 */
public class Env extends Instruction {
	private String name = Env.class.getSimpleName().toUpperCase(Locale.ENGLISH);
	private Map<String, String> variables;

	/**
	 * Creates an env instruction.
	 *
	 * @param variables
	 *            the map of environment variables
	 */
	public Env(Map<String, String> variables) {
		this.variables = variables;
	}

	@Override
	public String getName() {
		return name;
	}

	/**
	 * Get the map of environment variables.
	 *
	 * @return the map of environment variables
	 */
	public Map<String, String> getVariables() {
		return variables;
	}

	/**
	 * Set the map of environment variables.
	 *
	 * @param variables
	 *            the map of environment variables
	 */
	public void setVariables(Map<String, String> variables) {
		this.variables = variables;
	}

	@Override
	public String getInstruction() {
		StringBuilder sb = new StringBuilder();
		sb.append(name).append(" ");
		String varsStr = variables.entrySet().stream()
				.map(entry -> entry.getKey() + "=\"" + entry.getValue() + "\"")
				.collect(Collectors.joining(" "));
		sb.append(varsStr);
		return sb.toString();
	}

}


text:
struct X0 {
  void __attribute__((regparm(3))) f0();
  void __attribute__((regparm(3))) f1();
  void __attribute__((regparm(3))) f2(); // expected-note{{previous declaration is here}}
  void f3(); // expected-note{{previous declaration is here}}
};

void X0::f0() { }
void __attribute__((regparm(3))) X0::f1() { }
void __attribute__((regparm(2))) X0::f2() { } // expected-error{{function declared with with regparm(2) attribute was previously declared with the regparm(3) attribute}}
void __attribute__((regparm(2))) X0::f3() { } // expected-error{{function declared with with regparm(2) attribute was previously declared without the regparm attribute}}


text:
base=/home/boatdata

source ${base}/pi_config/charts/config.sh ${1}

cat <<EOF

The values for the installation are
User          : ${OSM_USER}
Database name : ${OSM_DB}
Server name   : ${VHOST}
Backend       : mod_tile
PBF URL       : ${PBF_URL}
PBF file      : ${PBF_FILE}
Update        : ${UPDATE_URL}

To change these values, edit the script file

If the values are not correct, break this script (CTRL-C) now or wait 10s to continue

Some package will ask you some question, answer with the default values which
have been modified to represent your values.

You can find your an example at
http://${VHOST}/osm

The rendered/downloaded tiles are stored in
/var/lib/mod_tile

The main renderd config is
/etc/renderd.cfg
/etc/default/renderd

EOF


text:
package com.github.alexanderwe.bananaj.model.conversation;

/**
 * Created by alexanderweiss on 03.01.16.
 * Class for representing a conversation in MailChimp - NOT IMPLEMENTED YET
 */
public class Conversation {
}


text:
/// <reference path="../typings/modules/lodash/index.d.ts" />
/**
 * cqjs/src/eventstream.js
 */

'use strict'

// import { IDomain } from './domain'
// import { IEvent } from './event'

// import { throwit } from './utils'

// export type IEventStream<TState> = {
//   kind: 'EVENTSTREAM',

//   getDomain: () => IDomain<TState>,
//   getKey: () => string,
//   getEvents: () => Array<IEvent<any>>,

//   append: (...events: Array<IEvent<any>>) => void,
//   load: () => TState,
// }

// export const EventStream = <TState>(domain: IDomain<TState>, key: string, ...initialEvents: Array<IEvent<any>>) => {
//   let data = initialEvents
//   return {
//     append: (...events: Array<IEvent<any>>) => {
//       data.push(...events)
//     },
//     getDomain: () => domain,
//     getEvents: () => data,
//     getKey: () => key,
//     kind: 'EVENTSTREAM',
//     load: (): TState => {
//       // const events = domain.getEventsMap
//       const events = domain.getEvents()
//       const state = domain.getMeta().getInitialState()// _.cloneDeep(domain.initial_state)
//       const meta = { key, version: 0 }
//       return data.reduce((s, curr, index) => {
//         const eventType = curr.meta.type
//         const uri = domain.getMeta().getUri()
//         if (!data.hasOwnProperty(eventType)) {
//           throwit('Invalid event [' + eventType + '] in domain [' + uri + ']')
//         }
//         meta.version = index
//         // return events[eventType].loader(s, curr.payload, meta)
//         const loader = events.filter(e => e.getMeta().type === eventType)[0].getLoader()
//         return loader(s, curr.payload, meta)
//       }, state)
//     },
//   }
// }

/*
export class EventStream<TState> {
  kind: 'EVENTSTREAM';
  domain: IDomain<TState>;
  events: Array<IEvent<any>>;
  key: string;

  constructor(domain: IDomain<TState>, key: string, ...events: Array<IEvent<any>>) {
    this.domain = domain
    this.events = events
    this.key = key
  }

  getDomain(): IDomain<TState> {
    return this.domain
  }

  getKey(): string {
    return this.key
  }

  getEvents(): Array<IEvent<any>> {
    return this.events
  }

  append(...events: Array<IEvent<any>>) {
    this.events.push(...events)
  }

  load(): TState {
    //const loaders = this.domain.loaders
    const events = this.domain.events
    const agg = _.cloneDeep(this.domain.initial_state)
    const meta = {
      //domain: this.domain,
      key: this.key,
      version: 0
    }
    let result = this.events.reduce((state, curr, index) => {
      let eventType = curr.def.type
      if (!events.hasOwnProperty(eventType)) throwit('Invalid event [' + eventType + '] in domain [' + this.domain.uri + ']')
      meta.version = index
      return events[eventType].loader(state, curr.payload, meta)
    }, agg)
    return result
  }
}
*/


text:
/************************************************************
 *	°æȨËùÓÐ  (c)2011,   hxf

 *  ÎļþÃû³Æ	£ºTableInfoDao.java

 *
 *  ´´½¨Ê±¼ä	£º2015Äê10ÔÂ16ÈÕ ÏÂÎç4:20:33
 *  µ±Ç°°æ±¾ºÅ£ºv1.0
 ************************************************************/
package com.example.orderservice.dao;

import java.util.ArrayList;
import java.util.List;

import com.example.orderservice.model.DictionaryTypeBean;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.UrlQuerySanitizer.ValueSanitizer;

/************************************************************
 *  ÄÚÈÝÕªÒª	£º

 *
 *  ×÷Õß	£ºhxf
 *  ´´½¨Ê±¼ä	£º2015Äê10ÔÂ16ÈÕ ÏÂÎç4:20:33
 *  µ±Ç°°æ±¾ºÅ£ºv1.0
 *  ÀúÊ·¼Ç¼	:
 *  	ÈÕÆÚ	: 2015Äê10ÔÂ16ÈÕ ÏÂÎç4:20:33 	ÐÞ¸ÄÈË£º
 *  	ÃèÊö	:
 ************************************************************/
public class DictionaryTypeDao {

	/*
	 * Êý¾Ý¿âÃû
	 */
	public static final String DB_NAME = "orderdish";

	/*
	 * ±íÃû
	 */
	public static final String TABLE_NAME = "T_DATA_DICTIONARY_TYPE";

	/*
	 * Êý¾Ý¿â°æ±¾
	 */
	public static final int VERSION = 1;

	private static DictionaryTypeDao dictionaryTypeDao;

	private SQLiteDatabase db;

	/*
	 * ½«¹¹Ôì·½·¨Ë½Óл¯,ÒÔʵÏÖµ¥ÁÐģʽ
	 * ʵÀý»¯Ê±£¬´«µÝContext¶ÔÏó½øÀ´£¬ºóÃæ´úÂëÒªÓõ½
	 */
	private DictionaryTypeDao(Context context){
		MyDatabaseHelper dbHelper = new MyDatabaseHelper(context, DB_NAME, null, VERSION);
		db = dbHelper.getWritableDatabase();
	}

	/*
	 * ÌṩgetInstance£¨£©ÓÃÓÚ»ñÈ¡DictionaryTypeDaoµÄʵÀý
	 */
	public synchronized static DictionaryTypeDao getInstance(Context context){
		if (dictionaryTypeDao == null) {
			dictionaryTypeDao = new DictionaryTypeDao(context);
		}
		return dictionaryTypeDao;
	}

	//CRUD²Ù×÷------------------------------------------------¡·

	/*
	 * ½«DictionaryTypeBeanʵÀý²åÈëT_DATA_DICTIONARY_TYPE±í
	 */
	public long saveDictionaryType(DictionaryTypeBean dictionaryTypeBean){
		long newRow = 0;

		if (dictionaryTypeBean != null) {
			ContentValues values = new ContentValues();
			values.put("NAME", dictionaryTypeBean.getName());
			newRow = db.insert(TABLE_NAME, null, values);
		}

		return newRow;
	}

	/*
	 * ½«Ö¸¶¨dictionaryTypeBean´ÓT_DATA_DICTIONARY_TYPE±íÖÐɾ³ý
	 */
	public boolean deleteDictionaryType(DictionaryTypeBean dictionaryTypeBean){
		if (dictionaryTypeBean != null) {
			int id = dictionaryTypeBean.getId();
			db.delete(TABLE_NAME, "ID = ?", new String[]{String.valueOf(id)});
			return  true;
		}
		return false;
	}

	/*
	 * ÐÞ¸ÄÖ¸¶¨IDÖµµÄÐÅÏ¢
	 */
	public boolean modifyDictionaryType(DictionaryTypeBean dictionaryTypeBean){

		if (dictionaryTypeBean != null) {
			int id = dictionaryTypeBean.getId();
			String name = dictionaryTypeBean.getName();

			ContentValues values = new ContentValues();
			values.put("NAME", name);

			db.update(TABLE_NAME, values, "ID = ?", new String[]{String.valueOf(id)});
			return true;
		}

		return false;
	}

	/*
	 * T_DATA_DICTIONARY_TYPE±í¶ÁÈ¡ËùÓÐDictionaryTypeBeanʵÀý
	 */
	public List<DictionaryTypeBean> loadDictionaryType(){
		List<DictionaryTypeBean> list = new ArrayList<DictionaryTypeBean>();
		Cursor cursor = db.query(TABLE_NAME, null, null, null, null, null, null);

		if (cursor.moveToFirst()) {
			do {
				DictionaryTypeBean dictionaryTypeBean = new DictionaryTypeBean();
				dictionaryTypeBean.setId(cursor.getInt(cursor.getColumnIndex("ID")));
				dictionaryTypeBean.setName(cursor.getString(cursor.getColumnIndex("NAME")));
				list.add(dictionaryTypeBean);

			} while (cursor.moveToNext());
		}
		return list;
	}

	/*
	 * ²éѯT_DATA_DICTIONARY_TYPE±íÖÐÖ¸¶¨IDµÄNAMEÖµ
	 */
	public String queryName(int id){
		String name = null;

		Cursor cursor = db.query(TABLE_NAME, null, "ID = ?", new String[]{String.valueOf(id)}, null, null, null);
		if (cursor.moveToNext()) {
			name = cursor.getString(cursor.getColumnIndex("NAME"));
		}

		return name;
	}

}


text:
namespace lldb_private {

class DiagnosticManager;
class ExecutionContext;

/// Encapsulates dynamic check functions used by expressions.
///
/// Each of the utility functions encapsulated in this class is responsible
/// for validating some data that an expression is about to use.  Examples
/// are:
///
/// a = *b;     // check that b is a valid pointer
/// [b init];   // check that b is a valid object to send "init" to
///
/// The class installs each checker function into the target process and makes
/// it available to IRDynamicChecks to use.
class DynamicCheckerFunctions {
public:
  enum DynamicCheckerFunctionsKind {
    DCF_Clang,
  };

  DynamicCheckerFunctions(DynamicCheckerFunctionsKind kind) : m_kind(kind) {}
  virtual ~DynamicCheckerFunctions() = default;

  /// Install the utility functions into a process.  This binds the instance
  /// of DynamicCheckerFunctions to that process.
  ///
  /// \param[in] diagnostic_manager
  ///     A diagnostic manager to report errors to.
  ///
  /// \param[in] exe_ctx
  ///     The execution context to install the functions into.
  ///
  /// \return
  ///     True on success; false on failure, or if the functions have
  ///     already been installed.
  virtual bool Install(DiagnosticManager &diagnostic_manager,
                       ExecutionContext &exe_ctx) = 0;
  virtual bool DoCheckersExplainStop(lldb::addr_t addr, Stream &message) = 0;

  DynamicCheckerFunctionsKind GetKind() const { return m_kind; }

private:
  const DynamicCheckerFunctionsKind m_kind;
};
} // namespace lldb_private

#endif // LLDB_EXPRESSION_DYNAMICCHECKERFUNCTIONS_H


text:
require 'spec_helper'
module Alf
  module Algebra
    describe Coerce do

      let(:operator_class){ Coerce }

      it_should_behave_like("An operator class")

      subject{ a_lispy.coerce(an_operand, :a => Integer, :b => Float) }

      it { should be_a(Coerce) }

      it 'should be bound correctly' do
        subject.coercions.should eq(Heading[:a => Integer, :b => Float])
      end

    end
  end
end


text:
<?php

namespace Alchemy\Resource\Reader;

class NullReader extends StringReader
{

    public function __construct()
    {
        parent::__construct('');
    }
}


text:
package org.apache.geronimo.connector;

import java.util.Timer;

import javax.resource.spi.UnavailableException;
import javax.resource.spi.XATerminator;
import javax.resource.spi.work.WorkManager;

import org.apache.geronimo.connector.work.GeronimoWorkManager;

/**
 * GBean BootstrapContext implementation that refers to externally configured WorkManager
 * and XATerminator gbeans.
 *
 * @version $Rev$ $Date$
 */
public class BootstrapContextImpl implements javax.resource.spi.BootstrapContext {
    private final GeronimoWorkManager workManager;

    /**
     * Normal constructor for use as a GBean.
     * @param workManager
     */
    public BootstrapContextImpl(final GeronimoWorkManager workManager) {
        this.workManager = workManager;
    }

    /**
     * @see javax.resource.spi.BootstrapContext#getWorkManager()
     */
    public WorkManager getWorkManager() {
        return workManager;
    }

    /**
     * @see javax.resource.spi.BootstrapContext#getXATerminator()
     */
    public XATerminator getXATerminator() {
        return workManager.getXATerminator();
    }

    /**
     * @see javax.resource.spi.BootstrapContext#createTimer()
     */
    public Timer createTimer() throws UnavailableException {
        return new Timer();
    }

//    public static final GBeanInfo GBEAN_INFO;
//
//    static {
//        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(BootstrapContext.class);
//          //adding interface does not work, creates attributes for references???
////        infoFactory.addInterface(javax.resource.spi.BootstrapContext.class);
//
//        infoFactory.addOperation("createTimer");
//        infoFactory.addOperation("getWorkManager");
//        infoFactory.addOperation("getXATerminator");
//
//        infoFactory.addReference("WorkManager", WorkManager.class);
//        infoFactory.addReference("XATerminator", XATerminator.class);
//
//        infoFactory.setConstructor(new String[]{"WorkManager", "XATerminator"});
//
//        GBEAN_INFO = infoFactory.getBeanInfo();
//    }
//
//    public static GBeanInfo getGBeanInfo() {
//        return GBEAN_INFO;
//    }

}


text:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Short description for file
 *
 * Long description for file (if any)...
 *
 * PHP version 5.4
 *
 * @category   CategoryName
 * @package    PackageName
 * @author     Matthew Setter <matthew@maltblue.com>
 * @copyright  2014 Client/Author
 * @see        Enter if required
 * @since      File available since Release/Tag:
 */

namespace BabyMonitor\Tables;

use BabyMonitor\Models\FeedModel;
use Zend\Db\TableGateway\TableGateway;
use Zend\Db\Sql\Where as WherePredicate;
use Zend\Stdlib\ArrayObject;

class FeedTable
{
    const DATETIME_FORMAT = 'Y-m-d';

    protected $tableGateway;

    public function __construct(TableGateway $tableGateway)
    {
        $this->tableGateway = $tableGateway;
    }

    public function fetchById($feedId)
    {
        if (!empty($feedId)) {
            $select = $this->tableGateway->getSql()->select();
            $select->where(array("feedId" => (int)$feedId));
            $results = $this->tableGateway->selectWith($select);

            if ($results->count() == 1) {
                return $results->current();
            }
        }

        return false;
    }

    /**
     * Attempts to delete a feed item
     *
     * @param $feedId
     * @return bool|int
     */
    public function delete($feedId)
    {
        if (!empty($feedId)) {
            return $this->tableGateway->delete(array(
                "feedId" => (int)$feedId
            ));
        }

        return false;
    }

    /**
     * Return X most recent feeds
     *
     * @param int $limit The limit of records returned. Defaults to 5
     * @return bool|null|\Zend\Db\ResultSet\ResultSetInterface
     */
    public function fetchMostRecentFeeds($limit = 5)
    {
        if (!empty($limit)) {
            $select = $this->tableGateway->getSql()->select();
            $select->limit((int)$limit)
                   ->order('feedDate DESC, feedTime DESC');
            $results = $this->tableGateway->selectWith($select);

            return $results->buffer();
        }

        return false;
    }

    public function fetchByDateRange(\DateTime $startDate = null, \DateTime $endDate = null)
    {
        $select = $this->tableGateway->getSql()->select();
        $where = new WherePredicate();
        $whereClause = array();

        if (!is_null($startDate)) {
            $whereClause[] = $where->greaterThanOrEqualTo(
                'feedDate', $startDate->format(self::DATETIME_FORMAT)
            );
        }

        if (!is_null($endDate)) {
            $whereClause[] = $where->lessThanOrEqualTo(
                'feedDate', $endDate->format(self::DATETIME_FORMAT)
            );
        }

        $select->where($whereClause)->order("feedDate DESC, feedTime DESC");

        $results = $this->tableGateway->selectWith($select);

        return $results->buffer();
    }

    public function save(FeedModel $feed)
    {
        /*
         * Left because you could also approach it this way
         *
        $data = array(
            'userId' => $feed->userId,
            'feedDate' => $feed->feedDate,
            'feedTime' => $feed->feedTime,
            'feedAmount' => $feed->feedAmount,
            'feedNotes' => $feed->feedNotes,
            'feedTemperature' => $feed->feedTemperature,
        );
         */
        $data = $feed->getArrayCopy();
        unset($data['feedId']);

        if ((int)$feed->feedId == 0) {
            if ($this->tableGateway->insert($data)) {
                return $this->tableGateway->getLastInsertValue();
            }
        } else {
            if ($retstat = $this->tableGateway->update($data, array('feedId' => (int)$feed->feedId))) {
                return $retstat;
            }
        }
    }
}


text:
const _      = require('lodash');
const expect = require('expect');
const sinon  = require('sinon');
const Graph  = require('../graph.js');

/**
 * Test libraries.
 */
require('should');
require('should-sinon');

/**
 *  Node insertion test plan.
 */
describe('Insertion of nodes in the graph', function () {

    const graph = new Graph();

    /**
     * New nodes insertion test.
     */
    it('should be successful when inserting new nodes', function () {
        graph.addNode('foo');
        graph.addNode('bar');
        graph.addNode('baz');

        expect(graph.hasNode('foo')).toBeTruthy();
        expect(graph.hasNode('bar')).toBeTruthy();
        expect(graph.hasNode('baz')).toBeTruthy();
        expect(_.size(graph.nodes)).toEqual(3);
    });

    /**
     * Ignoring existing node on insertion test.
     */
    it('should be ignored when adding already existing nodes', function () {
        graph.addNode('foo');
        graph.addNode('bar');
        graph.addNode('baz');
        expect(_.size(graph.nodes)).toEqual(3);
    });

    /**
     * Node addition event triggering test.
     */
    it('should trigger an appropriate event', function (done) {
        const callback = function (node) {
            expect(node.id).toEqual('boo');
            graph.removeListener('node.added', callback);
            done();
        };
        graph.on('node.added', callback);
        graph.addNode('boo');
    });

});

/**
 *  Edge insertion test plan.
 */
describe('Insertion of edges in the graph', function () {

    const graph = new Graph();

    it('should be successful when adding new edges', function () {
        graph.addEdge('foo', 'bar');
        graph.addEdge('bar', 'baz');

        // Verifying the consistency of the graph.
        expect(graph.hasEdge(graph.nodes['foo'], graph.nodes['bar'])).toBeTruthy();
        expect(graph.hasEdge(graph.nodes['bar'], graph.nodes['baz'])).toBeTruthy();

        // Verifying that the first edge matches the
        // foo->bar edge.
        expect(graph.edges[0].source.id).toEqual('foo');
        expect(graph.edges[0].target.id).toEqual('bar');

        // Verifying that the second edge matches the
        // bar->baz edge.
        expect(graph.edges[1].source.id).toEqual('bar');
        expect(graph.edges[1].target.id).toEqual('baz');
    });

    it('should create the given nodes if they do not exist', function () {
        graph.addEdge('one', 'two');

        // Verifying whether the nodes have been created.
        expect(graph.hasNode('one')).toBeTruthy();
        expect(graph.hasNode('two')).toBeTruthy();

        // Verifying whether the edge has been created.
        expect(graph.edges[2].source.id).toEqual('one');
        expect(graph.edges[2].target.id).toEqual('two');
    });

    it('should add the created edges to their belonging nodes', function () {
        graph.addEdge('three', 'four');

        // Verifying whether the created edge was added to the `three` node.
        expect(graph.nodes['three'].edges[0].source.id).toEqual('three');
        expect(graph.nodes['three'].edges[0].target.id).toEqual('four');

        // Verifying whether the created edge was added to the `four` node.
        expect(graph.nodes['four'].edges[0].source.id).toEqual('three');
        expect(graph.nodes['four'].edges[0].target.id).toEqual('four');
    });

    it('should not add an edge if it does already exist', function () {
        for (let i = 0; i < 10; ++i) {
            graph.addEdge('five', 'six');
        }
        expect(graph.edges.length).toEqual(5);
    });

    it('should trigger an appropriate event', function (done) {
        const callback = (edge) => {
            expect(edge.source.id).toEqual('seven');
            expect(edge.target.id).toEqual('eight');
            graph.removeListener('edge.added', callback);
            done();
        };
        graph.on('edge.added', callback);
        graph.addEdge('seven', 'eight');
    });

});

/**
 *  Node removal test plan.
 */
describe('Removal of nodes in the graph', function () {

    const graph = new Graph();

    beforeEach(() => {
        graph.addNode('foo');
        graph.addNode('bar');
    });

    it('should be successful when removing an existing node', function () {
        graph.removeNode('foo');
        graph.removeNode('bar');
        expect(graph.hasNode('foo')).toBeFalsy();
        expect(graph.hasNode('bar')).toBeFalsy();
        expect(_.size(graph.nodes)).toEqual(0);
    });

    it('should be able to remove all the edges associated with the removed node', function () {
        graph.addEdge('foo', 'bar');
        graph.removeNode('foo');
        // There should be no edges left since we have removed
        // one of the nodes having an edge
        expect(graph.edges.length).toEqual(0);
        expect(graph.nodes['bar'].edges.length).toEqual(0);
        graph.removeNode('bar');
        expect(_.size(graph.nodes) && graph.edges.length).toEqual(0);
    });

    it('should trigger an appropriate event', function (done) {
        const callback = (id) => {
            expect(id).toEqual('foo');
            graph.removeListener('node.removed', callback);
            done();
        };
        graph.on('node.removed', callback);
        graph.removeNode('foo');
    });
});

/**
 *  Edge removal test plan.
 */
describe('Removal of edges in the graph', function () {

    const graph = new Graph();

    beforeEach(() => {
        graph.addEdge('foo', 'bar');
        graph.addEdge('bar', 'baz');
    });

    it('should be successful when removing an existing edge', function () {
        graph.removeEdge('foo', 'bar');
        graph.removeEdge('bar', 'baz');
        expect(graph.hasEdge(graph.nodes['foo'], graph.nodes['bar'])).toBeFalsy();
        expect(graph.hasEdge(graph.nodes['bar'], graph.nodes['baz'])).toBeFalsy();
        expect(graph.edges.length).toEqual(0);
    });

    it('should be able to remove the nodes edges associated with the removed edge', function () {
        // Removing the foo->bar edge.
        graph.removeEdge('foo', 'bar');
        expect(graph.nodes['foo'].edges.length).toEqual(0);
        expect(graph.nodes['bar'].edges.length).toEqual(1);

        // Removing the bar->baz edge.
        expect(graph.edges.length).toEqual(1);
        graph.removeEdge('bar', 'baz');
        expect(graph.nodes['bar'].edges.length).toEqual(0);
        expect(graph.nodes['baz'].edges.length).toEqual(0);
        expect(graph.edges.length).toEqual(0);
    });

    it('should trigger an appropriate event', function (done) {
        const callback = (source, target) => {
            expect(source).toEqual('foo');
            expect(target).toEqual('bar');
            expect(graph.hasEdge(graph.nodes['foo'], graph.nodes['bar'])).toBeFalsy();
            graph.removeListener('edge.removed', callback);
            done();
        };
        graph.on('edge.removed', callback);
        graph.removeEdge('foo', 'bar');
    });
});

/**
 *  Nodes and edges removal.
 */
describe('Graph nodes and edges removal', function () {

    const graph = new Graph();

    beforeEach(() => {
        graph.addEdge('foo', 'bar');
        graph.addEdge('bar', 'baz');
    });

    it('should always be successfull', function () {
        graph.clear();
        expect(_.size(graph.nodes)).toEqual(0);
        expect(graph.edges.length).toEqual(0);
    });

    it('should trigger appropriate events', function () {
        const receiver = {
            onEdgeRemoved: sinon.spy(),
            onNodeRemoved: sinon.spy()
        };
        graph.on('edge.removed', receiver.onEdgeRemoved);
        graph.on('node.removed', receiver.onNodeRemoved);
        graph.clear();
        receiver.onEdgeRemoved.should.have.callCount(2);
        receiver.onNodeRemoved.should.have.callCount(3);
    });
});


text:
Polymer({
      is: 'paper-slider',

      behaviors: [
        Polymer.IronA11yKeysBehavior,
        Polymer.IronFormElementBehavior,
        Polymer.PaperInkyFocusBehavior,
        Polymer.IronRangeBehavior
      ],

      properties: {
        /**
         * If true, the slider thumb snaps to tick marks evenly spaced based
         * on the `step` property value.
         */
        snaps: {
          type: Boolean,
          value: false,
          notify: true
        },

        /**
         * If true, a pin with numeric value label is shown when the slider thumb
         * is pressed. Use for settings for which users need to know the exact
         * value of the setting.
         */
        pin: {
          type: Boolean,
          value: false,
          notify: true
        },

        /**
         * The number that represents the current secondary progress.
         */
        secondaryProgress: {
          type: Number,
          value: 0,
          notify: true,
          observer: '_secondaryProgressChanged'
        },

        /**
         * If true, an input is shown and user can use it to set the slider value.
         */
        editable: {
          type: Boolean,
          value: false
        },

        /**
         * The immediate value of the slider.  This value is updated while the user
         * is dragging the slider.
         */
        immediateValue: {
          type: Number,
          value: 0,
          readOnly: true,
          notify: true
        },

        /**
         * The maximum number of markers
         */
        maxMarkers: {
          type: Number,
          value: 0,
          notify: true,
          observer: '_maxMarkersChanged'
        },

        /**
         * If true, the knob is expanded
         */
        expand: {
          type: Boolean,
          value: false,
          readOnly: true
        },

        /**
         * True when the user is dragging the slider.
         */
        dragging: {
          type: Boolean,
          value: false,
          readOnly: true
        },

        transiting: {
          type: Boolean,
          value: false,
          readOnly: true
        },

        markers: {
          type: Array,
          readOnly: true,
          value: []
        },
      },

      observers: [
        '_updateKnob(value, min, max, snaps, step)',
        '_valueChanged(value)',
        '_immediateValueChanged(immediateValue)'
      ],

      hostAttributes: {
        role: 'slider',
        tabindex: 0
      },

      keyBindings: {
        'left down pagedown home': '_decrementKey',
        'right up pageup end': '_incrementKey'
      },

      ready: function() {
        // issue polymer/polymer#1305
        this.async(function() {
          this._updateKnob(this.value);
        }, 1);
      },

      /**
       * Increases value by `step` but not above `max`.
       * @method increment
       */
      increment: function() {
        this.value = this._clampValue(this.value + this.step);
      },

      /**
       * Decreases value by `step` but not below `min`.
       * @method decrement
       */
      decrement: function() {
        this.value = this._clampValue(this.value - this.step);
      },

      _updateKnob: function(value, min, max, snaps, step) {
        this.setAttribute('aria-valuemin', min);
        this.setAttribute('aria-valuemax', max);
        this.setAttribute('aria-valuenow', value);

        this._positionKnob(this._calcRatio(value));
      },

      _valueChanged: function() {
        this.fire('value-change');
      },

      _immediateValueChanged: function() {
        if (this.dragging) {
          this.fire('immediate-value-change');
        } else {
          this.value = this.immediateValue;
        }
      },

      _secondaryProgressChanged: function() {
        this.secondaryProgress = this._clampValue(this.secondaryProgress);
      },

      _expandKnob: function() {
        this._setExpand(true);
      },

      _resetKnob: function() {
        this.cancelDebouncer('expandKnob');
        this._setExpand(false);
      },

      _positionKnob: function(ratio) {
        this._setImmediateValue(this._calcStep(this._calcKnobPosition(ratio)));
        this._setRatio(this._calcRatio(this.immediateValue));

        this.$.sliderKnob.style.left = (this.ratio * 100) + '%';
        if (this.dragging) {
          this._knobstartx = this.ratio * this._w;
          this.translate3d(0, 0, 0, this.$.sliderKnob);
        }
      },

      _calcKnobPosition: function(ratio) {
        return (this.max - this.min) * ratio + this.min;
      },

      _onTrack: function(event) {
        event.stopPropagation();
        switch (event.detail.state) {
          case 'start':
            this._trackStart(event);
            break;
          case 'track':
            this._trackX(event);
            break;
          case 'end':
            this._trackEnd();
            break;
        }
      },

      _trackStart: function(event) {
        this._w = this.$.sliderBar.offsetWidth;
        this._x = this.ratio * this._w;
        this._startx = this._x;
        this._knobstartx = this._startx;
        this._minx = - this._startx;
        this._maxx = this._w - this._startx;
        this.$.sliderKnob.classList.add('dragging');
        this._setDragging(true);
      },

      _trackX: function(e) {
        if (!this.dragging) {
          this._trackStart(e);
        }

        var dx = Math.min(this._maxx, Math.max(this._minx, e.detail.dx));
        this._x = this._startx + dx;

        var immediateValue = this._calcStep(this._calcKnobPosition(this._x / this._w));
        this._setImmediateValue(immediateValue);

        // update knob's position
        var translateX = ((this._calcRatio(this.immediateValue) * this._w) - this._knobstartx);
        this.translate3d(translateX + 'px', 0, 0, this.$.sliderKnob);
      },

      _trackEnd: function() {
        var s = this.$.sliderKnob.style;

        this.$.sliderKnob.classList.remove('dragging');
        this._setDragging(false);
        this._resetKnob();
        this.value = this.immediateValue;

        s.transform = s.webkitTransform = '';

        this.fire('change');
      },

      _knobdown: function(event) {
        this._expandKnob();

        // cancel selection
        event.preventDefault();

        // set the focus manually because we will called prevent default
        this.focus();
      },

      _bardown: function(event) {
        this._w = this.$.sliderBar.offsetWidth;
        var rect = this.$.sliderBar.getBoundingClientRect();
        var ratio = (event.detail.x - rect.left) / this._w;
        var prevRatio = this.ratio;

        this._setTransiting(true);

        this._positionKnob(ratio);

        this.debounce('expandKnob', this._expandKnob, 60);

        // if the ratio doesn't change, sliderKnob's animation won't start
        // and `_knobTransitionEnd` won't be called
        // Therefore, we need to manually update the `transiting` state

        if (prevRatio === this.ratio) {
          this._setTransiting(false);
        }

        this.async(function() {
          this.fire('change');
        });

        // cancel selection
        event.preventDefault();
      },

      _knobTransitionEnd: function(event) {
        if (event.target === this.$.sliderKnob) {
          this._setTransiting(false);
        }
      },

      _maxMarkersChanged: function(maxMarkers) {
        if (!this.snaps) {
          this._setMarkers([]);
        }
        var steps = Math.floor((this.max - this.min) / this.step);
        if (steps > maxMarkers) {
          steps = maxMarkers;
        }
        this._setMarkers(new Array(steps));
      },

      _mergeClasses: function(classes) {
        return Object.keys(classes).filter(
          function(className) {
            return classes[className];
          }).join(' ');
      },

      _getClassNames: function() {
        return this._mergeClasses({
          disabled: this.disabled,
          pin: this.pin,
          snaps: this.snaps,
          ring: this.immediateValue <= this.min,
          expand: this.expand,
          dragging: this.dragging,
          transiting: this.transiting,
          editable: this.editable
        });
      },

      _incrementKey: function(event) {
        if (!this.disabled) {
          if (event.detail.key === 'end') {
            this.value = this.max;
          } else {
            this.increment();
          }
          this.fire('change');
        }
      },

      _decrementKey: function(event) {
        if (!this.disabled) {
          if (event.detail.key === 'home') {
            this.value = this.min;
          } else {
            this.decrement();
          }
          this.fire('change');
        }
      },

      _changeValue: function(event) {
        this.value = event.target.value;
        this.fire('change');
      },

      _inputKeyDown: function(event) {
        event.stopPropagation();
      },

      // create the element ripple inside the `sliderKnob`
      _createRipple: function() {
        this._rippleContainer = this.$.sliderKnob;
        return Polymer.PaperInkyFocusBehaviorImpl._createRipple.call(this);
      },

      // Hide the ripple when user is not interacting with keyboard.
      // This behavior is different from other ripple-y controls, but is
      // according to spec: https://www.google.com/design/spec/components/sliders.html
      _focusedChanged: function(receivedFocusFromKeyboard) {
        if (receivedFocusFromKeyboard) {
          this.ensureRipple();
        }
        if (this.hasRipple()) {
          // note, ripple must be un-hidden prior to setting `holdDown`
          if (receivedFocusFromKeyboard) {
            this._ripple.removeAttribute('hidden');
          } else {
            this._ripple.setAttribute('hidden', '');
          }
          this._ripple.holdDown = receivedFocusFromKeyboard;
        }
      }
    });

    /**
     * Fired when the slider's value changes.
     *
     * @event value-change
     */

    /**
     * Fired when the slider's immediateValue changes.
     *
     * @event immediate-value-change
     */

    /**
     * Fired when the slider's value changes due to user interaction.
     *
     * Changes to the slider's value due to changes in an underlying
     * bound variable will not trigger this event.
     *
     * @event change
     */


text:
import hasOwn from '../utils/hasOwn'
import {findIndex} from 'lodash'
import applyPatch from './applyPatch'
import insert from './arrayInsert'

function move(arr, from, to) {
  const nextValue = arr.slice()
  const val = nextValue[from]
  nextValue.splice(from, 1)
  nextValue.splice(to, 0, val)
  return nextValue
}

function findTargetIndex(array, pathSegment) {
  if (typeof pathSegment === 'number') {
    return pathSegment
  }
  const index = findIndex(array, pathSegment)
  return index === -1 ? false : index
}

export default function apply(value, patch) {
  const nextValue = value.slice() // make a copy for internal mutation

  if (patch.path.length === 0) {
    // its directed to me
    if (patch.type === 'setIfMissing') {
      if (!Array.isArray(patch.value)) {
        // eslint-disable-line max-depth
        throw new Error('Cannot set value of an array to a non-array')
      }
      return value === undefined ? patch.value : value
    } else if (patch.type === 'set') {
      if (!Array.isArray(patch.value)) {
        // eslint-disable-line max-depth
        throw new Error('Cannot set value of an array to a non-array')
      }
      return patch.value
    } else if (patch.type === 'unset') {
      return undefined
    } else if (patch.type === 'move') {
      if (
        !patch.value ||
        !hasOwn(patch.value, 'from') ||
        !hasOwn(patch.value, 'to')
      ) {
        // eslint-disable-line max-depth
        throw new Error(
          `Invalid value of 'move' patch. Expected a value with "from" and "to" indexes, instead got: ${JSON.stringify(
            patch.value
          )}`
        )
      }
      return move(nextValue, patch.value.from, patch.value.to)
    }
    throw new Error(`Invalid array operation: ${patch.type}`)
  }

  const [head, ...tail] = patch.path

  const index = findTargetIndex(value, head)

  // If the given selector could not be found, return as-is
  if (index === false) {
    return nextValue
  }

  if (tail.length === 0) {
    if (patch.type === 'insert') {
      const {position, items} = patch
      return insert(value, position, index, items)
    } else if (patch.type === 'unset') {
      if (typeof index !== 'number') {
        throw new Error(
          `Expected array index to be a number, instead got "${index}"`
        )
      }
      nextValue.splice(index, 1)
      return nextValue
    }
  }

  // The patch is not directed to me
  nextValue[index] = applyPatch(nextValue[index], {
    ...patch,
    path: tail
  })
  return nextValue
}


text:
package org.simmetrics;

@SuppressWarnings("javadoc")
public abstract class StringDistanceTest extends DistanceTest<String> {

	protected static final class T extends TestCase<String>{
		public T(float similarity, String a, String b) {
			super(similarity, a, b);
		}
	}

	@Override
	protected abstract T[] getTests();

	@Override
	protected final String getEmpty() {
		return "";
	}
}


text:
pre#gitdiff {
    text-align:left;
    width:80;
    margin:auto;
    text-transform:none;
}
div#main {
    font-size:18px;
    text-transform:lowercase;
}
table {
    margin:auto;
    width:80%;
}
table td {
    padding:5px;
}
p.intro {
    border:1px solid #ccc;
    padding:20px;
    border-radius:4px;
}
div.progress.open {
    background-color: #f4fff4;
    background-image: linear-gradient(to bottom,#f4fff4,#f9fff9);
}
div.progress {
    margin-top:auto;
    margin-bottom:auto;
    text-align:left;
    font-size:50%;
    color:gray;
    min-width:200px;
}
div.progress-inner.open {
    background-color: #3fff3f;
    background-image: linear-gradient(to bottom,#3fff3f,#7fff7f);
    float:left;
    margin-right:2px;
}
div.progress.closed {
    background-color: #fff5f5;
    background-image: linear-gradient(to bottom,#fff5f5,#fff9f9);
}
div.progress-inner.closed {
    background-color: #ff3f3f;
    background-image: linear-gradient(to bottom,#ff3f3f,#ff7f7f);
}

ul {
    margin-left:0;
    margin-bottom:5px;
    font-size:80%;
}
li {
    background-image: linear-gradient(to bottom, #f5ebe2, #f5e6d8);
    border:1px solid #f5dcc5;
    padding:5px;
    margin:5px;
    display:inline-block;
}

#footer {
    font-size:80%;
}


text:
using System;
using CQRSlite.Events;

namespace Zuehlke.Eacm.Web.Backend.DomainModel.Events
{
    public class EntityDefinitionModified : IEvent
    {
        public Guid Id { get; set; }

        public int Version { get; set; }

        public DateTimeOffset TimeStamp { get; set; }

        public Guid EntityId { get; set; }

        public string Name { get; set; }

        public string Description { get; set; }
    }
}


text:
@interface WelcomeScreenCoordinator : ChromeCoordinator

// Initiates a WelcomeScreenCoordinator with |navigationController| and
// |browser|.
- (instancetype)initWithBaseNavigationController:
                    (UINavigationController*)navigationController
                                         browser:(Browser*)browser
                                        delegate:
                                            (id<FirstRunScreenDelegate>)delegate
    NS_DESIGNATED_INITIALIZER;

- (instancetype)initWithBaseViewController:(UIViewController*)viewController
                                   browser:(Browser*)browser NS_UNAVAILABLE;

@end

#endif  // IOS_CHROME_BROWSER_UI_FIRST_RUN_WELCOME_WELCOME_SCREEN_COORDINATOR_H_


text:
@font-face {
	font-family: 'Heroes Legend';
	src: url('fonts/Heroes Legend.eot');
	src: local('☺'), url('fonts/Heroes Legend.woff') format('woff'), url('fonts/Heroes Legend.ttf') format('truetype'), url('fonts/Heroes Legend.svg') format('svg');
	font-weight: normal;
	font-style: normal;
}

@font-face {
	font-family: 'Vendetta';
	src: url('fonts/Vendetta.eot');
	src: local('☺'), url('fonts/Vendetta.woff') format('woff'), url('fonts/Vendetta.ttf') format('truetype'), url('fonts/Vendetta.svg') format('svg');
	font-weight: normal;
	font-style: normal;
}

@font-face {
	font-family: 'markpro';
	src: url('fonts/markpro.eot');
	src: local('☺'), url('fonts/markpro.woff') format('woff'), url('fonts/markpro.ttf') format('truetype'), url('fonts/markpro.svg') format('svg');
	font-weight: normal;
	font-style: normal;
}

@font-face {
	font-family: 'markpro';
	src: url('fonts/markpro-bold.eot');
	src: local('☺'), url('fonts/markpro-bold.woff') format('woff'), url('fonts/markpro-bold.ttf') format('truetype'), url('fonts/markpro-bold.svg') format('svg');
	font-weight: bold;
	font-style: normal;
}

@font-face {
	font-family: 'markpro-heavy';
	src: url('fonts/markpro-heavy.eot');
	src: local('☺'), url('fonts/markpro-heavy.woff') format('woff'), url('fonts/markpro-heavy.ttf') format('truetype'), url('fonts/markpro-heavy.svg') format('svg');
	font-weight: normal;
	font-style: normal;
}


text:
#if MXIO

using System.Collections.Generic;
using CSharpUtils.Logging;
using MOXA_CSharp_MXIO;

namespace CSharpUtils.MXIO
{
    /// <summary>
    /// Create and manager connections with one or more MXIO IO modules.
    ///
    /// This builds on the default MXIO libraries, as provided by the manufacturer: https://www.moxa.com/product/MXIO_Library.htm.
    ///
    /// In order for this to work, the MXIO.cs and MXIO_NET.dll files must be placed in the Vendor directory, and the compilation symbol "MXIO" must be added.
    /// </summary>
    public class MXIOManager
    {
        /// <summary>
        /// The logger to be used.
        /// </summary>
        public Logger Logger { get; set; }

        /// <summary>
        /// The amount of times to retry actions, to account for network instability.
        /// </summary>
        public short Retries { get; set; } = 10;

        /// <summary>
        /// The time between retries
        /// </summary>
        public int RetryDelay { get; set; } = 100;

        /// <summary>
        /// The timeout for actions to the MXIO module.
        /// </summary>
        public uint Timeout { get; set; } = 500;

        /// <summary>
        /// The MXIO connections.
        /// </summary>
        private List<MXIOConnection> connections = new List<MXIOConnection>();

        public MXIOManager(Logger logger)
        {
            this.Logger = logger;
            Logger.Log(LogLevel.INFO, "Initializing the MXIO library...");
            int ret;

            // DLL version.
            ret = MXIO_CS.MXIO_GetDllVersion();
            Logger.Log(LogLevel.INFO, "DLL Version: {0}.{1}.{2}.{3}", (ret >> 12) & 0xF, (ret >> 8) & 0xF, (ret >> 4) & 0xF, (ret) & 0xF);

            // Build date.
            ret = MXIO_CS.MXIO_GetDllBuildDate();
            Logger.Log(LogLevel.INFO, "DLL Build Date: {0:x}/{1:x}/{2:x}", (ret >> 16), (ret >> 8) & 0xFF, (ret) & 0xFF);

            // Init.
            ret = MXIO_CS.MXEIO_Init();
            if (ret != MXIO_CS.MXIO_OK)
            {
                throw new MXIOException("MXIO init failed: {0}.", ret);
            }
        }

        /// <summary>
        /// Connect to an MXIO module.
        /// </summary>
        /// <param name="name">The name of the MXIO module, for logging purposes</param>
        /// <param name="ip">The IP address of the MXIO module</param>
        /// <param name="port">The port of the MXIO module</param>
        public MXIOConnection Connect(string name, string ip, ushort port)
        {
            MXIOConnection connection = new MXIOE1KConnection(this, name, ip, port);
            this.connections.Add(connection);
            return connection;
        }
    }
}

#endif


text:
package org.springframework.jdbc.support.nativejdbc;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * {@link NativeJdbcExtractor} implementation that delegates to JDBC 4.0's
 * unwrap method, as defined by {@link java.sql.Wrapper}.
 *
 *
Note: Only use this when actually running against a JDBC 4.0 driver,
 * with a connection pool that supports the JDBC 4.0 API (i.e. at least accepts
 * JDBC 4.0 API calls and passes them through to the underlying driver)!
 *
 * @author Juergen Hoeller
 * @since 2.5
 * @see java.sql.Wrapper#unwrap
 * @see SimpleNativeJdbcExtractor
 * @see org.springframework.jdbc.core.JdbcTemplate#setNativeJdbcExtractor
 * @see org.springframework.jdbc.support.lob.OracleLobHandler#setNativeJdbcExtractor
 */
public class Jdbc4NativeJdbcExtractor extends NativeJdbcExtractorAdapter {

	protected Connection doGetNativeConnection(Connection con) throws SQLException {
		return (Connection) con.unwrap(Connection.class);
	}

	public Statement getNativeStatement(Statement stmt) throws SQLException {
		return (Statement) stmt.unwrap(Statement.class);
	}

	public PreparedStatement getNativePreparedStatement(PreparedStatement ps) throws SQLException {
		return (PreparedStatement) ps.unwrap(PreparedStatement.class);
	}

	public CallableStatement getNativeCallableStatement(CallableStatement cs) throws SQLException {
		return (CallableStatement) cs.unwrap(CallableStatement.class);
	}

	public ResultSet getNativeResultSet(ResultSet rs) throws SQLException {
		return (ResultSet) rs.unwrap(ResultSet.class);
	}

}


text:
<?php

$language_data = array (
    'LANG_NAME' => 'QML',
    'COMMENT_SINGLE' => array(1 => '//'),
    'COMMENT_MULTI' => array('/*' => '*/'),
    'COMMENT_REGEXP' => array(
        // comments
        2 => "/(?<=[\\s^])(s|tr|y)\\/(?!\*)(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])+(?<!\s)\\/(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])*(?<!\s)\\/[msixpogcde]*(?=[\\s$\\.\\;])|(?<=[\\s^(=])(m|q[qrwx]?)?\\/(?!\*)(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])+(?<!\s)\\/[msixpogc]*(?=[\\s$\\.\\,\\;\\)])/iU",
        // property binding
        3 => "/([a-z][\\w\\.]+)(?=:)/",
        // TODO: property name (fixed length lookbehind assertion?)
        4 => "/(?<=property\\s+\\w+\\s+)(\\w+)/"
        ),
    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
    'QUOTEMARKS' => array("'", '"'),
    'ESCAPE_CHAR' => '\\',
    'KEYWORDS' => array(
        1 => array(
            'as','break','case','catch','continue','const','debugger',
            'default','delete','do','else','finally','for','function',
            'if','import','in','instanceof','new','on','public','property',
            'readonly','return','signal','switch','this','throw','try',
            'typeof','while','with'
            ),
        2 => array(
            'action','bool','color','date','double','enumeration','font',
            'int','list','matrix4x4','point','quaternion','real','rect',
            'size','string','time','url','var','variant','vector2d',
            'vector3d','vector4d','void'
            ),
        // http://qt-project.org/doc/qt-5/qtbluetooth-qmlmodule.html
        3 => array(
            'BluetoothDiscoveryModel','BluetoothService','BluetoothSocket'
            ),
        // http://qt-project.org/doc/qt-5/qtgraphicaleffects-qmlmodule.html
        4 => array(
            'Blend','BrightnessContrast','ColorOverlay','Colorize',
            'ConicalGradient','Desaturate','DirectionalBlur','Displace',
            'DropShadow','FastBlur','GammaAdjust','GaussianBlur','Glow',
            'HueSaturation','InnerShadow','LevelAdjust','LinearGradient',
            'MaskedBlur','OpacityMask','RadialBlur','RadialGradient',
            'RectangularGlow','RecursiveBlur','ThresholdMask','ZoomBlur'
            ),
        // http://qt-project.org/doc/qt-5/qtaudioengine-qmlmodule.html
        5 => array(
            'AttenuationModelLinear','AttenuationModelInverse','AudioCategory',
            'AudioEngine','AudioListener','AudioSample','PlayVariation',
            'Sound','SoundInstance'
            ),
        // http://qt-project.org/doc/qt-5/qtmultimedia-qmlmodule.html
        6 => array(
            'Video','Audio','MediaPlayer','Camera','CameraCapture',
            'CameraExposure','CameraFlash','CameraFocus','CameraImageProcessing',
            'CameraRecorder','Radio','RadioData','Torch','SoundEffect','VideoOutput'
            ),
        // http://qt-project.org/doc/qt-5/qtnfc-qmlmodule.html
        7 => array(
            'NdefFilter','NdefMimeRecord','NdefTextRecord','NdefUriRecord',
            'NearField','NdefRecord'
            ),
        // http://qt-project.org/doc/qt-5/qtpositioning-qmlmodule.html
        8 => array(
            'QtPositioning','CoordinateAnimation','Position','PositionSource',
            'Address','Location'
            ),
        // http://qt-project.org/doc/qt-5/qtqml-models-qmlmodule.html
        9 => array(
            'DelegateModel','DelegateModelGroup','ListModel','ListElement','ObjectModel'
            ),
        // http://qt-project.org/doc/qt-5/qtqml-qmlmodule.html
        10 => array(
            'Binding','Component','Connections','Date','Instantiator',
            'Locale','Number','Qt','QtObject','String','Timer'
            ),
        // http://qt-project.org/doc/qt-5/qt-labs-folderlistmodel-qmlmodule.html
        11 => array(
            'FolderListModel'
            ),
        // http://qt-project.org/doc/qt-5/qtquick-localstorage-qmlmodule.html
        12 => array(
            'openDatabaseSync'
            ),
        // http://qt-project.org/doc/qt-5/qt-labs-settings-qmlmodule.html
        13 => array(
            'Settings'
            ),
        // http://qt-project.org/doc/qt-5/qtquick-window-qmlmodule.html
        14 => array(
            'Screen','Window','CloseEvent'
            ),
        // http://qt-project.org/doc/qt-5/qtquick-xmllistmodel-qmlmodule.html
        15 => array(
            'XmlRole','XmlListModel'
            ),
        // http://qt-project.org/doc/qt-5/qtquick-particles-qmlmodule.html
        16 => array(
            'Age','AngleDirection','CumulativeDirection','CustomParticle',
            'Direction','EllipseShape','Friction','Gravity','GroupGoal',
            'ImageParticle','ItemParticle','LineShape','MaskShape','Affector',
            'Emitter','Shape','ParticleGroup','ParticlePainter','ParticleSystem',
            'Attractor','PointDirection','RectangleShape','SpriteGoal',
            'TargetDirection','TrailEmitter','Turbulence','Particle','Wander'
            ),
        // http://qt-project.org/doc/qt-5/qttest-qmlmodule.html
        17 => array(
            'SignalSpy','TestCase'
            ),
        // http://qt-project.org/doc/qt-5/qtquick-qmltypereference.html
        18 => array(
            'Item','Rectangle','Image','BorderImage','AnimatedImage','AnimatedSprite',
            'SpriteSequence','Text','Accessible','Gradient','GradientStop','SystemPalette',
            'Sprite','FontLoader','Repeater','Loader','Visual Item Transformations','Transform',
            'Scale','Rotation','Translate','MouseArea','Keys','KeyNavigation','FocusScope',
            'Flickable','PinchArea','MultiPointTouchArea','Drag','DropArea','TextInput',
            'TextEdit','IntValidator','DoubleValidator','RegExpValidator','TouchPoint',
            'PinchEvent','WheelEvent','MouseEvent','KeyEvent','DragEvent','Positioner',
            'Column','Row','Grid','Flow','LayoutMirroring','State','PropertyChanges',
            'StateGroup','StateChangeScript','ParentChange','AnchorChanges','Transition',
            'ViewTransition','SequentialAnimation','ParallelAnimation','Behavior','PropertyAction',
            'PauseAnimation','SmoothedAnimation','SpringAnimation','ScriptAction','PropertyAnimation',
            'NumberAnimation','Vector3dAnimation','ColorAnimation','RotationAnimation','ParentAnimation',
            'AnchorAnimation','PathAnimation','XAnimator','YAnimator','ScaleAnimator','RotationAnimator',
            'OpacityAnimator','UniformAnimator','Lower-level Animation Types','PathInterpolator',
            'AnimationController','Path','PathLine','PathQuad','PathCubic','PathArc','PathCurve',
            'PathSvg','PathAttribute','PathPercent','VisualItemModel','VisualDataModel','VisualDataGroup',
            'ListView','GridView','PathView','Package','Flipable','ShaderEffect','ShaderEffectSource',
            'GridMesh','WorkerScript','Canvas','Context2D','CanvasGradient','CanvasPixelArray',
            'CanvasImageData','TextMetrics',
            ),
        // http://qt-project.org/doc/qt-5/qtquick-controls-qmlmodule.html
        19 => array(
            'ApplicationWindow','BusyIndicator','Button','Calendar',
            'CheckBox','ComboBox','GroupBox','Label','Menu','MenuBar',
            'ProgressBar','RadioButton','ScrollView','Slider','SpinBox',
            'SplitView','StackView','StackViewDelegate','StatusBar',
            'Switch','Tab','TabView','TableView','TableViewColumn',
            'TextArea','TextField','ToolBar','ToolButton','Action',
            'ExclusiveGroup','MenuSeparator','MenuItem','Stack'
            ),
        // http://qt-project.org/doc/qt-5/qtquick-dialogs-qmlmodule.html
        20 => array(
            'Dialog','ColorDialog','FileDialog','FontDialog','MessageDialog'
            ),
        // http://qt-project.org/doc/qt-5/qtquick-layouts-qmlmodule.html
        21 => array(
            'Layout','RowLayout','ColumnLayout','GridLayout'
            ),
        // http://qt-project.org/doc/qt-5/qtsensors-qmlmodule.html
        22 => array(
            'Accelerometer','AccelerometerReading','Altimeter','AltimeterReading',
            'AmbientLightReading','AmbientLightSensor','AmbientTemperatureReading',
            'AmbientTemperatureSensor','Compass','CompassReading','Gyroscope',
            'GyroscopeReading','HolsterReading','HolsterSensor','IRProximityReading',
            'IRProximitySensor','LightReading','LightSensor','Magnetometer',
            'MagnetometerReading','OrientationReading','OrientationSensor',
            'PressureReading','PressureSensor','ProximityReading','ProximitySensor',
            'RotationReading','RotationSensor','SensorGesture','SensorGlobal',
            'SensorReading','TapReading','TapSensor','TiltReading','TiltSensor'
            ),
        // http://qt-project.org/doc/qt-5/qtwinextras-qmlmodule.html
        23 => array(
            'JumpListDestination','JumpListLink','JumpListSeparator','DwmFeatures',
            'JumpList','JumpListCategory','TaskbarButton','ThumbnailToolBar','ThumbnailToolButton'
            ),
        // http://qt-project.org/doc/qt-5/qtwebkit-qmlmodule.html
        24 => array(
            'WebView','WebLoadRequest'
            )
        ),
    'SYMBOLS' => array(
        '(', ')', '[', ']', '{', '}',
        '+', '-', '*', '/', '%',
        '!', '@', '&', '|', '^',
        '<', '>', '=',
        ',', ';', '?', ':'
        ),
    'CASE_SENSITIVE' => array(
        GESHI_COMMENTS => false,
        1 => true,
        2 => true,
        3 => true,
        4 => true,
        5 => true,
        6 => true,
        7 => true,
        8 => true,
        9 => true,
        10 => true,
        11 => true,
        12 => true,
        13 => true,
        14 => true,
        15 => true,
        16 => true,
        17 => true,
        18 => true,
        19 => true,
        20 => true,
        21 => true,
        22 => true,
        23 => true,
        24 => true
        ),
    'STYLES' => array(
        'KEYWORDS' => array(
            1 => 'color: #808041;',
            2 => 'color: #808041;',
            3 => 'color: #800780;',
            4 => 'color: #800780;',
            5 => 'color: #800780;',
            6 => 'color: #800780;',
            7 => 'color: #800780;',
            8 => 'color: #800780;',
            9 => 'color: #800780;',
            10 => 'color: #800780;',
            11 => 'color: #800780;',
            12 => 'color: #800780;',
            13 => 'color: #800780;',
            14 => 'color: #800780;',
            15 => 'color: #800780;',
            16 => 'color: #800780;',
            17 => 'color: #800780;',
            18 => 'color: #800780;',
            19 => 'color: #800780;',
            20 => 'color: #800780;',
            21 => 'color: #800780;',
            22 => 'color: #800780;',
            23 => 'color: #800780;',
            24 => 'color: #800780;'
            ),
        'COMMENTS' => array(
            1 => 'color: #008025;',
            2 => 'color: #008025;',
            3 => 'color: #970009;',
            4 => 'color: #970009;',
            'MULTI' => 'color: #008025;'
            ),
        'ESCAPE_CHAR' => array(
            0 => 'color: #000099; font-weight: bold;'
            ),
        'BRACKETS' => array(
            0 => 'color: #000000;'
            ),
        'STRINGS' => array(
            0 => 'color: #008025;'
            ),
        'NUMBERS' => array(
            0 => 'color: #000000;'
            ),
        'METHODS' => array(
            1 => 'color: #000000;'
            ),
        'SYMBOLS' => array(
            0 => 'color: #000000;'
            ),
        'REGEXPS' => array(
            ),
        'SCRIPT' => array(
            0 => '',
            1 => '',
            2 => '',
            3 => ''
            )
        ),
    'URLS' => array(
        1 => '',
        2 => '',
        3 => 'http://qt-project.org/doc/qt-5/qml-qtbluetooth-{FNAMEL}.html',
        4 => 'http://qt-project.org/doc/qt-5/qml-qtgraphicaleffects-{FNAMEL}.html',
        5 => 'http://qt-project.org/doc/qt-5/qml-qtaudioengine-{FNAMEL}.html',
        6 => 'http://qt-project.org/doc/qt-5/qml-qtmultimedia-{FNAMEL}.html',
        7 => 'http://qt-project.org/doc/qt-5/qml-qtnfc-{FNAMEL}.html',
        8 => 'http://qt-project.org/doc/qt-5/qml-qtpositioning-{FNAMEL}.html',
        9 => 'http://qt-project.org/doc/qt-5/qml-qtqml-models-{FNAMEL}.html',
        10 => 'http://qt-project.org/doc/qt-5/qml-qtqml-{FNAMEL}.html',
        11 => 'http://qt-project.org/doc/qt-5/qml-qt-labs-folderlistmodel-{FNAMEL}.html',
        12 => 'http://qt-project.org/doc/qt-5/qtquick-localstorage-qmlmodule.html',
        13 => 'http://qt-project.org/doc/qt-5/qml-qt-labs-settings-{FNAMEL}.html',
        14 => 'http://qt-project.org/doc/qt-5/qml-qtquick-window-{FNAMEL}.html',
        15 => 'http://qt-project.org/doc/qt-5/qml-qtquick-xmllistmodel-{FNAMEL}.html',
        16 => 'http://qt-project.org/doc/qt-5/qml-qtquick-particles-{FNAMEL}.html',
        17 => 'http://qt-project.org/doc/qt-5/qml-qttest-{FNAMEL}.html',
        18 => 'http://qt-project.org/doc/qt-5/qml-qtquick-{FNAMEL}.html',
        19 => 'http://qt-project.org/doc/qt-5/qml-qtquick-controls-{FNAMEL}.html',
        20 => 'http://qt-project.org/doc/qt-5/qml-qtquick-dialogs-{FNAMEL}.html',
        21 => 'http://qt-project.org/doc/qt-5/qml-qtquick-layouts-{FNAMEL}.html',
        22 => 'http://qt-project.org/doc/qt-5/qml-qtsensors-{FNAMEL}.html',
        23 => 'http://qt-project.org/doc/qt-5/qml-qtwinextras-{FNAMEL}.html',
        24 => 'http://qt-project.org/doc/qt-5/qml-qtwebkit-{FNAMEL}.html'
        ),
    'OOLANG' => true,
    'OBJECT_SPLITTERS' => array(
        1 => '.'
        ),
    'REGEXPS' => array(
        ),
    'STRICT_MODE_APPLIES' => GESHI_MAYBE,
    'SCRIPT_DELIMITERS' => array(
        0 => array(
            '<script type="text/javascript">' => '</script>'
            ),
        1 => array(
            '<script language="javascript">' => '</script>'
            )
        ),
    'HIGHLIGHT_STRICT_BLOCK' => array(
        0 => true,
        1 => true
        )
);


text:
package poussecafe.discovery;

import java.util.List;
import org.junit.Test;

import static org.junit.Assert.assertTrue;

public class CustomListenerHierarchyDiscoveryTest {

    @Test
    public void expectedListenersDiscoveredInDomainProcessHierarchy() throws NoSuchMethodException, SecurityException {
        givenCustomListenerContainerInstance();
        whenDiscoveringListeners();
        thenExpectedListenersDiscovered();
    }

    private void givenCustomListenerContainerInstance() {
        container = new CustomListenerContainer();
    }

    private Object container;

    private void whenDiscoveringListeners() {
        CustomMessageListenerDiscoverer explorer = new CustomMessageListenerDiscoverer.Builder()
                .service(container)
                .build();
        listeners = explorer.discoverListeners();
    }

    private List<poussecafe.environment.MessageListener> listeners;

    private void thenExpectedListenersDiscovered() throws NoSuchMethodException {
        assertTrue(listeners.size() == 2);
        assertTrue(listeners.stream()
            .map(poussecafe.environment.MessageListener::id)
            .allMatch(id -> id.startsWith(container.getClass().getName())));
    }
}