text:
/* global edit_plugin */
//Add `edit` and `delete` controls for plugin placeholder inside text plugin
(function($){
    'use strict';
    $.fn.extend({
        getScreenPosition : function(ed){
            var parentWin = $(ed.getWin());

            return {
                top: this.get(0).offsetTop - parentWin.scrollTop(),
                left: this.get(0).offsetLeft - parentWin.scrollLeft()
            };
        }
    });

    function insertPluginControls(target, ed){
        if(!ed || !target){return;}

        var body = $(ed.getBody()),
            win = $(ed.getWin()),
            html = '',
            controls, edit, del;

        removePluginControls(ed);

        html += '
';
            html += '

';
            html += '

';
        html += '
';

        $(html).appendTo(body);
        controls = body.find('.plugin-controls');
        edit = controls.find('.edit');
        del = controls.find('.delete');

        controls.css(target.getScreenPosition(ed));
        controls.css({
            'width': target.width(),
            'height': target.height()
        });

        //placeholder image is too small to fit controls
        if(edit.outerWidth() + del.outerWidth() > target.width() ||
           edit.outerHeight() + del.outerHeight() > target.height()){
            controls.addClass('small');

            //even worse, the placeholedr is in the top left corner
            if(target.position().top < edit.outerHeight()){
                controls.addClass('top');
            }

            //in case the placeholder is too close to the right edge
            if(del.outerWidth() + del.offset().left > body.width()){
                controls.addClass('right');
            }
        }

        del.click(function(){
            target.remove();
            removePluginControls(ed);
        });

        edit.click(function(){
            var taget_id_arr = target.attr('id').split('_'),
                obj_id = taget_id_arr[taget_id_arr.length - 1];

            // `edit_plugin` should be provided globally but worth to check
            if(typeof window.edit_plugin === 'function'){
                edit_plugin(obj_id);
            }
        });

        win.bind('scroll.'+ed.editorId, function(){
            controls.css(target.getScreenPosition(ed));
        });

        $('body').bind('click.'+ed.editorId, function(){
            removePluginControls(ed);
        });

        //temporary disable editing
        ed.getBody().setAttribute('contenteditable', false);

    }

    function removePluginControls(ed){
        if(!ed){return;}

        //enable editing
        ed.getBody().setAttribute('contenteditable', true);
        $(ed.getBody()).find('.plugin-controls').remove();
        $(ed.getWin()).unbind('scroll.' + ed.editorId);
        $('body').unbind('click.' + ed.editorId);
    }

    tinymce.onAddEditor.add(function(mgr, ed){
        ed.onInit.add(function(ed){
            //append controls styles to editor iframe head
            $('#plugin-controls').appendTo($(ed.getDoc()).find('head'));
        });

        ed.onClick.add(function(ed, e){
            var targetId = e.target.id || '';

            if(targetId.match(/^plugin_obj_\d*$/)){
                insertPluginControls($(e.target), ed);
            }else{
                removePluginControls(ed);
            }
        });
    });

}(jQuery));


text:
import { translate } from '@waldur/i18n';
import { ResourceBreadcrumbsRegistry } from '@waldur/resource/breadcrumbs/ResourceBreadcrumbsRegistry';

ResourceBreadcrumbsRegistry.register('Rancher.Node', (resource) => {
  return [
    {
      label: resource.cluster_name,
      state: 'resource-details',
      params: {
        uuid: resource.project_uuid,
        resource_uuid: resource.cluster_uuid,
        resource_type: 'Rancher.Cluster',
      },
    },
    {
      label: translate('Nodes'),
      state: 'resource-details',
      params: {
        uuid: resource.project_uuid,
        resource_uuid: resource.cluster_uuid,
        resource_type: 'Rancher.Cluster',
        tab: 'nodes',
      },
    },
  ];
});

redpajama_set_name: RedPajamaGithub


text:
import importlib

def import_fn(fn_name):
    """
    Return python function object from the function name argument that's in the form of "module.func"
    """
    module_name, attribute = fn_name.rsplit('.', 1)
    module = importlib.import_module(module_name)
    return getattr(module, attribute)

def import_module(module_name):
    return importlib.import_module(module_name)


text:
package mbus

import (
	"sync"
	"time"

	"code.cloudfoundry.org/clock"
)

type MetricsRecorder struct {
	sync.RWMutex
	currentMax               time.Duration
	Clock                    clock.Clock
	registerMessagesReceived int
}

func NewMetricsRecorder(clock clock.Clock) *MetricsRecorder {
	return &MetricsRecorder{
		Clock: clock,
	}
}

func (r *MetricsRecorder) GetMaxSinceLastInterval() (float64, error) {
	r.Lock()
	duration := r.currentMax
	r.currentMax = 0
	r.Unlock()
	return float64(duration.Nanoseconds()) / float64(time.Millisecond), nil
}

func (r *MetricsRecorder) RecordMessageTransitTime(unixTimeNS int64) {
	if unixTimeNS == 0 {
		return
	}

	r.Lock()
	diff := r.Clock.Now().Sub(time.Unix(0, unixTimeNS))
	if diff > r.currentMax {
		r.currentMax = diff
	}
	r.Unlock()
}
func (r *MetricsRecorder) RecordRegisterMessageReceived() {
	r.registerMessagesReceived++
}
func (r *MetricsRecorder) GetRegisterMessagesReceived() (float64, error) {
	return float64(r.registerMessagesReceived), nil
}


text:
function [ vector] = MinMaxNorm( vector )
%MINMAXNORM Summary of this function goes here
%   Detailed explanation goes here
minimum = min(vector);
vector = vector - minimum;
maximum = max(vector);
vector ./ maximum;

end


text:
<?php

/**
 * This file is part of playSMS.
 *
 * playSMS 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, either version 3 of the License, or
 * (at your option) any later version.
 *
 * playSMS 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 playSMS. If not, see <http://www.gnu.org/licenses/>.
 */
defined('_SECURE_') or die('Forbidden');

// hook_sendsms
// called by main sms sender
// return true for success delivery
// $smsc : smsc
// $sms_sender : sender mobile number
// $sms_footer : sender sms footer or sms sender ID
// $sms_to : destination sms number
// $sms_msg : sms message tobe delivered
// $gpid : group phonebook id (optional)
// $uid : sender User ID
// $smslog_id : sms ID
function jasmin_hook_sendsms($smsc, $sms_sender, $sms_footer, $sms_to, $sms_msg, $uid = '', $gpid = 0, $smslog_id = 0, $sms_type = 'text', $unicode = 0) {
	global $plugin_config;

	_log("enter smsc:" . $smsc . " smslog_id:" . $smslog_id . " uid:" . $uid . " to:" . $sms_to, 3, "jasmin_hook_sendsms");

	// override plugin gateway configuration by smsc configuration
	$plugin_config = gateway_apply_smsc_config($smsc, $plugin_config);

	$sms_sender = stripslashes($sms_sender);
	if ($plugin_config['jasmin']['module_sender']) {
		$sms_sender = $plugin_config['jasmin']['module_sender'];
	}

	$sms_footer = stripslashes($sms_footer);
	$sms_msg = stripslashes($sms_msg);
	$ok = false;

	if ($sms_footer) {
		$sms_msg = $sms_msg . $sms_footer;
	}

	if ($sms_sender && $sms_to && $sms_msg) {

		$unicode_query_string = '';
		if ($unicode) {
			if (function_exists('mb_convert_encoding')) {
				// $sms_msg = mb_convert_encoding($sms_msg, "UCS-2BE", "auto");
				$sms_msg = mb_convert_encoding($sms_msg, "UCS-2", "auto");
				// $sms_msg = mb_convert_encoding($sms_msg, "UTF-8", "auto");
				$unicode_query_string = "&coding=8"; // added at the of query string if unicode
			}
		}

		$query_string = "username=" . $plugin_config['jasmin']['api_username'] . "&password=" . $plugin_config['jasmin']['api_password'] . "&to=" . urlencode($sms_to) . "&from=" . urlencode($sms_sender) . "&content=" . urlencode($sms_msg) . $unicode_query_string;
		$query_string .= "&dlr=yes&dlr-level=2&dlr-url=" . $plugin_config['jasmin']['callback_url'];
		$url = $plugin_config['jasmin']['url'] . "?" . $query_string;

		_log("send url:[" . $url . "]", 3, "jasmin_hook_sendsms");

		// new way
		$opts = array(
			'http' => array(
				'method' => 'POST',
				'header' => "Content-type: application/x-www-form-urlencoded\r\nContent-Length: " . strlen($query_string) . "\r\nConnection: close\r\n",
				'content' => $query_string
			)
		);
		$context = stream_context_create($opts);
		$resp = file_get_contents($plugin_config['jasmin']['url'], FALSE, $context);

		// Success "07033084-5cfd-4812-90a4-e4d24ffb6e3d"
		// Error "No route found"
		$resp = explode(' ', $resp, 2);

		if ($resp[0] == 'Success') {
			$c_message_id = $resp[1];
			$c_message_id = str_replace('"', '', $c_message_id);
			_log("sent smslog_id:" . $smslog_id . " message_id:" . $c_message_id . " smsc:" . $smsc, 2, "jasmin_hook_sendsms");
			$db_query = "
				INSERT INTO " . _DB_PREF_ . "_gatewayJasmin (local_smslog_id, remote_smslog_id)
				VALUES ('$smslog_id', '$c_message_id')";
			$id = @dba_insert_id($db_query);
			if ($id) {
				$ok = true;
				$p_status = 1;
				dlr($smslog_id, $uid, $p_status);
			}
		} else {
			// even when the response is not what we expected we still print it out for debug purposes
			if ($resp[0] == 'Error') {
				$resp = $resp[1];
				$resp = str_replace('"', '', $resp);
			} else {
				$resp = str_replace("\n", " ", $resp);
				$resp = str_replace("\r", " ", $resp);
			}
			_log("failed smslog_id:" . $smslog_id . " resp:[" . $resp . "] smsc:" . $smsc, 2, "jasmin_hook_sendsms");
		}
	}
	if (!$ok) {
		$p_status = 2;
		dlr($smslog_id, $uid, $p_status);
	}

	return $ok;
}


text:
Ticket priority <?php echo $button ?>

        <form action="<?php echo $action; ?>" method="post">

            Priority <?php echo form_error('priority') ?>
            <input type="text" class="form-control" name="priority" id="priority" placeholder="Priority" value="<?php echo $priority; ?>" />

            Priority Desc <?php echo form_error('priority_desc') ?>
            <input type="text" class="form-control" name="priority_desc" id="priority_desc" placeholder="Priority Desc" value="<?php echo $priority_desc; ?>" />

            Priority Color <?php echo form_error('priority_color') ?>
            <input type="text" class="form-control" name="priority_color" id="priority_color" placeholder="Priority Color" value="<?php echo $priority_color; ?>" />

            Priority Urgency <?php echo form_error('priority_urgency') ?>
            <input type="text" class="form-control" name="priority_urgency" id="priority_urgency" placeholder="Priority Urgency" value="<?php echo $priority_urgency; ?>" />

            Status <?php echo form_error('ispublic') ?>
            <input type="text" class="form-control" name="ispublic" id="ispublic" placeholder="Ispublic" value="<?php echo $ispublic; ?>" />

	    <input type="hidden" name="priority_id" value="<?php echo $priority_id; ?>" />
	    <button type="submit" class="btn btn-primary"><?php echo $button ?></button>
	    <a href="<?php echo site_url('ticket_priority') ?>" class="btn btn-default">Cancel
	</form>


text:
 Copyright ©2016  ITSILKROUTELLC. All Rights Reserved

                	 Contact


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hrms.admin;

import com.hrms.dbconnection.GetSQLConnection;
import com.hrms.queries.GetSQLQueryUpdate;
import com.hrms.utilities.ConvertionUtilities;
import com.vaadin.data.Item;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.ui.*;
import com.vaadin.ui.Button.ClickEvent;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author jet
 */
public class AdminApp extends VerticalLayout {

    GetSQLQueryUpdate queryUpdate = new GetSQLQueryUpdate();
    ConvertionUtilities conUtil = new ConvertionUtilities();
    Table userAccessTbl = new Table();

    public AdminApp() {
        setSpacing(false);
        setMargin(false);
        setSizeFull();
        setImmediate(true);

        userAccessTable();
        addComponent(userAccessTbl);
    }

    public final void userAccessTable(){
        GetSQLConnection getConnection = new GetSQLConnection();
        Connection conn = getConnection.connection();
        userAccessTbl.removeAllItems();
        userAccessTbl.setSizeFull();
        userAccessTbl.setImmediate(true);
        userAccessTbl.setSelectable(true);

        userAccessTbl.addContainerProperty("id", String.class, null);
        userAccessTbl.addContainerProperty("name", String.class, null);
        userAccessTbl.addContainerProperty("trade", String.class, null);
        userAccessTbl.addContainerProperty("branch", String.class, null);
        userAccessTbl.addContainerProperty("username", String.class, null);
        userAccessTbl.addContainerProperty("role", String.class, null);
        userAccessTbl.addContainerProperty("attendance", CheckBox.class, null);
        userAccessTbl.addContainerProperty("contributions", CheckBox.class, null);
        userAccessTbl.addContainerProperty("cash bond", CheckBox.class, null);
        userAccessTbl.addContainerProperty("advances", CheckBox.class, null);
        userAccessTbl.addContainerProperty("adjustment", CheckBox.class, null);
        userAccessTbl.addContainerProperty("salary", CheckBox.class, null);
        userAccessTbl.addContainerProperty("edit employee", CheckBox.class, null);
        userAccessTbl.addContainerProperty("add/edit events", CheckBox.class, null);
        userAccessTbl.addContainerProperty("adjust salary", CheckBox.class, null);

        userAccessTbl.setColumnAlignment("attendance", Table.ALIGN_CENTER);
        userAccessTbl.setColumnAlignment("contributions", Table.ALIGN_CENTER);
        userAccessTbl.setColumnAlignment("cash bond", Table.ALIGN_CENTER);
        userAccessTbl.setColumnAlignment("advances", Table.ALIGN_CENTER);
        userAccessTbl.setColumnAlignment("adjustment", Table.ALIGN_CENTER);
        userAccessTbl.setColumnAlignment("salary", Table.ALIGN_CENTER);
        userAccessTbl.setColumnAlignment("edit employee", Table.ALIGN_CENTER);
        userAccessTbl.setColumnAlignment("add/edit events", Table.ALIGN_CENTER);
        userAccessTbl.setColumnAlignment("adjust salary", Table.ALIGN_CENTER);

        try {
            int i = 0;
            Statement stmt = conn.createStatement();
            ResultSet rs = stmt.executeQuery("SELECT * FROM user_access_control");
            while(rs.next()){
                Object itemId = new Integer(i);

                final CheckBox attendance = new CheckBox();
                attendance.setValue(conUtil.convertStringToBoolean(rs.getString("attendance")));
                attendance.setData(itemId);
                attendance.setImmediate(true);
                attendance.addListener(new Property.ValueChangeListener() {

                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        Object itemId = attendance.getData();
                        Item item = userAccessTbl.getItem(itemId);

                        String id = item.getItemProperty("id").getValue().toString();
                        String userAccess = "attendance";
                        String value = event.getProperty().getValue().toString();
                        boolean resultValue = (Boolean) event.getProperty().getValue();
                        boolean result = queryUpdate.updateUserAccessControl(id, userAccess, value);
                        if(result == true){
                            if(resultValue == true){
                                getWindow().showNotification("Enable user to encode Attendance!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }else{
                                getWindow().showNotification("Disable user to encode Attendance!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }
                        }
                    }

                });

                final CheckBox contributions = new CheckBox();
                contributions.setValue(conUtil.convertStringToBoolean(rs.getString("contributions")));
                contributions.setData(itemId);
                contributions.setImmediate(true);
                contributions.addListener(new Property.ValueChangeListener() {

                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        Object itemId = contributions.getData();
                        Item item = userAccessTbl.getItem(itemId);

                        String id = item.getItemProperty("id").getValue().toString();
                        String userAccess = "contributions";
                        String value = event.getProperty().getValue().toString();
                        boolean resultValue = (Boolean) event.getProperty().getValue();
                        boolean result = queryUpdate.updateUserAccessControl(id, userAccess, value);
                        if(result == true){
                            if(resultValue == true){
                                getWindow().showNotification("Enable user to Edit/delete Contributions!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }else{
                                getWindow().showNotification("Disable user to Edit/delete Contributions!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }
                        }
                    }

                });

                final CheckBox cashBond = new CheckBox();
                cashBond.setValue(conUtil.convertStringToBoolean(rs.getString("cashBond")));
                cashBond.setData(itemId);
                cashBond.setImmediate(true);
                cashBond.addListener(new Property.ValueChangeListener() {

                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        Object itemId = cashBond.getData();
                        Item item = userAccessTbl.getItem(itemId);

                        String id = item.getItemProperty("id").getValue().toString();
                        String userAccess = "cashBond";
                        String value = event.getProperty().getValue().toString();
                        boolean resultValue = (Boolean) event.getProperty().getValue();
                        boolean result = queryUpdate.updateUserAccessControl(id, userAccess, value);
                        if(result == true){
                            if(resultValue == true){
                                getWindow().showNotification("Enable user to Add/Remove Cash Bond!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }else{
                                getWindow().showNotification("Disable user to Add/Remove Cash Bond!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }
                        }
                    }

                });

                final CheckBox advances = new CheckBox();
                advances.setValue(conUtil.convertStringToBoolean(rs.getString("advances")));
                advances.setData(itemId);
                advances.setImmediate(true);
                advances.addListener(new Property.ValueChangeListener() {

                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        Object itemId = advances.getData();
                        Item item = userAccessTbl.getItem(itemId);

                        String id = item.getItemProperty("id").getValue().toString();
                        String userAccess = "advances";
                        String value = event.getProperty().getValue().toString();
                        boolean resultValue = (Boolean) event.getProperty().getValue();
                        boolean result = queryUpdate.updateUserAccessControl(id, userAccess, value);
                        if(result == true){
                            if(resultValue == true){
                                getWindow().showNotification("Enable user to Add/Remove Advances!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }else{
                                getWindow().showNotification("Disable user to Add/Remove Advances!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }
                        }
                    }

                });

                final CheckBox adjustment = new CheckBox();
                adjustment.setValue(conUtil.convertStringToBoolean(rs.getString("adjustment")));
                adjustment.setData(itemId);
                adjustment.setImmediate(true);
                adjustment.addListener(new Property.ValueChangeListener() {

                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        Object itemId = adjustment.getData();
                        Item item = userAccessTbl.getItem(itemId);

                        String id = item.getItemProperty("id").getValue().toString();
                        String userAccess = "adjustment";
                        String value = event.getProperty().getValue().toString();
                        boolean resultValue = (Boolean) event.getProperty().getValue();
                        boolean result = queryUpdate.updateUserAccessControl(id, userAccess, value);
                        if(result == true){
                            if(resultValue == true){
                                getWindow().showNotification("Enable user to Add/Remove Adjustment!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }else{
                                getWindow().showNotification("Disable user to Add/Remove Adjustment!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }
                        }
                    }

                });

                final CheckBox salary = new CheckBox();
                salary.setValue(conUtil.convertStringToBoolean(rs.getString("salary")));
                salary.setData(itemId);
                salary.setImmediate(true);
                salary.addListener(new Property.ValueChangeListener() {

                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        Object itemId = salary.getData();
                        Item item = userAccessTbl.getItem(itemId);

                        String id = item.getItemProperty("id").getValue().toString();
                        String userAccess = "salary";
                        String value = event.getProperty().getValue().toString();
                        boolean resultValue = (Boolean) event.getProperty().getValue();
                        boolean result = queryUpdate.updateUserAccessControl(id, userAccess, value);
                        if(result == true){
                            if(resultValue == true){
                                getWindow().showNotification("Enable user to Remove Salary!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }else{
                                getWindow().showNotification("Disable user to Remove Salary!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }
                        }
                    }

                });

                final CheckBox editEmployeesInfo = new CheckBox();
                editEmployeesInfo.setValue(conUtil.convertStringToBoolean(rs.getString("editEmployeesInfo")));
                editEmployeesInfo.setData(itemId);
                editEmployeesInfo.setImmediate(true);
                editEmployeesInfo.addListener(new Property.ValueChangeListener() {

                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        Object itemId = editEmployeesInfo.getData();
                        Item item = userAccessTbl.getItem(itemId);

                        String id = item.getItemProperty("id").getValue().toString();
                        String userAccess = "editEmployeesInfo";
                        String value = event.getProperty().getValue().toString();
                        boolean resultValue = (Boolean) event.getProperty().getValue();
                        boolean result = queryUpdate.updateUserAccessControl(id, userAccess, value);
                        if(result == true){
                            if(resultValue == true){
                                getWindow().showNotification("Enable user to Remove Edit Employees Info!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }else{
                                getWindow().showNotification("Disable user to Remove Edit Employees Info!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }
                        }
                    }

                });

                final CheckBox addEvents = new CheckBox();
                addEvents.setValue(conUtil.convertStringToBoolean(rs.getString("addEvents")));
                addEvents.setData(itemId);
                addEvents.setImmediate(true);
                addEvents.addListener(new Property.ValueChangeListener() {

                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        Object itemId = addEvents.getData();
                        Item item = userAccessTbl.getItem(itemId);

                        String id = item.getItemProperty("id").getValue().toString();
                        String userAccess = "addEvents";
                        String value = event.getProperty().getValue().toString();
                        boolean resultValue = (Boolean) event.getProperty().getValue();
                        boolean result = queryUpdate.updateUserAccessControl(id, userAccess, value);
                        if(result == true){
                            if(resultValue == true){
                                getWindow().showNotification("Enable user to Add Events!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }else{
                                getWindow().showNotification("Disable user to Add Events!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }
                        }
                    }

                });

                final CheckBox adjustSalary = new CheckBox();
                adjustSalary.setValue(conUtil.convertStringToBoolean(rs.getString("adjustSalary")));
                adjustSalary.setData(itemId);
                adjustSalary.setImmediate(true);
                adjustSalary.addListener(new Property.ValueChangeListener() {

                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        Object itemId = addEvents.getData();
                        Item item = userAccessTbl.getItem(itemId);

                        String id = item.getItemProperty("id").getValue().toString();
                        String userAccess = "adjustSalary";
                        String value = event.getProperty().getValue().toString();
                        boolean resultValue = (Boolean) event.getProperty().getValue();
                        boolean result = queryUpdate.updateUserAccessControl(id, userAccess, value);
                        if(result == true){
                            if(resultValue == true){
                                getWindow().showNotification("Enable user to Adjust Salary!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }else{
                                getWindow().showNotification("Disable user to Adjust Salary!", Window.Notification.TYPE_TRAY_NOTIFICATION);
                            }
                        }
                    }

                });

                userAccessTbl.addItem(new Object[]{
                    rs.getString("uaId"),
                    rs.getString("name").toUpperCase(),
                    rs.getString("trade").toUpperCase(),
                    rs.getString("branch").toUpperCase(),
                    rs.getString("username"),
                    rs.getString("role"),
                    attendance,
                    contributions,
                    cashBond,
                    advances,
                    adjustment,
                    salary,
                    editEmployeesInfo,
                    addEvents,
                    adjustSalary
                }, new Integer(i));
                i++;
            }
            userAccessTbl.setPageLength(userAccessTbl.size());
        } catch (SQLException ex) {
            Logger.getLogger(AdminApp.class.getName()).log(Level.SEVERE, null, ex);
        }finally{
            try {
                if(conn != null || !conn.isClosed()){
                    conn.close();
                }
            } catch (SQLException ex) {
                Logger.getLogger(AdminApp.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

    }

}


text:
module PairSee
  VERSION = '0.1.6'.freeze
end


text:
typedef struct __coda_adj_matrix CodaAdjMatrix;

CodaAdjMatrix *coda_adj_matrix_new();

CodaAdjMatrix *coda_adj_matrix_new_with_flags(int directed);

#endif


text: export default obj => obj && typeof obj.then === 'function';


text:
package com.datalint.open.shared.xml;

import java.util.Arrays;
import java.util.List;

import com.datalint.open.shared.util.MathUtil;
import com.datalint.open.shared.xml.xml.XmlAttribute;
import com.datalint.open.shared.xml.xml.XmlElement;

public class XmlBuilder {
	public static XmlElement createXmlElement(String tagName, List<String> attributes) {
		return new XmlElement(tagName, createAttrExpressions(attributes));
	}

	public static XmlElement createXmlElement(String tagName, String... attributes) {
		return new XmlElement(tagName, createAttrExpressions(Arrays.asList(attributes)));
	}

	private static IXmlExpression[] createAttrExpressions(List<String> attributes) {
		assert MathUtil.isEven(attributes.size());

		IXmlExpression[] expressions = new IXmlExpression[attributes.size() >> 1];

		for (int i = 0, j = 0; i < expressions.length; i++, j++) {
			expressions[i] = new XmlAttribute(attributes.get(j++), attributes.get(j));
		}

		return expressions;
	}

	private XmlBuilder() {
	}
}


text:
package ws.michalski.velogen;

import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import org.apache.commons.lang.SystemUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.velocity.context.Context;

import ws.michalski.velogen.config.Configuration;
import ws.michalski.velogen.config.Plugin;
import ws.michalski.velogen.config.StaticClass;
import ws.michalski.velogen.exceptions.VeloGenCommandException;
import ws.michalski.velogen.exceptions.VeloGenException;
import ws.michalski.velogen.interfaces.VeloGenPlugin;

public class VeloGenManager {

	private Logger logger;

	private Configuration config 				= null;
	private VeloGenCmd veloCmd 					= null;
	private String command 						= null;
	private Map<String, VeloGenPlugin> plugins 	= null;

	public VeloGenManager(){
		super();

		logger = LogManager.getLogger();

		config = VeloGenConfig.getInstance().loadConfig();
		veloCmd = new VeloGenCmd();

		plugins = new HashMap<>();
		loadPlugis();

	}

	public VeloGenEngine getVelogenEngine(Properties properties) throws VeloGenException {

		VeloGenEngine engine = null;
		try {
			engine = new VeloGenEngine(properties);
		} catch (Exception e) {
			logger.error(e.getMessage());
			throw new VeloGenException(e.getMessage());
		}

		settingEngine(engine);

		return engine;
	}

	public VeloGenEngine getVelogenEngine() throws VeloGenException {

		VeloGenEngine engine = null;
		try {
			engine = new VeloGenEngine();
		} catch (Exception e) {
			logger.error(e.getMessage());
			throw new VeloGenException(e.getMessage());
		}

		settingEngine(engine);

		return engine;
	}

	private void settingEngine(VeloGenEngine engine) {
		Context context = engine.getVeloContext();

		// Lade statische Klassen
		loadStaticClass(context);
	}

	private void loadStaticClass(Context context) {

		for (StaticClass staticClass : config.getStaticClasses().getStaticClass()) {

			logger.debug("Loading Static-Class " + staticClass.getClazz() + " as " + staticClass.getKeyName());

			Class<?> staticCls;
			try {
				staticCls = Class.forName(staticClass.getClazz());
				context.put(staticClass.getKeyName(), staticCls);
			} catch (ClassNotFoundException e) {
				logger.fatal(e.getMessage());
				e.printStackTrace();
				System.exit(2);
			}
		}
	}

	public VeloGenCmd getCommands(String[] argv) throws VeloGenCommandException{
		try {
			veloCmd.parse(argv);
		} catch (com.beust.jcommander.ParameterException e) {
			logger.error("Command parse error: " + e.getMessage());
			throw new VeloGenCommandException("", e);
		}
		command = veloCmd.jc.getParsedCommand();
		return veloCmd;
	}

	public Map<String, Object> run(){
		if(command == null){
			// Kein Plugin sollte aufgerufen werden. Leeres Map wird geliefert.
			return new HashMap<>();
		}
		VeloGenPlugin plugin = plugins.get(command);
		Object param = plugin.getCommandParam();
		return plugin.run(param);

	}

	public void getUsage(){
		veloCmd.usage();
	}

	public void getUsage(String command){
		veloCmd.usage(command);
	}

	/**
	 * Plugins werden aus config geladen
	 */
	private void loadPlugis(){

		for (Plugin plugin : config.getPlugins().getPlugin()) {
			addPlugin(plugin);
		}
	}

	/**
	 * Plugin wird registriert
	 *
	 * @param plugin
	 */
	@SuppressWarnings("unchecked")
	public void addPlugin(Plugin plugin) {
		logger.debug("Loading Plugin " + plugin.getClazz() + " as " + plugin.getName());

		Class<? extends VeloGenPlugin> plugInCls;
		try {
			plugInCls = (Class<? extends VeloGenPlugin>) Class.forName(plugin.getClazz());
			VeloGenPlugin pi = plugInCls.newInstance();
			veloCmd.addCommand(plugin.getName(), pi.getCommandParam());

			plugins.put(plugin.getName(), pi);

		} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
			logger.fatal(e.getMessage());
			e.printStackTrace();
			System.exit(3);
		}
	}

	/**
	 * Liefert Output-Path für generierte Dateien
	 *
	 * 1. Es wird geprüft, ob Parameter -op gesetzt ist, sonst
	 * 2. wird geprüft, ob config diese Information enthält, sonst
	 * 3. wird Unterverzeichnis ./output genutzt.
	 *
	 *
	 * @return
	 */
	public String getOutputPath(){

		String outputPath = null;

		if(veloCmd.getCommonParam().getOutputPath() != null){
			outputPath = veloCmd.getCommonParam().getOutputPath();
		} else if(config.getOutputPath() != null){
			outputPath = config.getOutputPath();
		} else {
			outputPath = SystemUtils.USER_DIR
					+ SystemUtils.FILE_SEPARATOR
					+ "output";
		}

		Path path = Paths.get(outputPath);

		if(Files.notExists(path, LinkOption.NOFOLLOW_LINKS) ||
				! Files.isDirectory(path, LinkOption.NOFOLLOW_LINKS)){
			logger.error("Output path error");
			// TODO: Exception
		}

		if(logger.isDebugEnabled()){
			logger.debug("Path " + path.toAbsolutePath().normalize().toString());
		}

		return path.toAbsolutePath().normalize().toString();
	}

	public void writeOutputFile(String fileName, String content, boolean replace) throws VeloGenException{

		Path target = Paths.get(getOutputPath(), fileName);

		if(! replace &&
				Files.exists(target, LinkOption.NOFOLLOW_LINKS)){
			throw new VeloGenException(target.normalize().toString() + " exist. Use option -ov for overwrite.");
		}

		try (FileOutputStream fos = new FileOutputStream(target.toFile(), false)) {
			try (BufferedWriter bwr = new BufferedWriter(new OutputStreamWriter(fos))) {
				bwr.write(content);
				bwr.flush();
			}

			fos.flush();

		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public String getCommand() {
		return command;
	}

}


text:
app.controller('homeCtrl', ['$scope', '$http', '$location','$rootScope','$routeParams', function($scope, $http, $location, $rootScope, $routeParams){
	$scope.newUsers = function(userData){
		var genNum = Math.floor((Math.random()*9000000 ) + 999999) + Math.floor((Math.random()*9999 ) + 99);
		userData.userId = genNum;

		if(userData.password != userData.confirmPassword){
			$scope.errMsg = "password does not match!";
		}else{
			$http.post('/sign-up', userData).success(function(data){
				if(data === 'exist'){
					$scope.errMsg = "Username already used!";
				}else{
					if(data.role === "teacher"){
						$location.url('/' + "teacher");
					}else if(data.role === "student"){
						$location.url('/' + "student");
					}
					$scope.newUser = "";
					$scope.errMsg =false;
				}
			});
		}
	}
	//login
	$scope.login = function(user){
		$http.post('/login', user).success(function(data){
			if(data.loginErr){
				$scope.logErrMsg = data.loginErr;
			}else{
				$rootScope.currentUser = data;
				$scope.logErrMsg = false;

				$http.post('/login', user).success(function(data){
					$rootScope.currentUser = data;
					$routeParams.page = data.username;
					// console.log($routeParams.page);
					userRoutes = ["administrator","teacher","student"];
						for (var i = userRoutes.length - 1; i >= 0; i--) {

							if(data.role == userRoutes[i]){
								$location.url('/' + userRoutes[i]);
							}

						}
				});
				// $http.post('/login', user).success(function(data){
				// 	$rootScope.currentUser = data;
				// 	console.log(data);

				// 			if(data){
				// 				$location.url('/' + data.username);
				// 				console.log(data.username);
				// 			}

				// });
			}
		})
	}
}]);


text:
package org.dasein.cloud.compute;

import javax.annotation.Nonnull;

/**
 * The history of the price of Spot VMs for a specified datacenter and VM Product type.
 */
public class SpotPriceHistory {
    private String providerDataCenterId;
    private String productId;
    private SpotPrice[] priceHistory;

    /**
     * Creates a new instance of a Spot Price History Object.
     * @param providerDataCenterId the datacenter being queried
     * @param productId the product type being queried
     * @param priceHistory an array showing price history records of timestamp against price
     * @return
     */
    public static SpotPriceHistory getInstance(@Nonnull String providerDataCenterId, @Nonnull String productId, @Nonnull SpotPrice[] priceHistory){
        SpotPriceHistory sph = new SpotPriceHistory();
        sph.providerDataCenterId = providerDataCenterId;
        sph.productId = productId;
        sph.priceHistory = priceHistory;
        return sph;
    }

    public @Nonnull String getProviderDataCenterId(){
        return providerDataCenterId;
    }

    public @Nonnull String getProductId(){
        return productId;
    }

    public @Nonnull SpotPrice[] getPriceHistory(){
        return priceHistory;
    }
}


text:
/*===
{"key3":3,"key1":1}
{"key4":4,"key3":3,"key2":2}
===*/

/* Try an extremely sparse property list.
 *
 * The enumeration order requirement for processing the property list
 * is much stricter than the standard enumeration requirements.
 * E5.1 Section 15.12.3, main algorithm, step 4.b.ii:
 *
 *   "For each value v of a property of replacer that has an array
 *    index property name. The properties are enumerated in the
 *    ascending array index order of their names."
 *
 * This poses some difficulties for very sparse arrays:
 *
 *   - You can't enumerate the array efficiently by walking through
 *     each array index (consider an array with 2 elements, at indices
 *     0 and 999999999).  Also note that the "length" property plays
 *     no part in the specified algorithm, even though the PropertyList
 *     must be an Array (have internal class "Array").
 *
 *   - You can't use the default enumeration order; if the array part
 *     has been abandoned, there is no guarantee that array indexed
 *     properties are in correct order in the entry part.
 *
 *   - You could enumerate the keys and sort them, but this would be a
 *     relatively complex solution to a corner case problem.
 *
 * The current implementation enumerates array indexed properties using
 * the default enumeration order; this may now produce the wrong order
 * for sparse arrays (= no array part).
 *
 * As a side note, V8 seems to iterate over the index space one
 * by one.  This is VERY slow (but yields the correct order):
 *
 *   > var obj = { foo: 1, bar: 2, quux: 3 };
 *   > var arr = []; arr[1] = 'quux'; arr[100000000] = 'foo'; arr[500] = 'bar';
 *   > JSON.stringify(obj, arr)
 *   '{"quux":3,"bar":2,"foo":1}'
 */

function sparsePropertyListTest1() {
    var obj = { key1: 1, key2: 2, key3: 3, key4: 4, key5: 5 };

    var plist1 = [];
    var plist2 = [];

    // non-sparse array with gap
    plist1[0] = 'key3';
    plist1[2] = 'key1';
    print(JSON.stringify(obj, plist1));

    // correct order: key4, key3, key2
    // (don't make numbers very large, V8 spends a lot of time on this otherwise)
    plist2[1] = 'key4';
    plist2[9999999] = 'key2';   // this forces plist2 sparse
    plist2[1000000] = 'key3';   // this key now enumerates AFTER the previous one
    print(JSON.stringify(obj, plist2));
}

sparsePropertyListTest1();


text:
using SharpDebug.CodeGen.UserTypes;

namespace SharpDebug.CodeGen.TypeInstances
{
    /// <summary>
    /// Type instance that represents template type argument which is constant.
    /// Used when we know that the type is representing Generics Specialization.
    /// </summary>
    /// <seealso cref="TemplateTypeInstance" />
    internal class TemplateArgumentConstantTypeInstance : UserTypeInstance
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TemplateArgumentConstantTypeInstance"/> class.
        /// </summary>
        /// <param name="constant">The template type argument constant.</param>
        public TemplateArgumentConstantTypeInstance(TemplateArgumentConstantUserType constant)
            : base(constant)
        {
            Constant = constant;
        }

        /// <summary>
        /// Gets the template type argument constant.
        /// </summary>
        public TemplateArgumentConstantUserType Constant { get; private set; }
    }
}


text:
package org.hl7.fhir.instance.model.valuesets;

// Generated on Tue, Sep 1, 2015 19:08-0400 for FHIR v1.0.0

import org.hl7.fhir.instance.model.EnumFactory;

public class ConditionCategoryEnumFactory implements EnumFactory<ConditionCategory> {

  public ConditionCategory fromCode(String codeString) throws IllegalArgumentException {
    if (codeString == null || "".equals(codeString))
      return null;
    if ("complaint".equals(codeString))
      return ConditionCategory.COMPLAINT;
    if ("symptom".equals(codeString))
      return ConditionCategory.SYMPTOM;
    if ("finding".equals(codeString))
      return ConditionCategory.FINDING;
    if ("diagnosis".equals(codeString))
      return ConditionCategory.DIAGNOSIS;
    throw new IllegalArgumentException("Unknown ConditionCategory code '"+codeString+"'");
  }

  public String toCode(ConditionCategory code) {
    if (code == ConditionCategory.COMPLAINT)
      return "complaint";
    if (code == ConditionCategory.SYMPTOM)
      return "symptom";
    if (code == ConditionCategory.FINDING)
      return "finding";
    if (code == ConditionCategory.DIAGNOSIS)
      return "diagnosis";
    return "?";
  }

}


text:
package com.redhat.mvc;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.redhat.brms.service.api.StatelessDecisionService;

@Controller
@RequestMapping("/deploy")
public class DeployController {

	private static final Logger LOGGER = LoggerFactory.getLogger(DeployController.class);

	@Resource(name = "localDecisionService")
	private StatelessDecisionService localDecisionService;
	@Resource(name = "remoteDecisionService")
	private StatelessDecisionService remoteDecisionService;

	private boolean serviceInit;

	@RequestMapping(method = RequestMethod.GET)
	public String printHello(ModelMap model) {
		model.put("releaseidLocal", localDecisionService.getCurrentVersion());
		model.put("releaseidRemote", remoteDecisionService.getCurrentVersion());
		return "deploy";
	}

	@RequestMapping(value = "/{type}", method = RequestMethod.GET)
	public String deployRules(@PathVariable String type, @RequestParam String group, @RequestParam String artifact, @RequestParam String version, ModelMap model) {

		boolean success = false;
		if (type.equals("local")) {
			success = localDecisionService.createOrUpgradeRulesWithVersion(group, artifact, version);
		} else {
			success = remoteDecisionService.createOrUpgradeRulesWithVersion(group, artifact, version);
		}

		String releaseid = "";
		if (success) {
			releaseid = String.format("successfully upgraded to %s %s %s", group, artifact, version);
		} else {
			releaseid = "deployment failed, check your logs";
		}
		LOGGER.info(releaseid);
		model.put("releaseid", releaseid);

		return "ruledeploy";
	}
}


text:
require 'test_helper'

class LogsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @log = logs(:one)
  end

  test "should get index" do
    get logs_url
    assert_response :success
  end

  test "should get new" do
    get new_log_url
    assert_response :success
  end

  test "should create log" do
    assert_difference('Log.count') do
      post logs_url, params: { log: { messages: @log.messages } }
    end

    assert_redirected_to log_url(Log.last)
  end

  test "should show log" do
    get log_url(@log)
    assert_response :success
  end

  test "should get edit" do
    get edit_log_url(@log)
    assert_response :success
  end

  test "should update log" do
    patch log_url(@log), params: { log: { messages: @log.messages } }
    assert_redirected_to log_url(@log)
  end

  test "should destroy log" do
    assert_difference('Log.count', -1) do
      delete log_url(@log)
    end

    assert_redirected_to logs_url
  end
end


text:
<?php namespace ibrss;

use Illuminate\Auth\UserTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Auth\User as UserContract;
use Illuminate\Auth\Passwords\CanResetPasswordTrait;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

class User extends Model implements UserContract, CanResetPasswordContract {

	use UserTrait, CanResetPasswordTrait;

	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'users';

	/**
	 * The attributes excluded from the model's JSON form.
	 *
	 * @var array
	 */
	protected $hidden = ['password', 'remember_token'];

}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.09.09 at 01:22:27 PM CEST
//

package test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlIDREF;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.namespace.QName;

/**
 *
Java class for mlabeledtr.type complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="mlabeledtr.type">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <group ref="{http://www.w3.org/1998/Math/MathML}mlabeledtr.content" maxOccurs="unbounded"/>
 *       <attGroup ref="{http://www.w3.org/1998/Math/MathML}mlabeledtr.attlist"/>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "mlabeledtr.type", namespace = "http://www.w3.org/1998/Math/MathML", propOrder = {
    "mlabeledtrContent"
})
public class MlabeledtrType {

    @XmlElement(name = "mtd", required = true)
    protected List<MtdType> mlabeledtrContent;
    @XmlAttribute(name = "class")
    @XmlSchemaType(name = "NMTOKENS")
    protected List<String> clazz;
    @XmlAttribute
    protected String style;
    @XmlAttribute
    @XmlIDREF
    @XmlSchemaType(name = "IDREF")
    protected Object xref;
    @XmlAttribute
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    @XmlID
    @XmlSchemaType(name = "ID")
    protected String id;
    @XmlAttribute(namespace = "http://www.w3.org/1999/xlink")
    @XmlSchemaType(name = "anySimpleType")
    protected String href;
    @XmlAttribute
    protected String rowalign;
    @XmlAttribute
    protected String columnalign;
    @XmlAttribute
    protected String groupalign;
    @XmlAnyAttribute
    private Map<QName, String> otherAttributes = new HashMap<QName, String>();

    /**
     * Gets the value of the mlabeledtrContent property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the mlabeledtrContent property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getMlabeledtrContent().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link MtdType }
     *
     *
     */
    public List<MtdType> getMlabeledtrContent() {
        if (mlabeledtrContent == null) {
            mlabeledtrContent = new ArrayList<MtdType>();
        }
        return this.mlabeledtrContent;
    }

    /**
     * Gets the value of the clazz property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the clazz property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getClazz().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link String }
     *
     *
     */
    public List<String> getClazz() {
        if (clazz == null) {
            clazz = new ArrayList<String>();
        }
        return this.clazz;
    }

    /**
     * Gets the value of the style property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getStyle() {
        return style;
    }

    /**
     * Sets the value of the style property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setStyle(String value) {
        this.style = value;
    }

    /**
     * Gets the value of the xref property.
     *
     * @return
     *     possible object is
     *     {@link Object }
     *
     */
    public Object getXref() {
        return xref;
    }

    /**
     * Sets the value of the xref property.
     *
     * @param value
     *     allowed object is
     *     {@link Object }
     *
     */
    public void setXref(Object value) {
        this.xref = value;
    }

    /**
     * Gets the value of the id property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getId() {
        return id;
    }

    /**
     * Sets the value of the id property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setId(String value) {
        this.id = value;
    }

    /**
     * Gets the value of the href property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getHref() {
        return href;
    }

    /**
     * Sets the value of the href property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setHref(String value) {
        this.href = value;
    }

    /**
     * Gets the value of the rowalign property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getRowalign() {
        if (rowalign == null) {
            return "baseline";
        } else {
            return rowalign;
        }
    }

    /**
     * Sets the value of the rowalign property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setRowalign(String value) {
        this.rowalign = value;
    }

    /**
     * Gets the value of the columnalign property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getColumnalign() {
        if (columnalign == null) {
            return "center";
        } else {
            return columnalign;
        }
    }

    /**
     * Sets the value of the columnalign property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setColumnalign(String value) {
        this.columnalign = value;
    }

    /**
     * Gets the value of the groupalign property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getGroupalign() {
        return groupalign;
    }

    /**
     * Sets the value of the groupalign property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setGroupalign(String value) {
        this.groupalign = value;
    }

    /**
     * Gets a map that contains attributes that aren't bound to any typed property on this class.
     *
     *

     * the map is keyed by the name of the attribute and
     * the value is the string value of the attribute.
     *
     * the map returned by this method is live, and you can add new attribute
     * by updating the map directly. Because of this design, there's no setter.
     *
     *
     * @return
     *     always non-null
     */
    public Map<QName, String> getOtherAttributes() {
        return otherAttributes;
    }

}


text:
package org.sprintapi.api.uri;

public class Authority {

	private String registeredName;
	private String userinfo;
	private Host host;
	private Integer port;

	public Authority(String registeredName) {
		super();
		this.registeredName = registeredName;
		this.userinfo = null;
		this.host = null;
		this.port = null;
	}

	public Authority(Host host) {
		this(null, host, null);
	}

	public Authority(Host host, Integer port) {
		this(null, host, port);
	}

	public Authority(String userinfo, Host host, Integer port) {
		super();
		this.registeredName = null;
		this.userinfo = userinfo;
		this.host = host;
		this.port = port;
	}

	@Override
	public String toString() {
		if (registeredName != null) {
			return registeredName;
		}
		final StringBuilder builder = new StringBuilder();
		if (userinfo != null) {
			builder.append(userinfo);
			builder.append('@');
		}
		if (host != null) {
			builder.append(host.toString());
		}
		if (port != null) {
			builder.append(':');
			builder.append(port);
		}
		return builder.toString();
	}

	public boolean isServer() {
		return registeredName == null;
	}

	public boolean isRegistredName() {
		return registeredName != null;
	}

	public String getRegisteredName() {
		return registeredName;
	}

	public void setRegisteredName(String registeredName) {
		this.registeredName = registeredName;
	}

	public String getUserinfo() {
		return userinfo;
	}

	public void setUserinfo(String userinfo) {
		this.userinfo = userinfo;
	}

	public Host getHost() {
		return host;
	}

	public void setHost(Host host) {
		this.host = host;
	}

	public Integer getPort() {
		return port;
	}

	public void setPort(Integer port) {
		this.port = port;
	}
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace CarDealer.Web.Models.AccountModels
{
    public class ExternalLoginModel
    {
        [Required]
        [EmailAddress]
        public string Email { get; set; }
    }
}


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

namespace De.Osthus.Ambeth.Util
{
    public struct LockState
    {
        public int readLockCount, writeLockCount;
    }
}


text:
Arduino Turn Indicator
======================

This project is to connect an Arduino to the Flight Gear flight simulator
to create a turn indicator. The project uses and Arduino Uno with a servo,
led, resitor, and two potentiometers. The Servo controlls the airplane angle
and the led shows the failure flag based on the information read from the
flight simulator. The two potentiometers are used to adjust the level and
standard rate turn positions.

Circuit
-------

    V5 ---- [ POT ] ---- GND
               |
            Analog 0

    V5 ---- [ POT ] ---- GND
               |
            Analog 1

    V5 ---- [ R 330 ohm ] ---- [ LED ] ---- GND

    V5 ---- Servo PWR
    GND --- Servo GND
    Digital 9 ---- Servo Signal

Flight Gear
-----------

To have flight gear communicate with the arduino you must first copy the file
arduinofgturnindicator.xml to the Protocol directory of flight gear. After
that you must start flight gear with the following command line, adjusting the
COM port name appropriately for your system.

  --generic=serial,out,30,COM9,9600,arduinofgturnindicator

Note that on Windows that COM ports higher than 9 must be named as \\.\COM10 as
an example. On linux or Mac you will have to use the appropriate naming scheme
for your operating system.

Functionality
-------------

When the circuit starts up it will go into a test mode where the failure led
will illuminate and then the servo will move to several predefined positions.
After that it will return to level position and remain in failure mode until
Flight Gear starts to transmit data to the circuit.

The first pot can be used to adjust the wings level or no-turn position while
the second pot can be used to adjust the standard rate turn position.


text:
function floor(value) {
  //  discuss at: http://phpjs.org/functions/floor/
  // original by: Onno Marsman
  //   example 1: floor(8723321.4);
  //   returns 1: 8723321

  return Math.floor(value);
}


text:
cards
=====

A simple web app for hosting cards on


text:
require File.dirname(__FILE__) + '/../../spec_helper'
require 'date'

describe "DateTime#to_time" do
  it "needs to be reviewed for spec completeness"
end


text:
class SubBitmapPlotWnd : public CWnd , public TargetTestable
{
	DECLARE_DYNAMIC(SubBitmapPlotWnd)

public:
	struct WheelEvent { bool IsUp; };
	SoraDbgPlot::Event::Event<WheelEvent> EventWheel;

	struct ClickEvent { int x; int y; };
	SoraDbgPlot::Event::Event<ClickEvent> EventClicked;

	struct AddTargetEvent { void * obj; };
	SoraDbgPlot::Event::Event<AddTargetEvent> EventAddTarget;

	struct TestTargetParam { void * obj; };
	SoraDbgPlot::Strategy::Strategy<TestTargetParam, bool> StrategyTestTarget;

	struct HighLightEvent { bool highlight; };
	SoraDbgPlot::Event::Event<HighLightEvent> EventHighLight;

	SubBitmapPlotWnd();
	virtual ~SubBitmapPlotWnd();

protected:
	DECLARE_MESSAGE_MAP()

	afx_msg void OnPaint();
	afx_msg LRESULT OnApp(WPARAM wParam, LPARAM lParam);

public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void PostNcDestroy();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);

	void SetBitmap(Bitmap * bitmap);

private:
	Bitmap * bmp;

public:
	virtual bool TestTarget(void * obj);
	virtual void AddToTarget(void * obj);
	virtual void HighLight(bool highlight);
};


text:
<?php

namespace Orchestra\Support\Tests\Providers;

use Orchestra\Support\Providers\Concerns\PackageProvider;
use Orchestra\Support\Providers\ServiceProvider;
use Orchestra\Testbench\TestCase;

class ServiceProviderTest extends TestCase
{
    /** @test */
    public function instance_has_proper_signature()
    {
        $stub = new class($this->app) extends ServiceProvider {
            public function register()
            {
                //
            }
        };

        $this->assertContains(PackageProvider::class, class_uses_recursive(\get_class($stub)));
    }
}


text:
Build FAST on Windows {#building-on-windows}
===========================================
@tableofcontents

These instructions are for building FAST on Windows using Visual Studio.
If you only want to test and use FAST, please [download a release](https://github.com/smistad/FAST/releases) instead.

This is tested on Windows 10 with [Visual Studio 2019 Community Edition which can be downloaded for free.](https://www.visualstudio.com/downloads/)

Install requirements
-------------------------
1. Download and install these tools:
   - [Git](https://git-scm.com/download/win)
   - [CMake](https://www.cmake.org)
   - [Visual Studio Community 2019](https://visualstudio.microsoft.com/vs/community/). **Do not use older version than 2019.**

2. Install OpenCL and OpenGL.
   - OpenGL: Usually installed along with your graphics driver.
   - OpenCL: To install OpenCL on Windows, download an implementation depending on the CPU/GPU you have and want to use:
      - **NVIDIA** - Install [CUDA](https://developer.nvidia.com/cuda-downloads)
      - **Intel** - Install the [Intel OpenCL SDK](https://software.intel.com/content/www/us/en/develop/tools/opencl-sdk/choose-download.html)

3. FAST will download all other dependencies (Qt5, eigen, zlib, DCMTK, OpenVINO, tensorflow, +++) automatically. Note that some [optional requirements](@ref requirements) are needed for video streaming and GPU neural network inference, this can be installed later.

Clone and Configure
--------------------

@m_class{m-block m-warning}

@par Warning
    Don't put the FAST code in a path with spaces, this will currently break the build.

Clone the code using Git and configure the project using CMake:
```bash
git clone https://github.com/smistad/FAST.git
cd FAST
mkdir build
cd build
# Default cmake configuration. Options may be added like so:
# cmake.exe .. -DFAST_BUILD_TESTS=OFF -DFAST_BUILD_EXAMPLES=ON -DFAST_MODULE_TensorFlow=ON
cmake.exe ..
```
This will create a Visual Studio solution in your build folder.

FAST has several [optional modules](@ref build-modules) and build options. These are enabled using cmake options named FAST_MODULE_<Name> and FAST_BUILD_<Name>.
Here is a list of some options which might be useful:
* FAST_BUILD_TOOLS
* FAST_BUILD_EXAMPLES
* FAST_BUILD_TESTS
* FAST_BUILD_DOCS
* FAST_MODULE_TensorFlow
* FAST_MODULE_TensorRT
* FAST_MODULE_OpenVINO
* FAST_MODULE_Dicom
* FAST_MODULE_WholeSlideImaging
* FAST_MODULE_OpenIGTLink
* FAST_MODULE_Clarius
* FAST_MODULE_Python
* FAST_MODULE_HDF5
* FAST_MODULE_Plotting
* FAST_MODULE_RealSense

Compile
-----------------------
You can now compile FAST from Visual Studio by opening the FAST.sln file in the build folder
(Remember to select Release config) **OR** you can compile FAST from the command line:

```bash
cmake.exe --build . --config Release --target ALL_BUILD -j 8
```

Test
----------------------

To test that your build was successful, run the systemCheck application:

```bash
./bin/systemCheck.exe
```

This should display the FAST logo and some FAST+OpenCL information.

Troubleshoot
----------------------

Still stuck? Get help at [![Join the chat on Gitter](https://img.shields.io/gitter/room/smistad/fast?logo=gitter)](https://gitter.im/smistad/FAST)

Install
----------------------
Set CMAKE_INSTALL_PREFIX to where you want to install FAST on your drive.
Then run:

```bash
cmake.exe --build . --config Release --target INSTALL -j 8
```

Build Windows installer
--------------------------
To build a Windows executable installer run:

```bash
cmake.exe --build . --config Release --target package -j 8
```

Build the Python bindings (pyFAST)
-----------------------
@todo


text:
require 'mocha/ruby_version'
require 'mocha/central'
require 'mocha/mock'
require 'mocha/names'
require 'mocha/receivers'
require 'mocha/state_machine'
require 'mocha/logger'
require 'mocha/configuration'
require 'mocha/stubbing_error'
require 'mocha/expectation_error_factory'

module Mocha

  class Mockery

    class << self

      def instance
        @instance ||= new
      end

      def verify(*args)
        instance.verify(*args)
      end

      def teardown
        instance.teardown
      end

      def reset_instance
        @instance = nil
      end

    end

    def named_mock(name, &block)
      add_mock(Mock.new(self, Name.new(name), &block))
    end

    def unnamed_mock(&block)
      add_mock(Mock.new(self, &block))
    end

    def mock_impersonating(object, &block)
      add_mock(Mock.new(self, ImpersonatingName.new(object), ObjectReceiver.new(object), &block))
    end

    def mock_impersonating_any_instance_of(klass, &block)
      add_mock(Mock.new(self, ImpersonatingAnyInstanceName.new(klass), AnyInstanceReceiver.new(klass), &block))
    end

    def new_state_machine(name)
      add_state_machine(StateMachine.new(name))
    end

    def verify(assertion_counter = nil)
      unless mocks.all? { |mock| mock.__verified__?(assertion_counter) }
        message = "not all expectations were satisfied\n#{mocha_inspect}"
        if unsatisfied_expectations.empty?
          backtrace = caller
        else
          backtrace = unsatisfied_expectations[0].backtrace
        end
        raise ExpectationErrorFactory.build(message, backtrace)
      end
      expectations.each do |e|
        unless Mocha::Configuration.allow?(:stubbing_method_unnecessarily)
          unless e.used?
            on_stubbing_method_unnecessarily(e)
          end
        end
      end
    end

    def teardown
      stubba.unstub_all
      reset
    end

    def stubba
      @stubba ||= Central.new
    end

    def mocks
      @mocks ||= []
    end

    def state_machines
      @state_machines ||= []
    end

    def mocha_inspect
      message = ""
      message << "unsatisfied expectations:\n- #{unsatisfied_expectations.map { |e| e.mocha_inspect }.join("\n- ")}\n" unless unsatisfied_expectations.empty?
      message << "satisfied expectations:\n- #{satisfied_expectations.map { |e| e.mocha_inspect }.join("\n- ")}\n" unless satisfied_expectations.empty?
      message << "states:\n- #{state_machines.map { |sm| sm.mocha_inspect }.join("\n- ")}" unless state_machines.empty?
      message
    end

    def on_stubbing(object, method)
      method = PRE_RUBY_V19 ? method.to_s : method.to_sym
      unless Mocha::Configuration.allow?(:stubbing_non_existent_method)
        unless object.method_exists?(method, include_public_methods = true)
          on_stubbing_non_existent_method(object, method)
        end
      end
      unless Mocha::Configuration.allow?(:stubbing_non_public_method)
        if object.method_exists?(method, include_public_methods = false)
          on_stubbing_non_public_method(object, method)
        end
      end
      unless Mocha::Configuration.allow?(:stubbing_method_on_nil)
        if object.nil?
          on_stubbing_method_on_nil(object, method)
        end
      end
      unless Mocha::Configuration.allow?(:stubbing_method_on_non_mock_object)
        on_stubbing_method_on_non_mock_object(object, method)
      end
    end

    def on_stubbing_non_existent_method(object, method)
      if Mocha::Configuration.prevent?(:stubbing_non_existent_method)
        raise StubbingError.new("stubbing non-existent method: #{object.mocha_inspect}.#{method}", caller)
      end
      if Mocha::Configuration.warn_when?(:stubbing_non_existent_method)
        logger.warn "stubbing non-existent method: #{object.mocha_inspect}.#{method}"
      end
    end

    def on_stubbing_non_public_method(object, method)
      if Mocha::Configuration.prevent?(:stubbing_non_public_method)
        raise StubbingError.new("stubbing non-public method: #{object.mocha_inspect}.#{method}", caller)
      end
      if Mocha::Configuration.warn_when?(:stubbing_non_public_method)
        logger.warn "stubbing non-public method: #{object.mocha_inspect}.#{method}"
      end
    end

    def on_stubbing_method_on_nil(object, method)
      if Mocha::Configuration.prevent?(:stubbing_method_on_nil)
        raise StubbingError.new("stubbing method on nil: #{object.mocha_inspect}.#{method}", caller)
      end
      if Mocha::Configuration.warn_when?(:stubbing_method_on_nil)
        logger.warn "stubbing method on nil: #{object.mocha_inspect}.#{method}"
      end
    end

    def on_stubbing_method_on_non_mock_object(object, method)
      if Mocha::Configuration.prevent?(:stubbing_method_on_non_mock_object)
        raise StubbingError.new("stubbing method on non-mock object: #{object.mocha_inspect}.#{method}", caller)
      end
      if Mocha::Configuration.warn_when?(:stubbing_method_on_non_mock_object)
        logger.warn "stubbing method on non-mock object: #{object.mocha_inspect}.#{method}"
      end
    end

    def on_stubbing_method_unnecessarily(expectation)
      if Mocha::Configuration.prevent?(:stubbing_method_unnecessarily)
        raise StubbingError.new("stubbing method unnecessarily: #{expectation.method_signature}", expectation.backtrace)
      end
      if Mocha::Configuration.warn_when?(:stubbing_method_unnecessarily)
        logger.warn "stubbing method unnecessarily: #{expectation.method_signature}"
      end
    end

    attr_writer :logger

    def logger
      @logger ||= Logger.new($stderr)
    end

    private

    def expectations
      mocks.map { |mock| mock.__expectations__.to_a }.flatten
    end

    def unsatisfied_expectations
      expectations.reject { |e| e.verified? }
    end

    def satisfied_expectations
      expectations.select { |e| e.verified? }
    end

    def add_mock(mock)
      mocks << mock
      mock
    end

    def add_state_machine(state_machine)
      state_machines << state_machine
      state_machine
    end

    def reset
      @stubba = nil
      @mocks = nil
      @state_machines = nil
    end

  end

end


text:
Heart::Heart(const sf::Texture& texture) :
SwapEntity(texture)
{
    sprite.setSprite(6*16, 3*16, 0);

    hp = 1;
    maxHP = 5;
}

void Heart::updateCurrent(sf::Time dt, Context context)
{

}

void Heart::handleEventCurrent(const sf::Event& event, Context context)
{

}

void Heart::drawCurrent(sf::RenderTarget& target, sf::RenderStates states) const
{

}


text:
// Copyright 2016 Twitter. 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.twitter.heron.healthmgr.common;

/**
 * This exception is generated when desired state information is not found
 */
class InvalidStateException extends RuntimeException {
  private static final long serialVersionUID = 1649354922817533118L;

  InvalidStateException(String topologyName, String message) {
    super(String.format("%s, topology:%s", message, topologyName));
  }
}


text:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using ActiveCollabTracSync.Data.ActiveCollab;
using ActiveCollabTracSync.Data.Trac;
using ActiveCollabTracSync.Entities.ActiveCollab;
using ActiveCollabTracSync.Entities.Trac;
using ActiveCollabSDK.SDK;

namespace ActiveCollabTracSync
{
    ///
    ///
    ///
    class Program
    {
        /// Runs the program with the specified arguments.
        /// <param name="args">The arguments.</param>
        public static void Main(string[] args)
        {
            Client.url = "https://app.activecollab.com/" + ConfigurationManager.AppSettings["ActiveCollabCloudInstanceID"];
            Client.key = ConfigurationManager.AppSettings["ActiveCollabApiKey"];

            var groupingField = ConfigurationManager.AppSettings["TracFieldForActiveCollabTaskGrouping"];
            var projectName = ConfigurationManager.AppSettings["ActiveCollabProjectName"];
            var maxAttempts = GetMaxAttempts();

            Console.Write("Getting data for Active Collab project \"" + projectName + "\"...");

            Project project = null;
            var getProjectNameAttemptCount = 0;
            var getProjectNameAttemptSucceeded = false;

            while (!getProjectNameAttemptSucceeded)
            {
                try
                {
                    project = ProjectDA.Get(projectName);
                    Console.WriteLine("Complete!");
                    getProjectNameAttemptSucceeded = true;
                }
                catch
                {
                    if (getProjectNameAttemptCount < maxAttempts)
                    {
                        getProjectNameAttemptCount++;
                        Console.Write("Attempt " + getProjectNameAttemptCount + " failed...");
                    }
                    else
                    {
                        throw;
                    }
                }
            }

            if (args.Length > 0)
            {
                // If a ticket ID is given, only sync that ticket.
                SyncTicket(TicketDA.Get(args[0], groupingField), project);
            }
            else
            {
                Console.WriteLine("\nSynchronizing all open tickets in Trac to Active Collab...\n");

                var openTracTickets = TicketDA.GetAllOpen(groupingField);
                SyncTickets(openTracTickets, project);

                Console.WriteLine("\nSynchronizing tickets with open tasks in Active Collab"
                        + " but no open ticket in Trac...\n");

                Console.Write("Getting list of all tickets with open tasks in the Active Collab project...");

                var getTasksAttemptCount = 0;
                var getTasksAttemptSucceeded = false;
                List<Task> activeCollabProjectTasks = null;

                while (!getTasksAttemptSucceeded)
                {
                    try
                    {
                        activeCollabProjectTasks = ProjectDA.GetTasks(project.Id);
                        Console.WriteLine("Complete!");
                        getTasksAttemptSucceeded = true;
                    }
                    catch
                    {
                        if (getTasksAttemptCount < maxAttempts)
                        {
                            getTasksAttemptCount++;
                            Console.Write("Attempt " + getTasksAttemptCount + " failed...");
                        }
                        else
                        {
                            throw;
                        }
                    }
                }

                var tracTicketIdsFromActiveCollabTasks = new List<string>();
                foreach (var curTask in activeCollabProjectTasks)
                {
                    string curTracTicketId = GetTracTicketIdFromActiveCollabTaskName(curTask.Name);

                    if (curTracTicketId == null)
                    {
                        Console.Write("Completing task for ticket #" + curTracTicketId + "...");

                        var completeAttemptCount = 0;
                        var completeAttemptSucceeded = false;

                        while (!completeAttemptSucceeded)
                        {
                            try
                            {
                                TaskDA.Complete(curTask.Id);
                                Console.WriteLine("Complete!");
                                completeAttemptSucceeded = true;
                            }
                            catch
                            {
                                if (completeAttemptCount < maxAttempts)
                                {
                                    completeAttemptCount++;
                                    Console.Write("Attempt " + completeAttemptCount + " failed...");
                                }
                                else
                                {
                                    throw;
                                }
                            }
                        }
                    }
                    else
                    {
                        tracTicketIdsFromActiveCollabTasks.Add(curTracTicketId);
                    }
                }

                Console.Write("\nRemoving tickets that have already been synchronized from the list...");

                tracTicketIdsFromActiveCollabTasks.RemoveAll(
                        ticketId => openTracTickets.Select(
                            ticket => ticket.Id
                        ).Contains(ticketId));

                Console.WriteLine("Complete!");

                SyncTickets(TicketDA.GetFromList(tracTicketIdsFromActiveCollabTasks, groupingField), project);

                Console.WriteLine("\nSync process complete!");
            }
        }

        ///
        /// Gets the name of the Trac ticket identifier from the Active Collab task.
        ///
        /// <param name="activeCollabTaskName">Name of the Active Collab task.</param>
        /// <returns></returns>
        private static string GetTracTicketIdFromActiveCollabTaskName(string activeCollabTaskName)
        {
            var dashIndex = activeCollabTaskName.IndexOf("-");

            if (dashIndex > 0)
            {
                var ticketNameSubstring = activeCollabTaskName.Substring(0, dashIndex);
                int ticketNumber;

                if (int.TryParse(ticketNameSubstring, out ticketNumber))
                {
                    return ticketNameSubstring;
                }
            }

            return null;
        }

        /// Synchronizes the ticket.
        /// <param name="tracTicket">The Trac ticket.</param>
        /// <param name="activeCollabProject">The Active Collab project.</param>
        private static void SyncTicket(Ticket tracTicket, Project activeCollabProject)
        {
            var users = Client.GetJson(Client.Get("users"));
            var activeCollabProjectTaskLists = ProjectDA.GetTaskLists(activeCollabProject.Id);
            var activeCollabProjectTasks = ProjectDA.GetTasks(activeCollabProject.Id);

            UpdateTicket(tracTicket, activeCollabProject, users,
                    activeCollabProjectTaskLists, activeCollabProjectTasks);
        }

        /// Synchronizes the tickets.
        /// <param name="tracTickets">The Trac tickets.</param>
        /// <param name="activeCollabProject">The Active Collab project.</param>
        private static void SyncTickets(List<Ticket> tracTickets, Project activeCollabProject)
        {
            var users = Client.GetJson(Client.Get("users"));
            var activeCollabProjectTaskLists = ProjectDA.GetTaskLists(activeCollabProject.Id);
            var activeCollabProjectTasks = ProjectDA.GetTasks(activeCollabProject.Id);

            foreach (var tracTicket in tracTickets)
            {
                UpdateTicket(tracTicket, activeCollabProject, users,
                        activeCollabProjectTaskLists, activeCollabProjectTasks);
            }
        }

        /// Updates the ticket.
        /// <param name="tracTicket">The Trac ticket.</param>
        /// <param name="activeCollabProject">The Active Collab project.</param>
        /// <param name="users">The users.</param>
        /// <param name="activeCollabProjectTaskLists">The Active Collab project task lists.</param>
        /// <param name="activeCollabProjectTasks">The Active Collab project tasks.</param>
        private static void UpdateTicket(Ticket tracTicket, Project activeCollabProject,
        Dictionary<string, object> users, List<TaskList> activeCollabProjectTaskLists,
        List<Task> activeCollabProjectTasks)
        {
            Console.Write("Synchronizing ticket #" + tracTicket.Id + "...");

            string[] includedUserEmails = ConfigurationManager.AppSettings["IncludedUserEmails"].Split(',');
            var maxAttempts = GetMaxAttempts();

            var newActiveCollabTaskName = tracTicket.Id + "-" + tracTicket.Summary;
            var newActiveCollabTaskDescription = tracTicket.Description;
            var newActiveCollabTaskIsCompleted = tracTicket.Status == "closed";
            var newActiveCollabTaskLabels = new List<string>();

            newActiveCollabTaskLabels.Add(tracTicket.Status.ToUpper());
            newActiveCollabTaskLabels.Add(tracTicket.Type.ToUpper());

            string assigneeId = "";

            if (includedUserEmails.Count() == 0 || includedUserEmails.Contains(tracTicket.Owner))
            {
                foreach (Dictionary<string, object> curUser in users.Values)
                {
                    if (curUser["email"].ToString() == tracTicket.Owner)
                    {
                        assigneeId = curUser["id"].ToString();
                        break;
                    }
                }
            }

            string taskListId = null;

            foreach (var curTaskList in activeCollabProjectTaskLists)
            {
                if (curTaskList.Name == tracTicket.Group)
                {
                    taskListId = curTaskList.Id;
                    break;
                }
            }

            if (taskListId == null)
            {
                taskListId = TaskListDA.Create(tracTicket.Group, activeCollabProject.Id);
                activeCollabProjectTaskLists.Add(new TaskList(taskListId, tracTicket.Group));
            }

            foreach (Entities.ActiveCollab.Task curActiveCollabProjectTask
                    in activeCollabProjectTasks)
            {
                if (GetTracTicketIdFromActiveCollabTaskName(curActiveCollabProjectTask.Name)
                        == tracTicket.Id)
                {
                    var updateAttemptCount = 0;
                    var updateAttemptSucceeded = false;

                    while (!updateAttemptSucceeded)
                    {
                        try
                        {
                            TaskDA.Update(curActiveCollabProjectTask.Id, newActiveCollabTaskName,
                                    newActiveCollabTaskDescription, activeCollabProject.Id,
                                    newActiveCollabTaskIsCompleted, taskListId, assigneeId,
                                    newActiveCollabTaskLabels);
                            Console.WriteLine("Complete!");
                            updateAttemptSucceeded = true;
                        }
                        catch
                        {
                            if (updateAttemptCount < maxAttempts)
                            {
                                updateAttemptCount++;
                                Console.Write("Attempt " + updateAttemptCount + " failed...");
                            }
                            else
                            {
                                throw;
                            }
                        }
                    }

                    return;
                }
            }

            var createAttemptCount = 0;
            var createAttemptSucceeded = false;

            while (!createAttemptSucceeded)
            {
                try
                {
                    TaskDA.Create(newActiveCollabTaskName, newActiveCollabTaskDescription,
                            activeCollabProject.Id, newActiveCollabTaskIsCompleted, taskListId,
                            assigneeId, newActiveCollabTaskLabels);
                    Console.WriteLine("Complete!");
                    createAttemptSucceeded = true;
                }
                catch
                {
                    if (createAttemptCount < maxAttempts)
                    {
                        createAttemptCount++;
                        Console.Write("Attempt " + createAttemptCount + " failed...");
                    }
                    else
                    {
                        throw;
                    }
                }
            }
        }

        /// Gets the maximum attempts.
        /// <returns></returns>
        private static int GetMaxAttempts()
        {
            int maxAttempts;

            if (!int.TryParse(ConfigurationManager.AppSettings["MaxAttempts"], out maxAttempts)
                    || maxAttempts <= 0)
            {
                maxAttempts = 1;
            }

            return maxAttempts;
        }
    }
}


text:
require 'ecloud/spec_helper'

if Fog.mocking?
  describe "Fog::Ecloud::Compute::BackupInternetService", :type => :mock_tmrk_ecloud_model do
    subject { @vcloud.vdcs[0].backup_internet_services[0] }

    describe :class do
      subject { Fog::Ecloud::Compute::BackupInternetService }

      it { should have_identity(:href) }
      it { should have_only_these_attributes([:href, :name, :id, :protocol, :enabled, :description, :timeout, :redirect_url, :monitor]) }
    end

    context "with no uri" do

      subject { Fog::Ecloud::Compute::BackupInternetService.new() }
      it { should have_all_attributes_be_nil }

    end

    context "as a collection member" do
      subject { @vcloud.vdcs[0].backup_internet_services[0].reload }

      let(:composed_service_data) { @vcloud.vdcs[0].backup_internet_services[0].send(:_compose_service_data) }

      it { should be_an_instance_of(Fog::Ecloud::Compute::BackupInternetService) }

      its(:href)                  { should == @mock_backup_service.href }
      its(:identity)              { should == @mock_backup_service.href }
      its(:name)                  { should == @mock_backup_service.name }
      its(:id)                    { should == @mock_backup_service.object_id.to_s }
      its(:protocol)              { should == @mock_backup_service.protocol }
      its(:enabled)               { should == @mock_backup_service.enabled.to_s }
      its(:description)           { should == @mock_backup_service.description }
      its(:timeout)               { should == @mock_backup_service.timeout.to_s }
      its(:redirect_url)          { should == (@mock_backup_service.redirect_url || "") }
      its(:monitor)               { should == nil }

      specify { composed_service_data[:href].should == subject.href.to_s }
      specify { composed_service_data[:name].should == subject.name }
      specify { composed_service_data[:id].should == subject.id.to_s }
      specify { composed_service_data[:protocol].should == subject.protocol }
      specify { composed_service_data[:enabled].should == subject.enabled.to_s }
      specify { composed_service_data[:description].should == subject.description }
      specify { composed_service_data[:timeout].should == subject.timeout.to_s }
    end
  end
end


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <title>
      hybrids - a framework for the web with unique declarative and functional
      architecture
    </title>
    <meta
      name="description"
      content="A JavaScript framework for creating fully-featured web
    applications, components libraries, and single web components with
    unique declarative and functional architecture"
    />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link
      rel="stylesheet"
      media="(prefers-color-scheme: dark)"
      href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css"
    />
    <link
      rel="stylesheet"
      media="(prefers-color-scheme: light)"
      href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css"
    />
    <link
      rel="stylesheet"
      media="(prefers-color-scheme: dark)"
      href="/assets/prism-dark.css"
    />
    <link
      rel="stylesheet"
      media="(prefers-color-scheme: light)"
      href="/assets/prism-light.css"
    />
    <link rel="stylesheet" href="/assets/styles.css" />
    <link rel="icon" type="image/svg+xml" href="/assets/hybrids-logo.svg" />


text:
class CreateProducts < ActiveRecord::Migration
  def self.up
    create_table :products do |t|
      t.decimal :price, :precision => 20, :scale => 2
      t.string :name
      t.references :company
      t.timestamps
    end
  end

  def self.down
    drop_table :products
  end
end


text:
package org.flamering.sample.chat.room.message;

import com.fasterxml.jackson.annotation.JsonProperty;

public class CreateRoomRequest {

	private String messageName = "CreateRoomRequest";

	private String userName = "";

	private String userToken = "";

	private String roomName = "";

	@JsonProperty("msg")
	public String getMessageName() {
		return messageName;
	}
	@JsonProperty("msg")
	public void setMessageName(String messageName) {
		this.messageName = messageName;
	}

	@JsonProperty("user_name")
	public String getUserName() {
		return userName;
	}
	@JsonProperty("user_name")
	public void setUserName(String userName) {
		this.userName = userName;
	}

	@JsonProperty("user_token")
	public String getUserToken() {
		return userToken;
	}
	@JsonProperty("user_token")
	public void setUserToken(String userToken) {
		this.userToken = userToken;
	}

	@JsonProperty("room_name")
	public String getRoomName() {
		return roomName;
	}
	@JsonProperty("room_name")
	public void setRoomName(String roomName) {
		this.roomName = roomName;
	}

}


text:
package com.amazonaws.services.guardduty.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.guardduty.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * FilterConditionMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class FilterConditionMarshaller {

    private static final MarshallingInfo<String> EQUALSVALUE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("equalsValue").build();
    private static final MarshallingInfo<Long> GREATERTHAN_BINDING = MarshallingInfo.builder(MarshallingType.LONG).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("greaterThan").build();
    private static final MarshallingInfo<Long> LESSTHAN_BINDING = MarshallingInfo.builder(MarshallingType.LONG).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("lessThan").build();

    private static final FilterConditionMarshaller instance = new FilterConditionMarshaller();

    public static FilterConditionMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(FilterCondition filterCondition, ProtocolMarshaller protocolMarshaller) {

        if (filterCondition == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(filterCondition.getEqualsValue(), EQUALSVALUE_BINDING);
            protocolMarshaller.marshall(filterCondition.getGreaterThan(), GREATERTHAN_BINDING);
            protocolMarshaller.marshall(filterCondition.getLessThan(), LESSTHAN_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
class Comment < ActiveRecord::Base
  belongs_to :article
  validates_presence_of :author, message: '請填寫推文者'
  validates_presence_of :article_id, message: '必須屬於一篇文章'
end