text:
module Aws::AutoScaling
  module Plugins
    class Endpoints < Seahorse::Client::Plugin
      option(
        :endpoint_provider,
        doc_type: 'Aws::AutoScaling::EndpointProvider',
        docstring: 'The endpoint provider used to resolve endpoints. Any '\
                   'object that responds to `#resolve_endpoint(parameters)` '\
                   'where `parameters` is a Struct similar to '\
                   '`Aws::AutoScaling::EndpointParameters`'
      ) do |cfg|
        Aws::AutoScaling::EndpointProvider.new
      end

      # @api private
      class Handler < Seahorse::Client::Handler
        def call(context)
          # If endpoint was discovered, do not resolve or apply the endpoint.
          unless context[:discovered_endpoint]
            params = parameters_for_operation(context)
            endpoint = context.config.endpoint_provider.resolve_endpoint(params)

            context.http_request.endpoint = endpoint.url
            apply_endpoint_headers(context, endpoint.headers)
          end

          context[:endpoint_params] = params
          context[:auth_scheme] =
            Aws::Endpoints.resolve_auth_scheme(context, endpoint)

          @handler.call(context)
        end

        private

        def apply_endpoint_headers(context, headers)
          headers.each do |key, values|
            value = values
              .compact
              .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
              .join(',')

            context.http_request.headers[key] = value
          end
        end

        def parameters_for_operation(context)
          case context.operation_name
          when :attach_instances
            Aws::AutoScaling::Endpoints::AttachInstances.build(context)
          when :attach_load_balancer_target_groups
            Aws::AutoScaling::Endpoints::AttachLoadBalancerTargetGroups.build(context)
          when :attach_load_balancers
            Aws::AutoScaling::Endpoints::AttachLoadBalancers.build(context)
          when :batch_delete_scheduled_action
            Aws::AutoScaling::Endpoints::BatchDeleteScheduledAction.build(context)
          when :batch_put_scheduled_update_group_action
            Aws::AutoScaling::Endpoints::BatchPutScheduledUpdateGroupAction.build(context)
          when :cancel_instance_refresh
            Aws::AutoScaling::Endpoints::CancelInstanceRefresh.build(context)
          when :complete_lifecycle_action
            Aws::AutoScaling::Endpoints::CompleteLifecycleAction.build(context)
          when :create_auto_scaling_group
            Aws::AutoScaling::Endpoints::CreateAutoScalingGroup.build(context)
          when :create_launch_configuration
            Aws::AutoScaling::Endpoints::CreateLaunchConfiguration.build(context)
          when :create_or_update_tags
            Aws::AutoScaling::Endpoints::CreateOrUpdateTags.build(context)
          when :delete_auto_scaling_group
            Aws::AutoScaling::Endpoints::DeleteAutoScalingGroup.build(context)
          when :delete_launch_configuration
            Aws::AutoScaling::Endpoints::DeleteLaunchConfiguration.build(context)
          when :delete_lifecycle_hook
            Aws::AutoScaling::Endpoints::DeleteLifecycleHook.build(context)
          when :delete_notification_configuration
            Aws::AutoScaling::Endpoints::DeleteNotificationConfiguration.build(context)
          when :delete_policy
            Aws::AutoScaling::Endpoints::DeletePolicy.build(context)
          when :delete_scheduled_action
            Aws::AutoScaling::Endpoints::DeleteScheduledAction.build(context)
          when :delete_tags
            Aws::AutoScaling::Endpoints::DeleteTags.build(context)
          when :delete_warm_pool
            Aws::AutoScaling::Endpoints::DeleteWarmPool.build(context)
          when :describe_account_limits
            Aws::AutoScaling::Endpoints::DescribeAccountLimits.build(context)
          when :describe_adjustment_types
            Aws::AutoScaling::Endpoints::DescribeAdjustmentTypes.build(context)
          when :describe_auto_scaling_groups
            Aws::AutoScaling::Endpoints::DescribeAutoScalingGroups.build(context)
          when :describe_auto_scaling_instances
            Aws::AutoScaling::Endpoints::DescribeAutoScalingInstances.build(context)
          when :describe_auto_scaling_notification_types
            Aws::AutoScaling::Endpoints::DescribeAutoScalingNotificationTypes.build(context)
          when :describe_instance_refreshes
            Aws::AutoScaling::Endpoints::DescribeInstanceRefreshes.build(context)
          when :describe_launch_configurations
            Aws::AutoScaling::Endpoints::DescribeLaunchConfigurations.build(context)
          when :describe_lifecycle_hook_types
            Aws::AutoScaling::Endpoints::DescribeLifecycleHookTypes.build(context)
          when :describe_lifecycle_hooks
            Aws::AutoScaling::Endpoints::DescribeLifecycleHooks.build(context)
          when :describe_load_balancer_target_groups
            Aws::AutoScaling::Endpoints::DescribeLoadBalancerTargetGroups.build(context)
          when :describe_load_balancers
            Aws::AutoScaling::Endpoints::DescribeLoadBalancers.build(context)
          when :describe_metric_collection_types
            Aws::AutoScaling::Endpoints::DescribeMetricCollectionTypes.build(context)
          when :describe_notification_configurations
            Aws::AutoScaling::Endpoints::DescribeNotificationConfigurations.build(context)
          when :describe_policies
            Aws::AutoScaling::Endpoints::DescribePolicies.build(context)
          when :describe_scaling_activities
            Aws::AutoScaling::Endpoints::DescribeScalingActivities.build(context)
          when :describe_scaling_process_types
            Aws::AutoScaling::Endpoints::DescribeScalingProcessTypes.build(context)
          when :describe_scheduled_actions
            Aws::AutoScaling::Endpoints::DescribeScheduledActions.build(context)
          when :describe_tags
            Aws::AutoScaling::Endpoints::DescribeTags.build(context)
          when :describe_termination_policy_types
            Aws::AutoScaling::Endpoints::DescribeTerminationPolicyTypes.build(context)
          when :describe_warm_pool
            Aws::AutoScaling::Endpoints::DescribeWarmPool.build(context)
          when :detach_instances
            Aws::AutoScaling::Endpoints::DetachInstances.build(context)
          when :detach_load_balancer_target_groups
            Aws::AutoScaling::Endpoints::DetachLoadBalancerTargetGroups.build(context)
          when :detach_load_balancers
            Aws::AutoScaling::Endpoints::DetachLoadBalancers.build(context)
          when :disable_metrics_collection
            Aws::AutoScaling::Endpoints::DisableMetricsCollection.build(context)
          when :enable_metrics_collection
            Aws::AutoScaling::Endpoints::EnableMetricsCollection.build(context)
          when :enter_standby
            Aws::AutoScaling::Endpoints::EnterStandby.build(context)
          when :execute_policy
            Aws::AutoScaling::Endpoints::ExecutePolicy.build(context)
          when :exit_standby
            Aws::AutoScaling::Endpoints::ExitStandby.build(context)
          when :get_predictive_scaling_forecast
            Aws::AutoScaling::Endpoints::GetPredictiveScalingForecast.build(context)
          when :put_lifecycle_hook
            Aws::AutoScaling::Endpoints::PutLifecycleHook.build(context)
          when :put_notification_configuration
            Aws::AutoScaling::Endpoints::PutNotificationConfiguration.build(context)
          when :put_scaling_policy
            Aws::AutoScaling::Endpoints::PutScalingPolicy.build(context)
          when :put_scheduled_update_group_action
            Aws::AutoScaling::Endpoints::PutScheduledUpdateGroupAction.build(context)
          when :put_warm_pool
            Aws::AutoScaling::Endpoints::PutWarmPool.build(context)
          when :record_lifecycle_action_heartbeat
            Aws::AutoScaling::Endpoints::RecordLifecycleActionHeartbeat.build(context)
          when :resume_processes
            Aws::AutoScaling::Endpoints::ResumeProcesses.build(context)
          when :set_desired_capacity
            Aws::AutoScaling::Endpoints::SetDesiredCapacity.build(context)
          when :set_instance_health
            Aws::AutoScaling::Endpoints::SetInstanceHealth.build(context)
          when :set_instance_protection
            Aws::AutoScaling::Endpoints::SetInstanceProtection.build(context)
          when :start_instance_refresh
            Aws::AutoScaling::Endpoints::StartInstanceRefresh.build(context)
          when :suspend_processes
            Aws::AutoScaling::Endpoints::SuspendProcesses.build(context)
          when :terminate_instance_in_auto_scaling_group
            Aws::AutoScaling::Endpoints::TerminateInstanceInAutoScalingGroup.build(context)
          when :update_auto_scaling_group
            Aws::AutoScaling::Endpoints::UpdateAutoScalingGroup.build(context)
          end
        end
      end

      def add_handlers(handlers, _config)
        handlers.add(Handler, step: :build, priority: 75)
      end
    end
  end
end


text:
const invalidArguments = [
  [undefined],
  [null],
  [true],
  ["test"],
  [Symbol()],
  [0],
  [0.1],
  [NaN],
  [{}, "Empty object"],
  [Response, "Response interface object"],
  [Response.prototype, "Response interface prototype object"],
];

for (const method of ["compileStreaming", "instantiateStreaming"]) {
  for (const [argument, name = format_value(argument)] of invalidArguments) {
    promise_test(t => {
      return promise_rejects_js(t, TypeError, WebAssembly[method](argument));
    }, `${method}: ${name}`);

    promise_test(t => {
      const promise = Promise.resolve(argument);
      return promise_rejects_js(t, TypeError, WebAssembly[method](argument));
    }, `${method}: ${name} in a promise`);
  }
}

redpajama_set_name: RedPajamaGithub


text:
import { AngularFireModule, AuthMethods } from 'angularfire2';

const firebaseConfig = {
    apiKey: "AIzaSyD9taKu2o17RAEkKz4y2UlfrFriaVhbrSw",
    authDomain: "silver-doe.firebaseapp.com",
    databaseURL: "https://silver-doe.firebaseio.com",
    storageBucket: "silver-doe.appspot.com",
    messagingSenderId: "969629471883"
};

const firebaseAuthConfig = {
    method: AuthMethods.Popup,
    remember: 'default'
};

export const FirebaseModule = AngularFireModule.initializeApp(firebaseConfig, firebaseAuthConfig);


text:
<?php

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

use AppBundle\Entity\User;
use AppBundle\Form\RegistrationType;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Security;

class UserController extends Controller
{
    /**
     * @Route("/login", name="login_route")
     */
    public function loginAction(Request $request) {
        $session = $request->getSession();

        // get the login error if there is one
        if ($request->attributes->has(Security::AUTHENTICATION_ERROR)) {
            $error = $request->attributes->get(
                Security::AUTHENTICATION_ERROR
            );
        } elseif (null !== $session && $session->has(Security::AUTHENTICATION_ERROR)) {
            $error = $session->get(Security::AUTHENTICATION_ERROR);
            $session->remove(Security::AUTHENTICATION_ERROR);
        } else {
            $error = '';
        }

        // last username entered by the user
        $lastUsername = (null === $session) ? '' : $session->get(Security::LAST_USERNAME);

        return $this->render(
            'user/login.html.twig',
            array(
                // last username entered by the user
                'last_username' => $lastUsername,
                'error'         => $error,
            )
    );
    }

    /**
     * @Route("/login_check", name="login_check")
     */
    public function loginCheckAction()
    {
    }

    /**
     * @Route("/logout", name="logout")
     */
    public function logoutCheckAction()
    {
    }

    /**
     * @Route("/register", name="register")
     */
    public function indexAction(Request $request)
    {
        // on crée un utilisateur vide
        $user = new User();

        // on recupere une instance de notre formulaire
        // ce form est associé à l'utilisateur vide
        $registrationForm = $this->createForm(new RegistrationType(), $user);

        // traite le formulaire
        $registrationForm->handleRequest( $request );
        // dump($user);

        // si les données sont valides ...
        if ($registrationForm->isValid()) {
            // hydrate les autres proprietés de notre User

                //generer un salt
                $salt = md5(uniqid());
                $user->setSalt( $salt );

                // generer un token
                $token = md5(uniqid());
                $user->setToken( $token );

                // hacher le mot de passe
                // sha512, 5000 fois
                $encoder = $this->container->get('security.password_encoder');
                $encoded = $encoder->encodePassword($user, $user->getPassword());
                $user->setPassword( $encoded );

                // dates d'inscription et date de modification
                $user->setDateRegistered(new \DateTime());
                $user->setDateModified(new \DateTime());

                // assigne toujours ce role aux utilisateurs du front office
                $user->setRoles( array("ROLE_USER"));

                // sauvegarder le User en bdd
                $em = $this->getDoctrine()->getManager();
                $em->persist( $user );
                $em->flush();

        }
        // on shoot le formulaire à Twig (on oublie pas le create view)
        $params = array(
            "registrationForm" => $registrationForm->createView()

        );
        return $this->render('user/register.html.twig', $params);
    }

    /**
     * @Route("/test-email", name="testEmail")
     */
    public function testAction() {

        $username = "yo";

        $message = \Swift_Message::newInstance()
            ->setCharset("utf-8")
            ->setSubject('Movies-mail')
            ->setFrom(array('mikael.guy@live.fr' => "Mikael"))
            ->setTo('guibioul@live.fr')
            ->setBody($this->renderView('email/forgot_password_email.html.twig',
                            array('username' => $username)),"txt/html")
        ;
        $this->get('mailer')->send($message);

        return $this->render("user/lost-password-check-email.html.twig");

    }
}


text:
'use strict';

// const utils = require('../lib/utils');
const commonBuilder = require('../lib/commonBuilder');
const prescriptionBuilder = require('../lib/prescriptionBuilder');
const injectionBuilder = require('../lib/injectionBuilder');
const patientBuilder = require('../lib/patientBuilder');
const summaryBuilder = require('../lib/summaryBuilder');

/*******************************************************************************
var simpleReferral = {
    patient: {},                                // 患者情報 simplePatientInfo
    occupation: '',                             // 職業 ?
    referFrom: {},                              // 紹介者情報を入れる親エレメント simpleCreator
    title: '',                                  // タイトル
    greeting: '',                               // 挨拶文 ?
    chiefComplaints: '',                        // 主訴
    clinicalDiagnosis: '',                      // 病名 ?
    pastHistory: {},                            // 既往歴 ?
    familyHistory: {},                          // 家族歴 ?
    presentIllness: {},                         // 現病歴
    testResults: {},                            // 検査結果 ?
    clinicalCourse: '',                         // 治療経過 ?
    medication: {},                             // 現在の処方 ?
    referPurpose: '',                           // 紹介目的
    remarks: {},                                // 備考 ?
    referToFacility: {},                        // 紹介先医療機関名
    referToPerson: {},                          // 紹介先医師 ? simpleCreator
    referToUnknownName: ''                      // 医師名を指定しない相手 ?
};

// 既往歴
var pastHistory = {
    value: '',                                  // 既往歴
    extRef: []                                  // 外部参照図 * [extRef]
};

// 家族歴歴
var familyHistory = {
    value: '',                                  // 家族歴歴
    extRef: []                                  // 外部参照図 * [extRef]
};

// 現病歴
var presentIllness = {
    value: '',                                  // 現病歴
    extRef: []                                  // 外部参照図 * [extRef]
};

// 検査結果
var testResults = {
    value: '',                                  // 検査結果
    extRef: []                                  // 外部参照図 * [extRef]
};

// 現在の処方
var medication = {
    value: '',                                  // 説明
    simplePrescription: {},                     // simplePrescription
    simpleInjection: {},                        // simpleInjection
    extRef: []                                  // 外部参照 * [extRef]
};

// 備考
var remarks: {
    value: ''                                   // 備考
    extRef: []                                  // 外部参照図 * [extRef]
},

// 紹介先医療機関名
var referToFacility = {
    facilityId: '',                             // 施設ID プロジェクトから指定
    facilityName: '',                           // 施設名称
    departmentId: '',                           // 診療科ID ?
    departmentName: ''                          // 診療科名称 ?
};
*******************************************************************************/

module.exports = {

    // PatientModule
    buildPatientModule: function (target, arr) {
        patientBuilder.build(target, arr);
    },

    // occupation
    buildOccupation: function (target, arr) {
        arr.push('<mmlRe:occupation>');
        arr.push(target);
        arr.push('</mmlRe:occupation>');
    },

    // referFrom
    buildReferFrom: function (target, arr) {
        arr.push('<mmlRe:referFrom>');
        commonBuilder.buildPersonalizedInfo(target, arr);
        arr.push('</mmlRe:referFrom>');
    },

    // title
    buildTitle: function (target, arr) {
        arr.push('<mmlRe:title>');
        arr.push(target);
        arr.push('</mmlRe:title>');
    },

    // greeting
    buildGreeting: function (target, arr) {
        arr.push('<mmlRe:greeting>');
        arr.push(target);
        arr.push('</mmlRe:greeting>');
    },

    // chiefComplaints
    buildChiefComplaints: function (target, arr) {
        arr.push('<mmlRe:chiefComplaints>');
        arr.push(target);
        arr.push('</mmlRe:chiefComplaints>');
    },

    // clinicalDiagnosis
    buildClinicalDiagnosis: function (target, arr) {
        arr.push('<mmlRe:clinicalDiagnosis>');
        arr.push(target);
        arr.push('</mmlRe:clinicalDiagnosis>');
    },

    // pastHistory extRef
    buildPastHistory: function (target, arr) {
        arr.push('<mmlRe:pastHistory>');
        arr.push(target.value);
        if (target.hasOwnProperty('extRef')) {
            target.extRef.forEach((e) => {
                commonBuilder.buildExtRef(e, arr);
            });
        }
        arr.push('</mmlRe:pastHistory>');
    },

    // familyHistory extRef
    buildFamilyHistory: function (target, arr) {
        arr.push('<mmlRe:familyHistory>');
        arr.push(target.value);
        if (target.hasOwnProperty('extRef')) {
            target.extRef.forEach((e) => {
                commonBuilder.buildExtRef(e, arr);
            });
        }
        arr.push('</mmlRe:familyHistory>');
    },

    // presentIllness extRef
    buildPresentIllness: function (target, arr) {
        arr.push('<mmlRe:presentIllness>');
        arr.push(target.value);
        if (target.hasOwnProperty('extRef')) {
            target.extRef.forEach((e) => {
                commonBuilder.buildExtRef(e, arr);
            });
        }
        arr.push('</mmlRe:presentIllness>');
    },

    // testResults extRef
    buildTestResults: function (target, arr) {
        arr.push('<mmlRe:testResults>');
        arr.push(target.value);
        if (target.hasOwnProperty('extRef')) {
            target.extRef.forEach((e) => {
                commonBuilder.buildExtRef(e, arr);
            });
        }
        arr.push('</mmlRe:testResults>');
    },

    // clinicalCourse
    buildClinicalCourse: function (target, arr) {
        summaryBuilder.buildClinicalCourse(target, arr);
    },

    // medication extRef
    buildMedication: function (target, arr) {
        arr.push('<mmlRe:medication>');
        arr.push(target.value);
        if (target.hasOwnProperty('PrescriptionModule')) {
            prescriptionBuilder.build(target.PrescriptionModule, arr);
        }
        if (target.hasOwnProperty('InjectionModule')) {
            injectionBuilder.build(target.InjectionModule, arr);
        }
        if (target.hasOwnProperty('extRef')) {
            target.extRef.forEach((e) => {
                commonBuilder.buildExtRef(e, arr);
            });
        }
        arr.push('</mmlRe:medication>');
    },

    // referPurpose
    buildReferPurpose: function (target, arr) {
        arr.push('<mmlRe:referPurpose>');
        arr.push(target);
        arr.push('</mmlRe:referPurpose>');
    },

    // remarks extRef
    buildRemarks: function (target, arr) {
        arr.push('<mmlRe:remarks>');
        arr.push(target.value);
        if (target.hasOwnProperty('extRef')) {
            target.extRef.forEach((e) => {
                commonBuilder.buildExtRef(e, arr);
            });
        }
        arr.push('</mmlRe:remarks>');
    },

    // referToFacility
    buildReferToFacility: function (target, arr) {
        arr.push('<mmlRe:referToFacility>');
        if (target.hasOwnProperty('Facility')) {
            commonBuilder.buildFacility(target.Facility, arr);
        }
        if (target.hasOwnProperty('Department')) {
            commonBuilder.buildDepartment(target.Department, arr);
        }
        arr.push('</mmlRe:referToFacility>');
    },

    // referToPerson
    buildReferToPerson: function (target, arr) {
        arr.push('<mmlRe:referToPerson>');
        commonBuilder.buildPersonalizedInfo(target, arr);
        arr.push('</mmlRe:referToPerson>');
    },

    // referToUnknownName
    buildReferToUnknownName: function (target, arr) {
        arr.push('<mmlRe:referToUnknownName>');
        arr.push(target);
        arr.push('</mmlRe:referToUnknownName>');
    },

    build: function (target, arr) {
        arr.push('<mmlRe:ReferralModule>');

        // PatientModule
        this.buildPatientModule(target.PatientModule, arr);

        // occupation
        if (target.hasOwnProperty('occupation')) {
            this.buildOccupation(target.occupation, arr);
        }

        // referFrom
        this.buildReferFrom(target.referFrom, arr);

        // title
        this.buildTitle(target.title, arr);

        // greeting
        if (target.hasOwnProperty('greeting')) {
            this.buildGreeting(target.greeting, arr);
        }

        // chiefComplaints
        this.buildChiefComplaints(target.chiefComplaints, arr);

        // clinicalDiagnosis
        if (target.hasOwnProperty('clinicalDiagnosis')) {
            this.buildClinicalDiagnosis(target.clinicalDiagnosis, arr);
        }

        // pastHistory
        if (target.hasOwnProperty('pastHistory')) {
            this.buildPastHistory(target.pastHistory, arr);
        }

        // familyHistory
        if (target.hasOwnProperty('familyHistory')) {
            this.buildFamilyHistory(target.familyHistory, arr);
        }

        // presentIllness
        if (target.hasOwnProperty('presentIllness')) {
            this.buildPresentIllness(target.presentIllness, arr);
        }

        // testResults
        if (target.hasOwnProperty('testResults')) {
            this.buildTestResults(target.testResults, arr);
        }

        // clinicalCourse
        if (target.hasOwnProperty('clinicalCourse')) {
            this.buildClinicalCourse(target.clinicalCourse, arr);
        }

        // medication
        if (target.hasOwnProperty('medication')) {
            this.buildMedication(target.medication, arr);
        }

        // referPurpose
        this.buildReferPurpose(target.referPurpose, arr);

        // remarks
        if (target.hasOwnProperty('remarks')) {
            this.buildRemarks(target.remarks, arr);
        }

        // referToFacility
        this.buildReferToFacility(target.referToFacility, arr);

        // referToPerson
        if (target.hasOwnProperty('referToPerson')) {
            this.buildReferToPerson(target.referToPerson, arr);
        }

        // referToUnknownName
        if (target.hasOwnProperty('referToUnknownName')) {
            this.buildReferToUnknownName(target.referToUnknownName, arr);
        }

        arr.push('</mmlRe:ReferralModule>');
    },

    deleteInstance: function (arr) {
        arr.push('<mmlRe:ReferralModule/>');
    }
};


text:
<resources>
    <string name="app_name">ListViewEdgeScale</string>
    <string name="action_settings">Settings</string>
</resources>


text:
using LightNode.Core;
using ProtoBuf.Meta;
using System;

namespace LightNode.Formatter
{
    public class ProtoBufContentFormatter : ContentFormatterBase
    {
        readonly RuntimeTypeModel runtimeTypeModel;

        public ProtoBufContentFormatter(string mediaType = "application/x-protobuf", string ext = "proto")
            : this(RuntimeTypeModel.Default, mediaType, ext)
        {
        }
        public ProtoBufContentFormatter(RuntimeTypeModel runtimeTypeModel, string mediaType = "application/x-protobuf", string ext = "proto")
            : base(mediaType, ext, null)
        {
            this.runtimeTypeModel = runtimeTypeModel;
        }

        public override void Serialize(System.IO.Stream stream, object obj)
        {
            runtimeTypeModel.Serialize(stream, obj);
        }

        public override object Deserialize(Type type, System.IO.Stream stream)
        {
            return runtimeTypeModel.Deserialize(stream, null, type);
        }
    }

    public class ProtoBufContentFormatterFactory : IContentFormatterFactory
    {
        public IContentFormatter CreateFormatter()
        {
            return new ProtoBufContentFormatter();
        }
    }
}


text:
try:
    from .local import *
except ImportError, e:
    pass


text:
layout: post
title:  "Google I/O 2017 Winner!"
date:   2017-03-01 16:00:00
categories: [tech]
comments: true
image:
  feature: google-io.png
---
Google I/O 2017...here I come! 🙌🏽

<!--more-->
MRW I find out that I'm going to Google I/O 2017:

<video preload="auto" autoplay="autoplay" loop="loop" style="width: 300px; height: 300px;">
    <source src="/img/giphy.mp4" type="video/webm"></source>
</video>
😱 OMG!!! I cannot believe this, I have been given the chance to attend Google I/O 2017!!! Keep pinching myself...is this real?!?!

This is a huge dream come true for me and I cannot wait to share this journey with you!

Make sure to check out my twitter/instagram/blog for live updates at the event.

Google I look forward to seeing you! 😎

**Follow me on: [@fizzyisdizzy](https://twitter.com/fizzyisdizzy)**


text:
package com.glaf.matrix.combination.util;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import com.glaf.core.domain.ColumnDefinition;
import com.glaf.core.domain.TableDefinition;
import com.glaf.core.util.DBUtils;

/**
 *
 * 实体数据工厂类
 *
 */
public class CombinationItemDomainFactory {

	public static final String TABLENAME = "SYS_COMBINATION_ITEM";

	public static final ConcurrentMap<String, String> columnMap = new ConcurrentHashMap<String, String>();

	public static final ConcurrentMap<String, String> javaTypeMap = new ConcurrentHashMap<String, String>();

	static {
		columnMap.put("id", "ID_");
		columnMap.put("syncId", "SYNCID_");
		columnMap.put("deploymentId", "DEPLOYMENTID_");
		columnMap.put("title", "TITLE_");
		columnMap.put("sql", "SQL_");
		columnMap.put("recursionSql", "RECURSIONSQL_");
		columnMap.put("recursionColumns", "RECURSIONCOLUMNS_");
		columnMap.put("primaryKey", "PRIMARYKEY_");
		columnMap.put("expression", "EXPRESSION_");
		columnMap.put("createTableFlag", "CREATETABLEFLAG_");
		columnMap.put("deleteFetch", "DELETEFETCH_");
		columnMap.put("sortNo", "SORTNO_");
		columnMap.put("locked", "LOCKED_");
		columnMap.put("createBy", "CREATEBY_");
		columnMap.put("createTime", "CREATETIME_");

		javaTypeMap.put("id", "Long");
		javaTypeMap.put("syncId", "Long");
		javaTypeMap.put("deploymentId", "String");
		javaTypeMap.put("title", "String");
		javaTypeMap.put("sql", "String");
		javaTypeMap.put("recursionSql", "String");
		javaTypeMap.put("recursionColumns", "String");
		javaTypeMap.put("primaryKey", "String");
		javaTypeMap.put("expression", "String");
		javaTypeMap.put("createTableFlag", "String");
		javaTypeMap.put("deleteFetch", "String");
		javaTypeMap.put("sortNo", "Integer");
		javaTypeMap.put("locked", "Integer");
		javaTypeMap.put("createBy", "String");
		javaTypeMap.put("createTime", "Date");
	}

	public static Map<String, String> getColumnMap() {
		return columnMap;
	}

	public static Map<String, String> getJavaTypeMap() {
		return javaTypeMap;
	}

	public static TableDefinition getTableDefinition() {
		return getTableDefinition(TABLENAME);
	}

	public static TableDefinition getTableDefinition(String tableName) {
		tableName = tableName.toUpperCase();
		TableDefinition tableDefinition = new TableDefinition();
		tableDefinition.setTableName(tableName);
		tableDefinition.setName("CombinationItem");

		ColumnDefinition idColumn = new ColumnDefinition();
		idColumn.setName("id");
		idColumn.setColumnName("ID_");
		idColumn.setJavaType("Long");
		tableDefinition.setIdColumn(idColumn);

		ColumnDefinition syncId = new ColumnDefinition();
		syncId.setName("syncId");
		syncId.setColumnName("SYNCID_");
		syncId.setJavaType("Long");
		tableDefinition.addColumn(syncId);

		ColumnDefinition deploymentId = new ColumnDefinition();
		deploymentId.setName("deploymentId");
		deploymentId.setColumnName("DEPLOYMENTID_");
		deploymentId.setJavaType("String");
		deploymentId.setLength(50);
		tableDefinition.addColumn(deploymentId);

		ColumnDefinition title = new ColumnDefinition();
		title.setName("title");
		title.setColumnName("TITLE_");
		title.setJavaType("String");
		title.setLength(200);
		tableDefinition.addColumn(title);

		ColumnDefinition sql = new ColumnDefinition();
		sql.setName("sql");
		sql.setColumnName("SQL_");
		sql.setJavaType("String");
		sql.setLength(4000);
		tableDefinition.addColumn(sql);

		ColumnDefinition recursionSql = new ColumnDefinition();
		recursionSql.setName("recursionSql");
		recursionSql.setColumnName("RECURSIONSQL_");
		recursionSql.setJavaType("String");
		recursionSql.setLength(4000);
		tableDefinition.addColumn(recursionSql);

		ColumnDefinition recursionColumns = new ColumnDefinition();
		recursionColumns.setName("recursionColumns");
		recursionColumns.setColumnName("RECURSIONCOLUMNS_");
		recursionColumns.setJavaType("String");
		recursionColumns.setLength(4000);
		tableDefinition.addColumn(recursionColumns);

		ColumnDefinition primaryKey = new ColumnDefinition();
		primaryKey.setName("primaryKey");
		primaryKey.setColumnName("PRIMARYKEY_");
		primaryKey.setJavaType("String");
		primaryKey.setLength(50);
		tableDefinition.addColumn(primaryKey);

		ColumnDefinition expression = new ColumnDefinition();
		expression.setName("expression");
		expression.setColumnName("EXPRESSION_");
		expression.setJavaType("String");
		expression.setLength(500);
		tableDefinition.addColumn(expression);

		ColumnDefinition createTableFlag = new ColumnDefinition();
		createTableFlag.setName("createTableFlag");
		createTableFlag.setColumnName("CREATETABLEFLAG_");
		createTableFlag.setJavaType("String");
		createTableFlag.setLength(1);
		tableDefinition.addColumn(createTableFlag);

		ColumnDefinition deleteFetch = new ColumnDefinition();
		deleteFetch.setName("deleteFetch");
		deleteFetch.setColumnName("DELETEFETCH_");
		deleteFetch.setJavaType("String");
		deleteFetch.setLength(1);
		tableDefinition.addColumn(deleteFetch);

		ColumnDefinition sortNo = new ColumnDefinition();
		sortNo.setName("sortNo");
		sortNo.setColumnName("SORTNO_");
		sortNo.setJavaType("Integer");
		tableDefinition.addColumn(sortNo);

		ColumnDefinition locked = new ColumnDefinition();
		locked.setName("locked");
		locked.setColumnName("LOCKED_");
		locked.setJavaType("Integer");
		tableDefinition.addColumn(locked);

		ColumnDefinition createBy = new ColumnDefinition();
		createBy.setName("createBy");
		createBy.setColumnName("CREATEBY_");
		createBy.setJavaType("String");
		createBy.setLength(50);
		tableDefinition.addColumn(createBy);

		ColumnDefinition createTime = new ColumnDefinition();
		createTime.setName("createTime");
		createTime.setColumnName("CREATETIME_");
		createTime.setJavaType("Date");
		tableDefinition.addColumn(createTime);

		return tableDefinition;
	}

	public static TableDefinition createTable() {
		TableDefinition tableDefinition = getTableDefinition(TABLENAME);
		if (!DBUtils.tableExists(TABLENAME)) {
			DBUtils.createTable(tableDefinition);
		} else {
			DBUtils.alterTable(tableDefinition);
		}
		return tableDefinition;
	}

	public static TableDefinition createTable(String tableName) {
		TableDefinition tableDefinition = getTableDefinition(tableName);
		if (!DBUtils.tableExists(tableName)) {
			DBUtils.createTable(tableDefinition);
		} else {
			DBUtils.alterTable(tableDefinition);
		}
		return tableDefinition;
	}

	private CombinationItemDomainFactory() {

	}

}


text:
package com.nec.strudel.entity;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Indexes {
    On[] value();
}


text:
<?php

declare(strict_types=1);

namespace phpseclib3\Tests\Unit\Crypt\AES;

class EvalTest extends TestCase
{
    protected function setUp(): void
    {
        $this->engine = 'Eval';
    }
}


text:
using MatterHackers.Agg.Image;
using MatterHackers.VectorMath;
using NUnit.Framework;

namespace MatterHackers.Agg.UI.Tests
{
	[TestFixture, Category("Agg.UI")]
	public class BackBufferTests
	{
		public bool saveImagesForDebug;

		private void SaveImage(ImageBuffer image, string dest)
		{
			if (saveImagesForDebug)
			{
				ImageTgaIO.Save(image, dest);
			}
		}

		[Test]
		public void DoubleBufferTests()
		{
			bool textWidgetDoubleBufferDefault = TextWidget.DoubleBufferDefault;

			// the text widget is double buffered
			TextWidget.DoubleBufferDefault = true;
			ImageBuffer doubleBufferImage = new ImageBuffer(65, 50, 24, new BlenderBGR());
			Button doubleBufferButton = new Button("testing", 0, 0);
			doubleBufferButton.OnDraw(doubleBufferImage.NewGraphics2D());
			SaveImage(doubleBufferImage, "z control.tga");

			// make sure the frame comparison function works.
			{
				ImageBuffer doubleBufferImageCopy = new ImageBuffer(doubleBufferImage, new BlenderBGR());
				Assert.IsTrue(doubleBufferImage == doubleBufferImageCopy);
			}

			// the text widget is not double buffered
			TextWidget.DoubleBufferDefault = false;
			ImageBuffer notDoubleBufferImage = new ImageBuffer(65, 50, 24, new BlenderBGR());
			Button notDoubleBufferButton = new Button("testing", 0, 0);
			notDoubleBufferButton.OnDraw(notDoubleBufferImage.NewGraphics2D());
			SaveImage(notDoubleBufferImage, "z test.tga");

			Assert.IsTrue(doubleBufferImage == notDoubleBufferImage);

			TextWidget.DoubleBufferDefault = textWidgetDoubleBufferDefault;
		}

		public void BackBuffersAreScreenAligned()
		{
			// make sure draw string and a text widget produce the same result when drawn to the same spot
			{
				ImageBuffer drawStringImage = new ImageBuffer(100, 20, 24, new BlenderBGR());
				{
					Graphics2D drawStringGraphics = drawStringImage.NewGraphics2D();
					drawStringGraphics.Clear(Color.White);
					drawStringGraphics.DrawString("test", 0, 0);
					SaveImage(drawStringImage, "z draw string.tga");
				}

				ImageBuffer textWidgetImage = new ImageBuffer(100, 20, 24, new BlenderBGR());
				{
					TextWidget textWidget = new TextWidget("test");
					Graphics2D textWidgetGraphics = textWidgetImage.NewGraphics2D();
					textWidgetGraphics.Clear(Color.White);
					textWidget.OnDraw(textWidgetGraphics);
				}

				Assert.IsTrue(drawStringImage == textWidgetImage);
			}

			// make sure that a back buffer is always trying to draw 1:1 pixels to the buffer above
			{
				ImageBuffer drawStringOffsetImage = new ImageBuffer(100, 20);
				{
					Graphics2D drawStringGraphics = drawStringOffsetImage.NewGraphics2D();
					drawStringGraphics.Clear(Color.White);
					drawStringGraphics.DrawString("test", 23.3, 0);
					SaveImage(drawStringOffsetImage, "z draw offset string.tga");
				}

				GuiWidget container = new GuiWidget(100, 20);
				container.DoubleBuffer = true;
				{
					TextWidget textWidget = new TextWidget("test", 23.3);
					container.AddChild(textWidget);
					container.BackBuffer.NewGraphics2D().Clear(Color.White);
					container.OnDraw(container.BackBuffer.NewGraphics2D());
					SaveImage(container.BackBuffer, "z offset text widget.tga");
				}

				Vector2 bestPosition;
				double bestLeastSquares;
				double maxError = 10;
				container.BackBuffer.FindLeastSquaresMatch(drawStringOffsetImage, out bestPosition, out bestLeastSquares, maxError);
				Assert.IsTrue(bestLeastSquares < maxError);
			}

			{
				ImageBuffer drawStringOffsetImage = new ImageBuffer(100, 20);
				{
					Graphics2D drawStringGraphics = drawStringOffsetImage.NewGraphics2D();
					drawStringGraphics.Clear(Color.White);
					drawStringGraphics.DrawString("test", 23.8, 0);
					SaveImage(drawStringOffsetImage, "z draw offset string.tga");
				}

				GuiWidget container1 = new GuiWidget(100, 20);
				container1.DoubleBuffer = true;
				GuiWidget container2 = new GuiWidget(90, 20);
				container2.OriginRelativeParent = new Vector2(.5, 0);
				container1.AddChild(container2);
				{
					TextWidget textWidget = new TextWidget("test", 23.3);
					container2.AddChild(textWidget);
					container1.BackBuffer.NewGraphics2D().Clear(Color.White);
					container1.OnDraw(container1.BackBuffer.NewGraphics2D());
					SaveImage(container1.BackBuffer, "z offset text widget.tga");
				}

				Assert.IsTrue(container1.BackBuffer.FindLeastSquaresMatch(drawStringOffsetImage, 5));
			}
		}
	}
}


text:
<md-toolbar class="md-table-toolbar md-default">

    <md-button id="main" hide show-gt-sm class="md-icon-button md-primary" ng-click="back()" aria-label="{{ 'Settings' | translate }}">
      <md-icon md-font-icon="arrow_back" >arrow_back</md-icon>
    </md-button>

Splash Pages

    <md-menu ng-if="menu">
      <md-button aria-label="{{ 'Open Tools' | translate }}" class="md-icon-button" ng-click="$mdOpenMenu($event)">
        <md-icon>more_vert</md-icon>
      </md-button>
      <md-menu-content width="4">
        <md-menu-item ng-repeat="item in menu">
          <md-button ng-disabled="item.disabled" ng-click="action(item.type)">
            <md-icon ng-if="item.icon" md-menu-origin md-font-icon="{{ item.icon }}">{{ item.icon }}</md-icon>
            {{item.name}}
          </md-button>
        </md-menu-item>
      </md-menu-content>
    </md-menu>

  <md-divider></md-divider>
</md-toolbar>

<md-content class="md-padding" layout="column" layout-gt-sm='column' layout-wrap>

  <form name="myForm" ng-submit="update(myForm)" confirm-on-exit>

      <md-card>

        <md-card-title>
          <md-card-title-text>

              Splash Settings

              <md-icon>error</md-icon>
              Splash not associated with a network. Associate now.

          </md-card-title-text>
        </md-card-title>
        <md-card-content layout="column" layout-gt-sm="row" layout-wrap>

              <md-input-container class="md-block">
                <translate>Access Type</translate>
                <md-select ng-model="splash.primary_access_id" ng-change="access_name()">
                  <md-option ng-repeat="type in access_types" value="{{type.id}}">
                    {{type.id | translateAccessTypeName}}
                  </md-option>
                </md-select>
              </md-input-container>

              <input style="display:none" type="password" name="splash_name"/>
              <md-input-container class="md-block">
                <translate>Splash Name</translate>
                <input ng-model="splash.splash_name" placeholder="{{ 'Name your splash page' | translate }}" type="text" name="splash_name" md-maxlength='100'>

Must be less than 100 characters

              </md-input-container>

              <md-list-item class="md-2-line">

Created

{{ splash.created_at | humanTime }}

              </md-list-item>
              <md-list-item class="md-2-line" ng-if="splash.debug">

Debug Mode

{{ splash.debug }}

              </md-list-item>
              <md-list-item class="md-2-line" ng-if="splash.vsg_host && splash.vsg_enabled">

Ruckus VSZ Host

{{ splash.vsg_host }}:{{ splash.vsg_port}}

              </md-list-item>
              <md-list-item class="md-2-line" ng-if="splash.meraki_enabled">

Meraki Enabled

              </md-list-item>
              <md-list-item class="md-2-line" ng-if="splash.unifi_enabled">

UniFi Enabled

              </md-list-item>

        </md-card-content>
      </md-card>

      <md-card>
        <md-card-title>
          <md-card-title-text>

              Email Capture

          </md-card-title-text>
        </md-card-title>

        <md-card-content layout="column" layout-gt-sm="row" layout-wrap>

              <md-input-container class="md-block">
                <translate>Newsletter Capture Type</translate>
                <md-select ng-model="splash.newsletter_type" ng-change="updateNews()">
                  <md-option ng-repeat="type in newsletter_types" value="{{ type.value }}">
                    {{type.key}}
                  </md-option>
                </md-select>
              </md-input-container>

              <md-input-container class="md-block">

                  Username and Password
                  Newsletter API Token

                <input ng-model="splash.newsletter_api_token" placeholder='{{ newsletter_placeholder }}' type="{{ showtoken ? 'text' : 'password' }}" ng-focus="showtoken = !showtoken" ng-blur="showtoken = !showtoken" name="newsletter_api_token" ng-maxlength='200' ng-disabled="!splash.newsletter_active || (splash.newsletter_type == 0 || splash.newsletter_type == 3)" ng-required="splash.newsletter_active && (splash.newsletter_type != 0 && splash.newsletter_type != 3)" ng-trim="false">

                     You must set a username and password.
                    You must set an API token.

              </md-input-container>

              <md-input-container class="md-block">
                <translate>Newsletter List ID</translate>
                <input ng-model="splash.newsletter_list_id" placeholder="{{ 'Your Newsletter List ID' | translate }}" ng-focus="showpassword = !showpassword" ng-blur="showpassword = !showpassword" type="{{ showpassword ? 'text' : 'password' }}" name="newsletter_list_id" ng-maxlength='100' ng-disabled="!splash.newsletter_active || (splash.newsletter_type == 0 || splash.newsletter_type == 3)" ng-required="splash.newsletter_active && (splash.newsletter_type != 0 && splash.newsletter_type != 3)" ng-pattern="/^[0-9a-zA-Z-_]*$/" ng-trim="false">

Invalid characters in list ID.

You must set a list ID.

              </md-input-container>

              <translate>'Internal Only' saves email in dashboard but doesn't subscribe to external service like MailChimp.</translate>

            <md-switch class="md-accent" ng-model="splash.email_required" aria-label="{{ 'Enabled Email Opt Out' | translate }}" ng-disabled="!splash.newsletter_active || splash.primary_access_id == 8 || splash.newsletter_checked">
              Disable Opt-Out
              Allow Opt-Out
            </md-switch>

            <md-switch class="md-accent" ng-model="splash.newsletter_checked" aria-label="{{ 'Enabled Checked' | translate }}" ng-disabled="!splash.newsletter_active || splash.primary_access_id == 8 || splash.email_required">
              <translate>Users should opt out</translate>

            </md-switch>

            <md-switch class="md-accent" ng-model="splash.merge_fields" aria-label="{{ 'Merge Fields' | translate }}" ng-disabled="!splash.newsletter_active || splash.primary_access_id != 8 || splash.newsletter_type != 1">
              <translate>Merge Registration Fields</translate>
            </md-switch>

            <md-switch class="md-accent" ng-model="splash.single_opt_in" aria-label="{{ 'Enabled Email Opt Out' | translate }}" ng-disabled="!splash.newsletter_active || splash.newsletter_type != 1">
              <translate>MailChimp Single Opt-In</translate>
            </md-switch>

        </md-card-content>
      </md-card>

      <md-card ng-hide="splash.primary_access_id == 2">
        <md-card-title>
          <md-card-title-text>

              Access Restrictions

          </md-card-title-text>
        </md-card-title>

        <md-card-content layout="column" layout-gt-sm="row" layout-wrap>

              <md-input-container class="md-block">
                <translate>Restriction Type</translate>
                <md-select ng-model="splash.access_restrict" ng-change="updateNews()">
                  <md-option ng-repeat="type in access_restrict" value="{{ type.value }}">
                    {{type.key}}
                  </md-option>
                </md-select>
              </md-input-container>

              <md-radio-group ng-model="splash.access_restrict_period" layout="row" style="padding: 10px 0 20px 0;" ng-if="splash.access_restrict === 'timed' || splash.access_restrict === 'data' || splash.access_restrict === 'none'" ng-disabled="splash.access_restrict === 'none'">
                <md-radio-button value="daily" class="md-primary"><translate>Daily</translate></md-radio-button>
                <md-radio-button value="weekly"><translate>Weekly</translate></md-radio-button>
                <md-radio-button value="monthly"><translate>Monthly</translate></md-radio-button>
              </md-radio-group>

                <md-input-container class="md-block">
                  <translate>Minutes {{ splash.access_restrict_period | translatableAccessRestrict | titleCase }}</translate>
                  <input ng-model="splash.access_restrict_mins" placeholder="" type='number' name="access_restrict_mins" ng-min="10" ng-max='43200' ng-disabled="splash.access_restrict === 'none'">

You must set the restrict mins.

Must be less than 43200.

Must be greater than 10.

                </md-input-container>

                <md-input-container class="md-block">
                  MB {{ splash.access_restrict_period | translatableAccessRestrict | titleCase }}
                  <input ng-model="splash.access_restrict_down" placeholder="{{ 'MB Limit' | translate }}" type='text' name="access_restrict_down" ng-max='' ng-min="10" required>

You must set the download restriction.

Must be greater than 10Mb.

                </md-input-container>

                <md-input-container class="md-block">
                  <translate>Timeout Days</translate>
                  <input ng-model="splash.timeout" placeholder="" type='number' name="timeout" ng-max='90' ng-min="0" ng-disabled="splash.access_restrict === 'none'">

Must be less than 90.

Must be greater than or equal to 0.

                </md-input-container>

                <md-input-container class="md-block">
                  <translate>Start Time</translate>
                  <input ng-model="splash.available_start" placeholder="{{ 'Start' | translate }}"  type='text' name="available_start" ng-pattern="/^([0-9]{2})\:([0-9]{2})$/">
                </md-input-container>

                <md-input-container class="md-block">
                  <translate>End Time</translate>
                  <input ng-model="splash.available_end" placeholder="{{ 'End' | translate }}" type='text' name="available_end" ng-pattern="/^([0-9]{2})\:([0-9]{2})$/">
                </md-input-container>

<translate>Allowed Days</translate>

                <day-selector active="true" days="splash.available_days" array="splash.periodic_days"></day-selector>

Set the start and end times to 00:00 to allow access all day

              <md-input-container class="md-block" ng-if="splash.access_restrict === 'timed' || splash.access_restrict === 'data'">

                  <md-icon md-font-icon="star">stars</md-icon>
                  Over-Usage Message

                <textarea rows=3 ng-model="splash.quota_message" placeholder="{{ 'Message displayed when a customer goes over-limit.' | translate }}" rows="3" ng-disabled="splash.access_restrict === 'periodic'"></textarea>
              </md-input-container>

              <translate>Download Speed {{ (splash.download_speed / 1024) | number }}Mbps</translate>
              <md-slider md-discrete ng-model="splash.download_speed" step="256" min="0" max="49134" aria-label="download">
              </md-slider>

              <translate>Upload Speed {{ (splash.upload_speed / 1024) | number }}Mbps</translate>
              <md-slider md-discrete ng-model="splash.upload_speed" step="256" min="0" max="49134" aria-label="upload">
              </md-slider>

              <md-input-container class="md-block">
                <translate>Download {{ splash.download_speed | mbps }}</translate>
                <input name="download" type="number" min="0" ng-model="splash.download_speed"></input>

Must be greater than or equal to 0.

              </md-input-container>

              <md-input-container class="md-block">
                <translate>Upload {{ splash.upload_speed | mbps }}</translate>
                <input name="upload" type="number" min="0" ng-model="splash.upload_speed"></input>

Must be greater than or equal to 0.

              </md-input-container>

            <translate>Speed restrictions not compatible with QuickCodes or Voucher based splash pages.</translate>

Edit values

        </md-card-content>
      </md-card>

      <md-card>
        <md-card-title>
          <md-card-title-text>

              Access Settings

          </md-card-title-text>

        </md-card-title>

        <md-card-content layout="column" layout-gt-sm="column">
          <md-input-container class="md-block">
            <translate>Walled Gardens</translate>
            <md-chips
              ng-model="splash.walled_gardens_array"
              placeholder="{{ 'Enter a URL' | translate }}"
              delete-button-label="{{ 'Remove URL' | translate }}"
              delete-hint="{{ 'Press delete to remove URL' | translate }}"
              secondary-placeholder="+URL"></md-chips>

Hit enter after each URL to save multiple addresses

          </md-input-container>

        </md-card-content>
      </md-card>

      <md-card>
        <md-card-title>
          <md-card-title-text>

              Advanced Settings

          </md-card-title-text>
        </md-card-title>

        <md-card-content layout="column" layout-gt-sm="row" layout-wrap>

                <md-input-container class="md-block">
                  <translate>Show After (mins)</translate>
                  <input ng-model="splash.session_timeout" placeholder="{{ 'Session Timeout' | translate }}" type='number' name="session_timeout" ng-max='43200' ng-min='10'></input>

Must be greater than 10 minutes.

Must be less than 43200 minutes.

                </md-input-container>

                <md-input-container class="md-block">
                  <translate>Idle Timeout (mins)</translate>
                  <input ng-model="splash.idle_timeout" placeholder="{{ 'Idle Timeout' | translate }}" type='number' name="idle_timeout" ng-max='43200' ng-min='10'></input>

Must be greater than 10 minutes.

Must be less than 43200 minutes.

                </md-input-container>

                <md-input-container class="md-block">
                  <translate>Weight</translate>
                  <input ng-model="splash.weight" placeholder="{{ 'Weight' | translate }}" type='number' name="weight" ng-min='0'></input>

Must be greater than 0.

                </md-input-container>

                <md-input-container class="md-block">
                  <translate>Redirect URL</translate>
                  <input ng-model="splash.success_url" placeholder="http://my-site.com/awesome" type='url' name="success_url" ng-maximum='255'>

Must be less than 255 chars.

Must be a valid URL, including http(s).

                </md-input-container>

                <md-input-container class="md-block">
                  <translate>Google Analytics</translate>
                  <input ng-model="splash.google_analytics_id" placeholder="UA-57956353-1" type='text' name="google_analytics_id" md-maxlength='15'>

Must be less than 15 chars.

                </md-input-container>

                <md-input-container class="md-block">
                  <translate>Unique ID</translate>
                  <input ng-model="splash.unique_id" disabled="1" type='text'>
                </md-input-container>

                <md-input-container class="md-block">
                  <translate>Timezone</translate>
                  <md-select ng-model="splash.timezone">
                    <md-option ng-repeat="zone in timezones" value="{{zone}}">
                      {{zone}}
                    </md-option>
                  </md-select>
                </md-input-container>

<translate>Set the Timezone to ensure your splash restrictions work correctly.</translate>

                <md-input-container class="md-block" flex-gt-sm="100" style="margin: 40px 0 0 0;">

                    <translate>Tags</translate>

                  <input ng-model="splash.tags" name="tags" placeholder="{{ 'Splash tags' | translate }}" type="text" ng-maxlength="255">

Must be less than 255 chars.

                </md-input-container>
                Filter your splash triggers and actions with tags.

            <md-switch class="md-accent" ng-model="splash.tagged_logins" aria-label="tagged logins" ng-change="updateLocation()">
              Tagged Logins Enabled
              Tagged Logins Disabled
            </md-switch>

            <md-switch class="md-accent" ng-model="splash.powered_by" aria-label="powered_by">
              'Powered By' Visible
              'Powered By' Hidden
            </md-switch>

            <md-switch class="md-accent" ng-model="splash.active" aria-label="active">
              Splash Enabled
              Splash Disabled
            </md-switch>

            <md-switch class="md-accent" ng-model="splash.display_console" aria-label="debug">
              Debug Mode Enabled
              Debug Mode Disabled
            </md-switch>

            <md-switch class="md-accent" ng-model="splash.bypass_popup_ios" aria-label="debug">
              Bypass iOS Popup Enabled
              Bypass iOS Popup Disabled
            </md-switch>

            <md-switch class="md-accent" ng-model="splash.bypass_popup_android" aria-label="debug">
              Bypass Android Popup Enabled
              Bypass Android Popup Disabled
            </md-switch>

        </md-card-content>
      </md-card>

      <md-button ng-click="update(myForm)" ng-disabled="myForm.$invalid || myForm.$pristine" class="md-raised md-primary"><translate>Save</translate></md-button>

Splash invalid, please check your settings.

      <md-button aria-label="menu" ng-hide="myForm.$invalid || myForm.$pristine" type="submit" class="md-fab md-primary md-fab-bottom-right ">
        <md-icon md-font-icon="" >save</md-icon>
      </md-button>

  </form>

</md-content>


text:
package db.schema.entity;

import java.util.Map;

/**
 * A query projecting some columns, having a single range filter condition, and optionally selections as well.
 * It contains information only relevant to scanning and filtering a single table.
 * Database queries touching multiple tables have to be represented by a separate Query object for each table being touched.
 *
 * @author Endre Palatinus
 *
 */
public class RangeQuery extends Query {

    protected Range rangeCondition;

    public RangeQuery(String name, int weight, Range rangeCondition) {
        super(name, weight);
        this.rangeCondition = rangeCondition;
    }

    public RangeQuery(Query query, Range rangeCondition) {
        super(query);
        this.rangeCondition = rangeCondition;
    }

    public Range getRangeCondition(){
        return this.rangeCondition;
    }

    public void setRangeCondition(Range range){
        this.rangeCondition = range;
    }
}


text:
package heterogeneous.brainStorm;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.JobPriority;
import org.apache.hadoop.mapred.KeyValueTextInputFormat;
import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reducer;
import org.apache.hadoop.mapred.Reporter;
import org.apache.hadoop.mapred.TextInputFormat;
import org.apache.hadoop.mapred.TextOutputFormat;
import org.apache.hadoop.mapred.lib.MultipleInputs;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;

/**
 *
	 *            This program concatenates both the networks and neighborhoods
	 *            so that it is easy to compute flow values. This class takes
	 *            the updated neighborhoods(neighborhoods updated with the
	 *            type of link information.
 * @author rohitp
 *
 */
public class ConcatenateNetworksForFlow extends Configured implements Tool {

	/**
	 * @param args
	 *
	 *
	 *
	 */

	public static class ConcatenateNetworksForFlowMapper extends MapReduceBase implements Mapper<Text, Text, Text, Text> {

		/*
		 *
		 * (non-Javadoc)
		 *
		 * @see org.apache.hadoop.mapred.Mapper#map(java.lang.Object,
		 * java.lang.Object, org.apache.hadoop.mapred.OutputCollector,
		 * org.apache.hadoop.mapred.Reporter)
		 *
		 */
		 /** Input:
		 *
		 * Key:<user:updateddegree>
		 *
		 *  --- updatedDegree = degree+(typeofnetwork); ---
		 *
		 * Value--<user1:degree1:commonItemCountDist>,<user3:degree3:commonItemCountDist>,<user2:degree2:commonItemCountDist>,typeofnetwork
		 *
		 * _typeofnetwork---Is the type of the network that is specified in the updated neighborhood job
		 *
		 * Output:
		 *
		 * Key--<User>
		 *
		 * Values_1 -- updatedDegree
		 * Values_2 -- <user1:degree1:commonItemCountDist>,<user3:degree3:commonItemCountDist>,<user2:degree2:commonItemCountDist>,typeofnetwork
		 */

		public void map(Text key, Text value, OutputCollector<Text, Text> output, Reporter reporter)
				throws IOException {
			// TODO Auto-generated method stub

			String keyString = key.toString();
			String[] userDegree = keyString.split("\\:");

			output.collect(new Text(userDegree[0]), new Text(userDegree[1]));
			output.collect(new Text(userDegree[0]), value);
		}
	}

	public static class ConcatenateNetworksForFlowReducer extends MapReduceBase
			implements Reducer<Text, Text, Text, Text> {

		/*
		 * (non-Javadoc)
		 *
		 * @see org.apache.hadoop.mapred.Reducer#reduce(java.lang.Object,
		 * java.util.Iterator, org.apache.hadoop.mapred.OutputCollector,
		 * org.apache.hadoop.mapred.Reporter)
		 */

		private HashMap<Integer, Integer> degrees = new HashMap<Integer, Integer>();
		private List<Integer> networkType = new ArrayList<Integer>();

/*		// remove the last character and test the rest of the string to see of
		// it is the degree or neighbors. If they are neighbors then the try
		// block will throw an exception*/
		public boolean isDegreeOrNeighbor(String source) {

			/*MyCode*/

			if(source.contains(":"))
			{
				return false;
			}
			else
			{
				int networkID = Integer.parseInt(source.charAt(source.length() - 1) + "");

				int degree = Integer.parseInt(source.substring(0, source.length() - 1));

				for (int network : networkType) {
					if (networkID == network)
					{
						/*store the degree information in the hashmap*/
						degrees.put(network, degree);
					}
				}

				return true;
			}

		}

		@Override
		public void configure(JobConf job) {
			try {
				int numNetworks = Integer.parseInt(job.get("numNetworks"));
				for (int i = 0; i < numNetworks; i++) {
					networkType.add(Integer.parseInt(job.get("type" + (i + 1))));
				}
			} catch (Exception e) {

			}
		}

		/** Input:
		 *
		 * Key--<User>
		 *
		 * ValueType_1 -- updatedDegree1,updatedDegree2 ... updatedDegree_numNetworks
		 * ValueType_2 -- Neighbor information from n networks
		 *
		 * <user1:degree1:commonItemCountDist>,<user3:degree3:commonItemCountDist>,<user2:degree2:commonItemCountDist>,typeofnetwork
		 *
		 * Output:
		 *
		 * Key:<User:updatedDegree1:updatedDegree2>
		 *
		 * Value--<user1:degree1:commonItemCountDist1:degree2:commonItemCountDist2>,
		 * 		  <user3:degree1:commonItemCountDist1:degree2:commonItemCountDist2>,
		 *        <user2:degree1:commonItemCountDist1:degree2:commonItemCountDist2>,
		 */
		public void reduce(Text key, Iterator<Text> values, OutputCollector<Text, Text> output, Reporter reporter) throws IOException {

			/*HashMap to store the neighbor information: The key is the  neighbor userID*/
			HashMap<String, HashMap<Integer, String>> neighbors = new HashMap<String, HashMap<Integer, String>>();

			while (values.hasNext()) {

				/*The input value can be either the degree (itemCount) or neighborhood information*/
				String itemCountOrNeighborsString = values.next().toString().trim();

				boolean itemCount = isDegreeOrNeighbor(itemCountOrNeighborsString);

				// If the value is not an itemCount then go to this part of the code and store the neighbor information
				if (!itemCount) {

					/*split the string using comma and store the neighbor information in a hashmap*/

					String[] networkNeighborString = itemCountOrNeighborsString.split(",");

					/*The last value corresponds to the network ID*/
					int networkID = Integer.parseInt(networkNeighborString[networkNeighborString.length-1]);

					/*iterate through the neighbors*/
					for(int i=0;i< networkNeighborString.length-1;i++)
					{
						/*The string array has userID, itemCount and commonItemDistribution*/
						String[] neighborInfo = networkNeighborString[i].trim().split(",");

						for (String s : neighborInfo) {

							// store all the edges in a hash map.
							String[] splits = s.split("\\:");

							// The key of the hashmap is the node name and the values are the itemCount and commonItemDistribution in each network respectively.
							// If the node is not present in both the neighborhoods we store only one neighbors degree and weight
							if (splits.length == 3)
							{
								s = splits[0];// splits[0]--contains the node name
								if (neighbors.containsKey(s))
								{

									HashMap<Integer, String> map = neighbors.get(s);

									for (int network : networkType)
									{

										/*If the current network ID matches the current network type*/
										if (networkID == network)
										{
											map.put(network, (splits[1]+ ":"+ splits[2]+ ":"));
											break;
										}
									}
									neighbors.put(s, map);
								}
								else
								{
									for (int network : networkType)
									{
										if (networkID == network)
										{
											HashMap<Integer, String> map = new HashMap<Integer, String>();
											map.put(network, (splits[1]+ ":"+ splits[2]+ ":"));
											neighbors.put(s, map);
											break;
										}
									}
								}

							}
						}
					}

				}
			}

			String updatedKey = key.toString();
			for (int network : networkType) {

				if(degrees.containsKey(network))
					updatedKey += ":" + degrees.get(network);
				else
					updatedKey += ":" + 0;
			}

			/*So far, we have parsed the itemCount information from different networks for the key user and stored it.
			 * We also parsed the neighbor information from multiple networks and stored it. Now we have to print it.*/

			// Iterate through the hashmap and store all the values(degree and
			// weights) of the hashmaps without the appended characters
			// The order of storing an is :
			/*
			 * If there is an edge of type ingredient and recipe in the
			 * neighborhood then we store the edge as:
			 *
			 * neighborID:recipe_degree:recipe_common_neighbors:ingredient_degree:ingredient_common_neighbors
			 *
			 * If there is recipe edge and no ingredient edge then we store the edge as:
			 *
			 * neighborID:recipe_degree:recipe_common_neighbors:0:0
			 *
			 * If there is a ingredient edge and no recipe edge then we store the edge as:
			 *
			 * neighborID:0:0:ingredient_degree:ingredient_common_neighbors
			 */
			Iterator<String> neighborIterator = neighbors.keySet().iterator();
			StringBuffer edges = new StringBuffer();

			while (neighborIterator.hasNext()) {
				String neighborKey = neighborIterator.next();
				/*Get the hashmap with the networkID as key and itemCount:dist as value*/
				HashMap<Integer, String> neighborValue = neighbors.get(neighborKey);

				String degreeWeight = "";

				for (int network : networkType) {
					if (neighborValue.containsKey(network)) {
						degreeWeight += (neighborValue.get(network));
					} else {
						degreeWeight += ("0:0:");
					}
				}
				edges.append(neighborKey + ":" + degreeWeight.substring(0, degreeWeight.length() - 1)+ ",");
			}

			// emit the node and it's new properties
			output.collect(new Text(updatedKey), new Text(edges.toString()));

			/*Degrees hashmap has to be reset for every user*/
			degrees.clear();
		}
	}

	public static void main(String[] args) {
		try {
			ToolRunner.run(new Configuration(),
					new ConcatenateNetworksForFlow(), args);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	public int run(String[] args) throws Exception {
		JobConf job = new JobConf(super.getConf(), this.getClass());
		job.setJarByClass(this.getClass());
		job.setJobName("Concatenate Degrees and Networks");
		job.setJobPriority(JobPriority.NORMAL);

		job.setMapperClass(ConcatenateNetworksForFlowMapper.class);
		job.setReducerClass(ConcatenateNetworksForFlowReducer.class);

		job.setOutputFormat(TextOutputFormat.class);

		job.setNumReduceTasks(Integer.parseInt(args[args.length-1]));

		job.setMapOutputKeyClass(Text.class);
		job.setMapOutputValueClass(Text.class);
		job.setOutputKeyClass(Text.class);
		job.setOutputValueClass(Text.class);

		int numNetworks = Integer.parseInt(args[args.length - 2]);

		for (int i = 0; i < numNetworks; i++) {

			System.out.println("Input path is: " + args[i]);
			MultipleInputs.addInputPath(job, new Path(args[i]),KeyValueTextInputFormat.class);
		}

		job.set("numNetworks", numNetworks+"");

		String outputPath_ = args[numNetworks];

		System.out.println("Output path is: " + outputPath_);

		FileSystem.get(job).delete(new Path(outputPath_));
		FileOutputFormat.setOutputPath(job,new Path(outputPath_));

		for (int i = 0; i < numNetworks; i++) {

			/* set the type of the network that we are using to store the neighborhood. The same type is to be used throughout */

			System.out.println("type" + (i + 1));
			System.out.println(args[numNetworks+1+i]);

			job.set("type" + (i + 1), args[numNetworks+1+i]);
		}

		JobClient.runJob(job);
		System.out.println("***********DONE********");
		return 0;
	}

}


text:
//<unit_header>
//----------------------------------------------------------------
//
// Martin Korneffel: IT Beratung/Softwareentwicklung
// Stuttgart, den 12.2014
//
//  Projekt.......: mko.BI
//  Name..........: State.cs
//  Aufgabe/Fkt...: Basisklasse der Zustände endlicher Automaten.
//                  Die endlichen Automaten sind Grundlage von Workflows.
//
//
//
//
//<unit_environment>
//------------------------------------------------------------------
//  Zielmaschine..: PC
//  Betriebssystem: Windows XP mit .NET 2.0
//  Werkzeuge.....: Visual Studio 2005
//  Autor.........: Martin Korneffel (mko)
//  Version 1.0...:
//
// </unit_environment>
//
//<unit_history>
//------------------------------------------------------------------
//
//  Version.......: 1.1
//  Autor.........: Martin Korneffel (mko)
//  Datum.........: 23.4.2015
//  Änderungen....: Umzug vom Projekt mko.Automaton.StateMachine in mko.BI.
//                  Integration der Zustandsüberführungsfunktion in die Zustandsklasse
//
//  Autor.........: Martin Korneffel (mko)
//  Datum.........: 4.2.2016
//  Änderungen....: BehaviorOfState gegen IStateBehavior ausgetauscht.
//                  Next gibt im Fall eines Endzustandes Liste mit Endzustand selber zurück.
//</unit_history>
//</unit_header>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace mko.BI.StateMachine
{
    public class State : IStateBehavior
    {
        /// <summary>
        /// Liste der möglichen Folgezustände
        /// </summary>
        public virtual State[] Next
        {
            get
            {
                // 4.2.2016, mko, Rückgabe von this falls isFinal == true
                if (IsFinal)
                    return new State[] { this };
                else
                    return _Next;
            }
        }

        State[] _Next;

        /// <summary>
        /// Initialisiert die Liste der Folgezustände dieses Zustands
        /// </summary>
        /// <param name="Next"></param>
        protected virtual void InitNext(State[] Next)
        {
            if (Next != null)
                _Next = Next;
            else
                _Next = new State[] { };
        }

        /// <summary>
        /// Konstruktor
        /// </summary>
        /// <param name="behavior">Definiert das grundsätzlich Verhalten des Zustandes (Start-, Normal- oder Finaler Zustand)</param>
        /// <param name="Next">Liste der möglichen Folgezustände</param>
        public State(IStateBehavior behavior, params State[] Next)
        {
            InitBehavior(behavior);
            InitNext(Next);
        }

        /// <summary>
        /// Initialisiert das Verhalten eines Zustandes
        /// </summary>
        /// <param name="behavior"></param>
        protected virtual void InitBehavior(IStateBehavior behavior)
        {
            _IsFinal = behavior.IsFinal;
            _IsStart = behavior.IsStart;
        }

        /// <summary>
        /// Zustand als Startzustand markieren
        /// </summary>
        /// <returns></returns>
        public static IStateBehavior CreateStartStateBehavior()
        {
            return new StartStateBehavior();
        }

        /// <summary>
        /// Zustand als gewöhnlichen Zustand markieren
        /// </summary>
        /// <returns></returns>
        public static IStateBehavior CreateNormalStateBehavior()
        {
            return new NormalStateBehavior();
        }

        /// <summary>
        /// Zustand als Endzustand markieren
        /// </summary>
        /// <returns></returns>
        public static IStateBehavior CreateFinalStateBehavior()
        {
            return new FinalStateBehavior();
        }

        /// <summary>
        /// Zustand als einzigen Zustand eines deterministischen Automaten markieren,
        /// der Start- und Endzustand in Einem ist.
        /// </summary>
        /// <returns></returns>
        public static IStateBehavior CreateSingleStateMachineBehavior()
        {
            return new SingleStateMachineBehavior();
        }

        /// <summary>
        /// Wenn True, dann ist der Zustand ein Startzustand
        /// </summary>
        public virtual bool IsStart
        {
            get
            {
                return _IsStart;
            }
        }
        bool _IsStart;

        /// <summary>
        /// Wenn True, dann ist der Zustand ein Endzustand
        /// </summary>
        public virtual bool IsFinal
        {
            get
            {
                return _IsFinal;
            }
        }
        bool _IsFinal;

        /// <summary>
        /// Wenn True, dann ist das Objekt ein Zustand vom Typ einer
        /// von State abgeleiteten Klasse, die neben der Darstellung des Zustandes an sich
        /// auch noch die mit dem Zustand verknüpften Zustand der Laufzeitumgebung speichert.
        /// Konvention:
        /// Eine Klasse mit der Basisklasse State, deren Name das Suffix "Context" hat, wird als
        /// Context- Klasse erkannt.
        /// </summary>
        public virtual bool IsContext
        {
            get
            {
                string name = GetType().Name;
                if (name.EndsWith("Context"))
                    return true;
                else
                    return false;
            }
        }

        /// <summary>
        /// Name des Zustandes. Wird aus dem Namen der Klasse ermittelt.
        /// Konvention: Wenn der Name der Klasse Context oder Base lautet,
        ///             dann wird der letzte Partikel des Namespce zurückgeliefert.
        ///             Voraussetzung ist, die gesamte Klassenhirarchie für einen
        ///             Zustand in einem eineindeutigen Namespace eingeschlossen ist.
        /// </summary>
        public virtual string Name
        {
            get
            {
                var type = GetType();
                string n = type.Name.ToLower();
                if (n == "context" || n == "base")
                {
                    return type.Namespace.Split('.').Last();
                }
                else
                {
                    return type.Name;
                }
            }
        }
    }
}


text:
#ifdef _MSC_VER
#pragma once
#endif

#include <fstream>

namespace ando {
	namespace logger {
		class IBasicLogger {
		public:
			virtual void rawLog(::std::string text) = 0;
		};
	}
}

#endif // IBASIC_LOGGER_HPP


text:
<?php

namespace Jbig3Base\Base\Model\Entity;

interface BaseEntityInterface
{
    public function getId();

    public function getFqcn();

    public function setFqcn($fqcn);
}


text:
package cache

import (
	kapierrors "k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/tools/cache"
	kapi "k8s.io/kubernetes/pkg/api"
)

// StoreToServiceAccountLister gives a store List and Exists methods. The store must contain only ServiceAccounts.
type StoreToServiceAccountLister struct {
	cache.Indexer
}

func (s *StoreToServiceAccountLister) ServiceAccounts(namespace string) storeServiceAccountsNamespacer {
	return storeServiceAccountsNamespacer{s.Indexer, namespace}
}

// storeServiceAccountsNamespacer provides a way to get and list ServiceAccounts from a specific namespace.
type storeServiceAccountsNamespacer struct {
	indexer   cache.Indexer
	namespace string
}

// Get the  ServiceAccount matching the name from the cache.
func (s storeServiceAccountsNamespacer) Get(name string, options metav1.GetOptions) (*kapi.ServiceAccount, error) {
	obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, kapierrors.NewNotFound(kapi.Resource("serviceaccount"), name)
	}
	return obj.(*kapi.ServiceAccount), nil
}

// List all the ServiceAccounts that match the provided selector using a namespace index.
// If the indexed list fails then we will fallback to listing from all namespaces and filter
// by the namespace we want.
func (s storeServiceAccountsNamespacer) List(selector labels.Selector) ([]*kapi.ServiceAccount, error) {
	serviceAccounts := []*kapi.ServiceAccount{}

	if s.namespace == metav1.NamespaceAll {
		for _, obj := range s.indexer.List() {
			bc := obj.(*kapi.ServiceAccount)
			if selector.Matches(labels.Set(bc.Labels)) {
				serviceAccounts = append(serviceAccounts, bc)
			}
		}
		return serviceAccounts, nil
	}

	items, err := s.indexer.ByIndex(cache.NamespaceIndex, s.namespace)
	if err != nil {
		return nil, err
	}
	for _, obj := range items {
		bc := obj.(*kapi.ServiceAccount)
		if selector.Matches(labels.Set(bc.Labels)) {
			serviceAccounts = append(serviceAccounts, bc)
		}
	}
	return serviceAccounts, nil
}


text:
const express = require('express');
const wrap = require("../../../middleware/async-wrapper.js");
const models = require("../../../models");
var router = express.Router();

// Index
router.get("/", wrap(async (req, res) => {
    var publications = await models.Publication.findAsync({});

    return res.render("cms/publications/index", { publications: publications });
}));

// Create
router.get("/new", wrap(async (req, res) => {
    return res.render("cms/publications/new");
}));
router.post("/", wrap(async (req, res) => {
    var publication = req.body.publication;
    var created = await models.Publication.create(publication);

    return res.redirect("/cms/publications");
}));

// Update
router.get("/:id/edit", wrap(async (req, res) => {
    var id = req.params.id;
    var publication = await models.Publication.findByIdAsync(id);

    return res.render("cms/publications/edit", { publication: publication });
}));
router.put("/:id", wrap(async (req, res) => {
    var id = req.params.id;
    var publication = req.body.publication;
    var updated = await models.Publication.findByIdAndUpdateAsync(id, publication);

    return res.redirect("/cms/publications");
}));

// Delete
router.delete("/:id", wrap(async (req, res) => {
    var id = req.params.id;
    var publicationsContainer = await models.Container.findOne({ label: "Main-Publications" });
    var publication = publicationsContainer.objects.find((obj) => { return obj.item == id });

    if (publication) {
        const index = publicationsContainer.objects.indexOf(publication);
        if (index !== -1) {
            publicationsContainer.objects.splice(index, 1);
        }
        await publicationsContainer.save();
    }
    var deleted = await models.Publication.findByIdAndRemoveAsync(id);

    return res.redirect("/cms/publications");
}));

module.exports = router;


text:
/* -------------------------------- Package -------------------------------- */

package com.github.jessemull.microflex.bigdecimalflex.stat;

/* ----------------------------- Dependencies ------------------------------ */

import java.math.BigDecimal;
import java.math.MathContext;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import com.google.common.base.Preconditions;

import com.github.jessemull.microflex.bigdecimalflex.plate.PlateBigDecimal;
import com.github.jessemull.microflex.bigdecimalflex.plate.WellBigDecimal;
import com.github.jessemull.microflex.bigdecimalflex.plate.WellSetBigDecimal;

/**
 * This class performs statistical operations that return a list of BigDecimals as
 * a result for BigDecimal plate stacks, plates, wells and well sets. To create
 * a custom statistical operation extend this class and override the calculate
 * methods using the appropriate statistical operation.
 *
 *

 *
 * Statistical operations can be performed on stacks, plates, sets and wells using
 * standard or aggregated functions. Standard functions calculate the desired
 * statistic for each well in the stack, plate or set. Aggregated functions aggregate
 * the values from all the wells in the stack, plate or set and perform the statistical
 * operation on the aggregated values. Both standard and aggregated functions can
 * be performed on a subset of data within the stack, plate, set or well.
 *
 *

 *
 * The methods within the MicroFlex library are meant to be flexible and the
 * descriptive statistic object supports operations using a single stack, plate,
 * set or well as well as collections and arrays of stacks, plates, sets or wells.
 *
 *

 *
Operation

 *
Beginning
Index

 *
Length of
Subset

 *
Input/Output

 *

 *
 *

 *

 *                Standard
 *

 *

 *
 *
 *

 *

 *                +/-
 *

 *

 *
 *
 *

 *

 *                +/-
 *

 *

 *
 *
 *

 *

 *                Accepts a single well, set, plate or stack as input
 *

 *

 *                Calculates the statistic for each well in a well, set, plate or stack
 *

 *

 *
 *

 *

 *
 *

 *

 *                Aggregated
 *

 *

 *
 *
 *

 *

 *                +/-
 *

 *

 *
 *
 *

 *

 *                +/-
 *

 *

 *
 *
 *

 *

 *                Accepts a single well/set/plate/stack or a collection/array of wells/sets/plates/stacks as input
 *

 *

 *                Aggregates the data from all the wells in a well/set/plate/stack and calculates the statistic using the aggregated data
 *

 *

 *
 *

 *

 *
 * MicroFlex currently supports the following statistical operations:
 *
 *

 *
Descriptive Statistics

 *

 *       Mean
 *

 *

 *       Geometric Mean
 *

 *

 *      Quadratic Mean
 *

 *

 *       Sum
 *

 *

 *       Sum Squared
 *

 *

 *       Skewness
 *

 *

 *       Kurtosis
 *

 *

 *       Maximum
 *

 *

 *       Minimum
 *

 *

 *       N
 *

 *

 *       Percentile
 *

 *

 *       Population Variance
 *

 *

 *       Sample Variance
 *

 *

 *       Standard Deviation
 *

 *

 *
 *

 *

 *
 * @author Jesse L. Mull
 * @update Updated Oct 18, 2016
 * @address http://www.jessemull.com
 * @email hello@jessemull.com
 */
public abstract class DescriptiveStatisticListBigDecimalContext {

    /* ---------------- Well statistics for all plate wells ----------------- */

    /**
     * Returns the statistic for each plate well.
     * @param    PlateBigDecimal    the plate
     * @param    MathContext        the math context
     * @return                      map of wells and results
     */
    public Map<WellBigDecimal, List<BigDecimal>> plate(PlateBigDecimal plate, MathContext mc) {

        Preconditions.checkNotNull(plate, "The plate value cannot be null.");

        Map<WellBigDecimal, List<BigDecimal>> result = new TreeMap<WellBigDecimal, List<BigDecimal>>();

        for (WellBigDecimal well : plate) {
            WellBigDecimal clone = new WellBigDecimal(well);
            result.put(clone, well(well, mc));
        }

        return result;

    }

    /**
     * Returns the statistic for each plate well using the values between the beginning
     * and ending indices.
     * @param    PlateBigDecimal    the plate
     * @param    int                beginning index of subset
     * @param    int                length of subset
     * @param    MathContext        the math context
     * @return                      map of wells and results
     */
    public Map<WellBigDecimal, List<BigDecimal>> plate(PlateBigDecimal plate, int begin, int length, MathContext mc) {

        Preconditions.checkNotNull(plate, "The plate value cannot be null.");

        Map<WellBigDecimal, List<BigDecimal>> result = new TreeMap<WellBigDecimal, List<BigDecimal>>();

        for (WellBigDecimal well : plate) {
            WellBigDecimal clone = new WellBigDecimal(well);
            result.put(clone, well(well, begin, length, mc));
        }

        return result;

    }

    /* --------------------- Aggregated plate statistics -------------------  */

    /**
     * Returns the aggregated statistic for the plate.
     * @param    PlateBigDecimal    the plate
     * @param    MathContext        the math context
     * @return                      the aggregated result
     */
    public List<BigDecimal> platesAggregated(PlateBigDecimal plate, MathContext mc) {

        Preconditions.checkNotNull(plate, "The plate cannot be null.");

        List<BigDecimal> aggregated = new ArrayList<BigDecimal>();

        for (WellBigDecimal well : plate) {
            aggregated.addAll(well.data());
        }

        return calculate(aggregated, mc);

    }

    /**
     * Returns the aggregated statistic for each plate.
     * @param    Collection<PlateBigDecimal>    collection of plates
     * @param    MathContext                    the math context
     * @return                                  map of plates and aggregated results
     */
    public Map<PlateBigDecimal, List<BigDecimal>> platesAggregated(Collection<PlateBigDecimal> collection, MathContext mc) {

        Preconditions.checkNotNull(collection, "The plate collection cannot be null.");

        Map<PlateBigDecimal, List<BigDecimal>> results = new TreeMap<PlateBigDecimal, List<BigDecimal>>();

        for(PlateBigDecimal plate : collection) {

            List<BigDecimal> aggregated = new ArrayList<BigDecimal>();
            PlateBigDecimal clone = new PlateBigDecimal(plate);

            for (WellBigDecimal well : plate) {
                aggregated.addAll(well.data());
            }

            results.put(clone, calculate(aggregated, mc));

        }

        return results;
    }

    /**
     * Returns the aggregated statistic for each plate.
     * @param    PlateBigDecimal[]    array of plates
     * @param    MathContext          the math context
     * @return                        map of plates and aggregated result
     */
    public Map<PlateBigDecimal, List<BigDecimal>> platesAggregated(PlateBigDecimal[] array, MathContext mc) {

        Preconditions.checkNotNull(array, "The plate array cannot be null.");

        Map<PlateBigDecimal, List<BigDecimal>> results = new TreeMap<PlateBigDecimal, List<BigDecimal>>();

        for(PlateBigDecimal plate : array) {

            List<BigDecimal> aggregated = new ArrayList<BigDecimal>();
            PlateBigDecimal clone = new PlateBigDecimal(plate);

            for (WellBigDecimal well : plate) {
                aggregated.addAll(well.data());
            }

            results.put(clone, calculate(aggregated, mc));

        }

        return results;
    }

    /**
     * Returns the aggregated statistic for each plate using the values between the
     * indices.
     * @param    PlateBigDecimal    the plate
     * @param    int                beginning index of subset
     * @param    int                length of subset
     * @param    MathContext        the math context
     * @return                      the aggregated result
     */
    public List<BigDecimal> platesAggregated(
            PlateBigDecimal plate, int begin, int length, MathContext mc) {

        Preconditions.checkNotNull(plate, "The plate cannot be null.");

        List<BigDecimal> aggregated = new ArrayList<BigDecimal>();

        for (WellBigDecimal well : plate) {
            aggregated.addAll(well.data().subList(begin, begin + length));
        }

        return calculate(aggregated, mc);

    }

    /**
     * Returns the aggregated statistic for each plate using the values between
     * the indices.
     * @param    Collection<PlateBigDecimal>    collection of plates
     * @param    int                            beginning index of subset
     * @param    int                            length of subset
     * @param    MathContext                    the math context
     * @return                                  map of plates and aggregated results
     */
    public Map<PlateBigDecimal, List<BigDecimal>> platesAggregated(
            Collection<PlateBigDecimal> collection, int begin, int length, MathContext mc) {

        Preconditions.checkNotNull(collection, "The plate collection cannot be null.");

        Map<PlateBigDecimal, List<BigDecimal>> results = new TreeMap<PlateBigDecimal, List<BigDecimal>>();

        for(PlateBigDecimal plate : collection) {

            List<BigDecimal> aggregated = new ArrayList<BigDecimal>();
            PlateBigDecimal clone = new PlateBigDecimal(plate);

            for (WellBigDecimal well : plate) {
                aggregated.addAll(well.data().subList(begin, begin + length));
            }

            results.put(clone, calculate(aggregated, mc));

        }

        return results;

    }

    /**
     * Returns the aggregated statistic for each plate using the values between
     * the indices.
     * @param    PlateBigDecimal[]    array of plates
     * @param    int                  beginning index of subset
     * @param    int                  length of subset
     * @param    MathContext          the math context
     * @return                        map of plates and aggregated results
     */
    public Map<PlateBigDecimal, List<BigDecimal>> platesAggregated(
            PlateBigDecimal[] array, int begin, int length, MathContext mc) {

        Preconditions.checkNotNull(array, "The plate array cannot be null.");

        Map<PlateBigDecimal, List<BigDecimal>> results = new TreeMap<PlateBigDecimal, List<BigDecimal>>();

        for(PlateBigDecimal plate : array) {

            List<BigDecimal> aggregated = new ArrayList<BigDecimal>();
            PlateBigDecimal clone = new PlateBigDecimal(plate);

            for (WellBigDecimal well : plate) {
                aggregated.addAll(well.data().subList(begin, begin + length));
            }

            results.put(clone, calculate(aggregated, mc));

        }

        return results;

    }

    /* --------------- Well statistics for all wells in a set --------------  */

    /**
     * Returns the statistic of each well in the well set.
     * @param    WellSetBigDecimal    the well set
     * @param    MathContext          the math context
     * @return                        map of wells and results
     */
    public Map<WellBigDecimal, List<BigDecimal>> set(WellSetBigDecimal set, MathContext mc) {

        Preconditions.checkNotNull(set, "The set cannot be null.");

    	Map<WellBigDecimal, List<BigDecimal>> result = new TreeMap<WellBigDecimal, List<BigDecimal>>();

        for (WellBigDecimal well : set) {
            WellBigDecimal clone = new WellBigDecimal(well);
            result.put(clone, well(well, mc));
        }

        return result;

    }

    /**
     * Returns the statistic of each well in the well set using the values between
     * the beginning and ending indices.
     * @param    WellSetBigDecimal    the well set
     * @param    int                  beginning index of subset
     * @param    int                  length of subset
     * @param    MathContext          the math context
     * @return                        map of wells and results
     */
    public Map<WellBigDecimal, List<BigDecimal>> set(WellSetBigDecimal set, int begin, int length, MathContext mc) {

    	Preconditions.checkNotNull(set, "The well set cannot be null.");

    	Map<WellBigDecimal, List<BigDecimal>> result = new TreeMap<WellBigDecimal, List<BigDecimal>>();

        for (WellBigDecimal well : set) {
        	WellBigDecimal clone = new WellBigDecimal(well);
            result.put(clone,  well(well, begin, length, mc));
        }

        return result;

    }

    /* --------------------- Aggregated set statistics ---------------------  */

    /**
     * Returns the aggregated statistic for the well set.
     * @param    WellSetBigDecimal    the well set
     * @param    MathContext          the math context
     * @return                        the aggregated result
     */
    public List<BigDecimal> setsAggregated(WellSetBigDecimal set, MathContext mc) {

        Preconditions.checkNotNull(set, "The well set cannot be null.");

        List<BigDecimal> aggregated = new ArrayList<BigDecimal>();

        for (WellBigDecimal well : set) {
            aggregated.addAll(well.data());
        }

        return calculate(aggregated, mc);

    }

    /**
     * Returns the aggregated statistic for each well set.
     * @param    Collection<WellSetBigDecimal>    collection of well sets
     * @param    MathContext                      the math context
     * @return                                    map of well sets and aggregated results
     */
    public Map<WellSetBigDecimal, List<BigDecimal>> setsAggregated(Collection<WellSetBigDecimal> collection, MathContext mc) {

        Preconditions.checkNotNull(collection, "The well set collection cannot be null.");

        Map<WellSetBigDecimal, List<BigDecimal>> results = new TreeMap<WellSetBigDecimal, List<BigDecimal>>();

        for(WellSetBigDecimal set : collection) {

            List<BigDecimal> aggregated = new ArrayList<BigDecimal>();
            WellSetBigDecimal clone = new WellSetBigDecimal(set);

            for (WellBigDecimal well : set) {
                aggregated.addAll(well.data());
            }

            results.put(clone, calculate(aggregated, mc));

        }

        return results;
    }

    /**
     * Returns the aggregated statistic for each well set.
     * @param    WellSetBigDecimal[]    array of well sets
     * @param    MathContext            the math context
     * @return                          map of well sets and aggregated results
     */
    public Map<WellSetBigDecimal, List<BigDecimal>> setsAggregated(WellSetBigDecimal[] array, MathContext mc) {

        Preconditions.checkNotNull(array, "The well set array cannot be null.");

        Map<WellSetBigDecimal, List<BigDecimal>> results = new TreeMap<WellSetBigDecimal, List<BigDecimal>>();

        for(WellSetBigDecimal set : array) {

            List<BigDecimal> aggregated = new ArrayList<BigDecimal>();
            WellSetBigDecimal clone = new WellSetBigDecimal(set);

            for (WellBigDecimal well : set) {
                aggregated.addAll(well.data());
            }

            results.put(clone, calculate(aggregated, mc));

        }

        return results;
    }

    /**
     * Returns the aggregated statistic for each well set using the values between the
     * indices.
     * @param    WellSetBigDecimal    the well set
     * @param    int                  beginning index of subset
     * @param    int                  length of subset
     * @param    MathContext          the math context
     * @return                        the aggregated result
     */
    public List<BigDecimal> setsAggregated(
            WellSetBigDecimal set, int begin, int length, MathContext mc) {

        Preconditions.checkNotNull(set, "The well set cannot be null.");

        List<BigDecimal> aggregated = new ArrayList<BigDecimal>();

        for (WellBigDecimal well : set) {
            aggregated.addAll(well.data().subList(begin, begin + length));
        }

        return calculate(aggregated, mc);

    }

    /**
     * Returns the aggregated statistic for each well set using the values between
     * the indices.
     * @param    Collection<WellSetBigDecimal>    collection of well sets
     * @param    int                              beginning index of subset
     * @param    int                              length of subset
     * @param    MathContext                      the math context
     * @return                                    map of well sets and aggregated results
     */
    public Map<WellSetBigDecimal, List<BigDecimal>> setsAggregated(
            Collection<WellSetBigDecimal> collection, int begin, int length, MathContext mc) {

        Preconditions.checkNotNull(collection, "The well set collection cannot be null.");

        Map<WellSetBigDecimal, List<BigDecimal>> results = new TreeMap<WellSetBigDecimal, List<BigDecimal>>();

        for(WellSetBigDecimal set : collection) {

            List<BigDecimal> aggregated = new ArrayList<BigDecimal>();
            WellSetBigDecimal clone = new WellSetBigDecimal(set);

            for (WellBigDecimal well : set) {
                aggregated.addAll(well.data().subList(begin, begin + length));
            }

            results.put(clone, calculate(aggregated, mc));

        }

        return results;

    }

    /**
     * Returns the aggregated statistic for each well set using the values between
     * the indices.
     * @param    WellSetBigDecimal[]    array of well sets
     * @param    int                    beginning index of subset
     * @param    int                    length of subset
     * @param    MathContext            the math context
     * @return                          map of well sets and aggregated results
     */
    public Map<WellSetBigDecimal, List<BigDecimal>> setsAggregated(
            WellSetBigDecimal[] array, int begin, int length, MathContext mc) {

        Preconditions.checkNotNull(array, "The well set array cannot be null.");

        Map<WellSetBigDecimal, List<BigDecimal>> results = new TreeMap<WellSetBigDecimal, List<BigDecimal>>();

        for(WellSetBigDecimal set : array) {

            List<BigDecimal> aggregated = new ArrayList<BigDecimal>();
            WellSetBigDecimal clone = new WellSetBigDecimal(set);

            for (WellBigDecimal well : set) {
                aggregated.addAll(well.data().subList(begin, begin + length));
            }

            results.put(clone, calculate(aggregated, mc));

        }

        return results;

    }

    /* -------------------------- Well statistics --------------------------  */

    /**
     * Returns the well statistic.
     * @param    WellBigDecimal    the well
     * @param    MathContext       the math context
     * @return                     the result
     */
    public List<BigDecimal> well(WellBigDecimal well, MathContext mc) {
        Preconditions.checkNotNull(well, "The well cannot be null.");
        return calculate(well.data(), mc);

    }

    /**
     * Returns the well statistic for the values between the beginning and ending
     * indices.
     * @param    WellBigDecimal    the well
     * @param    int               beginning index of subset
     * @param    int               length of the subset
     * @param    MathContext       the math context
     * @return                     the result
     */
    public List<BigDecimal> well(WellBigDecimal well, int begin, int length, MathContext mc) {
        Preconditions.checkNotNull(well, "The well cannot be null.");
        Preconditions.checkArgument(begin <= well.data().size() &&
                                    begin >= 0 &&
                                    begin + length <= well.data().size());

        return calculate(well.data(), begin, length, mc);

    }

    /* -------- Methods for calculating the statistic of a data set --------  */

    /**
     * Calculates the statistic.
     * @param    List<BigDecimal>    the list
     * @param    MathContext         the math context
     * @return                       the result
     */
    public abstract List<BigDecimal> calculate(List<BigDecimal> list, MathContext mc);

    /**
     * Calculates the statistic of the values between the beginning and ending indices.
     * @param    List<BigDecimal>    the list
     * @param    int                 beginning index of subset
     * @param    int                 length of subset
     * @param    MathContext         the math context
     * @return                       the result
     */
    public abstract List<BigDecimal> calculate(List<BigDecimal> list, int begin, int length, MathContext mc);
}