text:
package org.jasig.portal.events;

import java.util.Comparator;

import org.jasig.portal.events.aggr.BaseAggregation;
import org.joda.time.DateTime;

public class AggregationStartComparator implements Comparator<BaseAggregation<?,?>> {

	@Override
	public int compare(BaseAggregation<?,?> aggr1, BaseAggregation<?,?> aggr2) {
        final DateTime entryDate1 = aggr1.getDateTime();
        final DateTime entryDate2 = aggr2.getDateTime();

		return entryDate1.compareTo(entryDate2);
	}

}

redpajama_set_name: RedPajamaGithub


text:
"""Generate diagrams from imposm mapping schema and tm2source project.
Usage:
  generate_diagram.py mapping-keys <mapping_file>
  generate_diagram.py mapping-layers <tm2source_file> <mapping_file>
  generate_diagram.py layers <tm2source_file> [--individual]
  generate_diagram.py (-h | --help)
  generate_diagram.py --version
Options:
  -h --help         Show this screen.
  --version         Show version.
  --individual      Render each layer into separate file
"""
import re
from collections import namedtuple

from docopt import docopt
from graphviz import Digraph
import yaml

Layer = namedtuple('Layer', ['name', 'referenced_tables', 'fields'])
Table = namedtuple('Table', ['name', 'fields', 'mapping', 'type'])

def values_label(osm_values):
    return '[{} values]'.format(len(osm_values))

def normalize_graphviz_labels(label):
    return label.replace(':', '_')

def generate_mapping_subgraph(table):
    subgraph = Digraph(table.name, node_attr={
        'width:': '20',
        'fixed_size': 'shape'
    })

    subgraph.node(table.name, shape='box')

    for osm_key, osm_values in table.mapping:
        node_name = 'key_' + normalize_graphviz_labels(osm_key)
        subgraph.node(node_name, label=osm_key, shape='box')

        subgraph.edge(node_name, table.name,
                      label=values_label(osm_values), )

    return subgraph

def find_referenced_tables(sql_cmd, table_prefix="osm"):
    """Find all tables used in SQL FROM statements"""

    regexpr = "FROM {}_(\w*)".format(table_prefix)
    table_regex = re.compile(regexpr, re.IGNORECASE)
    for match in table_regex.findall(sql_cmd):
        yield replace_generalization_postfix(match)

def replace_generalization_postfix(table_name):
    return table_name.replace('_gen0', '').replace('_gen1', '')

def merge_grouped_mappings(mappings):
    """Merge multiple mappings into a single mapping for drawing"""
    for mapping_group, mapping_value in mappings.items():
        yield mapping_group, mapping_value['mapping']

def find_tables(config):
    for table_name, table_value in config['tables'].items():
        fields = table_value.get('fields')

        if table_value.get('mappings'):
            mapping = list(merge_grouped_mappings(table_value['mappings']))
        else:
            mapping = table_value.get('mapping').items()

        if mapping and fields:
            yield Table(table_name, fields, mapping, table_value['type'])

def find_layers(config):
    for layer in config['Layer']:
        layer_name = layer['id']
        sql_cmd = layer['Datasource']['table']

        tables = set([t for t in find_referenced_tables(sql_cmd)])

        fields = layer['fields'].items()
        yield Layer(layer_name, tables, fields)

def generate_struct_diagram(heading, body):
    return '''<

    {0}

    {1}

>'''.format(heading, body)

def generate_table_node(graph, table):
    field_names = [field['name'] for field in table.fields]
    node_body = generate_struct_diagram(
        table.name,
        '
'.join(field_names)
    )
    node_name = 'table_' + table.name
    graph.node(node_name, node_body, shape='none')
    return node_name

def generate_layer_node(graph, layer):
    field_names = sorted(['{}: {}'.format(field_name, field_type)
                          for field_name, field_type in layer.fields])

    node_body = generate_struct_diagram(
        '#' + layer.name,
        '
'.join(field_names)
    )
    node_name = 'layer_' + layer.name
    graph.node(node_name, node_body, shape='none')
    return node_name

def generate_table_layer_diagram(mapping_config, tm2source_config):
    graph = Digraph('Layers from Table Mappings', format='png', graph_attr={
        'rankdir': 'LR'
    })

    layers = find_layers(tm2source_config)
    tables = find_tables(mapping_config)

    for table in tables:
        generate_table_node(graph, table)

    for layer in layers:
        layer_node = generate_layer_node(graph, layer)
        for table_name in layer.referenced_tables:
            graph.edge('table_' + table_name, layer_node)

    graph.render(filename='table_layer_diagram', view=True)

def generate_layer_diagram(tm2source_config, individual):

    def make_graph():
        return Digraph('Layers', format='png', graph_attr={
            'rankdir': 'LR'
        })

    layers = find_layers(tm2source_config)

    if individual:
        for layer in layers:
            graph = make_graph()
            generate_layer_node(graph, layer)
            graph.render(filename='layer_' + layer.name, view=False)
    else:
        graph = make_graph()
        for layer in layers:
            generate_layer_node(graph, layer)
        graph.render(filename='layers', view=True)

def generate_table_mapping_diagram(mapping_config):
    graph = Digraph('Imposm Mapping', format='png', graph_attr={
        'rankdir': 'LR',
        'ranksep': '3'
    })

    for table in find_tables(mapping_config):
        graph.subgraph(generate_mapping_subgraph(table))

    graph.render(filename='mapping_graph', view=True)

if __name__ == '__main__':
    args = docopt(__doc__, version='0.1')
    mapping_file = args.get('<mapping_file>')
    tm2source_file = args.get('<tm2source_file>')

    if args.get('layers'):
        tm2source_config = yaml.load(open(tm2source_file, 'r'))
        generate_layer_diagram(tm2source_config,
                               individual=args.get('--individual'))

    if args.get('mapping-layers'):
        mapping_config = yaml.load(open(mapping_file, 'r'))
        tm2source_config = yaml.load(open(tm2source_file, 'r'))
        generate_table_layer_diagram(mapping_config, tm2source_config)

    if args.get('mapping-keys'):
        mapping_config = yaml.load(open(mapping_file, 'r'))
        generate_table_mapping_diagram(mapping_config)


text:
<?php

namespace App\Http\Controllers;

use App\Notice;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;

class NoticeController extends Controller
{
    /**
     * Show the form for editing the specified resource.
     *
     * @param  \App\Notice  $notice
     * @return \Illuminate\Http\Response
     */
    public function edit(Notice $notice)
    {
        return view('notices.form')->with('notice', $notice);
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Notice  $notice
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, Notice $notice)
    {
        $request->validate(Notice::$rules);

        $notice->update(array_merge(
            $request->all(),
            ['updated_by' => auth()->user()->username]
        ));

        return redirect()
            ->route('notices.edit', $notice)
            ->with('message', 'Oznam bol upravený');
    }
}


text:
const express = require('express');
const path = require('path');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const helmet = require('helmet');
const morgan = require('morgan');
const expressValidator = require('express-validator');
const config = require('config');
const app = express();
const JWTvalidation =  require('./middleware/JsonToken');
const userAuth = require('./routes/User/userAuth.js');
const ngoAuth = require('./routes/Ngo/ngoAuth');
const ngoEvent =  require('./routes/Ngo/ngoEvents');
const ngoProfile = require('./routes/Ngo/ngoProfile');
const cors = require('cors');
const image = require('./routes/Image/imageRoute');
const userInfo = require('./routes/User/userRoutes');
app.set('view engine', 'jade');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use(cors({ origin: '*', optionsSuccessStatus: 200 }));

app.use(helmet());

const MongoOptions = {
    server: {
        socketOptions: {
            keepAlive: 1,
            connectTimeoutMS: 30000
        }
    },
    replset: {
        socketOptions: {
            keepAlive: 1,
            connectTimeoutMS: 30000
        }
    }
};

// config.DBHost
mongoose.connect(config.DBHost, MongoOptions, (err, db) => {
    if (err) {
        return console.log('Connection to MongoStore could not be made', err);
    }
    console.log('Connection to Mongo Store Successful');
});

const db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));

if(config.util.getEnv('NODE_ENV') !== 'production' ){
    require('dotenv').load();
}

if (config.util.getEnv('NODE_ENV') !== 'test') {
    app.use(morgan('combined')); // 'combined' outputs the Apache style LOGs
}

app.use(expressValidator());
app.use('/userAuth', userAuth);
app.use('/ngoAuth', ngoAuth);

app.use(JWTvalidation);

app.use('/ngoEvent', ngoEvent);
app.use('/ngoProfile',ngoProfile);
app.use('/userInfo' ,userInfo );
app.use('/ngoStory' , require('./routes/Ngo/ngoStory'));
app.use('/image' , image);

const port = process.env.PORT || 3000;
app.set('port', port);

app.use((err, req, res, next) => {
    if (err.name === 'UnauthorizedError') {
        return res.status(403).send({
            success: false,
            message: 'No token provided.'
        });
    }
});

// catch 404 and forward to error handler
app.use((req, res, next) => {
    const err = new Error('Not Found');
    err.status = 404;

    next(err);
});

// error handler
app.use((err, req, res, next) => {
    // set locals, only providing error in development
    res.locals.message = err.message;
    res.locals.error = req.app.get('env') === 'development' ? err : {};

    res.status(err.status || 500);
    res.send({ 'error': 'Not Found' });
});

module.exports = app;


text:
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFallsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('falls_2_9', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('id_history');
            $table->foreign('id_history', 'falls_2_9_1_fk_historys')->references('id')->on('historys');
            $table->unsignedInteger('id_elderly');
            $table->foreign('id_elderly', 'falls_2_9_2_fk_elderlies')->references('id')->on('elderlies');
            $table->string('date_of_fall_month_2_9', '12')->nullable(true);
            $table->string('date_of_fall_year_2_9', '12')->nullable(true);
            $table->string('place_2_9', '15')->nullable(true);
            $table->boolean('the_fall_caused_some_fracture_2_9')->nullable(true);
            $table->string('the_fall_caused_some_fracture_extra_2_9', '30')->nullable(true);
            $table->boolean('you_stopped_perform_some_activity_for_fear_to_fall_again_2_9')->nullable(true);
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('falls_2_9');
    }
}


text:
//// [unusedLocalsinConstructor1.ts]
class greeter {
    constructor() {
        var unused = 20;
    }
}

//// [unusedLocalsinConstructor1.js]
var greeter = /** @class */ (function () {
    function greeter() {
        var unused = 20;
    }
    return greeter;
}());


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE124_Buffer_Underwrite__wchar_t_declare_memcpy_64b.c
Label Definition File: CWE124_Buffer_Underwrite.stack.label.xml
Template File: sources-sink-64b.tmpl.c
*/
/*
 * @description
 * CWE: 124 Buffer Underwrite
 * BadSource:  Set data pointer to before the allocated memory buffer
 * GoodSource: Set data pointer to the allocated memory buffer
 * Sinks: memcpy
 *    BadSink : Copy string to data using memcpy
 * Flow Variant: 64 Data flow: void pointer to data passed from one function to another in different source files
 *
 * */

#include "std_testcase.h"

#include <wchar.h>

#ifndef OMITBAD

void CWE124_Buffer_Underwrite__wchar_t_declare_memcpy_64b_badSink(void * dataVoidPtr)
{
    /* cast void pointer to a pointer of the appropriate type */
    wchar_t * * dataPtr = (wchar_t * *)dataVoidPtr;
    /* dereference dataPtr into data */
    wchar_t * data = (*dataPtr);
    {
        wchar_t source[100];
        wmemset(source, L'C', 100-1); /* fill with 'C's */
        source[100-1] = L'\0'; /* null terminate */
        /* POTENTIAL FLAW: Possibly copying data to memory before the destination buffer */
        memcpy(data, source, 100*sizeof(wchar_t));
        /* Ensure the destination buffer is null terminated */
        data[100-1] = L'\0';
        printWLine(data);
    }
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B uses the GoodSource with the BadSink */
void CWE124_Buffer_Underwrite__wchar_t_declare_memcpy_64b_goodG2BSink(void * dataVoidPtr)
{
    /* cast void pointer to a pointer of the appropriate type */
    wchar_t * * dataPtr = (wchar_t * *)dataVoidPtr;
    /* dereference dataPtr into data */
    wchar_t * data = (*dataPtr);
    {
        wchar_t source[100];
        wmemset(source, L'C', 100-1); /* fill with 'C's */
        source[100-1] = L'\0'; /* null terminate */
        /* POTENTIAL FLAW: Possibly copying data to memory before the destination buffer */
        memcpy(data, source, 100*sizeof(wchar_t));
        /* Ensure the destination buffer is null terminated */
        data[100-1] = L'\0';
        printWLine(data);
    }
}

#endif /* OMITGOOD */


text:
/**
	*
	@flow
**/

import jwt from 'jsonwebtoken';

let token = jwt.sign({foo: 'bar'}, 'hello');
console.log(token);

console.log(jwt.verify(token, 'hello'));

export default {};


text:
using System;
using System.Globalization;
using System.Threading;

namespace LinqToDB.DataProvider.Informix
{
	internal class InformixCultureFixRegion : IDisposable
	{
#if !NETSTANDARD
		private readonly CultureInfo _original;
#endif

		public InformixCultureFixRegion()
		{
#if !NETSTANDARD
			if (Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencyDecimalSeparator != ".")
			{
				_original = Thread.CurrentThread.CurrentCulture;
				Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
			}
#endif
		}

		void IDisposable.Dispose()
		{
#if !NETSTANDARD
			if (_original != null)
				Thread.CurrentThread.CurrentCulture = _original;
#endif
		}
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace console
{
    public class _066_TwoSum
    {
        /// <summary>
        /// Given an array of integers, find two numbers such that they add up to a specific target number.
        /// The function twoSum should return indices of the two numbers such that they add up to the target,
        /// where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are not zero-based.
        /// You may assume that each input would have exactly one solution.
        /// Input: numbers={2, 7, 11, 15}, target=9
        /// Output: index1=1, index2=2
        ///
        /// HashTable?????
        /// </summary>
        /// <param name="numbers"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public List<int> TwoSum(List<int> numbers, int value)
        {
            Dictionary<int, int> set = new Dictionary<int, int>();
            for (int i = 0; i < numbers.Count; i++)
            {
                if (!set.ContainsKey(value - numbers[i]))
                    set.Add(numbers[i], i);
                else
                {
                    return new List<int>() { i, set[value - numbers[i]] };
                }
            }

            return null;
        }
    }
}


text:
<?php

declare(strict_types=1);

namespace App\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20180225185406 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Content migration';
    }

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->addSql("INSERT INTO `fos_user_user` (`id`, `username`, `username_canonical`, `email`, `email_canonical`, `enabled`, `salt`, `password`, `last_login`, `confirmation_token`, `password_requested_at`, `roles`, `created_at`, `updated_at`, `date_of_birth`, `firstname`, `lastname`, `website`, `biography`, `gender`, `locale`, `timezone`, `phone`, `facebook_uid`, `facebook_name`, `facebook_data`, `twitter_uid`, `twitter_name`, `twitter_data`, `gplus_uid`, `gplus_name`, `gplus_data`, `token`, `two_step_code`) VALUES (1,'admin','admin','admin@localhost','admin@localhost',1,'2Vcp9MrG8Bkzlpnlg.RWm4tsmqTOlR5QAq76La9r0QY','\$argon2id\$v=19\$m=65536,t=4,p=1\$Twwp6lF3XgssbFNQUn8Vbg\$diXNnfXPsOpxjI12TNb5zTrAjeQ+nflbWihtXbZx74Q',NULL,NULL,NULL,'a:1:{i:0;s:16:\"ROLE_SUPER_ADMIN\";}','2020-03-29 18:51:52','2020-03-29 18:51:52',NULL,NULL,NULL,NULL,NULL,'u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);");
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
    }
}


text:
export class Emitter {
  constructor() {
    this._callbacks = {};
  }

  _eventName(name) {
    return '$' + name;
  }

  on(eventName, callback) {
    eventName = this._eventName(eventName);
    let eventCallbacks = this._callbacks[eventName];
    if(!eventCallbacks) {
      this._callbacks[eventName] = eventCallbacks = [];
    }

    eventCallbacks.push(callback);
    return this;
  }

  off(eventName, callback) {
    eventName = this._eventName(eventName);
    let eventCallbacks = this._callbacks[eventName];
    if(eventCallbacks) {
      let index = eventCallbacks.indexOf(callback);
      if(index >= 0) eventCallbacks.splice(index, 1);
    }

    return this;
  }

  emit(eventName, ...args) {
    eventName = this._eventName(eventName);
    let eventCallbacks = this._callbacks[eventName];
    if(eventCallbacks) {
      eventCallbacks.forEach((callback) => {
        callback.apply(this, args);
      });
    }
  }

  callbacks(eventName) {
    eventName = this._eventName(eventName);
    return this._callbacks[eventName];
  }
}


text:
A Stripe integrated MEAN stack ecommerce platform.

Changed as shit


text:
package chmod

import (
	"os"
)

// Interface is something that knows how to run the chmod system call.
// It is non-recursive.
type Interface interface {
	// Chmod changes the mode of the given file, implementing the same
	// semantics as os.Chmod.
	Chmod(path string, filemode os.FileMode) error
}

func New() Interface {
	return &chmodRunner{}
}

type chmodRunner struct{}

func (_ *chmodRunner) Chmod(path string, mode os.FileMode) error {
	return os.Chmod(path, mode)
}


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/menu_item_settings"
        android:title="@string/menu_item_settings" />
    <item
        android:id="@+id/menu_item_search"
        android:title="Search" />
    <item
        android:id="@+id/menu_item_about"
        android:title="About" />
</menu>


text:
/******************************************************************************
 **                   Edit    History                                         *
 **---------------------------------------------------------------------------*
 ** DATE          Module              DESCRIPTION                             *
 ** 16/08/2013    Hardware Composer   Add a new feature to Harware composer,  *
 **                                   verlayComposer use GPU to do the        *
 **                                   Hardware layer blending on Overlay      *
 **                                   buffer, and then post the OVerlay       *
 **                                   buffer to Display                       *
 ******************************************************************************
 ** Author:         fushou.yang@spreadtrum.com                                *
 **                 zhongjun.chen@spreadtrum.com                              *
 *****************************************************************************/

#ifndef _OVERLAY_NATIVEWINDOW_H_
#define _OVERLAY_NATIVEWINDOW_H_

#include <ui/FramebufferNativeWindow.h>
#include <ui/ANativeObjectBase.h>
#include <ui/Fence.h>
#include "gralloc_priv.h"
#include "Utility.h"

#include "../SprdPrimaryDisplayDevice/SprdPrimaryPlane.h"
#include "../SprdPrimaryDisplayDevice/SprdFrameBufferHAL.h"

class SprdPrimaryPlane;

namespace android {
// ----------------------------------------------------------------------------

//class Surface;
class NativeBuffer
    : public ANativeObjectBase<
        ANativeWindowBuffer,
        NativeBuffer,
        LightRefBase<NativeBuffer> >
{
public:
    NativeBuffer(int w, int h, int f, int u) : BASE() {
        ANativeWindowBuffer::width  = w;
        ANativeWindowBuffer::height = h;
        ANativeWindowBuffer::format = f;
        ANativeWindowBuffer::usage  = u;
    }
private:
    friend class LightRefBase<NativeBuffer>;
    ~NativeBuffer() { }; // this class cannot be overloaded
};

#define NUM_FRAME_BUFFERS  2

class OverlayNativeWindow   //: public overlayNativeWindow
    : public ANativeObjectBase<
        ANativeWindow,
        OverlayNativeWindow,
        LightRefBase<OverlayNativeWindow> >
{
public:
    OverlayNativeWindow(SprdPrimaryPlane *displayPlane);
    ~OverlayNativeWindow();

    bool Init();

    int releaseNativeBuffer();

private:
    SprdPrimaryPlane *mDisplayPlane;
    unsigned int mWidth;
    unsigned int mHeight;
    int mFormat;
    int mWindowUsage;
    int32_t mNumBuffers;
    int32_t mNumFreeBuffers;
    int32_t mBufferHead;
    sp<NativeBuffer> buffers[NUM_FRAME_BUFFERS];
    sp<NativeBuffer> front;

    mutable Mutex mutex;
    Condition mCondition;
    int32_t mCurrentBufferIndex;
    bool mUpdateOnDemand;

    friend class LightRefBase<OverlayNativeWindow>;

    static int setSwapInterval(ANativeWindow* window, int interval);
    static int cancelBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer, int fenceFd);
    static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer, int* fenceFd);
    //static int lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
    static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer, int fenceFd);
    static int query(const ANativeWindow* window, int what, int* value);
    static int perform(ANativeWindow* window, int operation, ...);

    static sp<NativeBuffer> CreateGraphicBuffer(private_handle_t* buffer);

    inline unsigned int round_up_to_page_size(unsigned int x)
    {
         return (x + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1);
    }

};
}; //android space

#endif


text:
from __future__ import unicode_literals

from django.utils import timezone

from django.db import models

# Create your models here.
class Recipe(models.Model):
    author = models.ForeignKey('Users.User')
    title = models.CharField(max_length=200)
    text = models.TextField()
    created_date = models.DateTimeField(default=timezone.now)
    published_date = models.DateTimeField(blank=True, null=True)
    image = models.ImageField(upload_to='pic_folder/', blank=True)

    def publish(self):
        self.published_date = timezone.now()
        self.save()

    def __str__(self):
        return self.title


text:
package org.archboy.clobaframe.query;

/**
 *
 * @author yang
 */
public class QueryException extends RuntimeException{

	private static final long serialVersionUID = 1L;

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

	public QueryException(String message, Throwable cause) {
		super(message, cause);
	}
}


text:
package org.daisy.dotify.formatter.impl.core;

class GridPoint {
    private final int row, col;

    GridPoint(int r, int c) {
        this.row = r;
        this.col = c;
    }

    int getRow() {
        return row;
    }

    int getCol() {
        return col;
    }

    @Override
    public String toString() {
        return "GridPoint [row=" + row + ", col=" + col + "]";
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + col;
        result = prime * result + row;
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        GridPoint other = (GridPoint) obj;
        if (col != other.col) {
            return false;
        }
        if (row != other.row) {
            return false;
        }
        return true;
    }

}


text:
{% extends "./layout/layout.html" %}

{% block title %}Reset {{item}}{% endblock %}

{% block body %}
  {% if item == 'password' %}

Reset your password

  {% else %}

Request username reminder

  {% endif %}

      <form action="{{path}}/pe12re/reset/{{item}}/email_sent" method="GET" novalidate data-clientside-validation="create_account_form_validation">
        <input name="title_number" value="{{data.title_number}}" type="hidden" />

        {% if item == 'password' %}

If you've forgotten your {{item}} we'll send you an email to help you reset it.

        {% else %}

Enter your email address below and we will send you an email containing the username for the account.

        {% endif %}

        <fieldset>

          <legend class="visuallyhidden">Enter your email address</legend>

            Email address
            <input class="form-control" type="text" id="email" name="email">

        </fieldset>

        <input type="submit" class="button" value="Continue">
      </form>

Didn't receive an email?

Try checking your spam or junk folder - emails can sometimes get mistakenly flagged

If you continue to have problems resetting your password, you can contact HM Land Registry.

{% endblock %}


text:
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE TypeFamilies #-}

{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE AutoDeriveTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}

module Data.FingerTree.PriorityQueue where

import GHC.Generics (Generic)
import Data.Data (Data)
import Data.Typeable (Typeable)
import Data.Foldable (Foldable)
import Data.Traversable (Traversable)

import Data.Monoid (Monoid(..), (<>))

import Data.FingerTree

data Prio a = Min
            | Prio a
            deriving (Eq, Ord, Show, Read,
                      Generic, Data, Typeable,
                      Functor, Foldable, Traversable)

newtype Element a = Element { getElement :: a } deriving (Eq, Ord)

instance Ord a => Monoid (Prio a) where
  mempty = Min
  Min `mappend` p = p
  p `mappend` Min = p
  (Prio a) `mappend` (Prio b) = Prio $ max a b

instance Ord a => Measured (Element a) where
  type Measure (Element a) = Prio a
  measure (Element a) = Prio a

newtype PQueue a = PQueue { getPQueue :: FingerTree (Prio a) (Element a) }
                 deriving (Eq, Ord)

instance Ord a => Monoid (PQueue a) where
  mempty = PQueue mempty
  (PQueue a) `mappend` (PQueue b) = PQueue $ a <> b

extract :: Ord a => (Prio a -> Bool) -> PQueue a -> Maybe (a, PQueue a)
extract _    (PQueue Empty) = Nothing
extract test (PQueue tree) = Just (getElement x, PQueue $ l <> r)
  where
    Split l x r = splitTree test mempty tree

extractMax :: Ord a => PQueue a -> Maybe (a, PQueue a)
extractMax (PQueue tree) = extract (measure tree <=) (PQueue tree)

extractGT :: Ord a => PQueue a -> a -> Maybe (a, PQueue a)
extractGT (PQueue tree) k = extract (Prio k <) (PQueue tree)

-- TODO(MP): extractAllGT


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28816_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Existing Wells Within Spacing Unit

    <p class="styleSans25.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Continental Resources, inc. has identified the following wells which currently exist in the spacing unit consisting of: Sec 4 & 9, T149N, R98W McKenzie County, ND
FileNumber AP! Number Well Name Wellbore 22058 3305303903 Lot 2 Sec 4, 149w, 98w Brooks 1~4H 660 FNL 1818 FEL
CRI has determined that the identified existing wells in the spacing unit specified above are not within 500' of the proposed Brooks 3-4H wellbore and do not pose any collision threats during drilling or completion operations.


text:
package com.ontraport.app.pages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;
import org.openqa.selenium.support.PageFactory;

import com.ontraport.app.tools.AbstractPage;

public class FieldEditor_User extends AbstractPage
{

    protected String   url = "/#!/fieldeditor&obj_id=2";

    @FindBy(how = How.XPATH, using = "//body")
    private WebElement body;

    public FieldEditor_User sample () throws Exception
    {
        return PageFactory.initElements(driver, FieldEditor_User.class);
    }

}


text:
package net.qldarch.ingest.transcript;

import net.qldarch.ingest.Configuration;
import net.qldarch.ingest.IngestStage;
import net.qldarch.ingest.IngestStageFactory;

public class TranscriptDescribeFactory implements IngestStageFactory<TranscriptDescribe> {
    public String getStageName() {
        return "describe";
    }

    public TranscriptDescribe createIngestStage(Configuration configuration) {
        return new TranscriptDescribe(configuration);
    }
}


text:
//  -*- C++ -*-

/*
 * Copyright (C) 1990,91   Silicon Graphics, Inc.
 *
 _______________________________________________________________________
 ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
 |
 |   $Revision: 1.1.1.1 $
 |
 |   Classes:
 |	SoSFNode
 |
 |   Author(s)		: Paul S. Strauss
 |
 ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
 _______________________________________________________________________
 */

#ifndef  _SO_SF_NODE_
#define  _SO_SF_NODE_

class SoNode;

#include <Inventor/fields/SoSubField.h>

//////////////////////////////////////////////////////////////////////////////
//
//  SoSFNode subclass of SoSField. The field value is a pointer to an
//  SoNode. The field automatically maintains a reference to the node
//  it points to and propagates notification from the node.
//
//////////////////////////////////////////////////////////////////////////////

// C-api: prefix=SoSNode
class INVENTOR_API SoSFNode : public SoSField {

    // Use standard field stuff
    SO_SFIELD_HEADER(SoSFNode, SoNode *, SoNode *);

  SoINTERNAL public:
    static void		initClass();

    // Update a copied field to use the copy of the node if there is one
    virtual void	fixCopy(SbBool copyConnections);

    // Override this to also check the stored node
    virtual SbBool	referencesCopy() const;

  private:
    // Override this to maintain write-references in node
    virtual void	countWriteRefs(SoOutput *out) const;

    // Changes value in field without doing other notification stuff.
    // Keeps track of references and auditors.
    void		setVal(SoNode *newValue);
};

#endif /* _SO_SF_NODE_ */


text:
/*
 * $Log: ImportDescriptorImpl.java,v $
 * Revision 1.1  2011/01/04 10:39:03  vizigoth
 * Refactor all package names to simpler forms more consistent with typical Java usage.
 *
 * Revision 1.1  2009/05/14 16:15:13  vizigoth
 * Major refactor to remove dependency on JPA and introduce better interface and implementation separation. Removed all setPropertiesFromInterface and castFromInterface methods.
 *
 * Revision 1.4  2009/03/30 09:04:51  vizigoth
 * Refactor to use SMPTE harmonized names and add early KLV file support.
 *
 * Revision 1.3  2008/10/16 16:51:53  vizigoth
 * First early release 0.1.
 *
 * Revision 1.2  2008/10/16 01:14:25  vizigoth
 * Documentation improved to an early release level. Still with Javadoc warnings.
 *
 * Revision 1.1  2007/11/13 22:09:25  vizigoth
 * Public release of MAJ API.
 */

package tv.amwa.maj.model.impl;

import java.io.Serializable;

import tv.amwa.maj.industry.MediaClass;
import tv.amwa.maj.model.ImportDescriptor;

/**
 *
Implements the description of a file essence source that is not directly manipulated
 * by an AAF application.

 *
 *
Typically, an import {@linkplain tv.amwa.maj.model.SourcePackage source package} is the source of a file
 * {@linkplain tv.amwa.maj.model.SourcePackage source package}, where an application had imported a file by
 * application-specific means.

 *
 *
 *
 */

@MediaClass(uuid1 = 0x0d010101, uuid2 = 0x0101, uuid3 = 0x4a00,
		  uuid4 = {0x06, 0x0e, 0x2b, 0x34, 0x02, 0x06, 0x01, 0x01},
		  definedName = "ImportDescriptor",
		  description = "The ImportDescriptor class describes a file essence source that is not directly manipulated by an AAF application.",
		  symbol = "ImportDescriptor")
public class ImportDescriptorImpl
	extends
		PhysicalDescriptorImpl
	implements
		ImportDescriptor,
		Serializable,
		Cloneable {

	/**

 */
	private static final long serialVersionUID = -3495776601175521397L;

	/**
	 *
Creates and initializes a new import descriptor, which represents a file essence source
	 * that is not directly manipulated by an AAF application.

	 */
	public ImportDescriptorImpl() { }

	public ImportDescriptor clone() {

		return (ImportDescriptor) super.clone();
	}
}


text:
<?php
require('require/class.Connection.php');
require('require/class.Spotter.php');
require('require/class.SpotterLive.php');
require('require/class.SpotterArchive.php');

if (!isset($_GET['ident'])){
	header('Location: '.$globalURL.'');
} else {

	//calculuation for the pagination
	if(!isset($_GET['limit']))
	{
		$limit_start = 0;
		$limit_end = 25;
		$absolute_difference = 25;
	} else {
		$limit_explode = explode(",", $_GET['limit']);
		$limit_start = $limit_explode[0];
		$limit_end = $limit_explode[1];
	}
	$absolute_difference = abs($limit_start - $limit_end);
	$limit_next = $limit_end + $absolute_difference;
	$limit_previous_1 = $limit_start - $absolute_difference;
	$limit_previous_2 = $limit_end - $absolute_difference;

	$page_url = $globalURL.'/ident/'.$_GET['ident'];

	if (isset($_GET['sort']))
	{
		$spotter_array = Spotter::getSpotterDataByIdent($_GET['ident'],$limit_start.",".$absolute_difference, $_GET['sort']);
	} else {
		$spotter_array = Spotter::getSpotterDataByIdent($_GET['ident'],$limit_start.",".$absolute_difference);
	}

	if (!empty($spotter_array))
	{
		$title = 'Detailed View for '.$spotter_array[0]['ident'];
		$ident = $spotter_array[0]['ident'];
		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
		require('header.php');
		if (isset($globalArchive) && $globalArchive) {
			// Requirement for altitude graph
			print '';
			//$all_data = SpotterLive::getAltitudeLiveSpotterDataByIdent($_GET['ident']);
			$all_data = SpotterArchive::getAltitudeArchiveSpotterDataById($spotter_array[0]['flightaware_id']);
			if (isset($globalTimezone)) {
				date_default_timezone_set($globalTimezone);
			} else date_default_timezone_set('UTC');
			if (count($all_data) > 0) {
				print '

                    ';
			}
		}
		print '
';
		print '
'.$spotter_array[0]['ident'].'
';
		print '
Ident'.$spotter_array[0]['ident'].'
';
		if (isset($spotter_array[0]['airline_icao'])) {
			print '
Airline'.$spotter_array[0]['airline_name'].'
';
		}
		print '
Flight HistoryView the Flight History of this callsign
';
		print '
';

		include('ident-sub-menu.php');
		print '
';
		print '
The table below shows the detailed information of all flights with the ident/callsign of '.$spotter_array[0]['ident'].'.
';

		include('table-output.php');
		print '
';
		if ($limit_previous_1 >= 0)
		{
			print '«Previous Page';
		}
		if ($spotter_array[0]['query_number_rows'] == $absolute_difference)
		{
			print 'Next Page»';
		}
		print '
';
		print '
';
	} else {
		$title = "Ident";
		require('header.php');
		print '
Error
';
		print '
Sorry, this ident/callsign is not in the database. :(
';
	}
}
require('footer.php');
?>


text:
using System;
using AddinX.Ribbon.Contract.Command;
using AddinX.Ribbon.Contract.Command.Field;

namespace AddinX.Ribbon.Implementation.Command
{
    public class GroupCommand : IGroupCommand, IVisibleField
    {
        public Func<bool> IsVisibleField { get; private set; }

        public GroupCommand()
        {
            IsVisibleField = () => true;
        }
        public void IsVisible(Func<bool> condition)
        {
            IsVisibleField = condition;
        }
    }
}


text:
module Main where

import qualified Foundation as F
import qualified Foundation.Collection as F
import Criterion.Main

import qualified Data.Text as T

textEnglish = "Set in the year 0 F.E. (\"Foundation Era\"), The Psychohistorians opens on Trantor, the capital of the 12,000-year-old Galactic Empire. Though the empire appears stable and powerful, it is slowly decaying in ways that parallel the decline of the Western Roman Empire. Hari Seldon, a mathematician and psychologist, has developed psychohistory, a new field of science and psychology that equates all possibilities in large societies to mathematics, allowing for the prediction of future events."

textJapanese = "数学者ハリ・セルダンは、膨大な集団の行動を予測する心理歴史学を作りあげ発展させることで、銀河帝国が近いうちに崩壊することを予言する[1]。セルダンは、帝国崩壊後に3万年続くはずの暗黒時代を、あらゆる知識を保存することで千年に縮めようとし、知識の集大成となる銀河百科事典 (Encyclopedia Galactica) を編纂するグループ「ファウンデーション」をつくったが、帝国崩壊を公言し平和を乱したという罪で裁判にかけられ、グループは銀河系辺縁部にある資源の乏しい無人惑星ターミナスへ追放されることになった。しかし、この追放劇すらもセルダンの計画に予定されていた事柄であった。病で死期をさとっていたセルダンは、己の仕事が終わったことを確信する。"

main = defaultMain
    [ bgroup "break"
        [ bgroup "#english-start"
            [ bench "foundation" $ whnf (fst . F.breakElem 'S') (F.fromList textEnglish :: F.String)
            , bench "text" $ nf (fst . T.break (== 'S')) (T.pack textEnglish)
            ]
        , bgroup "#english-middle"
            [ bench "foundation" $ whnf (fst . F.breakElem '2') (F.fromList textEnglish :: F.String)
            , bench "text" $ nf (fst . T.break (== '2')) (T.pack textEnglish)
            ]
        , bgroup "#english-notfound"
            [ bench "foundation" $ whnf (fst . F.breakElem 'z') (F.fromList textEnglish :: F.String)
            , bench "text" $ nf (fst . T.break (== 'z')) (T.pack textEnglish)
            ]
{-
        , bgroup "#japanese"
            [ bench "foundation" $ whnf (fst . F.breakElem '帝') (F.fromList textJapanese :: F.String)
            , bench "text" $ whnf (fst . T.break (== '帝')) (T.pack textJapanese)
            ]
-}
        ]
    ]


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Beih. Sydowia 2: 110 (1961)

#### Original name
Meliola falcatiseta var. alternipes Speg.

### Remarks
null


text:
require File.expand_path('../../../spec_helper', __FILE__)

describe "Regexp#source" do
  it "returns the original string of the pattern" do
    /ab+c/ix.source.should == "ab+c"
    /x(.)xz/.source.should == "x(.)xz"
  end

  it "has US-ASCII encoding when created from an ASCII-only \\u{} literal" do
    re = /[\u{20}-\u{7E}]/
    re.source.encoding.should equal(Encoding::US_ASCII)
  end

  it "has UTF-8 encoding when created from a non-ASCII-only \\u{} literal" do
    re = /[\u{20}-\u{7EE}]/
    re.source.encoding.should equal(Encoding::UTF_8)
  end
end


text:
import pathlib
import logging
import sys
import configparser
import io
import uuid

from os.path import expanduser

from nmea_converter_proxy.utils import text_resource_stream
from nmea_converter_proxy.server import run_server
from nmea_converter_proxy.test_tools import (run_dummy_concentrator,
                                             run_dummy_sensor)
from nmea_converter_proxy.conf import load_config, LOG_FILE, ConfigurationError
from nmea_converter_proxy.validation import (check_ipv4, check_port,
                                             ValidationError, check_file)

log = logging.getLogger(__name__)

# RUN subcommand
def run_cmd(args):
    config_file = pathlib.Path(args.config_file)
    try:
        conf = load_config(config_file)
    except ConfigurationError as e:
        sys.exit(e)
    run_server(**conf)

# INIT subcommand
def init_cmd(args):
    print('This will generate the config file. ')

    def request_port(msg, _used_ports=[], default=None):
        while True:
            default_port = default or next(iter(_used_ports), 8499) + 1
            port = input(msg % default_port)
            if not port:
                port = default_port
            try:
                port = check_port(port, _used_ports)
                _used_ports.insert(0, port)
                return port
            except ValueError as e:
                print(e)

    def request_ip(msg, default="127.0.0.1"):
        while True:
            ip = input(msg % default)
            if not ip:
                ip = default
            try:
                return check_ipv4(ip)
            except ValueError as e:
                print(e)

    concentrator_ip = request_ip('IP of the NMEA concentrator [%s]: ')
    msg = 'Port of the NMEA concentrator [%s]: '
    concentrator_port = request_port(msg, default=1240)

    msg = 'IP for incomming the Krohne Optiflex tide sensor messages [%s]: '
    optiplex_ip = request_ip(msg, "10.3.3.10")
    msg = 'Port for incomming Krohne Optiflex tide senso messages [%s]: '
    optiplex_port = request_port(msg, default=5300)

    msg = 'IP for incomming Aanderaa 4100R current meter messages [%s]: '
    aanderaa_ip = request_ip(msg, "10.3.3.52")
    msg = 'Port for Aanderaa 4100R current meter Aanderaa messages [%s]: '
    aanderaa_port = request_port(msg, default=5200)

    while True:
        msg = 'Magnetic declination for the aanderaa sensor [0.5]: '
        magnetic_declination = input(msg)
        if not magnetic_declination:
            magnetic_declination = -0.5
        try:
            magnetic_declination = float(magnetic_declination)
            assert -50 <= magnetic_declination <= 50
            break
        except (ValueError, AssertionError):
            print("Magnetic declination must be a number between -50 and 50")

    additional_sensors = {}
    while True:
        add_sensor = input('Do you want to add an arbitrary sensor ? [y/N] ')
        if add_sensor.lower() in ('n', 'no', ''):
            break

        name = None
        while not name:
            name = input('Give a name to the sensor: ')
        ip = request_ip('IP of the {} sensor [%s]: '.format(name))
        port = request_port('Port of the {} sensor [%s]: '.format(name))
        additional_sensors[name] = {'ip': ip, 'port': port}

    home = pathlib.Path(expanduser("~"))
    default_config_file = home / 'nmea_converter_proxy.ini'
    while True:
        msg = 'Where to save the file ? [default: "%s"]: '
        config_file = input(msg % default_config_file)
        if not config_file:
            config_file = default_config_file
        config_file = pathlib.Path(config_file)
        try:
            if config_file.is_file():
                res = input('File already exist. Overwrite ? [Y/n] ')
                if not res.lower().strip() in ('y', 'yes', ''):
                    continue
            with config_file.open('w') as f:
                cfg = configparser.ConfigParser()
                cfg.add_section('optiplex')
                cfg.set('optiplex', 'port', str(optiplex_port))
                cfg.set('optiplex', 'ip', optiplex_ip)
                cfg.add_section('aanderaa')
                cfg.set('aanderaa', 'port', str(aanderaa_port))
                cfg.set('aanderaa', 'ip', aanderaa_ip)
                cfg.set('aanderaa', 'magnetic_declination', str(magnetic_declination))
                cfg.add_section('concentrator')
                cfg.set('concentrator', 'ip', concentrator_ip)
                cfg.set('concentrator', 'port', str(concentrator_port))

                for name, values in additional_sensors.items():
                    section = "sensor:%s" % name
                    cfg.add_section(section)
                    cfg.set(section, 'ip', values['ip'])
                    cfg.set(section, 'port', str(values['port']))

                cfg.write(f)

                print('File config file saved.')
                print('Now you can start the proxy with by running:')
                print('python -m nmea_converter_proxy run "%s"' % config_file)
            break
        except EnvironmentError:
            config_file = None
            print("Cannot write a file to '%s'" % config_file)

def fake_concentrator_cmd(args):
    try:
        port = check_port(args.port)
    except ValueError as e:
        sys.exit(e)
    run_dummy_concentrator(port)

def fake_optiplex_cmd(args):
    try:
        port = check_port(args.port)
    except ValueError as e:
        sys.exit(e)

    if args.data_file:
        try:
            data_file = check_file(args.data_file)
            data_file = data_file.open()
        except ValidationError as e:
            sys.exit(e)
    else:
        fixtures = 'test_tools/fixtures/optiplex_fake_data.txt'
        data_file = text_resource_stream(fixtures,
                                         "nmea_converter_proxy",
                                         newline='\r\n')

    run_dummy_sensor("optiplex", port, data_file)

def fake_aanderaa_cmd(args):
    try:
        port = check_port(args.port)
    except ValueError as e:
        sys.exit(e)

    if args.data_file:
        try:
            data_file = check_file(args.data_file)
            data_file = data_file.open()
        except ValidationError as e:
            sys.exit(e)
    else:
        fixtures = 'test_tools/fixtures/aanderaa_fake_data.txt'
        data_file = text_resource_stream(fixtures,
                                         "nmea_converter_proxy",
                                         newline='\r\n')

    run_dummy_sensor("aanderaa", port, data_file)

def fake_generic_sensor(args):
    try:
        port = check_port(args.port)
    except ValueError as e:
        sys.exit(e)

    data_file = io.StringIO(newline='\r\n')
    uids = (uuid.uuid4().hex + "\r\n" for x in range(10))
    data_file.writelines(uids)
    data_file.seek(0)

    run_dummy_sensor("generic", port, data_file)

def log_file_cmd(args):
    try:
        with LOG_FILE.open() as f:
            lines = f.readlines()[-10:]
            if lines:
                print('Last lines of log:\n')
                for line in lines:
                    print(line, end='')
            else:
                print('Log is empty')
            print('\nRead the full log at %s' % LOG_FILE)
    except EnvironmentError:
        sys.exit('Could not open any log file at "%s"' % LOG_FILE)


text:
package org.apache.cassandra.db.filter;

import java.io.DataInput;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Comparator;

import org.apache.cassandra.config.CFMetaData;
import org.apache.cassandra.config.ColumnDefinition;
import org.apache.cassandra.db.TypeSizes;
import org.apache.cassandra.db.rows.CellPath;
import org.apache.cassandra.db.marshal.AbstractType;
import org.apache.cassandra.db.marshal.CollectionType;
import org.apache.cassandra.db.marshal.UTF8Type;
import org.apache.cassandra.io.util.DataOutputPlus;
import org.apache.cassandra.utils.ByteBufferUtil;

/**
 * Handles the selection of a subpart of a column.
 * <p>
 * This only make sense for complex column. For those, this allow for instance
 * to select only a slice of a map.
 */
public abstract class ColumnSubselection
{
    public static final Serializer serializer = new Serializer();

    private enum Kind { SLICE, ELEMENT }

    protected final ColumnDefinition column;

    protected ColumnSubselection(ColumnDefinition column)
    {
        this.column = column;
    }

    public static ColumnSubselection slice(ColumnDefinition column, CellPath from, CellPath to)
    {
        assert column.isComplex() && column.type instanceof CollectionType;
        assert from.size() <= 1 && to.size() <= 1;
        return new Slice(column, from, to);
    }

    public static ColumnSubselection element(ColumnDefinition column, CellPath elt)
    {
        assert column.isComplex() && column.type instanceof CollectionType;
        assert elt.size() == 1;
        return new Element(column, elt);
    }

    public ColumnDefinition column()
    {
        return column;
    }

    protected abstract Kind kind();

    public abstract CellPath minIncludedPath();
    public abstract CellPath maxIncludedPath();
    public abstract boolean includes(CellPath path);

    private static class Slice extends ColumnSubselection
    {
        private final CellPath from;
        private final CellPath to;

        private Slice(ColumnDefinition column, CellPath from, CellPath to)
        {
            super(column);
            this.from = from;
            this.to = to;
        }

        protected Kind kind()
        {
            return Kind.SLICE;
        }

        public CellPath minIncludedPath()
        {
            return from;
        }

        public CellPath maxIncludedPath()
        {
            return to;
        }

        public boolean includes(CellPath path)
        {
            Comparator<CellPath> cmp = column.cellPathComparator();
            return cmp.compare(from, path) <= 0 && cmp.compare(path, to) <= 0;
        }

        @Override
        public String toString()
        {
            // This assert we're dealing with a collection since that's the only thing it's used for so far.
            AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator();
            return String.format("[%s:%s]", from == CellPath.BOTTOM ? "" : type.getString(from.get(0)), to == CellPath.TOP ? "" : type.getString(to.get(0)));
        }
    }

    private static class Element extends ColumnSubselection
    {
        private final CellPath element;

        private Element(ColumnDefinition column, CellPath elt)
        {
            super(column);
            this.element = elt;
        }

        protected Kind kind()
        {
            return Kind.ELEMENT;
        }

        public CellPath minIncludedPath()
        {
            return element;
        }

        public CellPath maxIncludedPath()
        {
            return element;
        }

        public boolean includes(CellPath path)
        {
            Comparator<CellPath> cmp = column.cellPathComparator();
            return cmp.compare(element, path) == 0;
        }

        @Override
        public String toString()
        {
            // This assert we're dealing with a collection since that's the only thing it's used for so far.
            AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator();
            return String.format("[%s]", type.getString(element.get(0)));
        }
    }

    public static class Serializer
    {
        public void serialize(ColumnSubselection subSel, DataOutputPlus out, int version) throws IOException
        {
            ColumnDefinition column = subSel.column();
            ByteBufferUtil.writeWithShortLength(column.name.bytes, out);
            out.writeByte(subSel.kind().ordinal());
            switch (subSel.kind())
            {
                case SLICE:
                    Slice slice = (Slice)subSel;
                    column.cellPathSerializer().serialize(slice.from, out);
                    column.cellPathSerializer().serialize(slice.to, out);
                    break;
                case ELEMENT:
                    Element eltSelection = (Element)subSel;
                    column.cellPathSerializer().serialize(eltSelection.element, out);
                    break;
            }
            throw new AssertionError();
        }

        public ColumnSubselection deserialize(DataInput in, int version, CFMetaData metadata) throws IOException
        {
            ByteBuffer name = ByteBufferUtil.readWithShortLength(in);
            ColumnDefinition column = metadata.getColumnDefinition(name);
            if (column == null)
            {
                // If we don't find the definition, it could be we have data for a dropped column, and we shouldn't
                // fail deserialization because of that. So we grab a "fake" ColumnDefinition that ensure proper
                // deserialization. The column will be ignore later on anyway.
                column = metadata.getDroppedColumnDefinition(name);
                if (column == null)
                    throw new RuntimeException("Unknown column " + UTF8Type.instance.getString(name) + " during deserialization");
            }

            Kind kind = Kind.values()[in.readUnsignedByte()];
            switch (kind)
            {
                case SLICE:
                    CellPath from = column.cellPathSerializer().deserialize(in);
                    CellPath to = column.cellPathSerializer().deserialize(in);
                    return new Slice(column, from, to);
                case ELEMENT:
                    CellPath elt = column.cellPathSerializer().deserialize(in);
                    return new Element(column, elt);
            }
            throw new AssertionError();
        }

        public long serializedSize(ColumnSubselection subSel, int version)
        {
            long size = 0;

            ColumnDefinition column = subSel.column();
            size += TypeSizes.sizeofWithShortLength(column.name.bytes);
            size += 1; // kind
            switch (subSel.kind())
            {
                case SLICE:
                    Slice slice = (Slice)subSel;
                    size += column.cellPathSerializer().serializedSize(slice.from);
                    size += column.cellPathSerializer().serializedSize(slice.to);
                    break;
                case ELEMENT:
                    Element element = (Element)subSel;
                    size += column.cellPathSerializer().serializedSize(element.element);
                    break;
            }
            return size;
        }
    }
}


text:
/**
 * SfexpressServiceImplServiceSoapBindingStub.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package com.sf.ieca.business.sfexpress.appservice.impl;

public class SfexpressServiceImplServiceSoapBindingStub extends org.apache.axis.client.Stub implements com.sf.ieca.business.sfexpress.appservice.SfexpressService {
    private java.util.Vector cachedSerClasses = new java.util.Vector();
    private java.util.Vector cachedSerQNames = new java.util.Vector();
    private java.util.Vector cachedSerFactories = new java.util.Vector();
    private java.util.Vector cachedDeserFactories = new java.util.Vector();

    static org.apache.axis.description.OperationDesc [] _operations;

    static {
        _operations = new org.apache.axis.description.OperationDesc[1];
        _initOperationDesc1();
    }

    private static void _initOperationDesc1(){
        org.apache.axis.description.OperationDesc oper;
        org.apache.axis.description.ParameterDesc param;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("sfexpressService");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "xml"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "verifyCode"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(java.lang.String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "return"));
        oper.setStyle(org.apache.axis.constants.Style.RPC);
        oper.setUse(org.apache.axis.constants.Use.LITERAL);
        _operations[0] = oper;

    }

    public SfexpressServiceImplServiceSoapBindingStub() throws org.apache.axis.AxisFault {
         this(null);
    }

    public SfexpressServiceImplServiceSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
         this(service);
         super.cachedEndpoint = endpointURL;
    }

    public SfexpressServiceImplServiceSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
        if (service == null) {
            super.service = new org.apache.axis.client.Service();
        } else {
            super.service = service;
        }
        ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
    }

    protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
        try {
            org.apache.axis.client.Call _call = super._createCall();
            if (super.maintainSessionSet) {
                _call.setMaintainSession(super.maintainSession);
            }
            if (super.cachedUsername != null) {
                _call.setUsername(super.cachedUsername);
            }
            if (super.cachedPassword != null) {
                _call.setPassword(super.cachedPassword);
            }
            if (super.cachedEndpoint != null) {
                _call.setTargetEndpointAddress(super.cachedEndpoint);
            }
            if (super.cachedTimeout != null) {
                _call.setTimeout(super.cachedTimeout);
            }
            if (super.cachedPortName != null) {
                _call.setPortName(super.cachedPortName);
            }
            java.util.Enumeration keys = super.cachedProperties.keys();
            while (keys.hasMoreElements()) {
                java.lang.String key = (java.lang.String) keys.nextElement();
                _call.setProperty(key, super.cachedProperties.get(key));
            }
            return _call;
        }
        catch (java.lang.Throwable _t) {
            throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
        }
    }

    public java.lang.String sfexpressService(java.lang.String xml, java.lang.String verifyCode) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[0]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://appservice.sfexpress.business.ieca.sf.com/", "sfexpressService"));

        setRequestHeaders(_call);
        setAttachments(_call);
 try {        java.lang.Object _resp = _call.invoke(new java.lang.Object[] {xml, verifyCode});

        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (java.lang.String) _resp;
            } catch (java.lang.Exception _exception) {
                return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}
    }

}


text:
module CreditCardBins
  VERSION = "0.0.3"
end


text:
<?php

if (!defined("SZPHP_PATH"))
    exit('No direct script access allowed');
// .-----------------------------------------------------------------------------------
// |  Software: [SZPHP framework]
// |   Version: 2013.01
// |      Site: http://www.shenzhiwang.com
// |-----------------------------------------------------------------------------------
// |    Author: 向军 <houdunwangxj@gmail.com>
// | Copyright (c) 2012-2013, http://shenzhiwang.com. All Rights Reserved.
// |-----------------------------------------------------------------------------------
// |   License: http://www.apache.org/licenses/LICENSE-2.0
// '-----------------------------------------------------------------------------------

/**
 * 数据库操作接口
 * @package     Db
 * @author      深知网向军 <houdunwangxj@gmail.com>
 */
interface DbInterface
{

    public function connectDb(); //获得连接   参数为表名

    public function close(); //关闭数据库

    public function exe($sql); //发送没有返回值的sql

    public function query($sql); //有返回值的sql

    public function getInsertId(); //获得最后插入的id

    public function getAffectedRows(); //受影响的行数

    public function getVersion(); //获得版本

    public function beginTrans(); //自动提交模式true开启false关闭

    public function commit(); //提供一个事务

    public function rollback(); //回滚事务

    public function escapeString($str); //数据安全处理
}

?>


text:
package io.luan.learn4j.structure.impl;

import io.luan.learn4j.structure.Expression;
import io.luan.learn4j.structure.ExpressionType;
import io.luan.learn4j.utils.ShapeUtils;
import io.luan.learn4j.visitor.Visitor;

/**
 * Scalar Multiply
 *
 * @author Guangmiao Luan
 * @since 28/08/2017.
 */
public class Multiply extends BinaryOp {

    // Stores the broadcasted shape
    private int[] _shape;

    public Multiply(String name, Expression left, Expression right) {
        super(name, left, right);

        this._shape = ShapeUtils.broadcastShapes(left.getShape(), right.getShape());
    }

    @Override
    public void accept(Visitor visitor, Object... params) {
        visitor.visitMultiply(this, params);
    }

    @Override
    public int getRank() {
        // TODO: Should check for broadcast rules
        return getLeft().getRank();
    }

    @Override
    public int[] getShape() {
        return _shape;
    }

    @Override
    public ExpressionType getType() {
        return ExpressionType.Multiply;
    }
}