text:
namespace drive {

// Dummy implementation of FileSystemInterface. All functions do nothing.
class DummyFileSystem : public FileSystemInterface {
 public:
  virtual ~DummyFileSystem() {}
  virtual void Initialize() OVERRIDE {}
  virtual void AddObserver(FileSystemObserver* observer) OVERRIDE {}
  virtual void RemoveObserver(FileSystemObserver* observer) OVERRIDE {}
  virtual void CheckForUpdates() OVERRIDE {}
  virtual void TransferFileFromRemoteToLocal(
      const base::FilePath& remote_src_file_path,
      const base::FilePath& local_dest_file_path,
      const FileOperationCallback& callback) OVERRIDE {}
  virtual void TransferFileFromLocalToRemote(
      const base::FilePath& local_src_file_path,
      const base::FilePath& remote_dest_file_path,
      const FileOperationCallback& callback) OVERRIDE {}
  virtual void OpenFile(const base::FilePath& file_path,
                        OpenMode open_mode,
                        const OpenFileCallback& callback) OVERRIDE {}
  virtual void Copy(const base::FilePath& src_file_path,
                    const base::FilePath& dest_file_path,
                    const FileOperationCallback& callback) OVERRIDE {}
  virtual void Move(const base::FilePath& src_file_path,
                    const base::FilePath& dest_file_path,
                    const FileOperationCallback& callback) OVERRIDE {}
  virtual void Remove(const base::FilePath& file_path,
                      bool is_recursive,
                      const FileOperationCallback& callback) OVERRIDE {}
  virtual void CreateDirectory(
      const base::FilePath& directory_path,
      bool is_exclusive,
      bool is_recursive,
      const FileOperationCallback& callback) OVERRIDE {}
  virtual void CreateFile(const base::FilePath& file_path,
                          bool is_exclusive,
                          const FileOperationCallback& callback) OVERRIDE {}
  virtual void TouchFile(const base::FilePath& file_path,
                         const base::Time& last_access_time,
                         const base::Time& last_modified_time,
                         const FileOperationCallback& callback) OVERRIDE {}
  virtual void TruncateFile(const base::FilePath& file_path,
                            int64 length,
                            const FileOperationCallback& callback) OVERRIDE {}
  virtual void Pin(const base::FilePath& file_path,
                   const FileOperationCallback& callback) OVERRIDE {}
  virtual void Unpin(const base::FilePath& file_path,
                     const FileOperationCallback& callback) OVERRIDE {}
  virtual void GetFileByPath(const base::FilePath& file_path,
                             const GetFileCallback& callback) OVERRIDE {}
  virtual void GetFileByPathForSaving(
      const base::FilePath& file_path,
      const GetFileCallback& callback) OVERRIDE {}
  virtual void GetFileContentByPath(
      const base::FilePath& file_path,
      const GetFileContentInitializedCallback& initialized_callback,
      const google_apis::GetContentCallback& get_content_callback,
      const FileOperationCallback& completion_callback) OVERRIDE {}
  virtual void GetResourceEntryByPath(
      const base::FilePath& file_path,
      const GetResourceEntryCallback& callback) OVERRIDE {}
  virtual void ReadDirectoryByPath(
      const base::FilePath& file_path,
      const ReadDirectoryCallback& callback) OVERRIDE {}
  virtual void Search(const std::string& search_query,
                      const GURL& next_url,
                      const SearchCallback& callback) OVERRIDE {}
  virtual void SearchMetadata(
      const std::string& query,
      int options,
      int at_most_num_matches,
      const SearchMetadataCallback& callback) OVERRIDE {}
  virtual void GetAvailableSpace(
      const GetAvailableSpaceCallback& callback) OVERRIDE {}
  virtual void GetShareUrl(
      const base::FilePath& file_path,
      const GURL& embed_origin,
      const GetShareUrlCallback& callback) OVERRIDE {}
  virtual void GetMetadata(
      const GetFilesystemMetadataCallback& callback) OVERRIDE {}
  virtual void MarkCacheFileAsMounted(
      const base::FilePath& drive_file_path,
      const MarkMountedCallback& callback) OVERRIDE {}
  virtual void MarkCacheFileAsUnmounted(
      const base::FilePath& cache_file_path,
      const FileOperationCallback& callback) OVERRIDE {}
  virtual void GetCacheEntryByResourceId(
      const std::string& resource_id,
      const GetCacheEntryCallback& callback) OVERRIDE {}
  virtual void Reload() OVERRIDE {}
};

}  // namespace drive

#endif  // CHROME_BROWSER_CHROMEOS_DRIVE_DUMMY_FILE_SYSTEM_H_


text:
<?php

/*
 * add .styleci.yml
 */

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

class CreateOauth2TokensTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('oauth2_tokens', function (Blueprint $table) {
            $table->increments('id');
            $table->string('appid', 100)->comment('AppId');
            $table->string('openid', 500)->comment('用户唯一标识');
            $table->string('access_token', 500)->nullable()->comment('调用凭据');
            $table->string('refresh_token', 500)->nullable()->comment('刷新凭据');
            $table->string('scope', 500)->nullable()->comment('用户授权的作用域');
            $table->integer('expires_in')->nullable()->comment('access_token接口调用凭证超时时间');
            $table->timestamps();
        });
    }

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

redpajama_set_name: RedPajamaGithub


text:
import React from 'react'
import ReactDOM from 'react-dom'

import * as State from '../state'
import * as U from '../state/update'

import ReactCodeMirror from '@skidding/react-codemirror'
import CodeMirror from 'codemirror'

// import 'codemirror/mode/sql/sql'
import 'codemirror/mode/markdown/markdown'
import 'codemirror/keymap/sublime'

import 'codemirror/addon/display/placeholder'
import 'codemirror/addon/comment/comment'
import 'codemirror/addon/comment/continuecomment'

import 'codemirror/addon/edit/matchbrackets'
import 'codemirror/addon/edit/closebrackets'
import 'codemirror/addon/selection/active-line'
import 'codemirror/addon/search/match-highlighter'

import './prediction'

import 'codemirror/addon/hint/show-hint.css'
import 'codemirror/addon/hint/show-hint'
import './sql-hint'

import 'codemirror/addon/display/placeholder'

import './md.less'

import { EditableText } from '@blueprintjs/core'

import swal from 'sweetalert2'

import { addCell } from '../notebook'
import { DB, getDB } from '../db/configure'

import _ from 'lodash'

import { Intent, Popover, Position, Switch, Tooltip as BlueprintTooltip } from '@blueprintjs/core'

function Tooltip(props) {
    return (
        <BlueprintTooltip
            position={Position.RIGHT}
            tetherOptions={{ constraints: [{ attachment: 'together', to: 'scrollParent' }] }}
            {...props}
        />
    )
}

export class Cell extends React.Component {
    shouldComponentUpdate(nextProps) {
        return (
            nextProps.view !== this.props.view ||
            nextProps.connect !== this.props.connect ||
            nextProps.deltas !== this.props.deltas ||
            nextProps.forceRenderToken !== this.props.forceRenderToken
        )
    }

    componentDidMount() {
        var cm = this.cmr.getCodeMirror()
        var el = document.createElement('span')
        cm.addWidget({ line: 0, ch: 0 }, el, false)
        el.style.left = ''
        el.style.top = ''
        el.style.position = ''
        el.className = 'slice-editor-widget'
        this.widget = el
        this.componentDidUpdate()
    }

    componentDidUpdate() {
        ReactDOM.render(
            <SnippetWidget
                updateView={(e) => this.props.updateView(e)}
                view={this.props.view}
                cmr={this.cmr}
                connect={this.props.connect}
                config={this.props.config}
            />,
            this.widget
        )
    }

    render() {
        let { view, updateView, connect, deltas, virtualSchema, config } = this.props
        let db = DB(connect.active)
        let fresh =
            ((view.result && view.result.query) || '').trim() === (view.query || '').trim() ||
            view.error ||
            (view.query || '').trim() === '' ||
            view.loading ||
            connect.status != 'connected'

        const sql_options = {
            mode: db.syntax || 'text/plain',
            theme: 'hipster',
            // continueComments: true,
            highlightSelectionMatches: {
                // showToken: /\w/,
                trim: true,
            },
            lineWrapping: true,
            extraKeys: {
                'Cmd-Enter': (cm) => runCell(view.id),
                'Ctrl-Enter': (cm) => runCell(view.id),
                'Ctrl-Space': 'autocomplete',
            },
            // styleActiveLine: true,
            autoCloseBrackets: true,
            matchBrackets: true,
            addModeClass: true,
            placeholder:
                connect.status == 'connected' ? 'Type query here, or click a bubble below.' : '',

            tabSize: 2,
            indentUnit: 2,

            showPredictions: true,

            ...(db.CodeMirrorOptions ? db.CodeMirrorOptions(connect, virtualSchema) : {}),

            keyMap: 'sublime',
        }

        const md_options = {
            mode: 'markdown',
            keyMap: 'sublime',
            lineWrapping: true,
            theme: 'md',
            placeholder: 'Type Markdown here...',
            showPredictions: false,
        }

        let md = view.markdown

        return (

                        <ReactCodeMirror
                            value={view.query}
                            key="a"
                            ref={(e) => (this.cmr = e)}
                            onChange={(query) => {
                                // this is a silly patch for a graphql-codemirror bug
                                // https://github.com/graphql/graphiql/issues/735
                                updateView({ query: query.replace(/\xa0/g, ' ') })
                            }}
                            options={md ? md_options : sql_options}
                        />

                        {db.reference && (
                            <BlueprintTooltip
                                content={

                                        Refer to the results of this cell with{' '}

                                            {db.reference(view.name || view.suggestedName)}

                                }
                                className="pt-tooltip-indicator"
                            >

                                        {db.reference('SPLITTER').split('SPLITTER')[0] || ''}

                                    <EditableText
                                        value={view.name}
                                        onChange={(name) =>
                                            updateView({ name: name.replace(/[^\w]/g, '') })
                                        }
                                        placeholder={view.suggestedName}
                                        minWidth={30}
                                    />

                                        {db.reference('SPLITTER').split('SPLITTER')[1] || ''}

                            </BlueprintTooltip>
                        )}

                            <Tooltip content="Archive Cell">
                                <button onClick={this.props.close} title="Archive Cell">

                                </button>
                            </Tooltip>

                            {md ? null : (
                                <Tooltip content="Clone Cell">
                                    <button onClick={this.props.fork}>

                                    </button>
                                </Tooltip>
                            )}

                            {md ? null : connect.status === 'connected' ? (
                                <Tooltip content="Run Query (Cmd-Enter)" intent={Intent.SUCCESS}>
                                    <button onClick={(e) => runCell(view.id)}>
                                        {view.loading ? (

                                        ) : (

                                        )}
                                    </button>
                                </Tooltip>
                            ) : (
                                <Tooltip content="No database connected" intent={Intent.WARNING}>
                                    <button
                                        title="No database connected"
                                        data-tip="No database connected"
                                        onClick={(e) => runCell(view.id)}
                                    >

                                    </button>
                                </Tooltip>
                            )}

                    {md ? null : view.error ? (

{view.error}

                    ) : view.result ? (
                        <ErrorBoundary updateView={updateView}>
                            <ResultVisualizerLoader
                                view={view}
                                deltas={deltas}
                                connect={connect}
                                forceRenderToken={this.props.forceRenderToken}
                                config={config}
                                updateView={updateView}
                                beginDrag={this.props.beginDrag}
                                result={view.result}
                            />
                        </ErrorBoundary>
                    ) : null}

        )
    }
}

// './visualizer'
var VisualizerModule,
    VisualizerReadyQueue = []
setTimeout(async function() {
    VisualizerModule = await import('./visualizer')
    while (VisualizerReadyQueue.length > 0) {
        try {
            VisualizerReadyQueue.pop()()
        } catch (err) {}
    }
}, 0)

class ErrorBoundary extends React.Component {
    componentDidCatch(error, info) {
        this.props.updateView({
            error: error.toString(),
        })
    }
    render() {
        return this.props.children
    }
}

class ResultVisualizerLoader extends React.PureComponent {
    componentWillUpdate() {
        this.checkModule()
    }
    componentWillMount() {
        this.checkModule()
    }
    checkModule() {
        if (!VisualizerModule) {
            VisualizerReadyQueue.push((e) => this.setState({ visualizer: VisualizerModule }))
        }
    }
    render() {
        if (VisualizerModule) {
            return <VisualizerModule.ResultVisualizer {...this.props} />
        }
        return (

                 Loading...

        )
    }
}

export function cellById(cellId) {
    return ['notebook', 'layout', U.each, 'items', U.id(cellId)]
}

export function updateCell(cellId, update) {
    State.apply(...cellById(cellId), U.merge(update))
}

export function getCell(cellId) {
    return State.get(...cellById(cellId))
}

export async function runCell(cellId) {
    if (getCell(cellId).markdown) return

    if (State.get('connect', 'status') !== 'connected') {
        // immediately invoking swal causes it to be automatically dismissed
        // when runCell is triggered by Cmd-Enter
        requestAnimationFrame((_) =>
            swal.fire(
                'Oops...',
                'No database connected! Please connect to a database before running queries. ',
                'error'
            )
        )
        return
    }

    updateCell(cellId, { loading: true })
    try {
        let cell = getCell(cellId)
        var result = await getDB().run(cell.query, cellId)
        updateCell(cellId, {
            loading: false,
            result: result,
            error: null,
            suggestedName: cell.suggestedName || result.suggestedName,
        })
    } catch (err) {
        updateCell(cellId, { loading: false, result: null, error: err.message })
    }
}

import { Select } from '@blueprintjs/labs'
import { Classes, MenuItem } from '@blueprintjs/core'

function SnippetWidget({ connect, view, cmr, updateView, config }) {
    let db = DB(connect.active)
    var is_empty = (view.query || '').trim() === ''

    // if(!connect.schema) return null;
    if (connect.status !== 'connected') return null
    if (view.markdown) return null

    function replaceText(text, tokenize = false) {
        let cm = cmr.getCodeMirror()
        updateView({ query: text })
        cm.setValue(text)

        if (tokenize) {
            let markMap = {}
            for (let [start, end, text] of derange(/(\".*?\")/g, text)) {
                let el = document.createElement('span')
                el.innerText = text
                el.className = 'schema-token'
                let mark = cm.markText(cm.posFromIndex(start), cm.posFromIndex(end), {
                    atomic: true,
                    replacedWith: el,
                })
                if (!markMap[text]) markMap[text] = []
                markMap[text].push(mark)

                el.onclick = function() {
                    let pos = mark.find()
                    cm.setSelections(
                        markMap[text].map((k) => {
                            let p = k.find()
                            return { anchor: p.from, head: p.to }
                        })
                    )
                    cm.focus()
                }
            }
        }

        cm.setCursor(1e8, 1e8)
        cm.focus()
    }
    let visible_schema = connect.schema
        ? connect.schema.filter((k) => !(k.schema && k.schema.startsWith('_')))
        : []

    return (

            {visible_schema.length > 8
                ? _.map(_.groupBy(connect.schema, 'schema'), (k, i) => (
                      <Select
                          key={i}
                          items={k}
                          noResults={<MenuItem disabled text="No results." />}
                          onItemSelect={(film) =>
                              setTimeout(
                                  (j) => replaceText(db.select_table_snippet(film, config)),
                                  0
                              )
                          }
                          itemPredicate={(query, film, index) =>
                              film.name.toLowerCase().indexOf(query.toLowerCase().trim()) != -1
                          }
                          itemRenderer={({ handleClick, item: film, isActive }) => (
                              <MenuItem
                                  className={isActive ? Classes.ACTIVE : ''}
                                  key={film.name}
                                  onClick={handleClick}
                                  label={film.columns.join(', ')}
                                  text={film.name}
                              />
                          )}
                      >

                              {i || 'default'}

                      </Select>
                  ))
                : visible_schema.map((table) => (
                      <BlueprintTooltip
                          key={table.name}
                          content={table.columns.join(', ')}
                          position={Position.BOTTOM}
                          intent={Intent.PRIMARY}
                      >

 replaceText(db.select_table_snippet(table, config))}
                          >
                              {table.name}

                      </BlueprintTooltip>
                  ))}
            {db.create_table_snippet && (
                <BlueprintTooltip
                    content={'Create Table'}
                    position={Position.BOTTOM}
                    intent={Intent.WARNING}
                >

 replaceText(db.create_table_snippet(connect.schema), true)}
                    >

                </BlueprintTooltip>
            )}

            <BlueprintTooltip content={'Convert to Markdown Cell'} position={Position.BOTTOM}>

 {
                        updateView({ markdown: true })
                        // this works around a bug in the codemirror placeholder library
                        // which doesn't update placeholder text if the thing has focus
                        requestAnimationFrame((e) => {
                            let cm = cmr.getCodeMirror()
                            cm.setCursor(1e8, 1e8)
                            cm.focus()
                        })
                    }}
                >

            </BlueprintTooltip>

    )
}

// code originally written for hypernote
function derange(re, text) {
    var match,
        ranges = [],
        pos = 0
    while ((match = re.exec(text))) {
        ranges.push([match.index, re.lastIndex, match[1]])
    }
    return ranges
}

function rangesub(ranges, replaceWith) {
    var offset = 0
    ranges.sort((a, b) => a[0] - b[0])
    for (var i = 0; i < ranges.length; i++) {
        var [start, end, sub] = ranges[i]
        offset += replaceWith(start + offset, end + offset, sub) - (end - start)
    }
}

function rangesubtext(ranges, text, replacer) {
    rangesub(ranges, (start, end, sub) => {
        var flag = replacer(sub)
        text = text.slice(0, start) + flag + text.slice(end)
        return flag.length
    })
    return text
}

export class ArchivedCell extends React.PureComponent {
    render() {
        let { view, connect } = this.props
        let db = DB(connect.active)

        return (

                        <ReactCodeMirror
                            value={view.query}
                            options={{
                                readOnly: true,
                                mode: db.syntax || 'text/plain',
                                theme: 'hipster',
                                addModeClass: true,
                                lineWrapping: true,
                            }}
                        />

                            <Tooltip content="Unarchive">
                                <button onClick={(e) => untrashCell(view.id)}>

                                </button>
                            </Tooltip>
                            <Tooltip content="Remove Permanently" intent={Intent.DANGER}>
                                <button onClick={(e) => removeTrash(view.id)}>

                                </button>
                            </Tooltip>

        )
    }
}

function removeTrash(cellId) {
    State.batch((_) => {
        State.apply('trash', 'cells', U.removeId(cellId))

        if (State.get('trash', 'cells').length === 0) {
            State.apply('trash', 'open', U.replace(false))
        }
    })
}

function untrashCell(cellId) {
    State.batch((_) => {
        let cell = State.get('trash', 'cells', U.id(cellId))
        removeTrash(cellId)
        addCell(cell)
    })
}


text:
$(document).ready(function () {
    var $page = $('.page'), pages = $page.length, scrolling = false, curPage = 1;
    function svgPagination(prev, next, dir, revDir, divider) {
        if (!divider) {
            destroySvg(revDir, prev);
            if (revDir) {
                between(dir, prev);
            } else {
                between(dir, prev - 1);
            }
            createSvg(dir, next, 600, 300);
        } else {
            destroySvg(revDir, prev, 600 / divider);
            if (revDir) {
                between(dir, prev, 150 / divider, 150 / divider, 750 / divider);
            } else {
                between(dir, prev - 1, 150 / divider, 150 / divider, 750 / divider);
            }
            createSvg(dir, next, 600 / divider, 300 / divider);
        }
    }
    function timeoutHell(tempPrev, tempNext, numDir, numDirRev, divider, i) {
        setTimeout(function () {
            svgPagination(tempPrev, tempNext, numDir, numDirRev, divider);
        }, 900 / divider * i);
    }
    function pagination(page, direction) {
        scrolling = true;
        curPage = page;
        var tempPage = page, prevPage = +$('.nav--btn.active').attr('data-page'), $prevActive = $('.page.active'), $newActive = $('.page-' + page), numDir = direction === 'down' ? 0 : 1, numDirRev = direction === 'down' ? 1 : 0;
        $page.removeClass('inactive active down up');
        $('.nav--btn').removeClass('active');
        $('.nav--btn-' + page).addClass('active');
        $newActive.addClass('active');
        if (Math.abs(prevPage - curPage) > 1) {
            var divider = Math.abs(prevPage - curPage), tempPrev = prevPage, tempDir = direction === 'down' ? 0 : 1, tempNext = !tempDir ? prevPage + 1 : prevPage - 1;
            for (var i = 0; i < divider; i++) {
                if (window.CP.shouldStopExecution(1)) {
                    break;
                }
                if (!i) {
                    svgPagination(tempPrev, tempNext, numDir, numDirRev, divider);
                } else {
                    timeoutHell(tempPrev, tempNext, numDir, numDirRev, divider, i);
                }
                tempPrev = tempNext;
                tempNext = !tempDir ? tempNext + 1 : tempNext - 1;
            }
            window.CP.exitedLoop(1);
        } else {
            svgPagination(prevPage, curPage, numDir, numDirRev);
        }
        $('.page-number').css('transform', 'translateX(-' + (page - 1) * 5 + 'rem)');
        if (direction === 'down') {
            $prevActive.addClass('removing down');
        }
        if (direction === 'up') {
            $newActive.addClass('removing up');
        }
        while (--tempPage) {
            if (window.CP.shouldStopExecution(2)) {
                break;
            }
            $('.page-' + tempPage).addClass('inactive');
        }
        window.CP.exitedLoop(2);
        setTimeout(function () {
            $page.removeClass('removing up');
        }, 700);
        setTimeout(function () {
            scrolling = false;
        }, 1000);
    }
    function navigateUp() {
        if (curPage > 1) {
            curPage--;
            pagination(curPage, 'up');
        }
    }
    function navigateDown() {
        if (curPage < pages) {
            curPage++;
            pagination(curPage, 'down');
        }
    }
    $(document).on('mousewheel DOMMouseScroll', function (e) {
        if (!scrolling) {
            if (e.originalEvent.wheelDelta > 0 || e.originalEvent.detail < 0) {
                navigateUp();
            } else {
                navigateDown();
            }
        }
    });
    $(document).on('click', '.nav--btn:not(.active)', function () {
        if (scrolling)
            return;
        var nextPage = +$(this).attr('data-page'), dir = curPage < nextPage ? 'down' : 'up';
        pagination(nextPage, dir);
    });
    function between(dir, point, duration, delay, rDelay, easing) {
        var w = $('.nav--btn').outerWidth() / 2, duration = duration || 150, delay = delay || 150, rDelay = rDelay || 750, strokeW = 2, easing = easing || 'linear', d = [
                '0,' + w,
                w + ',' + w
            ];
        if (dir)
            d.reverse();
        d[0] = 'M' + d[0];
        var svg = $('<svg class=\'pathIt-svg\'><path stroke=\'#fff\' fill=\'none\' stroke-width=\'' + strokeW + '\' d=\'' + d + '\'/></svg>');
        svg.width(w).height(2 * w);
        var $path = $(svg).find('path'), len = $path[0].getTotalLength();
        $path.velocity({
            strokeDasharray: len,
            strokeDashoffset: len
        }, { duration: 0 });
        $('.nav--btn-' + point).append(svg);
        $(svg).css({ 'left': w * 2 - 2 });
        $path.delay(delay).velocity({ strokeDashoffset: 0 }, {
            duration: duration,
            easing: easing
        });
        setTimeout(function () {
            $(svg).css('transform', 'rotate(180deg)');
            $path.velocity({ strokeDashoffset: len }, {
                duration: duration,
                easing: easing
            });
        }, rDelay);
        setTimeout(function () {
            $(svg).remove();
        }, rDelay + duration + 10);
    }
    function createSvg(dir, point, duration, delay, easing) {
        var wh = $('.nav--btn').outerWidth(), duration = duration || 600, delay = delay || 0, strokeW = 2, easing = easing || 'linear', dTop = [
                '0,' + wh / 2,
                '0,0',
                wh + ',0',
                wh + ',' + wh / 2
            ], dBot = [
                '0,' + wh / 2,
                '0,' + wh,
                wh + ',' + wh,
                wh + ',' + wh / 2
            ], dataDir = dir ? 1 : 0;
        if (dir) {
            dTop.reverse();
            dBot.reverse();
        }
        dTop[0] = 'M' + dTop[0];
        dBot[0] = 'M' + dBot[0];
        var svg = $('<svg data-dir=\'' + dataDir + '\' class=\'pathIt-svg\'><path stroke=\'#fff\' fill=\'none\' stroke-width=\'' + strokeW + '\' d=\'' + dTop + '\'/><path stroke=\'#fff\' fill=\'none\' stroke-width=\'' + strokeW + '\' d=\'' + dBot + '\'/></svg>');
        svg.width(wh).height(wh);
        var len = $(svg).find('path')[0].getTotalLength();
        $(svg).find('path').each(function () {
            $(this).velocity({
                strokeDasharray: len,
                strokeDashoffset: len
            }, { duration: 0 });
        });
        $('.nav--btn-' + point).append(svg);
        $(svg).find('path').each(function () {
            $(this).delay(delay).velocity({ strokeDashoffset: 0 }, {
                duration: duration,
                easing: easing
            });
        });
    }
    function destroySvg(dir, point, duration, delay, easing) {
        var duration = duration || 600, delay = delay || 300, easing = easing || 'linear', $svg = $('.nav--btn-' + point + ' svg'), dataDir = +$svg.attr('data-dir');
        setTimeout(function () {
            if (dataDir !== dir)
                $svg.css('transform', 'rotate(180deg)');
        }, delay);
        $svg.find('path').each(function () {
            var $path = $(this), len = $path[0].getTotalLength();
            $svg = $path.parent(), $path.delay(delay).velocity({ strokeDashoffset: len }, {
                duration: duration,
                easing: easing
            });
        });
        setTimeout(function () {
            $svg.remove();
        }, duration + delay + 10);
    }
    createSvg(0, 1, 1);
});


text:
package gemlite.core.annotations.view;

public enum ViewType
{
    LOCAL, PARTITION;
}


text:
package io.strimzi.api.kafka.model.template;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.strimzi.api.kafka.model.Constants;
import io.strimzi.api.kafka.model.UnknownPropertyPreserving;
import io.strimzi.crdgenerator.annotations.Description;
import io.sundr.builder.annotations.Buildable;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * Representation of a BuildConfig template for Strimzi resources.
 */
@Buildable(
        editableEnabled = false,
        builderPackage = Constants.FABRIC8_KUBERNETES_API
)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({"metadata", "pullSecret"})
@EqualsAndHashCode
public class BuildConfigTemplate implements Serializable, UnknownPropertyPreserving {
    private static final long serialVersionUID = 1L;

    private MetadataTemplate metadata;
    private String pullSecret;
    private Map<String, Object> additionalProperties = new HashMap<>(0);

    @Description("Metadata to apply to the `PodDistruptionBugetTemplate` resource.")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    public MetadataTemplate getMetadata() {
        return metadata;
    }

    public void setMetadata(MetadataTemplate metadata) {
        this.metadata = metadata;
    }

    @Description("Container Registry Secret with the credentials for pulling the base image.")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    public String getPullSecret() {
        return pullSecret;
    }

    public void setPullSecret(String pullSecret) {
        this.pullSecret = pullSecret;
    }

    @Override
    public Map<String, Object> getAdditionalProperties() {
        return this.additionalProperties;
    }

    @Override
    public void setAdditionalProperty(String name, Object value) {
        this.additionalProperties.put(name, value);
    }
}


text:
class User < ApplicationRecord
  ## Much of this is lifted from Code Annotator
  ## (https://github.com/hafeild/code-annotator/blob/master/app/models/user.rb)
  ## User's have...
  ## - username
  ## - email
  ## - first_name
  ## - last_name
  ## - role (faculty, student, etc.)
  ## - field_of_study
  ## - password_digest
  ## - activation_digest
  ## - activated
  ## - activated_at
  ## - remember_digest
  ## - reset_digest
  ## - reset_sent_at
  ## - created_on
  ## - updated_on
  ## - permission_level
  ## - permission_level_granted_on
  ## - permission_level_granted_by
  ## - deleted
  ## - is_registered
  ## - created_by (user)
  ## - authored_assignment_groups (AssignmentGroups)
  ## - instructed_assignments (Assignments)
  ## - created_assignment_groups (AssignmentGroups)
  ## - created_assignments (Assignments)

  attr_accessor :remember_token, :activation_token, :reset_token

  has_and_belongs_to_many :authored_assignment_groups,
    class_name: "AssignmentGroup", join_table: "assignment_groups_authors"
  has_and_belongs_to_many :instructed_assignments,
    class_name: "Assignment", join_table: "assignments_instructors"
  has_many :created_assignment_groups,
    class_name: "AssignmentGroup", foreign_key: "creator_id"
  has_many :created_assignments,
    class_name: "Assignment", foreign_key: "creator_id"

  has_secure_password
  # has_secure_password validations: false

  has_many :permission_requests
  # has_many :reviewed_permission_requests, through: :permission_requests,
  #   source: :reviewed_by
  belongs_to :permission_level_granted_by, class_name: "User", optional: true
  belongs_to :created_by, class_name: "User", optional: true

  ## Emails will be lowercased.
  before_save :downcase_email

  ## Creates a unique activation code, which will be emailed to users.
  before_create :create_activation_digest

  #########################################
  ## Validations for stubs and non-stubs:
  ##
  ## Validate first and last names -- must be there and can't be longer than
  ## 50 chars.
  validates :first_name, presence: true, length: {maximum: 50}
  validates :last_name, presence: true, length: {maximum: 50}

  ## Validate email -- can't be longer than 255 characters
  ## and must be in the correct format.
  VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
  NO_AT_SIGNS_REGEX = /\A[^@]*\z/i
  validates :email, presence: true, length: {maximum: 255},
      format: {with: VALID_EMAIL_REGEX}, uniqueness: {case_sensitive: false}

  ## Validate username -- must be there, must be unique, and can't be longer
  ## 50 characters.
  validates :username, presence: true, length: {maximum: 50},
  uniqueness: {case_sensitive: false}, format: {with: NO_AT_SIGNS_REGEX}

  validates :is_registered, inclusion: { in: [true, false] }

  ## Validate a new password.
  validates :password, presence: true,
    length: {minimum: 8, maximum: 50}, allow_nil: true
  ##
  ########################################

  ##############################
  ## Validations for non-stubs:
  ##
  ## A stub is a user placeholder created by another user, e.g., so they can
  ## label that "user" as an author or instrtuctor. User stubs
  ## are unregistered users. A new user may signup and take over a stub if
  ## their email matches.
  def is_stub?
    is_registered == false
  end

  with_options unless: :is_stub? do |non_stub|

    ## Validate role.
    non_stub.validates :role, presence: true

    ## Validate field of study.
    non_stub.validates :field_of_study, presence: true

    # ## Validate a new password.
    # non_stub.validates :password, presence: true,
    #   length: {minimum: 8, maximum: 50}, allow_nil: true

  end
  ##
  ##############################

  ## Uses BCrypt to salt/encrypt a password.
  def User.digest(string)
    cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST :
                                                  BCrypt::Engine.cost
    BCrypt::Password.create(string, cost: cost)
  end

  ## Creates a new random token.
  def User.new_token
    SecureRandom.urlsafe_base64
  end

  ## Adds a remember token to the database.
  def remember
    self.remember_token = User.new_token
    update_attribute(:remember_digest, User.digest(remember_token))
  end

  ## Checks if the digest of the given token matches the stored attribute
  ## digest.
  def authenticated?(attribute, token)
    digest = send("#{attribute}_digest")
    return false if digest.nil?
    BCrypt::Password.new(digest).is_password?(token)
  end

  # Forgets a user (removes the remember token).
  def forget
    update_attribute(:remember_digest, nil)
  end

  # Activates an account.
  def activate
    update_attribute(:activated,    true)
    update_attribute(:activated_at, Time.zone.now)
  end

  # Sends activation email.
  def send_activation_email
    UserMailer.account_activation(self).deliver_now
  end

  # Sends permissions changed email.
  def send_permissions_changed_email
    UserMailer.permissions_changed(self).deliver_now
  end

  # Sends email verification email (to make sure their email address is
  # correct).
  def send_email_verification_email
    update_attribute(:activated, false)
    update_attribute(:activation_token, User.new_token)
    update_attribute(:activation_digest, User.digest(activation_token))
    save
    UserMailer.email_verification(self).deliver_now
  end

  # Sets the password reset attributes.
  def create_reset_digest
    update_attribute(:reset_token, User.new_token)
    update_attribute(:reset_digest,  User.digest(reset_token))
    update_attribute(:reset_sent_at, Time.zone.now)
    save
  end

  # Sends password reset email.
  def send_password_reset_email
    UserMailer.password_reset(self).deliver_now
  end

  # Returns true if a password reset has expired.
  def password_reset_expired?
    reset_sent_at < 2.hours.ago
  end

  def full_name
    "#{first_name} #{last_name}"
  end

  def can_edit?
    permission_level == "editor" or permission_level == "admin"
  end

  def is_admin?
    permission_level == "admin"
  end

  ## Gets a list of admins.
  def User.admins
    User.where({permission_level: "admin"}) || []
  end

  def is_deleted?
    deleted != false
  end

  def summary_data_json
    {
      id: id,
      first_name: first_name,
      last_name: last_name,
      #email: email
      username: username
    }
  end

  searchable do
    text :username, {as: :username_autocompletable}
    text :email, {as: :email_autocompletable}
    text :last_name, {as: :last_name_autocompletable}
    text :first_name,{as: :first_name_autocompletable}

    # text :username_autocompletable do
    #   username
    # end
    # text :email_autocompletable do
    #   email
    # end
    # text :last_name_autocompletable do
    #   last_name
    # end
    # text :first_name_autocompletable do
    #   first_name
    # end
    # text :username, :email, :first_name, :last_name
  end

  private
    ## Converts email to all lower-case.
    def downcase_email
      self.email = email.downcase
    end

    ## Creates and assigns the activation token and digest.
    def create_activation_digest
      self.activation_token = User.new_token
      self.activation_digest = User.digest(activation_token)
    end

end


text:
using AutoMapper;

using Competitions.Models;

using Tennis.Mappers;
using Tennis.ViewModels.Competitions;

namespace Tennis.WebApp.Mappers
{
    /// <summary>
    /// This represents the mapper entity between <see cref="FixtureModel"/> and <see cref="FixtureJsonViewModel"/>.
    /// </summary>
    public class FixtureModelToFixtureJsonViewModelMapper : BaseMapper
    {
        /// <summary>
        /// Configures the mapping information between source and destination.
        /// </summary>
        /// <param name="config"><see cref="IMapperConfigurationExpression"/> instance.</param>
        protected override void ConfigureMap(IMapperConfigurationExpression config)
        {
            config.CreateMap<FixtureModel, FixtureJsonViewModel>()
                  .ForMember(d => d.FixtureId, o => o.MapFrom(s => s.FixtureId))
                  .ForMember(d => d.CompetitionId, o => o.MapFrom(s => s.CompetitionId))
                  .ForMember(d => d.Round, o => o.MapFrom(s => s.Week))
                  .ForMember(d => d.DateScheduled, o => o.MapFrom(s => s.DateScheduled))
                  .ForMember(d => d.Club, o => o.MapFrom(s => s.Club.Name))
                  .ForMember(d => d.Venue, o => o.MapFrom(s => s.Club.Venue.FullAddress))
                ;
        }
    }
}


text:
class Topic < ActiveRecord::Base
  is_commentable

  validates :slug, :description, :user_id, :presence => true
  validates :title, :presence => true, :uniqueness => {:scope => [:slug, :forum_id]}

  belongs_to :forum
  belongs_to :user

  attr_accessible :commentable, :description, :slug, :title
  attr_accessible :commentable, :description, :slug, :title, :user_id, :forum_id, :as => :admin

  default_scope order("updated_at desc")

  def self.recent(count = 5)
    order("updated_at DESC").limit(count).includes(:forum, :user)
  end

end


text:
package com.vaadin.book.examples.layout;

import com.vaadin.book.examples.BookExampleBundle;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.Reindeer;

public class PanelExample extends CustomComponent implements BookExampleBundle {
    private static final long serialVersionUID = 3321998143334619838L;

    public void init(String context) {
        if ("basic".equals(context))
            basic();
        else if ("scroll".equals(context))
            scroll();
        else if ("scrollbars".equals(context))
            scrollbars();
        else
            setCompositionRoot(new Label("Error"));
    }

    void basic() {
        VerticalLayout layout = new VerticalLayout();
        layout.setWidth("300px");

        // BEGIN-EXAMPLE: layout.panel.basic
        final Panel panel = new Panel("Panel");
        layout.addComponent(panel);

        panel.addComponent(new Label("Here is some content"));
        // END-EXAMPLE: layout.panel.basic

        setCompositionRoot(layout);
    }

    void scroll() {
        VerticalLayout layout = new VerticalLayout();

        // BEGIN-EXAMPLE: layout.panel.scroll
        final Panel panel = new Panel("Scrolling Panel");
        panel.setHeight("300px");
        panel.setWidth("400px");
        panel.getContent().setHeight("1000px");
        panel.setScrollable(true);

        layout.addComponent(panel);

        HorizontalLayout scrollButtons = new HorizontalLayout();
        layout.addComponent(scrollButtons);

        Button scrollUp = new Button("Scroll Up");
        scrollUp.addListener(new Button.ClickListener() {
            private static final long serialVersionUID = 8557421620094669457L;

            public void buttonClick(ClickEvent event) {
                int scrollPos = panel.getScrollTop() - 250;
                if (scrollPos < 0)
                    scrollPos = 0;
                panel.setScrollTop(scrollPos);
            }
        });
        scrollButtons.addComponent(scrollUp);

        Button scrollDown = new Button("Scroll Down");
        scrollDown.addListener(new Button.ClickListener() {
            private static final long serialVersionUID = 8557421620094669457L;

            public void buttonClick(ClickEvent event) {
                int scrollPos = panel.getScrollTop();
                if (scrollPos > 1000)
                    scrollPos = 1000;
                panel.setScrollTop(scrollPos + 250);
            }
        });
        scrollButtons.addComponent(scrollDown);

        // END-EXAMPLE: layout.panel.scroll

        setCompositionRoot(layout);
    }

    void scrollbars() {
        VerticalLayout layout = new VerticalLayout();

        // BEGIN-EXAMPLE: layout.panel.scrollbars

        // END-EXAMPLE: layout.panel.scrollbars

        setCompositionRoot(layout);
    }

    void styling() {
        VerticalLayout layout = new VerticalLayout();
        layout.setWidth("300px");

        // BEGIN-EXAMPLE: layout.panel.basic
        final Panel panel = new Panel("Panel");
        panel.addStyleName(Reindeer.PANEL_LIGHT);
        layout.addComponent(panel);

        panel.addComponent(new Label("Here is some content"));
        // END-EXAMPLE: layout.panel.basic

        setCompositionRoot(layout);
    }
}


text:
package voldemort.server.protocol.admin;

import voldemort.annotations.jmx.JmxGetter;
import voldemort.annotations.jmx.JmxOperation;

/**
 */
public abstract class AsyncOperation implements Runnable {

    protected final AsyncOperationStatus status;

    public AsyncOperation(int id, String description) {
        this.status = new AsyncOperationStatus(id, description);
    }

    @JmxGetter(name = "asyncTaskStatus")
    public AsyncOperationStatus getStatus() {
        return status;
    }

    public void updateStatus(String msg) {
        status.setStatus(msg);
    }

    public void markComplete() {
        status.setComplete(true);

    }

    public void run() {
        updateStatus("Started " + getStatus());
        String previousThreadName = Thread.currentThread().getName();
        Thread.currentThread().setName(previousThreadName + "; AsyncOp ID " + status.getId());
        try {
            operate();
        } catch(Exception e) {
            status.setException(e);
        } finally {
            Thread.currentThread().setName(previousThreadName);
            updateStatus("Finished " + getStatus());
            markComplete();
        }
    }

    @Override
    public String toString() {
        return getStatus().toString();
    }

    abstract public void operate() throws Exception;

    @JmxOperation
    abstract public void stop();

    /**
     * Cumulative wait time is reported as Seconds in the JMX by AsyncService.
     * AsyncOperation can return a positive number indicating the milliseconds
     * it is waiting, to be included for that calculation.
     *
     * @return If the AsyncOperation is waiting, return the wait time in
     *         milliseconds else return 0
     */
    public long getWaitTimeMs() {
        return 0;
    }

    /**
     * Number of wait tasks is reported as Seconds in the JMX by AsyncService.
     * AsyncOperation can return true to indicate that it should be included in
     * that calculation.
     *
     * @return If the AsyncOperation is waiting, return true else false
     */
    public boolean isWaiting() {
        return false;
    }
}


text:
---
title: Using or Linking to Our Content
layout: corporate-2col
---

Using or Linking to Our Content

The content on Freddie Mac websites contains intellectual property that is protected from unauthorized use, copying and dissemination by copyright, trademark, and other laws. The posting of content does not constitute a waiver of any of Freddie Mac's proprietary rights in or related to such content (such as, but not limited to, patents, copyrights and trademarks) or a transfer of any such rights to you or any third party. You agree not to delete any copyright or similar notice from any content.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

        {{> tertiary-terms}}

{{> share-widget}}


text:
package ru.stqa.pft.mantis.appmanager;

import org.apache.commons.net.ftp.FTPClient;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public class FtpHelper {

  private final ApplicationManager app;
  private FTPClient ftp;

  public FtpHelper (ApplicationManager app) {
    this.app = app;
    ftp = new FTPClient(); // инициализация ftp при вызове конструктора
  }

// загрузка нового файла и временно переименовывает старый
// file локалный файл котю. д.б. загружен на удалённую машину, target имя уделённого файла,
// backup имя резервной копии если удаленный файл уже существует
  public  void  upload(File file, String target, String backup) throws IOException {
    ftp.connect(app.getProperty("ftp.host")); // соединение с сервером ftp.host
    ftp.login(app.getProperty("ftp.login"), app.getProperty("ftp.password")); // вход - указание login и password
    ftp.deleteFile(backup); // удаление предыдущей локальной копии
    ftp.rename(target, backup); // делаем резервную копию путем переименования уделенного файла
    ftp.enterLocalPassiveMode(); // пассивный режим передачи данных
    ftp.storeFile(target, new FileInputStream(file)); // передача файла в удаленный файл
    ftp.disconnect();
  }
// восстановление старого файла
  public  void  restore(String backup, String target) throws IOException {
    ftp.connect(app.getProperty("ftp.host"));
    ftp.login(app.getProperty("ftp.login"), app.getProperty("ftp.password"));
    ftp.deleteFile(target);
    ftp.rename(backup, target);
    ftp.disconnect();
  }

}


text:
import { exclude, toKey, isExisty, stripTags } from "lib/helpers"

describe("exclude", () => {
  const xs = [{ id: "foo", name: "Foo" }, { id: "bar", name: "Bar" }, { id: "baz", name: "Baz" }]

  it("excludes objects given a list of values and which property to match against", () => {
    expect(exclude(["foo", "baz"], "id")(xs)).toEqual([{ id: "bar", name: "Bar" }])
  })

  it("simply returns the list if invoked without arguments", () => {
    expect(exclude()(xs)).toEqual(xs)
  })
})

describe("toKey", () => {
  it("returns a stringified key given a path", () => {
    expect(toKey("foo/bar")).toBe("foo/bar?")
  })

  it("returns a stringified key given a path and an option", () => {
    expect(toKey("foo/bar", { sort: "asc" })).toBe("foo/bar?sort=asc")
  })

  it("returns a stringified key given a path and multiple options", () => {
    expect(
      toKey("foo/bar", {
        sort: "asc",
        sleep: false,
        size: 10,
      })
    ).toBe("foo/bar?size=10&sleep=false&sort=asc")
  })

  it("sorts the option keys in alphabetical order", () => {
    expect(
      toKey("foo/bar", {
        a: 3,
        z: "whatever",
        b: 99,
        d: false,
        c: 0,
      })
    ).toBe("foo/bar?a=3&b=99&c=0&d=false&z=whatever")
  })
})

describe("isExisty", () => {
  describe("existy things", () => {
    it("returns `true` for Integers", () => {
      expect(isExisty(0)).toBe(true)
      expect(isExisty(100)).toBe(true)
    })

    it("returns `true` for Strings", () => {
      expect(isExisty("0")).toBe(true)
      expect(isExisty("Foobar")).toBe(true)
      expect(isExisty(" Foo bar ")).toBe(true)
    })

    it("returns `true` for `NaN`", () => {
      expect(isExisty(NaN)).toBe(true)
    })

    it("returns `true` for non-empty Objects", () => {
      expect(isExisty({ foo: "bar" })).toBe(true)
    })
  })

  describe("not existy things", () => {
    it("returns `false` for empty Objects", () => {
      expect(isExisty({})).toBe(false)
    })

    it("returns `false` for empty Strings", () => {
      expect(isExisty("")).toBe(false)
    })

    it("returns `false` for whitespace Strings", () => {
      expect(isExisty(" ")).toBe(false)
      expect(isExisty(" \n ")).toBe(false)
      expect(isExisty(" \n\n")).toBe(false)
    })

    it("returns `false` for `undefined`", () => {
      expect(isExisty(undefined)).toBe(false)
    })

    it("returns `false` for `null`", () => {
      expect(isExisty(null)).toBe(false)
    })
  })
})

describe("stripTags", () => {
  const html = `<a href="http://google.com">Cabbie</a>`

  it("strips html from a string", () => {
    expect(stripTags(html)).toEqual("Cabbie")
  })

  it("returns an empty string if no string is provided", () => {
    expect(stripTags()).toEqual("")
  })
})


text:
var express = require('express');
var bodyParser = require('body-parser');
var path = require('path');

var app = express();

var port = Number(process.env.PORT || 3003);

app.use(bodyParser.urlencoded({extended: false}));

app.use(express.static(__dirname + '/client'));

app.listen(port, function () {
    console.log('Listening on port: ' + port);
});


text:
PhotoFixer is a really quick script that i wrote to help me organize all the photos from everyone in my family. Its saved me hours of work so figured it would be nice to share it if anyone else would like to use it. Essentailly everyone in my family has their own camera alongside their mobile phone so when it comes to storing all the files you have IMGXXX/DIMXXX/DCIMXXX/PHOXXX and theyre just a pain to organize. What this does it takes all those files and organizes them by date and time. The XX part is for Location, since i like to know where the photos were taken, but you can easily remove that in the code.

  - Clone from GitHub
  - NPM Install
  - Drop files you want to be processed in to 'process' folder
  - 'node creator.js'
  - Tell it who the photographer is 'eg John Doe > JD'
  - Magic
  - Rename XX to wherever the photos were taken

### Version
0.0.1

### Installation

Clone from github

```sh
$ git clone https://github.com/xjonsson/photofixer-exif.git
```

```sh
$ cd photofixer-exif/
$ npm install
```

Drop the files you want to process into photofixer-exif/process

```sh
$ node creator.js
```

Specify your photographers name

![Processing Images](http://xsync.io/github/photofixer-exif/photofixer-exif.gif)

### Issues

* I have not added every camera that exists, only the ones which i have played with. If its giving you a weird ending then just go and add another case into the code, it should spit out the EXIF information that is making the name weird if you check the console.
* I fix sequencing by adding 1 if the file exists. This works for the most part, but if your creating a dump from GoPro with 30images a second, you might want to add an additional number at the end.
* I have run this with over 65,000 photos and organized the last 14 years worth with this in a few days, it has worked for me but i take no responsibility if you lose your photos. Always do a copy into the process folder not your originals just in case =]

### Future

I seriously doubt that i will be doing very much more with this except if it i find anything else thats annoying but if you would like to add your cameras or any contributions just send me a pull request and i'll see if i can maintain it =]

License
----

MIT

**Get naked and run free**


text:
namespace ash::secure_channel {

namespace {

// Values generated using the Android implementation.
const char kSessionKeyHex[] =
    "f611126a04302551ac1e8ed512952ee287a1d2561e2a2c72e7bf1ebe4bdc74ce";
const char kInitiatorKeyHex[] =
    "787ec48783f0a1f9fb9c5bc0230c2e7f45b8783acf8c9bd1c63242df9da31999";
const char kResponderKeyHex[] =
    "a366ec1f9cf327b69c341211216545cc302379078229eae78b43d60c110a6fba";

}  // namespace

class SecureChannelSessionKeysTest : public testing::Test {
 public:
  SecureChannelSessionKeysTest(const SecureChannelSessionKeysTest&) = delete;
  SecureChannelSessionKeysTest& operator=(const SecureChannelSessionKeysTest&) =
      delete;

 protected:
  SecureChannelSessionKeysTest() {}
};

TEST_F(SecureChannelSessionKeysTest, GenerateKeys) {
  std::string session_key;
  ASSERT_TRUE(base::HexStringToString(kSessionKeyHex, &session_key));

  std::string initiator_key;
  ASSERT_TRUE(base::HexStringToString(kInitiatorKeyHex, &initiator_key));

  std::string responder_key;
  ASSERT_TRUE(base::HexStringToString(kResponderKeyHex, &responder_key));

  SessionKeys session_keys(session_key);
  EXPECT_EQ(initiator_key, session_keys.initiator_encode_key());
  EXPECT_EQ(responder_key, session_keys.responder_encode_key());
}

}  // namespace ash::secure_channel


text:
import * as t from "../../types";

var getObjRef = function (node, nodes, file, scope) {
  var ref;
  if (t.isIdentifier(node)) {
    if (scope.hasBinding(node.name)) {
      // this variable is declared in scope so we can be 100% sure
      // that evaluating it multiple times wont trigger a getter
      // or something else
      return node;
    } else {
      // could possibly trigger a getter so we need to only evaluate
      // it once
      ref = node;
    }
  } else if (t.isMemberExpression(node)) {
    ref = node.object;

    if (t.isIdentifier(ref) && scope.hasGlobal(ref.name)) {
      // the object reference that we need to save is locally declared
      // so as per the previous comment we can be 100% sure evaluating
      // it multiple times will be safe
      return ref;
    }
  } else {
    throw new Error(`We can't explode this node type ${node.type}`);
  }

  var temp = scope.generateUidBasedOnNode(ref);
  nodes.push(t.variableDeclaration("var", [
    t.variableDeclarator(temp, ref)
  ]));
  return temp;
};

var getPropRef = function (node, nodes, file, scope) {
  var prop = node.property;
  var key = t.toComputedKey(node, prop);
  if (t.isLiteral(key)) return key;

  var temp = scope.generateUidBasedOnNode(prop);
  nodes.push(t.variableDeclaration("var", [
    t.variableDeclarator(temp, prop)
  ]));
  return temp;
};

export default function (node, nodes, file, scope, allowedSingleIdent) {
  var obj;
  if (t.isIdentifier(node) && allowedSingleIdent) {
    obj = node;
  } else {
    obj = getObjRef(node, nodes, file, scope);
  }

  var ref, uid;

  if (t.isIdentifier(node)) {
    ref = node;
    uid = obj;
  } else {
    var prop = getPropRef(node, nodes, file, scope);
    var computed = node.computed || t.isLiteral(prop);
    uid = ref = t.memberExpression(obj, prop, computed);
  }

  return {
    uid: uid,
    ref: ref
  };
};


text:
package io.dwak.cardboardapod;

import retrofit.http.GET;
import retrofit.http.Query;
import rx.Observable;

public interface ApodService {
    @GET("/planetary/apod?concept_tags=True")
    Observable<ApodImage> getApod(@Query("date") String date,
                                  @Query("api_key") String apiKey);
}


text:
package org.caleydo.datadomain.image;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.SortedMap;
import java.util.TreeMap;

import org.caleydo.core.serialize.INIParser;

import com.google.common.io.Files;

/**
 * @author Thomas Geymayer
 *
 */
public class LayeredImage {

	public static class Image {
		public File image;
		public File thumbnail;

		public Image(File img, File thumb) {
			image = img;
			thumbnail = thumb;

			// Ensure an image is available
			if( image == null ) {
				image = thumbnail;
				thumbnail = null;
			}

			assert(image != null);
		}

		/**
		 * Copy all files of this image to the directory @a path
		 *
		 * @param path
		 * @throws IOException
		 */
		public void copy(File path, INIParser.Section cfgSection, String suffix) throws IOException {
			Files.copy(image, new File(path, image.getName()));
			cfgSection.setProperty("image" + suffix, image.getName());

			if (thumbnail != null) {
				Files.copy(thumbnail, new File(path, thumbnail.getName()));
				cfgSection.setProperty("image" + suffix + "_thumb", thumbnail.getName());
			}
		}
	}

	public static class Layer {

		protected LayeredImage parent;

		/** Border (just outline) */
		public Image border;

		/** Full region (filled, can be used for picking) */
		public Image area;

		/** Optional layer properties */
		public Properties props = new Properties();

		protected final String name;

		public Layer(String name, File borderImg, File borderThumb, File areaImg, File areaThumb) {
			if (borderImg != null || borderThumb != null)
				border = new Image(borderImg, borderThumb);

			if (areaImg != null || areaThumb != null)
				area = new Image(areaImg, areaThumb);

			this.name = name;
		}

		public String getName() {
			return name;
		}

		public LayeredImage getParent() {
			return parent;
		}

		/**
		 * Copy all files of this Layer to the directory @a path
		 *
		 * @param path
		 * @throws IOException
		 */
		public void copy(File path, INIParser.Section cfgSection) throws IOException {
			cfgSection.putAll(props);
			cfgSection.setProperty("name", name);

			if (border != null)
				border.copy(path, cfgSection, "_border");
			if (area != null)
				area.copy(path, cfgSection, "_area");
		}
	}

	protected String name;
	protected SortedMap<String, Layer> layers = new TreeMap<>();
	protected Image base;
	protected Properties props = new Properties();

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

	public String getName() {
		return name;
	}

	public void setBaseImage(File img, File thumb) {
		base = new Image(img, thumb);
	}

	public void addLayer(Layer layer) {
		layers.put(layer.getName(), layer);
		layer.parent = this;
	}

	public void addLayer(String name, File border, File borderThumb, File areaImg, File areaThumb) {
		addLayer(new Layer(name, border, borderThumb, areaImg, areaThumb));
	}

	public void addEmptyLayer(String name) {
		addLayer(new Layer(name, null, null, null, null));
	}

	public void setConfig(Properties cfg) {
		props = cfg;
	}

	public void addConfig(File cfg) throws IOException {
		FileReader reader = new FileReader(cfg);
		try {
			props.load(reader);
		} finally {
			reader.close();
		}
	}

	public Image getBaseImage() {
		return base;
	}

	public Layer getLayer(String name) {
		return layers.get(name);
	}

	public SortedMap<String, Layer> getLayers() {
		return layers;
	}

	public void removeLayer(Layer layer) {
		layers.remove(layer.getName());
	}

	public Properties getConfig() {
		return props;
	}

	/**
	 * Copy all files of this image to the directory @a path and also write the
	 * config .ini
	 *
	 * @param path
	 * @throws IOException
	 */
	public void export(File path) throws IOException {
		path.mkdirs();

		INIParser ini = new INIParser();
		INIParser.Section baseSection = ini.getOrCreateSection("base");
		baseSection.setProperty("name", name);
		baseSection.putAll(props);

		if (base != null)
			base.copy(path, baseSection, "");

		int layer_index = 0;
		for (Layer layer: layers.values()) {
			layer.copy(path, ini.getOrCreateSection("layer" + ++layer_index));
		}

		FileWriter writer = new FileWriter(new File(path, name + ".ini"));
		ini.write(writer);
		writer.close();
	}

	/** Import image from config file (INI)
	 *
	 * Naming scheme for images and layers:
	 *
	 * (all paths are relative to the path of the ini file)
	 *
	 * [base]
	 * image=<image_path>
	 * image_thumb=<thumbnail_path>
	 * name=<unique_image_name>
	 *
	 * [layer<n>]
	 * image_area=<image_path>
	 * image_area_thumb=<thumbnail_path>
	 * image_border=<image_path>
	 * image_border_thumb=<thumbnail_path>
	 * name=<layer_id>
	 *
	 * The resulting structure is a LayeredImage with name = <unique_image_name>
	 * and layers named <layerId> (or layer<n> if name property of layer is not
	 * given).
	 *
	 * If an image has no layers, an empty layer can be created (a layer without
	 * any image assigned, but a layer_id set). This allows also images without
	 * layers to be retrieved with ImageSet::getImageForLayer.
	 *
	 * Example 1:
	 *
	 *  Importing the following config file
	 *
	 *  [base]
	 *  image=K229-OR.png
	 *  image_thumb=K229-OR_thumb.png
	 *  name=K229-OR
	 *  [layer1]
	 *  image_area=K229-OR_32_area.png
	 *  image_border=K229-OR_32_border.png
	 *  name=K229-32
	 *  [layer2]
	 *  image_area=K229-OR_33_area.png
	 *  image_border=K229-OR_33_border.png
	 *  name=K229-33
	 *
	 *  results in the following structure:
	 *
	 *  LayeredImage: {
	 *    name: K229-OR,
	 *    base: {
	 *      file: K229-OR.png,
	 *      thumbnail: K220-OR_thumb.png
	 *    }
	 *    layers: {
	 *      K229-32: {
	 *        border: K229-OR_32_border.png,
	 *        area: K229-OR_32_area.png
	 *      }
	 *      K229-33: {
	 *        border: K229-OR_33_border.png,
	 *        area: K229-OR_33_area.png
	 *      }
	 *    }
	 *  }
	 *
	 *
	 * Example 2:
	 *
	 *  Importing the following images
	 *
	 *  [base]
	 *  image=K229-TU1_35.png
	 *  image_thumb=K229-TU1_35_thumb.png
	 *  name=K229-TU1
	 *  [layer1]
	 *  name=K229-35
	 *
	 *  results in the following structure
	 *
	 *  LayeredImage: {
	 *    name: K229-TU1,
	 *    base: {
	 *      file: K229-TU1_35.png,
	 *      thumbnail: K229-TU1_35_thumb.png
	 *    }
	 *    layers: {
	 *      K229-35: null
	 *    }
	 *  }
	 *
	 * @param cfg
	 * @return
	 */
	public static LayeredImage fromINI(File cfg) {
		try {
			INIParser ini = new INIParser(cfg);
			LayeredImage img = new LayeredImage();

			// Base image
			INIParser.Section base = ini.getSections().get("base");
			if (base == null) {
				System.err.println("LayeredImage: missing [base] section");
				return null;
			}

			img.setName(base.extractString("name"));
			if (img.getName() == null || img.getName().isEmpty()) {
				System.err.println("LayeredImage: missing name");
				return null;
			}

			img.setBaseImage( base.extractFile("image"),
							  base.extractFile("image_thumb") );
			img.setConfig(base);

			// Parse layers
			for(Entry<String, INIParser.Section> section: ini.getSections().entrySet()) {
				if (section.getKey().equals("base"))
					continue;

				String name = section.getValue().extractString("name");
				if (name == null || name.isEmpty())
					name = section.getKey();

				INIParser.Section props = section.getValue();
				Layer layer = new Layer(
					name,
					props.extractFile("image_border"),
					props.extractFile("image_border_thumb"),
					props.extractFile("image_area"),
					props.extractFile("image_area_thumb")
				);
				layer.props = props;

				img.addLayer(layer);
			}

			return img;

		} catch (FileNotFoundException e) {
			System.err.println("Failed to open file: " + cfg.getPath());
		} catch (IOException e) {
			System.err.println("Failed to parse INI: " + e.getMessage());
		}

		return null;
	}
}


text:
package org.terracotta.offheapresource.management;

import org.terracotta.management.service.monitoring.registry.provider.AliasBinding;
import org.terracotta.offheapresource.OffHeapResource;

public class OffHeapResourceBinding extends AliasBinding {

  public OffHeapResourceBinding(String identifier, OffHeapResource offHeapResource) {
    super(identifier, offHeapResource);
  }

  @Override
  public OffHeapResource getValue() {
    return (OffHeapResource) super.getValue();
  }

}


text:
package com.sinewang.kiimate.subject.core.api;

import one.kii.kiimate.model.core.dai.ExtensionDai;
import one.kii.kiimate.model.core.dai.ModelPublicationDai;
import one.kii.kiimate.model.core.dai.ModelSubscriptionDai;
import one.kii.kiimate.status.core.dai.GlimpsesDai;
import one.kii.kiimate.subject.core.api.SearchSubjectsApi;
import one.kii.summer.beans.utils.ValueMapping;
import one.kii.summer.io.context.ReadContext;
import one.kii.summer.io.exception.BadRequest;
import one.kii.summer.io.exception.Panic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;

/**
 * Created by WangYanJiong on 15/05/2017.
 */

@Component
public class DefaultSearchSubjectsApi implements SearchSubjectsApi {

    @Autowired
    private ExtensionDai extensionDai;

    @Autowired
    private ModelSubscriptionDai modelSubscriptionDai;

    @Autowired
    private ModelPublicationDai modelPublicationDai;

    @Autowired
    private GlimpsesDai glimpsesDai;

    @Override
    public List<Subjects> search(ReadContext context, Form form) throws BadRequest, Panic {
        switch (form.getObjectType()) {
            case EXTENSION:
                switch (form.getAccessType()) {
                    case OWNER:
                        ExtensionDai.ClueId clue = new ExtensionDai.ClueId();
                        clue.setId(form.getGroup());
                        List<ExtensionDai.Providers> subjects = extensionDai.queryProviders(clue);
                        return ValueMapping.from(Subjects.class, subjects);
                }
            case INTENSION:
                switch (form.getAccessType()) {
                    case OWNER:
                        ExtensionDai.ClueId clue = new ExtensionDai.ClueId();
                        clue.setId(form.getGroup());
                        List<ExtensionDai.Providers> subjects = extensionDai.queryProviders(clue);
                        return ValueMapping.from(Subjects.class, subjects);
                }
            case MODEL:
                switch (form.getAccessType()) {
                    case SUBSCRIBER:
                        ModelSubscriptionDai.ClueSubscriberId clue = new ModelSubscriptionDai.ClueSubscriberId();
                        clue.setId(form.getGroup());
                        List<ModelSubscriptionDai.Subscribers> subjects = modelSubscriptionDai.querySubscribers(clue);
                        return ValueMapping.from(Subjects.class, subjects);
                    case PROVIDER:
                        ModelPublicationDai.ClueId id = new ModelPublicationDai.ClueId();
                        id.setId(form.getGroup());
                        List<ModelPublicationDai.Provider> subjects1 = modelPublicationDai.searchProviders(id);
                        return ValueMapping.from(Subjects.class, subjects1);
                }
            case INSTANCE:
                switch (form.getAccessType()) {
                    case OWNER:
                        ModelSubscriptionDai.ClueSubscriberId clue = new ModelSubscriptionDai.ClueSubscriberId();
                        clue.setId(form.getGroup());
                        List<ModelSubscriptionDai.Subscribers> subjects = modelSubscriptionDai.querySubscribers(clue);
                        return ValueMapping.from(Subjects.class, subjects);
                }
            case GLIMPSE:
                switch (form.getAccessType()) {
                    case OWNER:
                        GlimpsesDai.ClueId clue = new GlimpsesDai.ClueId();
                        clue.setId(form.getGroup());
                        List<GlimpsesDai.Providers> subjects = glimpsesDai.queryProviders(clue);
                        return ValueMapping.from(Subjects.class, subjects);
                }
            case STATUS:
                switch (form.getAccessType()) {
                    case PROVIDER:
                        ModelSubscriptionDai.ClueSubscriberId clue = new ModelSubscriptionDai.ClueSubscriberId();
                        clue.setId(form.getGroup());
                        List<ModelSubscriptionDai.Subscribers> subjects = modelSubscriptionDai.querySubscribers(clue);
                        return ValueMapping.from(Subjects.class, subjects);
                }
        }
        return Collections.emptyList();
    }
}


text:
'use strict';

import * as assert from 'assert';
import { TPromise } from 'vs/base/common/winjs.base';
import { resolveWorkbenchCommonProperties } from 'vs/platform/telemetry/node/workbenchCommonProperties';
import { TestStorageService } from 'vs/test/utils/servicesTestUtils';

suite('Telemetry - common properties', function () {

	const commit = void 0;
	const version = void 0;

	test('default', function () {

		return resolveWorkbenchCommonProperties(new TestStorageService(), commit, version).then(props => {

			assert.ok('commitHash' in props);
			assert.ok('sessionID' in props);
			assert.ok('timestamp' in props);
			assert.ok('common.platform' in props);
			assert.ok('common.timesincesessionstart' in props);
			assert.ok('common.sequence' in props);

			// assert.ok('common.version.shell' in first.data); // only when running on electron
			// assert.ok('common.version.renderer' in first.data);
			assert.ok('common.osVersion' in props, 'osVersion');
			assert.ok('version' in props);

			assert.ok('common.firstSessionDate' in props, 'firstSessionDate');
			assert.ok('common.lastSessionDate' in props, 'lastSessionDate'); // conditional, see below, 'lastSessionDate'ow
			assert.ok('common.isNewSession' in props, 'isNewSession');

			// machine id et al
			assert.ok('common.instanceId' in props, 'instanceId');
			assert.ok('common.machineId' in props, 'machineId');
			if (process.platform === 'win32') { // SQM only on windows
				assert.ok('common.sqm.userid' in props, 'userid');
				assert.ok('common.sqm.machineid' in props, 'machineid');
			}

			assert.equal(Object.keys(props).length, process.platform === 'win32' ? 18 : 16);
		});
	});

	test('lastSessionDate when aviablale', function () {

		let service = new TestStorageService();
		service.store('telemetry.lastSessionDate', new Date().toUTCString());

		return resolveWorkbenchCommonProperties(service, commit, version).then(props => {

			assert.ok('common.lastSessionDate' in props); // conditional, see below
			assert.ok('common.isNewSession' in props);
			assert.equal(props['common.isNewSession'], 0);
		});
	});

	test('values chance on ask', function () {
		return resolveWorkbenchCommonProperties(new TestStorageService(), commit, version).then(props => {
			let value1 = props['common.sequence'];
			let value2 = props['common.sequence'];
			assert.ok(value1 !== value2, 'seq');

			value1 = props['timestamp'];
			value2 = props['timestamp'];
			assert.ok(value1 !== value2, 'timestamp');

			value1 = props['common.timesincesessionstart'];
			return TPromise.timeout(10).then(_ => {
				value2 = props['common.timesincesessionstart'];
				assert.ok(value1 !== value2, 'timesincesessionstart');
			});
		});
	});
});


text:
require 'hadoop_metrics2/api'

module HBaseMetrics
  class RegionServer
    include HadoopMetrics2::API

    def extract_region(target)
      ret = {  'regions' => [] }
      target.each do |k,v|
        if /^Namespace_(\w+)_table_([\w\.\-]+)_region_(\w+)_metric_(\w+)$/ =~ k
          r = ret['regions'].select{  |i| i['namespace'] == $1 && i['table'] == $2 && i['region'] == $3}.first
          unless r
            r = {
            'namespace' => $1,
            'table' => $2,
            'region' => $3,
            }
            ret['regions'] << r
          end
          r[$4] = v
        else
          ret[k] = v
        end
      end

      ret
    end

    def server
      query_jmx("Hadoop:service=HBase,name=RegionServer,sub=Server").first
    end

    def regions
      disable_snake_case {
        target = query_jmx("Hadoop:service=HBase,name=RegionServer,sub=Regions").first
        extract_region(target)
      }
    end

    def ipc
      query_jmx('Hadoop:service=HBase,name=RegionServer,sub=IPC').first
    end

    def replication
      query_jmx("Hadoop:service=HBase,name=RegionServer,sub=Replication").first
    end

  end
end


text:
using J2N.Numerics;
using Lucene.Net.Support;
using Lucene.Net.Util;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace Lucene.Net.Search.Spans
{

    using ToStringUtils = Lucene.Net.Util.ToStringUtils;

    /// <summary>
    /// Only return those matches that have a specific payload at
    /// the given position.
    /// </summary>
    public class SpanNearPayloadCheckQuery : SpanPositionCheckQuery
    {
        protected readonly ICollection<byte[]> m_payloadToMatch;
        private readonly IEqualityComparer payloadEqualityComparer;

        /// <param name="match">          The underlying <see cref="SpanQuery"/> to check.</param>
        /// <param name="payloadToMatch"> The <see cref="T:ICollection{byte[]}"/> of payloads to match.
        /// IMPORTANT: If the type provided does not implement <see cref="IList{T}"/> (including arrays) or
        /// <see cref="ISet{T}"/>, it should either implement <see cref="IStructuralEquatable"/> or override
        /// <see cref="object.Equals(object)"/> and <see cref="object.GetHashCode()"/> with implementations
        /// that compare the values of the byte arrays to ensure they are the same.</param>
        public SpanNearPayloadCheckQuery(SpanNearQuery match, ICollection<byte[]> payloadToMatch)
            : base(match)
        {
            this.m_payloadToMatch = payloadToMatch;

            // LUCENENET specific: Need to use a structural equality comparer based on the type that is passed in.
            if (payloadToMatch is ISet<byte[]>)
                payloadEqualityComparer = J2N.Collections.Generic.SetEqualityComparer<byte[]>.Default;
            else if (payloadToMatch is IList<byte[]>)
                payloadEqualityComparer = J2N.Collections.Generic.ListEqualityComparer<byte[]>.Default;
            else
                payloadEqualityComparer = J2N.Collections.StructuralEqualityComparer.Default;
        }

        protected override AcceptStatus AcceptPosition(Spans spans)
        {
            bool result = spans.IsPayloadAvailable;
            if (result == true)
            {
                var candidate = spans.GetPayload();
                if (candidate.Count == m_payloadToMatch.Count)
                {
                    //TODO: check the byte arrays are the same
                    //hmm, can't rely on order here
                    int matches = 0;
                    foreach (var candBytes in candidate)
                    {
                        //Unfortunately, we can't rely on order, so we need to compare all
                        foreach (var payBytes in m_payloadToMatch)
                        {
                            if (Arrays.Equals(candBytes, payBytes) == true)
                            {
                                matches++;
                                break;
                            }
                        }
                    }
                    if (matches == m_payloadToMatch.Count)
                    {
                        //we've verified all the bytes
                        return AcceptStatus.YES;
                    }
                    else
                    {
                        return AcceptStatus.NO;
                    }
                }
                else
                {
                    return AcceptStatus.NO;
                }
            }
            return AcceptStatus.NO;
        }

        public override string ToString(string field)
        {
            StringBuilder buffer = new StringBuilder();
            buffer.Append("spanPayCheck(");
            buffer.Append(m_match.ToString(field));
            buffer.Append(", payloadRef: ");
            foreach (var bytes in m_payloadToMatch)
            {
                ToStringUtils.ByteArray(buffer, bytes);
                buffer.Append(';');
            }
            buffer.Append(')');
            buffer.Append(ToStringUtils.Boost(Boost));
            return buffer.ToString();
        }

        public override object Clone()
        {
            SpanNearPayloadCheckQuery result = new SpanNearPayloadCheckQuery((SpanNearQuery)m_match.Clone(), m_payloadToMatch);
            result.Boost = Boost;
            return result;
        }

        public override bool Equals(object o)
        {
            if (this == o)
            {
                return true;
            }
            if (!(o is SpanNearPayloadCheckQuery other))
            {
                return false;
            }

            // LUCENENET NOTE: Need to use the structural equality comparer to compare equality of all contained values
            return payloadEqualityComparer.Equals(this.m_payloadToMatch, other.m_payloadToMatch)
                && this.m_match.Equals(other.m_match)
                // LUCENENET specific - compare bits rather than using equality operators to prevent these comparisons from failing in x86 in .NET Framework with optimizations enabled
                && NumericUtils.SingleToSortableInt32(this.Boost) == NumericUtils.SingleToSortableInt32(other.Boost);
        }

        public override int GetHashCode()
        {
            int h = m_match.GetHashCode();
            h ^= (h << 8) | (h.TripleShift(25)); // reversible
            //TODO: is this right?
            h ^= payloadEqualityComparer.GetHashCode(m_payloadToMatch); // LUCENENET NOTE: Need to use the structural equality comparer to compare equality of all contained values
            h ^= J2N.BitConversion.SingleToRawInt32Bits(Boost);
            return h;
        }
    }
}


text:
var poser = require('./src/node');

module.exports = poser;

['Array', 'Function', 'Object', 'Date', 'String'].forEach(pose);

function pose (type) {
  poser[type] = function poseComputedType () { return poser(type); };
}


text:
<?php

class CreateTextsTable extends Ruckusing_Migration_Base
{
    public function up()
    {
        $table = $this->create_table('drunk_texts');
        $table->column('phoneNumber', 'string');
        $table->column('message', 'string');
        $table->column('dateAdded', 'datetime');
        $table->column('approved', 'boolean');
        $table->finish();

    }//up()

    public function down()
    {
        $this->drop_table('drunk_texts');
    }//down()
}


text:
<?php

$mess=array(
"1.ios" => "Existe uma aplicação nativa para aceder %s através do iPhone/iPad!",
"2.ios" => "Já possuo a aplicação. Pretendo abri-la e adicionar este servidor à minha lista de servidores remotos",
"3.ios" => "Ainda não tenho a aplicação, abra-me a página da Loja de Aplicações da mesma!",
"4.ios" => "Não tenho interesse na aplicação, deixe-me usar a versão Web de %s.",
"1.android" => "Existe uma aplicação nativa para aceder %s através do %s no Android.",
"2.android" => "Já possuo a aplicação. Pretendo abri-la e adicionar este servidor à minha lista de servidores remotos",
"3.android" => "Ainda não tenho a aplicação, abra-me a página da Loja de Aplicações da mesma!",
"4.android" => "Não tenho interesse na aplicação, deixe-me usar a versão Web de %s.",
);


text:
from .event import Event
from .attack import Useable
from .signals import sighandler
from . import dialog
from . import meta

# object = effects with trainer as sender
# share code with attacks (Useable)
# + methods proper to object (action when found on the map)
# + quantities + player bag

# objects must interact with map to know if they can be used
# example: bicycle, road/city maps will say True, but not battles or houses
# permet aussi de faire des bonus sympas, genre une ball utilisable sur une map normale (qui pourrait servir à attraper un pokémon invisible, hors combat)
# pourrait permettre aussi de lister les pokémons présents sur la map et donc sujets à l'objet (pokéflûte par exemple)

@meta.apply
class Object(Useable, Event):
    "All objects (can be found on the map, put in the bag)"

    __attributes__ = ('quantity', 'trashable')

    def __init__(self, **kwargs):
        kwargs.setdefault('quantity', 1)
        kwargs.setdefault('trashable', True)
        return super().__init__(**kwargs)

    @sighandler
    def actioned(self, game, player, map, pos):
        'Find an object on a map'
        dialog.spawn(player, '{} got {}'.format(player.name, self.name))
        self.remove() # remove object from the map
        player.bag.append(self)


text:
package com.google.j2cl.junit.apt;

/**
 * A Unit test to test processing in {@link J2clTestingProcessingStepTest}.
 */
public class AdvancedJUnit3TestCaseParent extends AdvancedJUnit3TestCaseGrandParent {
  public void testParent() {}

  public void testParent1() {}

  public void someMethodParent() {}

  public void testOverridenFromParent() {}
}


text:
package services;

/**
 * Created by Chanan on 4/23/2014.
 */
public interface ParentStringService {
    String MakeLower(String in);
}