text:
<?php

/*
  Criado     : 22/10/2015
  Modificado : 16/11/2015
  Autor      : Raphaell
  Contato    : rafaelk-f@hotmail.com
  Descrição  :

        Se o pagamento da receita já tiver sido efetuado, a data do pagamento se
     torna obrigatoria.
 */

namespace Receita\Model\Filtro\Validacao;

use Zend\Validator\AbstractValidator;

class ReceitaDataPagamento extends AbstractValidator
{

    const MSG_DATA_PAGAMENTO_REQUERIDA     = "msgDataPagamentoRequerida";
    const MSG_DATA_PAGAMENTO_NAO_REQUERIDA = "msgDataPagamentoNaoRequerida";
    const MSG_DATA_PAGAMENTO_INVALIDA      = "msgDataPagamentoInvalida";

        protected $messageTemplates = array(
        self::MSG_DATA_PAGAMENTO_REQUERIDA     => "É necessaroi informar a data do pagamento!",
        self::MSG_DATA_PAGAMENTO_NAO_REQUERIDA => "Data do pagamento não deve ser informada!",
        self::MSG_DATA_PAGAMENTO_INVALIDA      => "Data inválida!!!!"
    );

    public function __construct($options = null)
    {
        parent::__construct($options);
    }

    /*
     * Verifica se o valor informado é uma data valida.
     *
     * @param  Date $data d/m/Y
     * @return Boolean
     */
    private function checarData($data)
    {
        if (strlen(trim($data)) == 10)
        {
            $arrayData = explode('/', $data);
            if (checkdate($arrayData[1], $arrayData[0], $arrayData[2]))
            {
                return true;
            }
        }

        $this->error(self::MSG_DATA_PAGAMENTO_INVALIDA);
        return false;
    }

    /*
     * Se o valor do campo pamgamento for "S" o campo data_pagamento é obrigatório,
     * se o valor do campo pagamento for "N" o campo data_pagamento deve ser vazio
     *
     * @param  String  $valorCampo
     * @param  Array   $outrosCampos
     * @return Boolean
     */
    private function validarCampo($valorCampo, Array $outrosCampos = array())
    {
        if (isset($outrosCampos['pagamento']) && $outrosCampos['pagamento'] == 'S')
        {
            if (empty($valorCampo))
            {
                $this->error(self::MSG_DATA_PAGAMENTO_REQUERIDA);
                return false;
            }
        } elseif (isset($outrosCampos['pagamento']) && $outrosCampos['pagamento'] == 'N')
        {
            if (!empty($valorCampo))
            {
                $this->error(self::MSG_DATA_PAGAMENTO_NAO_REQUERIDA);
                return false;
            }
        }

        if (!empty($valorCampo))
        {
            return $this->checarData($valorCampo);
        }

        return true;
    }

    /*
     * @param  String $value
     * @param  Array  $context
     * @return Boolean
     */
    public function isValid($value, Array $context = array())
    {
       $this->setValue($value);

       return $this->validarCampo($value, $context);
    }

}


text:
using namespace swift;
using namespace llvm::opt;

ArgsToFrontendInputsConverter::ArgsToFrontendInputsConverter(
    DiagnosticEngine &diags, const ArgList &args)
    : Diags(diags), Args(args),
      FilelistPathArg(args.getLastArg(options::OPT_filelist)),
      PrimaryFilelistPathArg(args.getLastArg(options::OPT_primary_filelist)) {}

Optional<FrontendInputsAndOutputs> ArgsToFrontendInputsConverter::convert(
    SmallVectorImpl<std::unique_ptr<llvm::MemoryBuffer>> *buffers) {
  SWIFT_DEFER {
    if (buffers) {
      std::move(ConfigurationFileBuffers.begin(),
                ConfigurationFileBuffers.end(),
                std::back_inserter(*buffers));
      // Clearing the original list of buffers isn't strictly necessary, but
      // makes the behavior more sensible if we were to call convert() again.
      ConfigurationFileBuffers.clear();
    }
  };

  if (enforceFilelistExclusion())
    return None;

  if (FilelistPathArg ? readInputFilesFromFilelist()
                      : readInputFilesFromCommandLine())
    return None;
  Optional<std::set<StringRef>> primaryFiles = readPrimaryFiles();
  if (!primaryFiles)
    return None;

  FrontendInputsAndOutputs result;
  std::set<StringRef> unusedPrimaryFiles;
  std::tie(result, unusedPrimaryFiles) =
      createInputFilesConsumingPrimaries(*primaryFiles);

  if (diagnoseUnusedPrimaryFiles(unusedPrimaryFiles))
    return None;

  // Must be set before iterating over inputs needing outputs.
  result.setBypassBatchModeChecks(
      Args.hasArg(options::OPT_bypass_batch_mode_checks));

  return std::move(result);
}

bool ArgsToFrontendInputsConverter::enforceFilelistExclusion() {
  if (Args.hasArg(options::OPT_INPUT) && FilelistPathArg) {
    Diags.diagnose(SourceLoc(),
                   diag::error_cannot_have_input_files_with_file_list);
    return true;
  }
  // The following is not strictly necessary, but the restriction makes
  // it easier to understand a given command line:
  if (Args.hasArg(options::OPT_primary_file) && PrimaryFilelistPathArg) {
    Diags.diagnose(
        SourceLoc(),
        diag::error_cannot_have_primary_files_with_primary_file_list);
    return true;
  }
  return false;
}

bool ArgsToFrontendInputsConverter::readInputFilesFromCommandLine() {
  bool hadDuplicates = false;
  for (const Arg *A :
       Args.filtered(options::OPT_INPUT, options::OPT_primary_file)) {
    hadDuplicates = addFile(A->getValue()) || hadDuplicates;
  }
  return false; // FIXME: Don't bail out for duplicates, too many tests depend
  // on it.
}

bool ArgsToFrontendInputsConverter::readInputFilesFromFilelist() {
  bool hadDuplicates = false;
  bool hadError =
      forAllFilesInFilelist(FilelistPathArg, [&](StringRef file) -> void {
        hadDuplicates = addFile(file) || hadDuplicates;
      });
  if (hadError)
    return true;
  return false; // FIXME: Don't bail out for duplicates, too many tests depend
                // on it.
}

bool ArgsToFrontendInputsConverter::forAllFilesInFilelist(
    Arg const *const pathArg, llvm::function_ref<void(StringRef)> fn) {
  if (!pathArg)
    return false;
  StringRef path = pathArg->getValue();
  llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> filelistBufferOrError =
      llvm::MemoryBuffer::getFile(path);
  if (!filelistBufferOrError) {
    Diags.diagnose(SourceLoc(), diag::cannot_open_file, path,
                   filelistBufferOrError.getError().message());
    return true;
  }
  for (auto file :
       llvm::make_range(llvm::line_iterator(*filelistBufferOrError->get()),
                        llvm::line_iterator()))
    fn(file);
  ConfigurationFileBuffers.push_back(std::move(*filelistBufferOrError));
  return false;
}

bool ArgsToFrontendInputsConverter::addFile(StringRef file) {
  if (Files.insert(file))
    return false;
  Diags.diagnose(SourceLoc(), diag::error_duplicate_input_file, file);
  return true;
}

Optional<std::set<StringRef>>
ArgsToFrontendInputsConverter::readPrimaryFiles() {
  std::set<StringRef> primaryFiles;
  for (const Arg *A : Args.filtered(options::OPT_primary_file))
    primaryFiles.insert(A->getValue());
  if (forAllFilesInFilelist(
          PrimaryFilelistPathArg,
          [&](StringRef file) -> void { primaryFiles.insert(file); }))
    return None;
  return primaryFiles;
}

std::pair<FrontendInputsAndOutputs, std::set<StringRef>>
ArgsToFrontendInputsConverter::createInputFilesConsumingPrimaries(
    std::set<StringRef> primaryFiles) {
  bool hasAnyPrimaryFiles = !primaryFiles.empty();

  FrontendInputsAndOutputs result;
  for (auto &file : Files) {
    bool isPrimary = primaryFiles.count(file) > 0;
    result.addInput(InputFile(file, isPrimary));
    if (isPrimary)
      primaryFiles.erase(file);
  }

  if (!Files.empty() && !hasAnyPrimaryFiles) {
    Optional<std::vector<std::string>> userSuppliedNamesOrErr =
        OutputFilesComputer::getOutputFilenamesFromCommandLineOrFilelist(Args,
                                                                         Diags);
    if (userSuppliedNamesOrErr && userSuppliedNamesOrErr->size() == 1)
      result.setIsSingleThreadedWMO(true);
  }

  return {std::move(result), std::move(primaryFiles)};
}

bool ArgsToFrontendInputsConverter::diagnoseUnusedPrimaryFiles(
    std::set<StringRef> primaryFiles) {
  for (auto &file : primaryFiles) {
    // Catch "swiftc -frontend -c -filelist foo -primary-file
    // some-file-not-in-foo".
    assert(FilelistPathArg && "Unused primary with no filelist");
    Diags.diagnose(SourceLoc(), diag::error_primary_file_not_found, file,
                   FilelistPathArg->getValue());
  }
  return !primaryFiles.empty();
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>HideUnhideColumnData (JasperReports 5.6.0 API)</title>
<meta name="date" content="2014-05-27">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

net.sf.jasperreports.components.headertoolbar.actions

Class HideUnhideColumnData

java.lang.Object

net.sf.jasperreports.components.headertoolbar.actions.BaseColumnData

net.sf.jasperreports.components.headertoolbar.actions.HideUnhideColumnData

public class HideUnhideColumnData
extends BaseColumnData

Version:

$Id: HideUnhideColumnData.java 5877 2013-01-07 19:51:14Z teodord $

Author:

Narcis Marcu (narcism@users.sourceforge.net)

Constructor Summary

Constructors

Constructor and Description

HideUnhideColumnData()

Method Summary

Methods

Modifier and Type
Method and Description

int[]
getColumnIndexes()

boolean
getHide()

void
setColumnIndexes(int[] columnIndexes)

void
setHide(boolean hide)

Methods inherited from class net.sf.jasperreports.components.headertoolbar.actions.BaseColumnData

getTableUuid, setTableUuid

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HideUnhideColumnData

public HideUnhideColumnData()

Method Detail

getColumnIndexes

public int[] getColumnIndexes()

setColumnIndexes

public void setColumnIndexes(int[] columnIndexes)

getHide

public boolean getHide()

setHide

public void setHide(boolean hide)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com


text:
require "football_interacters/version"
#team objects
require 'football_interacters/create_team'
require 'football_interacters/update_team'
require 'football_interacters/delete_team'
require 'football_interacters/team_find_by_id'

#game objects
require 'football_interacters/create_game'
require 'football_interacters/update_game'
require 'football_interacters/delete_game'
require 'football_interacters/game_find_by_id'

require 'football_interacters/team_list'
require 'football_interacters/game_list'
require 'football_interacters/capture_play'
require 'football_interacters/setup_next_play'

module FootballInteracters

end


text:
Spree::Product.class_eval do

  # Returns true if a product belongs to any consultations or
  # if a product belongs to a taxonomy which has a consultation assigned
  def has_consultant?
    raise "not implemented"
  end

end


text:
namespace ReMi.Plugin.Jira.Models
{
    public class IssueStatus
    {
        public int Id { get; set; }
        public string Name { get; set; }

        public override string ToString()
        {
            return string.Format("[Id={0}, Name={1}]", Id, Name);
        }
    }
}


text:
Ext.define('Ext.log.formatter.Identity', {
    extend: 'Ext.log.formatter.Default',
    config: {
        messageFormat: "[{osIdentity}][{browserIdentity}][{timestamp}][{priorityName}][{callerDisplayName}] {message}"
    },
    format: function(event) {
        event.timestamp = Ext.Date.toString();
        event.browserIdentity = Ext.browser.name + ' ' + Ext.browser.version;
        event.osIdentity = Ext.os.name + ' ' + Ext.os.version;

        return this.callParent(arguments);
    }
});
//</feature>


text:
<?php

require_once "bootstrap/features.php";
// require_once "bootstrap/meta-boxes.php";
// require_once "gallery-metabox/gallery-metabox.php";

// Your code here...

// require_once "inc/meta-boxes.php";

bs_configure("assets", ["path" => "assets"]);

// Enqueue styles & scripts

// bs_enqueue_admin_assets(); // required if you use repeater metabox or image uploader
bs_configure("styles", [
    "frontend" => [
        bs_url("style.css"),
    ],
]);
bs_configure("scripts", [
    "frontend" => [],
    "admin"    => [],
]);

// Configure main menu

/*
    bs_configure("menus", [
        "menus" => [
            "primary" => [
                "name" => "", // what will be shown in admin interface
            ],
        ],
    ]);

    bs_configure("menu-classes", [
        "first"  => "",
        "last"   => "",
        "active" => "",
    ]);
*/

// Create theme options page

/*
    bs_configure("options-pages", [
        "xx_theme_options" => [
            "title"   => "",
            "section" => "xx",
            "options" => [],
        ],
    ]);

    function xx_theme_options()
    {
        ?>

        <table class="form-table">

        </table>

        <?php
    }
*/

// Load ACF

/*
    bs_configure("acf", [
        "show_in_admin" => true, // set to false after exporting your fields
    ]);
*/


text:
<project name="Test project with Gosu" default="hello">

  <property name="gosu.launcher.version" value="2"/>
  <property name="gosu.version" value="0.10-beta10"/>

  <target name="hello">
    <echo message="hello"/>
  </target>

  <target name="init-gosu">
    <path id="ant.lib.path">
      <fileset dir="${lib.dir}" includes="gosu-launcher-*.jar"/>
      <fileset dir="${lib.dir}" includes="gosu-core-api-*.jar"/>
      <fileset dir="${lib.dir}" includes="gosu-core-*.jar"/>
      <pathelement location="../aardvark-core/target/classes"/>
    </path>
    <taskdef resource="gw/vark/task/antlib.xml" classpathref="ant.lib.path"/>

    <gosuInit>
      <classpath>
        <pathelement location="vark"/>
      </classpath>
    </gosuInit>
  </target>

  <target name="gosu-hello" depends="init-gosu">
    <gosu>
      uses test.Foo
      Foo.hello()
    </gosu>
  </target>

</project>


text:
/**
 * @Author: liushaobo2005@163.com
 * @Date: 2017.5.11 下午 6:42
 * @Desc: 公共组件 - Util
 * @Name: Util.js
 * @LifeCycle:https://github.com/kinshasa/react-native-qatest
 */
'use strict'
import React,{Component} from 'react'
import {
    PixelRatio,
    Dimensions,
} from 'react-native'
/***
 常用工具
 ***/
var Util={

    //单位像素
    pixel:1/PixelRatio.get(),
    //屏幕的尺寸
    size:{
        width:Dimensions.get('window').width,
        height:Dimensions.get('window').height,
    },
    //post请求(url:请求地址,data封装body,callback回调)
    post(url,data,callback){
        var feachOptions={
            method:'POST',
            headers:{
                'Accept': 'application/json',
                'Content-Type': 'application/json',
            },
            body:JSON.stringify(data),
        };
        fetch(url,feachOptions)
            .then((response)=>response.text())
            .then((responseText)=>{
                callback&&callback(JSON.parse(responseText));
            }).catch((error)=>{
            console.log('error='+error);
        });
    },
    //get请求
    get(url,callback){
        fetch(url)
            .then((response)=>response.text())
            .then((respnseText)=>{
                callback(JSON.parse(responseText));
            });
    }
}

export default Util;


text:
#include <aws/apigateway/model/DeleteMethodRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::APIGateway::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

DeleteMethodRequest::DeleteMethodRequest() :
    m_restApiIdHasBeenSet(false),
    m_resourceIdHasBeenSet(false),
    m_httpMethodHasBeenSet(false)
{
}

Aws::String DeleteMethodRequest::SerializePayload() const
{
  return "";
}


text:
(function() {
"use strict";

/*------------------------------------------------------------------------------
                        List of CodeMirror Key Mappings
------------------------------------------------------------------------------*/

var cm_keymaps = {
	None : "default",
	Vim : "vim",
	Emacs : "emacs",
	Sublime : "sublime"
};

var cm_themes = {
	Light: "default",
	Dark: "zenburn"
};

/*------------------------------------------------------------------------------
                              Global Variables
------------------------------------------------------------------------------*/

var cm_editor = null;
var leaps_client = null;
var username = Cookies.get("username") || "anon";
Cookies.set("username", username, { path: '', expires: 7 });

var users = {};
var file_paths = {
	next_path: '',
	opened: '',
	root: true,
	name: "Files",
	path: "Files",
	children: [],
	subscriptions: {}
};
var collapsed_dirs = {};

var messages_obj = {
	messages: []
};

var cmds_obj = {
	selected: 0,
	options: []
};

// Configuration options
var config = {
	theme: "Dark",
	binding: "None",
	use_tabs: true,
	indent_unit: 4,
	line_guide: 0,
	wrap_lines: false,
	show_space: true,
	auto_bracket: true,
	show_bracket: true,
	hide_numbers: false
};

// Load config from cookies
(function() {
	var conf_str = Cookies.get("config");
	if ( conf_str !== undefined && conf_str.length > 0 ) {
		try {
			var loaded_config = JSON.parse(conf_str);
			for ( var field in loaded_config ) {
				if ( loaded_config.hasOwnProperty(field) ) {
					config[field] = loaded_config[field];
				}
			}
		} catch(e) {
			console.error(err);
		}
	}
})();

function save_config() {
	Cookies.set("config", JSON.stringify(config), { path: '', expires: 7 });
}

/*------------------------------------------------------------------------------
                        Leaps Editor Bootstrapping
------------------------------------------------------------------------------*/

function replace_classname(old_class, new_class) {
	var old_elements = document.getElementsByClassName(old_class);
	var i = old_elements.length;
	while ( i-- ) {
		old_elements[i].className = old_elements[i].className.replace(old_class, new_class);
	}
}

function configure_codemirror() {
	if ( config.theme === 'Light' ) {
		replace_classname("dark", "light");
	} else {
		replace_classname("light", "dark");
	}
	if ( cm_editor !== null ) {
		cm_editor.setOption("theme", cm_themes[config.theme]);
		cm_editor.setOption("keyMap", cm_keymaps[config.binding]);
		cm_editor.setOption("indentWithTabs", config.use_tabs);
		cm_editor.setOption("indentUnit", config.indent_unit);
		cm_editor.setOption("lineWrapping", config.wrap_lines);
		cm_editor.setOption("lineNumbers", !config.hide_numbers);
		cm_editor.setOption("showTrailingSpace", config.show_space);
		cm_editor.setOption("autoCloseBrackets", config.auto_bracket);
		cm_editor.setOption("matchBrackets", config.show_bracket);
		if ( config.line_guide > 0 ) {
			cm_editor.setOption("rulers", [
				{color: "#777", column: config.line_guide, lineStyle: "dashed"}
			]);
		} else {
			cm_editor.setOption("rulers", []);
		}
	}
}

function restart_leaps() {
	if ( file_paths.opened.length > 0 ) {
		var reopen_path = file_paths.opened;
		leaps_client.on_next("disconnect", function() {
			join_document(reopen_path);
		});
	} else {
		leaps_client.on_next("disconnect", function() {
			init_leaps(function() {});
		});
	}
	leaps_client.close();
}

function init_leaps(after) {
	if ( cm_editor === null ) {
		var default_options = CodeMirror.defaults;
		default_options.readOnly = true;
		default_options.viewPortMargin = "Infinity";

		cm_editor = CodeMirror(document.getElementById("editor"), default_options);

		configure_codemirror();
	}

	if ( leaps_client !== null ) {
		after();
		return;
	}

	leaps_client = new leap_client();
	leaps_client.bind_codemirror(cm_editor);

	leaps_client.on("error", function(body) {
		if ( body.error.type === "ERR_SYNC" ) {
			show_err_message(body.error.message);
			if ( cm_editor !== null ) {
				cm_editor.options.readOnly = true;
			}
			if ( leaps_client !== null ) {
				console.error(body.error);
				leaps_client.close();
				leaps_client = null;
			}
		}
	});

	leaps_client.on("unsubscribe", function(body) {
		file_paths.opened = '';
		show_sys_message("Closed " + body.document.id);
		if ( cm_editor !== null ) {
			cm_editor.options.readOnly = true;
		}
		if ( file_paths.next_path.length > 0 ) {
			let err = leaps_client.subscribe(file_paths.next_path);
			if ( err ) {
				console.error(err);
			}
			file_paths.next_path = '';
		}
		calc_sub_counts();
	});

	leaps_client.on("connect", function() {
		show_sys_message("Connected");
		after();
	});

	leaps_client.on("disconnect", function() {
		file_paths.opened = '';
		show_sys_message("Lost connection");
		if ( cm_editor !== null ) {
			cm_editor.options.readOnly = true;
			cm_editor.getWrapperElement().parentNode.removeChild(cm_editor.getWrapperElement());
			cm_editor = null;
		}
		if ( leaps_client !== null ) {
			leaps_client.close();
			leaps_client = null;
		}
	});

	leaps_client.on("subscribe", function(body) {
		file_paths.opened = body.document.id;
		cm_editor.options.readOnly = false;
		show_sys_message("Opened " + body.document.id);

		// Set the hash of our URL to the path
		window.location.hash = "path:" + body.document.id;

		calc_sub_counts();
	});

	leaps_client.on("global_metadata", function(body) {
		if ( body.metadata.type === "user_info" ) {
			// This also gives us our session_id in body.client.session_id
			for ( var old_user in users ) {
				if ( users.hasOwnProperty(old_user) ) {
					Vue.delete(users, old_user);
				}
			}
			for ( var new_user in body.metadata.body.users ) {
				if ( body.metadata.body.users.hasOwnProperty(new_user) &&
					new_user !== body.client.session_id ) {
					Vue.set(users, new_user, body.metadata.body.users[new_user]);
				}
			}
		}
		if ( body.metadata.type === "cursor_update" ) {
			users[body.client.session_id].position = body.metadata.body.position;
		}
		if ( body.metadata.type === "message" ) {
			show_user_message(body.client.username, body.client.session_id, body.metadata.body.message.content);
		}
		if ( body.metadata.type === "user_subscribe" ) {
			show_sys_message("User " + body.client.username + " opened " + body.metadata.body.document.id);
			users[body.client.session_id].subscriptions = [
				body.metadata.body.document.id
			];
			calc_sub_counts();
		}
		if ( body.metadata.type === "user_unsubscribe" ) {
			if ( users.hasOwnProperty(body.client.session_id) ) {
				show_sys_message("User " + body.client.username + " closed " + body.metadata.body.document.id);
				users[body.client.session_id].subscriptions = [];
				calc_sub_counts();
			}
		}
		if ( body.metadata.type === "user_connect" ) {
			Vue.set(users, body.client.session_id, {
				username: body.client.username,
				position: 0,
				subscriptions: []
			});
			show_sys_message("User " + body.client.username + " has connected");
		}
		if ( body.metadata.type === "user_disconnect" ) {
			Vue.delete(users, body.client.session_id);
			show_sys_message("User " + body.client.username + " has disconnected");
			calc_sub_counts();
		}
		if ( body.metadata.type === "cmd_list" ) {
			cmds_obj.options = []; // Clear old cmds
			if ( body.metadata.body.cmds instanceof Array ) {
				for ( var i = 0; i < body.metadata.body.cmds.length; i++ ) {
					cmds_obj.options.push({
						index: i,
						text: body.metadata.body.cmds[i]
					});
				}
			}
		}
		if ( body.metadata.type === "cmd_output" ) {
			show_cmd_output(body.metadata.body.cmd);
		}
	});

	var protocol = window.location.protocol === "http:" ? "ws:" : "wss:";
	leaps_client.connect(
		protocol + "//" + window.location.host + window.location.pathname + "leaps/ws" +
			"?username=" + encodeURIComponent(username)
	);
}

function join_document(document_id) {
	if ( leaps_client === null ) {
		init_leaps(function() {
			join_document(document_id);
		});
		return;
	}

	try {
		var ext = document_id.substr(document_id.lastIndexOf(".") + 1);
		var info = CodeMirror.findModeByExtension(ext);
		if ( ext.length !== document_id.length && info.mode ) {
			cm_editor.setOption("mode", info.mime);
			CodeMirror.autoLoadMode(cm_editor, info.mode);
		} else {
			cm_editor.setOption("mode", null);
		}
	} catch (e) {
		console.error(e);
	}

	if ( file_paths.opened.length > 0 ) {
		file_paths.next_path = document_id;
		let err = leaps_client.unsubscribe(file_paths.opened);
		if ( err ) {
			console.error(err);
		}
	} else {
		let err = leaps_client.subscribe(document_id);
		if ( err ) {
			console.error(err);
		}
	}
}

function navigate_to_user(user) {
	if ( cm_editor !== null ) {
		if ( (user.subscriptions || []).length > 0 &&
			file_paths.opened !== user.subscriptions[0] ) {
			leaps_client.on_next("subscribe", function() {
				var pos = leap_client.pos_from_u_index(cm_editor.getDoc(), user.position);
				cm_editor.setCursor(pos);
				cm_editor.focus();
			});
			join_document(user.subscriptions[0]);
		} else {
			var pos = leap_client.pos_from_u_index(cm_editor.getDoc(), user.position);
			cm_editor.setCursor(pos);
			cm_editor.focus();
		}
	}
}

/*------------------------------------------------------------------------------
                                  Messages
------------------------------------------------------------------------------*/

function clip_messages() {
	if ( messages_obj.messages.length > 200 ) {
		messages_obj.messages = messages_obj.messages.slice(-200);
	}
	setTimeout(function() {
		// Yield for the Vue renderer before scrolling.
		var messages_ele = document.getElementById("message-list");
		messages_ele.scrollTop = messages_ele.scrollHeight;
	}, 1);
}

function show_user_message(username, session, content) {
	var now = new Date();
	var name_style = {};
	if ( session !== null ) {
		name_style.backgroundColor = leap_client.session_id_to_colour(session);
		name_style.color = "#fcfcfc";
	}
	messages_obj.messages.push({
		timestamp: now.toLocaleTimeString(),
		name: username,
		name_style: name_style,
		content: content
	});
	clip_messages();
}

function show_sys_message(content) {
	var now = new Date();
	messages_obj.messages.push({
		timestamp: now.toLocaleTimeString(),
		is_sys: true,
		content: content
	});
	clip_messages();
}

function show_err_message(content) {
	var now = new Date();
	messages_obj.messages.push({
		timestamp: now.toLocaleTimeString(),
		is_err: true,
		content: content
	});
	clip_messages();
}

function show_cmd_output(output) {
	if ( output.stdout.length === 0 &&
	     output.stderr.length === 0 &&
	     output.error.length === 0 ) {
		output.stdout = "Empty response";
	}
	var cmd_str = "";
	if ( output.id >= 0 && cmd_str < cmds_obj.options.length ) {
		cmd_str = cmds_obj.options[output.id].text;
	}
	messages_obj.messages.push({
		stdout: output.stdout,
		stderr: output.stderr,
		error: output.error,
		cmd: cmd_str
	});
	clip_messages();
}

/*------------------------------------------------------------------------------
                       File Path Acquire and Listing
------------------------------------------------------------------------------*/

function inject_paths(root, paths_list) {
	var i = 0, l = 0, j = 0, k = 0, m = 0, n = 0;

	var children = [];

	for ( i = 0, l = paths_list.length; i < l; i++ ) {
		var ptr = children;
		var split_path = paths_list[i].split('/');

		for ( j = 0, k = split_path.length - 1; j < k; j++ ) {
			var next_ptr = null;
			for ( m = 0, n = ptr.length; m < n; m++ ) {
				if ( ptr[m].name === split_path[j] ) {
					next_ptr = ptr[m].children;
				}
			}
			if ( next_ptr === null ) {
				var new_children = [];
				ptr.push({
					name: split_path[j],
					path: split_path.slice(0, j+1).join('/'),
					children: new_children
				});
				ptr = new_children;
			} else {
				ptr = next_ptr;
			}
		}

		ptr.push({
			name: split_path[k],
			path: paths_list[i]
		});
	}

	root.children = children;
}

function calc_sub_counts() {
	var subs = {};
	for ( var user in users ) {
		if ( users.hasOwnProperty(user) &&
		   ( users[user].subscriptions instanceof Array ) ) {
			for ( var i = 0; i < users[user].subscriptions.length; i++ ) {
				if ( !subs.hasOwnProperty(users[user].subscriptions[i]) ) {
					subs[users[user].subscriptions[i]] = 1;
				} else {
					subs[users[user].subscriptions[i]]++;
				}
			}
		}
	}
	if ( file_paths.opened.length > 0 ) {
		if ( !subs.hasOwnProperty(file_paths.opened) ) {
			subs[file_paths.opened] = 1;
		} else {
			subs[file_paths.opened]++;
		}
	}
	Vue.set(file_paths, 'subscriptions', subs);
}

function get_paths() {
	AJAX_REQUEST(window.location.pathname + "files", function(data) {
		try {
			var data_arrays = JSON.parse(data);
			inject_paths(file_paths, data_arrays.paths);
		} catch (e) {
			console.error("paths parse error", e);
		}
	}, function(code, message) {
		console.error("get_paths error", code, message);
	});
}

function AJAX_REQUEST(path, onsuccess, onerror, data) {
	var xmlhttp;
	if (window.XMLHttpRequest)  {
		// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	} else {
		// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	xmlhttp.onreadystatechange = function() {
		if ( xmlhttp.readyState == 4 ) { // DONE
			if ( xmlhttp.status == 200 ) {
				onsuccess(xmlhttp.responseText);
			} else {
				onerror(xmlhttp.status, xmlhttp.responseText);
			}
		}
	};

	if ( 'undefined' !== typeof data ) {
		xmlhttp.open("POST", path, true);
		xmlhttp.setRequestHeader("Content-Type","text/plain");
		xmlhttp.send(data);
	} else {
		xmlhttp.open("GET", path, true);
		xmlhttp.send();
	}
}

/*------------------------------------------------------------------------------
                           Input field bindings
------------------------------------------------------------------------------*/

function text_input(element, on_change) {
	if ( typeof element === 'string' ) {
		element = document.getElementById(element);
	}
	element.onkeypress = function(e) {
		if ( typeof e !== 'object' ) {
			e = window.event;
		}
		var keyCode = e.keyCode || e.which;
		if ( keyCode == '13' ) {
			on_change(element, element.value);
		}
	};
}

function init_input_fields() {
	var username_bar = document.getElementById("username-bar");
	username_bar.value = username;
	text_input(username_bar, function(ele, content) {
		if ( content === username ) {
			return;
		}
		if ( content.length === 0 ) {
			content = "anon";
			username_bar.value = content;
		}
		username = content;
		Cookies.set("username", username, { path: '', expires: 7 });
		restart_leaps();
	});

	var chat_bar = document.getElementById("chat-bar");
	text_input(chat_bar, function(ele, content) {
		if ( content.length > 0 ) {
			if ( leaps_client !== null ) {
				leaps_client.send_global_metadata({
					type: "message",
					body: {
						message: {
							content: content
						}
					}
				});
				show_user_message(username, null, content);
				ele.value = "";
			} else {
				show_err_message(
					"You must open a document in order to send messages, " +
					"they will be readable by other users editing that document"
				);
			}
		}
	});
	var message_list = document.getElementById("message-list");
	message_list.onclick = function() {
		chat_bar.focus();
	};

	var settings_window = document.getElementById("settings");
	document.getElementById("settings-open-btn").onclick = function() {
		settings_window.style.display = "";
	};
	document.getElementById("settings-close-btn").onclick = function() {
		settings_window.style.display = "none";
	};
	settings_window.onclick = function() {
		settings_window.style.display = "none";
	};

	var settings_inner_window = document.getElementById("settings-window");
	settings_inner_window.onclick = function(e) {
		if (!e) {
			e = window.event;
		}
		if (e.stopPropagation) {
			e.stopPropagation();
		}
		return true;
	};
}

/*------------------------------------------------------------------------------
                           Vue.js UI bindings
------------------------------------------------------------------------------*/

window.onload = function() {
	// define the item component
	Vue.component('file-item', {
		template: '#file-template',
		props: {
			model: Object
		},
		data: function () {
			return {
				open: !collapsed_dirs[this.model.path]
			};
		},
		computed: {
			is_open: function() {
				if ( this.model.path.length <= file_paths.opened.length ) {
					return file_paths.opened.substring(0, this.model.path.length) === this.model.path;
				}
				return false;
			},
			is_folder: function () {
				return this.model.children &&
					this.model.children.length;
			},
			sub_count: function() {
				if ( typeof file_paths.subscriptions[this.model.path] === 'number' ) {
					return file_paths.subscriptions[this.model.path];
				}
				return 0;
			}
		},
		methods: {
			toggle: function () {
				if (this.is_folder) {
					this.open = !this.open;
					if ( !this.open ) {
						collapsed_dirs[this.model.path] = true;
					} else {
						delete collapsed_dirs[this.model.path];
					}
					Cookies.set("collapsed_dirs", collapsed_dirs, { path: '' });
				} else {
					join_document(this.model.path);
				}
			}
		}
	});

	(new Vue({ el: '#file-list', data: { file_data: file_paths } }));
	(new Vue({ el: '#message-list', data: messages_obj }));
	(new Vue({
		el: '#cmd-menu',
		data: cmds_obj,
		methods: {
			run_cmd: function() {
				if ( cmds_obj.selected >= 0 && cmds_obj.selected < cmds_obj.options.length ) {
					if ( leaps_client !== null ) {
						leaps_client.send_global_metadata({
							type: "cmd",
							body: {
								cmd: {
									id: cmds_obj.selected
								}
							}
						});
						show_cmd_output({
							stdout: "Running `" + cmds_obj.options[cmds_obj.selected].text + "`"
						});
					}
				}
			}
		}
	}));
	(new Vue({
		el: '#users-list',
		data: { users: users },
		methods: {
			style: function(id) {
				return {
					color: "#fcfcfc",
					backgroundColor: leap_client.session_id_to_colour(id)
				};
			},
			go_to: navigate_to_user
		}
	}));
	(new Vue({
		el: '#settings',
		data: {
			themes: cm_themes,
			bindings: cm_keymaps,
			config: config
		},
		methods: {
			on_config_change: function() {
				save_config();
				configure_codemirror();
			}
		}
	}));

	init_input_fields();

	CodeMirror.modeURL = "mode/%N/%N.js";

	try {
		collapsed_dirs = JSON.parse(Cookies.get("collapsed_dirs"));
	} catch (e) {}
	get_paths();
	setInterval(get_paths, 1000);

	init_leaps(function() {
		window.onhashchange = function() {
			// You can link directly to a filepath with <URL>#path:/this/is/the/path.go
			if ( window.location.hash.length > 0 &&
				window.location.hash.substr(1, 5) === "path:" ) {
				var new_path = window.location.hash.substr(6);
				if ( new_path !== file_paths.opened ) {
					join_document(window.location.hash.substr(6));
				}
			}
		};

		// Event isn't triggered on page load but we might want to check.
		window.onhashchange();
	});
};

})();


text:
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Rank2Types #-}

module HorbitsCC.CameraControlExploration(basesAndCameraControls, ZoomModel(..), linearZoom, geometricZoom) where

import           Control.Lens
import           Control.Monad             hiding (forM_, mapM_)
import           Control.Monad.IO.Class
import           Data.Foldable
import           Graphics.Rendering.OpenGL
import           Graphics.UI.Gtk           hiding (set)
import           Linear
import           Prelude                   hiding (foldr, mapM_)

import           Horbits.Data.Binding
import           Horbits.UI.Camera
import           Horbits.UI.GL.GLSetup

-- Cam tests

drawSimplex :: Vertex4 GLdouble -> IO ()
drawSimplex (Vertex4 x y z w) =
    let (o, a, b, c) = ( Vertex3 x y z
                       , Vertex3 (x+w) y z
                       , Vertex3 x (y+w) z
                       , Vertex3 x y (z+w)
                       ) in
        renderPrimitive Triangles $ do
            color (Color3 1 0 0 :: Color3 GLfloat)
            vertex o
            vertex a
            vertex b
            color (Color3 0 1 0 :: Color3 GLfloat)
            vertex o
            vertex a
            vertex c
            color (Color3 0 0 1 :: Color3 GLfloat)
            vertex o
            vertex b
            vertex c
            color (Color3 1 1 1 :: Color3 GLfloat)
            vertex a
            vertex b
            vertex c

drawBases :: IO ()
drawBases = do
    drawSimplex (Vertex4 0.0 0.0 0.0 1.0)
    drawSimplex (Vertex4 2.0 0.0 0.0 0.7)
    drawSimplex (Vertex4 (-2.0) 0.0 0.0 0.7)
    drawSimplex (Vertex4 0.0 2.0 0.0 0.7)
    drawSimplex (Vertex4 0.0 (-2.0) 0.0 0.7)
    drawSimplex (Vertex4 0.0 0.0 2.0 0.7)
    drawSimplex (Vertex4 0.0 0.0 (-2.0) 0.7)

basesAndCameraControls :: Window -> IO ()
basesAndCameraControls window = do
    cam <- newVar $ initOrthoCamera (linearZoom 1 (1, 20)) :: IO (IORefBindingSource (OrthoCamera Double))
    canvas <- setupGLWithCamera 600 600 cam
    onGtkGLInit canvas $ onGtkGLDraw canvas drawBases
    box <- hBoxNew False 5
    ctrlBox <- vBoxNew True 5
    containerAdd box ctrlBox
    boundSpinButton cam (orthoCameraCenter . _x) "x" (-5) 5 1 (Just 0) >>= containerAdd ctrlBox
    boundSpinButton cam (orthoCameraCenter . _y) "y" (-5) 5 1 (Just 0) >>= containerAdd ctrlBox
    boundSpinButton cam (orthoCameraCenter . _z) "z" (-5) 5 1 (Just 0) >>= containerAdd ctrlBox
    boundSpinButton cam orthoCameraScale "d" 1 20 1 Nothing >>= containerAdd ctrlBox
    boundSpinButton cam orthoCameraColatitudeDeg "colat" 0 180 5 Nothing >>= containerAdd ctrlBox
    boundSpinButton cam orthoCameraLongitudeDeg "long" 0 360 5 Nothing >>= containerAdd ctrlBox
    containerAdd box canvas
    containerAdd window box
    void $ on window keyPressEvent $ tryEvent $ do
        [Control] <- eventModifier
        "k" <- eventKeyName
        liftIO $ logCamera cam

boundSpinButton :: (HasUpdate v t t) =>
                    v -> Setter' t Double -> String -> Double -> Double -> Double -> Maybe Double -> IO HBox
boundSpinButton src prop lab min' max' step def = do
    box <- hBoxNew True 5
    spb <- spinButtonNewWithRange min' max' step
    forM_ def $ spinButtonSetValue spb
    _ <- onValueSpinned spb $ spinButtonGetValue spb >>= (mapVarS prop src $=)
    _ <- labelNew (Just lab) >>= containerAdd box
    containerAdd box spb
    return box


text:
<?php
/**
 * Created by IntelliJ IDEA.
 * User: stevenhawley
 * Date: 10/4/16
 * Time: 1:55 PM
 */

namespace Fulfillment\OMS\Models\Response;

use Fulfillment\OMS\Models\Response\Contracts\TrackingEvent as ResponseTrackingEventContract;

class TrackingEvent implements ResponseTrackingEventContract {
	/**
	 * @var string
	 */
	public $trackingNumber;
	/**
	 * @var string
	 */
	public $time;
	/**
	 * @var string
	 */
	public $location;
	/**
	 * @var string
	 */
	public $status;
	/**
	 * @var string
	 */
	public $statusCategory;
	/**
	 * @var string
	 */
	public $source;

	/**
	 * @return string
	 */
	public function getTrackingNumber()
	{
		return $this->trackingNumber;
	}

	/**
	 * @param string $trackingNumber
	 */
	public function setTrackingNumber($trackingNumber)
	{
		$this->trackingNumber = $trackingNumber;
	}

	/**
	 * @return string
	 */
	public function getTime()
	{
		return $this->time;
	}

	/**
	 * @param string $time
	 */
	public function setTime($time)
	{
		$this->time = $time;
	}

	/**
	 * @return string
	 */
	public function getLocation()
	{
		return $this->location;
	}

	/**
	 * @param string $location
	 */
	public function setLocation($location)
	{
		$this->location = $location;
	}

	/**
	 * @return string
	 */
	public function getStatus()
	{
		return $this->status;
	}

	/**
	 * @param string $status
	 */
	public function setStatus($status)
	{
		$this->status = $status;
	}

	/**
	 * @return string
	 */
	public function getStatusCategory()
	{
		return $this->statusCategory;
	}

	/**
	 * @param string $statusCategory
	 */
	public function setStatusCategory($statusCategory)
	{
		$this->statusCategory = $statusCategory;
	}

	/**
	 * @return string
	 */
	public function getSource()
	{
		return $this->source;
	}

	/**
	 * @param string $source
	 */
	public function setSource($source)
	{
		$this->source = $source;
	}

}


text:
'use strict';

/**
 * @ngdoc function
 * @name ng311.states:Alert
 * @description Alert workflows configurations
 */
angular
  .module('ng311')
  .config(function ($stateProvider) {

    $stateProvider
      .state('app.alerts', {
        url: '/alerts',
        'templateUrl': 'views/alerts/main.html',
        'controller': 'AlertMainCtrl',
        resolve: {
          endpoints: function (Summary) {
            return Summary.endpoints({
              query: {
                deletedAt: {
                  $eq: null
                }
              }
            });
          }
        },
        data: {
          authenticated: true
        }
      });
  });


text:
package io.divide.client.auth;

import io.divide.client.BackendUser;
import io.divide.client.data.ServerResponse;
import io.divide.client.http.Status;

public class SignInResponse extends ServerResponse<BackendUser> {

    public SignInResponse(BackendUser user, Status status, String error) {
        super(user, status, error);
    }
}


text:
package org.apache.camel.component.atomix.client.queue;

public final class AtomixQueue {

    public enum Action {
        ADD,
        OFFER,
        PEEK,
        POLL,
        CLEAR,
        CONTAINS,
        IS_EMPTY,
        REMOVE,
        SIZE
    }

    private AtomixQueue() {
    }
}


text:
layout: post
authors: ["Greg Wilson"]
title: Pre-Assessment
date: 2012-11-13
time: "09:00:00"
category: ["Assessment"]
---

One of the recurring problems in our bootcamps is that at any point, about 1/4 of people are lost, and 1/4 are bored. The only fix we can think of is to let people self-assess before arrival to determine whether this is the right thing for them or not (and to let instructors know more about who they're going to be teaching). We've used variations on the questionnaire below a couple of times with useful results; we'd appreciate feedback on:

what else we should ask (please give us the actual question, rather than simply, "something about such-and-such")

what we could take out

how intimidating you think this might be to people who aren't confident in their skills—we'd really like to not frighten away the people who need us most

1. Career stage:

Undergrad

Grad

Post-doc

Faculty

Industry

Support staff

2. Disciplines:

Space sciences

Physics

Chemistry

Earth sciences (geology, oceanography, meteorology)

Life science (ecology and organisms)

Life science (cells and genes)

Brain and neurosciences

Medicine

Engineering (civil, mechanical, chemical)

Computer science/electrical engineering

Economics

Humanities/social sciences

Tech support/lab tech/support programmer

Admin

3. Platform:

Linux

Mac OS X

Windows

4. A tab-delimited file has two columns: the date, and the highest temperature on that day. Produce a graph showing the average highest temperature for each month.

could do it easily

could struggle through

wouldn't know where to start

Language/tool I would use: ____________

5. Write a short program to read a file containing columns of numbers separated by commas, average the non-negative values in the second and fifth columns, and print the results.

could do it easily

could struggle through

wouldn't know where to start

Language/tool I would use: ____________

6. Check out a working copy of a project from version control, add a file called paper.txt, and commit the change.

could do it easily

could struggle through

wouldn't know where to start

Tool I would use: ____________

7. In a directory with 1000 text files, create a list of all files that contain the word Drosophila, and redirect the output to a file called results.txt.

could do it easily

could struggle through

wouldn't know where to start

Tool I would use: ____________

8. A database has two tables Scientist and Lab. The Scientist table's columns are the scientist's student ID, name, and email address; the Lab table's columns are lab names, lab IDs, and scientist IDs. Write an SQL statement that outputs a count of the number of scientists in each lab.

could do it easily

could struggle through

wouldn't know where to start

Tool I would use: ____________


text:
package org.activiti.testing.assertions;

import static org.activiti.testing.assertions.ProcessEngineAssertions.assertThat;
import static org.activiti.testing.assertions.ProcessEngineAssertions.reset;
import static org.activiti.testing.assertions.ProcessEngineTests.complete;
import static org.activiti.testing.assertions.ProcessEngineTests.runtimeService;
import static org.activiti.testing.assertions.ProcessEngineTests.task;
import static org.activiti.testing.assertions.ProcessEngineTests.withVariables;

import org.activiti.engine.ActivitiException;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.activiti.engine.test.ActivitiRule;
import org.activiti.engine.test.Deployment;
import org.activiti.testing.assertions.helpers.Failure;
import org.activiti.testing.assertions.helpers.ProcessAssertTestCase;
import org.junit.After;
import org.junit.Rule;
import org.junit.Test;

/**
 * @author Martin Schimak <martin.schimak@plexiti.com>
 */
public class ProcessEngineTestsCompleteTest extends ProcessAssertTestCase {

  @Rule
  public ActivitiRule processEngineRule = new ActivitiRule();

  @After
  public void tearDown() {
    reset();
  }

  @Test
  @Deployment(resources = {
    "ProcessEngineTests-complete.bpmn"
  })
  public void testComplete_Success() {
    // Given
    ProcessInstance processInstance = runtimeService().startProcessInstanceByKey(
      "ProcessEngineTests-complete"
    );
    // When
    complete(task(processInstance));
    // Then
    assertThat(processInstance).isEnded();
  }

  @Test
  @Deployment(resources = {
    "ProcessEngineTests-complete.bpmn"
  })
  public void testComplete_Failure() {
    // Given
    final ProcessInstance processInstance = runtimeService().startProcessInstanceByKey(
      "ProcessEngineTests-complete"
    );
    // And
    final Task task = task(processInstance);
    // When
    complete(task);
    // Then
    expect(new Failure() {
      @Override
      public void when() {
        complete(task);
      }
    }, ActivitiException.class);
  }

  @Test
  @Deployment(resources = {
    "ProcessEngineTests-complete.bpmn"
  })
  public void testComplete_WithVariables_Success() {
    // Given
    ProcessInstance processInstance = runtimeService().startProcessInstanceByKey(
      "ProcessEngineTests-complete"
    );
    // When
    complete(task(processInstance), withVariables("a", "b"));
    // Then
    assertThat(processInstance).isEnded();
  }

  @Test
  @Deployment(resources = {
    "ProcessEngineTests-complete.bpmn"
  })
  public void testComplete_WithVariables_Failure() {
    // Given
    final ProcessInstance processInstance = runtimeService().startProcessInstanceByKey(
      "ProcessEngineTests-complete"
    );
    // And
    final Task task = task(processInstance);
    // When
    complete(task);
    // Then
    expect(new Failure() {
      @Override
      public void when() {
        complete(task, withVariables("a", "b"));
      }
    }, ActivitiException.class);
  }

}


text:
#include <deque>
#include <iostream>
#include <stdexcept>

#include <boost/foreach.hpp>

#ifdef DEBUG
#include <llvm/Analysis/Verifier.h>
#endif
#include <llvm/CodeGen/GCs.h>

#include "codegen/builtin.hpp"
#include "codegen/llvm.hpp"
#include "env/resolver.hpp"
#include "reader/ast/node.hpp"
#include "reader/parser.hpp"
#include "reader/lexer.hpp"
#include "runtime/intrinsics.hpp"

namespace
{
using namespace llvm;
using namespace isana;

bool is_closed(const std::string &code)
{
    std::deque<bool> paren_stack;
    for (std::string::const_iterator it = code.begin();
            it != code.end(); ++it) {
        if ((*it) == '(') {
            paren_stack.push_back(true);
            continue;
        } else if ((*it) == ')') {
            if (paren_stack.empty())
                throw std::runtime_error("Invalid statement");
            paren_stack.pop_back();
            continue;
        }
    }
    if (paren_stack.empty()) return true;
    return false;
}

Function *eval_func(reader::node_list &ns, codegen::module_ref &m)
{
    if (Function *exists = m->getFunction("repl"))
        exists->removeFromParent();

    codegen::type_list args;
    FunctionType *ft = codegen::get_ftype(codegen::void_type(), args);
    Function *fn = codegen::add_external_function("repl", ft, m),
             *unit = codegen::add_external_function("repl.unit", ft, m);

    BasicBlock *unit_entry = codegen::add_block("entry", unit);
    IRBuilder<> irb(unit_entry);
    BOOST_FOREACH(reader::node_ref n, ns) {
        irb.CreateCall(env::lookup("display"), n->codegen(unit_entry));
        irb.CreateCall(env::lookup("newline"));
    }
    irb.CreateRetVoid();

    BasicBlock *bb = codegen::add_block("entry", fn);
    irb.SetInsertPoint(bb);
    irb.CreateCall(unit);
    irb.CreateRetVoid();

#ifdef DEBUG
    verifyFunction(*unit);
    verifyFunction(*fn);
#endif

    return fn;
}
}

int main(void)
{
    using namespace llvm;
    using namespace isana;

    codegen::init_target();

    codegen::module_ref m = codegen::defmodule::create("isana.core");

    linkShadowStackGC();
    runtime::link_runtime();
    codegen::builtin::init(m);

#ifdef DEBUG
    verifyModule(*m.get());
#endif

    ExecutionEngine *ee = codegen::defmodule::execute(m);

    std::cout << "isana> ";
    std::string code;
    while (std::getline(std::cin, code)) {
        if (code.empty()) {
            std::cout << "isana> ";
            continue;
        }
        while (!is_closed(code)) {
            std::string next;
            std::getline(std::cin, next);
            code += " " + next;
        }
#ifdef DEBUG
        if (code == ":dump") {
            std::cout << std::endl << "--- dump ---" << std::endl;
            m->dump();
            std::cout << "---" << std::endl << std::endl;
            std::cout << "isana> ";
            continue;
        }
#endif
        try {
            reader::node_list ns = reader::parse(reader::tokenize(code));
            Function *eval = eval_func(ns, m);
            ee->recompileAndRelinkFunction(eval);
            std::vector<GenericValue> gvs;
            ee->runFunction(eval, gvs);
        } catch (const std::runtime_error &e) {
            std::cerr << e.what() << std::endl;
        }
        std::cout << "isana> ";
    }
}


text:
require_relative './spec_file'

module Snapdragon
  class SpecDirectory
    def initialize(path)
      @path = path
    end

    def spec_files
      spec_file_objs = []
      Dir.glob("#{@path.path}/**/*").each do |raw_path|
        if raw_path =~ /^[\w\/\-\d]+[s|S]pec\.js$/
          spec_file_objs << Snapdragon::SpecFile.new(Snapdragon::Path.new(raw_path))
        end
      end
      return spec_file_objs
    end
  end
end


text:
       Back

CAMERON-GUN

Status: Enabled

Tags: Default

Heartbeat: 2016-11-04   11:46am

LastIP: 103.5.73.3

AgentVersion: 2016-09-20-4dae

        <form id="switch-ios8" class="store-data">

Enable

                      <input type="checkbox" name="enable">

Swipe To Delete

                      <input type="checkbox" name="switchSwipeout">

        </form>


text:
set -ex
TIFF_VERSION="4.0.10"
if [[ ! -f $DEPS_PATH/lib/libtiff.a ]]; then
    # download and build libtiff
    >&2 echo "Building libtiff..."
    download \
        https://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.zip \
        ${DEPS_PATH}/libtiff.zip
    unzip -q $DEPS_PATH/libtiff.zip -d $DEPS_PATH
    pushd .
    cd $DEPS_PATH/tiff-$TIFF_VERSION
    ./configure --quiet --disable-shared --disable-jpeg --disable-zlib --disable-jbig --disable-lzma --prefix=$DEPS_PATH
    $MAKE
    $MAKE install
    popd
fi


text:
package org.apache.geode.rest.internal.web.controllers;

import java.util.ArrayList;
import java.util.Set;

import org.apache.geode.cache.Cache;
import org.apache.geode.cache.CacheClosedException;
import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.execute.Function;
import org.apache.geode.cache.execute.FunctionContext;

/**
 * The GetRegions class is an gemfire function that gives data about available regions.
 * <p/>
 *
 * @since GemFire 8.0
 */

public class GetRegions implements Function {

  @Override
  public void execute(FunctionContext context) {

    ArrayList<String> vals = new ArrayList<String>();

    Cache c = null;
    try {
      c = CacheFactory.getAnyInstance();
    } catch (CacheClosedException ex) {
      vals.add("NoCacheResult");
      context.getResultSender().lastResult(vals);
    }

    final Set<Region<?, ?>> regionSet = c.rootRegions();
    for (Region<?, ?> r : regionSet) {
      vals.add(r.getName());
    }

    context.getResultSender().lastResult(vals);
  }

  @Override
  public String getId() {
    return "GetRegions";
  }

  @Override
  public boolean hasResult() {
    return true;
  }

  @Override
  public boolean optimizeForWrite() {
    return false;
  }

  @Override
  public boolean isHA() {
    return false;
  }
};


text:
#ifndef WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_TESTLOADGENERATOR_H_
#define WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_TESTLOADGENERATOR_H_

#include <stdlib.h>

#include "webrtc/modules/interface/module_common_types.h"
#include "webrtc/typedefs.h"

class TestSenderReceiver;
namespace webrtc {
class CriticalSectionWrapper;
class EventWrapper;
class ThreadWrapper;
}

class TestLoadGenerator
{
public:
    TestLoadGenerator (TestSenderReceiver *sender, int32_t rtpSampleRate = 90000);
    virtual ~TestLoadGenerator ();

    int32_t SetBitrate (int32_t newBitrateKbps);
    virtual int32_t Start (const char *threadName = NULL);
    virtual int32_t Stop ();
    virtual bool GeneratorLoop () = 0;

protected:
    virtual int generatePayload ( uint32_t timestamp ) = 0;
    int generatePayload ();
    int sendPayload (const uint32_t timeStamp,
        const uint8_t* payloadData,
        const uint32_t payloadSize,
        const webrtc::FrameType frameType = webrtc::kVideoFrameDelta);

    webrtc::CriticalSectionWrapper* _critSect;
    webrtc::EventWrapper *_eventPtr;
    webrtc::ThreadWrapper* _genThread;
    int32_t _bitrateKbps;
    TestSenderReceiver *_sender;
    bool _running;
    int32_t _rtpSampleRate;
};

class CBRGenerator : public TestLoadGenerator
{
public:
    CBRGenerator (TestSenderReceiver *sender, int32_t payloadSizeBytes, int32_t bitrateKbps, int32_t rtpSampleRate = 90000);
    virtual ~CBRGenerator ();

    virtual int32_t Start () {return (TestLoadGenerator::Start("CBRGenerator"));};

    virtual bool GeneratorLoop ();

protected:
    virtual int generatePayload ( uint32_t timestamp );

    int32_t _payloadSizeBytes;
    uint8_t *_payload;
};

class CBRFixFRGenerator : public TestLoadGenerator // constant bitrate and fixed frame rate
{
public:
    CBRFixFRGenerator (TestSenderReceiver *sender, int32_t bitrateKbps, int32_t rtpSampleRate = 90000,
        int32_t frameRateFps = 30, double spread = 0.0);
    virtual ~CBRFixFRGenerator ();

    virtual int32_t Start () {return (TestLoadGenerator::Start("CBRFixFRGenerator"));};

    virtual bool GeneratorLoop ();

protected:
    virtual int32_t nextPayloadSize ();
    virtual int generatePayload ( uint32_t timestamp );

    int32_t _payloadSizeBytes;
    uint8_t *_payload;
    int32_t _payloadAllocLen;
    int32_t _frameRateFps;
    double      _spreadFactor;
};

class PeriodicKeyFixFRGenerator : public CBRFixFRGenerator // constant bitrate and fixed frame rate with periodically large frames
{
public:
    PeriodicKeyFixFRGenerator (TestSenderReceiver *sender, int32_t bitrateKbps, int32_t rtpSampleRate = 90000,
        int32_t frameRateFps = 30, double spread = 0.0, double keyFactor = 4.0, uint32_t keyPeriod = 300);
    virtual ~PeriodicKeyFixFRGenerator () {}

protected:
    virtual int32_t nextPayloadSize ();

    double          _keyFactor;
    uint32_t    _keyPeriod;
    uint32_t    _frameCount;
};

// Probably better to inherit CBRFixFRGenerator from CBRVarFRGenerator, but since
// the fix FR version already existed this was easier.
class CBRVarFRGenerator : public CBRFixFRGenerator // constant bitrate and variable frame rate
{
public:
    CBRVarFRGenerator(TestSenderReceiver *sender, int32_t bitrateKbps, const uint8_t* frameRates,
        uint16_t numFrameRates, int32_t rtpSampleRate = 90000, double avgFrPeriodMs = 5.0,
        double frSpreadFactor = 0.05, double spreadFactor = 0.0);

    ~CBRVarFRGenerator();

protected:
    virtual void ChangeFrameRate();
    virtual int32_t nextPayloadSize ();

    double       _avgFrPeriodMs;
    double       _frSpreadFactor;
    uint8_t* _frameRates;
    uint16_t _numFrameRates;
    int64_t  _frChangeTimeMs;
};

class CBRFrameDropGenerator : public CBRFixFRGenerator // constant bitrate and variable frame rate
{
public:
    CBRFrameDropGenerator(TestSenderReceiver *sender, int32_t bitrateKbps,
                    int32_t rtpSampleRate = 90000, double spreadFactor = 0.0);

    ~CBRFrameDropGenerator();

protected:
    virtual int32_t nextPayloadSize();

    double       _accBits;
};

#endif // WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_TESTLOADGENERATOR_H_


text:
import React, { Component } from 'react';
import PropTypes from 'prop-types';

/**
 * Belle internal component to wrap an Option in a ComboBox.
 *
 * This component exists to avoid binding functions in JSX.
 */
export default class ComboBoxItem extends Component {

  static displayName = 'ComboBoxItem';

  static propTypes = {
    children: PropTypes.node.isRequired,
    index: PropTypes.number.isRequired,
    onItemClick: PropTypes.func.isRequired,
    onItemTouchStart: PropTypes.func.isRequired,
    onItemTouchEnd: PropTypes.func.isRequired,
    onItemTouchCancel: PropTypes.func.isRequired,
    onItemMouseEnter: PropTypes.func.isRequired,
    onItemMouseLeave: PropTypes.func.isRequired,
  };

  _onClick = () => {
    this.props.onItemClick(this.props.index);
  };

  _onTouchStart = (event) => {
    this.props.onItemTouchStart(event, this.props.index);
  };

  _onTouchEnd = (event) => {
    this.props.onItemTouchEnd(event, this.props.index);
  };

  _onTouchCancel = () => {
    this.props.onItemTouchCancel();
  };

  _onMouseEnter = () => {
    this.props.onItemMouseEnter(this.props.index);
  };

  _onMouseLeave = () => {
    this.props.onItemMouseLeave();
  };

  _onMouseDown = (event) => {
    event.preventDefault();
  };

  render() {
    return (
      <li
        onClick={ this._onClick }
        onMouseEnter={ this._onMouseEnter }
        onMouseLeave={ this._onMouseLeave }
        onMouseDown={ this._onMouseDown }
        onTouchStart={ this._onTouchStart }
        onTouchEnd={ this._onTouchEnd }
        onTouchCancel={ this._onTouchCancel }
        role="option"
      >
        { this.props.children }
      </li>
    );
  }
}


text:
from support.protobuf import *
from support import *

sub_type = StructDescriptor()
sub_type.is_global = False
sub_type.name = "subType1"

field = FieldDescriptor()
field.field_index = 1
field.field_name = "test1"
field.type = "uint32"
sub_type.fields.append(field)

field = FieldDescriptor()
field.field_index = 2
field.is_collection = True
field.field_name = "test2"
field.type = "uint32"
sub_type.fields.append(field)

new_type = StructDescriptor()
new_type.name = "Type1"

field = FieldDescriptor()
field.field_index = 3
field.field_name = "structure_field_1"
field.type = ValueType.structure
field.struct_type = sub_type
new_type.fields.append(field)

res = new_type.generate_meta()
print(res)


text:
namespace Mages.Plugins.Plots
{
    using OxyPlot;
    using System;

    public static class PlotsPlugin
    {
        public static readonly String Name = "Plots";
        public static readonly String Version = "0.1.0";
        public static readonly String Author = "Florian Rappl";

        public static Type Plot
        {
            get { return typeof(PlotModel); }
        }
    }
}


text:
static NSString * const PKITrustDataAssetType = @"com.apple.MobileAsset.PKITrustServices.PKITrustData";

int main (int argc, const char * argv[])
{
    @autoreleasepool
    {
        ASAssetQuery* assetQuery = [[ASAssetQuery alloc] initWithAssetType:PKITrustDataAssetType];

        if (nil == assetQuery)
        {
            NSLog(@"Could not create an ASAssetQuery object");
            exit(EXIT_FAILURE);
        }

        NSError* error = nil;
        NSArray* foundAssets = nil;

        foundAssets = [assetQuery runQueryAndReturnError:&error];
        if (nil == foundAssets)
        {
            NSLog(@"running assetQuery fails: %@", [error localizedDescription]);
            exit(EXIT_FAILURE);
        }

        return 0;
    }
}


text:
CREATE TABLE CHANGELOG (
ID NUMERIC(20,0) NOT NULL,
APPLIED_AT VARCHAR(25) NOT NULL,
DESCRIPTION VARCHAR(255) NOT NULL
);

ALTER TABLE CHANGELOG
ADD CONSTRAINT PK_CHANGELOG
PRIMARY KEY (id);

INSERT INTO CHANGELOG (ID, APPLIED_AT, DESCRIPTION) VALUES (20160329144627, '2016-03-30 12:42:59', 'create changelog');

-- 20160329144628_first_migration.sql
--  First migration.
-- Migration SQL that makes the change goes here.

-- add a "category" column to the subscriptions table
ALTER TABLE `podcast_db`.`subscriptions`
ADD COLUMN `category` VARCHAR(45) NOT NULL AFTER `subscription_date`,
DROP PRIMARY KEY,
ADD PRIMARY KEY (`email`, `podcast_id`, `category`);

UPDATE `podcast_db`.`subscriptions`
SET category='default'
where category='';

INSERT INTO CHANGELOG (ID, APPLIED_AT, DESCRIPTION) VALUES (20160329144628, '2016-03-30 12:42:59', 'first migration');

-- 20160329150635_add_password_reset_token_to_users.sql
--  add password reset token to users
-- Migration SQL that makes the change goes here.

-- add passwd_reset_token
ALTER TABLE `podcast_db`.`users`
ADD COLUMN `password_reset_token` VARCHAR(45) NULL AFTER `registration_token`;

INSERT INTO CHANGELOG (ID, APPLIED_AT, DESCRIPTION) VALUES (20160329150635, '2016-03-30 12:42:59', 'add password reset token to users');

------------------------------------------------------------------------
-- MyBatis Migrations SUCCESS
-- Total time: 0s
-- Finished at: Wed Mar 30 12:42:59 CEST 2016
-- Final Memory: 7M/479M
------------------------------------------------------------------------


text:
<?php

namespace Symfony\Component\Finder\Tests\Iterator;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator;

class MultiplePcreFilterIteratorTest extends TestCase
{
    /**
     * @dataProvider getIsRegexFixtures
     */
    public function testIsRegex($string, $isRegex, $message)
    {
        $testIterator = new TestMultiplePcreFilterIterator();
        $this->assertEquals($isRegex, $testIterator->isRegex($string), $message);
    }

    public function getIsRegexFixtures()
    {
        return array(
            array('foo', false, 'string'),
            array(' foo ', false, '" " is not a valid delimiter'),
            array('\\foo\\', false, '"\\" is not a valid delimiter'),
            array('afooa', false, '"a" is not a valid delimiter'),
            array('//', false, 'the pattern should contain at least 1 character'),
            array('/a/', true, 'valid regex'),
            array('/foo/', true, 'valid regex'),
            array('/foo/i', true, 'valid regex with a single modifier'),
            array('/foo/imsxu', true, 'valid regex with multiple modifiers'),
            array('#foo#', true, '"#" is a valid delimiter'),
            array('{foo}', true, '"{,}" is a valid delimiter pair'),
            array('*foo.*', false, '"*" is not considered as a valid delimiter'),
            array('?foo.?', false, '"?" is not considered as a valid delimiter'),
        );
    }
}

class TestMultiplePcreFilterIterator extends MultiplePcreFilterIterator
{
    public function __construct()
    {
    }

    public function accept()
    {
        throw new \BadFunctionCallException('Not implemented');
    }

    public function isRegex($str)
    {
        return parent::isRegex($str);
    }

    public function toRegex($str)
    {
        throw new \BadFunctionCallException('Not implemented');
    }
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Monadex</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" href="bower_components/jquery-minicolors/jquery.minicolors.css"/>
  <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css"/>
  <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.css"/>
  <link rel="stylesheet" href="bower_components/seiyria-bootstrap-slider/dist/css/bootstrap-slider.min.css"/>
  <link rel="stylesheet" href="css/app.css"/>
  <link rel="stylesheet" href="css/landing.css"/>
  <link rel="stylesheet" href="css/designer.css"/>
  <link rel="stylesheet" href="css/campaign.css"/>
  <link rel="stylesheet" href="css/campaign-details.css"/>

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">

        </button>
        Monadex

            Learn More
            Login
            Get Started


text:
<bill session="115" type="h" number="85" updated="2017-05-04T00:17:13Z">
  <state datetime="2017-01-03">REFERRED</state>
  <status>
    <introduced datetime="2017-01-03"/>
  </status>
  <introduced datetime="2017-01-03"/>
  <titles>
    <title type="official" as="introduced">To make 1 percent across-the-board rescissions in non-defense, non-homeland-security, and non-veterans-affairs discretionary spending for each of the fiscal years 2017 and 2018.</title>
    <title type="display">To make 1 percent across-the-board rescissions in non-defense, non-homeland-security, and non-veterans-affairs discretionary spending for each of the fiscal years 2017 and 2018.</title>
  </titles>
  <sponsor bioguide_id="B001243"/>
  <cosponsors>
    <cosponsor bioguide_id="B001248" joined="2017-01-03"/>
    <cosponsor bioguide_id="F000448" joined="2017-01-03"/>
    <cosponsor bioguide_id="G000552" joined="2017-01-03"/>
    <cosponsor bioguide_id="H001036" joined="2017-01-03"/>
    <cosponsor bioguide_id="R000607" joined="2017-01-09"/>
    <cosponsor bioguide_id="W000820" joined="2017-01-03"/>
  </cosponsors>
  <actions>
    <action datetime="2017-01-03">
      <text>Introduced in House</text>
    </action>
    <action datetime="2017-01-03" state="REFERRED">
      <text>Referred to the House Committee on Appropriations.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="HSAP" name="House Appropriations" activity="Referral"/>
  </committees>
  <relatedbills>
    <bill type="h" session="115" relation="unknown" number="86"/>
    <bill type="h" session="115" relation="unknown" number="87"/>
  </relatedbills>
  <subjects>
    <term name="Economics and public finance"/>
    <term name="Appropriations"/>
    <term name="Budget deficits and national debt"/>
    <term name="Budget process"/>
    <term name="Executive agency funding and structure"/>
  </subjects>
  <amendments/>
  <summary date="2017-01-03T05:00:00Z" status="Introduced in House">This bill makes 1% across-the-board rescissions in discretionary spending for FY2017 and FY2018, excluding spending for defense, homeland security, and veterans affairs. It also requires the Office of Management and Budget to submit a report to Congress specifying the account and amount of each rescission made pursuant to this bill.</summary>
  <committee-reports/>
</bill>


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//-----------------------------------------------------------------------
// </copyright>
// <summary>Implements a cache for registered task objects.</summary>
//-----------------------------------------------------------------------

using System;
using Microsoft.Build.Framework;
using Microsoft.Build.Shared;

namespace Microsoft.Build.BackEnd.Components.Caching
{
    /// <summary>
    /// This is a cache of objects which are registered to be disposed of at a specified time.
    /// </summary>
    internal class RegisteredTaskObjectCache : RegisteredTaskObjectCacheBase, IBuildComponent, IRegisteredTaskObjectCache, IDisposable
    {
        /// <summary>
        /// Finalizer
        /// </summary>
        ~RegisteredTaskObjectCache()
        {
            Dispose(disposing: false);
        }

        #region IBuildComponent

        /// <summary>
        /// Initialize the build component.
        /// </summary>
        public void InitializeComponent(IBuildComponentHost host)
        {
        }

        /// <summary>
        /// Shuts down the build component.
        /// </summary>
        public void ShutdownComponent()
        {
            ErrorUtilities.VerifyThrow(IsCollectionEmptyOrUncreated(RegisteredTaskObjectLifetime.Build), "Build lifetime objects were not disposed at the end of the build");
        }

        #endregion

        #region IDisposable

        /// <summary>
        /// Implementation of Dispose pattern.
        /// </summary>
        public void Dispose()
        {
            Dispose(disposing: true);
            GC.SuppressFinalize(this);
        }

        #endregion

        /// <summary>
        /// Component factory.
        /// </summary>
        internal static IBuildComponent CreateComponent(BuildComponentType type)
        {
            ErrorUtilities.VerifyThrow(type == BuildComponentType.RegisteredTaskObjectCache, "Cannot create components of type {0}", type);
            return new RegisteredTaskObjectCache();
        }

        /// <summary>
        /// Implementation of Dispose pattern.
        /// </summary>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                ErrorUtilities.VerifyThrow(IsCollectionEmptyOrUncreated(RegisteredTaskObjectLifetime.Build), "Build lifetime objects were not disposed at the end of the build");
            }
        }
    }
}


text:
package org.araneaframework.jsp.tag.uilib.form.element;

import java.io.IOException;
import java.io.Writer;
import org.araneaframework.Path;
import org.araneaframework.jsp.UiUpdateEvent;
import org.araneaframework.jsp.util.JspUtil;
import org.araneaframework.jsp.util.JspWidgetCallUtil;
import org.araneaframework.uilib.event.OnClickEventListener;

/**
 * Button form element tag, represents {@link org.araneaframework.uilib.form.control.ButtonControl}. Rendered with
 * either <input type="button"> or just <button> depending on renderMode attribute.
 *
 * @author Oleg Mürk
 * @jsp.tag name = "button" body-content = "JSP" description = "Form button, represents UiLib 'ButtonControl'."
 */
public class FormButtonHtmlTag extends BaseFormButtonTag {

  public FormButtonHtmlTag() {
    this.baseStyleClass = "aranea-button";
  }

  @Override
  protected int doStartTag(Writer out) throws Exception {
    super.doStartTag(out);

    // Prepare
    String name = this.getFullFieldId();

    writeButtonStartTag(out);

    JspUtil.writeAttribute(out, "id", name);
    JspUtil.writeAttribute(out, "name", name);
    JspUtil.writeAttribute(out, "class", getStyleClass());
    JspUtil.writeAttribute(out, "style", getStyle());
    JspUtil.writeAttribute(out, "tabindex", this.tabindex);

    if (this.events && !this.viewModel.isDisabled()) {
      writeEventAttribute(out);
    } else if (this.viewModel.isDisabled()) {
      JspUtil.writeAttribute(out, "disabled", "disabled");
    }

    JspUtil.writeAttributes(out, this.attributes);

    if (this.accessKey != null) {
      JspUtil.writeAttribute(out, "accesskey", this.accessKey);
    }

    writeButtonCloseTag(out, false);

    // Continue
    return EVAL_BODY_INCLUDE;
  }

  @Override
  protected int doEndTag(Writer out) throws Exception {
    writeButtonCloseTag(out, true);
    return super.doEndTag(out);
  }

  protected boolean writeEventAttribute(Writer out) throws IOException {
    if (this.viewModel.isOnClickEventRegistered()) {
      UiUpdateEvent event = new UiUpdateEvent();
      event.setId(OnClickEventListener.ON_CLICK_EVENT);
      event.setTarget(this.formFullId + Path.SEPARATOR + this.derivedId);
      event.setUpdateRegionNames(this.updateRegionNames);
      event.setEventPrecondition(this.onClickPrecondition);

      JspUtil.writeEventAttributes(out, event);
      JspWidgetCallUtil.writeSubmitScriptForEvent(out, "onclick");
    }

    return this.viewModel.isOnClickEventRegistered();
  }
}


text:
package com.swtworkbench.community.xswt.codegens;

import org.eclipse.swt.graphics.Rectangle;

import com.swtworkbench.community.xswt.codegen.ICodeGenerator;

/**
 * Class FontCodeGenerator.
 *
 * @author djo
 */
public class RectangleCodeGenerator implements ICodeGenerator {

    /* (non-Javadoc)
     * @see net.sf.sweet_swt.xswt.constantgen.IConstantGenerator#getConstant(java.lang.Object)
     */
    public String getCode(Object o, String source) {
        Rectangle r = (Rectangle)o;
        return "new Rectangle(" + r.x + ", " + r.y + ", " + r.width + ", " + r.height + ")";
    }
}


text:
/**
 * 初始化获取archives.json数据
 */
function initJsonData(url) {
    var posts;
    var allKeys;
    $.ajax({
        type: "get", //jquey是不支持post方式跨域的
        async: false,
        url: url, //跨域请求的URL
        dataType: "json",
        //传递给请求处理程序,用以获得jsonp回调函数名的参数名(默认为:callback)
        jsonp: "jsoncallback",
        //自定义的jsonp回调函数名称,默认为jQuery自动生成的随机函数名
        jsonpCallback: "success_jsonpCallback",
        //成功获取跨域服务器上的json数据后,会动态执行这个callback函数
        success: function (json) {
            posts = json;
            allKeys = new Array(posts.length);
            for (var i = 0; i < posts.length; i++) {
                allKeys[i] = posts[i].UUID;
            }
            //console.log(url + "数据获取完成, posts.size : " + posts.length + " threads_key : " + allKeys.length);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            console.log(XMLHttpRequest);
            console.log(textStatus);
            console.log(errorThrown);
        }
    });
    return new Array(posts, allKeys)
}

function initTagsJsonData(url) {
    var tags;
    $.ajax({
        type: "get", //jquey是不支持post方式跨域的
        async: false,
        url: "/json/tags.json", //跨域请求的URL
        dataType: "json",
        //传递给请求处理程序,用以获得jsonp回调函数名的参数名(默认为:callback)
        jsonp: "jsoncallback",
        //自定义的jsonp回调函数名称,默认为jQuery自动生成的随机函数名
        jsonpCallback: "success_jsonpCallback",
        //成功获取跨域服务器上的json数据后,会动态执行这个callback函数
        success: function (json) {
            tags = json;
            //console.log("tags.json数据获取完成, tags.length : " + tags.length);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            console.log(XMLHttpRequest);
            console.log(textStatus);
            console.log(errorThrown);
        }
    });
    return tags;
}

/***
 *  根据threads获取当前页的多说评论数据
 * @param 所有文章
 * @param currentKeys 當前需要獲取根據文章ID獲取
 * @param currentPage 当前页面
 */
function getDuoShuoData(posts, currentKeys, currentPage, countPerPage) {
    $.ajax({
        type: "get", //jquey是不支持post方式跨域的
        async: false,
        url: "http://api.duoshuo.com/threads/counts.jsonp?short_name=demi-panda&threads=" + currentKeys.toString() + "&callback=?", //跨域请求的URL
        dataType: "jsonp",
        //传递给请求处理程序,用以获得jsonp回调函数名的参数名(默认为:callback)
        jsonp: "jsoncallback",
        //自定义的jsonp回调函数名称,默认为jQuery自动生成的随机函数名
        jsonpCallback: "success_jsonpCallback",
        timeout: 5000,
        //成功获取跨域服务器上的json数据后,会动态执行这个callback函数
        success: function (json) {
            var duoshuo = eval(json.response);
            console.log("duoshuo数据获取完成...");
            var content = pageselectCallback(posts, duoshuo, currentPage, countPerPage);
            $('#content').html(content);
            $("html, body").animate({ scrollTop: 0 }, 1000);
            console.log("初始化第" + currentPage + "页数据 OK...");
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            console.log(XMLHttpRequest);
            console.log(textStatus);
            console.log(errorThrown);
            duoshuo = null;
        }
    });
}
/**
 * 获取当前页threads_keys
 * @param allKeys 所有文章唯一ID
 * @param currentPage  当前页
 * @param countPerPage 每页显示的数量
 * @returns {Array}
 */
function getCurrentPageThreads(allKeys, currentPage, countPerPage) {
    var start = (currentPage - 1 ) * countPerPage;
    var rows = allKeys.length - start < countPerPage ? allKeys.length - start : countPerPage;
    var currentThreads = new Array(rows);
    var position = 0;
    for (var i = start; i < allKeys.length; i++) {
        currentThreads[position] = allKeys[i];
        position++;
        if (position >= rows) {
            break;
        }
    }
    //console.log("page : " + currentPage + " currentThreads : " + currentThreads);
    return currentThreads;
}

function getStartedInitialization(posts, allKeys, countPerPage) {
    getStartedInitialization(posts, allKeys, countPerPage, null);
}

function getStartedInitialization(posts, allKeys, countPerPage, tagName) {
    if (countPerPage == null || countPerPage == undefined) {
        countPerPage = 20;
    }
    var options = {
        currentPage: 1,
        //計算總頁數
        totalPages: posts.length % countPerPage == 0 ? posts.length / countPerPage : parseInt(posts.length / countPerPage) + 1,
        onPageClicked: function (e, originalEvent, type, newPage) {
            //获取第N页的threads
            var currentThreads = getCurrentPageThreads(allKeys, newPage, countPerPage);
            //同步获取评论数据
            getDuoShuoData(posts, currentThreads, newPage, countPerPage);
        }
    }
    if (tagName != null && tagName != undefined ) {
        if (options.currentPage == 1) {
            //获取第一页的threads
            var currentThreads = getCurrentPageThreads(allKeys, 1, countPerPage);
            getDuoShuoData(posts, currentThreads, 1, countPerPage);
        }
    }
    $('#page-selection').bootstrapPaginator(options);

}

function pageselectCallback(posts, duoshuo, currentPage, countPerPage) {
    var newcontent = "";
    if (currentPage == "" || parseInt(currentPage) <= 0) {
        currentPage = 1;
    }
    var start = (currentPage - 1 ) * countPerPage;
    var max_elem = Math.min((currentPage + 1) * countPerPage, posts.length);
    var position = 0;
    var rows = posts.length - start < countPerPage ? posts.length - start : countPerPage;
    for (var i = start; i < max_elem; i++) {
        //获取多说评论数
        var comments = "";
        if ( duoshuo != null && duoshuo[posts[i].UUID] != undefined && duoshuo[posts[i].UUID].comments != undefined ) {
            comments = duoshuo[posts[i].UUID].comments > 0 ? duoshuo[posts[i].UUID].comments + " 条评论" : "暂无评论";
        } else {
            comments = "暂无评论";
        }
        newcontent += "
";
        newcontent += "

" + posts[i].title + "

";
        newcontent += "
";
        newcontent += "
"; //span3 start
        /**
         if (posts[i].images.length > 1) {
            newcontent += "

";
            for (var j = 0; j < posts[i].images.length; j ++) {
                newcontent += "

";
            }
            newcontent += "

";
        } else {
            newcontent += "
";
            if (posts[i].images.length > 0) {
                newcontent += "";
            } else {
                newcontent += "
"+posts[i].description+"
";
            }
            newcontent += "
";
        }**/
        newcontent += "
";
        if (posts[i].images.length > 0) {
            newcontent += "";
        } else {
            newcontent += "
" + posts[i].description + "
";
        }
        newcontent += "
";

        newcontent += "
";//span3 end
        newcontent += "

"
        newcontent += "
" + posts[i].date + "
";
        newcontent += "
" + comments + "
";
        newcontent += "
";
        if (posts[i].tags.length > 0) {
            for (var t = 0; t < posts[i].tags.length; t++) {
                newcontent += "" + posts[i].tags[t] + " ";
            }
        }
        newcontent += "

";//ul end
        newcontent += "

";
        newcontent += "
" + posts[i].description + "
";
        newcontent += "<button class='btn btn-small btn-success' type='button'>Read more</button>";
        newcontent += "

";
        position++;
        if (position >= rows) {
            break;
        }
    }
    return newcontent;
}

function getTagParameter() {
    var urlItems = window.location.href.split("?");
    var params = "";
    if (urlItems != null && urlItems.length > 1) {
        params = urlItems[1];
        return params.split("=")[1];
    } else {
        return null;
    }

}

function isChinese(str) {
    var re = /[^\u4e00-\u9fa5]/;
    if (re.test(str)) return false;
    return true;
}


text:
Options

<?php foreach ($actions as $action): ?>
<?php
	if (isset($currentCat) && $currentCat != $action['cat']->get()) echo '
';
	if (!isset($currentCat) OR $currentCat != $action['cat']->get()) echo '

'.$action['cat']->get().'
';

	$currentCat = $action['cat']->get();
	$and = null;
?>

		<div class="wrapper" <?php if (isset($action['color'])): ?>style="background-color:#<?=$action['color']?>"<?php endif ?>>
			<a data-action="<?=$action['key']?>">
				<i data-feathericon="<?=$action['icon']->get()?>">
				<?=$action['title']?>

			<?php if (isset($action['andback']) && $action['andback']->get() === true) $and .= ''; ?>
			<?php if (isset($action['andreach']) && $action['andreach']->get() === true) $and .= ''; ?>
			<?php if (isset($action['andnew']) && $action['andnew']->get() === true) $and .= ''; ?>
			<?php if ($and) echo '
'.$and.'
'; ?>

<?php endforeach ?>


text:
package io.github.SimonXianyu.codefather.ui;

import io.github.SimonXianyu.codefather.model.EntityDef;

import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import java.awt.*;

/**
 * Use entity's name as node text
 * Created by simon on 2015/1/16.
 */
public class EntityTreeRender extends DefaultTreeCellRenderer {
    @Override
    public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
        super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
        if (value instanceof DefaultMutableTreeNode) {
            Object uobj = ((DefaultMutableTreeNode) value).getUserObject();
            if (uobj instanceof EntityDef){
                setText(((EntityDef) uobj).getName());
            }
        }

        return this;
    }
}


text:
package main

import (
	"fmt"
)

func init() {
	register("version", runVersion, `
usage: flynn version

Show flynn version string.
`)
}

func runVersion() {
	fmt.Println(Version)
}


text:
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery                                    |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify  |
// | it under the terms of the GNU General Public License as published by  |
// | the Free Software Foundation                                          |
// |                                                                       |
// | This program is distributed in the hope that it will be useful, but   |
// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+

/**
 * API method
 * Returns a list of tags
 * @param mixed[] $params
 *    @option bool sort_by_counter
 */
function ws_tags_getList($params, &$service)
{
  $tags = get_available_tags();
  if ($params['sort_by_counter'])
  {
    usort($tags, create_function('$a,$b', 'return -$a["counter"]+$b["counter"];') );
  }
  else
  {
    usort($tags, 'tag_alpha_compare');
  }

  for ($i=0; $i<count($tags); $i++)
  {
    $tags[$i]['id'] = (int)$tags[$i]['id'];
    $tags[$i]['counter'] = (int)$tags[$i]['counter'];
    $tags[$i]['url'] = make_index_url(
      array(
        'section'=>'tags',
        'tags'=>array($tags[$i])
        )
      );
  }

  return array(
    'tags' => new PwgNamedArray(
      $tags,
      'tag',
      ws_std_get_tag_xml_attributes()
      )
    );
}

/**
 * API method
 * Returns the list of tags as you can see them in administration
 * @param mixed[] $params
 *
 * Only admin can run this method and permissions are not taken into
 * account.
 */
function ws_tags_getAdminList($params, &$service)
{
  return array(
    'tags' => new PwgNamedArray(
      get_all_tags(),
      'tag',
      ws_std_get_tag_xml_attributes()
      )
    );
}

/**
 * API method
 * Returns a list of images for tags
 * @param mixed[] $params
 *    @option int[] tag_id (optional)
 *    @option string[] tag_url_name (optional)
 *    @option string[] tag_name (optional)
 *    @option bool tag_mode_and
 *    @option int per_page
 *    @option int page
 *    @option string order
 */
function ws_tags_getImages($params, &$service)
{
  // first build all the tag_ids we are interested in
  $tags = find_tags($params['tag_id'], $params['tag_url_name'], $params['tag_name']);
  $tags_by_id = array();
  foreach ($tags as $tag)
  {
    $tags['id'] = (int)$tag['id'];
    $tags_by_id[ $tag['id'] ] = $tag;
  }
  unset($tags);
  $tag_ids = array_keys($tags_by_id);

  $where_clauses = ws_std_image_sql_filter($params);
  if (!empty($where_clauses))
  {
    $where_clauses = implode(' AND ', $where_clauses);
  }

  $image_ids = get_image_ids_for_tags(
    $tag_ids,
    $params['tag_mode_and'] ? 'AND' : 'OR',
    $where_clauses,
    ws_std_image_sql_order($params)
    );

  $count_set = count($image_ids);
  $image_ids = array_slice($image_ids, $params['per_page']*$params['page'], $params['per_page'] );

  $image_tag_map = array();
  // build list of image ids with associated tags per image
  if (!empty($image_ids) and !$params['tag_mode_and'])
  {
    $query = '
SELECT image_id, GROUP_CONCAT(tag_id) AS tag_ids
  FROM '. IMAGE_TAG_TABLE .'
  WHERE tag_id IN ('. implode(',', $tag_ids) .')
    AND image_id IN ('. implode(',', $image_ids) .')
  GROUP BY image_id
;';
    $result = pwg_query($query);

    while ($row = pwg_db_fetch_assoc($result))
    {
      $row['image_id'] = (int)$row['image_id'];
      $image_ids[] = $row['image_id'];
      $image_tag_map[ $row['image_id'] ] = explode(',', $row['tag_ids']);
    }
  }

  $images = array();
  if (!empty($image_ids))
  {
    $rank_of = array_flip($image_ids);

    $query = '
SELECT *
  FROM '. IMAGES_TABLE .'
  WHERE id IN ('. implode(',',$image_ids) .')
;';
    $result = pwg_query($query);

    while ($row = pwg_db_fetch_assoc($result))
    {
      $image = array();
      $image['rank'] = $rank_of[ $row['id'] ];

      foreach (array('id', 'width', 'height', 'hit') as $k)
      {
        if (isset($row[$k]))
        {
          $image[$k] = (int)$row[$k];
        }
      }
      foreach (array('file', 'name', 'comment', 'date_creation', 'date_available') as $k)
      {
        $image[$k] = $row[$k];
      }
      $image = array_merge( $image, ws_std_get_urls($row) );

      $image_tag_ids = ($params['tag_mode_and']) ? $tag_ids : $image_tag_map[$image['id']];
      $image_tags = array();
      foreach ($image_tag_ids as $tag_id)
      {
        $url = make_index_url(
          array(
            'section'=>'tags',
            'tags'=> array($tags_by_id[$tag_id])
            )
          );
        $page_url = make_picture_url(
          array(
            'section'=>'tags',
            'tags'=> array($tags_by_id[$tag_id]),
            'image_id' => $row['id'],
            'image_file' => $row['file'],
            )
          );
        $image_tags[] = array(
          'id' => (int)$tag_id,
          'url' => $url,
          'page_url' => $page_url,
          );
      }

      $image['tags'] = new PwgNamedArray($image_tags, 'tag', ws_std_get_tag_xml_attributes() );
      $images[] = $image;
    }

    usort($images, 'rank_compare');
    unset($rank_of);
  }

  return array(
    'paging' => new PwgNamedStruct(
      array(
        'page' => $params['page'],
        'per_page' => $params['per_page'],
        'count' => count($images),
        'total_count' => $count_set,
        )
      ),
    'images' => new PwgNamedArray(
      $images,
      'image',
      ws_std_get_image_xml_attributes()
      )
    );
}

/**
 * API method
 * Adds a tag
 * @param mixed[] $params
 *    @option string name
 */
function ws_tags_add($params, &$service)
{
  include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');

  $creation_output = create_tag($params['name']);

  if (isset($creation_output['error']))
  {
    return new PwgError(500, $creation_output['error']);
  }

  return $creation_output;
}

?>


text:
// Copyright 2014 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.syntax;

import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.events.Location;

/**
 * The actual function registered in the environment. This function is defined in the
 * parsed code using {@link FunctionDefStatement}.
 */
public class UserDefinedFunction extends BaseFunction {

  private final ImmutableList<Statement> statements;
  private final SkylarkEnvironment definitionEnv;

  protected UserDefinedFunction(Identifier function,
      FunctionSignature.WithValues<Object, SkylarkType> signature,
      ImmutableList<Statement> statements, SkylarkEnvironment definitionEnv) {
    super(function.getName(), signature, function.getLocation());

    this.statements = statements;
    this.definitionEnv = definitionEnv;
  }

  public FunctionSignature.WithValues<Object, SkylarkType> getFunctionSignature() {
    return signature;
  }

  ImmutableList<Statement> getStatements() {
    return statements;
  }

  Location getLocation() {
    return location;
  }

  /**
   * Since the types of parameters of user defined functions are unknown, we just return
   * "name(parameterCount)"
   */
  @Override
  public String getShortSignature() {
    return String.format("%s(%d)", getName(), getArgArraySize());
  }

  @Override
  public Object call(Object[] arguments, FuncallExpression ast, Environment env)
      throws EvalException, InterruptedException {
    SkylarkEnvironment functionEnv = SkylarkEnvironment.createEnvironmentForFunctionCalling(
        env, definitionEnv, this);
    ImmutableList<String> names = signature.getSignature().getNames();

    // Registering the functions's arguments as variables in the local Environment
    int i = 0;
    for (String name : names) {
      functionEnv.update(name, arguments[i++]);
    }

    try {
      for (Statement stmt : statements) {
        stmt.exec(functionEnv);
      }
    } catch (ReturnStatement.ReturnException e) {
      return e.getValue();
    }
    return Environment.NONE;
  }
}


text:
package com.alibaba.rocketmq.broker.client;

import java.util.List;

import io.netty.channel.Channel;

/**
 * @author shijia.wxr<vintage.wang@gmail.com>
 * @since 2013-6-24
 */
public interface ConsumerIdsChangeListener {
    public void consumerIdsChanged(final String group, final List<Channel> channels);
}


text:
CREATE TABLE reddit_users (
  reddit_user_id serial NOT NULL,
  reddit_id character varying(10) NOT NULL,
  username character varying(20) NOT NULL,
  comment_karma integer NOT NULL,
  link_karma integer NOT NULL,
  over_18 smallint NOT NULL,
  has_gold smallint NOT NULL,
  is_employee smallint NOT NULL,
  reddit_created timestamp without time zone NOT NULL,
  updated timestamp without time zone NOT NULL,
  CONSTRAINT pk_ru_reddit_user_id PRIMARY KEY (reddit_user_id),
  CONSTRAINT uq_reddit_users_reddit_id UNIQUE (reddit_id)
);

ALTER SEQUENCE reddit_users_reddit_user_id_seq
RENAME TO reddit_users_seq;

CREATE INDEX idx_ru_username
ON reddit_users
USING btree (username);

CREATE INDEX idx_ru_updated
ON reddit_users (updated);

ALTER TABLE steam_users
ADD COLUMN reddit_user_id integer;

ALTER TABLE steam_users
ADD CONSTRAINT fk_steam_users_reddit_user_id FOREIGN KEY (reddit_user_id) REFERENCES reddit_users (reddit_user_id) ON UPDATE CASCADE ON DELETE SET NULL;

CREATE INDEX idx_su_reddit_user_id
ON steam_users
USING btree (reddit_user_id);

CREATE TABLE reddit_user_tokens (
  reddit_user_token_id serial NOT NULL,
  reddit_user_id integer NOT NULL,
  token text NOT NULL,
  refresh_token text NOT NULL,
  expires timestamp without time zone DEFAULT NULL,
  created timestamp without time zone NOT NULL,
  expired timestamp without time zone DEFAULT NULL,
  CONSTRAINT pk_rut_reddit_user_token_id PRIMARY KEY (reddit_user_token_id),
  CONSTRAINT uq_rut_reddit_user_id_token UNIQUE (reddit_user_id, token),
  CONSTRAINT fk_rut_reddit_user_id FOREIGN KEY (reddit_user_id) REFERENCES reddit_users (reddit_user_id) ON DELETE CASCADE ON UPDATE CASCADE
);

ALTER SEQUENCE reddit_user_tokens_reddit_user_token_id_seq
RENAME TO reddit_users_tokens_seq;

CREATE INDEX idx_tut_reddit_user_id
ON reddit_user_tokens
USING btree (reddit_user_id);

INSERT INTO cms_configuration_parameters(module_id, parameter_name, sort_order, parameter_data_type_id, display_name, has_value_list)
VALUES (2, 'reddit_client_id', 8, 1, 'Reddit Client ID', 0);

INSERT INTO cms_configuration_parameters(module_id, parameter_name, sort_order, parameter_data_type_id, display_name, has_value_list)
VALUES (2, 'reddit_client_secret', 9, 1, 'Reddit Client Secret', 0);


text:
en: Day Skipper
pl: sternik jachtowy
layout: dict_word
date: 2015-10-29
cat: sailor
---

Certyfikat kompetencji wydawany przez RYA. Najbliższym odpowiednikiem był obecny patent Sternika Morskiego w PZŻ.

Jest to pierwszy certyfikat dla osób prowadzących jacht samodzielnie. Można uzyskać na podstawie kursu. Certyfikat ten
wystawia się zarówno na wody pływowe jak i niepływowe w zależności od miejsca prowadzenia kursu i doświadczenia.
Wymagania teoretyczne sa podobne jak na [Coastal Skipper](/dict/c/coastal-skipper/), ale konieczny staż i wymagania
praktyczne są niższe.

Wbrew obiegowej opinii osoby posiadające ten certyfikat muszą mieć doświadczenie z prowadzenia jachtu nocą i mogą
samodzielnie pływać w nocy.

*zobacz też:*

* [certificate](/dict/c/certificate/)


text:
We need to go deeper.

DoubleGit is a tool which allows you to track the version history of the version history in a Git repository.  Wait, what?  Why?

The purpose of this tool is extremely specialized: it is used for creating a synthetic Git repository, and tracking that synthetic history as it changes over time.  The history must be linear.  No merging is supported.

## The use case

Suppose you are writing a programming tutorial.  The tutorial is accompanied by a git repository, showing the steps in the tutorial.  Then you realize that you want to change the code in step #1.  You could rewrite the history to reflect the tutorial, but you lose the real history.

This is solved with DoubleGit.  Use DoubleGit to check your repository into a repository, rewrite history in the inner repository, and then export the new history to the outer repository.

## Instructions

There are two commands: extract and rebuild.  **Warning: These commands are destructive!**

The extract command extracts the commit history from a Git repository in a way that it can be restored.  It will **DELETE** the output directory if it exists and recreate it.

    $ ls
    my-repo
    $ path/to/doublegit/run.sh extract my-repo my-repo-history

The restore command rebuilds a repository from the extracted version.  It will **DELETE** the output repository if it exists and recreate it.

    $ ls
    my-repo
    my-repo-history
    $ path/to/doublegit/run.sh rebuild my-repo-history my-repo-copy
    ...
    $ ls
    my-repo
    my-repo-history
    my-repo-copy

The SHA-1 hashes of the recreated repository should match those of the original repository.