text:
/* ----------------------------------------------------------------------
 * Project:      CMSIS DSP Library
 * Title:        InterpolationFunctions.c
 * Description:  Combination of all interpolation function source files.
 *
 * $Date:        22. July 2020
 * $Revision:    V1.0.0
 *
 * Target Processor: Cortex-M cores
 * -------------------------------------------------------------------- */
/*
 * Copyright (C) 2020 ARM Limited or its affiliates. All rights reserved.
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the License); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "arm_bilinear_interp_f32.c"
#include "arm_bilinear_interp_q15.c"
#include "arm_bilinear_interp_q31.c"
#include "arm_bilinear_interp_q7.c"
#include "arm_linear_interp_f32.c"
#include "arm_linear_interp_q15.c"
#include "arm_linear_interp_q31.c"
#include "arm_linear_interp_q7.c"
#include "arm_spline_interp_f32.c"
#include "arm_spline_interp_init_f32.c"

redpajama_set_name: RedPajamaGithub


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

<title>Transition</title>
<meta name="date" content="2017-02-09">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

racoon.design.funcspec

Class Transition

java.lang.Object

racoon.design.funcspec.PAElement

racoon.design.funcspec.Transition

public class Transition
extends PAElement

A transition from a State to another state. A transition corresponds to a protocol
 step, i.e., the set of Method elements that determine the next protocol state.

 In Racoon there are two types of transition: one-method, and abstract.
 An abstract transition groups many method calls into a single "black box" transition,
 which simplifies the protocol representation by hiding some implementation details.

Author:

Guido Lena Cota <guido.lena@unimi.it>

Constructor Summary

Constructors

Constructor and Description

Transition(java.lang.String id,
          boolean legal,
          State sourceState,
          State targetState,
          Role startingRole,
          Method method)

Constructor of new transitions, invoked either in ProtocolAutomatonParser or SelfishDeviationFactory.

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

void
addValuation(Valuation valuation)

Add a new element to the list of  elements associated with this transition.

SelfishDeviation
getDeviation()

Return the SelfishDeviation that has determined this transition.

Method
getMethod()

Return the Method that may be executed during this transition.

State
getSourceState()

Return the source State of this transition.

Role
getStartingRole()

Return the Role that starts the transition.

State
getTargetState()

Return the target State of this transition.

java.util.List<Valuation>
getValuations()

Return the set of Valuation elements associated with this transition.

java.lang.String
printInfo()

Print information about the element.

void
setDeviation(SelfishDeviation deviation)

Set the SelfishDeviation that has determined this transition.

void
setTargetState(State targetState)

Set the target State of this transition.

Methods inherited from class racoon.design.funcspec.PAElement

getId, isLegal

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Transition

public Transition(java.lang.String id,
                  boolean legal,
                  State sourceState,
                  State targetState,
                  Role startingRole,
                  Method method)

Constructor of new transitions, invoked either in ProtocolAutomatonParser or SelfishDeviationFactory.

Parameters:

id - The identifier of the transition.

legal - True if the transition is linked to a SelfishDeviation; false otherwise.

sourceState - The source State of the transition.

targetState - The target State of the transition.

startingRole - The Role that starts the transition.

method - The Method that may be executed during the transition.

Method Detail

getSourceState

public State getSourceState()

Return the source State of this transition.

getTargetState

public State getTargetState()

Return the target State of this transition.

setTargetState

public void setTargetState(State targetState)

Set the target State of this transition.

getStartingRole

public Role getStartingRole()

Return the Role that starts the transition.

getMethod

public Method getMethod()

Return the Method that may be executed during this transition.

getDeviation

public SelfishDeviation getDeviation()

Return the SelfishDeviation that has determined this transition.

setDeviation

public void setDeviation(SelfishDeviation deviation)

Set the SelfishDeviation that has determined this transition.

getValuations

public java.util.List<Valuation> getValuations()

Return the set of Valuation elements associated with this transition.

addValuation

public void addValuation(Valuation valuation)

Add a new element to the list of  elements associated with this transition.

printInfo

public java.lang.String printInfo()

Print information about the element.

Specified by:

printInfo in class PAElement

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
"use strict";

var lame = require('lame');
var mumble = require('mumble');
var yt = require('youtube-search');
var dl = require('youtube-dl');
var fs = require('fs');

var lastresults = [];

mumble.connect('mumble://wallpiece:9648', function(error, client) {
    if(error) { throw new Error(error); }

    client.authenticate('MusicBot', 'yolo');
    client.on('initialized', function () {
        start(client);
    });
});

var start = function(client) {
    var input = client.inputStream();
    var decoder = new lame.Decoder();

    client.on('textMessage', function (data) {
      var command = data.message.split(' ');

      if (command[0] == '/join') {
        client.channelById(client.userBySession(data.actor).channel.id).join();
      }
      else if (command[0] == '/select'){
        if (command[1] && parseInt(command[1]) != NaN) {
          if (lastresults.length > 0) {
            command[1] = parseInt(command[1]);
            dl.exec(lastresults[command[1]].link, ['-x', '--audio-format', 'mp3', '-o', 'music/%(title)s.%(ext)s'], {}, function(err, output) {
              if (err) throw err;
              play(client, lastresults[command[1]].title);
            });
          }
          else {
            sendMessage(client, 'You didn\'t do a song lookup yet, try /play (<songname>). Or you didn\'t fill in a number.');
          }
        }
        else {
          sendMessage(client, 'You need to specify which song you want to play : (<songnumber>)')
        }
      }
      else if (command[0] == '/play') {

        command[1] = command.splice(1).join(' ').replace(/\<.*\"\>|\<\/.*\>/g, '');

        if (command[1]) {
          if (command[1].substr(0,7) == 'http://' || command[1].substr(0, 8) == 'https://') {
            dl.exec(command[1], ['-x', '--audio-format', 'mp3', '-o', 'music/%(title)s.%(ext)s'], {}, function (err, output) {
              if (err) throw err;
              console.log(output)
              play(client, output[3].split('music/')[1].replace(/\.m4a/g, ''));
            });
          }
          else if (command[1] == 'offline') {
          }
          else {
            command.splice(0,1);
            yt(command.join(' '), {key: fs.readFileSync('apikey').toString()}, function (err, results) {
              lastresults = results;
              if (err) console.warn(err);
              var list = '
What song do you wanna play?
';
              for (var i = 0; i < results.length; i++) {
                list += '[' + i +'] ' + results[i].title + '
';

              }
              list += '
Type what song you want with /select <number of the song>'
              sendMessage(client, list);
            });
          }
        }
        else {
          sendMessage(client, 'You need to specify what you would want to play : (offline/<songname>/<youtubelink>)');
        }
      }

      console.log(data);

    });

    function sendMessage(client, message) {
      client.sendMessage('TextMessage', {'message': message, channelId: [client.user.channel.id]})
    }

    function play(client, song) {
        var stream;
        decoder.on( 'format', function(format) {
            stream.pipe(client.inputStream({
                channels: format.channels,
                sampleRate: format.sampleRate,
                gain: 0.1
            }));
        });

        stream = require('fs').createReadStream(__dirname + '/music/' + song + '.mp3').pipe(decoder);
    }

};


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <title>解决office word 2016 、2013等一直正在启动的问题 | coordinate</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

  <meta name="keywords" content="officeuninstall" />

    <meta name="google-site-verification" content="true" />

    <meta name="baidu-site-verification" content="true" />

    <meta name="360-site-verification" content="true" />

  <meta name="description" content="相信很多人都碰到过这个问题,我当时认为是office损坏问题,卸了重装,结果问题还在。官方给出的解决方法就是重装office,呵呵!!!后来意外发现了这个解决方案。  打开任务管理器,关闭其中的spoolsv.exe进程,你会发现word就可以打开了。">
<meta name="keywords" content="office,uninstall">
<meta property="og:type" content="article">
<meta property="og:title" content="解决office word 2016 、2013等一直正在启动的问题">
<meta property="og:url" content="http://coordinate.wang/2017/11/13/2017-11-13-解决office-word-2016-、2013等一直正在启动的问题/index.html">
<meta property="og:site_name" content="coordinate">
<meta property="og:description" content="相信很多人都碰到过这个问题,我当时认为是office损坏问题,卸了重装,结果问题还在。官方给出的解决方法就是重装office,呵呵!!!后来意外发现了这个解决方案。  打开任务管理器,关闭其中的spoolsv.exe进程,你会发现word就可以打开了。">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://wx4.sinaimg.cn/mw690/af2d2659ly1flg8hddy0ij20n60kkgoa.jpg">
<meta property="og:updated_time" content="2018-02-18T03:29:07.385Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="解决office word 2016 、2013等一直正在启动的问题">
<meta name="twitter:description" content="相信很多人都碰到过这个问题,我当时认为是office损坏问题,卸了重装,结果问题还在。官方给出的解决方法就是重装office,呵呵!!!后来意外发现了这个解决方案。  打开任务管理器,关闭其中的spoolsv.exe进程,你会发现word就可以打开了。">
<meta name="twitter:image" content="http://wx4.sinaimg.cn/mw690/af2d2659ly1flg8hddy0ij20n60kkgoa.jpg">

    <link rel="alternate" href="/atom.xml" title="coordinate" type="application/atom+xml">

  <link rel="icon" href="/css/images/favicon.ico">

    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">

  <link href="https://fonts.googleapis.com/css?family=Open+Sans|Montserrat:700" rel="stylesheet" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic" rel="stylesheet" type="text/css">
  <link href="//cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">

  <link rel="stylesheet" id="athemes-headings-fonts-css" href="//fonts.googleapis.com/css?family=Yanone+Kaffeesatz%3A200%2C300%2C400%2C700&ver=4.6.1" type="text/css" media="all">

  <link rel="stylesheet" id="athemes-headings-fonts-css" href="//fonts.googleapis.com/css?family=Oswald%3A300%2C400%2C700&ver=4.6.1" type="text/css" media="all">
  <link rel="stylesheet" href="/css/style.css">

  <link rel="stylesheet" href="/css/bootstrap.css" >
  <link rel="stylesheet" href="/css/fashion.css" >
  <link rel="stylesheet" href="/css/glyphs.css" >

            Menu
            Close

 首页

 归档

 分类

 标签

 关于

      解决office word 2016 、2013等一直正在启动的问题

	  <time datetime="2017-11-12T16:00:00.000Z" itemprop="datePublished">十一月 13, 2017</time>

    index

	  本文总阅读量次

相信很多人都碰到过这个问题,我当时认为是office损坏问题,卸了重装,结果问题还在。官方给出的解决方法就是重装office,呵呵!!!后来意外发现了这个解决方案。

打开任务管理器,关闭其中的spoolsv.exe进程,你会发现word就可以打开了。

    index

office

uninstall

        为正常使用来必力评论功能请激活JavaScript

      上一篇

          Dell Alienware Aurora R6(1080ti)安装Ubuntu17.04记录

      下一篇

使用QT和opencv3.3进行目标检测(YOLO)

    文章目录

无

	      © 2018 coordinate All Rights Reserved.

              本站访客数人次
              本站总访问量次

  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">


text: export default from './Menu.component';


text:
import React from 'react';
import MenuWrapper from './MenuWrapper';

export default ({ active, tool, toolbar, cursor }) => {
  const { settings } = toolbar[tool];
  return (
    <MenuWrapper active={active}>
      {tool} tool

          {Object.entries(settings)
            .map(([key, val]) => `${key}: ${JSON.stringify(val)}`)
            .join('\n')}

    </MenuWrapper>
  );
};


text:
using System;
using System.IO;

namespace NUnit.Framework.Constraints
{
    [TestFixture]
    public class FloatingPointNumericsTests
    {

        /// Tests the floating point value comparison helper
        [Test]
        public void FloatEqualityWithUlps()
        {
            Assert.IsTrue(
                FloatingPointNumerics.AreAlmostEqualUlps(0.00000001f, 0.0000000100000008f, 1)
            );
            Assert.IsFalse(
                FloatingPointNumerics.AreAlmostEqualUlps(0.00000001f, 0.0000000100000017f, 1)
            );

            Assert.IsTrue(
                FloatingPointNumerics.AreAlmostEqualUlps(1000000.00f, 1000000.06f, 1)
            );
            Assert.IsFalse(
                FloatingPointNumerics.AreAlmostEqualUlps(1000000.00f, 1000000.13f, 1)
            );
            Assert.IsFalse( // Ensure we don't overflow on twos complement values
                FloatingPointNumerics.AreAlmostEqualUlps(2.0f, -2.0f, 1)
            );
        }

        /// Tests the double precision floating point value comparison helper
        [Test]
        public void DoubleEqualityWithUlps()
        {
            Assert.IsTrue(
                FloatingPointNumerics.AreAlmostEqualUlps(0.00000001, 0.000000010000000000000002, 1)
            );
            Assert.IsFalse(
                FloatingPointNumerics.AreAlmostEqualUlps(0.00000001, 0.000000010000000000000004, 1)
            );

            Assert.IsTrue(
                FloatingPointNumerics.AreAlmostEqualUlps(1000000.00, 1000000.0000000001, 1)
            );
            Assert.IsFalse(
                FloatingPointNumerics.AreAlmostEqualUlps(1000000.00, 1000000.0000000002, 1)
            );
            Assert.IsFalse( // Ensure we don't overflow on twos complement values
                FloatingPointNumerics.AreAlmostEqualUlps(2.0, -2.0, 1)
            );
        }
    }
}


text:
/// <summary>Installs client.dll hooks.</summary>
void HookClient();


text:
/*
 * Axamit, gc.support@axamit.com
 */

package com.axamit.gc.api.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * The GCFile class represents file (attachment).
 *
 * @author Axamit, gc.support@axamit.com
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public final class GCFile {

    private String fileId;
    private String filename;
    private String mimeType;
    private String url;
    private String optimisedImageUrl;
    private String downloadUrl;
    private Integer size;
    private String altText;

    @JsonProperty("file_id")
    public String getFileId() {
        return fileId;
    }

    @JsonProperty("file_id")
    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    @JsonProperty("mime_type")
    public String getMimeType() {
        return mimeType;
    }

    @JsonProperty("mime_type")
    public void setMimeType(String mimeType) {
        this.mimeType = mimeType;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @JsonProperty("optimised_image_url")
    public String getOptimisedImageUrl() {
        return optimisedImageUrl;
    }

    @JsonProperty("optimised_image_url")
    public void setOptimisedImageUrl(String optimisedImageUrl) {
        this.optimisedImageUrl = optimisedImageUrl;
    }

    @JsonProperty("download_url")
    public String getDownloadUrl() {
        return downloadUrl;
    }

    @JsonProperty("download_url")
    public void setDownloadUrl(String downloadUrl) {
        this.downloadUrl = downloadUrl;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    @JsonProperty("alt_text")
    public String getAltText() {
        return altText;
    }

    @JsonProperty("alt_text")
    public void setAltText(String altText) {
        this.altText = altText;
    }
}


text:
package org.apache.tapestry5.integration.app1.pages.rest;

import org.apache.tapestry5.EventConstants;
import org.apache.tapestry5.annotations.RestInfo;
import org.apache.tapestry5.integration.app1.base.BaseRestDemoPage;

public class RestRequestNotHandledDemo extends BaseRestDemoPage {

    @RestInfo(consumes = "text/plain")
    Object onHttpPut()
    {
        return createResponse(EventConstants.HTTP_PUT, "no body", "no parameter");
    }

}


text:
module Fog
  module AWS
    class RDS
      class Real
        require 'fog/aws/parsers/rds/delete_event_subscription'

        # deletes an event subscription
        # http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DeleteEventSubscription.html
        # === Parameters
        # * SubscriptionName <~String> - The name of the subscription to delete
        # === Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>

        def delete_event_subscription(name)
          request({
            'Action'           => 'DeleteEventSubscription',
            'SubscriptionName' => name,
            :parser            => Fog::Parsers::AWS::RDS::DeleteEventSubscription.new
          })
        end
      end

      class Mock
        def delete_event_subscription(name)
          response = Excon::Response.new

          if data = self.data[:event_subscriptions][name]
            data['Status'] = 'deleting'
            self.data[:event_subscriptions][name] = data

            response.status = 200
            response.body = {
              "ResponseMetadata"=>{ "RequestId"=> Fog::AWS::Mock.request_id },
            }
            response
          else
            raise Fog::AWS::RDS::NotFound.new("EventSubscriptionNotFound => #{name} not found")
          end
        end
      end
    end
  end
end


text: export * from "./Hooks/useOnboarding"


text:
@interface NSObject (Common)

#pragma mark Tip M
+ (NSString *)tipFromError:(NSError *)error;
+ (BOOL)showError:(NSError *)error;
+ (void)showHudTipStr:(NSString *)tipStr;
+ (void)showAllTextDialog:(NSString *)str xOffset:(CGFloat)xOffset yOffset:(CGFloat)yOffset;
+ (instancetype)showHUDQueryStr:(NSString *)titleStr toView:(UIView *)view;
+ (instancetype)showHUDQueryStr:(NSString *)titleStr;
+ (NSUInteger)hideHUDQuery;
+ (void)showStatusBarQueryStr:(NSString *)tipStr;
+ (void)showStatusBarSuccessStr:(NSString *)tipStr;
+ (void)showStatusBarErrorStr:(NSString *)errorStr;
+ (void)showStatusBarError:(NSError *)error;
//+ (void)showCaptchaViewParams:(NSMutableDictionary *)params;

#pragma mark BaseURL
+ (NSString *)baseURLStr;
+ (BOOL)baseURLStrIsTest;
+ (void)changeBaseURLStrToTest:(BOOL)isTest;

#pragma mark File M
//获取fileName的完整地址
+ (NSString* )pathInCacheDirectory:(NSString *)fileName;
//创建缓存文件夹
+ (BOOL)createDirInCache:(NSString *)dirName;

//图片
+ (BOOL)saveImage:(UIImage *)image imageName:(NSString *)imageName inFolder:(NSString *)folderName;
+ (NSData*)loadImageDataWithName:( NSString *)imageName inFolder:(NSString *)folderName;
+ (BOOL)deleteImageCacheInFolder:(NSString *)folderName;

//网络请求
+ (BOOL)saveResponseData:(NSDictionary *)data toPath:(NSString *)requestPath;//缓存请求回来的json对象
+ (id)loadResponseWithPath:(NSString *)requestPath;//返回一个NSDictionary类型的json数据
+ (BOOL)deleteResponseCacheForPath:(NSString *)requestPath;
+ (BOOL)deleteResponseCache;
+ (NSUInteger)getResponseCacheSize;

#pragma mark NetError
-(id)handleResponse:(id)responseJSON;
-(id)handleResponse:(id)responseJSON autoShowError:(BOOL)autoShowError;

@end


text:
package com.jogl.engine.node;

import com.jogl.engine.SceneManager;
import com.jogl.engine.math.Matrix;
import com.jogl.engine.math.Vector4;

/**
 * @author Dmitry
 */
public class Camera extends Node {

    private Matrix projection;
    private final Matrix pv = new Matrix();

    private final Vector4 cameraTarget = new Vector4(0, 0, 10f);//original values of the camera target and up, just to not re instantiate objects
    private final Vector4 cameraUp = new Vector4(0, 10f, 0, 0);

    private final Vector4 currentCameraTarget = new Vector4(0, 0, 10f);
    private final Vector4 currentCameraUp = new Vector4(0, 10f, 0);

    public Camera(SceneManager sceneManager, Node parent) {
        super(sceneManager, parent);
        if (parent != null) {
            throw new RuntimeException("Camera should not be attached to parent");
        }

        projectionCamera(45.0f, 4.0f / 3.0f, 0.1f, 100.0f);
    }

    public Camera(SceneManager sceneManager) {
        super(sceneManager);
        projectionCamera(45.0f, 4.0f / 3.0f, 0.1f, 1000.0f);
    }

    private void projectionCamera(float fov, float aspect, float near, float far) {
        projection = new Matrix();
        projection.makePerspectiveProjectionMatrix(fov, aspect, near, far);
    }

    public Matrix getPVMatrix() {
        boolean shouldRecalculate = false;
        Matrix cameraModelMatrix = null;
        if (getParent() == null) {
            if (localTransformDirty) {
                cameraModelMatrix = getLocalTransform();
                shouldRecalculate = true;
                localTransformDirty = false;
            }
        } else {
            throw new RuntimeException("Camera should not be attached to parent");
        }

        if (shouldRecalculate) {
            cameraModelMatrix.multVectorOnMatrix(cameraTarget, currentCameraTarget);
            cameraModelMatrix.multVectorOnMatrix(cameraUp, currentCameraUp);
            Matrix camModel = new Matrix();
            Vector4 pos=getLocalPosition();
            camModel.lookAt(pos.getX(), pos.getY(), pos.getZ(), currentCameraTarget.getX(), currentCameraTarget.getY(), currentCameraTarget.getZ(), currentCameraUp.getX(), currentCameraUp.getY(), currentCameraUp.getZ());
            pv.loadIdentity();
            pv.multMatrix(projection);
            pv.multMatrix(camModel);
        }

        return pv;
    }

    /*public void setPositionAndLook(float x, float y, float z, float targetX, float targetY, float targetZ, float upX, float upY, float upZ) {
     localTransform.lookAt(x, y, z, targetX, targetY, targetZ, upX, upY, upZ);
     localTransformDirty = true;
     }*/
}


text:
require 'spec_helper'

describe 'nova' do

  shared_examples 'nova' do

    context 'with default parameters' do

      it 'installs packages' do
        should contain_package('python').with_ensure('present')
        should contain_package('python-greenlet').with(
          :ensure  => 'present',
          :require => 'Package[python]'
        )
        should contain_package('python-nova').with(
          :ensure  => 'present',
          :require => 'Package[python-greenlet]'
        )
        should contain_package('nova-common').with(
          :name    => platform_params[:nova_common_package],
          :ensure  => 'present',
          :tag    => ['openstack', 'nova']
        )
      end

      it 'creates various files and folders' do
        should contain_file('/var/log/nova').with(
          :ensure  => 'directory',
          :mode    => '0750',
          :owner   => 'nova',
          :group   => 'nova',
          :require => 'Package[nova-common]'
        )
        should contain_file('/etc/nova/nova.conf').with(
          :mode    => '0640',
          :owner   => 'nova',
          :group   => 'nova',
          :require => 'Package[nova-common]'
        )
      end

      it 'configures rootwrap' do
        should contain_nova_config('DEFAULT/rootwrap_config').with_value('/etc/nova/rootwrap.conf')
      end

      it { should contain_exec('networking-refresh').with(
        :command     => '/sbin/ifdown -a ; /sbin/ifup -a',
        :refreshonly => true
      )}

      it 'configures image service' do
        should contain_nova_config('DEFAULT/image_service').with_value('nova.image.glance.GlanceImageService')
        should contain_nova_config('glance/api_servers').with_value('localhost:9292')
      end

      it 'configures auth_strategy' do
        should contain_nova_config('DEFAULT/auth_strategy').with_value('keystone')
        should_not contain_nova_config('DEFAULT/use_deprecated_auth').with_value(false)
      end

      it 'configures rabbit' do
        should contain_nova_config('DEFAULT/rpc_backend').with_value('rabbit')
        should contain_nova_config('DEFAULT/rabbit_host').with_value('localhost')
        should contain_nova_config('DEFAULT/rabbit_password').with_value('guest').with_secret(true)
        should contain_nova_config('DEFAULT/rabbit_port').with_value('5672')
        should contain_nova_config('DEFAULT/rabbit_userid').with_value('guest')
        should contain_nova_config('DEFAULT/rabbit_virtual_host').with_value('/')
      end

      it 'configures various things' do
        should contain_nova_config('DEFAULT/verbose').with_value(false)
        should contain_nova_config('DEFAULT/debug').with_value(false)
        should contain_nova_config('DEFAULT/log_dir').with_value('/var/log/nova')
        should contain_nova_config('DEFAULT/state_path').with_value('/var/lib/nova')
        should contain_nova_config('DEFAULT/lock_path').with_value(platform_params[:lock_path])
        should contain_nova_config('DEFAULT/service_down_time').with_value('60')
        should contain_nova_config('DEFAULT/rootwrap_config').with_value('/etc/nova/rootwrap.conf')
        should contain_nova_config('DEFAULT/report_interval').with_value('10')
        should contain_nova_config('DEFAULT/os_region_name').with_ensure('absent')
      end

      it 'installs utilities' do
        should contain_class('nova::utilities')
      end

      it 'disables syslog' do
        should contain_nova_config('DEFAULT/use_syslog').with_value(false)
      end
    end

    context 'with overridden parameters' do

      let :params do
        { :verbose                  => true,
          :debug                    => true,
          :log_dir                  => '/var/log/nova2',
          :image_service            => 'nova.image.local.LocalImageService',
          :rabbit_host              => 'rabbit',
          :rabbit_userid            => 'rabbit_user',
          :rabbit_port              => '5673',
          :rabbit_password          => 'password',
          :rabbit_ha_queues         => 'undef',
          :lock_path                => '/var/locky/path',
          :state_path               => '/var/lib/nova2',
          :service_down_time        => '120',
          :auth_strategy            => 'foo',
          :ensure_package           => '2012.1.1-15.el6',
          :memcached_servers        => ['memcached01:11211', 'memcached02:11211'],
          :install_utilities        => false,
          :notification_driver      => 'ceilometer.compute.nova_notifier',
          :notification_topics      => 'openstack',
          :notify_api_faults        => true,
          :report_interval          => '60',
          :os_region_name           => 'MyRegion' }
      end

      it 'installs packages' do
        should contain_package('nova-common').with('ensure' => '2012.1.1-15.el6')
        should contain_package('python-nova').with('ensure' => '2012.1.1-15.el6')
      end

      it 'configures image service' do
        should contain_nova_config('DEFAULT/image_service').with_value('nova.image.local.LocalImageService')
        should_not contain_nova_config('glance/api_servers')
      end

      it 'configures auth_strategy' do
        should contain_nova_config('DEFAULT/auth_strategy').with_value('foo')
        should_not contain_nova_config('DEFAULT/use_deprecated_auth').with_value(true)
      end

      it 'configures rabbit' do
        should contain_nova_config('DEFAULT/rpc_backend').with_value('rabbit')
        should contain_nova_config('DEFAULT/rabbit_host').with_value('rabbit')
        should contain_nova_config('DEFAULT/rabbit_password').with_value('password').with_secret(true)
        should contain_nova_config('DEFAULT/rabbit_port').with_value('5673')
        should contain_nova_config('DEFAULT/rabbit_userid').with_value('rabbit_user')
        should contain_nova_config('DEFAULT/rabbit_virtual_host').with_value('/')
      end

      it 'configures memcached_servers' do
        should contain_nova_config('DEFAULT/memcached_servers').with_value('memcached01:11211,memcached02:11211')
      end

      it 'configures various things' do
        should contain_nova_config('DEFAULT/verbose').with_value(true)
        should contain_nova_config('DEFAULT/debug').with_value(true)
        should contain_nova_config('DEFAULT/log_dir').with_value('/var/log/nova2')
        should contain_nova_config('DEFAULT/state_path').with_value('/var/lib/nova2')
        should contain_nova_config('DEFAULT/lock_path').with_value('/var/locky/path')
        should contain_nova_config('DEFAULT/service_down_time').with_value('120')
        should contain_nova_config('DEFAULT/notification_driver').with_value('ceilometer.compute.nova_notifier')
        should contain_nova_config('DEFAULT/notification_topics').with_value('openstack')
        should contain_nova_config('DEFAULT/notify_api_faults').with_value(true)
        should contain_nova_config('DEFAULT/report_interval').with_value('60')
        should contain_nova_config('DEFAULT/os_region_name').with_value('MyRegion')
      end

      context 'with multiple notification_driver' do
        before { params.merge!( :notification_driver => ['ceilometer.compute.nova_notifier', 'nova.openstack.common.notifier.rpc_notifier']) }

        it { should contain_nova_config('DEFAULT/notification_driver').with_value(
          'ceilometer.compute.nova_notifier,nova.openstack.common.notifier.rpc_notifier'
        ) }
      end

      it 'does not install utilities' do
        should_not contain_class('nova::utilities')
      end

      context 'with logging directory disabled' do
        before { params.merge!( :log_dir => false) }

        it { should contain_nova_config('DEFAULT/log_dir').with_ensure('absent') }
      end
    end

    context 'with wrong notify_on_state_change parameter' do
      let :params do
        { :notify_on_state_change => 'vm_status' }
      end

      it 'configures database' do
        should contain_nova_config('DEFAULT/notify_on_state_change').with_ensure('absent')
      end
    end

    context 'with notify_on_state_change parameter' do
      let :params do
        { :notify_on_state_change => 'vm_state' }
      end

      it 'configures database' do
        should contain_nova_config('DEFAULT/notify_on_state_change').with_value('vm_state')
      end
    end

    context 'with syslog enabled' do
      let :params do
        { :use_syslog => 'true' }
      end

      it 'configures syslog' do
        should contain_nova_config('DEFAULT/use_syslog').with_value(true)
        should contain_nova_config('DEFAULT/syslog_log_facility').with_value('LOG_USER')
      end
    end

    context 'with syslog enabled and log_facility parameter' do
      let :params do
        { :use_syslog   => 'true',
          :log_facility => 'LOG_LOCAL0' }
      end

      it 'configures syslog' do
        should contain_nova_config('DEFAULT/use_syslog').with_value(true)
        should contain_nova_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0')
      end
    end

    context 'with rabbit_hosts parameter' do
      let :params do
        { :rabbit_hosts => ['rabbit:5673', 'rabbit2:5674'] }
      end

      it 'configures rabbit' do
        should_not contain_nova_config('DEFAULT/rabbit_host')
        should_not contain_nova_config('DEFAULT/rabbit_port')
        should contain_nova_config('DEFAULT/rabbit_hosts').with_value('rabbit:5673,rabbit2:5674')
        should contain_nova_config('DEFAULT/rabbit_ha_queues').with_value(true)
        should contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(false)
        should contain_nova_config('DEFAULT/amqp_durable_queues').with_value(false)
        should contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
        should contain_nova_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
        should contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
        should contain_nova_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
      end
    end

    context 'with rabbit_hosts parameter (one server)' do
      let :params do
        { :rabbit_hosts => ['rabbit:5673'] }
      end

      it 'configures rabbit' do
        should_not contain_nova_config('DEFAULT/rabbit_host')
        should_not contain_nova_config('DEFAULT/rabbit_port')
        should contain_nova_config('DEFAULT/rabbit_hosts').with_value('rabbit:5673')
        should contain_nova_config('DEFAULT/rabbit_ha_queues').with_value(true)
        should contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(false)
        should contain_nova_config('DEFAULT/amqp_durable_queues').with_value(false)
      end
    end

    context 'with rabbit_ha_queues set to true' do
      let :params do
        { :rabbit_ha_queues => 'true' }
      end

      it 'configures rabbit' do
        should contain_nova_config('DEFAULT/rabbit_ha_queues').with_value(true)
      end
    end

    context 'with amqp_durable_queues parameter' do
      let :params do
        { :rabbit_hosts => ['rabbit:5673'],
          :amqp_durable_queues => 'true' }
      end

      it 'configures rabbit' do
        should_not contain_nova_config('DEFAULT/rabbit_host')
        should_not contain_nova_config('DEFAULT/rabbit_port')
        should contain_nova_config('DEFAULT/rabbit_hosts').with_value('rabbit:5673')
        should contain_nova_config('DEFAULT/rabbit_ha_queues').with_value(true)
        should contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(false)
        should contain_nova_config('DEFAULT/amqp_durable_queues').with_value(true)
        should contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
        should contain_nova_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
        should contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
        should contain_nova_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
      end
    end

    context 'with rabbit ssl enabled with kombu' do
      let :params do
        { :rabbit_hosts       => ['rabbit:5673'],
          :rabbit_use_ssl     => 'true',
          :kombu_ssl_ca_certs => '/etc/ca.cert',
          :kombu_ssl_certfile => '/etc/certfile',
          :kombu_ssl_keyfile  => '/etc/key',
          :kombu_ssl_version  => 'TLSv1', }
      end

      it 'configures rabbit' do
        should contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(true)
        should contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_value('/etc/ca.cert')
        should contain_nova_config('DEFAULT/kombu_ssl_certfile').with_value('/etc/certfile')
        should contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_value('/etc/key')
        should contain_nova_config('DEFAULT/kombu_ssl_version').with_value('TLSv1')
      end
    end

    context 'with rabbit ssl enabled without kombu' do
      let :params do
        { :rabbit_hosts       => ['rabbit:5673'],
          :rabbit_use_ssl     => 'true', }
      end

      it 'configures rabbit' do
        should contain_nova_config('DEFAULT/rabbit_use_ssl').with_value(true)
        should contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
        should contain_nova_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
        should contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
        should contain_nova_config('DEFAULT/kombu_ssl_version').with_value('SSLv3')
      end
    end

    context 'with rabbit ssl disabled' do
      let :params do
        {
          :rabbit_password    => 'pass',
          :rabbit_use_ssl     => false,
          :kombu_ssl_version  => 'SSLv3',
        }
      end

      it 'configures rabbit' do
        should contain_nova_config('DEFAULT/rabbit_use_ssl').with_value('false')
        should contain_nova_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
        should contain_nova_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
        should contain_nova_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
        should contain_nova_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
      end
    end

    context 'with qpid rpc_backend' do
      let :params do
        { :rpc_backend => 'qpid' }
      end

      context 'with default parameters' do
        it 'configures qpid' do
          should contain_nova_config('DEFAULT/rpc_backend').with_value('qpid')
          should contain_nova_config('DEFAULT/qpid_hostname').with_value('localhost')
          should contain_nova_config('DEFAULT/qpid_port').with_value('5672')
          should contain_nova_config('DEFAULT/qpid_username').with_value('guest')
          should contain_nova_config('DEFAULT/qpid_password').with_value('guest').with_secret(true)
          should contain_nova_config('DEFAULT/qpid_heartbeat').with_value('60')
          should contain_nova_config('DEFAULT/qpid_protocol').with_value('tcp')
          should contain_nova_config('DEFAULT/qpid_tcp_nodelay').with_value(true)
        end
      end

      context 'with qpid_password parameter (without qpid_sasl_mechanisms)' do
        before do
          params.merge!({ :qpid_password => 'guest' })
        end
        it { should contain_nova_config('DEFAULT/qpid_sasl_mechanisms').with_ensure('absent') }
      end

      context 'with qpid_password parameter (with qpid_sasl_mechanisms)' do
        before do
          params.merge!({
            :qpid_password        => 'guest',
            :qpid_sasl_mechanisms => 'A'
          })
        end
        it { should contain_nova_config('DEFAULT/qpid_sasl_mechanisms').with_value('A') }
      end

      context 'with qpid_password parameter (with array of qpid_sasl_mechanisms)' do
        before do
          params.merge!({
            :qpid_password        => 'guest',
            :qpid_sasl_mechanisms => [ 'DIGEST-MD5', 'GSSAPI', 'PLAIN' ]
          })
        end
        it { should contain_nova_config('DEFAULT/qpid_sasl_mechanisms').with_value('DIGEST-MD5 GSSAPI PLAIN') }
      end
    end

    context 'with qpid rpc_backend with old parameter' do
      let :params do
        { :rpc_backend => 'nova.openstack.common.rpc.impl_qpid' }
      end

      it { should contain_nova_config('DEFAULT/rpc_backend').with_value('nova.openstack.common.rpc.impl_qpid') }
    end

    context 'with rabbitmq rpc_backend with old parameter' do
      let :params do
        { :rpc_backend => 'nova.openstack.common.rpc.impl_kombu' }
      end

      it { should contain_nova_config('DEFAULT/rpc_backend').with_value('nova.openstack.common.rpc.impl_kombu') }
    end

    context 'with ssh public key' do
      let :params do
        {
          :nova_public_key => {'type' => 'ssh-rsa',
                               'key'  => 'keydata'}
        }
      end

      it 'should install ssh public key' do
        should contain_ssh_authorized_key('nova-migration-public-key').with(
          :ensure => 'present',
          :key => 'keydata',
          :type => 'ssh-rsa'
        )
      end
    end

    context 'with ssh public key missing key type' do
      let :params do
        {
          :nova_public_key => {'type' => '',
                               'key'  => 'keydata'}
        }
      end

      it 'should raise an error' do
        expect {
          should contain_ssh_authorized_key('nova-migration-public-key').with(
            :ensure => 'present',
            :key => 'keydata',
            :type => ''
          )
        }.to raise_error Puppet::Error, /You must provide both a key type and key data./
      end
    end

    context 'with ssh public key missing key data' do
      let :params do
        {
          :nova_public_key => {'type' => 'ssh-rsa',
                               'key'  => ''}
        }
      end

      it 'should raise an error' do
        expect {
          should contain_ssh_authorized_key('nova-migration-public-key').with(
            :ensure => 'present',
            :key => 'keydata',
            :type => ''
          )
        }.to raise_error Puppet::Error, /You must provide both a key type and key data./
      end
    end

    context 'with ssh private key' do
      let :params do
        {
          :nova_private_key => {'type' => 'ssh-rsa',
                                'key'  => 'keydata'}
        }
      end

      it 'should install ssh private key' do
        should contain_file('/var/lib/nova/.ssh/id_rsa').with(
          :content => 'keydata'
        )
      end
    end

    context 'with ssh private key missing key type' do
      let :params do
        {
          :nova_private_key => {'type' => '',
                                'key'  => 'keydata'}
        }
      end

      it 'should raise an error' do
        expect {
          should contain_file('/var/lib/nova/.ssh/id_rsa').with(
            :content => 'keydata'
          )
        }.to raise_error Puppet::Error, /You must provide both a key type and key data./
      end
    end

    context 'with ssh private key having incorrect key type' do
      let :params do
        {
          :nova_private_key => {'type' => 'invalid',
                                'key'  => 'keydata'}
        }
      end

      it 'should raise an error' do
        expect {
          should contain_file('/var/lib/nova/.ssh/id_rsa').with(
            :content => 'keydata'
          )
        }.to raise_error Puppet::Error, /Unable to determine name of private key file./
      end
    end

    context 'with ssh private key missing key data' do
      let :params do
        {
          :nova_private_key => {'type' => 'ssh-rsa',
                                'key'  => ''}
        }
      end

      it 'should raise an error' do
        expect {
          should contain_file('/var/lib/nova/.ssh/id_rsa').with(
            :content => 'keydata'
          )
        }.to raise_error Puppet::Error, /You must provide both a key type and key data./
      end
    end

    context 'with SSL socket options set' do
      let :params do
        {
          :use_ssl          => true,
          :enabled_ssl_apis => ['ec2', 'osapi_compute'],
          :cert_file        => '/path/to/cert',
          :ca_file          => '/path/to/ca',
          :key_file         => '/path/to/key',
        }
      end

      it { should contain_nova_config('DEFAULT/enabled_ssl_apis').with_value('ec2,osapi_compute') }
      it { should contain_nova_config('DEFAULT/ssl_ca_file').with_value('/path/to/ca') }
      it { should contain_nova_config('DEFAULT/ssl_cert_file').with_value('/path/to/cert') }
      it { should contain_nova_config('DEFAULT/ssl_key_file').with_value('/path/to/key') }
    end

    context 'with SSL socket options set with wrong parameters' do
      let :params do
        {
          :use_ssl          => true,
          :enabled_ssl_apis => ['ec2'],
          :ca_file          => '/path/to/ca',
          :key_file         => '/path/to/key',
        }
      end

      it_raises 'a Puppet::Error', /The cert_file parameter is required when use_ssl is set to true/
    end

    context 'with SSL socket options set to false' do
      let :params do
        {
          :use_ssl          => false,
          :enabled_ssl_apis => [],
          :cert_file        => false,
          :ca_file          => false,
          :key_file         => false,
        }
      end

      it { should contain_nova_config('DEFAULT/enabled_ssl_apis').with_ensure('absent') }
      it { should contain_nova_config('DEFAULT/ssl_ca_file').with_ensure('absent') }
      it { should contain_nova_config('DEFAULT/ssl_cert_file').with_ensure('absent') }
      it { should contain_nova_config('DEFAULT/ssl_key_file').with_ensure('absent') }
    end

  end

  context 'on Debian platforms' do
    let :facts do
      { :osfamily => 'Debian' }
    end

    let :platform_params do
      { :nova_common_package => 'nova-common',
        :lock_path           => '/var/lock/nova' }
    end

    it_behaves_like 'nova'
  end

  context 'on RedHat platforms' do
    let :facts do
      { :osfamily => 'RedHat' }
    end

    let :platform_params do
      { :nova_common_package => 'openstack-nova-common',
        :lock_path           => '/var/lib/nova/tmp' }
    end

    it_behaves_like 'nova'
  end
end


text:
angular.module('tilesArrangement.arrangementGenerator', ['tilesProvider'])

    .factory('ArrangementGenerator', function (TilesProvider) {

        function newArrangementFor(rows, columns, tileWidth, tileHeight, groutWidth) {
            TilesProvider.reset();
            return new Arrangement(rows, columns, tileWidth, tileHeight, groutWidth);
        }

        function Arrangement(rows, columns, tileWidth, tileHeight, groutWidth) {
            var arrangedTiles = [];
            var leftPositions = positionsFor(rows, columns);

            while (!_.isEmpty(leftPositions)) {
                var position = _.sample(leftPositions);
                arrangedTiles.push({
                    position: position,
                    clockwiseRotations: _.random(1, 4),
                    tile: TilesProvider.nextRandomTile()
                });
                _.remove(leftPositions, position);
            }

            function swapTileAt(sourceRow, sourceColumn) {
                return {
                    withTileAt: function (targetRow, targetColumn) {
                        var sourceArrangedTile = _.find(arrangedTiles, function (arrangedTile) {
                            return arrangedTile.position.row === sourceRow
                                && arrangedTile.position.column === sourceColumn;
                        });
                        var targetArrangedTile = _.find(arrangedTiles, function (arrangedTile) {
                            return arrangedTile.position.row === targetRow
                                && arrangedTile.position.column === targetColumn;
                        });
                        sourceArrangedTile.position.row = targetRow;
                        sourceArrangedTile.position.column = targetColumn;
                        targetArrangedTile.position.row = sourceRow;
                        targetArrangedTile.position.column = sourceColumn;
                        if (sourceRow === targetRow && sourceColumn === targetColumn) {
                            sourceArrangedTile.clockwiseRotations = (sourceArrangedTile.clockwiseRotations + 1) % 4;
                        }
                    }
                }
            }

            return {
                size: new Size(columns * (tileWidth + groutWidth), rows * (tileHeight + groutWidth)),
                groutWidth: groutWidth,
                tileSize: new Size(tileWidth, tileHeight),
                arrangedTiles: arrangedTiles,
                swapTileAt: swapTileAt
            };

        }

        function Size(width, height) {
            return {
                width: width,
                height: height
            }
        }

        function positionsFor(rows, columns) {
            var cells = [];
            _.range(1, rows + 1).forEach(function (row) {
                _.range(1, columns + 1).forEach(function (column) {
                    cells.push({
                        row: row,
                        column: column
                    });
                });
            });
            return cells;
        }

        return {
            newArrangementFor: newArrangementFor
        }

    });


text:
package org.apache.pulsar.admin.cli;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.beust.jcommander.converters.CommaParameterSplitter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.function.Supplier;
import org.apache.pulsar.client.admin.PulsarAdmin;
import org.apache.pulsar.client.admin.PulsarAdminException;
import org.apache.pulsar.common.policies.data.TenantInfoImpl;

@Parameters(commandDescription = "Operations about tenants")
public class CmdTenants extends CmdBase {
    @Parameters(commandDescription = "List the existing tenants")
    private class List extends CliCommand {
        @Override
        void run() throws PulsarAdminException {
            print(getAdmin().tenants().getTenants());
        }
    }

    @Parameters(commandDescription = "Gets the configuration of a tenant")
    private class Get extends CliCommand {
        @Parameter(description = "tenant-name", required = true)
        private java.util.List<String> params;

        @Override
        void run() throws PulsarAdminException {
            String tenant = getOneArgument(params);
            print(getAdmin().tenants().getTenantInfo(tenant));
        }
    }

    @Parameters(commandDescription = "Creates a new tenant")
    private class Create extends CliCommand {
        @Parameter(description = "tenant-name", required = true)
        private java.util.List<String> params;

        @Parameter(names = { "--admin-roles",
                "-r" }, description = "Comma separated list of auth principal allowed to administrate the tenant",
                required = false, splitter = CommaParameterSplitter.class)
        private java.util.List<String> adminRoles;

        @Parameter(names = { "--allowed-clusters",
                "-c" }, description = "Comma separated allowed clusters. "
                + "If empty, the tenant will have access to all clusters",
                required = false, splitter = CommaParameterSplitter.class)
        private java.util.List<String> allowedClusters;

        @Override
        void run() throws PulsarAdminException {
            String tenant = getOneArgument(params);

            if (adminRoles == null) {
                adminRoles = Collections.emptyList();
            }

            if (allowedClusters == null || allowedClusters.isEmpty()) {
                // Default to all available cluster
                allowedClusters = getAdmin().clusters().getClusters();
            }

            TenantInfoImpl tenantInfo = new TenantInfoImpl(new HashSet<>(adminRoles), new HashSet<>(allowedClusters));
            getAdmin().tenants().createTenant(tenant, tenantInfo);
        }
    }

    @Parameters(commandDescription = "Updates the configuration for a tenant")
    private class Update extends CliCommand {
        @Parameter(description = "tenant-name", required = true)
        private java.util.List<String> params;

        @Parameter(names = { "--admin-roles",
                "-r" }, description = "Comma separated list of auth principal allowed to administrate the tenant. "
                + "If empty the current set of roles won't be modified",
                required = false, splitter = CommaParameterSplitter.class)
        private java.util.List<String> adminRoles;

        @Parameter(names = { "--allowed-clusters",
                "-c" }, description = "Comma separated allowed clusters. "
                + "If omitted, the current set of clusters will be preserved",
                required = false, splitter = CommaParameterSplitter.class)
        private java.util.List<String> allowedClusters;

        @Override
        void run() throws PulsarAdminException {
            String tenant = getOneArgument(params);

            if (adminRoles == null) {
                adminRoles = new ArrayList<>(getAdmin().tenants().getTenantInfo(tenant).getAdminRoles());
            }

            if (allowedClusters == null) {
                allowedClusters = new ArrayList<>(getAdmin().tenants().getTenantInfo(tenant).getAllowedClusters());
            }

            TenantInfoImpl tenantInfo = new TenantInfoImpl(new HashSet<>(adminRoles), new HashSet<>(allowedClusters));
            getAdmin().tenants().updateTenant(tenant, tenantInfo);
        }
    }

    @Parameters(commandDescription = "Deletes an existing tenant")
    private class Delete extends CliCommand {
        @Parameter(description = "tenant-name", required = true)
        private java.util.List<String> params;

        @Parameter(names = { "-f",
                "--force" }, description = "Delete a tenant forcefully by deleting all namespaces under it.")
        private boolean force = false;

        @Override
        void run() throws PulsarAdminException {
            String tenant = getOneArgument(params);
            getAdmin().tenants().deleteTenant(tenant, force);
        }
    }

    public CmdTenants(Supplier<PulsarAdmin> admin) {
        super("tenants", admin);
        jcommander.addCommand("list", new List());
        jcommander.addCommand("get", new Get());
        jcommander.addCommand("create", new Create());
        jcommander.addCommand("update", new Update());
        jcommander.addCommand("delete", new Delete());
    }

    @Parameters(hidden = true)
    static class CmdProperties extends CmdTenants {
        public CmdProperties(Supplier<PulsarAdmin> admin) {
            super(admin);
        }

        @Override
        public boolean run(String[] args) {
            System.err.println("WARN: The properties subcommand is deprecated. Please use tenants instead");
            return super.run(args);
        }
    }
}


text:
package com.microsoft.azure.management.policyinsights.v2018_04_04;

import com.microsoft.rest.RestException;
import okhttp3.ResponseBody;
import retrofit2.Response;

/**
 * Exception thrown for an invalid response with QueryFailure information.
 */
public class QueryFailureException extends RestException {
    /**
     * Initializes a new instance of the QueryFailureException class.
     *
     * @param message the exception message or the response content if a message is not available
     * @param response the HTTP response
     */
    public QueryFailureException(final String message, final Response<ResponseBody> response) {
        super(message, response);
    }

    /**
     * Initializes a new instance of the QueryFailureException class.
     *
     * @param message the exception message or the response content if a message is not available
     * @param response the HTTP response
     * @param body the deserialized response body
     */
    public QueryFailureException(final String message, final Response<ResponseBody> response, final QueryFailure body) {
        super(message, response, body);
    }

    @Override
    public QueryFailure body() {
        return (QueryFailure) super.body();
    }
}


text:
FOUNDATION_EXPORT double SWStepSliderVersionNumber;
FOUNDATION_EXPORT const unsigned char SWStepSliderVersionString[];


text:
package nl.sense_os.service.constants;

import java.util.Locale;

/**
 * General utility class.
 *
 * @author Steven Mulder <steven@sense-os.nl>
 */
public class Util {

	private Util() {
		// do not instantiate
	}

	/**
	 * @param bytes
	 *            Byte count;
	 * @param si
	 *            true to use SI system, where 1000 B = 1 kB
	 * @return A String with human-readable byte count, including suffix.
	 */
	public static String humanReadableByteCount(long bytes, boolean si) {
		int unit = si ? 1000 : 1024;
		if (bytes < unit) {
			return bytes + " B";
		}
		int exp = (int) (Math.log(bytes) / Math.log(unit));
		String pre = (si ? "kMGTPE" : "KMGTPE").charAt(exp - 1) + (si ? "" : "i");
        return String.format(Locale.ENGLISH, "%.1f %sB", bytes / Math.pow(unit, exp), pre);
	}
}


text:
* User Management
* Quest Management
* Achievements
* Leaderboards
* Messaging
* Push Notification
* Clan Management
* Item Management
* IAP Management
* Content Management System
* Multiplayer
* Analytics
* Server-side Logic
* Client SDKs

## User Management

### Email

### Facebook

### Anonymous

## Leaderboards
* Regular
* Reverse Ordered
* Geographic Filtering (City and/or Country)

## Achievements
* Regular
* Progress Based

## Push Notifications

### Ad-hoc Notification

### Triggered Notification

### Automatic Device Mapping
Push Notifications are targeted at Users with the Wiretap server retrieving all of the user's registered devices and mapping the notification to the device (and its respective platform).

### Supported Platforms
* iOS
* OSX
* Android
* Windows Phone 8
* Windows 8
* Webhook


text:
"""
This module lets your server send Web Push Notifications to your clients.

(Please, visit https://github.com/sergioburdisso/solidwebpush for more info).

----
"""
from __future__ import print_function
from sqlite3 import connect as db_connect
from multiprocessing import Pool
from py_vapid import Vapid

import os
import re
import json
import time
import base64
import requests
import http_ece
import pyelliptic

__version__ = '1.2.3'
__license__ = 'MIT'

def __doc_from__(docfunc):
    """A @decorator."""
    def __wrapper__(func):
        func.__name__ = docfunc.__name__
        func.__doc__ = docfunc.__doc__
        return func
    return __wrapper__

def __database__(func):
    """A @decorator."""
    @__doc_from__(func)
    def __init_database__(*args, **kwargs):
        s = args[0]

        if not s.__db_conn__:
            s.__db_conn__ = db_connect(s.__db_name__)
            s.__db_conn__.row_factory = lambda cursor, row: \
                dict((
                    (col[0], row[idx])
                    for idx, col
                    in enumerate(cursor.description)
                ))
            s.__db__ = s.__db_conn__.cursor()

            try:
                s.__db__.executescript('''
                    CREATE TABLE subscriptors (
                        session_id VARCHAR(256) NOT NULL PRIMARY KEY,
                        subscription VARCHAR(512) NOT NULL,
                        group_id INT NOT NULL
                    );
                ''')
                s.__db_conn__.commit()
            except:
                pass

            result = func(*args, **kwargs)

            s.__db_conn__.close()
            s.__db_conn__ = None
        else:
            result = func(*args, **kwargs)

        return result

    __init_database__.__name__ = func.__name__
    __init_database__.__doc__ = func.__doc__

    return __init_database__

def __is_valid_json__(jstr):
    try:
        json.loads(jstr)
        return True
    except:
        return False

class SesionIDError(Exception):
    """ exception to be thrown when no proper session_id is used """
    def __init__(self, message):
        Exception.__init__(self, message)

class SubscriptionError(Exception):
    """ exception to be thrown when no proper subscription is used """
    def __init__(self, msg=''):
        Exception.__init__(
            self,
            "subscription must be a valid JSON str, bytes or bytearray."
        )

class Pusher:
    """
    Pusher objects allows you to integrate Web Push Notifications
    into your project.

    Instantiate this class to integrate Web Push Notifications
    into your server. Objects of this class will create your public
    and private key, track your subscriptions, notify your clients,
    and do all the required work for you.

    e.g.

        >>> from solidwebpush import Pusher
        >>>
        >>> pusher = Pusher()
        >>>
        >>> #what's my base64-encoded public key?
        >>> print pusher.getB64PublicKey()
        >>>
        >>> subscription = "{Alice's serviceWorker subscription object}"
        >>>
        >>> #notify Alice
        >>> pusher.sendNotification(subscription, "Hello World!")
        >>>
        >>> #or
        >>> #permanently subscribe Alice
        >>> pusher.newSubscription(alice_session_id, subscription)
        >>>
        >>> #so that, from now on we can notify her by
        >>> pusher.notify(alice_session_id, "Hello World")
        >>>
        >>> #or notify all the permanently subscribed clients
        >>> pusher.notifyAll("Hello World")

    (for more "toy" examples visit
     https://github.com/sergioburdisso/solidwebpush/tree/master/examples)
    """

    __vapid__ = None
    __verbose__ = False

    __db_name__ = None
    __db_conn__ = None
    __db__ = None
    __pool__ = None

    __RE_URL__ = r"(https?://(?:[\w-]+\.)*[\w-]+(?::\d+)?)(?:/.*)?"

    def __init__(self, db_name="subscriptors.db", verbose=False):
        """
        Class constructor.

        :param db_name: The [optional] name ("subscriptors.db" by default) of
                       the file in which subscriptions will be stored in.
                       This is only required if methods like
                       ``newSubscription`` will be used.
        :type db_name: str
        :param verbose: An optional value, to enabled or disabled the "verbose
                        mode" (False by default)
        :type verbose: bool
        """
        self.__verbose__ = verbose
        self.__db_name__ = db_name

        if not os.path.exists('private_key.pem'):
            self.__print__("No private_key.pem file found")
            Vapid().save_key('private_key.pem')
            self.__print__("private_key.pem file created")

        self.__vapid__ = Vapid('private_key.pem')
        if not os.path.exists('public_key.pem'):
            self.__print__("No public_key.pem file found")
            self.__vapid__.save_public_key('public_key.pem')
            self.__print__("public_key.pem file created")

        if verbose:
            self.__print__("PublicKey: %s" % self.getB64PublicKey())

    def __getstate__(self):
        """Class state getter."""
        self_dict = self.__dict__.copy()
        try:
            del self_dict['__pool__']
            del self_dict['__db_conn__']
            del self_dict['__db__']
        except KeyError:
            pass
        return self_dict

    def __call__(self, subscription, data):
        """Class instances callable."""
        self.__send__(subscription, data)

    def __print__(self, msg):
        """Verbose print wrapper."""
        print("[ SolidWebPush ] %s" % msg)

    def __b64rpad__(self, b64str):
        """Base64 right (=)padding."""
        return b64str + b"===="[:len(b64str) % 4]

    def __encrypt__(self, user_publickey, user_auth, payload):
        """Encrypt the given payload."""

        user_publickey = user_publickey.encode("utf8")
        raw_user_publickey = base64.urlsafe_b64decode(
            self.__b64rpad__(user_publickey)
        )

        user_auth = user_auth.encode("utf8")
        raw_user_auth = base64.urlsafe_b64decode(self.__b64rpad__(user_auth))

        salt = os.urandom(16)

        curve = pyelliptic.ECC(curve="prime256v1")
        curve_id = base64.urlsafe_b64encode(curve.get_pubkey()[1:])

        http_ece.keys[curve_id] = curve
        http_ece.labels[curve_id] = "P-256"

        encrypted = http_ece.encrypt(
            payload.encode('utf8'),
            keyid=curve_id,
            dh=raw_user_publickey,
            salt=salt,
            authSecret=raw_user_auth,
            version="aesgcm"
        )

        return {
            'dh': base64.urlsafe_b64encode(
                curve.get_pubkey()
            ).strip(b'=').decode("utf-8"),
            'salt': base64.urlsafe_b64encode(
                salt
            ).strip(b'=').decode("utf-8"),
            'body': encrypted
        }

    def __send__(self, subscription, data):
        """Encrypt and send the data to the Message Server."""
        if __is_valid_json__(subscription):
            subscription = json.loads(subscription)
        else:
            raise SubscriptionError()

        if type(data) == dict:
            data = json.dumps(data)

        base_url = re.search(
            self.__RE_URL__,
            subscription["endpoint"]
        ).group(1)

        encrypted = self.__encrypt__(
            subscription["keys"]["p256dh"],
            subscription["keys"]["auth"],
            data
        )

        jwt_payload = {
            "aud": base_url,
            "exp": str(int(time.time()) + 60 * 60 * 12),
            "sub": "mailto:admin@mail.com"
        }

        headers = self.__vapid__.sign(jwt_payload)
        headers["TTL"] = str(43200)
        headers["Content-Type"] = "application/octet-stream"
        headers['Content-Encoding'] = "aesgcm"
        headers['Encryption'] = "salt=%s" % encrypted["salt"]
        headers["Crypto-Key"] = "dh=%s;p256ecdsa=%s" % (
            encrypted["dh"],
            self.getUrlB64PublicKey()
        )

        r = requests.post(
            subscription["endpoint"],
            data=encrypted["body"],
            headers=headers
        )

        if self.__verbose__:
            self.__print__(
                "Message Server response was: \nStatus: %d\nBody: %s"
                %
                (r.status_code, r.text)
            )

    def setVerbose(self, value):
        """
        Verbose mode.

        Enable and disable the verbose mode (disabled by default).
        When verbose mode is active, some internal messages are going
        to be displayed, as well as the responses from the Message Server.

        :param value: True to enable or False to disable
        :type value: bool
        """
        self.__verbose__ = value

    def getPublicKey(self):
        """
        Raw public key getter.

        :returns: the raw public key
        :rtype: str
        """
        return b"\x04" + self.__vapid__.public_key.to_string()

    def getPrivateKey(self):
        """
        Raw private key getter.

        (probably you won't care about private key at all)

        :returns: the raw private key
        :rtype: str
        """
        return self.__vapid__.private_key.to_string()

    def getB64PublicKey(self):
        """
        Base64 public key getter.

        Returns the string you're going to use when subscribing your
        serviceWorker.
        (as long as you're planning to decode it using JavaScript's
        ``atob`` function)

        :returns: Base64-encoded version of the public key
        :rtype: str
        """
        return base64.b64encode(self.getPublicKey()).decode("utf-8")

    def getB64PrivateKey(self):
        """
        Base64 private key getter.

        (probably you won't care about private key at all)

        :returns: Base64-encoded version of the private key
        :rtype: str
        """
        return base64.b64encode(self.getPrivateKey()).decode("utf-8")

    def getUrlB64PublicKey(self):
        """
        Url-Safe Base64 public key getter.

        This is the string you're going to use when subscribing your
        serviceWorker.
        (so long as you're planning to decode it using a function like
        ``urlB64ToUint8Array`` from
        https://developers.google.com/web/fundamentals/getting-started/codelabs/push-notifications/)

        :returns: URLSafe-Base64-encoded version of the public key
        :rtype: str
        """
        return base64.urlsafe_b64encode(
            self.getPublicKey()
        ).strip(b"=").decode("utf-8")

    def getUrlB64PrivateKey(self):
        """
        Url-Safe Base64 private key getter.

        (probably you won't care about private key at all)

        :returns: URLSafe-Base64-encoded version of the private key
        :rtype: str
        """
        return base64.urlsafe_b64encode(
            self.getPrivateKey()
        ).strip(b"=").decode("utf-8")

    def sendNotification(self, subscription, data, nonblocking=False):
        """
        Send the data to the Message Server.

        Pushes a notification carrying ``data`` to
        the client associated with the ``subscription`` object.
        If ``nonblocking`` is True, the program won't block waiting
        for the message to be completely sent. The ``wait()`` method
        should be used instead. (see ``wait()`` for more details)

        :param subscription: the client's subscription JSON object
        :type subscription: str
        :param data: A string or a dict object to be sent.
                     The dict will be automatically converted into a JSON
                     string before being sent.
                     An example of a dict object would be:
                     ``{"title": "hey Bob!", "body": "you rock"}``
        :type data: str or dict
        :param nonblocking: Whether to block the caller until this method
                            finishes running or not.
        :type nonblocking: bool
        """
        self.sendNotificationToAll(
            [subscription],
            data,
            nonblocking=nonblocking,
            processes=1
        )

    def sendNotificationToAll(
            self, subscriptions, data, nonblocking=False, processes=None):
        """
        Send the data to the Message Server.

        Pushes a notification carrying ``data`` to
        each of the clients associated with the list of ``subscriptions``.
        If ``nonblocking`` is True, the program won't block waiting
        for all the messages to be completely sent. The ``wait()`` method
        should be used instead. (see ``wait()`` for more details)

        :param subscriptions: The list of client's subscription JSON object
        :type subscriptions: list
        :param data: A string or a dict object to be sent.
                     The dict will be automatically converted into a JSON
                     string before being sent.
                     An example of a dict object would be:
                     ``{"title": "hey Bob!", "body": "you rock"}``
        :type data: str or dict
        :param processes: The [optional] number of worker processes to use.
                          If processes is not given then the number returned by
                          os.cpu_count() is used.
        :type processes: int
        :param nonblocking: Whether to block the caller until this method
                            finishes running or not.
        :type nonblocking: bool
        """
        if not self.__pool__:
            self.__pool__ = Pool(processes)

        if nonblocking:
            pool_apply = self.__pool__.apply_async
        else:
            pool_apply = self.__pool__.apply

        for subscription in subscriptions:
            pool_apply(self, args=(subscription, data))

        if not nonblocking:
            self.__pool__.close()
            self.__pool__.join()
            self.__pool__ = None

    def wait(self):
        """
        Wait for all the messages to be completely sent.

        Block the program and wait for all the notifications to be sent,
        before continuing.
        This only works if there exist a previous call to a method
        with the ``nonblocking`` parameter set to ``True``,
        as shown in the following example:

        >>> pusher.sendNotificationToAll(
            listOfsubscriptions,
            "Hello World",
            nonblocking=True
        )
        >>> # Maybe some other useful computation here
        >>> pusher.wait()
        """
        self.__pool__.close()
        self.__pool__.join()
        self.__pool__ = None

    @__database__
    def newSubscription(self, session_id, subscription, group_id=0):
        """
        newSubscription(session_id, subscription, group_id=0)
        Permanently subscribe a client.

        Subscribes the client by permanently storing its ``subscription`` and
        group id (``group_id``).
        This will allow you to push notifications using the
        client id (``session_id``) instead of its ``subscription`` object.

        Groups help you organize subscribers. For instance, suppose you
        want to notify Bob by sending a notification to all of his devices.
        If you previously subscribed each one of his devices to the same group
        let's say 13, then calling notifyAll with 13 will push notifications to
        all of them:

            >>> BobsGroup = 13
            >>> ...
            >>> pusher.newSubscription(
                    BobsTabletSessionId,
                    subscription0,
                    BobsGroup
                )
            >>> ...
            >>> pusher.newSubscription(
                    BobsLaptopSessionId,
                    subscription1,
                    BobsGroup
                )
            >>> ...
            >>> pusher.newSubscription(
                    BobsMobileSessionId,
                    subscription2,
                    BobsGroup
                )
            >>> ...
            >>> pusher.notifyAll(BobsGroup)

        :param session_id: The client's identification
                          (e.g. a cookie or other session token)
        :type session_id: str
        :param subscription: The client's subscription JSON object
        :type subscription: str
        :param group_id: an optional Group ID value (0 by default)
        :type group_id: int
        """
        if not __is_valid_json__(subscription):
            raise SubscriptionError()
        if not session_id and session_id != 0:
            raise SesionIDError("session_id cannot be empty")

        if not self.getSubscription(session_id):
            old_session_id = self.getIdSession(subscription)
            if old_session_id:
                self.removeSubscription(old_session_id)
            self.__db__.execute(
                "INSERT INTO subscriptors (session_id, subscription, group_id)"
                " VALUES (?,?,?)",
                (session_id, subscription, group_id)
            )
        else:
            self.__db__.execute(
                "UPDATE subscriptors SET subscription=?, group_id=? WHERE"
                " session_id=?",
                (subscription, group_id, session_id,)
            )
        self.__db_conn__.commit()

    @__database__
    def removeSubscription(self, session_id):
        """
        removeSubscription(session_id)
        Permanently unsubscribes a client.

        Unsubscribes the client by permanently removing its ``subscription``
        and group id.

        :param session_id: The client's identification (e.g. a cookie or other
                          session token)
        :type session_id: str
        """
        self.__db__.execute(
            "DELETE FROM subscriptors WHERE session_id = ?",
            (session_id,)
        )
        self.__db_conn__.commit()

    @__database__
    def notify(self, session_id, data, nonblocking=False):
        """
        notify(session_id, data, nonblocking=False)
        Notify a given client.

        Pushes a notification carrying ``data`` to the client associated with
        the ``session_id``.
        ``session_id`` is the value passed to the ``newSubscription`` method
        when storing the client's subscription object.

        :param session_id: The client's identification (e.g. a cookie or other
                          session token)
        :type session_id: str
        :param data: A string or a dict object to be sent.
                     The dict will be automatically converted into a JSON
                     string before being sent.
                     An example of a dict object would be:
                     ``{"title": "hey Bob!", "body": "you rock"}``
        :type data: str or dict
        :param nonblocking: Whether to block the caller until this method
                            finishes running or not.
        :type nonblocking: bool
        """
        if self.getSubscription(session_id):
            self.sendNotification(
                self.getSubscription(session_id),
                data,
                nonblocking=nonblocking
            )
        else:
            raise SesionIDError(
                "the given session_id '%s' does not exist "
                "(it has not been subscribed yet)." % session_id
            )

    @__database__
    def notifyAll(self, data, group_id=None, exceptions=[], nonblocking=False):
        """
        notifyAll(data, group_id=None, exceptions=[], nonblocking=False)
        Notify a group of clients.

        When no ``group_id`` is given, notify all subscribers (except for those
        in ``exceptions``). Otherwise, it only notifies all members of the
        ``group_id`` group (except for those in ``exceptions``).

        :param data: A string or a dict object to be sent.
                     The dict will be automatically converted into a JSON
                     string before being sent.
                     An example of a dict object would be:
                     ``{"title": "hey Bob!", "body": "you rock"}``
        :type data: str or dict
        :param group_id: an optional Group ID value (0 by default)
        :type group_id: int
        :param exceptions: The list of sessions ids to be excluded.
        :type exceptions: list
        :param nonblocking: Whether to block the caller until this method
                            finishes running or not.
        :type nonblocking: bool
        """
        if group_id is not None:
            condition = " WHERE group_id=" + group_id
        else:
            condition = ""

        self.sendNotificationToAll(
            [
                row["subscription"]
                for row in self.__db__.execute(
                    "SELECT * FROM subscriptors" + condition
                ).fetchall()
                if row["session_id"] not in exceptions
            ],
            data,
            nonblocking=nonblocking
        )

    @__database__
    def getIdSession(self, subscription):
        """
        getIdSession(subscription)
        Given a subscription object returns the session id associated with it.

        :param subscription: The client's subscription JSON object
        :type subscription: str
        :returns: the session id associated with subscription
        :rtype: str
        """
        res = self.__db__.execute(
            "SELECT session_id FROM subscriptors WHERE subscription=?",
            (subscription,)
        ).fetchone()
        return list(res.values())[0] if res else None

    @__database__
    def getSubscription(self, session_id):
        """
        getSubscription(session_id)
        Given a session id returns the subscription object associated with it.

        :param session_id: A session id
        :type session_id: str
        :returns: The client's subscription JSON object associated with
                  the session id.
        :rtype: str
        """
        res = self.__db__.execute(
            "SELECT subscription FROM subscriptors WHERE session_id=?",
            (session_id,)
        ).fetchone()
        return list(res.values())[0] if res else None

    @__database__
    def getGroupId(self, session_id):
        """
        getGroupId(session_id)
        Given a session id returns the group id it belongs to.

        :param session_id: A session id
        :type session_id: str
        :returns: a group id value
        :rtype: int
        """
        res = self.__db__.execute(
            "SELECT group_id FROM subscriptors WHERE session_id=?",
            (session_id,)
        ).fetchone()
        return list(res.values())[0] if res else None


text:
// 10 january 2013
package main

import (
	"net/http"
	"net/url"
	"io"
	"strings"
	"mime/multipart"
	"bytes"
//"os";"fmt"
)

// TODO better error handling

var apiaddr string

const queryMIME = "application/x-www-form-urlencoded"

// [22:46] <kevlar> see the implementation of PostForm for how you need to encode and set the POST body.
// which just posts the encoded queries with MIME type queryMIME
func buildQueryBody(action string, format string, query ...string) io.Reader {
	if len(query) % 2 == 1 {
		panic("odd number of arguments passed to buildQueryBody")
	}
	v := url.Values{}
	v.Set("format", format)			// TODO Add instead of Set for all of these?
	v.Set("action", action)
	for i := 0; i < len(query); i += 2 {
		v.Set(query[i], query[i + 1])
	}
	return strings.NewReader(v.Encode())
}

func buildMultipartBody(action string, format string, filecontents []byte, query ...string) (MIMEtype string, r io.Reader) {
	if len(query) % 2 == 1 {
		panic("odd number of arguments passed to buildQueryBody")
	}
	b := new(bytes.Buffer)
	v := multipart.NewWriter(b)
	err := v.WriteField("format", format)
	if err != nil {
		panic(err)
	}
	err = v.WriteField("action", action)
	if err != nil {
		panic(err)
	}
	filename := ""
	for i := 0; i < len(query); i += 2 {
		err = v.WriteField(query[i], query[i + 1])
		if err != nil {
			panic(err)
		}
		if query[i] == "filename" {
			filename = query[i + 1]
		}
	}
	if filename == "" {
		panic("filename not provided")
	}
	fw, err := v.CreateFormFile("file", filename)
	if err != nil {
		panic(err)
	}
	n, err := fw.Write(filecontents)
	if err != nil {
		panic(err)
	} else if n < len(filecontents) {
		panic("short writte shoving in file but no error returned")
	}
	v.Close()
	return v.FormDataContentType(), b
}

func dopost(MIMEtype string, r io.Reader) *http.Response {
	req, err := http.NewRequest("POST", apiaddr, r)
	if err != nil {
		panic(err)
	}
	if loginCookie != nil {
		req.AddCookie(loginCookie)
	}
	req.Header.Set("Content-Type", MIMEtype)
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	return resp
}

// TODO abstract MIMEtype away from here

func post(action string, format string, MIMEtype string, query ...string) *http.Response {
	return dopost(MIMEtype, buildQueryBody(action, format, query...))
}

func post_multipart(action string, format string, filecontents []byte, query...string) *http.Response {
	return dopost(buildMultipartBody(action, format, filecontents, query...))
}

/*
func main() {
	resp := post("login", nil,
		"lgname", "Andlabs",
		"lgpassword", "fake password")
	fmt.Printf("%+v\n", resp)
	io.Copy(os.Stdout, resp.Body)
	fmt.Println()
	cookies := resp.Cookies()
	if len(cookies) != 1 {
		panic("too many cookies")
	}
	resp = post("login", cookies[0],
		"lgname", "Andlabs",
		"lgpassword", "fake password")
	fmt.Printf("%+v\n", resp)
	io.Copy(os.Stdout, resp.Body)
	fmt.Println()
}
*/


text:
(function ($) {

    // Using it without an object
    $.sticky = function (note, options, callback) { return $.fn.sticky(note, options, callback); };

    $.fn.sticky = function (note, options, callback) {
        var position = 'top-right'; // top-left, top-right, bottom-left, or bottom-right

        // Default settings
        var settings = {
            'speed'      : 'fast', // animations: fast, slow, or integer
            'duplicates' : true, // true or false
            'autoclose'  : 5000, // integer or false
            'stickyClass': 'default' // default, info, success, warning, error
        };

        // Passing in the object instead of specifying a note
        if (!note) { note = this.html(); }

        if (options) { $.extend(settings, options); }

        // Variables
        var display = true;
        var duplicate = 'no';
        var stickyClass = settings.stickyClass;

        // Somewhat of a unique ID
        var uniqID = Math.floor(Math.random() * 99999);

        // Handling duplicate notes and IDs
        $('.sticky-note').each(function () {
            if ($(this).html() == note && $(this).is(':visible')) {
                duplicate = 'yes';
                if (!settings.duplicates) { display = false; }
            }
            if ($(this).attr('id') == uniqID) { uniqID = Math.floor(Math.random() * 9999999); }
        });

        var body = $('body');
        // Make sure the sticky queue exists
        if (!body.find('.sticky-queue').html()) { body.append('

'); }

        // Can it be displayed?
        if (display) {
            // Building and inserting sticky note
            $('.sticky-queue').prepend('

');
            var sticky = $('#' + uniqID);
            sticky.append('');
            sticky.append('
' + note + '
');

            // Smoother animation
            //var height = $('#' + uniqID).height();
            //sticky.css('height', height);

            sticky.slideDown(settings.speed);
            display = true;
        }

        // Listeners
        $('.sticky').ready(function () {
            // If 'autoclose' is enabled, set a timer to close the sticky
            if (settings.autoclose) { $('#' + uniqID).delay(settings.autoclose).fadeOut(settings.speed); }
        });
        // Closing a sticky
        $('.sticky-close').click(function () { $('#' + $(this).attr('rel')).dequeue().fadeOut(settings.speed); });

        // Callback data
        var response = {
            'id'       : uniqID,
            'duplicate': duplicate,
            'displayed': display,
            'position' : position
        };

        // Callback function?
        if (callback) { callback(response); }
        else { return(response); }

    };
})(jQuery);


text:
package org.apache.commons.jxpath;

/**
 * Bean Info factory contract
 */
public interface JXPathBeanInfoFactory {
	JXPathBeanInfo createBeanInfo( final Class clazz);
}


text:
class WeeklySummaryMailerPreview < ActionMailer::Preview

end


text:
"use strict";

const Constants = require("../../../Constants");
const Events = Constants.Events;

module.exports = function handler(data, gw) {
  if (!gw.isPrimary) return true;

  const channel = this.DirectMessageChannels.get(data.channel_id);
  const user = this.Users.get(data.user && data.user.id);
  if (!channel || !user) return true;

  this.Dispatcher.emit(Events.CHANNEL_RECIPIENT_REMOVE, {
    socket: gw,
    channel: channel,
    user: user
  });
  return true;
};


text:
using System;

namespace Carbonfrost.Commons.PropertyTrees {

    sealed class AddAttribute : Attribute {}

}


text:
<?php

namespace Omnipay\UnionPay;

/**
 * Class LegacyMobileGateway
 * @package Omnipay\UnionPay
 */
class LegacyMobileGateway extends AbstractLegacyGateway
{

    /**
     * Get gateway display name
     *
     * This can be used by carts to get the display name for each gateway.
     */
    public function getName()
    {
        return 'UnionPay_LegacyMobile';
    }

    public function purchase(array $parameters = array ())
    {
        return $this->createRequest('\Omnipay\UnionPay\Message\LegacyMobilePurchaseRequest', $parameters);
    }

    public function completePurchase(array $parameters = array ())
    {
        return $this->createRequest('\Omnipay\UnionPay\Message\LegacyCompletePurchaseRequest', $parameters);
    }
}


text:
(function(des) {
    'use strict';

    des.util.arraySum = function(arrayOne, arrayTwo) {
        var arraySum = [];
        var arrayLength = Math.min(arrayOne.length, arrayTwo.length);
        for (var i = 0; i < arrayLength; i++) {
            arraySum[i] = arrayOne[i] + arrayTwo[i];
        }
        return arraySum;
    };
})(des);


text:
JINX is a client to the CURSE SSH certificate signing server, which provides one-time use SSH certificates.

This software is currently in an alpha state and not recommended for use.

Requirements
------------
* OpenSSH 5.6+
* CentOS 7
* Ubuntu 12.04+

Because SSH certificates are a relatively recent feature in OpenSSH, older versions of CentOS unfortunately do not support their use.


text:
exports.config = {
    sauceUser: process.env.SAUCE_USERNAME,
    sauceKey: process.env.SAUCE_ACCESS_KEY,
    multiCapabilities: [{
        'platform': 'LINUX',
        'browserName': 'chrome',
        'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
        'name': 'meetup [Chrome]',
        'build': process.env.TRAVIS_BUILD_NUMBER
    }],
    framework: 'jasmine',
    specs: ['test/app/e2e/spec.js']
};


text:
package org.valkyriercp.command.config;

import org.springframework.core.style.ToStringCreator;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.valkyriercp.core.ButtonConfigurer;
import org.valkyriercp.core.support.LabelInfo;

import javax.swing.*;

/**
 * An immutable parameter object consisting of the text, mnemonic character, mnemonic character
 * index and keystroke accelerator that may be associated with a labeled command button.
 *
 *

 * This class also acts as a factory for creating instances of itself based on a string descriptor.
 * The syntax used for this descriptor is described in the javadoc for the {@link #valueOf(String)}
 * method.
 *
 *
 * @author Keith Donald
 * @author Kevin Stembridge
 *
 * @see LabelInfo
 * @see javax.swing.KeyStroke
 */
public final class CommandButtonLabelInfo implements ButtonConfigurer {

    /** A default instance to be used for command buttons with no label information. */
    public static final CommandButtonLabelInfo BLANK_BUTTON_LABEL = new CommandButtonLabelInfo("");

    private final LabelInfo labelInfo;

    private final KeyStroke accelerator;

    /**
     * Return an instance of this class, created by parsing the information in the given label
     * descriptor string. The expected format of this descriptor is the same as that used by
     * the {@link LabelInfo} class, with the following additions:
     *
     *

     *
The @ symbol is an escapable character.

     *
Everything after the first unescaped @ symbol will be treated as the textual representation
     * of the keystroke accelerator.

     *

     *
     * The expected format of the keystroke accelerator string is as described in the javadocs for the
     * {@link KeyStroke#getKeyStroke(String)} method.
     *
     *
     * @param labelDescriptor The label descriptor. May be null or empty, in which case, a default
     * blank label info will be returned.
     * @return A CommandButtonLabelInfo instance, never null.
     *
     * @throws IllegalArgumentException if {@code labelDescriptor} contains invalid syntax.
     *
     * @see LabelInfo
     * @see KeyStroke
     */
    public static CommandButtonLabelInfo valueOf(String labelDescriptor) {

        if (!StringUtils.hasText(labelDescriptor)) {
            return BLANK_BUTTON_LABEL;
        }

        StringBuffer labelInfoBuffer = new StringBuffer();
        char currentChar;
        KeyStroke keyStroke = null;

        for (int i = 0, textCharsIndex = 0; i < labelDescriptor.length(); i++, textCharsIndex++) {
            currentChar = labelDescriptor.charAt(i);

            if (currentChar == '\\') {
                int nextCharIndex = i + 1;
                //if this backslash is escaping an @ symbol, we remove the backslash and
                //continue with the next char
                if (nextCharIndex < labelDescriptor.length()) {
                    char nextChar = labelDescriptor.charAt(nextCharIndex);

                    if (nextChar == '@') {
                        labelInfoBuffer.append(nextChar);
                        i++;
                    } else {
                        labelInfoBuffer.append(currentChar);
                        labelInfoBuffer.append(nextChar);
                        i++;
                    }

                }

            }
            else if (currentChar == '@') {
                //we've found the accelerator indicator

                if (i + 1 == labelDescriptor.length()) {
                    throw new IllegalArgumentException(
                            "The label descriptor ["
                            + labelDescriptor
                            + "] does not specify a valid accelerator after the last "
                            + "non-espaced @ symbol.");
                }

                String acceleratorStr = labelDescriptor.substring(i + 1);
                keyStroke = KeyStroke.getKeyStroke(acceleratorStr);

                if (keyStroke == null) {
                    throw new IllegalArgumentException(
                            "The keystroke accelerator string ["
                            + acceleratorStr
                            + "] from the label descriptor ["
                            + labelDescriptor
                            + "] is not a valid keystroke format.");
                }

                break;

            }
            else {
                labelInfoBuffer.append(currentChar);
            }

        }

        LabelInfo info = LabelInfo.valueOf(labelInfoBuffer.toString());

        return new CommandButtonLabelInfo(info, keyStroke);

    }

    /**
     * Creates a new {@code CommandButtonLabelInfo} that will display the given text on its label.
     * There will be no associated mnemonic character and no keystroke accelerator.
     *
     * @param text The label text to be displayed. Must not be null.
     *
     * @throws IllegalArgumentException if {@code text} is null.
     */
    public CommandButtonLabelInfo(String text) {
        this(new LabelInfo(text), null);
    }

    /**
     * Creates a new {@code CommandButtonLabelInfo} with the given label information and keystroke
     * accelerator.
     *
     * @param labelInfo The label information. Must not be null.
     * @param accelerator The keystroke accelerator. May be null.
     *
     * @throws IllegalArgumentException if {@code labelInfo} is null.
     */
    public CommandButtonLabelInfo(LabelInfo labelInfo, KeyStroke accelerator) {
        Assert.notNull(labelInfo, "labelInfo");
        this.labelInfo = labelInfo;
        this.accelerator = accelerator;
    }

    /**
     * Returns the displayable text.
     *
     * @return The label text. Maybe an empty string but never null.
     */
    public String getText() {
        return this.labelInfo.getText();
    }

    /**
     * Returns the mnemonic for the label.
     *
     * @return The mnemonic for the label.
     */
    public int getMnemonic() {
        return this.labelInfo.getMnemonic();
    }

    /**
     * Returns the zero-based index for the mnemonic character within the label text.
     *
     * @return The mnemonic index or -1 to indicate that there is no associated mnemonic character.
     */
    public int getMnemonicIndex() {
        return this.labelInfo.getMnemonicIndex();
    }

    /**
     * Returns the keystroke accelerator for the label.
     *
     * @return The keystroke accelerator, or null.
     */
    public KeyStroke getAccelerator() {
        return this.accelerator;
    }

    /**
     * {@inheritDoc}
     */
    public int hashCode() {
        return this.labelInfo.hashCode() + (this.accelerator != null ? this.accelerator.hashCode() : 0);
    }

    /**
     * {@inheritDoc}
     */
    public boolean equals(Object obj) {

        if (obj == this) {
            return true;
        }

        if (!(obj instanceof CommandButtonLabelInfo)) {
            return false;
        }

        CommandButtonLabelInfo other = (CommandButtonLabelInfo)obj;

        if (!this.labelInfo.equals(other.labelInfo)) {
            return false;
        }

        if (!ObjectUtils.nullSafeEquals(this.accelerator, other.accelerator)) {
            return false;
        }

        return true;

    }

    /**
     * Configures an existing button appropriately based on this label info's
     * properties.
     *
     * @param button
     */
    public AbstractButton configure(AbstractButton button) {
        Assert.notNull(button);
        button.setText(this.labelInfo.getText());
        button.setMnemonic(this.labelInfo.getMnemonic());
        button.setDisplayedMnemonicIndex(this.labelInfo.getMnemonicIndex());
        configureAccelerator(button, getAccelerator());
        return button;
    }

    /**
     * Sets the given keystroke accelerator on the given button.
     *
     * @param button The button. May be null.
     * @param keystrokeAccelerator The accelerator. May be null.
     */
    protected void configureAccelerator(AbstractButton button, KeyStroke keystrokeAccelerator) {
        if ((button instanceof JMenuItem) && !(button instanceof JMenu)) {
            ((JMenuItem)button).setAccelerator(keystrokeAccelerator);
        }
    }

    /**
     * {@inheritDoc}
     */
    public String toString() {
        return new ToStringCreator(this)
                .append("labelInfo", this.labelInfo)
                .append("accelerator", this.accelerator)
                .toString();
    }

}


text:
```bash
composer require socialiteproviders/zalo
```

## Installation & Basic Usage

Please see the [Base Installation Guide](https://socialiteproviders.com/usage/), then follow the provider specific instructions below.

### Add configuration to `config/services.php`

```php
'zalo' => [
  'client_id' => env('ZALO_CLIENT_ID'),
  'client_secret' => env('ZALO_CLIENT_SECRET'),
  'redirect' => env('ZALO_REDIRECT_URI')
],
```

### Add provider event listener

Configure the package's listener to listen for `SocialiteWasCalled` events.

Add the event to your `listen[]` array in `app/Providers/EventServiceProvider`. See the [Base Installation Guide](https://socialiteproviders.com/usage/) for detailed instructions.

```php
protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \SocialiteProviders\Zalo\ZaloExtendSocialite::class.'@handle',
    ],
];
```

### Usage

You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):

```php
return Socialite::driver('zalo')->redirect();
```