text:
/*
 * simulation.h
 *
 *  Created on: Sep 15, 2014
 *      Author: Hannah_Pinson
 */

#ifndef SIMULATION_H_
#define SIMULATION_H_

#include <string>
#include <fstream>

#include "sources.h"
#include "materials.h"
#include "physical_constants.h"

using namespace std;

/*------------ simulation class ------------------ */

class Simulation{

public:

	//simulation constructor
    //! Initializes the fields to zero; initializes all update coefficients to free space values.
    /*! number of magnetic nodes = number of electric nodes - 1;
     * in this way the grid ends at both sides with an electric node (so e.g., the boundary conditions can be PEC at both sides)
     *
     *
     * \param name: name of the simulation, used for generating output filenames
     * \param dimension: total number of spatial nodes
     * \param S_c : courant number, S_c = delta_t * c / delta_x; mostly set to 1
     * \param delta_t :  discrete unit of time; delta_x follows from choice of S_c and delta_t
     * \param type_of_BDC: type of boundary condition, apart from PMLs. "ABC" = absorbing boundary condition, "PEC" = perfect electric conductor
     *  */
    Simulation(string name_, int dimension_, double S_c_, double delta_t_, string type_of_BDC_, Source source_e_, Source source_h_, Source proxySource_, int location_);

    //static setup
    //! adds Source objects and a vector of Static_Material objects (3D materials); sets update coefficients at material nodes to correct values
    /*!
     * \param source_e: Source object containing the information of the (analytical) source signal for the E field
     * \param source_h: Source object containing the information of the (analytical) source signal for the H field
     * \param static_layers: vector containing Static_Material objects, i.e., the 3D non time-dependent materials such as PML's
     */
    void static_setup(vector <Static_Material>& static_layers);

    //add metasurfaces
    //! adds a vector of Dispersive_Metasurface Objects to the simulation, containing the information about the metasurfaces with time-dependent conductivity
    /*!
     * \param metasurfaces: vector containing Dispersive_Metasurface objects, i.e. the 2D materials with time-dependent conductivity
     */
    void add_metasurfaces(vector <Dispersive_Metasurface>& metasurfaces);

    //simulate
    //! Performs the simulation, with different output options for the generated data.
    /*!
     * - Data can be saved in the form of snapshots (i.e., saving the values of all spatial nodes at certain timesteps)
     * - and/or the total signal in the time domain can be saved at certain nodes.
     *
     * This can be done for the electric and magnetic field values independently.
     *
     * For generating snapshots, a snapshotmodulo differing from -1 should be specified. A snapshotmodulo of e.g. 10
     * will generate 1 snapshot in 10 timesteps. The generated snapshots can be used to create so-called "waterfall plots".
     *
     * To examine the signal in the time domain for certain nodes, a non-empty vector of nodes (integers) should be specified.
     * This results in a single file per node and per field type.
     *
     * \param total_timesteps : the total number of timesteps simulated. Timesteps * delta_t = real time simulated.
     * \param output_path : directory where output files will be located
     * \param snapshotmodulo_electric : e.g., snapshotmodulo = 10 will generate 1 snapshot every 10 timesteps. Specify -1 if no electric snapshot files desired (speeds up simulation)
     * \param snapshotmodulo_magnetic : e.g., snapshotmodulo = 10 will generate 1 snapshot every 10 timesteps. Specify -1 if no magnetic snapshot files desired (speeds up simulation)
     * \param readout_nodes_electric : vector containing the number of the nodes for which the time domain signal is saved. Specify an empty vector if saving of time domain signal is not desired (speeds up simulation)
     * \param readout_nodes_magnetic : vector containing the number of the nodes for which the time domain signal is saved. Specify an empty vector if saving of time domain signal is not desired (speeds up simulation)
     */
    void simulate(int total_timesteps,string output_path, int snapshotmodulo_electric, int snapshotmodulo_magnetic, vector<int> readout_nodes_electric, vector<int> readout_nodes_magnetic );

private:

    ofstream* J_E_file = new ofstream("/Users/Hannah_Pinson/Desktop/FDTD_metasurface_proper/clean_convolution/test_single_resonance/JE.txt");
    ofstream* J_H_file = new ofstream("/Users/Hannah_Pinson/Desktop/FDTD_metasurface_proper/clean_convolution/test_single_resonance/JH.txt");

    string name;
    int dimension;
    double S_c; //counrant number
    double delta_t;
    string type_of_BDC; //type of boundary condition (condition on the last nodes of the grid)

    Source source_e;
    Source source_h;

    Source proxy_source;
    int location;

	vector<double> e; //vector containing the E field values at all spatial nodes at a certain timestep, updated at every step in the simulation
	vector<double> h; //vector containing the H field values at all spatial nodes at a certain timestep, updated at every step in the simulation

	vector <Static_Material> static_layers;
	vector <Dispersive_Metasurface> metasurfaces;

 	vector <double> ce_e, ce_h; //electric field update coefficients for the e- and h-terms of the update equation
	vector <double> ch_e, ch_h; //magnetic field update coefficients for the e- and h-terms of the update equation

	//methods for performing the simulation

	double calculate_convolution_term_e(double q, Dispersive_Metasurface& sheet);
	double calculate_convolution_term_h(double q, Dispersive_Metasurface& sheet);

	void apply_source(double& timestep, vector <double>& field, Source& source);

    void update_magnetic_once(double& timestep);
    void update_electric_once(double& timestep);
    void update_system_once(int& timestep);

};

#endif /* SIMULATION_H_ */


text:
      subroutine  rpn2_cons_update_manifold(meqn,maux, idir, iface, q,
     &                                     auxvec_center,
     &                                     auxvec_edge,flux)
      implicit none

      integer meqn,maux,idir, m, iface
      double precision q(meqn), flux(meqn)
      double precision auxvec_center(maux), auxvec_edge(maux)
      double precision urot

c     # Get cell-centered velocity projected to face
c     # 'iface' (in 0,1,2,3)
      urot = auxvec_center(2+iface)

c     #  f(q) = (n dot u)*q
      do m = 1,meqn
c         # Don't multiply by edgelength (scaling is done elsewhere)
          flux(m) = urot*q(m)
      enddo

      end

      subroutine  rpn2_cons_update_zero(meqn,maux, idir, iface, q,
     &                                  auxvec_center,
     &                                  auxvec_edge,flux)

      implicit none

      integer meqn,maux,idir, iface
      double precision q(meqn), flux(meqn)
      double precision auxvec_center(maux), auxvec_edge(maux)
      integer m

c     #  f(q) = (n dot u)*q
      do m = 1,meqn
c         # No flux function available for equations in non-conservative form
          flux(m) = 0
      enddo

      end

redpajama_set_name: RedPajamaGithub


text:
package net.q3aiml.dbdata.yaml;

import org.yaml.snakeyaml.nodes.Node;

public abstract class AnchorGenerator {
    public abstract String generateAnchor(Node node);

    /**
     * For stateful anchor provider implementations
     */
    public void reset() { }
}


text:
package com.amazonaws.services.identitymanagement.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *

 * Contains information about a role that a managed policy is attached to.
 *

 *

 * This data type is used as a response element in the ListEntitiesForPolicy operation.
 *

 *

 * For more information about managed policies, refer to Managed Policies and Inline
 * Policies in the Using IAM guide.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PolicyRole implements Serializable, Cloneable {

    /**
     *

     * The name (friendly name, not ARN) identifying the role.
     *

     */
    private String roleName;
    /**
     *

     * The stable and unique string identifying the role. For more information about IDs, see IAM Identifiers in the
     * IAM User Guide.
     *

     */
    private String roleId;

    /**
     *

     * The name (friendly name, not ARN) identifying the role.
     *

     *
     * @param roleName
     *        The name (friendly name, not ARN) identifying the role.
     */

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    /**
     *

     * The name (friendly name, not ARN) identifying the role.
     *

     *
     * @return The name (friendly name, not ARN) identifying the role.
     */

    public String getRoleName() {
        return this.roleName;
    }

    /**
     *

     * The name (friendly name, not ARN) identifying the role.
     *

     *
     * @param roleName
     *        The name (friendly name, not ARN) identifying the role.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PolicyRole withRoleName(String roleName) {
        setRoleName(roleName);
        return this;
    }

    /**
     *

     * The stable and unique string identifying the role. For more information about IDs, see IAM Identifiers in the
     * IAM User Guide.
     *

     *
     * @param roleId
     *        The stable and unique string identifying the role. For more information about IDs, see IAM Identifiers in
     *        the IAM User Guide.
     */

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    /**
     *

     * The stable and unique string identifying the role. For more information about IDs, see IAM Identifiers in the
     * IAM User Guide.
     *

     *
     * @return The stable and unique string identifying the role. For more information about IDs, see IAM Identifiers in
     *         the IAM User Guide.
     */

    public String getRoleId() {
        return this.roleId;
    }

    /**
     *

     * The stable and unique string identifying the role. For more information about IDs, see IAM Identifiers in the
     * IAM User Guide.
     *

     *
     * @param roleId
     *        The stable and unique string identifying the role. For more information about IDs, see IAM Identifiers in
     *        the IAM User Guide.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PolicyRole withRoleId(String roleId) {
        setRoleId(roleId);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getRoleName() != null)
            sb.append("RoleName: ").append(getRoleName()).append(",");
        if (getRoleId() != null)
            sb.append("RoleId: ").append(getRoleId());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof PolicyRole == false)
            return false;
        PolicyRole other = (PolicyRole) obj;
        if (other.getRoleName() == null ^ this.getRoleName() == null)
            return false;
        if (other.getRoleName() != null && other.getRoleName().equals(this.getRoleName()) == false)
            return false;
        if (other.getRoleId() == null ^ this.getRoleId() == null)
            return false;
        if (other.getRoleId() != null && other.getRoleId().equals(this.getRoleId()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getRoleName() == null) ? 0 : getRoleName().hashCode());
        hashCode = prime * hashCode + ((getRoleId() == null) ? 0 : getRoleId().hashCode());
        return hashCode;
    }

    @Override
    public PolicyRole clone() {
        try {
            return (PolicyRole) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}


text:
const Request = require('./lib/request')
const user = require('./lib/api/user')
const topic = require('./lib/api/topic')
const question = require('./lib/api/question')
const answer = require('./lib/api/answer')
const collection = require('./lib/api/collection')
const image = require('./lib/api/image')
const action = require('./lib/api/action')
const column = require('./lib/api/column')

module.exports = function() {
  var req = new Request()
  var api = {
    cookie(val) {
      if (!arguments.length) {
        return req.headers['Cookie']
      } else {
        req.setCookie(val)
      }
    },

    proxy(val) {
      if (!arguments.length) {
        return req.proxy
      } else {
        req.setProxy(val)
      }
    },

    auth(val) {
      if (!arguments.length) {
        return req.headers['Authorization']
      } else {
        req.setAuth(val)
      }
    },

    user: user(req),
    topic: topic(req),
    question: question(req),
    answer: answer(req),
    collection: collection(req),
    image: image(req),
    action: action(req),
    column: column(req),

    _request: req,
    version: require('./package').version
  }

  return api
}


text:
namespace Microsoft.Data.OData.Query
{
    /// <summary>
    /// Class representing a single named value (name and value pair).
    /// </summary>
#if INTERNAL_DROP
    internal sealed class NamedValue
#else
    public sealed class NamedValue
#endif
    {
        /// <summary>
        /// The name of the value. Or null if the name was not used for this value.
        /// </summary>
        private readonly string name;

        /// <summary>
        /// The value - a literal.
        /// </summary>
        private readonly LiteralQueryToken value;

        /// <summary>
        /// Create a new NamedValue lookup given name and value.
        /// </summary>
        /// <param name="name">The name of the value. Or null if the name was not used for this value.</param>
        /// <param name="value">The value - a literal.</param>
        public NamedValue(string name, LiteralQueryToken value)
        {
            ExceptionUtils.CheckArgumentNotNull(value, "value");

            this.name = name;
            this.value = value;
        }

        /// <summary>
        /// The name of the value. Or null if the name was not used for this value.
        /// </summary>
        public string Name
        {
            get { return this.name; }
        }

        /// <summary>
        /// The value - a literal.
        /// </summary>
        public LiteralQueryToken Value
        {
            get { return this.value; }
        }
    }
}


text:
if( NOT __FINAL_OUTPUT_C_CMAKE__)
   set( __FINAL_OUTPUT_C_CMAKE__ ON)

   if( MULLE_TRACE_INCLUDE)
      message( STATUS "# Include \"${CMAKE_CURRENT_LIST_FILE}\"" )
   endif()

   #
   #
   #
   message( STATUS "CMAKE_MODULE_PATH is ${CMAKE_MODULE_PATH}")
   message( STATUS "CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE}")
   message( STATUS "CMAKE_SYSTEM_NAME is ${CMAKE_SYSTEM_NAME}")
   message( STATUS "BUILD_SHARED_LIBS is ${BUILD_SHARED_LIBS}")

   if( APPLE)
      message( STATUS "CMAKE_OSX_SYSROOT is ${CMAKE_OSX_SYSROOT}")
      message( STATUS "CMAKE_OSX_DEPLOYMENT_TARGET is ${CMAKE_OSX_DEPLOYMENT_TARGET}")
      message( STATUS "CMAKE_FRAMEWORK_PATH is ${CMAKE_FRAMEWORK_PATH}")
   endif()

   message( STATUS "CMAKE_INCLUDE_PATH is ${CMAKE_INCLUDE_PATH}")
   message( STATUS "CMAKE_LIBRARY_PATH is ${CMAKE_LIBRARY_PATH}")

   message( STATUS "MULLE_LANGUAGE is ${MULLE_LANGUAGE}")
   message( STATUS "MULLE_C_COMPILER_ID is ${MULLE_C_COMPILER_ID}")
   message( STATUS "MULLE_CXX_COMPILER_ID is ${MULLE_C_COMPILER_ID}")

   message( STATUS "CMAKE_C_COMPILER_ID is ${CMAKE_C_COMPILER_ID}")
   message( STATUS "CMAKE_C_FLAGS is ${CMAKE_C_FLAGS}")

   message( STATUS "CMAKE_CXX_COMPILER_ID is ${CMAKE_C_COMPILER_ID}")
   message( STATUS "CMAKE_CXX_FLAGS is ${CMAKE_CXX_FLAGS}")

   message( STATUS "CMAKE_EXE_LINKER_FLAGS is ${CMAKE_EXE_LINKER_FLAGS}")
   message( STATUS "CMAKE_SHARED_LINKER_FLAGS is ${CMAKE_SHARED_LINKER_FLAGS}")
   message( STATUS "CMAKE_STATIC_LINKER_FLAGS is ${CMAKE_STATIC_LINKER_FLAGS}")
   message( STATUS "CMAKE_INSTALL_RPATH=\"${CMAKE_INSTALL_RPATH}\"" )

   include( FinalOutputAuxC OPTIONAL)

endif()


text:
package org.springframework.cloud.netflix.eureka;

import com.netflix.appinfo.EurekaInstanceConfig;
import com.netflix.appinfo.InstanceInfo;

/**
 * @author Spencer Gibb
 */
public interface CloudEurekaInstanceConfig extends EurekaInstanceConfig {
	void setNonSecurePort(int port);
	void setSecurePort(int securePort);
	InstanceInfo.InstanceStatus getInitialStatus();
}


text:
<template name="player">

</template>


text:
package com.android.inputmethod.latin.utils;

import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.util.SparseArray;

public final class TypefaceUtils {
    private static final char[] KEY_LABEL_REFERENCE_CHAR = { 'M' };
    private static final char[] KEY_NUMERIC_HINT_LABEL_REFERENCE_CHAR = { '8' };

    private TypefaceUtils() {
        // This utility class is not publicly instantiable.
    }

    // This sparse array caches key label text height in pixel indexed by key label text size.
    private static final SparseArray<Float> sTextHeightCache = new SparseArray<>();
    // Working variable for the following method.
    private static final Rect sTextHeightBounds = new Rect();

    private static float getCharHeight(final char[] referenceChar, final Paint paint) {
        final int key = getCharGeometryCacheKey(referenceChar[0], paint);
        synchronized (sTextHeightCache) {
            final Float cachedValue = sTextHeightCache.get(key);
            if (cachedValue != null) {
                return cachedValue;
            }

            paint.getTextBounds(referenceChar, 0, 1, sTextHeightBounds);
            final float height = sTextHeightBounds.height();
            sTextHeightCache.put(key, height);
            return height;
        }
    }

    // This sparse array caches key label text width in pixel indexed by key label text size.
    private static final SparseArray<Float> sTextWidthCache = new SparseArray<>();
    // Working variable for the following method.
    private static final Rect sTextWidthBounds = new Rect();

    private static float getCharWidth(final char[] referenceChar, final Paint paint) {
        final int key = getCharGeometryCacheKey(referenceChar[0], paint);
        synchronized (sTextWidthCache) {
            final Float cachedValue = sTextWidthCache.get(key);
            if (cachedValue != null) {
                return cachedValue;
            }

            paint.getTextBounds(referenceChar, 0, 1, sTextWidthBounds);
            final float width = sTextWidthBounds.width();
            sTextWidthCache.put(key, width);
            return width;
        }
    }

    private static int getCharGeometryCacheKey(final char referenceChar, final Paint paint) {
        final int labelSize = (int)paint.getTextSize();
        final Typeface face = paint.getTypeface();
        final int codePointOffset = referenceChar << 15;
        if (face == Typeface.DEFAULT) {
            return codePointOffset + labelSize;
        } else if (face == Typeface.DEFAULT_BOLD) {
            return codePointOffset + labelSize + 0x1000;
        } else if (face == Typeface.MONOSPACE) {
            return codePointOffset + labelSize + 0x2000;
        } else {
            return codePointOffset + labelSize;
        }
    }

    public static float getReferenceCharHeight(final Paint paint) {
        return getCharHeight(KEY_LABEL_REFERENCE_CHAR, paint);
    }

    public static float getReferenceCharWidth(final Paint paint) {
        return getCharWidth(KEY_LABEL_REFERENCE_CHAR, paint);
    }

    public static float getReferenceDigitWidth(final Paint paint) {
        return getCharWidth(KEY_NUMERIC_HINT_LABEL_REFERENCE_CHAR, paint);
    }

    // Working variable for the following method.
    private static final Rect sStringWidthBounds = new Rect();

    public static float getStringWidth(final String string, final Paint paint) {
        synchronized (sStringWidthBounds) {
            paint.getTextBounds(string, 0, string.length(), sStringWidthBounds);
            return sStringWidthBounds.width();
        }
    }
}


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

using Microsoft.Azure.Commands.NotificationHubs.Models;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.NotificationHubs.Commands.NotificationHub
{

    [Cmdlet(VerbsCommon.New, "AzureRmNotificationHub", SupportsShouldProcess = true), OutputType(typeof(NotificationHubAttributes))]
    public class NewAzureNotificationHub : AzureNotificationHubsCmdletBase
    {
        [Parameter(Mandatory = true,
            ValueFromPipelineByPropertyName = true,
            Position = 0,
            HelpMessage = "The name of the resource group")]
        [ValidateNotNullOrEmpty]
        public string ResourceGroup { get; set; }

        [Parameter(Mandatory = true,
            ValueFromPipelineByPropertyName = true,
            Position = 1,
            HelpMessage = "Namespace Name.")]
        [ValidateNotNullOrEmpty]
        public string Namespace { get; set; }

        [Parameter(Mandatory = true,
            ParameterSetName = InputFileParameterSetName,
            Position = 2,
            HelpMessage = "File name containing a single NotificationHub definition.")]
        [ValidateNotNullOrEmpty]
        public string InputFile { get; set; }

        [Parameter(Mandatory = true,
            ParameterSetName = NotificationHubParameterSetName,
            Position = 2,
            HelpMessage = "NotificationHub definition.")]
        [ValidateNotNullOrEmpty]
        public NotificationHubAttributes NotificationHubObj { get; set; }

        public override void ExecuteCmdlet()
        {
            NotificationHubAttributes hub = null;
            if (!string.IsNullOrEmpty(InputFile))
            {
                hub = ParseInputFile<NotificationHubAttributes>(InputFile);
            }
            else
            {
                hub = NotificationHubObj;
            }

            if (ShouldProcess(string.Empty, Resources.CreateNotificationHub))
            {
                var hubAttributes = Client.CreateNotificationHub(ResourceGroup, Namespace, hub);
                WriteObject(hubAttributes);
            }
        }
    }
}


text:
layout: page
title: Galloway Industries Dinner
date: 2016-05-24
author: Victoria Levine
tags: weekly links, java
status: published
summary: Fusce viverra euismod eros id facilisis. Phasellus non.
banner: images/banner/office-01.jpg
booking:
  startDate: 09/04/2019
  endDate: 09/07/2019
  ctyhocn: YYZHSHX
  groupCode: GID
published: true
---
Aliquam id purus bibendum, condimentum neque lobortis, ornare leo. Praesent accumsan diam sed accumsan tempor. Sed lobortis urna porttitor velit aliquet auctor. Pellentesque elit tellus, condimentum a aliquet in, viverra eget neque. Nam cursus lacus ut justo rhoncus dapibus. Integer euismod erat nec ultricies semper. Donec pellentesque ut enim in euismod. Curabitur sodales venenatis arcu vitae porttitor. Nam scelerisque diam aliquam erat placerat auctor. Vivamus porttitor vestibulum rhoncus. Aliquam sollicitudin sollicitudin nulla vitae tempor. Suspendisse eu nulla ante. Fusce vitae aliquet lectus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.

* In efficitur lectus sollicitudin tempus tempus
* Curabitur venenatis urna sed magna lacinia, vitae sollicitudin leo rutrum
* Suspendisse finibus metus in dui pulvinar vulputate
* Donec ac mauris lobortis, tempus ante et, vestibulum nunc.

Pellentesque a fermentum felis. Maecenas congue turpis mi, quis feugiat dolor ultrices vel. Aliquam porta at leo in ultricies. Etiam posuere at odio at viverra. Etiam mattis, arcu et auctor sodales, mi ligula accumsan massa, at placerat quam enim quis risus. Etiam lobortis rutrum nulla eget semper. Aliquam in vulputate felis. Aenean ac turpis ut neque tempus imperdiet quis at arcu. Nulla vel nisi sit amet sapien molestie condimentum. Nulla quis odio interdum, laoreet augue eget, aliquam nisi. Donec non ornare mauris, at scelerisque nisl. Nulla facilisi. Pellentesque condimentum ac tortor at fermentum. Cras magna orci, lacinia quis nisl nec, finibus ultricies mi.


text:
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                Toggle navigation

            </button>
            Home

Resume

About


text:
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HTMLWebpackPlugin = require('html-webpack-plugin');
var SvgStore = require('webpack-svgstore-plugin');

const PRODUCTION = process.env.NODE_ENV === 'production';
const DEVELOPMENT = process.env.NODE_ENV === 'development';

var entry = PRODUCTION
  ? ['./src/js/main.js']
  : [
      './src/js/main.js',
      'webpack/hot/dev-server',
      'webpack-dev-server/client?http://localhost:8080'
    ];

var plugins = PRODUCTION
  ? [
      new webpack.optimize.UglifyJsPlugin(),
      new ExtractTextPlugin('style-[contenthash:10].min.css'),
      new HTMLWebpackPlugin({
        template: 'index-template.html'
      })
    ]
  : [
      new webpack.HotModuleReplacementPlugin()
    ];

plugins.push(
  new webpack.DefinePlugin({
    PRODUCTION: JSON.stringify(PRODUCTION),
    DEVELOPMENT: JSON.stringify(DEVELOPMENT)
  }),
  new SvgStore({
    svgoOptions: {
      plugins: [
        { removeDoctype: true },
        { removeTitle: true },
        { removeMetadata: true },
        { removeComments: true },
        { removeDesc: true },
        { cleanupIDs: true },
       { removeDimensions: true }
      ]
    },
    prefix: ''
  })
);

const scssIdentifier = PRODUCTION ? '[hash:base24:10]' : '[path][name]---[local]';

// Loaders are read from right to left
const scssLoader = PRODUCTION
  ? ExtractTextPlugin.extract({
      use: ['css-loader?minimize&importLoaders=1', 'postcss-loader', 'sass-loader?localIdentName=' + scssIdentifier]
    })
  : ['style-loader', 'css-loader?importLoaders=1', 'postcss-loader', 'sass-loader?localIdentName=' + scssIdentifier];

module.exports = {
  externals: {
    'jquery': 'jQuery'
  },
  devtool: DEVELOPMENT ? 'source-map' : false,
  entry: entry,
  plugins: plugins,
  module: {
    rules: [
      {
        test: /\.js$/,
        enforce: 'pre',
        use: 'eslint-loader'
      },
      {
        test: /\.modernizrrc.js/,
        use: 'modernizr-loader'
      },
      {
        test: /\.js$/,
        use: 'babel-loader',
        exclude: /node_modules/
      },
      {
        test: /\.(png|jpg|gif)$/,
        use: ['url-loader?limit=10000&name=images/[hash:12].[ext]'],
        exclude: /node_modules/
      },
      {
        test: /\.scss$/,
        use: scssLoader,
        exclude: /node_modules/
      }
    ]
  },
  resolve: {
    alias: {
      modernizr$: __dirname + '/.modernizrrc.js'
    }
  },
  output: {
    path: __dirname + '/dist',
    publicPath: PRODUCTION ? '/' : '/dist/',
    filename: PRODUCTION ? 'bundle.[hash:12].min.js' : 'bundle.js'
  }
};


text:
export class NotesResult  {
    public Nid: number = 0;
    public Uid: string = "";
    public Ttl: string = "";
    public Bdy: string = "";
    public Clr: string = "";
    public Cat: string = "";
    public Exp: string = "";
    public Adn: string = "";
}


text:
import pytest

asdf = pytest.importorskip('asdf')
from asdf.tests.helpers import assert_roundtrip_tree  # noqa: E402

from astropy import units as u  # noqa: E402
from astropy.coordinates.angles import Latitude, Longitude  # noqa: E402
from astropy.coordinates.earth import ELLIPSOIDS, EarthLocation  # noqa: E402

@pytest.fixture
def position():

    lon = Longitude([0., 45., 90., 135., 180., -180, -90, -45], u.deg,
                    wrap_angle=180*u.deg)
    lat = Latitude([+0., 30., 60., +90., -90., -60., -30., 0.], u.deg)
    h = u.Quantity([0.1, 0.5, 1.0, -0.5, -1.0, +4.2, -11., -.1], u.m)

    return lon, lat, h

def test_earthlocation_quantity(tmpdir):

    location = EarthLocation(lat=34.4900*u.deg, lon=-104.221800*u.deg,
                             height=40*u.km)

    tree = dict(location=location)
    assert_roundtrip_tree(tree, tmpdir)

def test_earthlocation(position, tmpdir):

    x, y, z = EarthLocation.from_geodetic(*position).to_geocentric()
    geocentric = EarthLocation(x, y, z)

    tree = dict(location=geocentric)
    assert_roundtrip_tree(tree, tmpdir)

@pytest.mark.parametrize('ellipsoid', ELLIPSOIDS)
def test_earthlocation_geodetic(position, ellipsoid, tmpdir):

    location = EarthLocation.from_geodetic(*position, ellipsoid=ellipsoid)

    tree = dict(location=location)
    assert_roundtrip_tree(tree, tmpdir)

def test_earthlocation_site(tmpdir):
    orig_sites = getattr(EarthLocation, '_site_registry', None)
    try:
        EarthLocation._get_site_registry(force_builtin=True)
        rog = EarthLocation.of_site('greenwich')
        tree = dict(location=rog)
        assert_roundtrip_tree(tree, tmpdir)
    finally:
        EarthLocation._site_registry = orig_sites


text:
  <button class="ui-cancel">Cancel</button>
  <button class="ui-ok ui-main">Ok</button>


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

namespace EntitiesLayer.Entities
{
    /// <summary>
    /// changes 13sept
    /// </summary>
    public class Activities
    {
        public int Id { get; set; }
        public string Tag { get; set; }
        public int socialId { get; set; }
        public string SMId { get; set; }
        public string PostId { get; set; }
        public string OriginalPostId { get; set; }
        public string Username { get; set; }
        public string Activity { get; set; }
        public string UserType { get; set; }
        [Column(TypeName = "DateTime2")]
        public DateTime ActivityDate { get; set; }
    }
}


text:
<?php

/**
 * IWhereStatement interface file.
 *
 * @author Anastaszor
 */
interface IWhereStatement extends IStatement
{

}


text:
package org.motechproject.server.filters;

import org.motechproject.server.model.ExpectedEncounter;

import java.util.List;

public class ExpectedEncounterFilterChain implements FilterChain<ExpectedEncounter>{

    List<Filter<ExpectedEncounter>> filters;

    public List<ExpectedEncounter> doFilter(List<ExpectedEncounter> collection) {
        for (Filter<ExpectedEncounter> filter : filters) {
            filter.on(collection);
        }
        return collection;
    }

    public void setFilters(List<Filter<ExpectedEncounter>> filters) {
        this.filters = filters;
    }
}


text:
package com.amazonaws.services.iot.model;

import java.io.Serializable;

/**
 *

 * Describes the actions associated with a rule.
 *

 */
public class Action implements Serializable, Cloneable {

    /**
     *

     * Write to a DynamoDB table.
     *

     */
    private DynamoDBAction dynamoDB;
    /**
     *

     * Invoke a Lambda function.
     *

     */
    private LambdaAction lambda;
    /**
     *

     * Publish to an SNS topic.
     *

     */
    private SnsAction sns;
    /**
     *

     * Publish to an SQS queue.
     *

     */
    private SqsAction sqs;
    /**
     *

     * Write data to a Kinesis stream.
     *

     */
    private KinesisAction kinesis;
    /**
     *

     * Publish to another MQTT topic.
     *

     */
    private RepublishAction republish;
    /**
     *

     * Write to an S3 bucket.
     *

     */
    private S3Action s3;

    private FirehoseAction firehose;

    /**
     *

     * Write to a DynamoDB table.
     *

     *
     * @param dynamoDB
     *        Write to a DynamoDB table.
     */
    public void setDynamoDB(DynamoDBAction dynamoDB) {
        this.dynamoDB = dynamoDB;
    }

    /**
     *

     * Write to a DynamoDB table.
     *

     *
     * @return Write to a DynamoDB table.
     */
    public DynamoDBAction getDynamoDB() {
        return this.dynamoDB;
    }

    /**
     *

     * Write to a DynamoDB table.
     *

     *
     * @param dynamoDB
     *        Write to a DynamoDB table.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public Action withDynamoDB(DynamoDBAction dynamoDB) {
        setDynamoDB(dynamoDB);
        return this;
    }

    /**
     *

     * Invoke a Lambda function.
     *

     *
     * @param lambda
     *        Invoke a Lambda function.
     */
    public void setLambda(LambdaAction lambda) {
        this.lambda = lambda;
    }

    /**
     *

     * Invoke a Lambda function.
     *

     *
     * @return Invoke a Lambda function.
     */
    public LambdaAction getLambda() {
        return this.lambda;
    }

    /**
     *

     * Invoke a Lambda function.
     *

     *
     * @param lambda
     *        Invoke a Lambda function.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public Action withLambda(LambdaAction lambda) {
        setLambda(lambda);
        return this;
    }

    /**
     *

     * Publish to an SNS topic.
     *

     *
     * @param sns
     *        Publish to an SNS topic.
     */
    public void setSns(SnsAction sns) {
        this.sns = sns;
    }

    /**
     *

     * Publish to an SNS topic.
     *

     *
     * @return Publish to an SNS topic.
     */
    public SnsAction getSns() {
        return this.sns;
    }

    /**
     *

     * Publish to an SNS topic.
     *

     *
     * @param sns
     *        Publish to an SNS topic.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public Action withSns(SnsAction sns) {
        setSns(sns);
        return this;
    }

    /**
     *

     * Publish to an SQS queue.
     *

     *
     * @param sqs
     *        Publish to an SQS queue.
     */
    public void setSqs(SqsAction sqs) {
        this.sqs = sqs;
    }

    /**
     *

     * Publish to an SQS queue.
     *

     *
     * @return Publish to an SQS queue.
     */
    public SqsAction getSqs() {
        return this.sqs;
    }

    /**
     *

     * Publish to an SQS queue.
     *

     *
     * @param sqs
     *        Publish to an SQS queue.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public Action withSqs(SqsAction sqs) {
        setSqs(sqs);
        return this;
    }

    /**
     *

     * Write data to a Kinesis stream.
     *

     *
     * @param kinesis
     *        Write data to a Kinesis stream.
     */
    public void setKinesis(KinesisAction kinesis) {
        this.kinesis = kinesis;
    }

    /**
     *

     * Write data to a Kinesis stream.
     *

     *
     * @return Write data to a Kinesis stream.
     */
    public KinesisAction getKinesis() {
        return this.kinesis;
    }

    /**
     *

     * Write data to a Kinesis stream.
     *

     *
     * @param kinesis
     *        Write data to a Kinesis stream.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public Action withKinesis(KinesisAction kinesis) {
        setKinesis(kinesis);
        return this;
    }

    /**
     *

     * Publish to another MQTT topic.
     *

     *
     * @param republish
     *        Publish to another MQTT topic.
     */
    public void setRepublish(RepublishAction republish) {
        this.republish = republish;
    }

    /**
     *

     * Publish to another MQTT topic.
     *

     *
     * @return Publish to another MQTT topic.
     */
    public RepublishAction getRepublish() {
        return this.republish;
    }

    /**
     *

     * Publish to another MQTT topic.
     *

     *
     * @param republish
     *        Publish to another MQTT topic.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public Action withRepublish(RepublishAction republish) {
        setRepublish(republish);
        return this;
    }

    /**
     *

     * Write to an S3 bucket.
     *

     *
     * @param s3
     *        Write to an S3 bucket.
     */
    public void setS3(S3Action s3) {
        this.s3 = s3;
    }

    /**
     *

     * Write to an S3 bucket.
     *

     *
     * @return Write to an S3 bucket.
     */
    public S3Action getS3() {
        return this.s3;
    }

    /**
     *

     * Write to an S3 bucket.
     *

     *
     * @param s3
     *        Write to an S3 bucket.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public Action withS3(S3Action s3) {
        setS3(s3);
        return this;
    }

    /**
     * @param firehose
     */
    public void setFirehose(FirehoseAction firehose) {
        this.firehose = firehose;
    }

    /**
     * @return
     */
    public FirehoseAction getFirehose() {
        return this.firehose;
    }

    /**
     * @param firehose
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public Action withFirehose(FirehoseAction firehose) {
        setFirehose(firehose);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getDynamoDB() != null)
            sb.append("DynamoDB: " + getDynamoDB() + ",");
        if (getLambda() != null)
            sb.append("Lambda: " + getLambda() + ",");
        if (getSns() != null)
            sb.append("Sns: " + getSns() + ",");
        if (getSqs() != null)
            sb.append("Sqs: " + getSqs() + ",");
        if (getKinesis() != null)
            sb.append("Kinesis: " + getKinesis() + ",");
        if (getRepublish() != null)
            sb.append("Republish: " + getRepublish() + ",");
        if (getS3() != null)
            sb.append("S3: " + getS3() + ",");
        if (getFirehose() != null)
            sb.append("Firehose: " + getFirehose());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof Action == false)
            return false;
        Action other = (Action) obj;
        if (other.getDynamoDB() == null ^ this.getDynamoDB() == null)
            return false;
        if (other.getDynamoDB() != null
                && other.getDynamoDB().equals(this.getDynamoDB()) == false)
            return false;
        if (other.getLambda() == null ^ this.getLambda() == null)
            return false;
        if (other.getLambda() != null
                && other.getLambda().equals(this.getLambda()) == false)
            return false;
        if (other.getSns() == null ^ this.getSns() == null)
            return false;
        if (other.getSns() != null
                && other.getSns().equals(this.getSns()) == false)
            return false;
        if (other.getSqs() == null ^ this.getSqs() == null)
            return false;
        if (other.getSqs() != null
                && other.getSqs().equals(this.getSqs()) == false)
            return false;
        if (other.getKinesis() == null ^ this.getKinesis() == null)
            return false;
        if (other.getKinesis() != null
                && other.getKinesis().equals(this.getKinesis()) == false)
            return false;
        if (other.getRepublish() == null ^ this.getRepublish() == null)
            return false;
        if (other.getRepublish() != null
                && other.getRepublish().equals(this.getRepublish()) == false)
            return false;
        if (other.getS3() == null ^ this.getS3() == null)
            return false;
        if (other.getS3() != null
                && other.getS3().equals(this.getS3()) == false)
            return false;
        if (other.getFirehose() == null ^ this.getFirehose() == null)
            return false;
        if (other.getFirehose() != null
                && other.getFirehose().equals(this.getFirehose()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode
                + ((getDynamoDB() == null) ? 0 : getDynamoDB().hashCode());
        hashCode = prime * hashCode
                + ((getLambda() == null) ? 0 : getLambda().hashCode());
        hashCode = prime * hashCode
                + ((getSns() == null) ? 0 : getSns().hashCode());
        hashCode = prime * hashCode
                + ((getSqs() == null) ? 0 : getSqs().hashCode());
        hashCode = prime * hashCode
                + ((getKinesis() == null) ? 0 : getKinesis().hashCode());
        hashCode = prime * hashCode
                + ((getRepublish() == null) ? 0 : getRepublish().hashCode());
        hashCode = prime * hashCode
                + ((getS3() == null) ? 0 : getS3().hashCode());
        hashCode = prime * hashCode
                + ((getFirehose() == null) ? 0 : getFirehose().hashCode());
        return hashCode;
    }

    @Override
    public Action clone() {
        try {
            return (Action) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                            + "even though we're Cloneable!", e);
        }
    }
}


text:
package org.virtue.network.event.context.impl.out;

import org.virtue.game.content.clans.ClanRank;
import org.virtue.network.event.context.GameEventContext;

/**
 * @author Im Frizzy <skype:kfriz1998>
 * @author Frosty Teh Snowman <skype:travis.mccorkle>
 * @author Arthur <skype:arthur.behesnilian>
 * @author Sundays211
 * @since 27/12/2014
 */
public class ClanSettingsEventContext implements GameEventContext {

	public static class Member {

		private final String displayName;
		private final ClanRank rank;
		private final int varValue;
		private final int joinDay;

		/**
		 * Constructs a new {@code User} object for use within the {@code ClanSettingsPacket}
		 * @param displayName The display name of the player
		 * @param rank The player's rank within the clan
		 * @param varValue	The var data for this clan member
		 * @param joinDay The day on which the member joined the clan
		 */
		public Member (String displayName, ClanRank rank, int varValue, int joinDay) {
			this.displayName = displayName;
			this.rank = rank;
			this.varValue = varValue;
			this.joinDay = joinDay;
		}

		/**
		 * Gets the display name of the player
		 * @return	The display name
		 */
		public String getDisplayName () {
			return displayName;
		}

		/**
		 * Gets the rank of the player within the clan
		 * @return	The rank
		 */
		public ClanRank getRank () {
			return rank;
		}

		/**
		 * Gets the variable data for this clan member
		 * @return	The varValue data
		 */
		public int getVarValue () {
			return varValue;
		}

		/**
		 * Gets the day on which the member joined the clan
		 * @return	The join day
		 */
		public int getJoinDay () {
			return joinDay;
		}
	}

	public static class Variable {

		private final int key;
		private final Object value;

		public Variable (int key, Object value) {
			this.key = key;
			this.value = value;
		}

		public int getKey () {
			return key;
		}

		public Object getValue () {
			return value;
		}
	}

	private final Member[] members;

	private final String[] bans;

	private final boolean isGuestData;

	private final boolean allowGuests;

	private final ClanRank minTalk, minKick;

	private final int updateNum;

	private final String clanName;

	private final Variable[] variables;

	public ClanSettingsEventContext (boolean guestData, String clanName, Member[] members, String[] bans, int updateNum, boolean allowGuests, ClanRank minTalk, ClanRank minKick, Variable[] variables) {
		this.isGuestData = guestData;
		this.clanName = clanName;
		this.members = members;
		this.bans = bans;
		this.allowGuests = allowGuests;
		this.updateNum = updateNum;
		this.minTalk = minTalk;
		this.minKick = minKick;
		this.variables = variables;
	}

	/**
	 * Returns whether or not this is clan data for a guest clan
	 * @return	True if this is guest clan data, false if it's main clan data
	 */
	public boolean isGuestData () {
		return isGuestData;
	}

	/**
	 * Returns the current settings update number
	 * @return	The update number
	 */
	public int getUpdateNumber () {
		return updateNum;
	}

	/**
	 * Returns the name of the clan
	 * @return	The clan name
	 */
	public String getClanName () {
		return clanName;
	}

	/**
	 * Returns the minimum rank needed to talk in the clan chat channel
	 * @return	The minimum talk rank
	 */
	public ClanRank getMinTalk () {
		return minTalk;
	}

	/**
	 * Returns the minimum rank needed to kick guests from the clan chat channel
	 * @return	The minimum kick rank
	 */
	public ClanRank getMinKick () {
		return minKick;
	}

	/**
	 * Returns whether guests are allowed to join the associated clan chat channel
	 * @return	True if guests are allowed to join, false otherwise
	 */
	public boolean allowNonMembers () {
		return allowGuests;
	}

	/**
	 * Returns an array of members currently in the clan
	 * @return	An array of members
	 */
	public Member[] getMembers () {
		return members;
	}

	/**
	 * Returns an array of people currently banned from the clan
	 * @return	A string array containing the names of all banned players
	 */
	public String[] getBans () {
		return bans;
	}

	/**
	 * Returns an array containing the misc setting data for the clan
	 * @return	An array of Variables
	 */
	public Variable[] getVarValues () {
		return variables;
	}
}


text:
title: FluentIntersectionType.build - fluentast-core
---

[fluentast-core](../../index.html) / [at.hschroedl.fluentast.ast.type](../index.html) / [FluentIntersectionType](index.html) / [build](.)

# build

`fun build(ast: `[`AST`](https://help.eclipse.org/neon/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/dom/AST.html)`): `[`Type`](https://help.eclipse.org/neon/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/dom/Type.html) [(source)](https://github.com/hschroedl/FluentAST/tree/master/core/src/main/kotlin//at.hschroedl.fluentast/ast/type/Type.kt#L51)

Overrides [FluentType.build](../-fluent-type/build.html)


text:
require "rubygems"

require "formula_installer"
require "unpack_strategy"

require "cask/cask_dependencies"
require "cask/download"
require "cask/staged"
require "cask/verify"
require "cask/quarantine"

require "cgi"

module Cask
  class Installer
    extend Predicable
    # TODO: it is unwise for Cask::Staged to be a module, when we are
    #       dealing with both staged and unstaged Casks here. This should
    #       either be a class which is only sometimes instantiated, or there
    #       should be explicit checks on whether staged state is valid in
    #       every method.
    include Staged

    def initialize(cask, command: SystemCommand, force: false,
                   skip_cask_deps: false, binaries: true, verbose: false,
                   require_sha: false, upgrade: false,
                   installed_as_dependency: false, quarantine: true)
      @cask = cask
      @command = command
      @force = force
      @skip_cask_deps = skip_cask_deps
      @binaries = binaries
      @verbose = verbose
      @require_sha = require_sha
      @reinstall = false
      @upgrade = upgrade
      @installed_as_dependency = installed_as_dependency
      @quarantine = quarantine
    end

    attr_predicate :binaries?, :force?, :skip_cask_deps?, :require_sha?,
                   :upgrade?, :verbose?, :installed_as_dependency?,
                   :quarantine?

    def self.print_caveats(cask)
      odebug "Printing caveats"

      caveats = cask.caveats
      return if caveats.empty?

      ohai "Caveats"
      puts caveats + "\n"
    end

    def fetch
      odebug "Cask::Installer#fetch"

      satisfy_dependencies

      verify_has_sha if require_sha? && !force?
      download
      verify
    end

    def stage
      odebug "Cask::Installer#stage"

      Caskroom.ensure_caskroom_exists

      unpack_dependencies

      extract_primary_container
      save_caskfile
    rescue => e
      purge_versioned_files
      raise e
    end

    def install
      odebug "Cask::Installer#install"

      if @cask.installed? && !force? && !@reinstall && !upgrade?
        raise CaskAlreadyInstalledError, @cask
      end

      check_conflicts

      print_caveats
      fetch
      uninstall_existing_cask if @reinstall

      oh1 "Installing Cask #{Formatter.identifier(@cask)}"
      opoo "macOS's Gatekeeper has been disabled for this Cask" unless quarantine?
      stage
      install_artifacts

      unless @cask.tap&.private?
        ::Utils::Analytics.report_event("cask_install", @cask.token)
      end

      puts summary
    end

    def check_conflicts
      return unless @cask.conflicts_with

      @cask.conflicts_with.cask.each do |conflicting_cask|
        begin
          conflicting_cask = CaskLoader.load(conflicting_cask)
          if conflicting_cask.installed?
            raise CaskConflictError.new(@cask, conflicting_cask)
          end
        rescue CaskUnavailableError
          next # Ignore conflicting Casks that do not exist.
        end
      end
    end

    def reinstall
      odebug "Cask::Installer#reinstall"
      @reinstall = true
      install
    end

    def uninstall_existing_cask
      return unless @cask.installed?

      # use the same cask file that was used for installation, if possible
      installed_caskfile = @cask.installed_caskfile
      installed_cask = installed_caskfile.exist? ? CaskLoader.load(installed_caskfile) : @cask

      # Always force uninstallation, ignore method parameter
      Installer.new(installed_cask, binaries: binaries?, verbose: verbose?, force: true, upgrade: upgrade?).uninstall
    end

    def summary
      s = ""
      s << "#{Emoji.install_badge}  " if Emoji.enabled?
      s << "#{@cask} was successfully #{upgrade? ? "upgraded" : "installed"}!"
    end

    def download
      odebug "Downloading"
      @downloaded_path = Download.new(@cask, force: false, quarantine: quarantine?).perform
      odebug "Downloaded to -> #{@downloaded_path}"
      @downloaded_path
    end

    def verify_has_sha
      odebug "Checking cask has checksum"
      return unless @cask.sha256 == :no_check

      raise CaskNoShasumError, @cask.token
    end

    def verify
      Verify.all(@cask, @downloaded_path)
    end

    def primary_container
      @primary_container ||= begin
        UnpackStrategy.detect(@downloaded_path, type: @cask.container&.type)
      end
    end

    def extract_primary_container
      odebug "Extracting primary container"

      odebug "Using container class #{primary_container.class} for #{@downloaded_path}"

      basename = CGI.unescape(File.basename(@cask.url.path))

      if nested_container = @cask.container&.nested
        Dir.mktmpdir do |tmpdir|
          tmpdir = Pathname(tmpdir)
          primary_container.extract(to: tmpdir, basename: basename, verbose: verbose?)

          UnpackStrategy.detect(tmpdir/nested_container)
                        .extract_nestedly(to: @cask.staged_path, verbose: verbose?)
        end
      else
        primary_container.extract_nestedly(to: @cask.staged_path, basename: basename, verbose: verbose?)
      end

      return unless quarantine?
      return unless Quarantine.available?

      Quarantine.propagate(from: @downloaded_path, to: @cask.staged_path)
    end

    def install_artifacts
      already_installed_artifacts = []

      odebug "Installing artifacts"
      artifacts = @cask.artifacts
      odebug "#{artifacts.length} artifact/s defined", artifacts

      artifacts.each do |artifact|
        next unless artifact.respond_to?(:install_phase)

        odebug "Installing artifact of class #{artifact.class}"

        if artifact.is_a?(Artifact::Binary)
          next unless binaries?
        end

        artifact.install_phase(command: @command, verbose: verbose?, force: force?)
        already_installed_artifacts.unshift(artifact)
      end
    rescue => e
      begin
        already_installed_artifacts.each do |artifact|
          next unless artifact.respond_to?(:uninstall_phase)

          odebug "Reverting installation of artifact of class #{artifact.class}"
          artifact.uninstall_phase(command: @command, verbose: verbose?, force: force?)
        end
      ensure
        purge_versioned_files
        raise e
      end
    end

    # TODO: move dependencies to a separate class
    #       dependencies should also apply for "brew cask stage"
    #       override dependencies with --force or perhaps --force-deps
    def satisfy_dependencies
      return unless @cask.depends_on

      ohai "Satisfying dependencies"
      macos_dependencies
      arch_dependencies
      x11_dependencies
      formula_dependencies
      cask_dependencies unless skip_cask_deps? || installed_as_dependency?
    end

    def macos_dependencies
      return unless @cask.depends_on.macos

      if @cask.depends_on.macos.first.is_a?(Array)
        operator, release = @cask.depends_on.macos.first
        unless MacOS.version.send(operator, release)
          raise CaskError,
            "Cask #{@cask} depends on macOS release #{operator} #{release}, " \
            "but you are running release #{MacOS.version}."
        end
      elsif @cask.depends_on.macos.length > 1
        unless @cask.depends_on.macos.include?(Gem::Version.new(MacOS.version.to_s))
          raise CaskError,
            "Cask #{@cask} depends on macOS release being one of " \
            "[#{@cask.depends_on.macos.map(&:to_s).join(", ")}], " \
            "but you are running release #{MacOS.version}."
        end
      else
        unless MacOS.version == @cask.depends_on.macos.first
          raise CaskError,
            "Cask #{@cask} depends on macOS release " \
            "#{@cask.depends_on.macos.first}, " \
            "but you are running release #{MacOS.version}."
        end
      end
    end

    def arch_dependencies
      return if @cask.depends_on.arch.nil?

      @current_arch ||= { type: Hardware::CPU.type, bits: Hardware::CPU.bits }
      return if @cask.depends_on.arch.any? do |arch|
        arch[:type] == @current_arch[:type] &&
        Array(arch[:bits]).include?(@current_arch[:bits])
      end

      raise CaskError,
        "Cask #{@cask} depends on hardware architecture being one of " \
        "[#{@cask.depends_on.arch.map(&:to_s).join(", ")}], " \
        "but you are running #{@current_arch}"
    end

    def x11_dependencies
      return unless @cask.depends_on.x11
      raise CaskX11DependencyError, @cask.token unless MacOS::X11.installed?
    end

    def formula_dependencies
      formulae = @cask.depends_on.formula.map { |f| Formula[f] }
      return if formulae.empty?

      if formulae.all?(&:any_version_installed?)
        puts "All Formula dependencies satisfied."
        return
      end

      not_installed = formulae.reject(&:any_version_installed?)

      ohai "Installing Formula dependencies: #{not_installed.map(&:to_s).join(", ")}"
      not_installed.each do |formula|
        FormulaInstaller.new(formula).tap do |fi|
          fi.installed_as_dependency = true
          fi.installed_on_request = false
          fi.show_header = true
          fi.verbose = verbose?
          fi.prelude
          fi.install
          fi.finish
        end
      end
    end

    def cask_dependencies
      casks = CaskDependencies.new(@cask)
      return if casks.empty?

      if casks.all?(&:installed?)
        puts "All Cask dependencies satisfied."
        return
      end

      not_installed = casks.reject(&:installed?)

      ohai "Installing Cask dependencies: #{not_installed.map(&:to_s).join(", ")}"
      not_installed.each do |cask|
        Installer.new(
          cask,
          binaries: binaries?,
          verbose: verbose?,
          installed_as_dependency: true,
          force: false,
        ).install
      end
    end

    def unpack_dependencies
      formulae = primary_container.dependencies.select { |dep| dep.is_a?(Formula) }
      casks = primary_container.dependencies.select { |dep| dep.is_a?(Cask) }
                               .flat_map { |cask| [*CaskDependencies.new(cask), cask] }

      not_installed_formulae = formulae.reject(&:any_version_installed?)
      not_installed_casks = casks.reject(&:installed?)

      return if (not_installed_formulae + not_installed_casks).empty?

      ohai "Satisfying unpack dependencies"

      not_installed_formulae.each do |formula|
        FormulaInstaller.new(formula).tap do |fi|
          fi.installed_as_dependency = true
          fi.installed_on_request = false
          fi.show_header = true
          fi.verbose = verbose?
          fi.prelude
          fi.install
          fi.finish
        end
      end

      not_installed_casks.each do |cask|
        Installer.new(cask, verbose: verbose?, installed_as_dependency: true).install
      end
    end

    def print_caveats
      self.class.print_caveats(@cask)
    end

    def save_caskfile
      old_savedir = @cask.metadata_timestamped_path

      return unless @cask.sourcefile_path

      savedir = @cask.metadata_subdir("Casks", timestamp: :now, create: true)
      FileUtils.copy @cask.sourcefile_path, savedir
      old_savedir&.rmtree
    end

    def uninstall
      oh1 "Uninstalling Cask #{Formatter.identifier(@cask)}"
      uninstall_artifacts(clear: true)
      purge_versioned_files
      purge_caskroom_path if force?
    end

    def start_upgrade
      oh1 "Starting upgrade for Cask #{Formatter.identifier(@cask)}"

      uninstall_artifacts
      backup
    end

    def backup
      @cask.staged_path.rename backup_path
      @cask.metadata_versioned_path.rename backup_metadata_path
    end

    def restore_backup
      return unless backup_path.directory? && backup_metadata_path.directory?

      Pathname.new(@cask.staged_path).rmtree if @cask.staged_path.exist?
      Pathname.new(@cask.metadata_versioned_path).rmtree if @cask.metadata_versioned_path.exist?

      backup_path.rename @cask.staged_path
      backup_metadata_path.rename @cask.metadata_versioned_path
    end

    def revert_upgrade
      opoo "Reverting upgrade for Cask #{@cask}"
      restore_backup
      install_artifacts
    end

    def finalize_upgrade
      purge_backed_up_versioned_files

      puts summary
    end

    def uninstall_artifacts(clear: false)
      odebug "Un-installing artifacts"
      artifacts = @cask.artifacts

      odebug "#{artifacts.length} artifact/s defined", artifacts

      artifacts.each do |artifact|
        next unless artifact.respond_to?(:uninstall_phase)

        odebug "Un-installing artifact of class #{artifact.class}"
        artifact.uninstall_phase(command: @command, verbose: verbose?, skip: clear, force: force?)
      end
    end

    def zap
      ohai %Q(Implied "brew cask uninstall #{@cask}")
      uninstall_artifacts
      if (zap_stanzas = @cask.artifacts.select { |a| a.is_a?(Artifact::Zap) }).empty?
        opoo "No zap stanza present for Cask '#{@cask}'"
      else
        ohai "Dispatching zap stanza"
        zap_stanzas.each do |stanza|
          stanza.zap_phase(command: @command, verbose: verbose?, force: force?)
        end
      end
      ohai "Removing all staged versions of Cask '#{@cask}'"
      purge_caskroom_path
    end

    def backup_path
      return if @cask.staged_path.nil?

      Pathname("#{@cask.staged_path}.upgrading")
    end

    def backup_metadata_path
      return if @cask.metadata_versioned_path.nil?

      Pathname("#{@cask.metadata_versioned_path}.upgrading")
    end

    def gain_permissions_remove(path)
      Utils.gain_permissions_remove(path, command: @command)
    end

    def purge_backed_up_versioned_files
      ohai "Purging files for version #{@cask.version} of Cask #{@cask}"

      # versioned staged distribution
      gain_permissions_remove(backup_path) if backup_path&.exist?

      # Homebrew Cask metadata
      return unless backup_metadata_path.directory?

      backup_metadata_path.children.each do |subdir|
        gain_permissions_remove(subdir)
      end
      backup_metadata_path.rmdir_if_possible
    end

    def purge_versioned_files
      ohai "Purging files for version #{@cask.version} of Cask #{@cask}"

      # versioned staged distribution
      gain_permissions_remove(@cask.staged_path) if @cask.staged_path&.exist?

      # Homebrew Cask metadata
      if @cask.metadata_versioned_path.directory?
        @cask.metadata_versioned_path.children.each do |subdir|
          gain_permissions_remove(subdir)
        end

        @cask.metadata_versioned_path.rmdir_if_possible
      end
      @cask.metadata_master_container_path.rmdir_if_possible unless upgrade?

      # toplevel staged distribution
      @cask.caskroom_path.rmdir_if_possible unless upgrade?
    end

    def purge_caskroom_path
      odebug "Purging all staged versions of Cask #{@cask}"
      gain_permissions_remove(@cask.caskroom_path)
    end
  end
end


text:
package org.opendatakit.sync.service.entity;

import android.os.Parcel;
import android.os.Parcelable;

import org.opendatakit.aggregate.odktables.rest.entity.TableResource;
import org.opendatakit.aggregate.odktables.rest.entity.TableResourceList;

import java.util.ArrayList;

public class ParcelableTableResourceList extends TableResourceList implements Parcelable {
  public ParcelableTableResourceList() {
    super();
  }

  protected ParcelableTableResourceList(Parcel in) {
    super(
        null,
        in.readString(),
        in.readString(),
        in.readString(),
        in.readByte() == 1,
        in.readByte() == 1
    );

    setTables(readTables(in));
  }

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(getWebSafeRefetchCursor());
    dest.writeString(getWebSafeBackwardCursor());
    dest.writeString(getWebSafeResumeCursor());
    dest.writeByte((byte) (isHasMoreResults() ? 1 : 0));
    dest.writeByte((byte) (isHasPriorResults() ? 1 : 0));
    writeTables(dest, flags);
  }

  private void writeTables(Parcel dest, int flags) {
    if (getTables() == null) {
      dest.writeInt(-1);
      return;
    }

    dest.writeInt(getTables().size());
    for (TableResource tableResource : getTables()) {
      ParcelableTableResource.writeToParcel(tableResource, dest, flags);
    }
  }

  private ArrayList<TableResource> readTables(Parcel in) {
    int size = in.readInt();

    if (size < 0) {
      return null;
    }

    ArrayList<TableResource> list = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
      list.add(new ParcelableTableResource(in));
    }

    return list;
  }

  @Override
  public int describeContents() {
    return 0;
  }

  public static final Creator<ParcelableTableResourceList> CREATOR = new Creator<ParcelableTableResourceList>() {
    @Override
    public ParcelableTableResourceList createFromParcel(Parcel in) {
      return new ParcelableTableResourceList(in);
    }

    @Override
    public ParcelableTableResourceList[] newArray(int size) {
      return new ParcelableTableResourceList[size];
    }
  };
}


text:
<?php
/**
 * Network About administration panel.
 *
 * @package WordPress
 * @subpackage Multisite
 * @since 3.4.0
 */

/** Load WordPress Administration Bootstrap */
require_once( dirname( __FILE__ ) . '/admin.php' );

if ( ! is_multisite() )
	wp_die( __( 'Multisite support is not enabled.' ) );

require( ABSPATH . 'wp-admin/about.php' );


text:
import { BaseEntity, Column, Entity, PrimaryColumn } from 'typeorm';

@Entity()
export default class Program extends BaseEntity {
    @PrimaryColumn({
        type: 'bigint',
        unique: true,
    })
    public id!: number;

    @Column({
        type: 'bigint',
    })
    public updateTime!: number;

    @Column({
        type: 'bigint',
    })
    public channelId!: number;

    @Column({
        type: 'bigint',
    })
    public eventId!: number;

    @Column({
        type: 'integer',
    })
    public serviceId!: number;

    @Column({
        type: 'integer',
    })
    public networkId!: number;

    @Column({
        type: 'bigint',
    })
    public startAt!: number;

    @Column({
        type: 'bigint',
    })
    public endAt!: number;

    @Column({
        type: 'integer',
        select: false,
    })
    public startHour!: number;

    @Column({
        type: 'integer',
        select: false,
    })
    public week!: number;

    @Column({
        type: 'integer',
    })
    public duration!: number;

    @Column()
    public isFree!: boolean;

    @Column({
        type: 'text',
    })
    public name!: string; // 番組名 (表示用)

    @Column({
        type: 'text',
    })
    public halfWidthName!: string; // 番組名 (検索用)

    @Column({
        type: 'text',
    })
    public shortName!: string; // 番組名 (重複チェック用)

    @Column({
        type: 'text',
        nullable: true,
    })
    public description!: string | null;

    @Column({
        type: 'text',
        nullable: true,
    })
    public halfWidthDescription!: string | null;

    @Column({
        type: 'text',
        nullable: true,
    })
    public extended!: string | null;

    @Column({
        type: 'text',
        nullable: true,
    })
    public halfWidthExtended!: string | null;

    @Column({
        type: 'text',
        nullable: true,
    })
    public rawExtended!: string | null;

    @Column({
        type: 'text',
        nullable: true,
    })
    public rawHalfWidthExtended!: string | null;

    @Column({
        type: 'integer',
        nullable: true,
    })
    public genre1!: number | null;

    @Column({
        type: 'integer',
        nullable: true,
    })
    public subGenre1!: number | null;

    @Column({
        type: 'integer',
        nullable: true,
    })
    public genre2!: number | null;

    @Column({
        type: 'integer',
        nullable: true,
    })
    public subGenre2!: number | null;

    @Column({
        type: 'integer',
        nullable: true,
    })
    public genre3!: number | null;

    @Column({
        type: 'integer',
        nullable: true,
    })
    public subGenre3!: number | null;

    @Column()
    public channelType!: string; // GR BS CS SKY

    @Column()
    public channel!: string;

    @Column({
        type: 'text',
        nullable: true,
    })
    public videoType!: string | null;

    @Column({
        type: 'text',
        nullable: true,
    })
    public videoResolution!: string | null;

    @Column({
        type: 'integer',
        nullable: true,
    })
    public videoStreamContent!: number | null;

    @Column({
        type: 'integer',
        nullable: true,
    })
    public videoComponentType!: number | null;

    @Column({
        type: 'integer',
        nullable: true,
    })
    public audioSamplingRate!: number | null;

    @Column({
        type: 'integer',
        nullable: true,
    })
    public audioComponentType!: number | null;
}


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

import { NavController } from 'ionic-angular';

import { ComponentsListsBasicListPage } from './basic-list/components.lists.basic-list.page';
import { ComponentsListsNoLinesListPage } from './no-lines-list/components.lists.no-lines-list.page';
import { ComponentsListsInsetListPage } from './inset-list/components.lists.inset-list.page';
import { ComponentsListsListDividersPage } from './list-dividers/components.lists.list-dividers.page';
import { ComponentsListsListHeadersPage } from './list-headers/components.lists.list-headers.page';
import { ComponentsListsIconListPage } from './icon-list/components.lists.icon-list.page';
import { ComponentsListsAvatarListPage } from './avatar-list/components.lists.avatar-list.page';
import { ComponentsListsMultiLineListPage } from './multi-line-list/components.lists.multi-line-list.page';
import { ComponentsListsSlidingListPage } from './sliding-list/components.lists.sliding-list.page';
import { ComponentsListsThumbnailListPage } from './thumbnail-list/components.lists.thumbnail-list.page';

@Component({
  templateUrl: 'components.lists-list.html'
})
export class ComponentsListsListPage {
  constructor(
    private navCtrl: NavController
  ) { }

  public basicListTapped() {
    this.navCtrl.push(ComponentsListsBasicListPage);
  }

  public noLinesListTapped() {
    this.navCtrl.push(ComponentsListsNoLinesListPage);
  }

  public insetListTapped() {
    this.navCtrl.push(ComponentsListsInsetListPage);
  }

  public listDividersTapped() {
    this.navCtrl.push(ComponentsListsListDividersPage);
  }

  public listHeadersTapped() {
    this.navCtrl.push(ComponentsListsListHeadersPage);
  }

  public iconListTapped() {
    this.navCtrl.push(ComponentsListsIconListPage);
  }

  public avatarListTapped() {
    this.navCtrl.push(ComponentsListsAvatarListPage);
  }

  public multiLineListTapped() {
    this.navCtrl.push(ComponentsListsMultiLineListPage);
  }

  public slidingListTapped() {
    this.navCtrl.push(ComponentsListsSlidingListPage);
  }

  public thumbnailListTapped() {
    this.navCtrl.push(ComponentsListsThumbnailListPage);
  }
}


text:
/**=========================================================
 * Module: main.js
 * Main Application Controller
 =========================================================*/

angular.module('core').controller('AppController',
  ['$rootScope', '$scope', '$state', '$translate', '$window', '$localStorage', '$timeout', 'toggleStateService', 'colors', 'browser', 'cfpLoadingBar', 'Authentication',
  function($rootScope, $scope, $state, $translate, $window, $localStorage, $timeout, toggle, colors, browser, cfpLoadingBar, Authentication) {
    "use strict";

    // This provides Authentication context.
    $scope.authentication = Authentication;

    // Loading bar transition
    // -----------------------------------
    var thBar;
    $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) {
        if($('.wrapper > section').length) // check if bar container exists
          thBar = $timeout(function() {
            cfpLoadingBar.start();
          }, 0); // sets a latency Threshold
    });
    $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
        event.targetScope.$watch("$viewContentLoaded", function () {
          $timeout.cancel(thBar);
          cfpLoadingBar.complete();
        });
    });

    // Hook not found
    $rootScope.$on('$stateNotFound',
      function(event, unfoundState, fromState, fromParams) {
          console.log(unfoundState.to); // "lazy.state"
          console.log(unfoundState.toParams); // {a:1, b:2}
          console.log(unfoundState.options); // {inherit:false} + default options
      });
    // Hook error
    $rootScope.$on('$stateChangeError',
      function(event, toState, toParams, fromState, fromParams, error){
        console.log(error);
      });
    // Hook success
    $rootScope.$on('$stateChangeSuccess',
      function(event, toState, toParams, fromState, fromParams) {
        // display new view from top
        $window.scrollTo(0, 0);
        // Save the route title
        $rootScope.currTitle = $state.current.title;
      });

    $rootScope.currTitle = $state.current.title;
    $rootScope.pageTitle = function() {
      return $rootScope.app.name + ' - ' + ($rootScope.currTitle || $rootScope.app.description);
    };

    // iPad may presents ghost click issues
    // if( ! browser.ipad )
      // FastClick.attach(document.body);

    // Close submenu when sidebar change from collapsed to normal
    $rootScope.$watch('app.layout.isCollapsed', function(newValue, oldValue) {
      if( newValue === false )
        $rootScope.$broadcast('closeSidebarMenu');
    });

    // Restore layout settings
    if( angular.isDefined($localStorage.layout) )
      $scope.app.layout = $localStorage.layout;
    else
      $localStorage.layout = $scope.app.layout;

    $rootScope.$watch("app.layout", function () {
      $localStorage.layout = $scope.app.layout;
    }, true);

    // Allows to use branding color with interpolation
    // {{ colorByName('primary') }}
    $scope.colorByName = colors.byName;

    // Internationalization
    // ----------------------

    $scope.language = {
      // Handles language dropdown
      listIsOpen: false,
      // list of available languages
      available: {
        'en':       'English',
        'es_AR':    'Español'
      },
      // display always the current ui language
      init: function () {
        var proposedLanguage = $translate.proposedLanguage() || $translate.use();
        var preferredLanguage = $translate.preferredLanguage(); // we know we have set a preferred one in app.config
        $scope.language.selected = $scope.language.available[ (proposedLanguage || preferredLanguage) ];
      },
      set: function (localeId, ev) {
        // Set the new idiom
        $translate.use(localeId);
        // save a reference for the current language
        $scope.language.selected = $scope.language.available[localeId];
        // finally toggle dropdown
        $scope.language.listIsOpen = ! $scope.language.listIsOpen;
      }
    };

    $scope.language.init();

    // Restore application classes state
    toggle.restoreState( $(document.body) );

    // Applies animation to main view for the next pages to load
    $timeout(function(){
      $rootScope.mainViewAnimation = $rootScope.app.viewAnimation;
    });

    // cancel click event easily
    $rootScope.cancel = function($event) {
      $event.stopPropagation();
    };

}]);


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

<title>org.bouncycastle.util (Bouncy Castle Library 1.54 API Specification)</title>
<meta name="date" content="2015-12-29">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Bouncy Castle Cryptography Library 1.54

Prev Package

Next Package

Frames

No Frames

All Classes

Package org.bouncycastle.util

General purpose utility classes used throughout the APIs.

See: Description

Interface Summary

Interface
Description

Encodable

Interface implemented by objects that can be converted into byte arrays.

Iterable<T>

Utility class to allow use of Iterable feature in JDK 1.5+

Memoable

Interface for Memoable objects.

Selector<T>

Interface a selector from a store should conform to.

Store<T>

A generic interface describing a simple store of objects.

StreamParser

StringList

An interface defining a list of strings.

Class Summary

Class
Description

Arrays

General array utilities.

Arrays.Iterator<T>

Iterator backed by a specific array.

BigIntegers

BigInteger utilities.

CollectionStore<T>

A simple collection backed store.

Integers

Utility methods for ints.

IPAddress

Utility methods for processing String objects containing IP addresses.

Pack

Utility methods for converting byte arrays into ints and longs, and back again.

Properties

Utility method for accessing system properties.

Shorts

Strings

String utilities.

Times

Exception Summary

Exception
Description

MemoableResetException

Exception to be thrown on a failure to reset an object implementing Memoable.

StoreException

Exception thrown if there's an issue doing a match in store.

StreamParsingException

Package org.bouncycastle.util Description

General purpose utility classes used throughout the APIs.

Overview

Package

Class

Tree

Deprecated

Index

Help

Bouncy Castle Cryptography Library 1.54

Prev Package

Next Package

Frames

No Frames

All Classes


text:
<?php

namespace TCG\Voyager\Events;

use Illuminate\Queue\SerializesModels;

class FormFieldsRegistered
{
    use SerializesModels;

    public $fields;

    public function __construct(array $fields)
    {
        $this->fields = $fields;

        // @deprecate
        //
        event('voyager.form-fields.registered', $fields);
    }
}


text:
var dz = require('dezalgo');

module.exports = function read(stream, cb) {
  cb = dz(cb);
  return typeof stream.read == 'function'
    ? read2(stream, cb)
    : read1(stream, cb);
};

function read1(stream, cb) {
  if (!stream.readable) return cb();

  stream.on('data', ondata);
  stream.on('error', onerror);
  stream.on('end', onend);
  stream.resume();

  function ondata(data) {
    stream.pause();
    cleanup();
    cb(null, data);
  }

  function onerror(err) {
    cleanup();
    cb(err);
  }

  function onend(data) {
    cleanup();
    cb(null, data);
  }

  function cleanup() {
    stream.removeListener('data', ondata);
    stream.removeListener('error', onerror);
    stream.removeListener('end', onend);
  }
}

function read2(stream, cb) {
  if (!stream.readable) return cb();
  var ended = false;

  function onreadable() {
    cleanup();
    check();
  }

  function onend() {
    cleanup();
    if (!ended) {
      ended = true;
      cb(null, null);
    }
  }

  function onerror(err) {
    cleanup();
    cb(err);
  }

  function listen() {
    stream.on('readable', onreadable);
    stream.on('end', onend);
    stream.on('error', onerror);
  }

  function cleanup() {
    stream.removeListener('readable', onreadable);
    stream.removeListener('end', onend);
    stream.removeListener('error', onerror);
  }

  function check() {
    var errored = false;
    var _onerror;
    stream.on('error', _onerror = function(err){
      errored = true;
      stream.removeListener('error', _onerror);
      cb(err);
    });

    var buf = stream.read();
    stream.removeListener('error', _onerror);
    if (errored) return;
    if (buf) cb(null, buf);
    else listen();
  }

  check();
}


text:
require 'digest/md5'
require 'ostruct'

# external
require 'grit'
require 'github/markup'
require 'sanitize'

# internal
require File.expand_path('../gollum/git_access', __FILE__)
require File.expand_path('../gollum/committer', __FILE__)
require File.expand_path('../gollum/pagination', __FILE__)
require File.expand_path('../gollum/blob_entry', __FILE__)
require File.expand_path('../gollum/wiki', __FILE__)
require File.expand_path('../gollum/page', __FILE__)
require File.expand_path('../gollum/file', __FILE__)
require File.expand_path('../gollum/file_view', __FILE__)
require File.expand_path('../gollum/markup', __FILE__)
require File.expand_path('../gollum/sanitization', __FILE__)
require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)

module Gollum
  VERSION = '2.3.2'

  def self.assets_path
    ::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
  end

  class Error < StandardError; end

  class DuplicatePageError < Error
    attr_accessor :dir
    attr_accessor :existing_path
    attr_accessor :attempted_path

    def initialize(dir, existing, attempted, message = nil)
      @dir            = dir
      @existing_path  = existing
      @attempted_path = attempted
      super(message || "Cannot write #{@dir}/#{@attempted_path}, found #{@dir}/#{@existing_path}.")
    end
  end
end


text:
package com.fpt.ruby.crawler;

import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.data.mongodb.core.MongoOperations;

import com.fpt.ruby.config.SpringMongoConfig;
import com.fpt.ruby.model.MovieTicket;

public class CrawlPhimChieuRap {
	private static MongoOperations mongoOperation;
	public static void init(){
		ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringMongoConfig.class);
		mongoOperation = (MongoOperations) ctx.getBean("mongoTemplate");
	}

	public CrawlPhimChieuRap(){
		ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringMongoConfig.class);
		mongoOperation = (MongoOperations) ctx.getBean("mongoTemplate");
	}

	private static void showMovie(MovieTicket movieTicket){
		System.out.println("Movie: " + movieTicket.getMovie());
		System.out.println("Cinema: " + movieTicket.getCinema());
		System.out.println("Date: " + movieTicket.getDate());
		System.out.println("Type: " + movieTicket.getType());
		System.out.println("------------------------------");
	}

	public static void crawlCinema(String city, String cinema,String url,int date) throws Exception{
		System.out.println("url: " + url);
		System.out.println("Crawling cinema: " + cinema);
		url += "?date=" + date;
		Document doc = Jsoup.connect(url).timeout(100000).get();
		Elements newsHeadlines = doc.select("#ShowtimeItemResult");
		int count = 0;
		for (Element element : newsHeadlines) {
			count ++;
			MovieTicket movieTicket = new MovieTicket();
			Element headElement =  element.getElementsByClass("head").first();
			//System.out.print(headElement.select("span").select("a").last().text());

			//2D
			Elements btnDigitalElenments = element.select("#BoxTime").first()
												  .select(".TimesContent").first()
												  .select(".content").first()
												  .select(".bntDigital");

			for (Element element2 : btnDigitalElenments) {
				String time = element2.select("span").first().text().trim();
				movieTicket = new MovieTicket();
				movieTicket.setCity(city);
				movieTicket.setType("2D");
				movieTicket.setCinema(cinema);
				String movieTitle = headElement.select("span").select("a").last().attr("title");
				movieTitle =  movieTitle.replaceAll("\\((.*?)\\)", "").trim();
				movieTicket.setMovie(movieTitle);
				Date dateTicket = new Date();
				dateTicket.setDate(dateTicket.getDate() + date);
				dateTicket.setHours(Integer.parseInt(time.split(":")[0]));
				dateTicket.setMinutes(Integer.parseInt(time.split(":")[1]));
				dateTicket.setSeconds(0);
				movieTicket.setDate(dateTicket);
				System.out.println(movieTicket.getCinema() + " " + movieTicket.getMovie() + " " + movieTicket.getDate());
				mongoOperation.save(movieTicket);
				//showMovie(movieTicket);
			}

			//3D
			Elements bnt3dElenments = element.select("#BoxTime").first()
												  .select(".TimesContent").first()
												  .select(".content").first()
												  .select(".bnt3D");

			for (Element element2 : bnt3dElenments) {
				String time = element2.select("span").first().text().trim();
				movieTicket.setType("3D");
				movieTicket.setCity(city);
				movieTicket.setCinema(cinema);
				String movieTitle = headElement.select("span").select("a").last().attr("title");
				movieTitle =  movieTitle.replaceAll("\\((.*?)\\)", "").trim();
				movieTicket.setMovie(movieTitle);
				Date dateTicket = new Date();
				dateTicket.setDate(dateTicket.getDate() + date);
				dateTicket.setHours(Integer.parseInt(time.split(":")[0]));
				dateTicket.setMinutes(Integer.parseInt(time.split(":")[1]));
				dateTicket.setSeconds(0);
				movieTicket.setDate(dateTicket);
				System.out.println(movieTicket.getCinema() + " " + movieTicket.getMovie() + " " + movieTicket.getDate());
				mongoOperation.save(movieTicket);
				//showMovie(movieTicket);
			}

		}
	}

	public static void testMovieTicket(){
		MovieTicket movieTicket = new MovieTicket();
		movieTicket.setCinema("lotte");
		movieTicket.setMovie("x-men");
		movieTicket.setDate(new Date());
		mongoOperation.save(movieTicket);
	}

	public static void showMovieTickets(){
		List<MovieTicket> movieTickets = mongoOperation.findAll(MovieTicket.class);
		int  count = 0;
		Set<String> cinemas = new HashSet<String>();
		for (MovieTicket movieTicket : movieTickets){
			cinemas.add(movieTicket.getCinema());
			//if (count > 100) break;
		}
		for (String  cinema : cinemas){
			System.out.println(cinema);
		}
	}

	public void crawlHaNoi() throws Exception{
		mongoOperation.dropCollection(MovieTicket.class);
		String url = "http://phimchieurap.vn/lich-chieu/ha-noi";
		Document doc = Jsoup.connect(url).timeout(100000).get();
		Elements cinemas = doc.getElementById("ctl00_ContentPlaceHolder1_ddlrap").children();
		for (Element cinema : cinemas) {
			String  cinemaLink = cinema.attr("value");
			if (!cinemaLink.equals("0")){
				String cinemaName = cinema.text().trim();

				String city = "ha-noi";
				String cinemaUrl = url + "/rap/" + cinemaLink;
				//for (int date=0;date<6;date++)
				crawlCinema(city, cinemaName, cinemaUrl, 0);
			}
		}
	}

	public static void main(String[] args) throws Exception {
		init();
		//testTime();
		//testMovieTicket();
		// query to search user
		/*Query searchMovieTicketQuery = new Query(Criteria.where("cinema").is("lotte"));
		MovieTicket movieTicket = mongoOperation.findOne(searchMovieTicketQuery, MovieTicket.class);
		System.out.println(movieTicket.getDate().getDate());*/
		//crawlCinema("Ha Noi","lotte landmark","http://phimchieurap.vn/lich-chieu/ha-noi/rap/lotte-cinema-landmark", 0);
		//showMovieTickets();
		//crawlHaNoi();
		/*String st = "Hội Quái Hộp - The Boxtrolls (12.09.2014)";
		st = st.replaceAll("\\((.*?)\\)", "").trim();
		System.out.println(st);*/
	}
}


text:
package com.projectbolek.domain.model.dto;

import lombok.Data;

import java.io.Serializable;

/**
 * Created by rogalsp1 on 05.06.16.
 */
@Data
public class PasswordDTO extends BaseDTO implements Serializable{
    private static final long serialVersionUID = -5616075725214219482L;

    private String password;
}


text:
package org.apache.hadoop.net.unix;

import static org.junit.Assert.assertFalse;

import java.util.ArrayList;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReentrantLock;

import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

import com.google.common.util.concurrent.Uninterruptibles;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestDomainSocketWatcher {
  static final Logger LOG =
      LoggerFactory.getLogger(TestDomainSocketWatcher.class);

  private Throwable trappedException = null;

  @Before
  public void before() {
    Assume.assumeTrue(DomainSocket.getLoadingFailureReason() == null);
  }

  @After
  public void after() {
    if (trappedException != null) {
      throw new IllegalStateException(
          "DomainSocketWatcher thread terminated with unexpected exception.",
          trappedException);
    }
  }

  /**
   * Test that we can create a DomainSocketWatcher and then shut it down.
   */
  @Test(timeout=60000)
  public void testCreateShutdown() throws Exception {
    DomainSocketWatcher watcher = newDomainSocketWatcher(10000000);
    watcher.close();
  }

  /**
   * Test that we can get notifications out a DomainSocketWatcher.
   */
  @Test(timeout=180000)
  public void testDeliverNotifications() throws Exception {
    DomainSocketWatcher watcher = newDomainSocketWatcher(10000000);
    DomainSocket pair[] = DomainSocket.socketpair();
    final CountDownLatch latch = new CountDownLatch(1);
    watcher.add(pair[1], new DomainSocketWatcher.Handler() {
      @Override
      public boolean handle(DomainSocket sock) {
        latch.countDown();
        return true;
      }
    });
    pair[0].close();
    latch.await();
    watcher.close();
  }

  /**
   * Test that a java interruption can stop the watcher thread
   */
  @Test(timeout=60000)
  public void testInterruption() throws Exception {
    final DomainSocketWatcher watcher = newDomainSocketWatcher(10);
    watcher.watcherThread.interrupt();
    Uninterruptibles.joinUninterruptibly(watcher.watcherThread);
    watcher.close();
  }

  /**
   * Test that domain sockets are closed when the watcher is closed.
   */
  @Test(timeout=300000)
  public void testCloseSocketOnWatcherClose() throws Exception {
    final DomainSocketWatcher watcher = newDomainSocketWatcher(10000000);
    DomainSocket pair[] = DomainSocket.socketpair();
    watcher.add(pair[1], new DomainSocketWatcher.Handler() {
      @Override
      public boolean handle(DomainSocket sock) {
        return true;
      }
    });
    watcher.close();
    Uninterruptibles.joinUninterruptibly(watcher.watcherThread);
    assertFalse(pair[1].isOpen());
  }

  @Test(timeout=300000)
  public void testStress() throws Exception {
    final int SOCKET_NUM = 250;
    final ReentrantLock lock = new ReentrantLock();
    final DomainSocketWatcher watcher = newDomainSocketWatcher(10000000);
    final ArrayList<DomainSocket[]> pairs = new ArrayList<DomainSocket[]>();
    final AtomicInteger handled = new AtomicInteger(0);

    final Thread adderThread = new Thread(new Runnable() {
      @Override
      public void run() {
        try {
          for (int i = 0; i < SOCKET_NUM; i++) {
            DomainSocket pair[] = DomainSocket.socketpair();
            watcher.add(pair[1], new DomainSocketWatcher.Handler() {
              @Override
              public boolean handle(DomainSocket sock) {
                handled.incrementAndGet();
                return true;
              }
            });
            lock.lock();
            try {
              pairs.add(pair);
            } finally {
              lock.unlock();
            }
          }
        } catch (Throwable e) {
          LOG.error(e.toString());
          throw new RuntimeException(e);
        }
      }
    });

    final Thread removerThread = new Thread(new Runnable() {
      @Override
      public void run() {
        final Random random = new Random();
        try {
          while (handled.get() != SOCKET_NUM) {
            lock.lock();
            try {
              if (!pairs.isEmpty()) {
                int idx = random.nextInt(pairs.size());
                DomainSocket pair[] = pairs.remove(idx);
                if (random.nextBoolean()) {
                  pair[0].close();
                } else {
                  watcher.remove(pair[1]);
                }
              }
            } finally {
              lock.unlock();
            }
          }
        } catch (Throwable e) {
          LOG.error(e.toString());
          throw new RuntimeException(e);
        }
      }
    });

    adderThread.start();
    removerThread.start();
    Uninterruptibles.joinUninterruptibly(adderThread);
    Uninterruptibles.joinUninterruptibly(removerThread);
    watcher.close();
  }

  @Test(timeout = 300000)
  public void testStressInterruption() throws Exception {
    final int SOCKET_NUM = 250;
    final ReentrantLock lock = new ReentrantLock();
    final DomainSocketWatcher watcher = newDomainSocketWatcher(10);
    final ArrayList<DomainSocket[]> pairs = new ArrayList<DomainSocket[]>();
    final AtomicInteger handled = new AtomicInteger(0);

    final Thread adderThread = new Thread(new Runnable() {
      @Override
      public void run() {
        try {
          for (int i = 0; i < SOCKET_NUM; i++) {
            DomainSocket pair[] = DomainSocket.socketpair();
            watcher.add(pair[1], new DomainSocketWatcher.Handler() {
              @Override
              public boolean handle(DomainSocket sock) {
                handled.incrementAndGet();
                return true;
              }
            });
            lock.lock();
            try {
              pairs.add(pair);
            } finally {
              lock.unlock();
            }
            TimeUnit.MILLISECONDS.sleep(1);
          }
        } catch (Throwable e) {
          LOG.error(e.toString());
          throw new RuntimeException(e);
        }
      }
    });

    final Thread removerThread = new Thread(new Runnable() {
      @Override
      public void run() {
        final Random random = new Random();
        try {
          while (handled.get() != SOCKET_NUM) {
            lock.lock();
            try {
              if (!pairs.isEmpty()) {
                int idx = random.nextInt(pairs.size());
                DomainSocket pair[] = pairs.remove(idx);
                if (random.nextBoolean()) {
                  pair[0].close();
                } else {
                  watcher.remove(pair[1]);
                }
                TimeUnit.MILLISECONDS.sleep(1);
              }
            } finally {
              lock.unlock();
            }
          }
        } catch (Throwable e) {
          LOG.error(e.toString());
          throw new RuntimeException(e);
        }
      }
    });

    adderThread.start();
    removerThread.start();
    TimeUnit.MILLISECONDS.sleep(100);
    watcher.watcherThread.interrupt();
    Uninterruptibles.joinUninterruptibly(adderThread);
    Uninterruptibles.joinUninterruptibly(removerThread);
    Uninterruptibles.joinUninterruptibly(watcher.watcherThread);
  }

  /**
   * Creates a new DomainSocketWatcher and tracks its thread for termination due
   * to an unexpected exception.  At the end of each test, if there was an
   * unexpected exception, then that exception is thrown to force a failure of
   * the test.
   *
   * @param interruptCheckPeriodMs interrupt check period passed to
   *     DomainSocketWatcher
   * @return new DomainSocketWatcher
   * @throws Exception if there is any failure
   */
  private DomainSocketWatcher newDomainSocketWatcher(int interruptCheckPeriodMs)
      throws Exception {
    DomainSocketWatcher watcher = new DomainSocketWatcher(
        interruptCheckPeriodMs, getClass().getSimpleName());
    watcher.watcherThread.setUncaughtExceptionHandler(
        new Thread.UncaughtExceptionHandler() {
          @Override
          public void uncaughtException(Thread thread, Throwable t) {
            trappedException = t;
          }
        });
    return watcher;
  }
}


text:
package com.plattysoft.leonids;

import java.util.ArrayList;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;

class ParticleField extends View {

	private ArrayList<Particle> mParticles;

	public ParticleField(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	public ParticleField(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public ParticleField(Context context) {
		super(context);
	}

	public void setParticles(ArrayList<Particle> particles) {
		mParticles = particles;
	}

	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		// Draw all the particles
		for (int i=0; i<mParticles.size(); i++) {
			mParticles.get(i).draw(canvas);
		}
	}
}


text:
<?php

// This file was auto-generated from sdk-root/src/data/ds/2015-04-16/paginators-1.json
return ['pagination' => ['DescribeDomainControllers' => ['input_token' => 'NextToken', 'output_token' => 'NextToken', 'limit_key' => 'Limit']]];


text:
Django cradmin 1.1.0 releasenotes
#################################

************
What is new?
************
- Django 1.9 support.
    - Also tested with Django 1.10b1, and all tests pass, and everything seems to work as it should.
    - Minumum Django version is still 1.8.
- Minimum version of Django-crispy-forms updated to 1.6.0.

****************
Breaking changes
****************

The ``cradmin_texformatting_tags`` template library was removed
===============================================================
It used deprecated and non-public APIs. It is not in use anywhere in the library,
and was undocumented, so this should hopefully not cause any major issues for any users.

Custom themes must update their cradmin_base-folder
===================================================
Because of some minor changes in form rendering in ``django-crispy-forms`` 1.6.0, all custom
themes must update their ``cradmin_base`` folder to the base folder. The changes was made
in commit d7b0c061e805431d01d4a48dd7def8c6ad2414ba.

Can no longer set button classes using field_classes
====================================================
This is due to changes in ``django-crispy-forms`` 1.6.0. Buttons inheriting from
``django_cradmin.crispylayouts.CradminSubmitButton`` (or PrimarySubmit, DangerSubmit, DefaultSubmit, ...),
must set their CSS classes using the ``button_css_classes`` attribute instead.


text:
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')

class TestFactoryHelperSlackEmoji < Test::Unit::TestCase

  def setup
    @tester = FactoryHelper::SlackEmoji
    @emoticon_regex= /^(?::(?:[-\w+]+):)+$/
  end

  def test_people
    assert @tester.people.match(@emoticon_regex)
  end

  def test_nature
    assert @tester.nature.match(@emoticon_regex)
  end

  def test_food_and_drink
    assert @tester.food_and_drink.match(@emoticon_regex)
  end

  def test_activity
    assert @tester.activity.match(@emoticon_regex)
  end

  def test_travel_and_places
    assert @tester.travel_and_places.match(@emoticon_regex)
  end

  def test_objects
    assert @tester.objects.match(@emoticon_regex)
  end

  def test_symbols
    assert @tester.symbols.match(@emoticon_regex)
  end

  def test_flags
    assert @tester.flags.match(@emoticon_regex)
  end

  def test_custom
    assert @tester.custom.match(@emoticon_regex)
  end

  def test_emoji
    assert @tester.emoji.match(@emoticon_regex)
  end
end