text:
These are Phonegap plugins that expose the same JS API as Twilio Client for web as much as possible, meaning you should be able to use the same Twilio Client code from your web application inside of your Phonegap application with few if any modifications.

# Latest versions tested with this plugin
#### (as of September 4, 2015)
- Cordova 4.3.0
- Twilio Client for iOS 1.2.3
- Twilio Client for Android 1.2.6
- XCode 6.4
- Android SDK 21

# Example application
https://github.com/jefflinwood/TwilioClientPhoneGapExampleApp

# PhoneGap/Cordova Overview

- Install the most recent version of Cordova (as of this writing, 4.3.0) tools  - http://http://cordova.apache.org/
- Install plugman - https://github.com/apache/cordova-plugman

# Both Platforms at once

##Instructions
```
cordova plugin add  https://github.com/jefflinwood/twilio_client_phonegap.git
```

# iOS only

##Instructions

```
 plugman install --platform ios --project platforms/ios --plugin https://github.com/jefflinwood/twilio_client_phonegap.git

```

- After installing the Twilio Client plugin, you will need to download and install the Twilio Client SDK for iOS - follow the directions provided after plugman finishes.

# Android only

## Instructions

```
plugman install --platform android --project platforms/android --plugin https://github.com/jefflinwood/twilio_client_phonegap.git

```

- After installing the Twilio Client plugin, you will need to download and install the Twilio Client SDK for Android - follow the directions provided after plugman finishes. Be sure to include all of the library files, or your app will crash after receiving a call.

## Additional Features

In addition to the standard features of the Twilio Client JS Library, you can also use the included showNotification and cancelNotification functions to display a UILocalNotifcation to the user when during an incoming call while the app is running in the background:

```javascript
Twilio.Connection.showNotification("Notification Text", "notification_sound.wav");
```

```javascript
Twilio.Connection.cancelNotification();
```

You can also turn the device's speaker phone on or off during a call using the following method:

```javascript
Twilio.Connection.setSpeaker("on");
```

## Limitations

This is plugin is a first cut and should be considered alpha. Please use it and break it :) Report any issues using the Github issue tracker.

Some of the event handlers are currently no-ops because of differences between the web SDK and the iOS SDK, i.e. they both expose events the other does not, e.g. Twilio.Device.cancel is a no-op and there is no JS SDK notion of `-(void)deviceDidStartListeningForIncomingConnections:(TCDevice*)device`, etc.

Twilio.Connection objects are just proxy objects that delegate to the Objective-C layer.

Sounds are currently disabled and the JS methods that control them are no-ops because enabling them causes `EXC_BAD_ACCESS` errors. Will fix.

Methods that interrogate the client device or connection and return a result e.g. `Twilio.Device.status()` take a callback function with the response as the argument. Unfortunately I think this is unavoidable due to communication between the Phonegap JS and iOS layers being strictly asynchronous, e.g.

```javascript
Twilio.Device.connect(function(connection) {
    alert(connection.status());
})
```

becomes:

```javascript
Twilio.Device.connect(function(connection) {
    connection.status(function(status) { alert(status) });
})
```

Twilio Client documentation: http://www.twilio.com/docs/client/twilio-js


text:
import React, { Component } from 'react';
import { Route, Redirect } from 'react-router';
import firebase from 'firebase';
import { signIn, signOut, auth } from '../firebase';

class Login extends Component {
	constructor() {
		super();
		this.state = {
			username: '',
		};
	}

	login() {
		const { storeLoggedInUserData } = this.props;

		signIn().then(response => {
			const userData = Object.assign(
				{},
				{ displayName: response.user.displayName },
				{ userName: this.state.username },
				{ photo: response.user.photoURL },
				{ location: response.additionalUserInfo.profile.location.name }
			);
			storeLoggedInUserData(userData);
		});

		auth.onAuthStateChanged(user => {
			this.setState({
				user,
			});
		});
	}

	render() {
		const logoSrc = 'assets/Logo.png';
		const connectMe = 'assets/ConnectME.png';
		const loginLogout = this.props.loginUserExists
			? () => {
				signOut();
			}
			: () => {
				this.login();
			};
		const loginLogoutText = this.props.loginUserExists ? 'Logout' : 'Login';
		const isDisabled = !this.state.username;

		if (this.state.user) {
			return <Redirect to="/" />;
		}

		return (
			<form
				onSubmit={e => {
					e.preventDefault();
					loginLogout();
				}}
			>

Username:

					<input
						className="username-input"
						type="text"
						placeholder="Select A Username"
						onChange={e => {
							this.setState({ username: e.target.value });
						}}
					/>

				<input className="login-btn" type="submit" value={loginLogoutText} disabled={isDisabled} />
			</form>
		);
	}
}

export default Login;

redpajama_set_name: RedPajamaGithub


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Shipping extends CI_Controller {

    function __construct() {
        parent::__construct();
        $this->load->database();
        $this->load->model('customers_model', "Customer");
        $this->load->model('users_model', "Users");
        $this->load->model('shipping_model', "Shipping");
        if ($this->Users->auth_check() == false) {
            redirect('/login');
        }
        if($this->session->userdata['marbel_user']['type']!='admin'){
            redirect('logout');
        }

    }

    public function index() {

        $this->data['page'] = 'Shipping';
        $this->data['title'] = 'Shipping';
        $this->load->template('admin/shipping/shipping', $this->data);
    }

    public function get_shipping() {
        $sLimit = "";
        $lenght = 50;
        $str_point = 0;

        $query = "select m_orders.id,m_users.first_name,m_users.last_name,m_orders.wheel_color,m_orders.wheel_size,m_orders.priority,m_users.last_activity,m_orders.order_status,m_orders.order_date,m_orders.est_ship_date,m_orders.country from m_orders left join m_users on m_users.id = m_orders.user_id where  m_orders.order_status != 'deposite' AND m_orders.order_status != 'hold' AND m_orders.order_status != 'refunded' AND m_orders.order_status != 'shipped' AND m_orders.est_ship_date > 0  ";

        $col_sort = array("m_orders.id", "m_users.first_name", "m_users.last_name", "m_orders.order_date", "m_orders.est_ship_date", "m_users.last_activity", "m_orders.order_status", "m_orders.wheel_color", "m_orders.wheel_size", "m_orders.priority", "m_orders.country");

        $order_by = "m_orders.id";
        $temp = 'asc';

        if (isset($_GET['sSearch']) && $_GET['sSearch'] != "") {
            $words = $_GET['sSearch'];

            if ($words == 'International') {
                $query .= " AND  m_orders.country != 'US' AND  m_orders.country != 'CA' ";
            } else if ($words == 'North America') {
                $query .= " AND  (m_orders.country = 'US' or  m_orders.country = 'CA') ";
            } else {
                $query .= "AND (`m_users`.`first_name` REGEXP '$words'
                           OR `m_users`.`last_name` REGEXP '$words'
                           OR `m_orders`.`order_status` REGEXP '$words'
                           OR `m_orders`.`wheel_size` REGEXP '$words'
                           OR `m_orders`.`country` REGEXP '$words'
                           OR `m_orders`.`wheel_color` REGEXP '$words')";
            }
        }

        if (isset($_GET['iSortCol_0'])) {
            $index = $_GET['iSortCol_0'];
            $temp = $_GET['sSortDir_0'] === 'asc' ? 'asc' : 'desc';
            $order_by = $col_sort[$index];
        }
        $query .= "ORDER BY " . $order_by . " " . $temp . " ";

        if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') {
            $str_point = intval($_GET['iDisplayStart']);
            $lenght = intval($_GET['iDisplayLength']);
            $query_res = $query . " LIMIT " . $str_point . "," . $lenght;
        } else {
            $query_res = $query;
        }
        $res = $this->db->query($query_res);
        $count_res = $this->db->query($query);
        $result = $res->result_array();
        $count_result = $count_res->result_array();
        $total_record = count($count_result);
        $output = array(
            "sEcho" => intval($_GET['sEcho']),
            "iTotalRecords" => $total_record,
            "iTotalDisplayRecords" => $total_record,
            "aaData" => array()
        );

//        $result = $records->result_array();

        $i = 0;
        $final = array();
        foreach ($result as $val) {

            $output['aaData'][] = array("DT_RowId" => $val['id'], $val['id'], ucwords($val['first_name']), ucwords($val['last_name']), date('M j, Y', $val['order_date']), date('M j, Y', $val['est_ship_date']), Date('M j, Y', $val['last_activity']), ucwords($val['order_status']), $val['wheel_color'], $val['wheel_size'], $val['priority'], $val['country'], ' ');
        }

        echo json_encode($output);
        die;
    }

}


text:
angular.module('images', [])
    .controller('ImagesController', ['$scope', 'Image', 'ViewSpinner', 'Messages',
        function ($scope, Image, ViewSpinner, Messages) {
            $scope.toggle = false;
            $scope.predicate = '-Created';

            $scope.showBuilder = function () {
                $('#build-modal').modal('show');
            };

            $scope.removeAction = function () {
                ViewSpinner.spin();
                var counter = 0;
                var complete = function () {
                    counter = counter - 1;
                    if (counter === 0) {
                        ViewSpinner.stop();
                    }
                };
                angular.forEach($scope.images, function (i) {
                    if (i.Checked) {
                        counter = counter + 1;
                        Image.remove({id: i.Id}, function (d) {
                            angular.forEach(d, function (resource) {
                                Messages.send("Image deleted", resource.Deleted);
                            });
                            var index = $scope.images.indexOf(i);
                            $scope.images.splice(index, 1);
                            complete();
                        }, function (e) {
                            Messages.error("Failure", e.data);
                            complete();
                        });
                    }
                });
            };

            $scope.toggleSelectAll = function () {
                angular.forEach($scope.images, function (i) {
                    i.Checked = $scope.toggle;
                });
            };

            ViewSpinner.spin();
            Image.query({}, function (d) {
                $scope.images = d.map(function (item) {
                    return new ImageViewModel(item);
                });
                ViewSpinner.stop();
            }, function (e) {
                Messages.error("Failure", e.data);
                ViewSpinner.stop();
            });
        }]);


text:
{% load staticfiles %}
<!DOCTYPE html>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta content="{{ csrf_token }}" name="csrf-token" />
    <link href='https://fonts.googleapis.com/css?family=Lato:400,100,100italic,300italic,300,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
    <link href="{% static 'lib/bootstrap/dist/css/bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'lib/mdi/css/materialdesignicons.min.css' %}" type="text/css" rel="stylesheet" />
    <link href="{% static 'lib/prettify-min/prettify.min.css' %}" type="text/css" rel="stylesheet" />
    <link href="{% static 'css/base.css' %}" type="text/css" rel="stylesheet" />
    {% block head %} {% endblock head %}
    <title>{% block title %}Adventures{% endblock title %}</title>

    {% block navbar %}

                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1" aria-expanded="false">
                    Toggle navigation

                </button>

 Home

                        {{ request.user.username }}

View Profile

Settings

LogOut

    {% endblock navbar %}
        {% block body %}

                {% block mobile-sidebar %}{% endblock mobile-sidebar %} {% block sidebar %} {% endblock sidebar %}

                    {% block content %}{% endblock content %}

        {% endblock body %}

    {% block script %}{% endblock script %}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>License — PHPRtfLite v1.x documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="top" title="PHPRtfLite v1.x documentation" href="index.html" />
    <link rel="prev" title="Bugs and feature requests" href="bug-feature.html" />

Navigation

          index

          previous |

PHPRtfLite v1.x documentation »

License¶

PHPRtfLite is released under GNU Lesser General Public License.

PHPRtfLite is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

PHPRtfLite 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 Lesser General Public License for more details.

See also http://www.gnu.org/licenses/lgpl.html

Previous topic

Bugs and feature requests

This Page

Show Source

Quick search

    <form class="search" action="search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          previous |

PHPRtfLite v1.x documentation »

        © Copyright 2011, sigmaz.
      Created using Sphinx 1.0.7.


text:
//
//  NSString+pinyin.m
//  iosapp
//
//  Created by 王晨 on 15/8/25.
//  Copyright © 2015年 oschina. All rights reserved.
//

#import "NSString+pinyin.h"

@implementation NSString (pinyin)
/*
- (NSString*)pinyinFirst{
    if (self == nil || self.length == 0) {
        return @"";
    }
    NSMutableString *result = [NSMutableString stringWithString:[self substringToIndex:1]];
    //先转换为带声调的拼音
    CFStringTransform((CFMutableStringRef)result,NULL, kCFStringTransformMandarinLatin,NO);
    //再转换为不带声调的拼音
    CFStringTransform((CFMutableStringRef)result,NULL, kCFStringTransformStripDiacritics,NO);
    return result;
}
*/
- (NSString*)pinyin {
    if (self == nil || self.length == 0) {
        return @"";
    }
    NSMutableString *result = [NSMutableString stringWithString:self];
    //先转换为带声调的拼音
    CFStringTransform((CFMutableStringRef)result,NULL, kCFStringTransformMandarinLatin,NO);
    //再转换为不带声调的拼音
    CFStringTransform((CFMutableStringRef)result,NULL, kCFStringTransformStripDiacritics,NO);
    return [result uppercaseString];
}
@end


text:
/**
 *
 * $Id: InducedMutationAction.java,v 1.17 2008-01-17 18:09:01 pandyas Exp $
 *
 * $Log: not supported by cvs2svn $
 * Revision 1.16  2007/10/31 17:11:18  pandyas
 * Modified comments for #9756  	geneID has been replaced with entrezGeneID - existing values need to be moved to new place
 *
 * Revision 1.15  2007/09/12 19:36:40  pandyas
 * modified debug statements for build to stage tier
 *
 * Revision 1.14  2007/07/23 17:40:43  pandyas
 * Fixed typo in word occurred
 *
 * Revision 1.13  2007/04/04 13:19:07  pandyas
 * modified names for mutation identifier fields (number changed to id)
 *
 * Revision 1.12  2007/03/26 12:02:31  pandyas
 * caMOd 2.3 enhancements for Zebrafish support
 *
 * Revision 1.11  2006/05/04 19:27:37  pandyas
 * Changed GeneticAlterationCollection to GeneticAlteration relationship from SpontaneousMutation and InducedMutation objects
 *
 * Revision 1.10  2006/04/17 19:09:41  pandyas
 * caMod 2.1 OM changes
 *
 *
 */

package gov.nih.nci.camod.webapp.action;

import gov.nih.nci.camod.Constants;
import gov.nih.nci.camod.domain.AnimalModel;
import gov.nih.nci.camod.domain.InducedMutation;
import gov.nih.nci.camod.service.AnimalModelManager;
import gov.nih.nci.camod.service.InducedMutationManager;
import gov.nih.nci.camod.webapp.form.InducedMutationForm;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;

/**
 * InducedMutationAction Class
 */
public final class InducedMutationAction extends BaseAction {

    /**
     * Edit
     *
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        log.trace("Entering edit");
		if (!isTokenValid(request)) {
			return mapping.findForward("failure");
		}

        InducedMutationForm inducedMutationForm = (InducedMutationForm) form;

        // Grab the current modelID from the session
        String modelID = (String) request.getSession().getAttribute(Constants.MODELID);

        log.debug("<TargetedModificationAction edit> following Characteristics:"
        		+ "\n\t getType: "  + inducedMutationForm.getType()
                + "\n\t getOtherType: " + inducedMutationForm.getOtherType()
                + "\n\t getCasNumber: " + inducedMutationForm.getCasNumber()
                + "\n\t getGeneIdentifier: " + inducedMutationForm.getGeneIdentifier() + "\n\t getName: " + inducedMutationForm.getName()
                + "\n\t getDescription: " + inducedMutationForm.getDescription()
                + "\n\t getObservation: " + inducedMutationForm.getObservation()
                + "\n\t getMethodObservation: " + inducedMutationForm.getMethodOfObservation()
                 + "\n\t getMgiId: "  + inducedMutationForm.getMgiId()
                + "\n\t getZfinId: "  + inducedMutationForm.getZfinId()
                + "\n\t getRgdId: "  + inducedMutationForm.getRgdId()
                + "\n\t"
                + (String) request.getSession().getAttribute("camod.loggedon.username"));

        // Grab the current SpontaneousMutation we are working with related to
        // this
        String aInducedMutationID = request.getParameter("aInducedMutationID");

        String theAction = (String) request.getParameter(Constants.Parameters.ACTION);

        try {

            InducedMutationManager inducedMutationManager = (InducedMutationManager) getBean("inducedMutationManager");

            if ("Delete".equals(theAction)) {

                // Grab the current modelID from the session
                String theModelId = (String) request.getSession().getAttribute(Constants.MODELID);

                AnimalModelManager theAnimalModelManager = (AnimalModelManager) getBean("animalModelManager");
                AnimalModel theAnimalModel = theAnimalModelManager.get(theModelId);

                inducedMutationManager.remove(aInducedMutationID, theAnimalModel);

                log.debug("InducedMutation deleted");

                ActionMessages msg = new ActionMessages();
                msg.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("inducedmutation.delete.successful"));
                saveErrors(request, msg);

            } else {
    	        // retrieve animal model by it's id
    	        AnimalModelManager theAnimalModelManager = (AnimalModelManager) getBean("animalModelManager");
    	        AnimalModel theAnimalModel = theAnimalModelManager.get(modelID);

                InducedMutation theInducedMutation = inducedMutationManager.get(aInducedMutationID);
                inducedMutationManager.update(theAnimalModel, inducedMutationForm, theInducedMutation);

                log.debug("InducedMutation edited");

                ActionMessages msg = new ActionMessages();
                msg.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("inducedmutation.edit.successful"));
                saveErrors(request, msg);
            }
        } catch (Exception e) {
            log.error("Exception ocurred editing InducedMutation", e);

            // Encountered an error
            ActionMessages msg = new ActionMessages();
            msg.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("errors.admin.message"));
            saveErrors(request, msg);
        }

        log.trace("Exiting edit");
		resetToken(request);

        return mapping.findForward("AnimalModelTreePopulateAction");
    }

    /**
     * Save
     *
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        log.debug("<InducedMutationAction save> Entering save");
		if (!isTokenValid(request)) {
			return mapping.findForward("failure");
		}

        // Create a form to edit
        InducedMutationForm inducedMutationForm = (InducedMutationForm) form;
        request.getSession().setAttribute(Constants.FORMDATA, inducedMutationForm);

        // Grab the current modelID from the session
        String theModelId = (String) request.getSession().getAttribute(Constants.MODELID);

        log.debug("<InducedMutationAction save> following Characteristics:" + "\n\t getType: "  + inducedMutationForm.getType()
                + "\n\t getOtherType: " + inducedMutationForm.getOtherType()
                + "\n\t getCasNumber: " + inducedMutationForm.getCasNumber()
                + "\n\t getGeneIdentifier: " + inducedMutationForm.getGeneIdentifier() + "\n\t getName: " + inducedMutationForm.getName()
                + "\n\t getDescription: " + inducedMutationForm.getDescription()
                + "\n\t getObservation: " + inducedMutationForm.getObservation()
                + "\n\t getMethodObservation: " + inducedMutationForm.getMethodOfObservation()
                + "\n\t getMgiId: "  + inducedMutationForm.getMgiId()
                + "\n\t getZfinId: "  + inducedMutationForm.getZfinId()
                + "\n\t getRgdNumber: "  + inducedMutationForm.getRgdId()
                + "\n\t"
                + (String) request.getSession().getAttribute("camod.loggedon.username"));

        try {
            // retrieve model and update w/ new values
            AnimalModelManager theAnimalModelManager = (AnimalModelManager) getBean("animalModelManager");
            AnimalModel theAnimalModel = theAnimalModelManager.get(theModelId);

            theAnimalModelManager.addGeneticDescription(theAnimalModel, inducedMutationForm);

            log.debug("New InducedMutation created");

            ActionMessages msg = new ActionMessages();
            msg.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("inducedmutation.creation.successful"));
            saveErrors(request, msg);

        } catch (Exception e) {
            log.error("Exception occurred creating InducedMutation", e);

            // Encountered an error
            ActionMessages msg = new ActionMessages();
            msg.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("errors.admin.message"));
            saveErrors(request, msg);
        }

        log.trace("Exiting save");
		resetToken(request);

        return mapping.findForward("AnimalModelTreePopulateAction");
    }
}


text:
<?php

defined('_JEXEC') or die;

JLoader::import('components.com_fields.libraries.fieldsplugin', JPATH_ADMINISTRATOR);

/**
 * Fields Editor Plugin
 *
 * @since  3.7.0
 */
class PlgFieldsEditor extends FieldsPlugin
{
	/**
	 * Transforms the field into a DOM XML element and appends it as a child on the given parent.
	 *
	 * @param   stdClass    $field   The field.
	 * @param   DOMElement  $parent  The field node parent.
	 * @param   JForm       $form    The form.
	 *
	 * @return  DOMElement
	 *
	 * @since   3.7.0
	 */
	public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form)
	{
		$fieldNode = parent::onCustomFieldsPrepareDom($field, $parent, $form);

		if (!$fieldNode)
		{
			return $fieldNode;
		}

		$fieldNode->setAttribute('buttons', $field->fieldparams->get('buttons', 0) ? 'true' : 'false');
		$fieldNode->setAttribute('hide', implode(',', $field->fieldparams->get('hide', array())));

		return $fieldNode;
	}
}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using AsmResolver.IO;

namespace AsmResolver.PE.DotNet.Metadata.Tables.Rows
{
    /// <summary>
    /// Represents a single row in the field layout metadata table.
    /// </summary>
    public struct FieldLayoutRow : IMetadataRow
    {
        /// <summary>
        /// Reads a single field layout row from an input stream.
        /// </summary>
        /// <param name="reader">The input stream.</param>
        /// <param name="layout">The layout of the field layout table.</param>
        /// <returns>The row.</returns>
        public static FieldLayoutRow FromReader(ref BinaryStreamReader reader, TableLayout layout)
        {
            return new FieldLayoutRow(
                reader.ReadUInt32(),
                reader.ReadIndex((IndexSize) layout.Columns[1].Size));
        }

        /// <summary>
        /// Creates a new row for the field layout metadata table.
        /// </summary>
        /// <param name="offset">The offset of the field relative to the start of the enclosing structure type.</param>
        /// <param name="field">The index into the Field type referencing the field that this layout was assigned to.</param>
        public FieldLayoutRow(uint offset, uint field)
        {
            Offset = offset;
            Field = field;
        }

        /// <inheritdoc />
        public TableIndex TableIndex => TableIndex.FieldLayout;

        /// <inheritdoc />
        public int Count => 2;

        /// <inheritdoc />
        public uint this[int index] => index switch
        {
            0 => Offset,
            1 => Field,
            _ => throw new IndexOutOfRangeException()
        };

        /// <summary>
        /// Gets or sets the offset of the field relative to the start of the enclosing structure type.
        /// </summary>
        public uint Offset
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets an index into the Field type referencing the field that this layout was assigned to.
        /// </summary>
        public uint Field
        {
            get;
            set;
        }

        /// <inheritdoc />
        public void Write(IBinaryStreamWriter writer, TableLayout layout)
        {
            writer.WriteUInt32(Offset);
            writer.WriteIndex(Field, (IndexSize) layout.Columns[1].Size);
        }

        /// <summary>
        /// Determines whether this row is considered equal to the provided field layout row.
        /// </summary>
        /// <param name="other">The other row.</param>
        /// <returns><c>true</c> if the rows are equal, <c>false</c> otherwise.</returns>
        public bool Equals(FieldLayoutRow other)
        {
            return Offset == other.Offset && Field == other.Field;
        }

        /// <inheritdoc />
        public override bool Equals(object? obj)
        {
            return obj is FieldLayoutRow other && Equals(other);
        }

        /// <inheritdoc />
        public override int GetHashCode()
        {
            unchecked
            {
                return ((int) Offset * 397) ^ (int) Field;
            }
        }

        /// <inheritdoc />
        public override string ToString()
        {
            return $"({Offset:X8}, {Field:X8})";
        }

        /// <inheritdoc />
        public IEnumerator<uint> GetEnumerator()
        {
            return new MetadataRowColumnEnumerator(this);
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }
}


text:
var lib = require('../index.js');

describe('A function for parsing query paramters', function() {
  var queryString;
  beforeEach(function () {
    queryString = undefined;
  });
  it('returns an options object', function() {
    queryString = {
      _limit: 2,
      _last: 'abc',
      _expand: 'table'
    };
  	var options = lib.querystring(queryString);
    expect(options).toBeDefined();
    expect(options.limit).toBe('2');
    expect(options.last).toEqual({id: 'abc'});
    expect(options.filter).not.toBeDefined();
  });
  it('returns an options object from encoded parameters', function() {
    queryString = {
      _limit: 2,
      _last: '%7B%22id%22%3A%22A%22%2C%22sort%22%3A1%7D',
      _expand: 'table'
    };
    var options = lib.querystring(queryString);
    expect(options).toBeDefined();
    expect(options.limit).toBe('2');
    expect(options.last).toEqual({id: 'A', sort: 1});
    expect(options.filter).not.toBeDefined();
  });
  it('returns an options object with expand', function() {
    queryString = {
      _expand: 'table'
    };
    var options = lib.querystring(queryString);
    expect(options).toBeDefined();
    expect(options.expand).toBeDefined();
    expect(options.expand.relTable).toBe('tables');
    expect(options.expand.relId).toBe('tableId');
    expect(options.expand.relLabel).toBe('table');
  });
  it('returns an options object with embed', function() {
    queryString = {
      _limit: 2,
      _last: 'abc',
      _embed: 'tables'
    };
    var options = lib.querystring(queryString);
    expect(options).toBeDefined();
    expect(options.embed).toBeDefined();
    expect(options.embed.relTable).toBe('tables');
    expect(options.embed.relId).toBe('tableId');
    expect(options.embed.relLabel).toBe('tables');
  });
  it('returns an options object with filter', function () {
    queryString = {
      id: 'abc',
      color: 'red'
    };
    var options = lib.querystring(queryString);
    expect(options).toBeDefined();
    expect(options.filter).toBeDefined();
    expect(options.filter.id).toBe('abc');
    expect(options.filter.color).toBe('red');
  });
  it('returns an empty object', function() {
    var options = lib.querystring(queryString);
    expect(typeof(options)).toBe('object');
    expect(Object.keys(options).length).toBe(0);
  });
});


text:
<!doctype html>

	<meta charset="utf-8">
	<meta http-equiv="x-ua-compatible" content="ie=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<title>"stats/lowess/docs/types/index.d" | stdlib</title>
	<meta name="description" content="stdlib is a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing.">
	<meta name="author" content="stdlib">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

	<link rel="apple-touch-icon" sizes="180x180" href="../apple-touch-icon.png">
	<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
	<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
	<link rel="manifest" href="../manifest.json">
	<link rel="mask-icon" href="../safari-pinned-tab.svg" color="#5bbad5">
	<meta name="theme-color" content="#ffffff">

	<meta property="og:type" content="website">
	<meta property="og:site_name" content="stdlib">
	<meta property="og:url" content="https://stdlib.io/">
	<meta property="og:title" content="A standard library for JavaScript and Node.js.">
	<meta property="og:description" content="stdlib is a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing.">
	<meta property="og:locale" content="en_US">
	<meta property="og:image" content="">

	<meta name="twitter:card" content="A standard library for JavaScript and Node.js.">
	<meta name="twitter:site" content="@stdlibjs">
	<meta name="twitter:url" content="https://stdlib.io/">
	<meta name="twitter:title" content="stdlib">
	<meta name="twitter:description" content="stdlib is a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing.">
	<meta name="twitter:image" content="">
	<link rel="stylesheet" href="../assets/css/main.css">
	<link rel="stylesheet" href="../assets/css/theme.css">

						Search
						<input id="tsd-search-field" type="text" />

Preparing search index...

The search index is not available

						Options

								All

Public

Public/Protected

All

							<input type="checkbox" id="tsd-filter-inherited" checked />
							Inherited
							<input type="checkbox" id="tsd-filter-only-exported" />
							Only exported

					Menu

					Globals

					"stats/lowess/docs/types/index.d"

External module "stats/lowess/docs/types/index.d"

Index

Interfaces

Options

Output

Functions

lowess

Functions

Export assignment lowess

lowess(x: NumericArray, y: NumericArray, options?: Options): Output

Defined in lib/node_modules/@stdlib/stats/lowess/docs/types/index.d.ts:84

Locally-weighted polynomial regression via the LOWESS algorithm.

References

Cleveland, William S. 1979. "Robust Locally and Smoothing Weighted Regression Scatterplots." Journal of the American Statistical Association 74 (368): 829–36. doi:10.1080/01621459.1979.10481038.

Cleveland, William S. 1981. "Lowess: A program for smoothing scatterplots by robust locally weighted regression." American Statistician 35 (1): 54–55. doi:10.2307/2683591.

throws

arguments x and y must have the same length

Parameters

x: NumericArray

ordered x-axis values (abscissa values)

y: NumericArray

corresponding y-axis values (ordinate values)

Optional options: Options

function options

Returns

									Output

ordered x-values and fitted values

						Packages

						"stats/lowess/docs/types/index.d"

						Options

						Output

						lowess

Legend

Module

Object literal

Variable

Function

Function with type parameter

Index signature

Type alias

Type alias with type parameter

Enumeration

Enumeration member

Property

Method

Interface

Interface with type parameter

Constructor

Property

Method

Index signature

Class

Class with type parameter

Constructor

Property

Method

Accessor

Index signature

Inherited constructor

Inherited property

Inherited method

Inherited accessor

Protected property

Protected method

Protected accessor

Private property

Private method

Private accessor

Static property

Static method

		Donate
		/
		Docs
		/
		Chat
		/
		Twitter
		/
		Contribute


text:
{{{ value }}}

    {{{ label }}}

      {{#fallbackUrl}}{{/fallbackUrl}}


text:
#import "NSString.h"

@interface NSString (NKAssetDownload)
- (id)_issueDirectory;
@end


text:
  </div><!-- /#content .container -->

  <!-- Bootstrap core JavaScript
  ================================================== -->
  <!-- Placed at the end of the document so the pages load faster -->
  <script src="js/jquery.min.js"></script>
  <script src="js/bootstrap.min.js"></script>
  <script src="js/common.js"></script>

</body>
</html>


text:
<!doctype html>

	<meta charset="utf-8">
	<title>Statom</title>


text:
var FileTests = require('./astfiletests');

var tests = new FileTests('tests/testfiles', 'ast');

tests.makeSuite('ast', 'ast_', function(f) {
    return f.indexOf('ast_') === 0 && f.indexOf('ast_error_') !== 0;
});

tests.makeSuite('ast-error', 'ast_error_', function(f) {
    return f.indexOf('ast_error_') === 0;
});

// vi:ts=4:et


text:
package redhorizon.ui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;

import java.util.HashMap;

/**
 * A basic main application window.
 *
 * @author Emanuel Rabina
 */
public abstract class ApplicationWindow extends Window {

	protected final MenuManager menumanager;

	/**
	 * Constructor, create a window with the usual minimize/maximize/close
	 * buttons and other optional components.
	 *
	 * @param addmenubar Whether or not to include a menu bar in the application
	 * 					 window.
	 */
	protected ApplicationWindow(boolean addmenubar) {

		super(SWT.SHELL_TRIM);

		shell.setLayout(createFillLayout());

		menumanager = addmenubar ? new MenuManager() : null;
	}

	/**
	 * Centers the window on the current monitor.
	 */
	@Override
	protected void pack() {

		Rectangle displayarea = shell.getDisplay().getPrimaryMonitor().getBounds();
		Rectangle windowarea = shell.getBounds();
		shell.setBounds((displayarea.width - windowarea.width) / 2,
				(displayarea.height - windowarea.height) / 2,
				windowarea.width, windowarea.height);
	}

	/**
	 * Tracks menu items in the menu bar for easier access to menu items.
	 */
	protected class MenuManager {

		private final Menu menubar;
		private final HashMap<String,Menu> menus = new HashMap<>();

		/**
		 * Constructor, creates a new menu manager, adding a menu bar to the
		 * application window.
		 */
		private MenuManager() {

			menubar = new Menu(shell, SWT.BAR);
			shell.setMenuBar(menubar);
		}

		/**
		 * Adds a new menu to the menu bar.
		 *
		 * @param displayname How the menu item appears in the menu bar,
		 * 					  including things like the accelerator key
		 * 					  (preceeded with a '&').
		 * @return The menu that was added.
		 */
		public Menu addMenu(String displayname) {

			MenuItem menubaritem = new MenuItem(menubar, SWT.CASCADE);
			menubaritem.setText(displayname);

			Menu menu = new Menu(shell, SWT.DROP_DOWN);
			menubaritem.setMenu(menu);

			String name = displayname.replace("&", "").toLowerCase();
			menus.put(name, menu);

			return menu;
		}
	}
}


text:
 // should be added in info http://www.daveallanson.com/index.php?option=com_content&view=article&id=56:adding-custom-fonts-ios-4&catid=38:blog&Itemid=56
#define FONT_NAME_REGULAR @"TimesNewRomanPSMT"
#define FONT_NAME_BOLD @"TimesNewRomanPS-BoldMT"

// Config
#define SERVER_URL @"http://util.trademob.com:5000"

#define SUCCESS @"SUCCESS"
#define PARSING_XML  @"XML"
#define PARSING_JSON  @"JSON"
#define REQUEST_GET  @"GET"
#define REQUEST_POST  @"POST"

#define SAMPLE_SCRIPT @"cards"
#define USERNAME @"tester"
#define PASSWORD @"tm-sdktest"

#define MENU_OPTION1 @"MENU_OPTION1"
#define MENU_OPTION2 @"MENU_OPTION2"

#define NAME_DEFAULT @"Ramy Kfoury"
#define EMAIL_DEFAULT @"ramy@trademob.com"
#define HOMEPAGE_DEFAULT @"http://ramy.trademob.com"

// Notifications

#endif


text:
package water.api;

import water.Key;
import water.api.KeyV3.FrameKeyV3;
import water.util.FFTTransformer;

public class FFTTransformerV3 extends JobV3<FFTTransformer, FFTTransformerV3> {
  @API(help="Dataset", required = true)
  public FrameKeyV3 dataset;

  @API(help="Destination Frame ID")
  public FrameKeyV3 destination_frame;

  @API(help="Dimensions of the input array: Length, Width, Depth", required = true)
  public int[] dimensions;

  @API(help="Whether to do the inverse FFT")
  public boolean inverse;

  @Override public FFTTransformer createImpl() {
    return new FFTTransformer(Key.<FFTTransformer>make(), "FFTTransformer job");
  }
}


text:
![Screenshot of vim-plist in action](http://i.imgur.com/ezBKTK7.png)

This vim bundle adds complete support for [property lists](plist) (*plist*)
files.

The plugin uses the underlying **plutil** (or **plistutil**) tool for
manipulating property lists. It supports reading and writing in *binary*,
*xml* and *json* formats.

## Requirements

- Vim 7.4 or later
- plutil (bundled with macOS) or [plistutil](libplist)

## Installation

Use your favorite plugin manager.

- [NeoBundle][neobundle]

    ```vim
    NeoBundle 'darfink/vim-plist'
    ```

- [Vundle][vundle]

    ```vim
    Bundle 'darfink/vim-plist'
    ```

- [Pathogen][pathogen]

    ```sh
    git clone git://github.com/darfink/vim-plist.git ~/.vim/bundle/vim-plist
    ```

- [vim-plug][vim-plug]

    ```vim
    Plug 'darfink/vim-plist'
    ```

## Usage

None! Just go ahead and edit plist files. Although there are some customization
options availabe.

- Change the display format used when editing property lists:

    ```vim
    let g:plist_display_format = 'xml'
    ```

    Available options for this command; *json* or *xml*. This does not only
    control the display format of binary property lists, but also for *json*
    and *xml* files. If the option is set to *json*, property lists in *xml*
    format will be displayed as *json* as well (but the format used when saving
    will be preserved).

- Change the plist format used when saving property lists:

    ```vim
    let g:plist_save_format = ''
    ```

    By default, property lists are saved in the same format as they had when
    opened. If you want to override this and always save property lists in a
    specific format, you can use *json*, *xml* or *binary* format.

## Notes

If you want syntax checking I highly recommend [Syntastic][syntastic] since it
has integrated support for property lists.

In case you use the `sudo tee` trick for writing to root owned files when using
Vim, it will **not** work with plist files. This is because the *tee* trick
uses the underlying Vim *write* function which bypasses the plugins
`BufWriteCmd` and `FileWriteCmd` hooks.

This does not add *plist* as a new filetype, but merely conversion
functionality between the different representable formats.

## Todo

- Add saving format options while editing (e.g. `:PlistSaveAs json`)

- Change display format while editing (e.g. `:PlistFormat xml`)

## License

MIT: [License][license]

[neobundle]: https://github.com/Shougo/neobundle.vim
[vundle]: https://github.com/gmarik/vundle
[pathogen]: https://github.com/tpope/vim-pathogen
[vim-plug]: https://github.com/junegunn/vim-plug
[vim-json]: https://github.com/elzr/vim-json
[syntastic]: https://github.com/scrooloose/syntastic
[license]: https://github.com/darfink/vim-plist/blob/master/LICENSE
[libplist]: https://github.com/libimobiledevice/libplist
[plist]: http://en.wikipedia.org/wiki/Property_list


text:
package org.marketcetera.util.log;

import org.marketcetera.util.log.I18NLoggerProxy;
import org.marketcetera.util.log.I18NMessage0P;
import org.marketcetera.util.log.I18NMessage1P;
import org.marketcetera.util.log.I18NMessageProvider;

/**
 * @author tlerios@marketcetera.com
 * @since 0.5.0
 * @version $Id: TestMessages.java 16154 2012-07-14 16:34:05Z colin $
 */

/* $License$ */

public interface TestMessages
{
    static final I18NMessageProvider PROVIDER=
        new I18NMessageProvider("util_log_test");
    static final I18NLoggerProxy LOGGER=
        new I18NLoggerProxy(PROVIDER);

    static final I18NMessage0P HELLO_MSG=
        new I18NMessage0P(LOGGER,"hello");
    static final I18NMessage1P HELLO_TITLE=
        new I18NMessage1P(LOGGER,"hello","title");
    static final I18NMessage1P HELLO_ECHO=
        new I18NMessage1P(LOGGER,"hello","echo");
    static final I18NMessage1P CHOICE_MSG=
        new I18NMessage1P(LOGGER,"choice");
    static final I18NMessage1P LOG_MSG=
        new I18NMessage1P(LOGGER,"log");

    static final I18NMessageNP BASE_MSG=
        new I18NMessageNP(LOGGER,"base");
    static final I18NMessageNP BASE_TTL=
        new I18NMessageNP(LOGGER,"base","ttl");

    static final I18NMessage0P P0_MSG=
        new I18NMessage0P(LOGGER,"p0");
    static final I18NMessage0P P0_MSG_COPY=
        new I18NMessage0P(LOGGER,"p0");
    static final I18NMessage0P P0_TTL=
        new I18NMessage0P(LOGGER,"p0","ttl");
    static final I18NMessage0P P0_TTL_COPY=
        new I18NMessage0P(LOGGER,"p0","ttl");
    static final I18NMessage1P P1_MSG=
        new I18NMessage1P(LOGGER,"p1");
    static final I18NMessage1P P1_TTL=
        new I18NMessage1P(LOGGER,"p1","ttl");
    static final I18NMessage2P P2_MSG=
        new I18NMessage2P(LOGGER,"p2");
    static final I18NMessage2P P2_TTL=
        new I18NMessage2P(LOGGER,"p2","ttl");
    static final I18NMessage3P P3_MSG=
        new I18NMessage3P(LOGGER,"p3");
    static final I18NMessage3P P3_TTL=
        new I18NMessage3P(LOGGER,"p3","ttl");
    static final I18NMessage4P P4_MSG=
        new I18NMessage4P(LOGGER,"p4");
    static final I18NMessage4P P4_TTL=
        new I18NMessage4P(LOGGER,"p4","ttl");
    static final I18NMessage5P P5_MSG=
        new I18NMessage5P(LOGGER,"p5");
    static final I18NMessage5P P5_TTL=
        new I18NMessage5P(LOGGER,"p5","ttl");
    static final I18NMessage6P P6_MSG=
        new I18NMessage6P(LOGGER,"p6");
    static final I18NMessage6P P6_TTL=
        new I18NMessage6P(LOGGER,"p6","ttl");
    static final I18NMessageNP PN_MSG=
        new I18NMessageNP(LOGGER,"pn");
    static final I18NMessageNP PN_TTL=
        new I18NMessageNP(LOGGER,"pn","ttl");

    static final I18NMessage0P NONEXISTENT=
        new I18NMessage0P(LOGGER,"nonexistent_msg");
}


text:
# Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "M:/Collage Projects/Spring 2017/File Structure/First Lab Tasks")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "M:/Collage Projects/Spring 2017/File Structure/First Lab Tasks/cmake-build-debug")

# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)

# The C and CXX include file regular expressions for this directory.
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})


text:
package gnu.xml.validation.datatype;

import java.util.Set;
import java.util.StringTokenizer;
import javax.xml.namespace.QName;
import org.relaxng.datatype.DatatypeException;
import org.relaxng.datatype.ValidationContext;

/**
 * An XML Schema list simple type.
 *
 * @author Chris Burdess
 */
public class ListSimpleType
  extends SimpleType
{

  /**
   * The type of the items in this list (atomic or union).
   */
  public final SimpleType itemType;

  public ListSimpleType(QName name, Set facets,
                        int fundamentalFacets, SimpleType baseType,
                        Annotation annotation, SimpleType itemType)
  {
    super(name, LIST, facets, fundamentalFacets, baseType, annotation);
    this.itemType = itemType;
  }

  public void checkValid(String value, ValidationContext context)
    throws DatatypeException
  {
    super.checkValid(value, context);
    StringTokenizer st = new StringTokenizer(value, " ");
    if (!st.hasMoreTokens())
      throw new DatatypeException("invalid list value");
    while (st.hasMoreTokens())
      {
        String token = st.nextToken();
        itemType.checkValid(token, context);
      }
  }

}


text:
require 'spec_helper'

require_relative '../../../lib/locomotive/steam/middlewares/thread_safe'
require_relative '../../../lib/locomotive/steam/middlewares/helpers'
require_relative '../../../lib/locomotive/steam/middlewares/renderer'

describe Locomotive::Steam::Middlewares::Renderer do

  let(:app) { ->(env) { [200, env, 'app'] }}

  let(:middleware) { described_class.new(app) }

  describe 'missing 404 page' do

    let(:locale)  { 'en' }
    let(:site)    { instance_double('Site', default_locale: 'en') }

    subject do
      middleware.call env_for('http://www.example.com', { 'steam.page' => nil, 'steam.locale' => locale, 'steam.site' => site })
    end

    specify 'return 404' do
      code, headers, response = subject
      expect(code).to eq(404)
      expect(response).to eq(["Your 404 page is missing. Please create it."])
    end

    context 'in another locale' do

      let(:locale) { 'fr' }

      specify 'return 200' do
        code, headers, response = subject
        expect(code).to eq(404)
        expect(response).to eq(["Your 404 page is missing in the fr locale. Please create it."])
      end

    end

  end

end


text:
@implementation PointRecords
- (instancetype)init
{
    self = [super init];
    if (self) {
        _propertyArrayMap = [NSDictionary dictionaryWithObjectsAndKeys:
                             @"PointRecord", @"list", nil];
        _canLoadMore = YES;
        _isLoading = _willLoadMore = NO;
        _page = @(1);
        _pageSize = @(20);
    }
    return self;
}
- (NSNumber *)points_left{
    if (!_points_left && _list.count > 0) {
        _points_left = [(PointRecord *)_list.firstObject points_left];
    }
    return _points_left;
}
- (NSString *)toPath{
    return @"api/point/records";
}
- (NSDictionary *)toParams{
    return @{@"page" : _willLoadMore? @(_page.integerValue +1) : @(1),
             @"pageSize" : _pageSize};
}
- (void)configWithObj:(PointRecords *)records{
    self.page = records.page;
    self.pageSize = records.pageSize;
    self.totalPage = records.totalPage;
    if (_willLoadMore) {
        [self.list addObjectsFromArray:records.list];
    }else{
        self.list = [NSMutableArray arrayWithArray:records.list];
    }
    _canLoadMore = _page.intValue < _totalPage.intValue;
}
@end


text:
#include "config.h"

#include <stdlib.h>
#include <ctype.h>
#include <string.h>

#include "zile.h"
#include "extern.h"

Marker *make_marker(void)
{
  Marker *marker;
  marker = (Marker *)zmalloc(sizeof(Marker));
  memset(marker, 0, sizeof(Marker));
  return marker;
}

static void unchain_marker(Marker *marker)
{
  Marker *m, *next, *prev = NULL;

  if (!marker->bp)
    return;

  for (m = marker->bp->markers; m; m = next) {
    next = m->next;
    if (m == marker) {
      if (prev)
        prev->next = next;
      else
        m->bp->markers = next;

      m->bp = NULL;
      break;
    }
    prev = m;
  }
}

void free_marker(Marker *marker)
{
  unchain_marker(marker);
  free(marker);
}

void move_marker(Marker *marker, Buffer *bp, Point pt)
{
  if (bp != marker->bp) {
    /* Unchain with the previous pointed buffer.  */
    unchain_marker(marker);

    /* Change the buffer.  */
    marker->bp = bp;

    /* Chain with the new buffer.  */
    marker->next = bp->markers;
    bp->markers = marker;
  }

  /* Change the point.  */
  marker->pt = pt;
}

Marker *copy_marker(Marker *m)
{
  Marker *marker = make_marker();
  move_marker(marker, m->bp, m->pt);
  return marker;
}

Marker *point_marker(void)
{
  Marker *marker = make_marker();
  move_marker(marker, cur_bp, cur_bp->pt);
  return marker;
}

Marker *point_min_marker(void)
{
  Marker *marker = make_marker();
  move_marker(marker, cur_bp, point_min());
  return marker;
}


text:
import Ember from 'ember';

let Owner;

if (Ember._RegistryProxyMixin && Ember._ContainerProxyMixin) {
  Owner = Ember.Object.extend(Ember._RegistryProxyMixin, Ember._ContainerProxyMixin);
} else {
  Owner = Ember.Object.extend();
}

export default Owner;


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.hangduykhiem.thesismvp">

    <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">
        <activity android:name=".View.MainMVPActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>

</manifest>


text:
/**
 * Justboil.me - a TinyMCE image upload plugin
 * jbimages/langs/fr.js
 *
 * Released under Creative Commons Attribution 3.0 Unported License
 *
 * License: http://creativecommons.org/licenses/by/3.0/
 * Plugin info: http://justboil.me/
 * Author: Viktor Kuzhelnyi
 *
 * Version: 2.3 released 23/06/2013
 */

tinyMCE.addI18n('fr.jbimages',{
	desc : 'T\u00E9l\u00E9charger une image'
});


text:
<?php

namespace Acme\AddressrBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class AcmeAddressrBundle extends Bundle
{
}


text:
package com.badlogic.gdx.utils.reflect;

import java.lang.annotation.Inherited;

import com.badlogic.gwtref.client.ReflectionCache;
import com.badlogic.gwtref.client.Type;

/** Utilities for Class reflection.
 * @author nexsoftware */
public final class ClassReflection {

	/** Returns the Class object associated with the class or interface with the supplied string name. */
	static public Class forName (String name) throws ReflectionException {
		try {
			return ReflectionCache.forName(name).getClassOfType();
		} catch (ClassNotFoundException e) {
			throw new ReflectionException("Class not found: " + name);
		}
	}

	/** Returns the simple name of the underlying class as supplied in the source code. */
	static public String getSimpleName (Class c) {
		return c.getSimpleName();
	}

	/** Determines if the supplied Object is assignment-compatible with the object represented by supplied Class. */
	static public boolean isInstance (Class c, Object obj) {
		return obj != null && isAssignableFrom(c, obj.getClass());
	}

	/** Determines if the class or interface represented by first Class parameter is either the same as, or is a superclass or
	 * superinterface of, the class or interface represented by the second Class parameter. */
	static public boolean isAssignableFrom (Class c1, Class c2) {
		Type c1Type = ReflectionCache.getType(c1);
		Type c2Type = ReflectionCache.getType(c2);
		return c1Type.isAssignableFrom(c2Type);
	}

	/** Returns true if the class or interface represented by the supplied Class is a member class. */
	static public boolean isMemberClass (Class c) {
		return ReflectionCache.getType(c).isMemberClass();
	}

	/** Returns true if the class or interface represented by the supplied Class is a static class. */
	static public boolean isStaticClass (Class c) {
		return ReflectionCache.getType(c).isStatic();
	}

	/** Determines if the supplied Class object represents an array class. */
	static public boolean isArray (Class c) {
		return ReflectionCache.getType(c).isArray();
	}

	/** Creates a new instance of the class represented by the supplied Class. */
	static public <T> T newInstance (Class<T> c) throws ReflectionException {
		try {
			return (T)ReflectionCache.getType(c).newInstance();
		} catch (NoSuchMethodException e) {
			throw new ReflectionException("Could not use default constructor of " + c.getName(), e);
		}
	}

	/** Returns an array of {@link Constructor} containing the public constructors of the class represented by the supplied Class. */
	static public Constructor[] getConstructors (Class c) {
		com.badlogic.gwtref.client.Constructor[] constructors = ReflectionCache.getType(c).getConstructors();
		Constructor[] result = new Constructor[constructors.length];
		for (int i = 0, j = constructors.length; i < j; i++) {
			result[i] = new Constructor(constructors[i]);
		}
		return result;
	}

	/** Returns a {@link Constructor} that represents the public constructor for the supplied class which takes the supplied
	 * parameter types. */
	static public Constructor getConstructor (Class c, Class... parameterTypes) throws ReflectionException {
		try {
			return new Constructor(ReflectionCache.getType(c).getConstructor(parameterTypes));
		} catch (SecurityException e) {
			throw new ReflectionException("Security violation while getting constructor for class: " + c.getName(), e);
		} catch (NoSuchMethodException e) {
			throw new ReflectionException("Constructor not found for class: " + c.getName(), e);
		}
	}

	/** Returns a {@link Constructor} that represents the constructor for the supplied class which takes the supplied parameter
	 * types. */
	static public Constructor getDeclaredConstructor (Class c, Class... parameterTypes) throws ReflectionException {
		try {
			return new Constructor(ReflectionCache.getType(c).getDeclaredConstructor(parameterTypes));
		} catch (SecurityException e) {
			throw new ReflectionException("Security violation while getting constructor for class: " + c.getName(), e);
		} catch (NoSuchMethodException e) {
			throw new ReflectionException("Constructor not found for class: " + c.getName(), e);
		}
	}

	/** Returns an array of {@link Method} containing the public member methods of the class represented by the supplied Class. */
	static public Method[] getMethods (Class c) {
		com.badlogic.gwtref.client.Method[] methods = ReflectionCache.getType(c).getMethods();
		Method[] result = new Method[methods.length];
		for (int i = 0, j = methods.length; i < j; i++) {
			result[i] = new Method(methods[i]);
		}
		return result;
	}

	/** Returns a {@link Method} that represents the public member method for the supplied class which takes the supplied parameter
	 * types. */
	static public Method getMethod (Class c, String name, Class... parameterTypes) throws ReflectionException {
		try {
			return new Method(ReflectionCache.getType(c).getMethod(name, parameterTypes));
		} catch (SecurityException e) {
			throw new ReflectionException("Security violation while getting method: " + name + ", for class: " + c.getName(), e);
		} catch (NoSuchMethodException e) {
			throw new ReflectionException("Method not found: " + name + ", for class: " + c.getName(), e);
		}
	}

	/** Returns an array of {@link Method} containing the methods declared by the class represented by the supplied Class. */
	static public Method[] getDeclaredMethods (Class c) {
		com.badlogic.gwtref.client.Method[] methods = ReflectionCache.getType(c).getDeclaredMethods();
		Method[] result = new Method[methods.length];
		for (int i = 0, j = methods.length; i < j; i++) {
			result[i] = new Method(methods[i]);
		}
		return result;
	}

	/** Returns a {@link Method} that represents the method declared by the supplied class which takes the supplied parameter types. */
	static public Method getDeclaredMethod (Class c, String name, Class... parameterTypes) throws ReflectionException {
		try {
			return new Method(ReflectionCache.getType(c).getMethod(name, parameterTypes));
		} catch (SecurityException e) {
			throw new ReflectionException("Security violation while getting method: " + name + ", for class: " + c.getName(), e);
		} catch (NoSuchMethodException e) {
			throw new ReflectionException("Method not found: " + name + ", for class: " + c.getName(), e);
		}
	}

	/** Returns an array of {@link Field} containing the public fields of the class represented by the supplied Class. */
	static public Field[] getFields (Class c) {
		com.badlogic.gwtref.client.Field[] fields = ReflectionCache.getType(c).getFields();
		Field[] result = new Field[fields.length];
		for (int i = 0, j = fields.length; i < j; i++) {
			result[i] = new Field(fields[i]);
		}
		return result;
	}

	/** Returns a {@link Field} that represents the specified public member field for the supplied class. */
	static public Field getField (Class c, String name) throws ReflectionException {
		try {
			return new Field(ReflectionCache.getType(c).getField(name));
		} catch (SecurityException e) {
			throw new ReflectionException("Security violation while getting field: " + name + ", for class: " + c.getName(), e);
		}
	}

	/** Returns an array of {@link Field} objects reflecting all the fields declared by the supplied class. */
	static public Field[] getDeclaredFields (Class c) {
		com.badlogic.gwtref.client.Field[] fields = ReflectionCache.getType(c).getDeclaredFields();
		Field[] result = new Field[fields.length];
		for (int i = 0, j = fields.length; i < j; i++) {
			result[i] = new Field(fields[i]);
		}
		return result;
	}

	/** Returns a {@link Field} that represents the specified declared field for the supplied class. */
	static public Field getDeclaredField (Class c, String name) throws ReflectionException {
		try {
			return new Field(ReflectionCache.getType(c).getField(name));
		} catch (SecurityException e) {
			throw new ReflectionException("Security violation while getting field: " + name + ", for class: " + c.getName(), e);
		}
	}

	/** Returns true if the supplied class has an annotation of the given type. */
	static public boolean isAnnotationPresent (Class c, Class<? extends java.lang.annotation.Annotation> annotationType) {
		Annotation[] annotations = getAnnotations(c);
		for (Annotation annotation : annotations) {
			if (annotation.getAnnotationType().equals(annotationType)) return true;
		}
		return false;
	}

	/** Returns an array of {@link Annotation} objects reflecting all annotations declared by the supplied class, and inherited
	 * from its superclass. Returns an empty array if there are none. */
	static public Annotation[] getAnnotations (Class c) {
		Type declType = ReflectionCache.getType(c);
		java.lang.annotation.Annotation[] annotations = declType.getDeclaredAnnotations();

		// annotations of supplied class
		Annotation[] result = new Annotation[annotations.length];
		for (int i = 0; i < annotations.length; i++) {
			result[i] = new Annotation(annotations[i]);
		}

		// search super classes, until Object.class is reached
		Type superType = declType.getSuperclass();
		java.lang.annotation.Annotation[] superAnnotations;
		while (!superType.getClassOfType().equals(Object.class)) {
			superAnnotations = superType.getDeclaredAnnotations();
			for (int i = 0; i < superAnnotations.length; i++) {
				// check for annotation types marked as Inherited
				Type annotationType = ReflectionCache.getType(superAnnotations[i].annotationType());
				if (annotationType.getDeclaredAnnotation(Inherited.class) != null) {
					// ignore duplicates
					boolean duplicate = false;
					for (Annotation annotation : result) {
						if (annotation.getAnnotationType().equals(annotationType)) {
							duplicate = true;
							break;
						}
					}
					// append to result set
					if (!duplicate) {
						Annotation[] copy = new Annotation[result.length + 1];
						for (int j = 0; j < result.length; j++) {
							copy[j] = result[j];
						}
						copy[result.length] = new Annotation(superAnnotations[i]);
						result = copy;
					}
				}
			}
			superType = superType.getSuperclass();
		}

		return result;
	}

	/** Returns an {@link Annotation} object reflecting the annotation provided, or null of this class doesn't have, or doesn't
	 * inherit, such an annotation. This is a convenience function if the caller knows already which annotation type he's looking
	 * for. */
	static public Annotation getAnnotation (Class c, Class<? extends java.lang.annotation.Annotation> annotationType) {
		Annotation[] annotations = getAnnotations(c);
		for (Annotation annotation : annotations) {
			if (annotation.getAnnotationType().equals(annotationType)) return annotation;
		}
		return null;
	}

	/** Returns an array of {@link Annotation} objects reflecting all annotations declared by the supplied class, or an empty
	 * array if there are none. Does not include inherited annotations. */
	static public Annotation[] getDeclaredAnnotations (Class c) {
		java.lang.annotation.Annotation[] annotations = ReflectionCache.getType(c).getDeclaredAnnotations();
		Annotation[] result = new Annotation[annotations.length];
		for (int i = 0; i < annotations.length; i++) {
			result[i] = new Annotation(annotations[i]);
		}
		return result;
	}

	/** Returns an {@link Annotation} object reflecting the annotation provided, or null of this class doesn't have such an
	 * annotation. This is a convenience function if the caller knows already which annotation type he's looking for. */
	static public Annotation getDeclaredAnnotation (Class c, Class<? extends java.lang.annotation.Annotation> annotationType) {
		java.lang.annotation.Annotation annotation = ReflectionCache.getType(c).getDeclaredAnnotation(annotationType);
		if (annotation != null) return new Annotation(annotation);
		return null;
	}
}


text:
from os import path
import sys
sys.path.append(path.abspath("../../external/planning_algorithms"))

import rospy
import numpy as np
import matplotlib.pyplot as plt
import json

from geometry_msgs.msg import Twist
from geometry_msgs.msg import Pose2D

from environment.worlds.occupancy_grid import OccupancyGrid
from environment.robots.turtlebot import Turtlebot
from environment.robots.humans import HumanSimple

class SFWorld:
    def __init__(self):
        # load a map
        map_path = rospy.get_param("~map_path",
                                   "../../external/planning_algorithms/resources/occ_maps/test_map.png")
        map_res = rospy.get_param("~map_resolution", 0.01)

        self.grid_map = OccupancyGrid(map_path, map_res)
        map_width = self.grid_map.width * map_res
        map_height = self.grid_map.height * map_res

        # load agent settings
        agent_setting_file = rospy.get_param("~agent_setting_file",
                                             "../../resources/sim_setting/default.json")
        settings = json.load(open(agent_setting_file))

        self.nhuman = settings["num_humans"]

        self.humans = []
        self.human_param = []
        for k in range(self.nhuman):
            human_id = "human" + str(k)
            goal = np.array([settings[human_id]["goal_x"], settings[human_id]["goal_y"]])
            k = settings[human_id]["k"]
            vd = settings[human_id]["vd"]

            human = HumanSimple()
            human.set_goal(goal, k, vd)
            self.humans.append(human)

            # load the social force parameters
            ah = settings[human_id]["hh_param"][0]
            bh = settings[human_id]["hh_param"][1]
            Rh = settings[human_id]["hh_param"][2]

            ar = settings[human_id]["hr_param"][0]
            br = settings[human_id]["hr_param"][1]
            Rr = settings[human_id]["hr_param"][2]

            self.human_param.append((ah, bh, Rh, ar, br, Rr))

            # start poses
            pose_start = np.array(settings[human_id]["pose_start"])
            human.set_pose(pose_start)

        # create a robot
        self.robot = Turtlebot()

        # set robot initial position
        pose_start = np.array(settings["robot"]["pose_start"])
        self.robot.set_pose(pose_start)

        # robot command input
        self.cmd_vel = np.array([0.0, 0.0])

        # publishers and subscribers
        self.cmd_vel_sub = rospy.Subscriber("/cmd_vel", Twist, self.cmd_vel_callback)

        self.human_pubs = []
        for k in range(self.nhuman):
            topic_name = "/human_poses/human" + str(k)
            self.human_pubs.append(rospy.Publisher(topic_name, Pose2D, queue_size=1))

        # create a plot axis
        self.fig, self.ax = plt.subplots()
        self.ax.set_aspect("equal")
        self.ax.set_xlim(0, map_width)
        self.ax.set_ylim(0, map_height)
        plt.ion()

        # self.grid_map.visualize(self.ax)

        # visualize human and robot
        for human in self.humans:
            human.visualize(self.ax)

        self.robot.visualize(self.ax)

        # initialize a counter
        self.counter = 0

    def cmd_vel_callback(self, cmd_vel_msg):
        self.cmd_vel[0] = cmd_vel_msg.linear.x
        self.cmd_vel[1] = cmd_vel_msg.angular.z

    def update(self, dt):
        self.counter += 1

        for human in self.humans:
            human.update(np.zeros((2,)), dt)
            if self.counter % 5 == 1:
                human.visualize(self.ax)

        if self.counter % 5 == 1:
            plt.pause(0.001)

if __name__ == "__main__":
    # initialize node
    rospy.init_node("simulation_world")

    # create the world object
    world = SFWorld()

    # loop
    rate = rospy.Rate(100)
    while not rospy.is_shutdown():
        print "hhh"
        world.update(0.01)
        rate.sleep()


text:
	local p = premake

	-- only declare the suite as a test if http.get is an existing method.
	local suite = {}
	if http.get ~= nil then
		suite = test.declare("premake_http")
	end

	function suite.http_get()
		local result, err = http.get("http://httpbin.org/user-agent")
		if result then
			p.out(result)
			test.capture(
				'{"user-agent": "Premake/' .. _PREMAKE_VERSION .. '"}'
			)
		else
			test.fail(err);
		end
	end

	function suite.https_get()
		-- sslverifypeer = 0, so we can test from within companies like here at Blizzard where all HTTPS traffic goes through
		-- some strange black box that re-signs all traffic with a custom ssl certificate.
		local result, err = http.get("https://httpbin.org/user-agent", { sslverifypeer = 0 })
		if result then
			p.out(result)
			test.capture(
				'{"user-agent": "Premake/' .. _PREMAKE_VERSION .. '"}'
			)
		else
			test.fail(err);
		end
	end

	function suite.https_get_verify_peer()
		local result, err = http.get("https://httpbin.org/user-agent")
		if result then
			p.out(result)
			test.capture(
				'{"user-agent": "Premake/' .. _PREMAKE_VERSION .. '"}'
			)
		else
			test.fail(err);
		end
	end

	function suite.http_responsecode()
		local result, err, responseCode = http.get("http://httpbin.org/status/418")
		test.isequal(responseCode, 418)
	end

	function suite.http_redirect()
		local result, err, responseCode = http.get("http://httpbin.org/redirect/3")
		if result then
			test.isequal(responseCode, 200)
		else
			test.fail(err);
		end
	end

	function suite.http_headers()
		local result, err, responseCode = http.get("http://httpbin.org/headers", {
			headers = { 'X-Premake: premake' }
		})

		if result then
			if (not result:find('X-Premake')) then
				test.fail("response doens't contain header")
				test.print(result)
			end
		else
			test.fail(err);
		end
	end


text:
/* micropolisJS. Adapted by Graeme McCutcheon from Micropolis.
 *
 * This code is released under the GNU GPL v3, with some additional terms.
 * Please see the files LICENSE and COPYING for details. Alternatively,
 * consult http://micropolisjs.graememcc.co.uk/LICENSE and
 * http://micropolisjs.graememcc.co.uk/COPYING
 *
 */
Micro.MonsterSprite = function (map, spriteManager, x, y) {
  Micro.BaseSprite.call( this );
    this.init(Micro.SPRITE_MONSTER, map, spriteManager, x, y);
    this.width = 48;
    this.height = 48;
    this.xOffset = -24;
    this.yOffset = -24;

    if (x > Micro.worldToPix(map.width) / 2) {
      if (y > Micro.worldToPix(map.height) / 2) this.frame = 10;
      else this.frame = 7;
    } else if (y > Micro.worldToPix(map.height) / 2) { this.frame = 1;
    } else { this.frame = 4;
    }

    this.flag = 0;
    this.count = 1000;
    this.destX = Micro.worldToPix(map.pollutionMaxX);
    this.destY = Micro.worldToPix(map.pollutionMaxY);
    this.origX = this.x;
    this.origY = this.y;
    this._seenLand = false;

    this.xDelta = [ 2, 2, -2, -2, 0];
    this.yDelta = [-2, 2, 2, -2, 0];
    this.cardinals1 = [ 0, 1, 2, 3];
    this.cardinals2 = [ 1, 2, 3, 0];
    this.diagonals1 = [ 2, 5, 8, 11];
    this.diagonals2 = [11, 2, 5, 8];
}

Micro.MonsterSprite.prototype = Object.create( Micro.BaseSprite.prototype );

Micro.MonsterSprite.prototype.move = function(spriteCycle, messageManager, disasterManager, blockMaps) {
    if (this.soundCount > 0)
      this.soundCount--;

    // Frames 1 - 12 are diagonal sprites, 3 for each direction.
    // 1-3 NE, 2-6 SE, etc. 13-16 represent the cardinal directions.
    var currentDir = Math.floor((this.frame - 1) / 3);
    var frame, dir;

    if (currentDir < 4) { /* turn n s e w */
      // Calculate how far in the 3 step animation we were,
      // move on to the next one
      frame = (this.frame - 1) % 3;

      if (frame === 2)
        this.step = 0;

      if (frame === 0)
        this.step = 1;

      if (this.step)
        frame++;
      else
        frame--;

      var absDist = Micro.absoluteDistance(this.x, this.y, this.destX, this.destY);

      if (absDist < 60) {
        if (this.flag === 0) {
          this.flag = 1;
          this.destX = this.origX;
          this.destY = this.origY;
        } else {
          this.frame = 0;
          return;
        }
      }

      // Perhaps switch to a cardinal direction
      dir = Micro.getDir(this.x, this.y, this.destX, this.destY);
      dir = Math.floor((dir - 1) / 2);

      if (dir !== currentDir && Random.getChance(10)) {
        if (Random.getRandom16() & 1)
          frame = this.cardinals1[currentDir];
        else
          frame = this.cardinals2[currentDir];

        currentDir = 4;

        if (!this.soundCount) {
          messageManager.sendMessage(Messages.SOUND_MONSTER);
          this.soundCount = 50 + Random.getRandom(100);
        }
      }
    } else {
      // Travelling in a cardinal direction. Switch to a diagonal
      currentDir = 4;
      dir = this.frame;
      frame = (dir - 13) & 3;

      if (!(Random.getRandom16() & 3)) {
        if (Random.getRandom16() & 1)
          frame = this.diagonals1[frame];
        else
          frame = this.diagonals2[frame];

        // We mung currentDir and frame here to
        // make the assignment below work
        currentDir = Math.floor((frame - 1) / 3);
        frame = (frame - 1) % 3;
      }
    }

    frame = currentDir * 3 + frame + 1;
    if (frame > 16)
      frame = 16;

    this.frame = frame;

    this.x += this.xDelta[currentDir];
    this.y += this.yDelta[currentDir];

    if (this.count > 0)
      this.count--;

    var tileValue = Micro.getTileValue(this.map, this.x, this.y);

    if (tileValue === -1 || (tileValue === Tile.RIVER && this.count < 500))
      this.frame = 0;

    if (tileValue === Tile.DIRT || tileValue > Tile.WATER_HIGH)
      this._seenLand = true;

    var spriteList = this.spriteManager.getSpriteList();
    for (var i = 0; i < spriteList.length; i++) {
      var s = spriteList[i];

      if (s.frame !== 0 &&
          (s.type === Micro.SPRITE_AIRPLANE || s.type === Micro.SPRITE_HELICOPTER ||
           s.type === Micro.SPRITE_SHIP || s.type === Micro.SPRITE_TRAIN) &&
            Micro.checkSpriteCollision(this, s))
        s.explodeSprite(messageManager);
    }

    Micro.destroyMapTile(this.spriteManager, this.map, blockMaps, this.x, this.y);
  };

/*
  // Metadata for image loading
  Object.defineProperties(MonsterSprite,
    {ID: Micro.makeConstantDescriptor(5),
     width: Micro.makeConstantDescriptor(48),
     frames: Micro.makeConstantDescriptor(16)});

  return MonsterSprite;
});
*/


text:
import { Component, ViewChild} from '@angular/core';

import { jqxSchedulerComponent } from '../../../jqwidgets-ts/angular_jqxscheduler';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})

export class AppComponent {
    @ViewChild('myScheduler') myScheduler: jqxSchedulerComponent;

    source: any =
    {
        dataType: 'json',
        dataFields: [
            { name: 'id', type: 'string' },
            { name: 'status', type: 'string' },
            { name: 'about', type: 'string' },
            { name: 'address', type: 'string' },
            { name: 'company', type: 'string' },
            { name: 'name', type: 'string' },
            { name: 'style', type: 'string' },
            { name: 'calendar', type: 'string' },
            { name: 'start', type: 'date', format: 'yyyy-MM-dd HH:mm' },
            { name: 'end', type: 'date', format: 'yyyy-MM-dd HH:mm' }
        ],
        id: 'id',
        url: '../sampledata/appointments.txt'
    };

    adapter: any = new jqx.dataAdapter(this.source);

    appointmentDataFields: any =
    {
        from: 'start',
        to: 'end',
        id: 'id',
        description: 'about',
        location: 'address',
        subject: 'name',
        style: 'style',
        status: 'status'
    };

    views: any[] =
    [
        { type: 'dayView', showWeekends: false, timeRuler: { hidden: false } },
        { type: 'weekView', showWeekends: false, timeRuler: { hidden: false } },
        { type: 'monthView', showWeekends: false }
    ];

    date: any = new jqx.date(2016, 11, 23);
}


text:
#ifndef __DIRECT__SYSTEM_H__
#define __DIRECT__SYSTEM_H__

#include <sys/types.h>

pid_t direct_gettid( void );
long  direct_pagesize( void );

unsigned long direct_page_align( unsigned long value );

#endif


text:
use clippy_utils::diagnostics::{span_lint_and_sugg, span_lint_and_then};
use clippy_utils::source::snippet_opt;
use clippy_utils::{fn_def_id, in_macro, path_to_local_id};
use if_chain::if_chain;
use rustc_ast::ast::Attribute;
use rustc_errors::Applicability;
use rustc_hir::intravisit::{walk_expr, FnKind, NestedVisitorMap, Visitor};
use rustc_hir::{Block, Body, Expr, ExprKind, FnDecl, HirId, MatchSource, PatKind, StmtKind};
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_middle::hir::map::Map;
use rustc_middle::lint::in_external_macro;
use rustc_middle::ty::subst::GenericArgKind;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::hygiene::DesugaringKind;
use rustc_span::source_map::Span;
use rustc_span::sym;

declare_clippy_lint! {
    /// ### What it does
    /// Checks for `let`-bindings, which are subsequently
    /// returned.
    ///
    /// ### Why is this bad?
    /// It is just extraneous code. Remove it to make your code
    /// more rusty.
    ///
    /// ### Example
    /// ```rust
    /// fn foo() -> String {
    ///     let x = String::new();
    ///     x
    /// }
    /// ```
    /// instead, use
    /// ```
    /// fn foo() -> String {
    ///     String::new()
    /// }
    /// ```
    pub LET_AND_RETURN,
    style,
    "creating a let-binding and then immediately returning it like `let x = expr; x` at the end of a block"
}

declare_clippy_lint! {
    /// ### What it does
    /// Checks for return statements at the end of a block.
    ///
    /// ### Why is this bad?
    /// Removing the `return` and semicolon will make the code
    /// more rusty.
    ///
    /// ### Example
    /// ```rust
    /// fn foo(x: usize) -> usize {
    ///     return x;
    /// }
    /// ```
    /// simplify to
    /// ```rust
    /// fn foo(x: usize) -> usize {
    ///     x
    /// }
    /// ```
    pub NEEDLESS_RETURN,
    style,
    "using a return statement like `return expr;` where an expression would suffice"
}

#[derive(PartialEq, Eq, Copy, Clone)]
enum RetReplacement {
    Empty,
    Block,
}

declare_lint_pass!(Return => [LET_AND_RETURN, NEEDLESS_RETURN]);

impl<'tcx> LateLintPass<'tcx> for Return {
    fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'_>) {
        // we need both a let-binding stmt and an expr
        if_chain! {
            if let Some(retexpr) = block.expr;
            if let Some(stmt) = block.stmts.iter().last();
            if let StmtKind::Local(local) = &stmt.kind;
            if local.ty.is_none();
            if cx.tcx.hir().attrs(local.hir_id).is_empty();
            if let Some(initexpr) = &local.init;
            if let PatKind::Binding(_, local_id, _, _) = local.pat.kind;
            if path_to_local_id(retexpr, local_id);
            if !last_statement_borrows(cx, initexpr);
            if !in_external_macro(cx.sess(), initexpr.span);
            if !in_external_macro(cx.sess(), retexpr.span);
            if !in_external_macro(cx.sess(), local.span);
            if !in_macro(local.span);
            then {
                span_lint_and_then(
                    cx,
                    LET_AND_RETURN,
                    retexpr.span,
                    "returning the result of a `let` binding from a block",
                    |err| {
                        err.span_label(local.span, "unnecessary `let` binding");

                        if let Some(mut snippet) = snippet_opt(cx, initexpr.span) {
                            if !cx.typeck_results().expr_adjustments(retexpr).is_empty() {
                                snippet.push_str(" as _");
                            }
                            err.multipart_suggestion(
                                "return the expression directly",
                                vec![
                                    (local.span, String::new()),
                                    (retexpr.span, snippet),
                                ],
                                Applicability::MachineApplicable,
                            );
                        } else {
                            err.span_help(initexpr.span, "this expression can be directly returned");
                        }
                    },
                );
            }
        }
    }

    fn check_fn(
        &mut self,
        cx: &LateContext<'tcx>,
        kind: FnKind<'tcx>,
        _: &'tcx FnDecl<'tcx>,
        body: &'tcx Body<'tcx>,
        _: Span,
        _: HirId,
    ) {
        match kind {
            FnKind::Closure => {
                // when returning without value in closure, replace this `return`
                // with an empty block to prevent invalid suggestion (see #6501)
                let replacement = if let ExprKind::Ret(None) = &body.value.kind {
                    RetReplacement::Block
                } else {
                    RetReplacement::Empty
                };
                check_final_expr(cx, &body.value, Some(body.value.span), replacement);
            },
            FnKind::ItemFn(..) | FnKind::Method(..) => {
                if let ExprKind::Block(block, _) = body.value.kind {
                    check_block_return(cx, block);
                }
            },
        }
    }
}

fn attr_is_cfg(attr: &Attribute) -> bool {
    attr.meta_item_list().is_some() && attr.has_name(sym::cfg)
}

fn check_block_return<'tcx>(cx: &LateContext<'tcx>, block: &Block<'tcx>) {
    if let Some(expr) = block.expr {
        check_final_expr(cx, expr, Some(expr.span), RetReplacement::Empty);
    } else if let Some(stmt) = block.stmts.iter().last() {
        match stmt.kind {
            StmtKind::Expr(expr) | StmtKind::Semi(expr) => {
                check_final_expr(cx, expr, Some(stmt.span), RetReplacement::Empty);
            },
            _ => (),
        }
    }
}

fn check_final_expr<'tcx>(
    cx: &LateContext<'tcx>,
    expr: &'tcx Expr<'tcx>,
    span: Option<Span>,
    replacement: RetReplacement,
) {
    match expr.kind {
        // simple return is always "bad"
        ExprKind::Ret(ref inner) => {
            // allow `#[cfg(a)] return a; #[cfg(b)] return b;`
            let attrs = cx.tcx.hir().attrs(expr.hir_id);
            if !attrs.iter().any(attr_is_cfg) {
                let borrows = inner.map_or(false, |inner| last_statement_borrows(cx, inner));
                if !borrows {
                    emit_return_lint(
                        cx,
                        span.expect("`else return` is not possible"),
                        inner.as_ref().map(|i| i.span),
                        replacement,
                    );
                }
            }
        },
        // a whole block? check it!
        ExprKind::Block(block, _) => {
            check_block_return(cx, block);
        },
        ExprKind::If(_, then, else_clause_opt) => {
            if let ExprKind::Block(ifblock, _) = then.kind {
                check_block_return(cx, ifblock);
            }
            if let Some(else_clause) = else_clause_opt {
                if expr.span.desugaring_kind() != Some(DesugaringKind::LetElse) {
                    check_final_expr(cx, else_clause, None, RetReplacement::Empty);
                }
            }
        },
        // a match expr, check all arms
        // an if/if let expr, check both exprs
        // note, if without else is going to be a type checking error anyways
        // (except for unit type functions) so we don't match it
        ExprKind::Match(_, arms, MatchSource::Normal) => {
            for arm in arms.iter() {
                check_final_expr(cx, arm.body, Some(arm.body.span), RetReplacement::Block);
            }
        },
        ExprKind::DropTemps(expr) => check_final_expr(cx, expr, None, RetReplacement::Empty),
        _ => (),
    }
}

fn emit_return_lint(cx: &LateContext<'_>, ret_span: Span, inner_span: Option<Span>, replacement: RetReplacement) {
    if ret_span.from_expansion() {
        return;
    }
    match inner_span {
        Some(inner_span) => {
            if in_external_macro(cx.tcx.sess, inner_span) || inner_span.from_expansion() {
                return;
            }

            span_lint_and_then(cx, NEEDLESS_RETURN, ret_span, "unneeded `return` statement", |diag| {
                if let Some(snippet) = snippet_opt(cx, inner_span) {
                    diag.span_suggestion(ret_span, "remove `return`", snippet, Applicability::MachineApplicable);
                }
            });
        },
        None => match replacement {
            RetReplacement::Empty => {
                span_lint_and_sugg(
                    cx,
                    NEEDLESS_RETURN,
                    ret_span,
                    "unneeded `return` statement",
                    "remove `return`",
                    String::new(),
                    Applicability::MachineApplicable,
                );
            },
            RetReplacement::Block => {
                span_lint_and_sugg(
                    cx,
                    NEEDLESS_RETURN,
                    ret_span,
                    "unneeded `return` statement",
                    "replace `return` with an empty block",
                    "{}".to_string(),
                    Applicability::MachineApplicable,
                );
            },
        },
    }
}

fn last_statement_borrows<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> bool {
    let mut visitor = BorrowVisitor { cx, borrows: false };
    walk_expr(&mut visitor, expr);
    visitor.borrows
}

struct BorrowVisitor<'a, 'tcx> {
    cx: &'a LateContext<'tcx>,
    borrows: bool,
}

impl<'tcx> Visitor<'tcx> for BorrowVisitor<'_, 'tcx> {
    type Map = Map<'tcx>;

    fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {
        if self.borrows {
            return;
        }

        if let Some(def_id) = fn_def_id(self.cx, expr) {
            self.borrows = self
                .cx
                .tcx
                .fn_sig(def_id)
                .output()
                .skip_binder()
                .walk(self.cx.tcx)
                .any(|arg| matches!(arg.unpack(), GenericArgKind::Lifetime(_)));
        }

        walk_expr(self, expr);
    }

    fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
        NestedVisitorMap::None
    }
}


text:
<?php

namespace Programs\Parkcms\Workshop;

use Parkcms\Programs\Admin\Editor as BaseEditor;

use Programs\Parkcms\Workshop\Models\Workshop as Model;
use Programs\Parkcms\Workshop\Models\Part;

class Editor extends BaseEditor {
    public function register()
    {
        $this->addResourceEndpoint('', $this);

        $this->addEndpoint('settings', 'settings', 'get');
        $this->addEndpoint('updateSettings', 'updateSettings', 'put');

        $this->addEndpoint('changeWorkshop', 'changeWorkshop', 'get');
    }

    public function index($properties)
    {
        $workshop = $this->getWorkshop($properties);
        $toolbar = $this->makeField('Toolbar');
        // $toolbar->addButton('New Workshop', 'file', array('load-action' => 'createW'));
        $toolbar->addButton('Settings', 'cog', array('load-action' => 'settings'));
        $toolbar->addButton('New Part', 'file', array('load-action' => 'create'));

        $table = $this->makeField('Table');

        $table->setHeaders(array('title' => 'Title', 'description' => 'Description'));

        $table->setButtons(array(
            array(
                'load-action'    => 'edit',
                'title'     => 'Edit',
                'content'   => 'Edit'
            ),
            array(
                'confirm-action'    => 'delete',
                'confirm-message'   => 'Do you really want to delete the selected entry?',
                'title'     => 'Delete',
                'content'   => 'Delete'
            )
        ));

        $table->setRows($workshop->parts);

        return $toolbar->render() . $table->render();
    }

    public function settings($properties)
    {
        $workshop = $this->getWorkshop($properties);

        $form = $this->makeField('Form');

        $form->setAction('updateSettings');
        $form->setMethod('put');

        $form->addFields(function($form) use ($workshop) {
            $title = $form->addField('SelectChange', array(
                'name'  => 'selected_workshop',
                'values' => $this->getWorkshopTitles($workshop->identifier),
                'value' => $workshop->id,
                'label' => 'Workshop:'
            ));

            $title = $form->addField('Text', array(
                'name'  => 'title',
                'value' => '',
                'label' => 'Title:'
            ));

            $content = $form->addField('Content', array(
                'name'  => 'content',
                'value' => '',
                'label' => 'Content:'
            ));

            $terms = $form->addField('Content', array(
                'name'  => 'terms',
                'value' => '',
                'label' => 'Terms:'
            ));

            $registration_mail = $form->addField('Text', array(
                'name'  => 'registration_mail',
                'value' => '',
                'label' => 'Registration Mail:'
            ));

            $registration_mail_body = $form->addField('Content', array(
                'name'  => 'registration_mail_body',
                'value' => '',
                'label' => 'Registration Mail Body:'
            ));

            $date = $form->addField('Text', array(
                'name'  => 'date',
                'type'  => 'date',
                'value' => '',
                'label' => 'Date:'
            ));

            $seats = $form->addField('Text', array(
                'name'  => 'seats',
                'type'  => 'number',
                'value' => '',
                'label' => 'Seats:'
            ));

            if ($workshop !== null)
            {
                $title->setValue($workshop->title);
                $content->setValue($workshop->content);
                $terms->setValue($workshop->terms);
                $registration_mail->setValue($workshop->registration_mail);
                $registration_mail_body->setValue($workshop->registration_mail_body);
                $date->setValue($workshop->date->format('Y-m-d'));
                $seats->setValue($workshop->seats);

                $id = $form->addField('Text', array(
                    'type'  => 'hidden',
                    'name'  => 'id',
                    'value' => $workshop->id
                ));
            }
        });

        $form->addSubmit('Save');
        $form->addButton('Cancel', 'abort', 'index');

        return $form;
    }

    public function updateSettings($properties)
    {
        $form = $properties['form'];

        $workshop = Model::find($form['id']);

        $workshop->title = $form['title'];
        $workshop->content = $form['content'];
        $workshop->terms = $form['terms'];
        $workshop->registration_mail = $form['registration_mail'];
        $workshop->date = $form['date'];
        $workshop->seats = $form['seats'];

        if ($workshop->save()) {
            return array('success' => array('message' => 'Workshop updated successfully'), 'redirect' => 'index');
        } else {
            return array('error' => array('message' => 'The settings could not be saved!'), 'redirect' => 'index');
        }
    }

    public function changeWorkshop($properties)
    {
        if (Model::find($properties['id']) === null) {
            return Response::json(array('error' => array('title' => 'Workshop Editor Error', 'message' => 'The given item with ID #' . $properties['id'] . ' was not found in the database!')), 404);
        }

        foreach($this->getWorkshops($properties) as $workshop) {
            if($workshop->id == $properties['id']) {
                $workshop->active = 1;
            } else {
                $workshop->active = 0;
            }
            $workshop->save();
        }

        return array('success' => array('message' => 'Workshop successfully activated'), 'redirect' => 'settings');
    }

    public function create()
    {
        return $this->generateItemForm('store', 'post');
    }

    public function edit($properties)
    {
        $item = Part::find($properties['id']);

        if ($item === null) {
            return Response::json(array('error' => array('title' => 'Workshop Editor Error', 'message' => 'The given item with ID #' . $properties['id'] . ' was not found in the database!')), 404);
        }

        return $this->generateItemForm('update', 'put', $item);
    }

    public function update($properties)
    {
        $form = $properties['form'];

        $item = Part::find($form['id']);
        if ($item === null) {
            return Response::json(array('error' => array('title' => 'Workshop Editor Error', 'message' => 'The given item with ID #' . $properties['id'] . ' was not found in the database!')), 404);
        }

        $item->title = $form['title'];
        $item->description = $form['description'];
        $item->price = $form['price'];
        $item->part_type = $form['part_type'];
        $item->select_values = $form['select_values'];
        $item->connected_with_seats = $form['connected_with_seats'];
        $item->order = $form['order'];

        if ($item->save()) {
            return array('success' => array('message' => 'Field updated successfully'), 'redirect' => 'index');
        } else {
            return array('error' => array('message' => 'The given item could not be saved!'), 'redirect' => 'index');
        }
    }

    public function store($properties)
    {
        $form = $properties['form'];

        $workshop = $this->getWorkshop($properties);

        $item = new Part;

        $item->title = $form['title'];
        $item->description = $form['description'];
        $item->price = $form['price'];
        $item->part_type = $form['part_type'];
        $item->select_values = $form['select_values'];
        $item->connected_with_seats = $form['connected_with_seats'];
        $item->order = $form['order'];

        $item->workshop_id = $workshop->id;

        if ($item->save()) {
            return array('success' => array('message' => 'Field created successfully'), 'redirect' => 'index');
        } else {
            return array('error' => array('message' => 'The given item could not be saved!'), 'redirect' => 'index');
        }
    }

    public function delete($properties)
    {
        $item = Part::find($properties['id']);

        if ($item === null) {
            return Response::json(array('error' => array('title' => 'Workshop Editor Error', 'message' => 'The given item with ID #' . $properties['id'] . ' was not found in the database!')), 404);
        }

        $item->registrations()->detach();

        if ($item->delete()) {
            return array('success' => array('message' => 'Part deleted successfully'), 'redirect' => 'index');
        } else {
            return array('error' => array('message' => 'The given item could not be deleted!'), 'redirect' => 'index');
        }
    }

    private function getWorkshop($identifier)
    {
        if(is_array($identifier)) {
            $identifier = $identifier['identifier'];
        }

        return Model::with('parts')->where('identifier', $identifier)->where('active', 1)->first();
    }

    private function getWorkshops($identifier)
    {
        if(is_array($identifier)) {
            $identifier = $identifier['identifier'];
        }

        return Model::where('identifier', $identifier)->get();
    }

    private function getWorkshopTitles($identifier)
    {
        $workshops = $this->getWorkshops($identifier);

        $data = array();
        foreach($workshops as $workshop) {
            $data[$workshop->id] = $workshop->title;
        }

        return $data;
    }

    private function generateItemForm($action, $method, $item = null)
    {
        $form = $this->makeField('Form');

        $form->setAction($action);
        $form->setMethod($method);

        $form->addFields(function($form) use ($item) {
            $title = $form->addField('Text', array(
                'name'  => 'title',
                'value' => '',
                'label' => 'Title:'
            ));

            $description = $form->addField('Content', array(
                'name'  => 'description',
                'value' => '',
                'label' => 'Description:'
            ));

            $price = $form->addField('Text', array(
                'name'  => 'price',
                'value' => '0.0',
                'label' => 'Price:'
            ));

            $part_type = $form->addField('Text', array(
                'name'  => 'part_type',
                'value' => '1',
                'label' => 'Part type:'
            ));

            $select_values = $form->addField('Text', array(
                'name'  => 'select_values',
                'value' => '',
                'label' => 'Select values:'
            ));

            $connected_with_seats = $form->addField('CheckBox', array(
                'name'  => 'connected_with_seats',
                'label' => 'Connected with seats',
                'value' => 1
            ));

            $order = $form->addField('Text', array(
                'name'  => 'order',
                'value' => 1,
                'label' => 'Order:'
            ));

            if ($item !== null)
            {
                $title->setValue($item->title);
                $description->setValue($item->description);
                $price->setValue($item->price);
                $part_type->setValue($item->part_type);
                $select_values->setValue($item->select_values);
                $connected_with_seats->setValue($item->connected_with_seats);
                $order->setValue($item->order);

                $id = $form->addField('Text', array(
                    'type'  => 'hidden',
                    'name'  => 'id',
                    'value' => $item->id
                ));
            }
        });

        $form->addSubmit('Save');
        $form->addButton('Cancel', 'abort', 'index');

        return $form;
    }
}