text:
@rem Licensed to the Apache Software Foundation (ASF) under one
@rem or more contributor license agreements.  See the NOTICE file
@rem distributed with this work for additional information
@rem regarding copyright ownership.  The ASF licenses this file
@rem to you under the Apache License, Version 2.0 (the
@rem "License"); you may not use this file except in compliance
@rem with the License.  You may obtain a copy of the License at
@rem
@rem   http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing,
@rem software distributed under the License is distributed on an
@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@rem KIND, either express or implied.  See the License for the
@rem specific language governing permissions and limitations
@rem under the License.

@echo on

set CMAKE_BUILD_TYPE=release
set MESON_BUILD_TYPE=release

set INSTALL_DIR=%HOMEDRIVE%%HOMEPATH%\install
set PATH=%INSTALL_DIR%\bin;%PATH%
set PKG_CONFIG_PATH=%INSTALL_DIR%\lib\pkgconfig

for /f "usebackq" %%v in (`python3 -c "import sys; print('.'.join(map(str, sys.version_info[0:2])))"`) do (
  set PYTHON_VERSION=%%v
)

set CPP_BUILD_DIR=cpp\build
mkdir %CPP_BUILD_DIR%
pushd %CPP_BUILD_DIR%

cmake ^
    -G "MSYS Makefiles" ^
    -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ^
    -DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
    -DARROW_VERBOSE_THIRDPARTY_BUILD=OFF ^
    -DARROW_PACKAGE_PREFIX=%MINGW_PREFIX% ^
    -DARROW_JEMALLOC=OFF ^
    -DARROW_USE_GLOG=OFF ^
    -DARROW_PYTHON=ON ^
    -DPythonInterp_FIND_VERSION=ON ^
    -DPythonInterp_FIND_VERSION_MAJOR=3 ^
    -DARROW_BUILD_TESTS=ON ^
    .. || exit /B
make -j4 || exit /B
setlocal
set PYTHONHOME=%MINGW_PREFIX%\lib\python%PYTHON_VERSION%
set PYTHONPATH=%PYTHONHOME%
set PYTHONPATH=%PYTHONPATH%;%MINGW_PREFIX%\lib\python%PYTHON_VERSION%\lib-dynload
set PYTHONPATH=%PYTHONPATH%;%MINGW_PREFIX%\lib\python%PYTHON_VERSION%\site-packages
@rem TODO(ARROW-4784): Run all tests
ctest ^
  --exclude-regex "arrow-array-test|arrow-thread-pool-test" ^
  --output-on-failure ^
  --parallel 2 || exit /B
endlocal
make install || exit /B
popd

set C_GLIB_BUILD_DIR=c_glib\build
meson ^
    setup ^
    --prefix=%INSTALL_DIR% ^
    --buildtype=%MESON_BUILD_TYPE% ^
    %C_GLIB_BUILD_DIR% ^
    c_glib || exit /B
sed -i'' -s 's/\r//g' %C_GLIB_BUILD_DIR%/arrow-glib/version.h || exit /B
ninja -C %C_GLIB_BUILD_DIR% || exit /B
ninja -C %C_GLIB_BUILD_DIR% install || exit /B


text:
megsja
======

An shopping cart application intend to be Minimal, Extensible written using Grails using scalability of Java for better agility

redpajama_set_name: RedPajamaGithub


text:
package com.oregonscientific.meep.store;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

import android.content.Context;
import android.os.Environment;
import android.util.Log;

public class HttpDownloader {
	private Thread mHttpThread = null;
	private boolean mIsDownloading = false;
	private String mStorePath = null;
	private	boolean mIsStoreToInternal = false;
	private String mUrl = null;
	private String name = "";
	Context mContext = null;
	private OnDownloadListener mOnDownloadListener = null;

	public interface OnDownloadListener
	{
		public abstract void onDownloadCompleted(boolean downloadAborted);
		public void onDownloadProgress(String name, int downloadedBytes, int contentLength);
	}

	public HttpDownloader(Context context)
	{
		mContext = context;
		mHttpThread = new Thread(mHttpDownloadRunnable);
	}

	public String getUrl() {
		return mUrl;
	}

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

	public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void startDownload()
	{
		mHttpThread.start();
	}

	public OnDownloadListener getOnDownloadListener() {
		return mOnDownloadListener;
	}

	public void setOnDownloadListener(OnDownloadListener onDownloadListener) {
		this.mOnDownloadListener = onDownloadListener;
	}

	public String getStorePath() {
		return mStorePath;
	}

	public void setStorePath(String storePath) {
		this.mStorePath = storePath;
	}

	public boolean isStoreToInternal() {
		return mIsStoreToInternal;
	}

	public void setIsStoreToInternal(boolean isStoreToInternal) {
		this.mIsStoreToInternal = isStoreToInternal;
	}

	private Runnable mHttpDownloadRunnable = new Runnable() {

		@Override
		public void run() {
			Log.d("httpdownload", "start http download");
			try {
	            HttpClient httpClient = new DefaultHttpClient();
	            HttpGet httpGet = new HttpGet(mUrl);
				HttpResponse response = httpClient.execute(httpGet);
				InputStream is = response.getEntity().getContent();
				int contentLength = Integer.parseInt(response.getHeaders("Content-Length")[0].getValue());
				Log.v("httpdownload", "File size: " + contentLength);
				File root = Environment.getExternalStorageDirectory();

				String localFilePath = root.getPath() + "/temp";
				if(mStorePath!=null)
				{
					localFilePath = mStorePath;//root.getPath() + "/tempApk.apk";
				}
				FileOutputStream fos = null;
				if (isStoreToInternal()) {

					String fileName = mUrl.substring(mUrl.lastIndexOf('/')+1);
					Log.d("httpdownload", "save file : file name = " + fileName);
					try
					{
					fos = mContext.openFileOutput(fileName,  Context.MODE_PRIVATE);
					}catch (Exception e) {
						Log.d("httpdownload", "save file error:" + e.toString());
					}
					Log.d("httpdownload", "save file 1");
				} else {
					Log.d("httpdownload", "save file 2");
					fos = new FileOutputStream(localFilePath, false);
					Log.d("httpdownload", "save file 3");
				}
				//FileOutputStream fos = mContext.openFileOutput("tempApk.apk", Context.MODE_PRIVATE);
				OutputStream os = new BufferedOutputStream(fos);

				byte[] buffer = new byte[1024];
				 int byteRead = 0;
				 int totalByte = 0;
				 long lastNotify = System.currentTimeMillis();
				 while ((byteRead = is.read(buffer)) != -1) {
					 os.write(buffer, 0, byteRead);
					 totalByte += byteRead;
					 Log.d("httpdownload", "byte read:" + totalByte);
					 if (getOnDownloadListener() != null && contentLength > 0 && (System.currentTimeMillis() - lastNotify) >= 1000) {
					     // we send download progress at most in 1000ms interval
				         getOnDownloadListener().onDownloadProgress(name, totalByte, contentLength);
				         lastNotify = System.currentTimeMillis();
					 }
				 }
				 os.flush();
				 fos.flush();

				 os.close();
				 fos.close();

				 is.close();
				if (getOnDownloadListener() != null) {
					getOnDownloadListener().onDownloadCompleted(false);
				}
            } catch (Exception e) {
                Log.d("httpdownload", "http download:" + e.toString());
                e.printStackTrace();
                if (getOnDownloadListener() != null) {
                    getOnDownloadListener().onDownloadCompleted(true);
                }
            }
		}
	};
}


text:
A demo of the Karma Test Adapter
================

See: [Karma Test Adapter](https://github.com/MortenHoustonLudvigsen/KarmaTestAdapter)

See also a [demo video](http://youtu.be/T9wqxOX3OX0)


text:
PROCEED="yes"
REINSTALL=0
grep rxvt_unicode-9.21 /list-$CHRISTENED"-"$SURNAME > /dev/null && ((\!$?)) &&\
    REINSTALL=1 && echo "Previous installation detected, proceed?" && read PROCEED
[ $PROCEED = "yes" ] || [ $PROCEED = "y" ] || exit 0
# Download:
wget http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-9.21.tar.bz2
# md5sum:
echo "a9a06c608258c5fd247c3725d8f44582 rxvt-unicode-9.21.tar.bz2" | md5sum -c ;\
    ( exit ${PIPESTATUS[0]} )
#
tar -xvf rxvt-unicode-9.21.tar.bz2
cd rxvt-unicode-9.21
./configure --prefix=/usr --enable-everything
make
#
as_root make install
cd ..
as_root rm -rf rxvt-unicode-9.21
#
# Add to installed list for this computer:
echo "rxvt_unicode-9.21" >> /list-$CHRISTENED"-"$SURNAME
#
(($REINSTALL)) && exit 0 || (exit 0)
###################################################
#
# Configuration
#
as_root tee -a /etc/X11/app-defaults/URxvt << "EOF"
URxvt*perl-ext: matcher
URxvt*urlLauncher: firefox
URxvt.background: black
URxvt.foreground: yellow
URxvt*font: xft:Monospace:pixelsize=12
EOF
#
as_root tee /usr/share/applications/urxvt.desktop << "EOF"
[Desktop Entry]
Encoding=UTF-8
Name=Rxvt-Unicode Terminal
Comment=Use the command line
GenericName=Terminal
Exec=urxvt
Terminal=false
Type=Application
Icon=utilities-terminal
Categories=GTK;Utility;TerminalEmulator;
EOF
#
grep rxvt_unicode-9.21 /list-$CHRISTENED"-"$SURNAME > /dev/null &&
as_root tee -a /usr/share/applications/urxvt.desktop << "EOF"
#StartupNotify=true
EOF
as_root tee -a /usr/share/applications/urxvt.desktop << "EOF"
Keywords=console;command line;execute;
EOF
update-desktop-database -q
#
###################################################


text:
import { Wargear } from "./wargear";

export const MaxHeavyWeapons: number = 1;

export class KillTeamFighterWargear {

    private _wargear: Wargear;

    public get wargear(): Wargear {
        return this._wargear;
    }
}


text:
import { Component, View, OnInit, DynamicComponentLoader, Injector, provide, Renderer, ElementRef, ComponentRef } from 'angular2/core';
import {FORM_DIRECTIVES, NgForm} from 'angular2/common';
import {ObservableWrapper, Promise, PromiseWrapper} from 'angular2/src/facade/async';
import { Http } from 'angular2/http';

import {SHARED_COMPONENTS} from './../../shared/shared_modules.ts';
let template = require('./form_loader.html');

@Component({
	selector: 'form-loader',
	inputs: ['loader', 'data', 'control']
})
@View({
	template: template,
	directives: [SHARED_COMPONENTS, FORM_DIRECTIVES]
})
export class FormLoader implements OnInit {
	form: NgForm;
	loader: string;
	data: any;

	constructor(
		private _dComponentLoader: DynamicComponentLoader,
		private _renderer: Renderer,
		private _el: ElementRef,
		public http: Http

	) { }

	ngOnInit() {
		let comp = _.find(SHARED_COMPONENTS, (e) => {
			return e.name === this.loader;
		})

		if (!comp) {
			return
		}

		return this._dComponentLoader.loadIntoLocation(comp, this._el, 'child')
			.then((comp: any) => {
				comp.instance.data = this.data;
				comp.instance.init();
			});

	}

}


text:
Ext.define('Cetera.window.LockingWindowController', {
    extend: 'Ext.app.ViewController',
    alias: 'controller.lockingwindowcontroller',

    onLoginClick: function(btn) {
        var f = btn.up('form').getForm();

        Config.setLocale(f.getValues().locale);
        if (f.isValid()) {
            f.submit({
                url: '/cms/include/action_login.php',
                scope: this,
                waitMsg: _('Подождите...'),
                success: function(form, action) {
                    btn.up('window').close();
                    Ext.Loader.loadScript({
                        url: '/cms/include/config.php',
                        scope: this,
                        onLoad: function() {
                            Cetera.getApplication().launchBackOffice();
                        }
                    });
                }
            });
        }
    },

    onResetClick:  function(btn) {
        var f = btn.up('form').getForm();

        if (f.isValid()) {
            f.submit({
                url: '/cms/include/action_login.php',
                scope: this,
                waitMsg: _('Подождите...'),
                success: function(form, action) {
                    if (action.result.message) {
                        Ext.Msg.alert(_('Результат'), action.result.message);
                        f.setValues({
                            recover: ''
                        });
                    }
                }
            });
        }
    },

    onLoginButton: function(btn) {
        btn.up('window').close();
        Ext.create('Cetera.window.Login');
    },

    onResetButton:  function(btn) {
       btn.up('window').close();
       Ext.create('Cetera.window.PasswordReset');
    }
});


text:
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/lambda/LambdaErrors.h>

using namespace Aws::Client;
using namespace Aws::Lambda;
using namespace Aws::Utils;

namespace Aws
{
namespace Lambda
{
namespace LambdaErrorMapper
{

static const int INVALID_ZIP_FILE_HASH = HashingUtils::HashString("InvalidZipFileException");
static const int SERVICE_HASH = HashingUtils::HashString("ServiceException");
static const int TOO_MANY_REQUESTS_HASH = HashingUtils::HashString("TooManyRequestsException");
static const int INVALID_SECURITY_GROUP_I_D_HASH = HashingUtils::HashString("InvalidSecurityGroupIDException");
static const int RESOURCE_CONFLICT_HASH = HashingUtils::HashString("ResourceConflictException");
static const int INVALID_REQUEST_CONTENT_HASH = HashingUtils::HashString("InvalidRequestContentException");
static const int SUBNET_I_P_ADDRESS_LIMIT_REACHED_HASH = HashingUtils::HashString("SubnetIPAddressLimitReachedException");
static const int REQUEST_TOO_LARGE_HASH = HashingUtils::HashString("RequestTooLargeException");
static const int E_N_I_LIMIT_REACHED_HASH = HashingUtils::HashString("ENILimitReachedException");
static const int E_C2_UNEXPECTED_HASH = HashingUtils::HashString("EC2UnexpectedException");
static const int INVALID_SUBNET_I_D_HASH = HashingUtils::HashString("InvalidSubnetIDException");
static const int CODE_STORAGE_EXCEEDED_HASH = HashingUtils::HashString("CodeStorageExceededException");
static const int UNSUPPORTED_MEDIA_TYPE_HASH = HashingUtils::HashString("UnsupportedMediaTypeException");
static const int E_C2_ACCESS_DENIED_HASH = HashingUtils::HashString("EC2AccessDeniedException");
static const int E_C2_THROTTLED_HASH = HashingUtils::HashString("EC2ThrottledException");
static const int POLICY_LENGTH_EXCEEDED_HASH = HashingUtils::HashString("PolicyLengthExceededException");

AWSError<CoreErrors> GetErrorForName(const char* errorName)
{
  int hashCode = HashingUtils::HashString(errorName);

  if (hashCode == INVALID_ZIP_FILE_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::INVALID_ZIP_FILE), false);
  }
  else if (hashCode == SERVICE_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::SERVICE), false);
  }
  else if (hashCode == TOO_MANY_REQUESTS_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::TOO_MANY_REQUESTS), false);
  }
  else if (hashCode == INVALID_SECURITY_GROUP_I_D_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::INVALID_SECURITY_GROUP_I_D), false);
  }
  else if (hashCode == RESOURCE_CONFLICT_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::RESOURCE_CONFLICT), false);
  }
  else if (hashCode == INVALID_REQUEST_CONTENT_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::INVALID_REQUEST_CONTENT), false);
  }
  else if (hashCode == SUBNET_I_P_ADDRESS_LIMIT_REACHED_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::SUBNET_I_P_ADDRESS_LIMIT_REACHED), false);
  }
  else if (hashCode == REQUEST_TOO_LARGE_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::REQUEST_TOO_LARGE), false);
  }
  else if (hashCode == E_N_I_LIMIT_REACHED_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::E_N_I_LIMIT_REACHED), false);
  }
  else if (hashCode == E_C2_UNEXPECTED_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::E_C2_UNEXPECTED), false);
  }
  else if (hashCode == INVALID_SUBNET_I_D_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::INVALID_SUBNET_I_D), false);
  }
  else if (hashCode == CODE_STORAGE_EXCEEDED_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::CODE_STORAGE_EXCEEDED), false);
  }
  else if (hashCode == UNSUPPORTED_MEDIA_TYPE_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::UNSUPPORTED_MEDIA_TYPE), false);
  }
  else if (hashCode == E_C2_ACCESS_DENIED_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::E_C2_ACCESS_DENIED), false);
  }
  else if (hashCode == E_C2_THROTTLED_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::E_C2_THROTTLED), false);
  }
  else if (hashCode == POLICY_LENGTH_EXCEEDED_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(LambdaErrors::POLICY_LENGTH_EXCEEDED), false);
  }
  return AWSError<CoreErrors>(CoreErrors::UNKNOWN, false);
}

} // namespace LambdaErrorMapper
} // namespace Lambda
} // namespace Aws


text:
package io.fabric8.vertx.internal;

import io.fabric8.vertx.FabricVertexFactory;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import org.vertx.java.core.AsyncResult;
import org.vertx.java.core.Handler;
import org.vertx.java.core.Vertx;
import org.vertx.java.core.VertxFactory;
import org.vertx.java.core.impl.DefaultVertxFactory;

@Component(immediate = true)
@Service(FabricVertexFactory.class)
public class FabricVertxFactoryImpl extends VertxFactory implements FabricVertexFactory {

    private final DefaultVertxFactory defaultVertxFactory = new DefaultVertxFactory();

    @Override
    public Vertx createVertx() {
        return defaultVertxFactory.createVertx();
    }

    @Override
    public Vertx createVertx(String hostname) {
        return defaultVertxFactory.createVertx(hostname);
    }

    @Override
    public Vertx createVertx(int port, String hostname) {
        return defaultVertxFactory.createVertx(port, hostname);
    }

    @Override
    public void createVertx(int port, String hostname, Handler<AsyncResult<Vertx>> resultHandler) {
        defaultVertxFactory.createVertx(port, hostname, resultHandler);
    }
}


text:
namespace org {
  namespace apache {
    namespace lucene {
      namespace util {
        class Accountable;
        class Bits;
      }
      namespace search {
        class DocIdSetIterator;
      }
    }
  }
}
namespace java {
  namespace lang {
    class Class;
  }
  namespace io {
    class IOException;
  }
}
template<class T> class JArray;

namespace org {
  namespace apache {
    namespace lucene {
      namespace search {

        class DocIdSet : public ::java::lang::Object {
        public:
          enum {
            mid_init$_54c6a166,
            mid_bits_03c2457d,
            mid_isCacheable_54c6a16a,
            mid_iterator_dc23660c,
            mid_ramBytesUsed_54c6a17a,
            max_mid
          };

          static ::java::lang::Class *class$;
          static jmethodID *mids$;
          static bool live$;
          static jclass initializeClass(bool);

          explicit DocIdSet(jobject obj) : ::java::lang::Object(obj) {
            if (obj != NULL)
              env->getClass(initializeClass);
          }
          DocIdSet(const DocIdSet& obj) : ::java::lang::Object(obj) {}

          static DocIdSet *EMPTY;

          DocIdSet();

          ::org::apache::lucene::util::Bits bits() const;
          jboolean isCacheable() const;
          ::org::apache::lucene::search::DocIdSetIterator iterator() const;
          jlong ramBytesUsed() const;
        };
      }
    }
  }
}

#include <Python.h>

namespace org {
  namespace apache {
    namespace lucene {
      namespace search {
        extern PyTypeObject PY_TYPE(DocIdSet);

        class t_DocIdSet {
        public:
          PyObject_HEAD
          DocIdSet object;
          static PyObject *wrap_Object(const DocIdSet&);
          static PyObject *wrap_jobject(const jobject&);
          static void install(PyObject *module);
          static void initialize(PyObject *module);
        };
      }
    }
  }
}

#endif


text:
class FortuneServer : public QTcpServer
{
    Q_OBJECT

public:
    FortuneServer(QObject *parent = 0);

protected:
    void incomingConnection(int socketDescriptor);

private:
    QStringList fortunes;
};

#endif


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Threading.Tasks;
using Thinktecture.IdentityServer.Core.Connect;
using Thinktecture.IdentityServer.Core.Connect.Models;
using UnitTests.Plumbing;

namespace UnitTests.Validation_Tests.Client_Validation
{
    [TestClass]
    public class Client_Validation
    {
        ClientValidator _validator = Factory.CreateClientValidator();

        const string Category = "Client validation";

        [TestMethod]
        [TestCategory(Category)]
        public async Task Valid_Client_Credentials()
        {
            var credential = new ClientCredential
            {
                ClientId = "codeclient",
                Secret = "secret"
            };

            var client = await _validator.ValidateClientCredentialsAsync(credential);

            Assert.IsNotNull(client);
            Assert.AreEqual("codeclient", client.ClientId);
        }

        [TestMethod]
        [TestCategory(Category)]
        public async Task Invalid_Client_Credentials()
        {
            var credential = new ClientCredential
            {
                ClientId = "codeclient",
                Secret = "invalid"
            };

            var client = await _validator.ValidateClientCredentialsAsync(credential);

            Assert.IsNull(client);
        }

        [TestMethod]
        [TestCategory(Category)]
        public async Task Unkown_Client()
        {
            var credential = new ClientCredential
            {
                ClientId = "unknown",
                Secret = "invalid"
            };

            var client = await _validator.ValidateClientCredentialsAsync(credential);

            Assert.IsNull(client);
        }

        [TestMethod]
        [TestCategory(Category)]
        public async Task Disabled_Client()
        {
            var credential = new ClientCredential
            {
                ClientId = "disabled",
                Secret = "invalid"
            };

            var client = await _validator.ValidateClientCredentialsAsync(credential);

            Assert.IsNull(client);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        [TestCategory(Category)]
        public async Task Null_Client_Credentials()
        {
            var credential = new ClientCredential();

            var client = await _validator.ValidateClientCredentialsAsync(credential);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        [TestCategory(Category)]
        public async Task Null_ClientId()
        {
            var credential = new ClientCredential();

            var client = await _validator.ValidateClientCredentialsAsync(credential);
        }

        [TestMethod]
        [TestCategory(Category)]
        public async Task Empty_Client_Credentials()
        {
            var credential = new ClientCredential
            {
                ClientId = "",
                Secret = ""
            };

            var client = await _validator.ValidateClientCredentialsAsync(credential);

            Assert.IsNull(client);
        }
    }
}


text:
package example.distributed.optimizers.batching;

import com.codahale.metrics.Meter;
import com.codahale.metrics.Snapshot;
import com.github.rollingmetrics.dropwizard.Dropwizard;
import com.github.rollingmetrics.histogram.OverflowResolver;
import com.github.rollingmetrics.histogram.hdr.RollingHdrHistogram;
import com.hazelcast.map.IMap;
import io.github.bucket4j.Bandwidth;
import io.github.bucket4j.Bucket;
import io.github.bucket4j.BucketConfiguration;
import io.github.bucket4j.distributed.AsyncBucketProxy;
import io.github.bucket4j.distributed.proxy.ClientSideConfig;
import io.github.bucket4j.distributed.proxy.optimization.Optimizations;
import io.github.bucket4j.grid.hazelcast.HazelcastProxyManager;
import org.gridkit.nanocloud.Cloud;
import org.gridkit.nanocloud.CloudFactory;
import org.gridkit.nanocloud.VX;
import org.gridkit.vicluster.ViNode;
import org.junit.AfterClass;
import org.junit.BeforeClass;

import com.hazelcast.config.Config;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Serializable;
import java.time.Duration;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;

public class HazelcastWithBatchingPerformanceExample {

    private static Logger logger = LoggerFactory.getLogger(HazelcastWithBatchingPerformanceExample.class);

    private static IMap<String, byte[]> map;
    private static Cloud cloud;
    private static ViNode server;

    private static HazelcastInstance hazelcastInstance;

    @BeforeClass
    public static void setup() {
        // start separated JVM on current host
        cloud = CloudFactory.createCloud();
        cloud.node("**").x(VX.TYPE).setLocal();
        server = cloud.node("stateful-hazelcast-server");

        server.exec((Runnable & Serializable) () -> {
            Config config = new Config();
            config.setLiteMember(false);
            HazelcastProxyManager.addCustomSerializers(config.getSerializationConfig(), 100);
            HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(config);
            hazelcastInstance.getMap("my_buckets");
        });

        // start hazelcast client which works inside current JVM and does not hold data
        Config config = new Config();
        HazelcastProxyManager.addCustomSerializers(config.getSerializationConfig(), 100);
        config.setLiteMember(true);
        hazelcastInstance = Hazelcast.newHazelcastInstance(config);
        map = hazelcastInstance.getMap("my_buckets");
    }

    @AfterClass
    public static void shutdown() {
        if (hazelcastInstance != null) {
            hazelcastInstance.shutdown();
        }
        if (cloud != null) {
            cloud.shutdown();
        }
    }

    @Test
    public void benchmarkSyncBucket() throws InterruptedException {
        Meter consumptionRate = new Meter();
        com.codahale.metrics.Timer latencyTimer = buildLatencyTimer();

        HazelcastProxyManager<String> proxyManager = new HazelcastProxyManager<>(map, ClientSideConfig.getDefault());
        BucketConfiguration configuration = BucketConfiguration.builder()
                .addLimit(
                    Bandwidth.simple(10, Duration.ofSeconds(1)).withInitialTokens(0))
                .build();

        Bucket bucket = proxyManager.builder()
                .withOptimization(Optimizations.batching())
                .build("13", configuration);

        Timer statLogTimer = new Timer();
        statLogTimer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("Consumption rate " + consumptionRate.getOneMinuteRate() + " tokens/sec");
                System.out.println("Operations with bucket rate " + latencyTimer.getOneMinuteRate() + " ops/sec");
                Snapshot snapshot = latencyTimer.getSnapshot();
                System.out.println("Operations with bucket latency:" +
                        " mean=" + TimeUnit.NANOSECONDS.toMicros((long) snapshot.getMean()) + "micros" +
                        " median=" + TimeUnit.NANOSECONDS.toMicros((long)snapshot.getMedian()) + "micros" +
                        " max=" + TimeUnit.NANOSECONDS.toMillis(snapshot.getMax()) + "millis");
                System.out.println("---------------------------------------------");
            }
        }, 1_000, 1_000);

        int PARALLEL_THREADS = 100;
        // start
        for (int i = 0; i < PARALLEL_THREADS; i++) {
            Thread thread = new Thread(() -> {
                while (true) {
                    try (com.codahale.metrics.Timer.Context ctx = latencyTimer.time()) {
                        if (bucket.tryConsume(1)) {
                            consumptionRate.mark();
                        }
                    } catch (Throwable t) {
                        logger.error("Failed to consume tokens from bucket", t);
                    }
                }
            });
            thread.setName("Bucket consumer " + i);
            thread.start();
        }

        Thread.currentThread().join();
    }

    @Test
    public void benchmarkAsyncBucket() throws InterruptedException {
        Meter consumptionRate = new Meter();
        com.codahale.metrics.Timer latencyTimer = buildLatencyTimer();

        HazelcastProxyManager<String> proxyManager = new HazelcastProxyManager<>(map, ClientSideConfig.getDefault());
        BucketConfiguration configuration = BucketConfiguration.builder()
                .addLimit(
                        Bandwidth.simple(10, Duration.ofSeconds(1)).withInitialTokens(0))
                .build();

        AsyncBucketProxy bucket = proxyManager.asAsync().builder()
                .withOptimization(Optimizations.batching())
                .build("13", configuration);

        // We need a backpressure for ougoing work because it obviously that OOM can be happen in asycnhrouous bucket mode
        // when tasks incoming rate is greater then Hazelcast can process
        Semaphore semaphore = new Semaphore(20_00); // no more then 20_000 throttling requests in progress

        Timer statLogTimer = new Timer();
        statLogTimer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("Consumption rate " + consumptionRate.getOneMinuteRate() + " tokens/sec");
                System.out.println("Operations with bucket rate " + latencyTimer.getOneMinuteRate() + " ops/sec");
                Snapshot snapshot = latencyTimer.getSnapshot();
                System.out.println(
                        "Operations with bucket latency:" +
                        " mean=" + TimeUnit.NANOSECONDS.toMicros((long) snapshot.getMean()) + "micros" +
                        " median=" + TimeUnit.NANOSECONDS.toMicros((long)snapshot.getMedian()) + "micros" +
                        " max=" + TimeUnit.NANOSECONDS.toMillis(snapshot.getMax()) + "millis" +
                        " current_requests_in_progress=" + semaphore.availablePermits()
                );
                System.out.println("---------------------------------------------");
            }
        }, 1_000, 1_000);

        int PARALLEL_THREADS = 4;
        // start
        for (int i = 0; i < PARALLEL_THREADS; i++) {
            Thread thread = new Thread(() -> {
                while (true) {
                    try {
                        semaphore.acquire();
                        long currentTimeNanos = System.nanoTime();
                        bucket.tryConsume(1).whenComplete((consumed, error) -> {
                            long latencyNanos = System.nanoTime() - currentTimeNanos;
                            semaphore.release();
                            latencyTimer.update(latencyNanos, TimeUnit.NANOSECONDS);
                            if (error != null) {
                               logger.error("Failed to consume tokens from bucket", error);
                               return;
                            }
                            if (consumed) {
                               consumptionRate.mark();
                            }
                        });
                    } catch (Throwable t) {
                        semaphore.release();
                        logger.error("Failed to consume tokens from bucket", t);
                    }
                }
            });
            thread.setName("Bucket consumer " + i);
            thread.start();
        }

        Thread.currentThread().join();
    }

    private com.codahale.metrics.Timer buildLatencyTimer() {
        RollingHdrHistogram histogram = RollingHdrHistogram.builder()
                .withSignificantDigits(2)
                .resetReservoirPeriodicallyByChunks(Duration.ofSeconds(60), 3)
                .withHighestTrackableValue(1_000_000_000_000L, OverflowResolver.REDUCE_TO_HIGHEST_TRACKABLE)
                .build();
        return Dropwizard.toTimer(histogram);
    }

}


text:
#import "SNSResponse.h"
#import "../AmazonServiceExceptionUnmarshaller.h"

#import "SNSNotFoundException.h"
#import "SNSAuthorizationErrorException.h"
#import "SNSInternalErrorException.h"
#import "SNSInvalidParameterException.h"

/**
 * Add Permission
 */
@interface SNSAddPermissionResponse:SNSResponse
{
}

@end


text:
/* eslint-disable @typescript-eslint/naming-convention */

import * as Platform from '../../core/platform/platform.js';
import * as SDK from '../../core/sdk/sdk.js';
import type * as Protocol from '../../generated/protocol.js';

import {RecordType, TimelineData} from './TimelineModel.js';

import {TracingLayerTree, type TracingLayerPayload, type TracingLayerTile} from './TracingLayerTree.js';

export class TimelineFrameModel {
  private readonly categoryMapper: (arg0: SDK.TracingModel.Event) => string;
  private frames!: TimelineFrame[];
  private frameById!: {
    [x: number]: TimelineFrame,
  };
  private beginFrameQueue!: TimelineFrameBeginFrameQueue;
  private minimumRecordTime!: number;
  private lastFrame!: TimelineFrame|null;
  private mainFrameCommitted!: boolean;
  private mainFrameRequested!: boolean;
  private lastLayerTree!: TracingFrameLayerTree|null;
  private framePendingActivation!: PendingFrame|null;
  private currentTaskTimeByCategory!: {
    [x: string]: number,
  };
  private target!: SDK.Target.Target|null;
  private framePendingCommit?: PendingFrame|null;
  private lastBeginFrame?: number|null;
  private lastDroppedFrame?: number|null;
  private lastNeedsBeginFrame?: number|null;
  private lastTaskBeginTime?: number|null;
  private layerTreeId?: number|null;
  private currentProcessMainThread?: SDK.TracingModel.Thread|null;

  constructor(categoryMapper: (arg0: SDK.TracingModel.Event) => string) {
    this.categoryMapper = categoryMapper;

    this.reset();
  }

  getFrames(): TimelineFrame[] {
    return this.frames;
  }

  getFramesWithinWindow(startTime: number, endTime: number): TimelineFrame[] {
    const firstFrame =
        Platform.ArrayUtilities.lowerBound(this.frames, startTime || 0, (time, frame) => time - frame.endTime);
    const lastFrame =
        Platform.ArrayUtilities.lowerBound(this.frames, endTime || Infinity, (time, frame) => time - frame.startTime);
    return this.frames.slice(firstFrame, lastFrame);
  }

  hasRasterTile(rasterTask: SDK.TracingModel.Event): boolean {
    const data = rasterTask.args['tileData'];
    if (!data) {
      return false;
    }
    const frameId = data['sourceFrameNumber'];
    const frame = frameId && this.frameById[frameId];
    if (!frame || !frame.layerTree) {
      return false;
    }
    return true;
  }

  rasterTilePromise(rasterTask: SDK.TracingModel.Event): Promise<{
    rect: Protocol.DOM.Rect,
    snapshot: SDK.PaintProfiler.PaintProfilerSnapshot,
  }|null> {
    if (!this.target) {
      return Promise.resolve(null);
    }
    const data = rasterTask.args['tileData'];
    const frameId = (data['sourceFrameNumber'] as number);
    const tileId = data['tileId'] && data['tileId']['id_ref'];
    const frame = frameId && this.frameById[frameId];
    if (!frame || !frame.layerTree || !tileId) {
      return Promise.resolve(null);
    }

    return frame.layerTree.layerTreePromise().then(layerTree => layerTree && layerTree.pictureForRasterTile(tileId));
  }

  reset(): void {
    this.minimumRecordTime = Infinity;
    this.frames = [];
    this.frameById = {};
    this.beginFrameQueue = new TimelineFrameBeginFrameQueue();
    this.lastFrame = null;
    this.lastLayerTree = null;
    this.mainFrameCommitted = false;
    this.mainFrameRequested = false;
    this.framePendingCommit = null;
    this.lastBeginFrame = null;
    this.lastDroppedFrame = null;
    this.lastNeedsBeginFrame = null;
    this.framePendingActivation = null;
    this.lastTaskBeginTime = null;
    this.target = null;
    this.layerTreeId = null;
    this.currentTaskTimeByCategory = {};
  }

  handleBeginFrame(startTime: number, seqId: number): void {
    if (!this.lastFrame) {
      this.startFrame(startTime);
    }
    this.lastBeginFrame = startTime;

    this.beginFrameQueue.addFrameIfNotExists(seqId, startTime, false, false);
  }

  handleDroppedFrame(startTime: number, seqId: number, isPartial: boolean): void {
    if (!this.lastFrame) {
      this.startFrame(startTime);
    }

    // This line handles the case where no BeginFrame event is issued for
    // the dropped frame. In this situation, add a BeginFrame to the queue
    // as if it actually occurred.
    this.beginFrameQueue.addFrameIfNotExists(seqId, startTime, true, isPartial);
    this.beginFrameQueue.setDropped(seqId, true);
    this.beginFrameQueue.setPartial(seqId, isPartial);
  }

  handleDrawFrame(startTime: number, seqId: number): void {
    if (!this.lastFrame) {
      this.startFrame(startTime);
      return;
    }

    // - if it wasn't drawn, it didn't happen!
    // - only show frames that either did not wait for the main thread frame or had one committed.
    if (this.mainFrameCommitted || !this.mainFrameRequested) {
      if (this.lastNeedsBeginFrame) {
        const idleTimeEnd = this.framePendingActivation ? this.framePendingActivation.triggerTime :
                                                          (this.lastBeginFrame || this.lastNeedsBeginFrame);
        if (idleTimeEnd > this.lastFrame.startTime) {
          this.lastFrame.idle = true;
          this.lastBeginFrame = null;
        }
        this.lastNeedsBeginFrame = null;
      }

      const framesToVisualize = this.beginFrameQueue.processPendingBeginFramesOnDrawFrame(seqId);

      // Visualize the current frame and all pending frames before it.
      for (const frame of framesToVisualize) {
        const isLastFrameIdle = this.lastFrame.idle;

        // If |frame| is the first frame after an idle period, the CPU time
        // will be logged ("committed") under |frame| if applicable.
        this.startFrame(frame.startTime);
        if (isLastFrameIdle && this.framePendingActivation) {
          this.commitPendingFrame();
        }
        if (frame.isDropped) {
          this.lastFrame.dropped = true;
        }
        if (frame.isPartial) {
          this.lastFrame.isPartial = true;
        }
      }
    }
    this.mainFrameCommitted = false;
  }

  handleActivateLayerTree(): void {
    if (!this.lastFrame) {
      return;
    }
    if (this.framePendingActivation && !this.lastNeedsBeginFrame) {
      this.commitPendingFrame();
    }
  }

  handleRequestMainThreadFrame(): void {
    if (!this.lastFrame) {
      return;
    }
    this.mainFrameRequested = true;
  }

  handleCompositeLayers(): void {
    if (!this.framePendingCommit) {
      return;
    }
    this.framePendingActivation = this.framePendingCommit;
    this.framePendingCommit = null;
    this.mainFrameRequested = false;
    this.mainFrameCommitted = true;
  }

  handleLayerTreeSnapshot(layerTree: TracingFrameLayerTree): void {
    this.lastLayerTree = layerTree;
  }

  handleNeedFrameChanged(startTime: number, needsBeginFrame: boolean): void {
    if (needsBeginFrame) {
      this.lastNeedsBeginFrame = startTime;
    }
  }

  private startFrame(startTime: number): void {
    if (this.lastFrame) {
      this.flushFrame(this.lastFrame, startTime);
    }
    this.lastFrame = new TimelineFrame(startTime, startTime - this.minimumRecordTime);
  }

  private flushFrame(frame: TimelineFrame, endTime: number): void {
    frame.setLayerTree(this.lastLayerTree);
    frame.setEndTime(endTime);
    if (this.lastLayerTree) {
      this.lastLayerTree.setPaints(frame.paints);
    }
    const lastFrame = this.frames[this.frames.length - 1];
    if (this.frames.length && lastFrame && (frame.startTime !== lastFrame.endTime || frame.startTime > frame.endTime)) {
      console.assert(
          false, `Inconsistent frame time for frame ${this.frames.length} (${frame.startTime} - ${frame.endTime})`);
    }
    this.frames.push(frame);
    if (typeof frame.mainFrameId === 'number') {
      this.frameById[frame.mainFrameId] = frame;
    }
  }

  private commitPendingFrame(): void {
    if (!this.framePendingActivation || !this.lastFrame) {
      return;
    }

    this.lastFrame.addTimeForCategories(this.framePendingActivation.timeByCategory);
    this.lastFrame.paints = this.framePendingActivation.paints;
    this.lastFrame.mainFrameId = this.framePendingActivation.mainFrameId;
    this.framePendingActivation = null;
  }

  addTraceEvents(target: SDK.Target.Target|null, events: SDK.TracingModel.Event[], threadData: {
    thread: SDK.TracingModel.Thread,
    time: number,
  }[]): void {
    this.target = target;
    let j = 0;
    this.currentProcessMainThread = threadData.length && threadData[0].thread || null;
    for (let i = 0; i < events.length; ++i) {
      while (j + 1 < threadData.length && threadData[j + 1].time <= events[i].startTime) {
        this.currentProcessMainThread = threadData[++j].thread;
      }
      this.addTraceEvent(events[i]);
    }
    this.currentProcessMainThread = null;
  }

  private addTraceEvent(event: SDK.TracingModel.Event): void {
    if (event.startTime && event.startTime < this.minimumRecordTime) {
      this.minimumRecordTime = event.startTime;
    }

    if (event.name === RecordType.SetLayerTreeId) {
      this.layerTreeId = event.args['layerTreeId'] || event.args['data']['layerTreeId'];
    } else if (
        event.id && event.phase === SDK.TracingModel.Phase.SnapshotObject &&
        event.name === RecordType.LayerTreeHostImplSnapshot && Number(event.id) === this.layerTreeId && this.target) {
      const snapshot = (event as SDK.TracingModel.ObjectSnapshot);
      this.handleLayerTreeSnapshot(new TracingFrameLayerTree(this.target, snapshot));
    } else {
      this.processCompositorEvents(event);
      if (event.thread === this.currentProcessMainThread) {
        this.addMainThreadTraceEvent(event);
      } else if (this.lastFrame && event.selfTime && !SDK.TracingModel.TracingModel.isTopLevelEvent(event)) {
        this.lastFrame.addTimeForCategory(this.categoryMapper(event), event.selfTime);
      }
    }
  }

  private processCompositorEvents(event: SDK.TracingModel.Event): void {
    if (event.args['layerTreeId'] !== this.layerTreeId) {
      return;
    }

    const timestamp = event.startTime;
    if (event.name === RecordType.BeginFrame) {
      this.handleBeginFrame(timestamp, event.args['frameSeqId']);
    } else if (event.name === RecordType.DrawFrame) {
      this.handleDrawFrame(timestamp, event.args['frameSeqId']);
    } else if (event.name === RecordType.ActivateLayerTree) {
      this.handleActivateLayerTree();
    } else if (event.name === RecordType.RequestMainThreadFrame) {
      this.handleRequestMainThreadFrame();
    } else if (event.name === RecordType.NeedsBeginFrameChanged) {
      this.handleNeedFrameChanged(timestamp, event.args['data'] && event.args['data']['needsBeginFrame']);
    } else if (event.name === RecordType.DroppedFrame) {
      this.handleDroppedFrame(timestamp, event.args['frameSeqId'], event.args['hasPartialUpdate']);
    }
  }

  private addMainThreadTraceEvent(event: SDK.TracingModel.Event): void {
    if (SDK.TracingModel.TracingModel.isTopLevelEvent(event)) {
      this.currentTaskTimeByCategory = {};
      this.lastTaskBeginTime = event.startTime;
    }
    if (!this.framePendingCommit && TimelineFrameModel.mainFrameMarkers.indexOf(event.name as RecordType) >= 0) {
      this.framePendingCommit =
          new PendingFrame(this.lastTaskBeginTime || event.startTime, this.currentTaskTimeByCategory);
    }
    if (!this.framePendingCommit) {
      this.addTimeForCategory(this.currentTaskTimeByCategory, event);
      return;
    }
    this.addTimeForCategory(this.framePendingCommit.timeByCategory, event);

    if (event.name === RecordType.BeginMainThreadFrame && event.args['data'] && event.args['data']['frameId']) {
      this.framePendingCommit.mainFrameId = event.args['data']['frameId'];
    }
    if (event.name === RecordType.Paint && event.args['data']['layerId'] && TimelineData.forEvent(event).picture &&
        this.target) {
      this.framePendingCommit.paints.push(new LayerPaintEvent(event, this.target));
    }
    if (event.name === RecordType.CompositeLayers && event.args['layerTreeId'] === this.layerTreeId) {
      this.handleCompositeLayers();
    }
  }

  private addTimeForCategory(
      timeByCategory: {
        [x: string]: number,
      },
      event: SDK.TracingModel.Event): void {
    if (!event.selfTime) {
      return;
    }
    const categoryName = this.categoryMapper(event);
    timeByCategory[categoryName] = (timeByCategory[categoryName] || 0) + event.selfTime;
  }

  private static readonly mainFrameMarkers: RecordType[] = [
    RecordType.ScheduleStyleRecalculation,
    RecordType.InvalidateLayout,
    RecordType.BeginMainThreadFrame,
    RecordType.ScrollLayer,
  ];
}

export class TracingFrameLayerTree {
  private readonly target: SDK.Target.Target;
  private readonly snapshot: SDK.TracingModel.ObjectSnapshot;
  private paintsInternal!: LayerPaintEvent[]|undefined;

  constructor(target: SDK.Target.Target, snapshot: SDK.TracingModel.ObjectSnapshot) {
    this.target = target;
    this.snapshot = snapshot;
  }

  async layerTreePromise(): Promise<TracingLayerTree|null> {
    const result = (await this.snapshot.objectPromise() as unknown as {
      active_tiles: TracingLayerTile[],
      device_viewport_size: {
        width: number,
        height: number,
      },
      active_tree: {
        root_layer: TracingLayerPayload,
        layers: TracingLayerPayload[],
      },
    });
    if (!result) {
      return null;
    }
    const viewport = result['device_viewport_size'];
    const tiles = result['active_tiles'];
    const rootLayer = result['active_tree']['root_layer'];
    const layers = result['active_tree']['layers'];
    const layerTree = new TracingLayerTree(this.target);
    layerTree.setViewportSize(viewport);
    layerTree.setTiles(tiles);

    await layerTree.setLayers(rootLayer, layers, this.paintsInternal || []);
    return layerTree;
  }

  paints(): LayerPaintEvent[] {
    return this.paintsInternal || [];
  }

  setPaints(paints: LayerPaintEvent[]): void {
    this.paintsInternal = paints;
  }
}

export class TimelineFrame {
  startTime: number;
  startTimeOffset: number;
  endTime: number;
  duration: number;
  timeByCategory: {
    [x: string]: number,
  };
  cpuTime: number;
  idle: boolean;
  dropped: boolean;
  isPartial: boolean;
  layerTree: TracingFrameLayerTree|null;
  paints: LayerPaintEvent[];
  mainFrameId: number|undefined;

  constructor(startTime: number, startTimeOffset: number) {
    this.startTime = startTime;
    this.startTimeOffset = startTimeOffset;
    this.endTime = this.startTime;
    this.duration = 0;
    this.timeByCategory = {};
    this.cpuTime = 0;
    this.idle = false;
    this.dropped = false;
    this.isPartial = false;
    this.layerTree = null;
    this.paints = [];
    this.mainFrameId = undefined;
  }

  hasWarnings(): boolean {
    return false;
  }

  setEndTime(endTime: number): void {
    this.endTime = endTime;
    this.duration = this.endTime - this.startTime;
  }

  setLayerTree(layerTree: TracingFrameLayerTree|null): void {
    this.layerTree = layerTree;
  }

  addTimeForCategories(timeByCategory: {
    [x: string]: number,
  }): void {
    for (const category in timeByCategory) {
      this.addTimeForCategory(category, timeByCategory[category]);
    }
  }

  addTimeForCategory(category: string, time: number): void {
    this.timeByCategory[category] = (this.timeByCategory[category] || 0) + time;
    this.cpuTime += time;
  }
}

export class LayerPaintEvent {
  private readonly eventInternal: SDK.TracingModel.Event;
  private readonly target: SDK.Target.Target|null;

  constructor(event: SDK.TracingModel.Event, target: SDK.Target.Target|null) {
    this.eventInternal = event;
    this.target = target;
  }

  layerId(): string {
    return this.eventInternal.args['data']['layerId'];
  }

  event(): SDK.TracingModel.Event {
    return this.eventInternal;
  }

  picturePromise(): Promise<{
    rect: Array<number>,
    serializedPicture: string,
  }|null> {
    const picture = TimelineData.forEvent(this.eventInternal).picture;
    if (!picture) {
      return Promise.resolve(null);
    }

    // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    return picture.objectPromise().then((result: any) => {
      if (!result) {
        return null;
      }
      const rect = result['params'] && result['params']['layer_rect'];
      const picture = result['skp64'];
      return rect && picture ? {rect: rect, serializedPicture: picture} : null;
    });
  }

  async snapshotPromise(): Promise<{
    rect: Array<number>,
    snapshot: SDK.PaintProfiler.PaintProfilerSnapshot,
  }|null> {
    const paintProfilerModel = this.target && this.target.model(SDK.PaintProfiler.PaintProfilerModel);
    const picture = await this.picturePromise();
    if (!picture || !paintProfilerModel) {
      return null;
    }
    const snapshot = await paintProfilerModel.loadSnapshot(picture.serializedPicture);
    return snapshot ? {rect: picture.rect, snapshot: snapshot} : null;
  }
}

export class PendingFrame {
  timeByCategory: {
    [x: string]: number,
  };
  paints: LayerPaintEvent[];
  mainFrameId: number|undefined;
  triggerTime: number;
  constructor(triggerTime: number, timeByCategory: {
    [x: string]: number,
  }) {
    this.timeByCategory = timeByCategory;
    this.paints = [];
    this.mainFrameId = undefined;
    this.triggerTime = triggerTime;
  }
}

// The parameters of an impl-side BeginFrame.
class BeginFrameInfo {
  seqId: number;
  startTime: number;
  isDropped: boolean;
  isPartial: boolean;
  constructor(seqId: number, startTime: number, isDropped: boolean, isPartial: boolean) {
    this.seqId = seqId;
    this.startTime = startTime;
    this.isDropped = isDropped;
    this.isPartial = isPartial;
  }
}

// A queue of BeginFrames pending visualization.
// BeginFrames are added into this queue as they occur; later when their
// corresponding DrawFrames occur (or lack thereof), the BeginFrames are removed
// from the queue and their timestamps are used for visualization.
export class TimelineFrameBeginFrameQueue {
  private queueFrames!: number[];

  // Maps frameSeqId to BeginFrameInfo.
  private mapFrames!: {
    [x: number]: BeginFrameInfo,
  };

  constructor() {
    this.queueFrames = [];
    this.mapFrames = {};
  }

  // Add a BeginFrame to the queue, if it does not already exit.
  addFrameIfNotExists(seqId: number, startTime: number, isDropped: boolean, isPartial: boolean): void {
    if (!(seqId in this.mapFrames)) {
      this.mapFrames[seqId] = new BeginFrameInfo(seqId, startTime, isDropped, isPartial);
      this.queueFrames.push(seqId);
    }
  }

  // Set a BeginFrame in queue as dropped.
  setDropped(seqId: number, isDropped: boolean): void {
    if (seqId in this.mapFrames) {
      this.mapFrames[seqId].isDropped = isDropped;
    }
  }

  setPartial(seqId: number, isPartial: boolean): void {
    if (seqId in this.mapFrames) {
      this.mapFrames[seqId].isPartial = isPartial;
    }
  }

  processPendingBeginFramesOnDrawFrame(seqId: number): BeginFrameInfo[] {
    const framesToVisualize: BeginFrameInfo[] = [];

    // Do not visualize this frame in the rare case where the current DrawFrame
    // does not have a corresponding BeginFrame.
    if (seqId in this.mapFrames) {
      // Pop all BeginFrames before the current frame, and add only the dropped
      // ones in |frames_to_visualize|.
      // Non-dropped frames popped here are BeginFrames that are never
      // drawn (but not considered dropped either for some reason).
      // Those frames do not require an proactive visualization effort and will
      // be naturally presented as continuationss of other frames.
      while (this.queueFrames[0] !== seqId) {
        const currentSeqId = this.queueFrames[0];
        if (this.mapFrames[currentSeqId].isDropped) {
          framesToVisualize.push(this.mapFrames[currentSeqId]);
        }

        delete this.mapFrames[currentSeqId];
        this.queueFrames.shift();
      }

      // Pop the BeginFrame associated with the current DrawFrame.
      framesToVisualize.push(this.mapFrames[seqId]);
      delete this.mapFrames[seqId];
      this.queueFrames.shift();
    }
    return framesToVisualize;
  }
}


text:
@class GSsexView;
@class GSageView;
@class GScityView;
@class GSauthenticationVC;

@class GSchangePassWordVC;

@interface PersonInfoViewController : UIViewController

@property (nonatomic ,strong) GSchangePassWordVC *changePassWordVC;

@property (nonatomic,strong) GSsexView *sexV;
@property (nonatomic,strong) GSageView *ageV;
@property (nonatomic,strong) GScityView *cityV;

@property (nonatomic,strong) GSauthenticationVC *authenticationVC;
@end


text:
PhoneGap
********
PhoneGap is an open source development tool for building fast, easy mobile apps
with JavaScript.

Contents

.. toctree::
   :maxdepth: 1

   links
   issues


text:
\subsection{ANOVA Test}

First of all, ideally, since the block design is highly correlated to trial
design, we might get the collinearity issue in our model, we would like to check
that and keep only either one design that would be good enough for our generalized
linear regression model. To address this question, we apply ANOVA test to figure which
design will be the best candidate. In the null hypothesis, we would like to test
$\widehat{\beta_{block}}$ = 0 or $\widehat{\beta_{trial}}$ = 0, and we would prefer the
model that has the lowest residual sum of square (RSS). The RSSs we obtained from
the ANOVA test are 253183.7, 263744.3, 260204.09 for mixed design, model without
block design, and model without trial design, respectively. Since he mixed design model
has the lowest RSS, we decide to choose the mixed model to do further analysis.

\subsection{Cross Validation}

Since we have already tested the mixed design model with ANOVA, we would like to
apply a 5-folds cross validation (CV) to select a model from the mixed models with
and without discrete cosine transformation (DCT), and we are going to select a model
base on cross validation score, calculated as the mean of squared errors (MSE).
Mean of squared errors (mixed design no dct): 71461.0961108,
Mean of squared errors (mixed design with dct): 191332664.585.
Therefore, the final model we select is the mixed design model without DCT
because its MSE is the lower one.

\subsection{Comparing 2-back and 0-back}

Finally, in the experiment design, we know the 2-back test asks for two letters back,
while 0-back asks for a specified letter. We are interested in find the voxels that responded
differently when performing these two tasks. We fitted our final design models to
both 0-back and 2-back task, and obtained $\hat{\beta}$ from each model. We set the null
hypothesis test for t-test to be $\widehat{\beta_{0-back}}$ - $\widehat{\beta_{2-back}}$ = 0.
We reject the null hypothesis test if the p value is lower than 0.05/133 from Bonferroni
correction. We found only 108 voxels that rejected the null hypothesis, meaning that these
voxels in the brain responded differently when performing 0-back and 2-back tasks.


text:
import { isNone } from '@ember/utils';
import { computed, get } from '@ember/object';
import { A, isArray } from '@ember/array';
import { schedule } from '@ember/runloop';
import joint from 'npm:jointjs';
import $ from 'jquery';
import { forPointerMethodOverrideResizeAndDnd } from '../../../utils/fd-update-coordinate-for-firefox';

export let EmptyView = joint.dia.LinkView.extend({
  updateInputsArray: computed(() => []).readOnly(),

  verticesChanging: false,

  initialize: function() {
    joint.dia.LinkView.prototype.initialize.apply(this, arguments);

    this.$box = $(this.template);
    this.model.inputElements = this.$box;
    this.$el.addClass('linktools-disabled')

    this.setColors();
    this.setButtonStyles();

    this.model.on('change:source', function(element, newSource) {
      let objectModel = this.model.get('objectModel');
      if (objectModel) {
        if (!isNone(newSource.id)) {
          this.$box.css('visibility', 'visible');
          schedule('afterRender', this, function() {
            this.updateBox();
            this.highlight();
          });

          if (this.oldSourceValue) {
            if (!get(this, 'oldSourceValue.connectionPoint.args.coords')) {
              this.oldSourceValue.connectionPoint = { name: 'toPointConnection', args: { coords: this.sourcePoint } };
            }

            if (this.oldSourceValue.id) {
              this.triggerHistoryStep('source', newSource, this.oldSourceValue);
            }

            this.oldSourceValue = undefined;
          }

          objectModel.set('source', newSource);
          objectModel.set('startPoint', this.sourcePoint);
          this.paper.trigger('checkexistelements', objectModel, this, true);
        } else {
          if (!this.oldSourceValue) {
            this.oldSourceValue = this.model.previous('source');
            this.$box.css('visibility', 'hidden');
            this.unhighlight();
          }
        }
      }
    }, this);

    this.model.on('change:target', function(element, newTarget) {
      let objectModel = this.model.get('objectModel');
      if (objectModel) {
        if (!isNone(newTarget.id)) {
          this.$box.css('visibility', 'visible');
          schedule('afterRender', this, function() {
            this.updateBox();
            this.highlight();
          });

          if (this.oldTargetValue) {
            if (!get(this, 'oldTargetValue.connectionPoint.args.coords')) {
              this.oldTargetValue.connectionPoint = { name: 'toPointConnection', args: { coords: this.targetPoint } };
            }

            if (this.oldTargetValue.id) {
              this.triggerHistoryStep('target', newTarget, this.oldTargetValue);
            }

            this.oldTargetValue = undefined;
          }

          objectModel.set('target', newTarget);
          objectModel.set('endPoint', this.targetPoint);
          this.paper.trigger('checkexistelements', objectModel, this, false);
        } else {
          if (!this.oldTargetValue) {
            this.oldTargetValue = this.model.previous('target');
            this.$box.css('visibility', 'hidden');
            this.unhighlight();
          }
        }
      }
    }, this);

    this.model.on('change:vertices', function() {
      if (!this.verticesChanging) {
        this.verticesChanging = true;
        this.$box.css('visibility', 'hidden');
        this.unhighlight();
        if (!this.$el.hasClass('edit-disabled')) {
          this.paper.once('link:pointerup', this._verticesChanged, this);
        } else {
          this.verticesChanging = false;
        }
      }
    }, this);
  },

  updateBox() {
    this.updateInputsWidth(get(this, 'updateInputsArray'));
  },

  updateInputsWidth(inputSelectors) {
    let selectors = isArray(inputSelectors) ? inputSelectors : [inputSelectors];
    let $buffer = this.$box.find('.input-buffer');
    selectors.forEach((selector) => {
      this.updateInputWidth(selector, $buffer);
    }, this);
  },

  updateInputWidth(selector, buffer) {
    buffer = buffer || this.$box.find('.input-buffer');
    let $input = this.$box.find(selector);
    buffer.css('font-weight', $input.css('font-weight'));
    buffer.text($input.val());
    $input.width(buffer.width() + 1);
  },

  getTextColor() {
    const objectModel = this.model.get('objectModel');
    if (!isNone(objectModel)) {
      const textColor = objectModel.get('primitive.DrawStyle.TextColor');
      if (!isNone(textColor)) {
        return 'rgba(' + [textColor.R, textColor.G, textColor.B, textColor.A].join(',') + ')';
      }
    }

    return;
  },

  getBrushColor() {
    const objectModel = this.model.get('objectModel');
    if (!isNone(objectModel)) {
      const brushColor = objectModel.get('primitive.DrawStyle.DrawBrush.Color');
      if (!isNone(brushColor)) {
        return 'rgba(' + [brushColor.R, brushColor.G, brushColor.B, brushColor.A].join(',') + ')';
      }
    }

    return;
  },

  setColors() {
    const textColor = this.getTextColor();
    const brushColor = this.getBrushColor();

    if (!isNone(textColor)) {
      this.model.attr('.connection/stroke', textColor);
    }

    const inputElements = this.model.inputElements;
    if (isArray(inputElements) && (!isNone(textColor) || !isNone(brushColor))) {
      inputElements.each(function(index, input) {
        if (!isNone(textColor)) {
          $(input).find('input, textarea').css('color', textColor);
        }

        if (!isNone(brushColor)) {
          $(input).find('input, textarea').css('background-color', brushColor);
        }
      });
    }
  },

  setButtonStyles() {
    const _this = this;
    const buttons = this.getButtons();
    buttons.forEach(button => {
      let style = {};
      style[`.${get(button, 'name')}`] = get(button, 'attrs.element');
      style[`.${get(button, 'name')}>circle`] = get(button, 'attrs.circle');
      style[`.${get(button, 'name')}>text`] = get(button, 'attrs.text');
      _this.model.attr(style);
    });
  },

  pointerdblclick: function(evt, x, y) {
    let readonly = this.paper.options.interactive;
    if (!isNone(readonly) && typeof readonly === 'object') {
      this._setVerticesValue();
      this.addVertex(x, y);
      this.paper.off('link:pointerup', this._verticesChanged, this);
      this._verticesChanged();
      this._checkVerticesChanges();
    }
  },

  getButtons() {
    if (this.paper) {
      let readonly = this.paper.options.interactive;
      if (!readonly && typeof readonly !== 'object') {
        return A();
      }
    }

    return A([{
      name: 'remove-button',
      text: '&#xe827',
      title: window.i18n.t('components.fd-diagram-editing-panel.remove-button-title').string,
      handler: this.removeLink.bind(this),
      attrs: {
        'element': { atConnectionRatio: .2 },
        'circle': { r: 6, fill: '#007aff', stroke: '#007aff', 'stroke-width': 1, 'cursor': 'pointer' },
        'text': { fill: '#ffffff','font-size': 8, 'text-anchor': 'middle', x: 0, y: 2, 'font-family': 'fd-icons', visibility: 'visible', 'cursor': 'pointer' },
      }
    },  {
      name: 'color-button',
      text: '&#xf1fc',
      title: window.i18n.t('components.fd-diagram-editing-panel.color-button-title').string,
      handler: this.changeColorElement.bind(this),
      attrs: {
        'element': { atConnectionRatio: .3 },
        'circle': { r: 6, fill: '#007aff', stroke: '#007aff', 'stroke-width': 1 },
        'text': { fill: '#ffffff','font-size': 7, 'text-anchor': 'middle', x: 0, y: 2, 'font-family': 'Icons', visibility: 'visible', 'cursor': 'pointer' },
      }
    }]);
  },

  removeLink(e) {
    e.stopPropagation();
    const linkJson = JSON.stringify(this.model.get('objectModel'));
    this.triggerHistoryStep('Delete', null, linkJson);
    this.model.remove();
  },

  changeColorElement(e) {
    e.stopPropagation();
    this.paper.trigger('element:openpopup', this, $(e.currentTarget));
  },

  /**
    Update coordinates for FF.
  */
  pointerdown(evt, x, y) {
    this._setVerticesValue();
    let readonly = this.paper.options.interactive;
    if (readonly && typeof readonly === 'object') {
      $(this.paper.el).find('input,textarea').addClass('click-disabled');
    }

    let coordinates = forPointerMethodOverrideResizeAndDnd(evt, x, y);
    joint.dia.LinkView.prototype.pointerdown.apply(this, [evt, coordinates.x, coordinates.y]);
  },

  pointermove(evt, x, y) {
    let coordinates = forPointerMethodOverrideResizeAndDnd(evt, x, y);
    joint.dia.LinkView.prototype.pointermove.apply(this, [evt, coordinates.x, coordinates.y]);
  },

  pointerup(evt, x, y) {
    this._checkVerticesChanges();
    let readonly = this.paper.options.interactive;
    if (readonly && typeof readonly === 'object') {
      $(this.paper.el).find('input,textarea').removeClass('click-disabled');
    }

    let coordinates = forPointerMethodOverrideResizeAndDnd(evt, x, y);
    joint.dia.LinkView.prototype.pointerup.apply(this, [evt, coordinates.x, coordinates.y]);
  },

  triggerHistoryStep(propName, newValue, oldValue) {
    let changes = A();

    const objectModel = this.model.get('objectModel');
    changes.addObject({ field: propName, oldValue: oldValue || objectModel.get(propName), newValue: newValue });
    this.model.graph.trigger('history:add', this.model.get('id'), changes);
  },

  _setVerticesValue() {
    this.needStepOnConnect = true;
    const objectModel = this.model.get('objectModel');
    this.oldVerticesValue = {
      vertices: objectModel.get('vertices'),
      source: objectModel.get('source'),
      target: objectModel.get('target'),
      endPoint: objectModel.get('endPoint'),
      startPoint: objectModel.get('startPoint')
    };
  },

  _checkVerticesChanges() {
    const objectModel = this.model.get('objectModel');
    const oldObjectModel = this.oldVerticesValue;
    const vertices = objectModel.get('vertices');
    if (JSON.stringify(oldObjectModel.vertices) !== JSON.stringify(vertices)) {
      this.triggerHistoryStep('vertices', vertices, oldObjectModel.vertices);
    }

    /*if (JSON.stringify(oldObjectModel.source) !== JSON.stringify(objectModel.get('source')) ||
      JSON.stringify(oldObjectModel.startPoint) !== JSON.stringify(objectModel.get('startPoint'))) {
        let changes = A();

        const objectModel = this.model.get('objectModel');
        changes.addObject({ field: 'source', oldValue: oldObjectModel.source, newValue: objectModel.get('source') });
        changes.addObject({ field: 'startPoint', oldValue: oldObjectModel.startPoint, newValue: objectModel.get('startPoint') });
        this.model.graph.trigger('history:add', this.model.get('id'), changes);
    }

    if (JSON.stringify(oldObjectModel.target) !== JSON.stringify(objectModel.get('target')) ||
      JSON.stringify(oldObjectModel.endPoint) !== JSON.stringify(objectModel.get('endPoint'))) {
        let changes = A();

        const objectModel = this.model.get('objectModel');
        changes.addObject({ field: 'target', oldValue: oldObjectModel.target, newValue: objectModel.get('target') });
        changes.addObject({ field: 'endPoint', oldValue: oldObjectModel.endPoint, newValue: objectModel.get('endPoint') });
        this.model.graph.trigger('history:add', this.model.get('id'), changes);
    }*/
  },

  _verticesChanged() {
    this.verticesChanging = false;
    this.$box.css('visibility', 'visible');
    schedule('afterRender', this, function() {
      this.updateBox();
      this.highlight();
    });
  }
});


text:
package com.vmware.vim25;

/**
@author Steve Jin (sjin@vmware.com)
*/

public class EventFilterSpec extends DynamicData
{
  public EventFilterSpecByEntity entity;
  public EventFilterSpecByTime time;
  public EventFilterSpecByUsername userName;
  public Integer eventChainId;
  public ManagedObjectReference alarm;
  public ManagedObjectReference scheduledTask;
  public Boolean disableFullMessage;
  public String[] category;
  public String[] type;
  public String[] tag;
  public String[] eventTypeId;

  public EventFilterSpecByEntity getEntity()
  {
    return this.entity;
  }

  public EventFilterSpecByTime getTime()
  {
    return this.time;
  }

  public EventFilterSpecByUsername getUserName()
  {
    return this.userName;
  }

  public Integer getEventChainId()
  {
    return this.eventChainId;
  }

  public ManagedObjectReference getAlarm()
  {
    return this.alarm;
  }

  public ManagedObjectReference getScheduledTask()
  {
    return this.scheduledTask;
  }

  public Boolean getDisableFullMessage()
  {
    return this.disableFullMessage;
  }

  public String[] getCategory()
  {
    return this.category;
  }

  public String[] getType()
  {
    return this.type;
  }

  public String[] getTag()
  {
    return this.tag;
  }

  public String[] getEventTypeId()
  {
    return this.eventTypeId;
  }

  public void setEntity(EventFilterSpecByEntity entity)
  {
    this.entity=entity;
  }

  public void setTime(EventFilterSpecByTime time)
  {
    this.time=time;
  }

  public void setUserName(EventFilterSpecByUsername userName)
  {
    this.userName=userName;
  }

  public void setEventChainId(Integer eventChainId)
  {
    this.eventChainId=eventChainId;
  }

  public void setAlarm(ManagedObjectReference alarm)
  {
    this.alarm=alarm;
  }

  public void setScheduledTask(ManagedObjectReference scheduledTask)
  {
    this.scheduledTask=scheduledTask;
  }

  public void setDisableFullMessage(Boolean disableFullMessage)
  {
    this.disableFullMessage=disableFullMessage;
  }

  public void setCategory(String[] category)
  {
    this.category=category;
  }

  public void setType(String[] type)
  {
    this.type=type;
  }

  public void setTag(String[] tag)
  {
    this.tag=tag;
  }

  public void setEventTypeId(String[] eventTypeId)
  {
    this.eventTypeId=eventTypeId;
  }
}