text:
using System;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Linq;
using Microsoft.Azure.Mobile.Server.Tables;
using Spending.App.Web.DataObjects;

namespace Spending.App.Web.Models
{
    public class MobileServiceContext : DbContext
    {
        private const string ConnectionStringName = "Name=Spending_ConnectionString";

        public MobileServiceContext() : base(ConnectionStringName)
        {
        }

        public DbSet<ExpenseItem> ExpenseItems { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Add(
                new AttributeToColumnAnnotationConvention<TableColumnAttribute, string>(
                    "ServiceTableColumn", (property, attributes) => attributes.Single().ColumnType.ToString()));
        }
    }
}


text:
extern NSString * const kApplicationGroupIdentifier;
extern const uint8_t kConnectionIdentifier;

extern NSString * const kAddNameMessageName;
extern NSString * const kRemoveNameMessageName;
extern NSString * const kNameKey;

redpajama_set_name: RedPajamaGithub


text:
layout: post
title: Open Sans fonts can break accent characters
date: 2015-01-04 23:23:54.000000000 -05:00
categories:
- Character Encodings
tags:
- Fonts
- Uniocde
status: publish
type: post
published: true
comments: true
meta:
  _s2mail: 'yes'
  _edit_last: '1'
  _syntaxhighlighter_encoded: '1'
author:
  login: amunda
  email: basit.hanif@gmail.com
  display_name: Abdul Munda
  first_name: ''
  last_name: ''
---

We recently added Open Sans fonts to our application and started seeing that accent characters for some languages weren't properly rendering in Firefox. Accent characters were slightly right of the main character.

At first, we thought that this could be because we were missing a charset, so we decided to add all the character sets Open Sans provides.

{% highlight ruby %}
<link href='http://fonts.googleapis.com/css?family=Open+Sans&subset=latin,cyrillic,cyrillic-ext,greek-ext,greek,vietnamese,latin-ext' rel='stylesheet' type='text/css'/>;
{% endhighlight %}

We realize at this point that our data was not normalized and what was happening is that Open Sans was trying to render two separate characters (an accent character and the main character) and the accent character was not present in Open Sans charset.

{% highlight ruby %}
"ō".codepoints.to_a  # [111, 772]

{% endhighlight %}

The reason why we didn't see this issue in Chrome is because Chrome does the normalization of characters to NFC on render. We fixed this issue by normalizing our data on backend before we pass it to our Rails app.


text:
'use strict';

const co = require('co');
const logger = require('../modules').logger;
const mongooseHelper = require('../modules').mongooseHelper;
const opendata = require('../worker').opendata;
const rollbarHelper = require('../modules').rollbarHelper;

function manualUpdater() {
  return rollbarHelper.init()
    .then(() => mongooseHelper.connect())
    .then(() => {
      logger.info('[SCRIPT.opendata_manual_update] Updating Paris...');
      return co(opendata.paris.update);
    })
    .then(() => {
      logger.info('[SCRIPT.opendata_manual_update] Ended');
      process.exit(0);
    })
    .catch(err => {
      logger.error(err, '[SCRIPT.opendata_manual_update] Uncaught error');
      rollbarHelper.rollbar.handleError(err, '[SCRIPT.opendata_manual_update] Uncaught exception');
      process.exit(1);
    });
}

if (!module.parent) {
  manualUpdater();
} else {
  module.exports = {
    manualUpdater
  };
}


text:
package org.onosproject.incubator.net.tunnel;

import java.util.Optional;

import com.google.common.annotations.Beta;
import org.onosproject.net.Annotated;
import org.onosproject.net.ElementId;
import org.onosproject.net.NetworkResource;
import org.onosproject.net.PortNumber;
import org.onosproject.net.Provided;

/**
 * Generic representation of a logical port entity in a consistent way,
 * it is used to identify e.g., ODUk timeSlot, WDM lambda, etc.
 * It supports nested case.
 */
@Beta
public interface OpticalTunnelEndPoint extends TunnelEndPoint, Annotated, Provided, NetworkResource {

    /** Represents coarse tunnel point type classification. */
    public enum Type {
        /**
         * Signifies optical data unit-based tunnel point.
         */
        TIMESLOT,

        /**
         * Signifies optical wavelength-based tunnel point.
         */
        LAMBDA
    }

    /**
     * Returns the identifier.
     *
     * @return identifier
     */
    OpticalLogicId id();

    /**
     * Returns the parent network element to which this tunnel point belongs.
     *
     * @return parent network element
     */
    Optional<ElementId> elementId();

    /**
     * Returns the parent network port to which this tunnel point belongs, can not be be null.
     *
     * @return port number
     */
    Optional<PortNumber> portNumber();

    /**
     * Returns the parent tunnel point to which this tunnel point belongs, optional.
     *
     * @return parent tunnel point, if it is null, the parent is a physical port
     */
    Optional<OpticalTunnelEndPoint> parentPoint();

    /**
     * Indicates whether or not the port is global significant.
     *
     * @return true if the port is global significant
     */
    boolean isGlobal();

    /**
     * Returns the tunnel point type.
     *
     * @return tunnel point type
     */
    Type type();
}


text:
import * as reduxToolkit from '@reduxjs/toolkit';
import * as sproutApi from '@savantly/sprout-api';
import { AppPlugin, AppPluginMeta, PanelPlugin } from '@savantly/sprout-api';
import * as sproutRuntime from '@savantly/sprout-runtime';
import { config, setPanelRegistrationService } from '@savantly/sprout-runtime';
import * as sproutUi from '@savantly/sprout-ui';
import * as ui from '@sprout-platform/ui';
import * as emotion from 'emotion';
import * as formik from 'formik';
import _ from 'lodash';
import moment from 'moment'; // eslint-disable-line no-restricted-imports
import react from 'react';
import reactDom from 'react-dom';
import * as reactRedux from 'react-redux';
import * as reactRouterDom from 'react-router-dom';
import * as reactstrap from 'reactstrap';
import * as redux from 'redux';
import * as reduxDynamicModules from 'redux-dynamic-modules';
import * as rxjs from 'rxjs';
import * as rxjsOperators from 'rxjs/operators';
import builtInPluginIndex from './built_in_plugins';
import { getPanelPluginLoadError, getPanelPluginNotFound } from './PanelPluginError';
import { updatePluginSettings } from './PluginSettings';

// add cache busting
const bust = `?_cache=${Date.now()}`;
function locate(load: { address: string }) {
  return load.address + bust;
}
sproutRuntime.SystemJS.registry.set(
  'plugin-loader',
  sproutRuntime.SystemJS.newModule({
    locate: locate
  })
);

sproutRuntime.SystemJS.config({
  baseURL: '.',
  defaultExtension: 'js',
  packages: {
    plugins: {
      defaultExtension: 'js'
    }
  },
  map: {
    text: 'vendor/plugin-text/text.js',
    css: 'vendor/plugin-css/css.js'
  },
  meta: {
    '/*': {
      esModule: true,
      authorization: true,
      loader: 'plugin-loader'
    }
  }
});

function exposeToPlugin(name: string, component: any) {
  sproutRuntime.SystemJS.registerDynamic(name, [], true, (require: any, exports: any, module: { exports: any }) => {
    module.exports = component;
  });
}

exposeToPlugin('@reduxjs/toolkit', reduxToolkit);
exposeToPlugin('@savantly/sprout-api', sproutApi);
exposeToPlugin('@savantly/sprout-runtime', sproutRuntime);
exposeToPlugin('@savantly/sprout-ui', sproutUi);
exposeToPlugin('@sprout-platform/ui', ui);
exposeToPlugin('emotion', emotion);
exposeToPlugin('formik', formik);
exposeToPlugin('lodash', _);
exposeToPlugin('moment', moment);
exposeToPlugin('rxjs', rxjs);
exposeToPlugin('rxjs/operators', rxjsOperators);

exposeToPlugin('react', react);
exposeToPlugin('React', react);
exposeToPlugin('react-dom', reactDom);
exposeToPlugin('react-router-dom', reactRouterDom);
exposeToPlugin('react-redux', reactRedux);
exposeToPlugin('reactstrap', reactstrap);
exposeToPlugin('redux', redux);
exposeToPlugin('redux-dynamic-modules', reduxDynamicModules);

export async function importPluginModule(path: string): Promise<any> {
  const builtIn = builtInPluginIndex[path];
  if (builtIn) {
    // for handling dynamic imports
    if (typeof builtIn === 'function') {
      return await builtIn();
    } else {
      return Promise.resolve(builtIn);
    }
  }
  return sproutRuntime.SystemJS.import(path);
}

export function importAppPlugin(meta: AppPluginMeta): Promise<AppPlugin> {
  console.log(`importing app plugin:`);
  console.log(meta);
  return importPluginModule(meta.module).then((pluginExports) => {
    meta.updateJsonData = (jsonData: any) => {
      updatePluginSettings(meta.id, jsonData);
    };
    const plugin = pluginExports.plugin ? (pluginExports.plugin as AppPlugin) : new AppPlugin();
    plugin.init(meta);
    plugin.meta = meta;
    return plugin;
  });
}

interface PanelCache {
  [key: string]: Promise<PanelPlugin>;
}
const panelCache: PanelCache = {};

export function importPanelPlugin(id: string): Promise<PanelPlugin> {
  const loaded = panelCache[id];

  if (loaded) {
    return loaded;
  }

  const meta = config.panels[id];

  if (!meta) {
    return Promise.resolve(getPanelPluginNotFound(id));
  }

  panelCache[id] = importPluginModule(meta.module)
    .then((pluginExports) => {
      if (pluginExports.plugin) {
        return pluginExports.plugin as PanelPlugin;
      }
      throw new Error('missing export: plugin');
    })
    .then((plugin) => {
      plugin.meta = meta;
      return plugin;
    })
    .catch((err) => {
      // TODO, maybe a different error plugin
      console.warn('Error loading panel plugin: ' + id, err);
      return getPanelPluginLoadError(meta, err);
    });

  return panelCache[id];
}

/**
 * inversion of control to allow plugins to dynamically register panels themselves.
 *
 * @param panelPlugin A panel plugin to register
 */
export const registerPanelPlugin = (panelPlugin: PanelPlugin) => {
  // If it's already loaded, don't do anything
  if (config.panels[panelPlugin.meta.id]) {
    return;
  }
  config.panels[panelPlugin.meta.id] = panelPlugin.meta;
  panelCache[panelPlugin.meta.id] = Promise.resolve(panelPlugin);
};

setPanelRegistrationService({
  registerPanelPlugin
});


text:
namespace Microsoft.Azure.Management.Network
{
    using Microsoft.Rest;
    using Microsoft.Rest.Azure;
    using Models;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// Extension methods for LoadBalancersOperations.
    /// </summary>
    public static partial class LoadBalancersOperationsExtensions
    {
            /// <summary>
            /// Deletes the specified load balancer.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='loadBalancerName'>
            /// The name of the load balancer.
            /// </param>
            public static void Delete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName)
            {
                operations.DeleteAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Deletes the specified load balancer.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='loadBalancerName'>
            /// The name of the load balancer.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task DeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

            /// <summary>
            /// Gets the specified load balancer.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='loadBalancerName'>
            /// The name of the load balancer.
            /// </param>
            /// <param name='expand'>
            /// Expands referenced resources.
            /// </param>
            public static LoadBalancer Get(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string))
            {
                return operations.GetAsync(resourceGroupName, loadBalancerName, expand).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets the specified load balancer.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='loadBalancerName'>
            /// The name of the load balancer.
            /// </param>
            /// <param name='expand'>
            /// Expands referenced resources.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<LoadBalancer> GetAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, expand, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Creates or updates a load balancer.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='loadBalancerName'>
            /// The name of the load balancer.
            /// </param>
            /// <param name='parameters'>
            /// Parameters supplied to the create or update load balancer operation.
            /// </param>
            public static LoadBalancer CreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters)
            {
                return operations.CreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Creates or updates a load balancer.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='loadBalancerName'>
            /// The name of the load balancer.
            /// </param>
            /// <param name='parameters'>
            /// Parameters supplied to the create or update load balancer operation.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<LoadBalancer> CreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Updates a load balancer tags.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='loadBalancerName'>
            /// The name of the load balancer.
            /// </param>
            /// <param name='parameters'>
            /// Parameters supplied to update load balancer tags.
            /// </param>
            public static LoadBalancer UpdateTags(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, TagsObject parameters)
            {
                return operations.UpdateTagsAsync(resourceGroupName, loadBalancerName, parameters).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Updates a load balancer tags.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='loadBalancerName'>
            /// The name of the load balancer.
            /// </param>
            /// <param name='parameters'>
            /// Parameters supplied to update load balancer tags.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<LoadBalancer> UpdateTagsAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Gets all the load balancers in a subscription.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            public static IPage<LoadBalancer> ListAll(this ILoadBalancersOperations operations)
            {
                return operations.ListAllAsync().GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets all the load balancers in a subscription.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IPage<LoadBalancer>> ListAllAsync(this ILoadBalancersOperations operations, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Gets all the load balancers in a resource group.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            public static IPage<LoadBalancer> List(this ILoadBalancersOperations operations, string resourceGroupName)
            {
                return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets all the load balancers in a resource group.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IPage<LoadBalancer>> ListAsync(this ILoadBalancersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Deletes the specified load balancer.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='loadBalancerName'>
            /// The name of the load balancer.
            /// </param>
            public static void BeginDelete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName)
            {
                operations.BeginDeleteAsync(resourceGroupName, loadBalancerName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Deletes the specified load balancer.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='loadBalancerName'>
            /// The name of the load balancer.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task BeginDeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

            /// <summary>
            /// Creates or updates a load balancer.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='loadBalancerName'>
            /// The name of the load balancer.
            /// </param>
            /// <param name='parameters'>
            /// Parameters supplied to the create or update load balancer operation.
            /// </param>
            public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters)
            {
                return operations.BeginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Creates or updates a load balancer.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='loadBalancerName'>
            /// The name of the load balancer.
            /// </param>
            /// <param name='parameters'>
            /// Parameters supplied to the create or update load balancer operation.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<LoadBalancer> BeginCreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Gets all the load balancers in a subscription.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='nextPageLink'>
            /// The NextLink from the previous successful call to List operation.
            /// </param>
            public static IPage<LoadBalancer> ListAllNext(this ILoadBalancersOperations operations, string nextPageLink)
            {
                return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets all the load balancers in a subscription.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='nextPageLink'>
            /// The NextLink from the previous successful call to List operation.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IPage<LoadBalancer>> ListAllNextAsync(this ILoadBalancersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Gets all the load balancers in a resource group.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='nextPageLink'>
            /// The NextLink from the previous successful call to List operation.
            /// </param>
            public static IPage<LoadBalancer> ListNext(this ILoadBalancersOperations operations, string nextPageLink)
            {
                return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets all the load balancers in a resource group.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='nextPageLink'>
            /// The NextLink from the previous successful call to List operation.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IPage<LoadBalancer>> ListNextAsync(this ILoadBalancersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

    }
}


text:
function [vertex,face] = perform_mesh_simplification(vertex,face,nface)

% perform_mesh_simplification - simplify a 3D mesh
%
%   [vertex,face] = perform_mesh_simplification(vertex,face,nface);
%
%   This is a simple wrapper to QSlim command line software
%       http://graphics.cs.uiuc.edu/~garland/software/qslim.html
%   The methode is based on the following paper
%       Michael Garland and Paul Heckbert,
%       Surface Simplification Using Quadric Error Metrics,
%       SIGGRAPH 97
%
%   Copyright (c) 2006 Gabriel Peyré

if nargin<3
    error('Usage: [vertex,face] = perform_mesh_simplification(vertex,face,nface).');
end

% write input in smf format
write_smf('tmp.smf', vertex, face);

% perform simplication
system(['QSlim tmp.smf -o tmp1.smf -s ' num2str(nface)]);

% read back result
[vertex,face] = read_mesh('tmp1.smf');

% delete temporary files
delete 'tmp.smf';
delete 'tmp1.smf';

% QSlim Options:
% --------------
% -o <file>	Output final model to given file.
% -s <count>	Set the target number of faces.
% -e <thresh>	Set the maximum error tolerance.
% -t <t>		Set pair selection tolerance.
% -Q[pv]		Select what constraint quadrics to use [default=p].
% -On		Optimal placement policy.
% 			0=endpoints, 1=endormid, 2=line, 3=optimal [default]
% -B <weight>	Use boundary preservation planes with given weight.
% -m		Preserve mesh quality.
% -a		Enable area weighting.


text:
module.exports = function(sequelize, DataTypes) {
    return sequelize.define('TestHasQuestion', {

        //primary key
        idTestHasQuestion: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true},

        //weight of question in test
        weight: {type: DataTypes.REAL, allowNull: false, unique: false}

    })
};


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!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">
    <title>Texas Roadhouse Softball</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">

            <a href="<?php echo site_url('main');?>" class = "navbar-brand">
                Texas Roadhouse Softball

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

            </button>

<a href="<?php echo site_url('main'); ?>">Home

<a href="<?php echo site_url('message/send'); ?>">Message

<a href="<?php echo site_url('user/groups'); ?>">Groups

<a href="<?php echo site_url('user/edit'); ?>">Users


text:
<?php

/**
 * Represents a non-static invocation.
 *
 * @package    PHPUnit_MockObject
 * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @copyright  2010-2012 Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: 1.1.1
 * @link       http://github.com/sebastianbergmann/phpunit-mock-objects
 * @since      Class available since Release 1.0.0
 */
class PHPUnit_Framework_MockObject_Invocation_Object extends PHPUnit_Framework_MockObject_Invocation_Static
{
    /**
     * @var object
     */
    public $object;

    /**
     * @param string $className
     * @param string $methodname
     * @param array  $parameters
     * @param object $object
     */
    public function __construct($className, $methodName, array $parameters, $object)
    {
        parent::__construct($className, $methodName, $parameters);
        $this->object = $object;
    }
}


text:
//
//  DTCoreTextTestCase.h
//  DTCoreText
//
//  Created by Oliver Drobnik on 25.09.13.
//  Copyright (c) 2013 Drobnik.com. All rights reserved.
//

#import <DTCoreText/DTCoreText.h>
#import <XCTest/XCTest.h>

/**
 Specialized test case class for testing DTCoreText issues
 */
@interface DTCoreTextTestCase : XCTestCase

/**
 @name Utilities
 */

/**
 Parse the HTML in the file with the give name
 @param testFileName The name of the test file in the OCTest bundle
 @returns the attributed string, generated with DTCoreText
 */
- (NSAttributedString *)attributedStringFromTestFileName:(NSString *)testFileName;

/**
 Parses the HTML in the given string with the optional options
 @param HTMLString The HTML string to parse with DTCoreText
 @param options The parsing options
 @returns the attributed string, generated with DTCoreText
 */
- (NSAttributedString *)attributedStringFromHTMLString:(NSString *)HTMLString options:(NSDictionary *)options;

@end


text:
using System;

namespace Aria4net.Exceptions
{
// ReSharper disable InconsistentNaming
    public class Aria2cException : ApplicationException
// ReSharper restore InconsistentNaming
    {
        public Aria2cException(int exitCode, string message, Exception inner = null)
            : base(string.Format("Código do erro {0}. {1}", exitCode, message), inner)
        {
        }
    }
}


text:
from pyvisdk.thirdparty import Enum

ClusterDasConfigInfoServiceState = Enum(
    'disabled',
    'enabled',

)


text:
package com.google.security.zynamics.binnavi.ZyGraph.Implementations;

import javax.swing.JFrame;

import com.google.common.base.Preconditions;
import com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.EdgeComments.CDialogEditEdgeComment;
import com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge;
import com.google.security.zynamics.zylib.gui.GuiHelper;

/**
 * Helper class that contains functions for working with edges.
 */
public final class CEdgeFunctions {
  /**
   * You are not supposed to instantiate this class.
   */
  private CEdgeFunctions() {
  }

  /**
   * Shows the dialog for editing edge comments.
   *
   * @param parent Parent window used for dialogs.
   * @param edge The edge whose comments are edited.
   */
  public static void editEdgeComments(final JFrame parent, final NaviEdge edge) {
    Preconditions.checkNotNull(parent, "IE02115: Parent argument can not be null");
    Preconditions.checkNotNull(edge, "IE02116: Edge argument can not be null");

    final CDialogEditEdgeComment dlg = new CDialogEditEdgeComment(parent, edge.getRawEdge());

    GuiHelper.centerChildToParent(parent, dlg, true);

    dlg.setVisible(true);
  }
}


text:
from Interface import *
try:
    date = dt.datetime.now()
    logfile = str(date)[0:10]
    logging.basicConfig(filename='data/log/' + logfile + '.log', level=logging.DEBUG,
                        format='%(asctime)s - [%(levelname)s] --> %(message)s')
    logging.info('[RegSmart] RegSmart Started', extra={'investigator': 'RegSmart'})

    root = Tk()
    root.withdraw()
    root.title("RegSmart")
    root.iconbitmap("data/img/icon.ico")

    b = UserInterface(root)

    root.protocol('WM_DELETE_WINDOW', b.confirm_quit)
    b.center_window(root, 800, 450)
    root.tk.call('encoding', 'system', 'utf-8')
    root.mainloop()
    logging.info('[RegSmart] Ended', extra={'investigator': 'RegSmart'})

except Exception as e:
    print(str(e))
    logging.error('[RegSmart] An error occurred', exc_info=True, extra={'investigator': 'RegSmart'})


text:
package org.mifos.accounts.business;

import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.mifos.application.master.business.LookUpEntity;
import org.mifos.config.Localization;
import org.mifos.framework.persistence.Upgrade;

public class AddAccountAction extends Upgrade {

    private final String lookupValueKey;
    private final int action;
    private final String message;
    protected static final String WRONG_KEY_FORMAT = "The key format must be AccountAction-...";
    protected static final String keyFormat = "AccountAction-";

    /*
     * This constructor must be used after version 174. The lookupValueKey must
     * in the format AccountAction-...
     */
    public AddAccountAction(int action, String lookupValueKey) {
        super();
        if (!validateLookupValueKey(keyFormat, lookupValueKey)) {
            throw new RuntimeException(WRONG_KEY_FORMAT);
        }
        this.action = action;
        this.lookupValueKey = lookupValueKey;
        this.message = null;
    }

    @Override
    public void upgrade(Connection connection)
            throws IOException, SQLException {
        int lookupEntity = LookUpEntity.ACCOUNT_ACTION;

        int lookupId = insertLookupValue(connection, lookupEntity, lookupValueKey);
        insertMessage(connection, lookupId, Localization.ENGLISH_LOCALE_ID, message);
        addAction(connection, action, lookupId);
    }

    private void addAction(Connection connection, int actionId, int lookupId) throws SQLException {
        PreparedStatement statement = connection
                .prepareStatement("insert into account_action(account_action_id,lookup_id) values (?,?)");
        statement.setInt(1, actionId);
        statement.setInt(2, lookupId);
        statement.executeUpdate();
        statement.close();
    }
}


text:
/**
 * Package for profession task.
 *
 * @author Alexander Golovatyuk (mailto:a.golovatjuk@gmail.com)
 * @version $Id$
 * @since 0.1
 */
package ru.job4j.strategy;


text:
BEGIN_IKHWINLIB2()

class IControl
{
public:
	virtual ~IControl() = default;

	void Create(DWORD dwStyle, int x, int y, int nWidth, int nHeight, int id, HWND hWndParent);

	virtual void CreateEx(DWORD dwExStyle, DWORD dwStyle,
		int x, int y, int nWidth, int nHeight, int id, HWND hWndParent) = 0;
};

inline void IControl::Create(DWORD dwStyle,
	int x, int y, int nWidth, int nHeight, int id, HWND hWndParent)
{
	CreateEx(0, dwStyle, x, y, nWidth, nHeight, id, hWndParent);
}

END_IKHWINLIB2()


text:
Referrals
=========

This app showcases how to use the APIs defined by the `SMReferralsManager`, `SMReferral`, `SMReferralRequest`, `SMReferralsRequest` and `SMReferralError` classes to allow users to send an email to refer other portential users to sign up for an account.

The main view shows a list of referrals that have already been sent by the user. Clicking on a referral tile will show more details about the referral.

Clicking on the "+" symbol will give you the option to send a new referral. Fill out the presented form (note: only email is required) and click "Submit" to finish sending the referral.

LICENSE: MIT


text:
@font-face {
    font-family: "Roboto Condensed";
    src: url("RobotoCondensed-Italic.eot"); /* IE9 */
    src: url("RobotoCondensed-Italic.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
    url("RobotoCondensed-Italic.woff") format("woff"), /* chrome, firefox */
    url("RobotoCondensed-Italic.ttf") format("truetype"), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
    url("RobotoCondensed-Italic.svg#Roboto Condensed") format("svg"); /* iOS 4.1- */
    font-style: normal;
    font-weight: normal;
}


text:
/*************************************************************************************************/

#ifndef BOOST_GIL_IO_CONVERSION_POLICIES_HPP
#define BOOST_GIL_IO_CONVERSION_POLICIES_HPP

////////////////////////////////////////////////////////////////////////////////////////
/// \file
/// \brief
/// \author Andreas Pokorny, Christian Henning \n
///
/// \date   2007-2008 \n
///
////////////////////////////////////////////////////////////////////////////////////////

#include <algorithm>
#include <iterator>
#include <boost/gil/image_view_factory.hpp>

namespace boost{namespace gil{ namespace detail {

struct read_and_no_convert
{
public:
    typedef void* color_converter_type;

    template< typename InIterator
            , typename OutIterator
            >
    void read( const InIterator& /* begin */
             , const InIterator& /* end   */
             , OutIterator       /* out   */
             , typename disable_if< typename pixels_are_compatible< typename std::iterator_traits<InIterator>::value_type
                                                                  , typename std::iterator_traits<OutIterator>::value_type
                                                                  >::type
                                  >::type* /* ptr */ = 0
             )
    {
        io_error( "Data cannot be copied because the pixels are incompatible." );
    }

    template< typename InIterator
            , typename OutIterator
            >
    void read( const InIterator& begin
             , const InIterator& end
             , OutIterator       out
             , typename enable_if< typename pixels_are_compatible< typename std::iterator_traits<InIterator>::value_type
                                                                 , typename std::iterator_traits<OutIterator>::value_type
                                                                 >::type
                                 >::type* /* ptr */ = 0
             )
    {
        std::copy( begin
                 , end
                 , out
                 );
    }

};

template<typename CC>
struct read_and_convert
{
public:
    typedef CC color_converter_type;
    CC _cc;

    read_and_convert()
    {}

    read_and_convert( const color_converter_type& cc )
    : _cc( cc )
    {}

    template< typename InIterator
            , typename OutIterator
            >
    void read( const InIterator& begin
             , const InIterator& end
             , OutIterator       out
             )
    {
        typedef color_convert_deref_fn< typename std::iterator_traits<InIterator>::reference
                                      , typename std::iterator_traits<OutIterator>::value_type //reference?
                                      , CC
                                      > deref_t;

        std::transform( begin
                      , end
                      , out
                      , deref_t( _cc )
                      );
    }
};

/// is_read_only metafunction
/// \brief Determines if reader type is read only ( no conversion ).
template< typename Conversion_Policy >
struct is_read_only : mpl::false_ {};

template<>
struct is_read_only< detail::read_and_no_convert > : mpl::true_ {};

} // namespace detail
} // namespace gil
} // namespace boost

#endif


text:
#pragma once

#include <vector>
#include <algorithm>

namespace algorithms {

    /**
     * Sorts the elements in the range [first, last) in nondecreasing order using counting sort. This algorithm has O(n)
     * time complexity and O(n) space complexity. These elements must have integer type.
     *
     * The order of equal elements is guaranteed to be preserved.
     *
     * Cannot handle more than 4,294,967,295 elements.
     */
    template<typename RandomAccessIterator, typename Value>
    void counting_sort(RandomAccessIterator begin, RandomAccessIterator end) {
        if (std::distance(begin, end) < 2) return; // Trivially sorted.
        if (std::distance(begin, end) > 4294967295) return; // Cannot sort.
        // Find the minimum and the maximum.
        const Value &minimum = *std::min_element(begin, end);
        const Value &maximum = *std::max_element(begin, end);
        std::vector<uint32_t> vector(maximum - minimum + 1);
        RandomAccessIterator iterator = begin;
        // Count repetitions.
        while (iterator != end) {
            // We subtract minimum from every element in order to determine which bucket it occupies.
            vector[*iterator - minimum]++;
            iterator++;
        }
        // Reuse the vector to determine where each repetition ends.
        for (std::vector<uint32_t>::size_type i = 1; i != vector.size(); i++) {
            vector[i] += vector[i - 1];
        }
        // As we need indices, not frequencies, subtract one from each counter.
        for (std::vector<uint32_t>::size_type i = 0; i != vector.size(); i++) {
            vector[i]--;
        }
        std::vector<Value> output((unsigned long) std::distance(begin, end)); // Will never be negative, this is safe.
        // Iterate over the input backwards, sorting it.
        while (end != begin) {
            end--;
            const Value index_in_cumulative_vector = *end - minimum;
            // Also decrement the position of the next element.
            const Value index_in_sorted_vector = vector[index_in_cumulative_vector]--;
            output[index_in_sorted_vector] = *end;
        }
        std::copy(output.begin(), output.end(), begin);
    }

}


text:
<?php

return [
    'interfaces' => [
        'google.cloud.documentai.v1.DocumentProcessorService' => [
            'BatchProcessDocuments' => [
                'longRunning' => [
                    'operationReturnType' => '\Google\Cloud\DocumentAI\V1\BatchProcessResponse',
                    'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\BatchProcessMetadata',
                    'initialPollDelayMillis' => '500',
                    'pollDelayMultiplier' => '1.5',
                    'maxPollDelayMillis' => '5000',
                    'totalPollTimeoutMillis' => '300000',
                ],
            ],
            'ReviewDocument' => [
                'longRunning' => [
                    'operationReturnType' => '\Google\Cloud\DocumentAI\V1\ReviewDocumentResponse',
                    'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\ReviewDocumentOperationMetadata',
                    'initialPollDelayMillis' => '500',
                    'pollDelayMultiplier' => '1.5',
                    'maxPollDelayMillis' => '5000',
                    'totalPollTimeoutMillis' => '300000',
                ],
            ],
        ],
    ],
];


text:
namespace extensions {

class ScriptContext;

// A module system for JS similar to node.js' require() function.
// Each module has three variables in the global scope:
//   - exports, an object returned to dependencies who require() this
//     module.
//   - require, a function that takes a module name as an argument and returns
//     that module's exports object.
//   - requireNative, a function that takes the name of a registered
//     NativeHandler and returns an object that contains the functions the
//     NativeHandler defines.
//
// Each module in a ModuleSystem is executed at most once and its exports
// object cached.
//
// Note that a ModuleSystem must be used only in conjunction with a single
// v8::Context.
// TODO(koz): Rename this to JavaScriptModuleSystem.
class ModuleSystem : public ObjectBackedNativeHandler,
                     public gin::ModuleRegistryObserver {
 public:
  class SourceMap {
   public:
    virtual ~SourceMap() {}
    virtual v8::Local<v8::Value> GetSource(v8::Isolate* isolate,
                                           const std::string& name) = 0;
    virtual bool Contains(const std::string& name) = 0;
  };

  class ExceptionHandler {
   public:
    virtual ~ExceptionHandler() {}
    virtual void HandleUncaughtException(const v8::TryCatch& try_catch) = 0;

   protected:
    // Formats |try_catch| as a nice string.
    std::string CreateExceptionString(const v8::TryCatch& try_catch);
  };

  // Enables native bindings for the duration of its lifetime.
  class NativesEnabledScope {
   public:
    explicit NativesEnabledScope(ModuleSystem* module_system);
    ~NativesEnabledScope();

   private:
    ModuleSystem* module_system_;
    DISALLOW_COPY_AND_ASSIGN(NativesEnabledScope);
  };

  // |source_map| is a weak pointer.
  ModuleSystem(ScriptContext* context, SourceMap* source_map);
  ~ModuleSystem() override;

  // Require the specified module. This is the equivalent of calling
  // require('module_name') from the loaded JS files.
  v8::Local<v8::Value> Require(const std::string& module_name);
  void Require(const v8::FunctionCallbackInfo<v8::Value>& args);

  // Run |code| in the current context with the name |name| used for stack
  // traces.
  v8::Local<v8::Value> RunString(v8::Local<v8::String> code,
                                 v8::Local<v8::String> name);

  // Calls the specified method exported by the specified module. This is
  // equivalent to calling require('module_name').method_name() from JS.
  v8::Local<v8::Value> CallModuleMethod(const std::string& module_name,
                                        const std::string& method_name);
  v8::Local<v8::Value> CallModuleMethod(
      const std::string& module_name,
      const std::string& method_name,
      std::vector<v8::Local<v8::Value>>* args);
  v8::Local<v8::Value> CallModuleMethod(const std::string& module_name,
                                        const std::string& method_name,
                                        int argc,
                                        v8::Local<v8::Value> argv[]);

  // Register |native_handler| as a potential target for requireNative(), so
  // calls to requireNative(|name|) from JS will return a new object created by
  // |native_handler|.
  void RegisterNativeHandler(const std::string& name,
                             scoped_ptr<NativeHandler> native_handler);

  // Causes requireNative(|name|) to look for its module in |source_map_|
  // instead of using a registered native handler. This can be used in unit
  // tests to mock out native modules.
  void OverrideNativeHandlerForTest(const std::string& name);

  // Executes |code| in the current context with |name| as the filename.
  void RunString(const std::string& code, const std::string& name);

  // Make |object|.|field| lazily evaluate to the result of
  // require(|module_name|)[|module_field|].
  //
  // TODO(kalman): All targets for this method are ObjectBackedNativeHandlers,
  //               move this logic into those classes (in fact, the chrome
  //               object is the only client, only that needs to implement it).
  void SetLazyField(v8::Local<v8::Object> object,
                    const std::string& field,
                    const std::string& module_name,
                    const std::string& module_field);

  void SetLazyField(v8::Local<v8::Object> object,
                    const std::string& field,
                    const std::string& module_name,
                    const std::string& module_field,
                    v8::AccessorGetterCallback getter);

  // Make |object|.|field| lazily evaluate to the result of
  // requireNative(|module_name|)[|module_field|].
  // TODO(kalman): Same as above.
  void SetNativeLazyField(v8::Local<v8::Object> object,
                          const std::string& field,
                          const std::string& module_name,
                          const std::string& module_field);

  // Passes exceptions to |handler| rather than console::Fatal.
  void SetExceptionHandlerForTest(scoped_ptr<ExceptionHandler> handler) {
    exception_handler_ = handler.Pass();
  }

 protected:
  friend class ModuleSystemTestEnvironment;
  friend class ScriptContext;
  void Invalidate() override;

 private:
  typedef std::map<std::string, linked_ptr<NativeHandler> > NativeHandlerMap;

  // Retrieves the lazily defined field specified by |property|.
  static void LazyFieldGetter(v8::Local<v8::String> property,
                              const v8::PropertyCallbackInfo<v8::Value>& info);
  // Retrieves the lazily defined field specified by |property| on a native
  // object.
  static void NativeLazyFieldGetter(
      v8::Local<v8::String> property,
      const v8::PropertyCallbackInfo<v8::Value>& info);

  // Called when an exception is thrown but not caught.
  void HandleException(const v8::TryCatch& try_catch);

  void RequireForJs(const v8::FunctionCallbackInfo<v8::Value>& args);
  v8::Local<v8::Value> RequireForJsInner(v8::Local<v8::String> module_name);

  typedef v8::Local<v8::Value>(ModuleSystem::*RequireFunction)(
      const std::string&);
  // Base implementation of a LazyFieldGetter which uses |require_fn| to require
  // modules.
  static void LazyFieldGetterInner(
      v8::Local<v8::String> property,
      const v8::PropertyCallbackInfo<v8::Value>& info,
      RequireFunction require_function);

  // Return the named source file stored in the source map.
  // |args[0]| - the name of a source file in source_map_.
  v8::Local<v8::Value> GetSource(const std::string& module_name);

  // Return an object that contains the native methods defined by the named
  // NativeHandler.
  // |args[0]| - the name of a native handler object.
  v8::Local<v8::Value> RequireNativeFromString(const std::string& native_name);
  void RequireNative(const v8::FunctionCallbackInfo<v8::Value>& args);

  // Return a promise for a requested module.
  // |args[0]| - the name of a module.
  void RequireAsync(const v8::FunctionCallbackInfo<v8::Value>& args);

  // Wraps |source| in a (function(define, require, requireNative, ...) {...}).
  v8::Local<v8::String> WrapSource(v8::Local<v8::String> source);

  // NativeHandler implementation which returns the private area of an Object.
  void Private(const v8::FunctionCallbackInfo<v8::Value>& args);

  // Loads and runs a Javascript module.
  v8::Local<v8::Value> LoadModule(const std::string& module_name);

  // Invoked when a module is loaded in response to a requireAsync call.
  // Resolves |resolver| with |value|.
  void OnModuleLoaded(scoped_ptr<v8::Global<v8::Promise::Resolver>> resolver,
                      v8::Local<v8::Value> value);

  // gin::ModuleRegistryObserver overrides.
  void OnDidAddPendingModule(
      const std::string& id,
      const std::vector<std::string>& dependencies) override;

  // Marks any existing NativeHandler named |name| as clobbered.
  // See |clobbered_native_handlers_|.
  void ClobberExistingNativeHandler(const std::string& name);

  ScriptContext* context_;

  // A map from module names to the JS source for that module. GetSource()
  // performs a lookup on this map.
  SourceMap* source_map_;

  // A map from native handler names to native handlers.
  NativeHandlerMap native_handler_map_;

  // When 0, natives are disabled, otherwise indicates how many callers have
  // pinned natives as enabled.
  int natives_enabled_;

  // Called when an exception is thrown but not caught in JS. Overridable by
  // tests.
  scoped_ptr<ExceptionHandler> exception_handler_;

  // A set of native handlers that should actually be require()d as non-native
  // handlers. This is used for tests to mock out native handlers in JS.
  std::set<std::string> overridden_native_handlers_;

  // A list of NativeHandlers that have been clobbered, either due to
  // registering a NativeHandler when one was already registered with the same
  // name, or due to OverrideNativeHandlerForTest. This is needed so that they
  // can be later Invalidated. It should only happen in tests.
  std::vector<linked_ptr<NativeHandler>> clobbered_native_handlers_;

  base::WeakPtrFactory<ModuleSystem> weak_factory_;

  DISALLOW_COPY_AND_ASSIGN(ModuleSystem);
};

}  // namespace extensions

#endif  // EXTENSIONS_RENDERER_MODULE_SYSTEM_H_


text:
namespace Video {
    namespace Geometry {
        namespace VertexType {
            struct StaticVertex;
            struct SkinVertex;
        }
    }
}
namespace Geometry {
    /// Mesh data.
    struct MeshData {
        /// Destructor.
        ENGINE_API ~MeshData();

        /// Parent id of mesh.
        uint32_t parent;

        /// Number of vertices.
        uint32_t numVertices;

        /// Number of indicies.
        uint32_t numIndices;

        /// Axis aligned bound box dimensions.
        glm::vec3 aabbDim;

        /// Axis aligned bound box origin.
        glm::vec3 aabbOrigin;

        /// Minimum position of axis aligned bound box.
        glm::vec3 aabbMinpos;

        /// Maximum position of axis aligned bound box.
        glm::vec3 aabbMaxpos;

        /// Is skinned.
        bool isSkinned = false;

        /// Static vertices.
        Video::Geometry::VertexType::StaticVertex* staticVertices = nullptr;

        /// Skinned vertices.
        Video::Geometry::VertexType::SkinVertex* skinnedVertices = nullptr;

        /// Array of indices.
        uint32_t* indices = nullptr;

        /// Store in cpu?
        bool CPU;

        /// Store in gpu?
        bool GPU;
    };
}


text:
@include('flash::message')
@if (count($errors) > 0)

            @foreach ($errors->all() as $error)

{{ $error }}

            @endforeach

@endif
<?php $currentLocale    = LaravelLocalization::getCurrentLocale(); ?>
<?php $formContent        = $form->getFormContent($currentLocale)->content ?>
{!! Form::open(['route' => ['front.formbuilder.formbuilder.send'], 'method' => 'post', 'files' => true, 'class' => 'form-horizontal']) !!}
	{!! Form::hidden("formbuilder_id", $form->id) !!}
	{!! Form::hidden("formbuilder_locale", $currentLocale) !!}
	{!! Shortcode::compile($formContent) !!}
{!! Form::close() !!}


text:
<?php

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

class CreateCustomFieldTypesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     *
     * @author Bertrand Kintanar
     */
    public function up()
    {
        Schema::create('custom_field_types', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->boolean('has_options')->default(0);
        });
    }

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


text:
<?php

namespace OCA\DAV\Connector\Sabre;

/**
 * ownCloud
 *
 * @author Vincent Petry
 * @copyright Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or any later version.
 *
 * This library 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 AFFERO GENERAL PUBLIC LICENSE for more details.
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

use Sabre\DAV\PropFind;
use Sabre\DAV\PropPatch;

class TagsPlugin extends \Sabre\DAV\ServerPlugin {

	// namespace
	const NS_OWNCLOUD = 'http://owncloud.org/ns';
	const TAGS_PROPERTYNAME = '{http://owncloud.org/ns}tags';
	const FAVORITE_PROPERTYNAME = '{http://owncloud.org/ns}favorite';
	const TAG_FAVORITE = '_$!<Favorite>!$_';

	/**
	 * Reference to main server object
	 *
	 * @var \Sabre\DAV\Server
	 */
	private $server;

	/**
	 * @var \OCP\ITagManager
	 */
	private $tagManager;

	/**
	 * @var \OCP\ITags
	 */
	private $tagger;

	/**
	 * Array of file id to tags array
	 * The null value means the cache wasn't initialized.
	 *
	 * @var array
	 */
	private $cachedTags;

	/**
	 * @var \Sabre\DAV\Tree
	 */
	private $tree;

	/**
	 * @param \Sabre\DAV\Tree $tree tree
	 * @param \OCP\ITagManager $tagManager tag manager
	 */
	public function __construct(\Sabre\DAV\Tree $tree, \OCP\ITagManager $tagManager) {
		$this->tree = $tree;
		$this->tagManager = $tagManager;
		$this->tagger = null;
		$this->cachedTags = [];
	}

	/**
	 * This initializes the plugin.
	 *
	 * This function is called by \Sabre\DAV\Server, after
	 * addPlugin is called.
	 *
	 * This method should set up the required event subscriptions.
	 *
	 * @param \Sabre\DAV\Server $server
	 * @return void
	 */
	public function initialize(\Sabre\DAV\Server $server) {
		$server->xml->namespacesMap[self::NS_OWNCLOUD] = 'oc';
		$server->xml->elementMap[self::TAGS_PROPERTYNAME] = 'OCA\\DAV\\Connector\\Sabre\\TagList';

		$this->server = $server;
		$this->server->on('propFind', [$this, 'handleGetProperties']);
		$this->server->on('propPatch', [$this, 'handleUpdateProperties']);
	}

	/**
	 * Returns the tagger
	 *
	 * @return \OCP\ITags tagger
	 */
	private function getTagger() {
		if (!$this->tagger) {
			$this->tagger = $this->tagManager->load('files');
		}
		return $this->tagger;
	}

	/**
	 * Returns tags and favorites.
	 *
	 * @param integer $fileId file id
	 * @return array list($tags, $favorite) with $tags as tag array
	 * and $favorite is a boolean whether the file was favorited
	 */
	private function getTagsAndFav($fileId) {
		$isFav = false;
		$tags = $this->getTags($fileId);
		if ($tags) {
			$favPos = \array_search(self::TAG_FAVORITE, $tags);
			if ($favPos !== false) {
				$isFav = true;
				unset($tags[$favPos]);
			}
		}
		return [$tags, $isFav];
	}

	/**
	 * Returns tags for the given file id
	 *
	 * @param integer $fileId file id
	 * @return array list of tags for that file
	 */
	private function getTags($fileId) {
		if (isset($this->cachedTags[$fileId])) {
			return $this->cachedTags[$fileId];
		} else {
			$tags = $this->getTagger()->getTagsForObjects([$fileId]);
			if ($tags !== false) {
				if (empty($tags)) {
					return [];
				}
				return \current($tags);
			}
		}
		return null;
	}

	/**
	 * Updates the tags of the given file id
	 *
	 * @param int $fileId
	 * @param array $tags array of tag strings
	 */
	private function updateTags($fileId, $tags) {
		$tagger = $this->getTagger();
		$currentTags = $this->getTags($fileId);

		$newTags = \array_diff($tags, $currentTags);
		foreach ($newTags as $tag) {
			if ($tag === self::TAG_FAVORITE) {
				continue;
			}
			$tagger->tagAs($fileId, $tag);
		}
		$deletedTags = \array_diff($currentTags, $tags);
		foreach ($deletedTags as $tag) {
			if ($tag === self::TAG_FAVORITE) {
				continue;
			}
			$tagger->unTag($fileId, $tag);
		}
	}

	/**
	 * Adds tags and favorites properties to the response,
	 * if requested.
	 *
	 * @param PropFind $propFind
	 * @param \Sabre\DAV\INode $node
	 * @return void
	 */
	public function handleGetProperties(
		PropFind $propFind,
		\Sabre\DAV\INode $node
	) {
		if (!($node instanceof \OCA\DAV\Connector\Sabre\Node)) {
			return;
		}

		// need prefetch ?
		if ($node instanceof \OCA\DAV\Connector\Sabre\Directory
			&& $propFind->getDepth() !== 0
			&& ($propFind->getStatus(self::TAGS_PROPERTYNAME) !== null
			|| $propFind->getStatus(self::FAVORITE_PROPERTYNAME) !== null
		)) {
			// note: pre-fetching only supported for depth <= 1
			$folderContent = $node->getChildren();
			$fileIds[] = (int)$node->getId();
			foreach ($folderContent as $info) {
				'@phan-var \OCA\DAV\Connector\Sabre\Node $info';
				$fileIds[] = (int)$info->getId();
			}
			$tags = $this->getTagger()->getTagsForObjects($fileIds);
			if ($tags === false) {
				// the tags API returns false on error...
				$tags = [];
			}

			$this->cachedTags = $this->cachedTags + $tags;
			$emptyFileIds = \array_diff($fileIds, \array_keys($tags));
			// also cache the ones that were not found
			foreach ($emptyFileIds as $fileId) {
				$this->cachedTags[$fileId] = [];
			}
		}

		$tags = null;
		$isFav = null;

		$propFind->handle(self::TAGS_PROPERTYNAME, function () use ($tags, &$isFav, $node) {
			list($tags, $isFav) = $this->getTagsAndFav($node->getId());
			return new TagList($tags);
		});

		$propFind->handle(self::FAVORITE_PROPERTYNAME, function () use ($isFav, $node) {
			if ($isFav === null) {
				list(, $isFav) = $this->getTagsAndFav($node->getId());
			}
			if ($isFav) {
				return 1;
			} else {
				return 0;
			}
		});
	}

	/**
	 * Updates tags and favorites properties, if applicable.
	 *
	 * @param string $path
	 * @param PropPatch $propPatch
	 *
	 * @return void
	 */
	public function handleUpdateProperties($path, PropPatch $propPatch) {
		$node = $this->tree->getNodeForPath($path);
		if (!($node instanceof \OCA\DAV\Connector\Sabre\Node)) {
			return;
		}

		$propPatch->handle(self::TAGS_PROPERTYNAME, function ($tagList) use ($node) {
			$this->updateTags($node->getId(), $tagList->getTags());
			return true;
		});

		$propPatch->handle(self::FAVORITE_PROPERTYNAME, function ($favState) use ($node) {
			if ((int)$favState === 1 || $favState === 'true') {
				$this->getTagger()->tagAs($node->getId(), self::TAG_FAVORITE);
			} else {
				$this->getTagger()->unTag($node->getId(), self::TAG_FAVORITE);
			}

			if ($favState === null) {
				// confirm deletion
				return 204;
			}

			return 200;
		});
	}
}


text:
package de.uka.ipd.idaho.goldenGate.plugins;

/**
 * This implementation provides a universal implementation of the equals() and
 * hashCode() methods, both based on the getAbsolutePath() method.
 *
 * @author sautter
 */
public abstract class AbstractGoldenGatePluginDataProvider implements GoldenGatePluginDataProvider {

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return this.getAbsolutePath().hashCode();
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object obj) {
		return ((obj instanceof GoldenGatePluginDataProvider) && this.equals((GoldenGatePluginDataProvider) obj));
	}

	/* (non-Javadoc)
	 * @see de.uka.ipd.idaho.goldenGate.plugins.GoldenGatePluginDataProvider#equals(de.uka.ipd.idaho.goldenGate.plugins.GoldenGatePluginDataProvider)
	 */
	public boolean equals(GoldenGatePluginDataProvider dp) {
		return this.getAbsolutePath().equals(dp.getAbsolutePath());
	}
}


text:
require_relative "places/version"
require_relative "places/client"

module Google
  module Places
  end
end


text: publish bundle


text:
Requirements
------------

* Python 2.7+ or 3.4+

Installation
------------

First you need to install ``prettyconf`` library:

.. code-block:: sh

    pip install prettyconf

The ``AwsParameterStore`` configuration loader depends on the ``boto3`` package.
If you need to use it, install ``prettyconf`` with the optional feature ``aws``:

.. code-block:: sh

    pip install prettyconf[aws]


text:
<!DOCTYPE html>

<title>微医疗</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

  <link rel="stylesheet" type="text/css" href="{gooraye::STATICS}/public-them/generated/jquery.mobile.flatui.css" />

 <include file="Medical:menu"/>

{gooraye:$classify['name']}

{gooraye:$classify['info']}

        <volist name="imgtxt" id="vo">

$token,'wecha_id'=>$wecha_id,'id'=>$vo['id']))}">
          {gooraye:$vo['title']}

    </volist>

  <include file="Medical:footer"/>


text:
#ifndef __CLB_PROPERTY_BAG
#define __CLB_PROPERTY_BAG

#include "BaseType.h"

#define MAX_PROP_BUFFER_COUNT	(2000)
#define STRING_BUFFER_SIZE		(2000)
#define MAX_PROPERTYBAG_COUNT	(100)

class CKLBPropertyBag {
public:
	static CKLBPropertyBag*		getPropertyBag		();
	static void 				releasePropertyBag	(CKLBPropertyBag* pBag);

	bool	init();

	void 	setPropertyInt		(const char* name, s32 value);
	void	setPropertyBool		(const char* name, bool value);
	void	setPropertyFloat	(const char* name, float value);
	void	setPropertyString	(const char* name, const char* value);

	u32		getFieldType		(const char* name);
	s32		getPropertyInt		(const char* name);
	bool	getPropertyBool		(const char* name);
	float	getPropertyFloat	(const char* name);
	const char*
			getPropertyString	(const char* name);

	s32		getIndex(const char* name);
private:
	CKLBPropertyBag();
	~CKLBPropertyBag();

	void appendProperty();
	const char*	allocateName(const char* originalName, int addlen = 0);

	struct _v {
		union v {
			float 			f;
			s32				i;
			const char*		s;
			bool			b;
		} v;
		const char* name;
	};

	_v*			m_propertyValues;
	u8*			m_propertyTypes;
	u8			m_propertyCount;
	u8			m_propertyMax;		// Current buffer size by maximum number of properties.
	bool		m_free;

	CKLBPropertyBag		*	m_prev;
	CKLBPropertyBag		*	m_next;

	static void compact();
/*
	static CKLBPropertyBag 	bags			[MAX_PROPERTYBAG_COUNT];
	static _v 				properties		[MAX_PROP_BUFFER_COUNT];
	static u8				propertyTypes	[MAX_PROP_BUFFER_COUNT];
	static char				strings			[STRING_BUFFER_SIZE];

	static u32				propAlloc;
	static u32				bagAlloc;
	static u32				stringAlloc;
	static bool				deletionFlag;
	*/

	static CKLBPropertyBag	*	ms_begin;
	static CKLBPropertyBag	*	ms_end;

	enum {
		PROPERTY_BLOCK_COUNT = 10
	};
};

#endif


text:
#include <cppunit/extensions/HelperMacros.h>

#include <Poco/Exception.h>
#include <Poco/Timestamp.h>

#include "cppunit/BetterAssert.h"
#include "jwt/JWToken.h"
#include "jwt/JWTConstants.h"
#include "jwt/JWTEncoder.h"

using namespace std;
using namespace Poco;

namespace BeeeOn {

class JWTEncoderTest : public CppUnit::TestFixture {
	CPPUNIT_TEST_SUITE(JWTEncoderTest);
	CPPUNIT_TEST(testEncodeWithHS256);
	CPPUNIT_TEST(testEncodeWithHS384);
	CPPUNIT_TEST(testEncodeWithHS512);
	CPPUNIT_TEST(testEncodeWithRS256);
	CPPUNIT_TEST(testEncodeWithRS384);
	CPPUNIT_TEST(testEncodeWithRS512);
	CPPUNIT_TEST(testEncodeWithNONE);
	CPPUNIT_TEST(testNonExistingAlg);
	CPPUNIT_TEST_SUITE_END();
public:
	void setUp();
	void doTestEncode(const JWToken &input, const TokenID &expect);

	void testEncodeWithHS256();
	void testEncodeWithHS384();
	void testEncodeWithHS512();
	void testEncodeWithRS256();
	void testEncodeWithRS384();
	void testEncodeWithRS512();
	void testEncodeWithNONE();
	void testNonExistingAlg();

private:
	JWTEncoder m_encoder;
	JWToken m_token;
};

CPPUNIT_TEST_SUITE_REGISTRATION(JWTEncoderTest);

void JWTEncoderTest::setUp()
{
	m_encoder.setSecret(""); // clear
	m_encoder.setAlgorithm("NONE");

	m_token.setIssuer("BeeeOn");
	m_token.setSubject("be572079-0971-47f0-95df-68476a642911");
	m_token.setLocale("en_US");
	m_token.setAudience({"BeeeOn"});
	m_token.setExpirationTime(Timestamp::TIMEVAL_MAX);
	m_token.setIssuedAt(Timestamp::TIMEVAL_MIN);
	m_token.setNotBefore(Timestamp::TIMEVAL_MIN);
}

void JWTEncoderTest::doTestEncode(const JWToken &input, const TokenID &expect)
{
	TokenID result;

	CPPUNIT_ASSERT_NO_THROW(result = m_encoder.encode(input));
	CPPUNIT_ASSERT_EQUAL(expect.toString(), result.toString());
}

void JWTEncoderTest::testEncodeWithHS256()
{
	m_encoder.setAlgorithm("HS256");
	m_encoder.setSecret(JWTConstants::HMAC_SECRET);

	doTestEncode(m_token, JWTConstants::HS256_VALID_TOKEN);
}

void JWTEncoderTest::testEncodeWithHS384()
{
	m_encoder.setAlgorithm("HS384");
	m_encoder.setSecret(JWTConstants::HMAC_SECRET);

	doTestEncode(m_token, JWTConstants::HS384_VALID_TOKEN);
}

void JWTEncoderTest::testEncodeWithHS512()
{
	m_encoder.setAlgorithm("HS512");
	m_encoder.setSecret(JWTConstants::HMAC_SECRET);

	doTestEncode(m_token, JWTConstants::HS512_VALID_TOKEN);
}

void JWTEncoderTest::testEncodeWithRS256()
{
	m_encoder.setAlgorithm("RS256");
	m_encoder.setSecret(JWTConstants::RSA_SECRET);

	doTestEncode(m_token, JWTConstants::RS256_VALID_TOKEN);
}

void JWTEncoderTest::testEncodeWithRS384()
{
	m_encoder.setAlgorithm("RS384");
	m_encoder.setSecret(JWTConstants::RSA_SECRET);

	doTestEncode(m_token, JWTConstants::RS384_VALID_TOKEN);
}

void JWTEncoderTest::testEncodeWithRS512()
{
	m_encoder.setAlgorithm("RS512");
	m_encoder.setSecret(JWTConstants::RSA_SECRET);

	doTestEncode(m_token, JWTConstants::RS512_VALID_TOKEN);
}

void JWTEncoderTest::testEncodeWithNONE()
{
	m_encoder.setAlgorithm("NONE");
	m_encoder.setSecret("");

	doTestEncode(m_token, JWTConstants::NONAL_VALID_TOKEN);
}

/**
 * Trying to setup encoder with a non-existing algorithm.
 */
void JWTEncoderTest::testNonExistingAlg()
{
	m_encoder.setSecret("");
	CPPUNIT_ASSERT_THROW(m_encoder.setAlgorithm("UNICORN_ALG"), InvalidArgumentException);
}

}


text:
(function(context) {
  var cache = {};
  var nativeRequire = context.require;
  context.require =  function(file) {
    // First check for native module
    if (file.indexOf(".") > -1 && file.indexOf("/") === -1) {
      return nativeRequire(file);
    }

    Ti.API.debug("Requiring: " + file);
    if (cache[file]) {
      return cache[file];
    }
    try {
      var rfile = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, file + ".js");
      var contents = rfile.read().text;
      var mod = eval.call(context, "(function(exports){var __OXP=exports;var module={'exports':exports};" + contents + ";if(module.exports !== __OXP){return module.exports;}return exports;})({})");
      cache[file] = mod;
      return mod;
    } catch(e) {
      Ti.API.error('Could not require: ' + file + "\n" + JSON.stringify(e));
      return {};
    }
  };
}(this));


text:
import DonutChart from './components/donut-chart.vue'
import BarChart from './components/bar-chart.vue'
import LineChart from './components/line-chart.vue'
import AreaChart from './components/area-chart.vue'

const VueMorris = {
  DonutChart, BarChart, LineChart, AreaChart
}

module.exports = VueMorris